5#ifndef V8_HEAP_FACTORY_INL_H_
6#define V8_HEAP_FACTORY_INL_H_
32#define ROOT_ACCESSOR(Type, name, CamelName) \
33 Handle<Type> Factory::name() { \
34 return Handle<Type>(&isolate()->roots_table()[RootIndex::k##CamelName]); \
40 requires(std::is_convertible_v<Handle<T>, Handle<String>>)
44 if (IsInternalizedString(*
string))
return string;
65 if (IsInternalizedString(*
string))
return string;
86template <
typename T,
template <
typename>
typename HandleType>
87 requires(std::is_convertible_v<HandleType<T>, HandleType<String>>)
90 if (begin == 0 &&
end == str->length())
return str;
91 return NewProperSubString(str, begin,
end);
106 map->is_dictionary_map()
108 allocation_site, new_js_object_type)
119template <ExternalPo
interTag tag>
128 foreign->init_foreign_address<tag>(
isolate(), addr);
134 MessageTemplate::kURIMalformed);
153 DCHECK(IsInterpreterData(*interpreter_data) ||
154 IsBytecodeArray(*interpreter_data));
155 interpreter_data_ = interpreter_data;
161 if (!IsUndefined(number_string_cache()->get(hash * 2),
isolate()) &&
162 !
isolate()->MemorySaverModeEnabled()) {
164 if (number_string_cache()->
length() != full_size) {
167 isolate()->
heap()->set_number_string_cache(*new_cache);
173 cache->set(hash * 2, *number);
174 cache->set(hash * 2 + 1, *js_string);
183 (IsHeapNumber(
key) && IsHeapNumber(number) &&
187 return undefined_value();
MaybeHandle< String > NewStringFromOneByte(base::Vector< const uint8_t > string, AllocationType allocation=AllocationType::kYoung)
Tagged< HeapObject > AllocateRawWithImmortalMap(int size, AllocationType allocation, Tagged< Map > map, AllocationAlignment alignment=kTaggedAligned)
Handle< FixedArray > NewFixedArray(int length, AllocationType allocation=AllocationType::kYoung)
CodeBuilder & set_source_position_table(Handle< TrustedByteArray > table)
CodeBuilder & set_interpreter_data(Handle< TrustedObject > interpreter_data)
CodeBuilder & set_empty_source_position_table()
ReadOnlyRoots read_only_roots() const
Isolate * isolate() const
V8_INLINE void NumberToStringCacheSet(DirectHandle< Object > number, int hash, DirectHandle< String > js_string)
Handle< Name > InternalizeName(Handle< T > name)
Handle< Foreign > NewForeign(Address addr, AllocationType allocation_type=AllocationType::kYoung)
V8_INLINE HeapAllocator * allocator() const
DirectHandle< Object > NewURIError()
V8_INLINE Handle< Object > NumberToStringCacheGet(Tagged< Object > number, int hash)
Handle< JSArray > NewJSArrayWithElements(DirectHandle< FixedArrayBase > elements, ElementsKind elements_kind, int length, AllocationType allocation=AllocationType::kYoung)
Handle< String > InternalizeString(base::Vector< const char > str, bool convert_encoding=false)
Handle< String > NewStringFromStaticChars(const char(&str)[N], AllocationType allocation=AllocationType::kYoung)
Handle< JSObject > NewJSObjectFromMap(DirectHandle< Map > map, AllocationType allocation=AllocationType::kYoung, DirectHandle< AllocationSite > allocation_site=DirectHandle< AllocationSite >::null(), NewJSObjectType=NewJSObjectType::kNoAPIWrapper)
Handle< JSObject > NewError(DirectHandle< JSFunction > constructor, DirectHandle< String > message, DirectHandle< Object > options={})
Handle< JSObject > NewSlowJSObjectFromMap(DirectHandle< Map > map, int number_of_slow_properties, AllocationType allocation=AllocationType::kYoung, DirectHandle< AllocationSite > allocation_site=DirectHandle< AllocationSite >::null(), NewJSObjectType=NewJSObjectType::kNoAPIWrapper)
Handle< JSObject > NewFastOrSlowJSObjectFromMap(DirectHandle< Map > map, int number_of_slow_properties, AllocationType allocation=AllocationType::kYoung, DirectHandle< AllocationSite > allocation_site=DirectHandle< AllocationSite >::null(), NewJSObjectType=NewJSObjectType::kNoAPIWrapper)
HandleType< String > NewSubString(HandleType< T > str, uint32_t begin, uint32_t end)
HeapAllocator * allocator()
int MaxNumberToStringCacheSize() const
StringTable * string_table() const
v8::internal::Factory * factory()
static const int kInitialCapacity
DirectHandle< String > LookupString(Isolate *isolate, DirectHandle< String > key)
#define ROOT_ACCESSOR(Type, name, CamelName)
Vector< const uint8_t > StaticOneByteVector(const char(&array)[N])
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
constexpr int kMaxRegularHeapObjectSize
V8_INLINE IndirectHandle< T > indirect_handle(DirectHandle< T > handle)
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in name
bool IsUniqueName(Tagged< Name > obj)
template const char * string
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
#define MUTABLE_ROOT_LIST(V)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)