40template <
typename Impl>
41template <AllocationType allocation>
44 Tagged<Map> map = read_only_roots().heap_number_map();
62template <
typename Impl>
67 int size = map->instance_size();
68 return handle(NewStructInternal(roots, map, size, allocation),
isolate());
71template <
typename Impl>
81template <
typename Impl>
85 int size = map->instance_size();
89 code->init_self_indirect_pointer(
isolate());
90 code->initialize_flags(options.kind, options.is_context_specialized,
91 options.is_turbofanned);
92 code->set_builtin_id(options.builtin);
93 code->set_instruction_size(options.instruction_size);
94 code->set_metadata_size(options.metadata_size);
95 code->set_inlined_bytecode_size(options.inlined_bytecode_size);
96 code->set_osr_offset(options.osr_offset);
98 options.osr_offset.IsNone());
99 code->set_handler_table_offset(options.handler_table_offset);
100 code->set_constant_pool_offset(options.constant_pool_offset);
101 code->set_code_comments_offset(options.code_comments_offset);
102 code->set_builtin_jump_table_info_offset(
103 options.builtin_jump_table_info_offset);
104 code->set_unwinding_info_offset(options.unwinding_info_offset);
105 code->set_parameter_count(options.parameter_count);
106#ifdef V8_ENABLE_LEAPTIERING
112 DCHECK(options.deoptimization_data.is_null());
114 *options.bytecode_or_interpreter_data.ToHandleChecked();
115 DCHECK(IsBytecodeArray(data) || IsInterpreterData(data));
116 code->set_bytecode_or_interpreter_data(data);
118 DCHECK(options.bytecode_or_interpreter_data.is_null());
119 code->set_deoptimization_data(
120 *options.deoptimization_data.ToHandleChecked());
122 DCHECK(options.deoptimization_data.is_null());
123 DCHECK(options.bytecode_or_interpreter_data.is_null());
124 code->clear_deoptimization_data_and_interpreter_data();
129 DCHECK(options.source_position_table.is_null());
130 code->set_bytecode_offset_table(
131 *options.bytecode_offset_table.ToHandleChecked());
133 DCHECK(options.bytecode_offset_table.is_null());
135 if (options.source_position_table.ToHandle(&table)) {
136 code->set_source_position_table(*table);
138 code->clear_source_position_table_and_bytecode_offset_table();
141 DCHECK(options.bytecode_offset_table.is_null());
142 code->set_source_position_table(
143 *options.source_position_table.ToHandleChecked());
148 if (options.instruction_stream.ToHandle(&istream)) {
150 code->SetInstructionStreamAndInstructionStart(
isolate(), *istream);
154 code->SetInstructionStartForOffHeapBuiltin(
isolate(),
155 options.instruction_start);
158 wrapper->set_code(code);
159 code->set_wrapper(*wrapper);
161 code->clear_padding();
165template <
typename Impl>
174 wrapper->clear_code();
178template <
typename Impl>
184template <
typename Impl>
192 if (length == 0)
return empty_trusted_fixed_array();
196template <
typename Impl>
199 if (length == 0)
return empty_protected_fixed_array();
203template <
typename Impl>
209 return NewFixedArrayWithFiller(map, length, undefined_value(), allocation);
212template <
typename Impl>
216 if (length == 0)
return impl()->empty_fixed_array();
217 return NewFixedArrayWithFiller(fixed_array_map(), length, the_hole_value(),
221template <
typename Impl>
231 array->set_length(length);
236template <
typename Impl>
240 if (length == 0)
return impl()->empty_fixed_array();
242 FATAL(
"Invalid FixedArray size %d", length);
246 result->set_map_after_allocation(
249 array->set_length(length);
254template <
typename Impl>
260template <
typename Impl>
272 array->set_length(length);
274 read_only_roots().undefined_value(), length);
279template <
typename Impl>
285template <
typename Impl>
290 if (length == 0)
return empty_trusted_weak_fixed_array();
294template <
typename Impl>
299 if (length == 0)
return empty_protected_weak_fixed_array();
303template <
typename Impl>
309template <
typename Impl>
312 if (length == 0)
return empty_trusted_byte_array();
316template <
typename Impl>
322template <
typename Impl>
328template <
typename Impl>
330 int length,
const uint8_t* raw_bytecodes,
int frame_size,
337 FATAL(
"Fatal JavaScript invalid size error %d", length);
343 size, allocation, read_only_roots().bytecode_array_map());
346 instance->init_self_indirect_pointer(
isolate());
347 instance->set_length(length);
348 instance->set_frame_size(frame_size);
350 instance->set_max_arguments(max_arguments);
351 instance->set_incoming_new_target_or_generator_register(
354 instance->set_handler_table(*handler_table);
356 instance->set_wrapper(*wrapper);
357 CopyBytes(
reinterpret_cast<uint8_t*
>(instance->GetFirstBytecodeAddress()),
358 raw_bytecodes, length);
359 instance->clear_padding();
360 wrapper->set_bytecode(instance);
364template <
typename Impl>
372 read_only_roots().bytecode_wrapper_map(), allocation)),
378 wrapper->clear_bytecode();
382template <
typename Impl>
386 return NewScriptWithId(source,
isolate()->GetNextScriptId(),
390template <
typename Impl>
394 DCHECK(IsString(*source) || IsUndefined(*source));
402 raw->set_source(*source);
404 raw->set_id(script_id);
405 raw->set_line_offset(0);
406 raw->set_column_offset(0);
410 raw->set_eval_from_shared_or_wrapped_arguments(roots.undefined_value(),
412 raw->set_eval_from_position(0);
415 raw->set_host_defined_options(roots.empty_fixed_array(),
418 raw->set_compiled_lazy_function_positions(roots.undefined_value(),
420#ifdef V8_SCRIPTORMODULE_LEGACY_LIFETIME
421 raw->set_script_or_modules(roots.empty_array_list());
424 impl()->ProcessNewScript(script, script_event_type);
428template <
typename Impl>
436 read_only_roots().sloppy_arguments_elements_map()));
443 result->set_context(*context, write_barrier_mode);
444 result->set_arguments(*arguments, write_barrier_mode);
448template <
typename Impl>
454template <
typename Impl>
464 shared->SetScript(
isolate(), read_only_roots(), *script,
469template <
typename Impl>
472 Tagged<Map> map = read_only_roots().shared_function_info_map();
478 shared->clear_padding();
479 shared->CopyFrom(*other,
isolate());
484template <
typename Impl>
488 Tagged<Map> map = read_only_roots().shared_function_info_wrapper_map();
492 wrapper->set_shared_info(*sfi);
497template <
typename Impl>
499 int children_length) {
504 result->set_data_length(data_length);
505 result->set_children_length(children_length);
512template <
typename Impl>
516 int32_t end_position) {
517 return TorqueGeneratedFactory<Impl>::NewUncompiledDataWithoutPreparseData(
521template <
typename Impl>
524 Handle<String> inferred_name, int32_t start_position, int32_t end_position,
526 return TorqueGeneratedFactory<Impl>::NewUncompiledDataWithPreparseData(
527 inferred_name, start_position, end_position, preparse_data,
531template <
typename Impl>
535 int32_t end_position) {
536 return TorqueGeneratedFactory<Impl>::
537 NewUncompiledDataWithoutPreparseDataWithJob(inferred_name, start_position,
542template <
typename Impl>
545 Handle<String> inferred_name, int32_t start_position, int32_t end_position,
547 return TorqueGeneratedFactory<Impl>::NewUncompiledDataWithPreparseDataAndJob(
548 inferred_name, start_position, end_position, preparse_data,
kNullAddress,
552template <
typename Impl>
563 bool has_shared_name = maybe_name.
ToHandle(&shared_name);
564 if (has_shared_name) {
565 DCHECK(shared_name->IsFlat());
573 if (maybe_function_data.
ToHandle(&function_data)) {
577 DCHECK(!IsInstructionStream(*function_data));
578 DCHECK(!IsCode(*function_data));
579 if (IsExposedTrustedObject(*function_data)) {
582 raw->SetUntrustedData(*function_data);
585 raw->set_builtin_id(builtin);
587 DCHECK(raw->HasBuiltinId());
588 DCHECK_EQ(Builtin::kIllegal, raw->builtin_id());
591 raw->CalculateConstructAsBuiltin();
599 raw->DontAdaptArguments();
602 raw->set_length(len);
606 raw->builtin_id(), raw->length(),
607 raw->internal_formal_parameter_count_with_receiver()));
614template <
typename Impl>
619 bool has_seen_proto) {
621 isolate(), boilerplate, all_properties, index_keys, has_seen_proto,
625template <
typename Impl>
629 auto result = NewStructInternal<ArrayBoilerplateDescription>(
632 result->set_elements_kind(elements_kind);
633 result->set_constant_elements(*constant_values);
637template <
typename Impl>
643 wrapper->clear_data();
647template <
typename Impl>
652 auto result = NewStructInternal<RegExpBoilerplateDescription>(
656 result->set_source(*source);
657 result->set_flags(flags.value());
661template <
typename Impl>
666 DCHECK_EQ(raw_strings->length(), cooked_strings->length());
668 auto result = NewStructInternal<TemplateObjectDescription>(
671 result->set_raw_strings(*raw_strings);
672 result->set_cooked_strings(*cooked_strings);
676template <
typename Impl>
678 int slot_count,
int create_closure_slot_count,
AllocationType allocation) {
683 size, allocation, read_only_roots().feedback_metadata_map()));
684 result->set_slot_count(slot_count);
685 result->set_create_closure_slot_count(create_closure_slot_count);
690 memset(
reinterpret_cast<uint8_t*
>(data_start), 0, data_size);
696template <
typename Impl>
699 const int slot_count =
static_cast<int>(slots.size());
702 Tagged<Map> map = read_only_roots().coverage_info_map();
705 info->set_slot_count(slot_count);
706 for (
int i = 0;
i < slot_count;
i++) {
708 info->InitializeSlot(
i, range.start, range.end);
713template <
typename Impl>
717 uint8_t buffer[] = {
static_cast<uint8_t
>(c1),
static_cast<uint8_t
>(c2)};
720 uint16_t buffer[] = {c1, c2};
724template <
typename Impl>
725template <
class StringTableKey>
752template <
typename Impl>
757 return InternalizeStringWithKey(&
key);
760template <
typename Impl>
765 return InternalizeStringWithKey(&
key);
768template <
typename Impl>
772 AllocateRawOneByteInternalizedString(str.
length(), raw_hash_field);
781template <
typename Impl>
785 AllocateRawTwoByteInternalizedString(str.
length(), raw_hash_field);
794template <
typename Impl>
799 AllocateRawOneByteInternalizedString(str.
length(), raw_hash_field);
807template <
typename Impl>
808template <
typename SeqStringT>
811 DCHECK(SeqStringT::IsCompatibleMap(map, read_only_roots()));
813 RefineAllocationTypeForInPlaceInternalizableString(
814 allocation, map) == allocation);
819 int size = SeqStringT::SizeFor(length);
825 string->clear_padding_destructively(length);
826 string->set_length(length);
832template <
typename Impl>
835 Tagged<Map> map = read_only_roots().seq_one_byte_string_map();
836 return NewRawStringWithMap<SeqOneByteString>(
838 RefineAllocationTypeForInPlaceInternalizableString(allocation, map));
841template <
typename Impl>
844 Tagged<Map> map = read_only_roots().seq_two_byte_string_map();
845 return NewRawStringWithMap<SeqTwoByteString>(
847 RefineAllocationTypeForInPlaceInternalizableString(allocation, map));
850template <
typename Impl>
853 return NewRawStringWithMap<SeqOneByteString>(
854 length, read_only_roots().shared_seq_one_byte_string_map(),
858template <
typename Impl>
861 return NewRawStringWithMap<SeqTwoByteString>(
862 length, read_only_roots().shared_seq_two_byte_string_map(),
866template <
typename Impl>
867template <
template <
typename>
typename HandleType>
870 HandleType<String> left, HandleType<String> right,
872 if (IsThinString(*left)) {
875 if (IsThinString(*right)) {
878 uint32_t left_length = left->length();
879 if (left_length == 0)
return right;
880 uint32_t right_length = right->length();
881 if (right_length == 0)
return left;
883 uint32_t length = left_length + right_length;
886 uint16_t c1 = left->Get(0,
isolate());
887 uint16_t c2 = right->Get(0,
isolate());
888 return MakeOrFindTwoCharacterString(c1, c2);
897 bool left_is_one_byte = left->IsOneByteRepresentation();
898 bool right_is_one_byte = right->IsOneByteRepresentation();
899 bool is_one_byte = left_is_one_byte && right_is_one_byte;
910 HandleType<SeqOneByteString>
result =
911 NewRawOneByteString(length, allocation).ToHandleChecked();
914 uint8_t* dest =
result->GetChars(no_gc, access_guard);
918 left->template GetDirectStringChars<uint8_t>(no_gc, access_guard);
924 right->template GetDirectStringChars<uint8_t>(no_gc, access_guard);
925 CopyChars(dest + left_length, src, right_length);
930 HandleType<SeqTwoByteString>
result =
931 NewRawTwoByteString(length, allocation).ToHandleChecked();
942 return NewConsString(left, right, length, is_one_byte, allocation);
945template <
typename Impl>
948 int length,
bool one_byte,
950 DCHECK(!IsThinString(*left));
951 DCHECK(!IsThinString(*right));
956 one_byte ? NewWithImmortalMap(
957 read_only_roots().cons_one_byte_string_map(), allocation)
958 : NewWithImmortalMap(
959 read_only_roots().cons_two_byte_string_map(), allocation));
964 result->set_length(length);
965 result->set_first(*left, mode);
966 result->set_second(*right, mode);
970template <
typename Impl>
977 uint16_t buffer[] = {code};
981template <
typename Impl>
985 int length =
string.length();
986 if (length == 0)
return empty_string();
987 if (length == 1)
return LookupSingleCharacterStringFromCode(
string[0]);
990 NewRawOneByteString(
string.
length(), allocation));
999 string.begin(), length);
1004template <
typename Impl>
1006 std::string_view
string,
1018template <
typename Impl>
1022 if (
IsSmi(*number))
return SmiToString(
Cast<Smi>(*number), mode);
1033template <
typename Impl>
1038 : impl()->NumberToStringCacheHash(value);
1041 Handle<Object> cached = impl()->NumberToStringCacheGet(*number, hash);
1048 }
else if (std::isnan(value)) {
1051 char arr[kNumberToStringBufferSize];
1054 result = StringViewToString(
this,
string, mode);
1057 impl()->NumberToStringCacheSet(number, hash,
result);
1062template <
typename Impl>
1067 : impl()->NumberToStringCacheHash(number);
1070 Handle<Object> cached = impl()->NumberToStringCacheGet(number, hash);
1078 char arr[kNumberToStringBufferSize];
1081 result = StringViewToString(
this,
string, mode);
1090 static_assert(Smi::kMaxValue <= std::numeric_limits<uint32_t>::max());
1095 number.value() >= 0) {
1097 static_cast<uint32_t
>(number.value()), raw->length());
1098 raw->set_raw_hash_field(raw_hash_field);
1104template <
typename Impl>
1108 FATAL(
"Fatal JavaScript invalid size error %d", length);
1115 bigint->clear_padding();
1119template <
typename Impl>
1125 size, type, read_only_roots().scope_info_map());
1127 MemsetTagged(scope_info->data_start(), read_only_roots().undefined_value(),
1129#if TAGGED_SIZE_8_BYTES
1130 scope_info->set_optional_padding(0);
1135template <
typename Impl>
1142template <
typename Impl>
1145 Tagged<Map> map = read_only_roots().shared_function_info_map();
1150 shared->Init(read_only_roots(),
isolate()->GetAndIncNextUniqueSfiId());
1154template <
typename Impl>
1159 DCHECK_LT(0, number_of_all_descriptors);
1162 size, allocation, read_only_roots().descriptor_array_map());
1172 if (
heap->incremental_marking()->IsMajorMarking()) {
1178 array->Initialize(read_only_roots().empty_enum_cache(),
1180 slack, raw_gc_state);
1184template <
typename Impl>
1187 auto result = NewStructInternal<ClassPositions>(CLASS_POSITIONS_TYPE,
1194template <
typename Impl>
1197 int length, uint32_t raw_hash_field) {
1200 DCHECK_IMPLIES(length == 0, !impl()->EmptyStringRootIsInitialized());
1202 Tagged<Map> map = read_only_roots().internalized_one_byte_string_map();
1205 RefineAllocationTypeForInPlaceInternalizableString(
1212 answer->clear_padding_destructively(length);
1213 answer->set_length(length);
1214 answer->set_raw_hash_field(raw_hash_field);
1219template <
typename Impl>
1222 int length, uint32_t raw_hash_field) {
1226 Tagged<Map> map = read_only_roots().internalized_two_byte_string_map();
1231 RefineAllocationTypeForInPlaceInternalizableString(
1235 answer->clear_padding_destructively(length);
1236 answer->set_length(length);
1237 answer->set_raw_hash_field(raw_hash_field);
1242template <
typename Impl>
1247 isolate()->
heap()->AsHeap()->MaxRegularHeapObjectSize(allocation)) &&
1248 v8_flags.use_marking_progress_bar) {
1256template <
typename Impl>
1260 FATAL(
"Fatal JavaScript invalid size error %d", length);
1266template <
typename Impl>
1270 FATAL(
"Fatal JavaScript invalid size error %d", capacity);
1276template <
typename Impl>
1279 return AllocateRawWithImmortalMap(map->instance_size(), allocation, map);
1282template <
typename Impl>
1296template <
typename Impl>
1299 return impl()->AllocateRaw(size, allocation, alignment);
1302template <
typename Impl>
1308 if (capacity == 0) {
1310 read_only_roots().address_at(RootIndex::kEmptySwissPropertyDictionary),
1313 return empty_swiss_property_dictionary();
1317 FATAL(
"Fatal JavaScript invalid size error %d", capacity);
1323 impl()->NewByteArray(meta_table_length, allocation);
1325 Tagged<Map> map = read_only_roots().swiss_name_dictionary_map();
1328 AllocateRawWithImmortalMap(size, allocation, map));
1330 table->Initialize(
isolate(), *meta_table, capacity);
1334template <
typename Impl>
1337 return NewSwissNameDictionaryWithCapacity(
1341template <
typename Impl>
1344 auto function_template_rare_data =
1345 NewStructInternal<FunctionTemplateRareData>(
1348 function_template_rare_data->set_c_function_overloads(
1353template <
typename Impl>
1356 InstanceType instance_type = from_string_map->instance_type();
1358 switch (instance_type) {
1361 map = internalized_two_byte_string_map();
1365 map = internalized_one_byte_string_map();
1369 map = external_internalized_two_byte_string_map();
1373 map = external_internalized_one_byte_string_map();
1382template <
typename Impl>
1387 InstanceType instance_type = string_map->instance_type();
1395 return impl()->AllocationTypeForInPlaceInternalizableString();
1398#ifdef V8_ENABLE_LEAPTIERING
1399template <
typename Impl>
1402 JSDispatchTable::Space* space) {
1405 return jdt->TryAllocateAndInitializeEntry(space,
parameter_count, *code);
1417 FactoryBase<LocalFactory>;
1425 DirectHandle<String> right,
1433 DirectHandle<String> right,
#define SBXCHECK_IMPLIES(when, then)
#define SLOW_DCHECK(condition)
static const uint16_t kMaxChar
constexpr T * begin() const
static DirectHandle< ArrayList > New(IsolateT *isolate, int capacity, AllocationType allocation=AllocationType::kYoung)
static const uint32_t kMaxLength
static uint32_t SizeFor(uint32_t length)
static constexpr bool IsBuiltinId(Builtin builtin)
static bool CheckFormalParameterCount(Builtin builtin, int function_length, int formal_parameter_count_with_receiver)
static Handle< ByteArray > New(IsolateT *isolate, int capacity, AllocationType allocation=AllocationType::kYoung)
static const int kMaxLength
static constexpr int SizeFor(int length)
static const uint32_t kMinLength
static int SizeFor(int slot_count)
static constexpr RawGCStateType GetFullyMarkedState(unsigned epoch, DescriptorIndex number_of_descriptors)
static constexpr RawGCStateType kInitialGCState
static constexpr int SizeFor(int number_of_all_descriptors)
MaybeHandle< String > NewStringFromOneByte(base::Vector< const uint8_t > string, AllocationType allocation=AllocationType::kYoung)
V8_WARN_UNUSED_RESULT Handle< String > NumberToString(DirectHandle< Object > number, NumberCacheMode mode=NumberCacheMode::kBoth)
Tagged< HeapObject > AllocateRawWithImmortalMap(int size, AllocationType allocation, Tagged< Map > map, AllocationAlignment alignment=kTaggedAligned)
Tagged< HeapObject > AllocateRawFixedArray(int length, AllocationType allocation)
DirectHandle< RegExpBoilerplateDescription > NewRegExpBoilerplateDescription(DirectHandle< RegExpData > data, DirectHandle< String > source, Tagged< Smi > flags)
DirectHandle< UncompiledDataWithPreparseDataAndJob > NewUncompiledDataWithPreparseDataAndJob(Handle< String > inferred_name, int32_t start_position, int32_t end_position, Handle< PreparseData >)
Handle< SharedFunctionInfo > NewSharedFunctionInfo(AllocationType allocation)
Handle< WeakFixedArray > NewWeakFixedArrayWithMap(Tagged< Map > map, int length, AllocationType allocation=AllocationType::kYoung)
DirectHandle< RegExpDataWrapper > NewRegExpDataWrapper()
Handle< AccessorPair > NewAccessorPair()
Handle< String > MakeOrFindTwoCharacterString(uint16_t c1, uint16_t c2)
DirectHandle< FunctionTemplateRareData > NewFunctionTemplateRareData()
Handle< SharedFunctionInfo > CloneSharedFunctionInfo(DirectHandle< SharedFunctionInfo > other)
V8_WARN_UNUSED_RESULT HandleType< String >::MaybeType NewConsString(HandleType< String > left, HandleType< String > right, AllocationType allocation=AllocationType::kYoung)
Handle< String > NewStringFromAsciiChecked(const char *str, AllocationType allocation=AllocationType::kYoung)
DirectHandle< SeqOneByteString > NewOneByteInternalizedStringFromTwoByte(base::Vector< const base::uc16 > str, uint32_t raw_hash_field)
Tagged< HeapObject > NewWithImmortalMap(Tagged< Map > map, AllocationType allocation)
Tagged< HeapObject > AllocateRaw(int size, AllocationType allocation, AllocationAlignment alignment=kTaggedAligned)
V8_WARN_UNUSED_RESULT Handle< String > SmiToString(Tagged< Smi > number, NumberCacheMode mode=NumberCacheMode::kBoth)
Handle< ArrayBoilerplateDescription > NewArrayBoilerplateDescription(ElementsKind elements_kind, DirectHandle< FixedArrayBase > constant_values)
DirectHandle< DeoptimizationLiteralArray > NewDeoptimizationLiteralArray(int length)
Tagged< HeapObject > AllocateRawArray(int size, AllocationType allocation)
DirectHandle< DeoptimizationFrameTranslation > NewDeoptimizationFrameTranslation(int length)
Handle< Code > NewCode(const NewCodeOptions &options)
Handle< String > LookupSingleCharacterStringFromCode(uint16_t code)
V8_WARN_UNUSED_RESULT MaybeHandle< SeqOneByteString > NewRawOneByteString(int length, AllocationType allocation=AllocationType::kYoung)
Handle< TemplateObjectDescription > NewTemplateObjectDescription(DirectHandle< FixedArray > raw_strings, DirectHandle< FixedArray > cooked_strings)
Handle< FixedArray > NewFixedArrayWithMap(DirectHandle< Map > map, int length, AllocationType allocation=AllocationType::kYoung)
Handle< ProtectedFixedArray > NewProtectedFixedArray(int length)
Handle< SwissNameDictionary > NewSwissNameDictionary(int at_least_space_for=kSwissNameDictionaryInitialCapacity, AllocationType allocation=AllocationType::kYoung)
Handle< ScopeInfo > NewScopeInfo(int length, AllocationType type=AllocationType::kOld)
Handle< TrustedFixedArray > NewTrustedFixedArray(int length, AllocationType allocation=AllocationType::kTrusted)
V8_WARN_UNUSED_RESULT Handle< String > HeapNumberToString(DirectHandle< HeapNumber > number, double value, NumberCacheMode mode=NumberCacheMode::kBoth)
Handle< ByteArray > NewByteArray(int length, AllocationType allocation=AllocationType::kYoung)
Handle< PreparseData > NewPreparseData(int data_length, int children_length)
Handle< Script > NewScriptWithId(DirectHandle< UnionOf< String, Undefined > > source, int script_id, ScriptEventType event_type=ScriptEventType::kCreate)
MaybeHandle< SeqStringT > NewRawStringWithMap(int length, Tagged< Map > map, AllocationType allocation)
Tagged< HeapObject > AllocateRawWeakArrayList(int length, AllocationType allocation)
DirectHandle< BytecodeWrapper > NewBytecodeWrapper(AllocationType allocation=AllocationType::kOld)
Handle< String > InternalizeString(base::Vector< const uint8_t > string, bool convert_encoding=false)
DirectHandle< SourceTextModuleInfo > NewSourceTextModuleInfo()
Handle< DescriptorArray > NewDescriptorArray(int number_of_descriptors, int slack=0, AllocationType allocation=AllocationType::kYoung)
DirectHandle< UncompiledDataWithoutPreparseData > NewUncompiledDataWithoutPreparseData(Handle< String > inferred_name, int32_t start_position, int32_t end_position)
Handle< SharedFunctionInfo > NewSharedFunctionInfoForLiteral(FunctionLiteral *literal, DirectHandle< Script > script, bool is_toplevel)
DirectHandle< CodeWrapper > NewCodeWrapper()
Handle< FreshlyAllocatedBigInt > NewBigInt(uint32_t length, AllocationType allocation=AllocationType::kYoung)
Handle< SeqOneByteString > NewOneByteInternalizedString(base::Vector< const uint8_t > str, uint32_t raw_hash_field)
MaybeDirectHandle< Map > GetInPlaceInternalizedStringMap(Tagged< Map > from_string_map)
Handle< ObjectBoilerplateDescription > NewObjectBoilerplateDescription(int boilerplate, int all_properties, int index_keys, bool has_seen_proto)
Handle< SeqOneByteString > AllocateRawOneByteInternalizedString(int length, uint32_t raw_hash_field)
V8_WARN_UNUSED_RESULT MaybeHandle< SeqOneByteString > NewRawSharedOneByteString(int length)
DirectHandle< SloppyArgumentsElements > NewSloppyArgumentsElements(int length, DirectHandle< Context > context, DirectHandle< FixedArray > arguments, AllocationType allocation=AllocationType::kYoung)
DirectHandle< ArrayList > NewArrayList(int size, AllocationType allocation=AllocationType::kYoung)
Handle< WeakFixedArray > NewWeakFixedArray(int length, AllocationType allocation=AllocationType::kYoung)
Handle< FixedArray > NewFixedArrayWithHoles(int length, AllocationType allocation=AllocationType::kYoung)
DirectHandle< SharedFunctionInfoWrapper > NewSharedFunctionInfoWrapper(DirectHandle< SharedFunctionInfo > sfi)
AllocationType RefineAllocationTypeForInPlaceInternalizableString(AllocationType allocation, Tagged< Map > string_map)
Handle< BytecodeArray > NewBytecodeArray(int length, const uint8_t *raw_bytecodes, int frame_size, uint16_t parameter_count, uint16_t max_arguments, DirectHandle< TrustedFixedArray > constant_pool, DirectHandle< TrustedByteArray > handler_table, AllocationType allocation=AllocationType::kTrusted)
DirectHandle< UncompiledDataWithoutPreparseDataWithJob > NewUncompiledDataWithoutPreparseDataWithJob(Handle< String > inferred_name, int32_t start_position, int32_t end_position)
Handle< FixedArrayBase > NewFixedDoubleArray(int length, AllocationType allocation=AllocationType::kYoung)
V8_WARN_UNUSED_RESULT MaybeHandle< SeqTwoByteString > NewRawTwoByteString(int length, AllocationType allocation=AllocationType::kYoung)
Handle< Struct > NewStruct(InstanceType type, AllocationType allocation=AllocationType::kYoung)
V8_WARN_UNUSED_RESULT MaybeHandle< SeqTwoByteString > NewRawSharedTwoByteString(int length)
Handle< Script > NewScript(DirectHandle< UnionOf< String, Undefined > > source, ScriptEventType event_type=ScriptEventType::kCreate)
Handle< ClassPositions > NewClassPositions(int start, int end)
Handle< FixedArray > NewFixedArrayWithFiller(DirectHandle< Map > map, int length, DirectHandle< HeapObject > filler, AllocationType allocation)
Handle< ProtectedWeakFixedArray > NewProtectedWeakFixedArray(int length)
Handle< TrustedWeakFixedArray > NewTrustedWeakFixedArray(int length)
Handle< SeqTwoByteString > NewTwoByteInternalizedString(base::Vector< const base::uc16 > str, uint32_t raw_hash_field)
Handle< FixedArray > NewFixedArray(int length, AllocationType allocation=AllocationType::kYoung)
Handle< SeqTwoByteString > AllocateRawTwoByteInternalizedString(int length, uint32_t raw_hash_field)
Handle< FeedbackMetadata > NewFeedbackMetadata(int slot_count, int create_closure_slot_count, AllocationType allocation=AllocationType::kOld)
DirectHandle< FixedArray > NewFixedArrayWithZeroes(int length, AllocationType allocation=AllocationType::kYoung)
Handle< SwissNameDictionary > NewSwissNameDictionaryWithCapacity(int capacity, AllocationType allocation)
Handle< CoverageInfo > NewCoverageInfo(const ZoneVector< SourceRange > &slots)
Handle< TrustedByteArray > NewTrustedByteArray(int length, AllocationType allocation_type=AllocationType::kTrusted)
Handle< String > InternalizeStringWithKey(StringTableKey *key)
Handle< HeapNumber > NewHeapNumber()
DirectHandle< UncompiledDataWithPreparseData > NewUncompiledDataWithPreparseData(Handle< String > inferred_name, int32_t start_position, int32_t end_position, Handle< PreparseData >)
static constexpr int kMaxLength
static Handle< FixedArray > New(IsolateT *isolate, int capacity, AllocationType allocation=AllocationType::kYoung)
static Handle< FixedArrayBase > New(IsolateT *isolate, int capacity, AllocationType allocation=AllocationType::kYoung)
FunctionKind kind() const
int function_literal_id() const
MaybeHandle< String > GetName(IsolateT *isolate) const
void set_shared_function_info(Handle< SharedFunctionInfo > shared_function_info)
V8_WARN_UNUSED_RESULT V8_INLINE auto CustomAllocateWithRetryOrFail(Function &&Allocate, AllocationType allocation)
static constexpr int kHeaderSize
HeapAllocator * allocator()
IsolateGroup * isolate_group() const
Isolate * shared_space_isolate() const
static V8_INLINE LargePageMetadata * FromHeapObject(Tagged< HeapObject > o)
static Tagged< Map > GetMapFor(ReadOnlyRoots roots, InstanceType type)
V8_WARN_UNUSED_RESULT V8_INLINE bool ToHandle(DirectHandle< S > *out) const
MarkingProgressTracker & marking_progress_tracker()
static constexpr int kEmptyHashField
static Handle< ObjectBoilerplateDescription > New(IsolateT *isolate, int boilerplate, int all_properties, int index_keys, bool has_seen_proto, AllocationType allocation=AllocationType::kYoung)
static int SizeFor(int data_length, int children_length)
static Handle< ProtectedFixedArray > New(IsolateT *isolate, int capacity)
static Handle< ProtectedWeakFixedArray > New(IsolateT *isolate, int capacity)
static V8_EXPORT_PRIVATE bool Contains(Address address)
static constexpr RootIndex SingleCharacterStringIndex(int c)
static constexpr int SizeFor(int length)
static V8_INLINE constexpr int32_t SizeFor(int32_t length)
static V8_INLINE constexpr int32_t SizeFor(int32_t length)
static V8_EXPORT_PRIVATE constexpr Tagged< Smi > const kNoSharedNameSentinel
static void InitFromFunctionLiteral(IsolateT *isolate, FunctionLiteral *lit, bool is_toplevel)
static SharedStringAccessGuardIfNeeded NotNeeded()
static const uint32_t kMinLength
static constexpr Tagged< Smi > FromInt(int value)
static constexpr Tagged< Smi > zero()
static V8_INLINE uint32_t MakeArrayIndexHash(uint32_t value, uint32_t length)
static void WriteToFlat(Tagged< String > source, SinkCharT *sink, uint32_t start, uint32_t length)
static const uint32_t kMaxLength
static const int32_t kMaxOneByteCharCode
static bool IsInPlaceInternalizable(Tagged< String > string)
static constexpr bool IsValidCapacity(int capacity)
static constexpr int MaxCapacity()
static int CapacityFor(int at_least_space_for)
static constexpr int SizeFor(int capacity)
static constexpr int MetaTableSizeFor(int capacity)
static constexpr int SizeFor(int capacity)
static Handle< TrustedByteArray > New(IsolateT *isolate, int capacity, AllocationType allocation_type=AllocationType::kTrusted)
static Handle< TrustedFixedArray > New(IsolateT *isolate, int capacity, AllocationType allocation=AllocationType::kTrusted)
static Handle< TrustedWeakFixedArray > New(IsolateT *isolate, int capacity)
static constexpr int SizeForCapacity(int capacity)
static constexpr int kMaxCapacity
static Handle< WeakFixedArray > New(IsolateT *isolate, int capacity, AllocationType allocation=AllocationType::kYoung, MaybeDirectHandle< Object > initial_value={})
static constexpr Register invalid_value()
#define ASSIGN_RETURN_ON_EXCEPTION(isolate, dst, call)
#define THROW_NEW_ERROR(isolate, call)
#define EXPORT_TEMPLATE_DEFINE(export)
SharedFunctionInfoRef shared
ZoneVector< RpoNumber > & result
FunctionLiteral * literal
V8_INLINE constexpr bool IsInternalizedString(InstanceType instance_type)
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
void CopyBytes(T *dst, const T *src, size_t num_bytes)
constexpr int kMaxRegularHeapObjectSize
SlotTraits::TObjectSlot ObjectSlot
bool DoubleToSmiInteger(double value, int *smi_int_value)
bool IsNumber(Tagged< Object > obj)
MaybeHandle< T > MaybeIndirectHandle
V8_INLINE constexpr bool IsSmi(TaggedImpl< kRefType, StorageType > obj)
V8_INLINE IndirectHandle< T > indirect_handle(DirectHandle< T > handle)
std::string_view IntToStringView(int n, base::Vector< char > buffer)
void MemsetTagged(Tagged_t *start, Tagged< MaybeObject > value, size_t counter)
V8_INLINE DirectHandle< T > direct_handle(Tagged< T > object, Isolate *isolate)
Handle< T > IndirectHandle
constexpr JSDispatchHandle kNullJSDispatchHandle(0)
bool IsShared(Tagged< Object > obj)
constexpr AdaptArguments kDontAdapt
constexpr bool CodeKindMayLackSourcePositionTable(CodeKind kind)
typename detail::FlattenUnionHelper< Union<>, Ts... >::type UnionOf
@ SHARED_SEQ_ONE_BYTE_STRING_TYPE
@ SEQ_ONE_BYTE_STRING_TYPE
@ SHARED_SEQ_TWO_BYTE_STRING_TYPE
@ SHARED_EXTERNAL_TWO_BYTE_STRING_TYPE
@ EXTERNAL_TWO_BYTE_STRING_TYPE
@ SEQ_TWO_BYTE_STRING_TYPE
@ SHARED_EXTERNAL_ONE_BYTE_STRING_TYPE
@ EXTERNAL_ONE_BYTE_STRING_TYPE
void CopyChars(DstType *dst, const SrcType *src, size_t count) V8_NONNULL(1
constexpr bool CodeKindUsesBytecodeOrInterpreterData(CodeKind kind)
V8_EXPORT_PRIVATE FlagValues v8_flags
constexpr int JSParameterCount(int param_count_without_receiver)
std::string_view DoubleToStringView(double v, base::Vector< char > buffer)
uint64_t HashSeed(Isolate *isolate)
static constexpr Address kNullAddress
void MemCopy(void *dest, const void *src, size_t size)
constexpr bool CodeKindUsesDeoptimizationData(CodeKind kind)
constexpr bool CodeKindUsesBytecodeOffsetTable(CodeKind kind)
kInterpreterTrampolineOffset script
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
static constexpr ReleaseStoreTag kReleaseStore
static constexpr AcquireLoadTag kAcquireLoad
#define DCHECK_LE(v1, v2)
#define CHECK_GE(lhs, rhs)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK_NE(v1, v2)
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
#define DCHECK_EQ(v1, v2)
#define DCHECK_GT(v1, v2)
#define V8_EXPORT_PRIVATE