chromium/v8/src/heap/factory-inl.h

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_HEAP_FACTORY_INL_H_
#define V8_HEAP_FACTORY_INL_H_

#include "src/common/globals.h"
#include "src/heap/factory.h"

// Clients of this interface shouldn't depend on lots of heap internals.
// Do not include anything from src/heap here!
// TODO(all): Remove the heap-inl.h include below.
#include "src/execution/isolate-inl.h"
#include "src/handles/handles-inl.h"
#include "src/heap/factory-base-inl.h"
#include "src/heap/heap-inl.h"  // For MaxNumberToStringCacheSize.
#include "src/objects/feedback-cell.h"
#include "src/objects/heap-number-inl.h"
#include "src/objects/heap-object.h"
#include "src/objects/objects-inl.h"
#include "src/objects/oddball.h"
#include "src/objects/string-inl.h"
#include "src/objects/string-table-inl.h"
#include "src/strings/string-hasher.h"

namespace v8 {
namespace internal {

#define ROOT_ACCESSOR
MUTABLE_ROOT_LIST()
#undef ROOT_ACCESSOR

template <typename T, typename>
Handle<String> Factory::InternalizeString(Handle<T> string) {}

template <typename T, typename>
Handle<Name> Factory::InternalizeName(Handle<T> name) {}

#ifdef V8_ENABLE_DIRECT_HANDLE
template <typename T, typename>
DirectHandle<String> Factory::InternalizeString(DirectHandle<T> string) {
  // T should be a subtype of String, which is enforced by the second template
  // argument.
  if (IsInternalizedString(*string)) return string;
  return isolate()->string_table()->LookupString(isolate(), string);
}

template <typename T, typename>
DirectHandle<Name> Factory::InternalizeName(DirectHandle<T> name) {
  // T should be a subtype of Name, which is enforced by the second template
  // argument.
  if (IsUniqueName(*name)) return name;
  return isolate()->string_table()->LookupString(isolate(), Cast<String>(name));
}
#endif

template <size_t N>
Handle<String> Factory::NewStringFromStaticChars(const char (&str)[N],
                                                 AllocationType allocation) {}

Handle<String> Factory::NewStringFromAsciiChecked(const char* str,
                                                  AllocationType allocation) {}

Handle<String> Factory::NewSubString(Handle<String> str, int begin, int end) {}

Handle<JSArray> Factory::NewJSArrayWithElements(
    DirectHandle<FixedArrayBase> elements, ElementsKind elements_kind,
    AllocationType allocation) {}

Handle<JSObject> Factory::NewFastOrSlowJSObjectFromMap(
    DirectHandle<Map> map, int number_of_slow_properties,
    AllocationType allocation, DirectHandle<AllocationSite> allocation_site,
    NewJSObjectType new_js_object_type) {}

Handle<JSObject> Factory::NewFastOrSlowJSObjectFromMap(DirectHandle<Map> map) {}

template <ExternalPointerTag tag>
Handle<Foreign> Factory::NewForeign(Address addr,
                                    AllocationType allocation_type) {}

Handle<Object> Factory::NewURIError() {}

ReadOnlyRoots Factory::read_only_roots() const {}

HeapAllocator* Factory::allocator() const {}

Factory::CodeBuilder& Factory::CodeBuilder::set_empty_source_position_table() {}

Factory::CodeBuilder& Factory::CodeBuilder::set_interpreter_data(
    Handle<TrustedObject> interpreter_data) {}

void Factory::NumberToStringCacheSet(DirectHandle<Object> number, int hash,
                                     DirectHandle<String> js_string) {}

Handle<Object> Factory::NumberToStringCacheGet(Tagged<Object> number,
                                               int hash) {}

}  // namespace internal
}  // namespace v8

#endif  // V8_HEAP_FACTORY_INL_H_