5#ifndef V8_ROOTS_ROOTS_H_
6#define V8_ROOTS_ROOTS_H_
25template <
typename Impl>
32#define STRONG_READ_ONLY_HEAP_NUMBER_ROOT_LIST(V) \
34 V(HeapNumber, nan_value, NanValue) \
35 V(HeapNumber, hole_nan_value, HoleNanValue) \
36 V(HeapNumber, infinity_value, InfinityValue) \
37 V(HeapNumber, minus_zero_value, MinusZeroValue) \
38 V(HeapNumber, minus_infinity_value, MinusInfinityValue) \
39 V(HeapNumber, max_safe_integer, MaxSafeInteger) \
40 V(HeapNumber, max_uint_32, MaxUInt32) \
41 V(HeapNumber, smi_min_value, SmiMinValue) \
42 V(HeapNumber, smi_max_value_plus_one, SmiMaxValuePlusOne)
46#define INTERNALIZED_STRING_LIST_ADAPTER(V, name, ...) V(String, name, name)
49#define EXTRA_IMPORTANT_INTERNALIZED_STRING_ROOT_LIST(V) \
50 EXTRA_IMPORTANT_INTERNALIZED_STRING_LIST_GENERATOR( \
51 INTERNALIZED_STRING_LIST_ADAPTER, V)
54#define STRONG_READ_ONLY_ROOT_LIST(V) \
58 V(Map, free_space_map, FreeSpaceMap) \
59 V(Map, one_pointer_filler_map, OnePointerFillerMap) \
60 V(Map, two_pointer_filler_map, TwoPointerFillerMap) \
61 V(Hole, uninitialized_value, UninitializedValue) \
62 V(Undefined, undefined_value, UndefinedValue) \
63 V(Hole, the_hole_value, TheHoleValue) \
64 V(Null, null_value, NullValue) \
65 V(True, true_value, TrueValue) \
66 V(False, false_value, FalseValue) \
67 EXTRA_IMPORTANT_INTERNALIZED_STRING_ROOT_LIST(V) \
68 V(Map, meta_map, MetaMap) \
69 V(Map, byte_array_map, ByteArrayMap) \
70 V(Map, fixed_array_map, FixedArrayMap) \
71 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \
72 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \
73 V(Map, hash_table_map, HashTableMap) \
74 V(Map, symbol_map, SymbolMap) \
75 V(Map, seq_one_byte_string_map, SeqOneByteStringMap) \
76 V(Map, internalized_one_byte_string_map, InternalizedOneByteStringMap) \
77 V(Map, scope_info_map, ScopeInfoMap) \
78 V(Map, shared_function_info_map, SharedFunctionInfoMap) \
79 V(Map, instruction_stream_map, InstructionStreamMap) \
80 V(Map, cell_map, CellMap) \
81 V(Map, global_property_cell_map, GlobalPropertyCellMap) \
82 V(Map, foreign_map, ForeignMap) \
83 V(Map, heap_number_map, HeapNumberMap) \
84 V(Map, transition_array_map, TransitionArrayMap) \
87 V(Map, feedback_vector_map, FeedbackVectorMap) \
88 V(ScopeInfo, empty_scope_info, EmptyScopeInfo) \
89 V(FixedArray, empty_fixed_array, EmptyFixedArray) \
90 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \
93 V(Hole, arguments_marker, ArgumentsMarker) \
94 V(Hole, exception, Exception) \
95 V(Hole, termination_exception, TerminationException) \
96 V(Hole, optimized_out, OptimizedOut) \
97 V(Hole, stale_register, StaleRegister) \
98 V(Hole, property_cell_hole_value, PropertyCellHoleValue) \
99 V(Hole, hash_table_hole_value, HashTableHoleValue) \
100 V(Hole, promise_hole_value, PromiseHoleValue) \
102 V(Map, script_context_table_map, ScriptContextTableMap) \
103 V(Map, closure_feedback_cell_array_map, ClosureFeedbackCellArrayMap) \
104 V(Map, feedback_metadata_map, FeedbackMetadataArrayMap) \
105 V(Map, array_list_map, ArrayListMap) \
106 V(Map, bigint_map, BigIntMap) \
107 V(Map, object_boilerplate_description_map, ObjectBoilerplateDescriptionMap) \
108 V(Map, bytecode_array_map, BytecodeArrayMap) \
109 V(Map, code_map, CodeMap) \
110 V(Map, coverage_info_map, CoverageInfoMap) \
111 V(Map, dictionary_template_info_map, DictionaryTemplateInfoMap) \
112 V(Map, global_dictionary_map, GlobalDictionaryMap) \
113 V(Map, global_context_side_property_cell_map, \
114 GlobalContextSidePropertyCellMap) \
115 V(Map, many_closures_cell_map, ManyClosuresCellMap) \
116 V(Map, mega_dom_handler_map, MegaDomHandlerMap) \
117 V(Map, module_info_map, ModuleInfoMap) \
118 V(Map, name_dictionary_map, NameDictionaryMap) \
119 V(Map, no_closures_cell_map, NoClosuresCellMap) \
120 V(Map, number_dictionary_map, NumberDictionaryMap) \
121 V(Map, one_closure_cell_map, OneClosureCellMap) \
122 V(Map, ordered_hash_map_map, OrderedHashMapMap) \
123 V(Map, ordered_hash_set_map, OrderedHashSetMap) \
124 V(Map, name_to_index_hash_table_map, NameToIndexHashTableMap) \
125 V(Map, registered_symbol_table_map, RegisteredSymbolTableMap) \
126 V(Map, ordered_name_dictionary_map, OrderedNameDictionaryMap) \
127 V(Map, preparse_data_map, PreparseDataMap) \
128 V(Map, property_array_map, PropertyArrayMap) \
129 V(Map, accessor_info_map, AccessorInfoMap) \
130 V(Map, interceptor_info_map, InterceptorInfoMap) \
131 V(Map, regexp_match_info_map, RegExpMatchInfoMap) \
132 V(Map, regexp_data_map, RegExpDataMap) \
133 V(Map, atom_regexp_data_map, AtomRegExpDataMap) \
134 V(Map, ir_regexp_data_map, IrRegExpDataMap) \
135 V(Map, simple_number_dictionary_map, SimpleNumberDictionaryMap) \
136 V(Map, small_ordered_hash_map_map, SmallOrderedHashMapMap) \
137 V(Map, small_ordered_hash_set_map, SmallOrderedHashSetMap) \
138 V(Map, small_ordered_name_dictionary_map, SmallOrderedNameDictionaryMap) \
139 V(Map, source_text_module_map, SourceTextModuleMap) \
140 V(Map, swiss_name_dictionary_map, SwissNameDictionaryMap) \
141 V(Map, synthetic_module_map, SyntheticModuleMap) \
142 IF_WASM(V, Map, wasm_import_data_map, WasmImportDataMap) \
143 IF_WASM(V, Map, wasm_capi_function_data_map, WasmCapiFunctionDataMap) \
144 IF_WASM(V, Map, wasm_dispatch_table_map, WasmDispatchTableMap) \
145 IF_WASM(V, Map, wasm_exported_function_data_map, \
146 WasmExportedFunctionDataMap) \
147 IF_WASM(V, Map, wasm_internal_function_map, WasmInternalFunctionMap) \
148 IF_WASM(V, Map, wasm_func_ref_map, WasmFuncRefMap) \
149 IF_WASM(V, Map, wasm_js_function_data_map, WasmJSFunctionDataMap) \
150 IF_WASM(V, Map, wasm_null_map, WasmNullMap) \
151 IF_WASM(V, Map, wasm_resume_data_map, WasmResumeDataMap) \
152 IF_WASM(V, Map, wasm_suspender_object_map, WasmSuspenderObjectMap) \
153 IF_WASM(V, Map, wasm_trusted_instance_data_map, WasmTrustedInstanceDataMap) \
154 IF_WASM(V, Map, wasm_type_info_map, WasmTypeInfoMap) \
155 V(Map, weak_fixed_array_map, WeakFixedArrayMap) \
156 V(Map, weak_array_list_map, WeakArrayListMap) \
157 V(Map, ephemeron_hash_table_map, EphemeronHashTableMap) \
158 V(Map, embedder_data_array_map, EmbedderDataArrayMap) \
159 V(Map, weak_cell_map, WeakCellMap) \
160 V(Map, trusted_fixed_array_map, TrustedFixedArrayMap) \
161 V(Map, trusted_weak_fixed_array_map, TrustedWeakFixedArrayMap) \
162 V(Map, trusted_byte_array_map, TrustedByteArrayMap) \
163 V(Map, protected_fixed_array_map, ProtectedFixedArrayMap) \
164 V(Map, protected_weak_fixed_array_map, ProtectedWeakFixedArrayMap) \
165 V(Map, interpreter_data_map, InterpreterDataMap) \
166 V(Map, shared_function_info_wrapper_map, SharedFunctionInfoWrapperMap) \
167 V(Map, trusted_foreign_map, TrustedForeignMap) \
169 V(Map, seq_two_byte_string_map, SeqTwoByteStringMap) \
170 V(Map, cons_two_byte_string_map, ConsTwoByteStringMap) \
171 V(Map, cons_one_byte_string_map, ConsOneByteStringMap) \
172 V(Map, thin_two_byte_string_map, ThinTwoByteStringMap) \
173 V(Map, thin_one_byte_string_map, ThinOneByteStringMap) \
174 V(Map, sliced_two_byte_string_map, SlicedTwoByteStringMap) \
175 V(Map, sliced_one_byte_string_map, SlicedOneByteStringMap) \
176 V(Map, external_two_byte_string_map, ExternalTwoByteStringMap) \
177 V(Map, external_one_byte_string_map, ExternalOneByteStringMap) \
178 V(Map, internalized_two_byte_string_map, InternalizedTwoByteStringMap) \
179 V(Map, external_internalized_two_byte_string_map, \
180 ExternalInternalizedTwoByteStringMap) \
181 V(Map, external_internalized_one_byte_string_map, \
182 ExternalInternalizedOneByteStringMap) \
183 V(Map, uncached_external_internalized_two_byte_string_map, \
184 UncachedExternalInternalizedTwoByteStringMap) \
185 V(Map, uncached_external_internalized_one_byte_string_map, \
186 UncachedExternalInternalizedOneByteStringMap) \
187 V(Map, uncached_external_two_byte_string_map, \
188 UncachedExternalTwoByteStringMap) \
189 V(Map, uncached_external_one_byte_string_map, \
190 UncachedExternalOneByteStringMap) \
191 V(Map, shared_seq_one_byte_string_map, SharedSeqOneByteStringMap) \
192 V(Map, shared_seq_two_byte_string_map, SharedSeqTwoByteStringMap) \
193 V(Map, shared_external_one_byte_string_map, SharedExternalOneByteStringMap) \
194 V(Map, shared_external_two_byte_string_map, SharedExternalTwoByteStringMap) \
195 V(Map, shared_uncached_external_one_byte_string_map, \
196 SharedUncachedExternalOneByteStringMap) \
197 V(Map, shared_uncached_external_two_byte_string_map, \
198 SharedUncachedExternalTwoByteStringMap) \
200 V(Map, undefined_map, UndefinedMap) \
201 V(Map, null_map, NullMap) \
202 V(Map, boolean_map, BooleanMap) \
203 V(Map, hole_map, HoleMap) \
205 V(Map, js_shared_array_map, JSSharedArrayMap) \
206 V(Map, js_atomics_mutex_map, JSAtomicsMutexMap) \
207 V(Map, js_atomics_condition_map, JSAtomicsConditionMap) \
209 V(EnumCache, empty_enum_cache, EmptyEnumCache) \
210 V(PropertyArray, empty_property_array, EmptyPropertyArray) \
211 V(ByteArray, empty_byte_array, EmptyByteArray) \
212 V(ObjectBoilerplateDescription, empty_object_boilerplate_description, \
213 EmptyObjectBoilerplateDescription) \
214 V(ArrayBoilerplateDescription, empty_array_boilerplate_description, \
215 EmptyArrayBoilerplateDescription) \
216 V(ClosureFeedbackCellArray, empty_closure_feedback_cell_array, \
217 EmptyClosureFeedbackCellArray) \
218 V(NumberDictionary, empty_slow_element_dictionary, \
219 EmptySlowElementDictionary) \
220 V(OrderedHashMap, empty_ordered_hash_map, EmptyOrderedHashMap) \
221 V(OrderedHashSet, empty_ordered_hash_set, EmptyOrderedHashSet) \
222 V(FeedbackMetadata, empty_feedback_metadata, EmptyFeedbackMetadata) \
223 V(NameDictionary, empty_property_dictionary, EmptyPropertyDictionary) \
224 V(OrderedNameDictionary, empty_ordered_property_dictionary, \
225 EmptyOrderedPropertyDictionary) \
226 V(SwissNameDictionary, empty_swiss_property_dictionary, \
227 EmptySwissPropertyDictionary) \
228 V(InterceptorInfo, noop_interceptor_info, NoOpInterceptorInfo) \
229 V(ArrayList, empty_array_list, EmptyArrayList) \
230 V(WeakFixedArray, empty_weak_fixed_array, EmptyWeakFixedArray) \
231 V(WeakArrayList, empty_weak_array_list, EmptyWeakArrayList) \
232 V(Cell, invalid_prototype_validity_cell, InvalidPrototypeValidityCell) \
233 V(FeedbackCell, many_closures_cell, ManyClosuresCell) \
234 STRONG_READ_ONLY_HEAP_NUMBER_ROOT_LIST(V) \
236 V(FixedArray, single_character_string_table, SingleCharacterStringTable) \
238 V(Hole, self_reference_marker, SelfReferenceMarker) \
240 V(Hole, basic_block_counters_marker, BasicBlockCountersMarker) \
242 V(ScopeInfo, global_this_binding_scope_info, GlobalThisBindingScopeInfo) \
243 V(ScopeInfo, empty_function_scope_info, EmptyFunctionScopeInfo) \
244 V(ScopeInfo, native_scope_info, NativeScopeInfo) \
245 V(ScopeInfo, shadow_realm_scope_info, ShadowRealmScopeInfo) \
246 V(RegisteredSymbolTable, empty_symbol_table, EmptySymbolTable) \
248 V(ByteArray, hash_seed, HashSeed) \
249 IF_WASM(V, HeapObject, wasm_null_padding, WasmNullPadding) \
250 IF_WASM(V, WasmNull, wasm_null, WasmNull)
256#define TRUSTED_ROOT_LIST(V) \
257 V(TrustedByteArray, empty_trusted_byte_array, EmptyTrustedByteArray) \
258 V(TrustedFixedArray, empty_trusted_fixed_array, EmptyTrustedFixedArray) \
259 V(TrustedWeakFixedArray, empty_trusted_weak_fixed_array, \
260 EmptyTrustedWeakFixedArray) \
261 V(ProtectedFixedArray, empty_protected_fixed_array, \
262 EmptyProtectedFixedArray) \
263 V(ProtectedWeakFixedArray, empty_protected_weak_fixed_array, \
264 EmptyProtectedWeakFixedArray)
266#define BUILTINS_WITH_SFI_LIST_GENERATOR(APPLY, V) \
267 APPLY(V, ProxyRevoke, proxy_revoke) \
268 APPLY(V, AsyncFromSyncIteratorCloseSyncAndRethrow, \
269 async_from_sync_iterator_close_sync_and_rethrow) \
270 APPLY(V, AsyncFunctionAwaitRejectClosure, \
271 async_function_await_reject_closure) \
272 APPLY(V, AsyncFunctionAwaitResolveClosure, \
273 async_function_await_resolve_closure) \
274 APPLY(V, AsyncGeneratorAwaitRejectClosure, \
275 async_generator_await_reject_closure) \
276 APPLY(V, AsyncGeneratorAwaitResolveClosure, \
277 async_generator_await_resolve_closure) \
278 APPLY(V, AsyncGeneratorYieldWithAwaitResolveClosure, \
279 async_generator_yield_with_await_resolve_closure) \
280 APPLY(V, AsyncGeneratorReturnClosedResolveClosure, \
281 async_generator_return_closed_resolve_closure) \
282 APPLY(V, AsyncGeneratorReturnClosedRejectClosure, \
283 async_generator_return_closed_reject_closure) \
284 APPLY(V, AsyncGeneratorReturnResolveClosure, \
285 async_generator_return_resolve_closure) \
286 APPLY(V, AsyncIteratorValueUnwrap, async_iterator_value_unwrap) \
287 APPLY(V, ArrayFromAsyncArrayLikeOnFulfilled, \
288 array_from_async_array_like_on_fulfilled) \
289 APPLY(V, ArrayFromAsyncArrayLikeOnRejected, \
290 array_from_async_array_like_on_rejected) \
291 APPLY(V, ArrayFromAsyncIterableOnFulfilled, \
292 array_from_async_iterable_on_fulfilled) \
293 APPLY(V, ArrayFromAsyncIterableOnRejected, \
294 array_from_async_iterable_on_rejected) \
295 APPLY(V, PromiseCapabilityDefaultResolve, \
296 promise_capability_default_resolve) \
297 APPLY(V, PromiseCapabilityDefaultReject, promise_capability_default_reject) \
298 APPLY(V, PromiseGetCapabilitiesExecutor, promise_get_capabilities_executor) \
299 APPLY(V, PromiseAllSettledResolveElementClosure, \
300 promise_all_settled_resolve_element_closure) \
301 APPLY(V, PromiseAllSettledRejectElementClosure, \
302 promise_all_settled_reject_element_closure) \
303 APPLY(V, PromiseAllResolveElementClosure, \
304 promise_all_resolve_element_closure) \
305 APPLY(V, PromiseAnyRejectElementClosure, promise_any_reject_element_closure) \
306 APPLY(V, PromiseThrowerFinally, promise_thrower_finally) \
307 APPLY(V, PromiseValueThunkFinally, promise_value_thunk_finally) \
308 APPLY(V, PromiseThenFinally, promise_then_finally) \
309 APPLY(V, PromiseCatchFinally, promise_catch_finally) \
310 APPLY(V, ShadowRealmImportValueFulfilled, \
311 shadow_realm_import_value_fulfilled) \
312 APPLY(V, AsyncIteratorPrototypeAsyncDisposeResolveClosure, \
313 async_iterator_prototype_async_dispose_resolve_closure)
315#define BUILTINS_WITH_SFI_ROOTS_LIST_ADAPTER(V, CamelName, underscore_name, \
317 V(SharedFunctionInfo, underscore_name##_shared_fun, CamelName##SharedFun)
319#define BUILTINS_WITH_SFI_ROOTS_LIST(V) \
320 BUILTINS_WITH_SFI_LIST_GENERATOR(BUILTINS_WITH_SFI_ROOTS_LIST_ADAPTER, V)
324#define STRONG_MUTABLE_IMMOVABLE_ROOT_LIST(V) \
325 ACCESSOR_INFO_ROOT_LIST(V) \
327 V(Script, empty_script, EmptyScript) \
329 V(PropertyCell, array_constructor_protector, ArrayConstructorProtector) \
330 V(PropertyCell, no_elements_protector, NoElementsProtector) \
331 V(PropertyCell, mega_dom_protector, MegaDOMProtector) \
332 V(PropertyCell, no_profiling_protector, NoProfilingProtector) \
333 V(PropertyCell, no_undetectable_objects_protector, \
334 NoUndetectableObjectsProtector) \
335 V(PropertyCell, is_concat_spreadable_protector, IsConcatSpreadableProtector) \
336 V(PropertyCell, array_species_protector, ArraySpeciesProtector) \
337 V(PropertyCell, typed_array_length_protector, TypedArrayLengthProtector) \
338 V(PropertyCell, typed_array_species_protector, TypedArraySpeciesProtector) \
339 V(PropertyCell, promise_species_protector, PromiseSpeciesProtector) \
340 V(PropertyCell, regexp_species_protector, RegExpSpeciesProtector) \
341 V(PropertyCell, string_length_protector, StringLengthProtector) \
342 V(PropertyCell, array_iterator_protector, ArrayIteratorProtector) \
343 V(PropertyCell, array_buffer_detaching_protector, \
344 ArrayBufferDetachingProtector) \
345 V(PropertyCell, promise_hook_protector, PromiseHookProtector) \
346 V(PropertyCell, promise_resolve_protector, PromiseResolveProtector) \
347 V(PropertyCell, map_iterator_protector, MapIteratorProtector) \
348 V(PropertyCell, promise_then_protector, PromiseThenProtector) \
349 V(PropertyCell, set_iterator_protector, SetIteratorProtector) \
350 V(PropertyCell, string_iterator_protector, StringIteratorProtector) \
351 V(PropertyCell, string_wrapper_to_primitive_protector, \
352 StringWrapperToPrimitiveProtector) \
353 V(PropertyCell, number_string_not_regexp_like_protector, \
354 NumberStringNotRegexpLikeProtector) \
356 V(FixedArray, string_split_cache, StringSplitCache) \
357 V(FixedArray, regexp_multiple_cache, RegExpMultipleCache) \
358 V(FixedArray, regexp_match_global_atom_cache, RegExpMatchGlobalAtomCache) \
360 V(FixedArray, builtins_constants_table, BuiltinsConstantsTable) \
362 V(SharedFunctionInfo, source_text_module_execute_async_module_fulfilled_sfi, \
363 SourceTextModuleExecuteAsyncModuleFulfilledSFI) \
364 V(SharedFunctionInfo, source_text_module_execute_async_module_rejected_sfi, \
365 SourceTextModuleExecuteAsyncModuleRejectedSFI) \
366 V(SharedFunctionInfo, atomics_mutex_async_unlock_resolve_handler_sfi, \
367 AtomicsMutexAsyncUnlockResolveHandlerSFI) \
368 V(SharedFunctionInfo, atomics_mutex_async_unlock_reject_handler_sfi, \
369 AtomicsMutexAsyncUnlockRejectHandlerSFI) \
370 V(SharedFunctionInfo, atomics_condition_acquire_lock_sfi, \
371 AtomicsConditionAcquireLockSFI) \
372 V(SharedFunctionInfo, async_disposable_stack_on_fulfilled_shared_fun, \
373 AsyncDisposableStackOnFulfilledSharedFun) \
374 V(SharedFunctionInfo, async_disposable_stack_on_rejected_shared_fun, \
375 AsyncDisposableStackOnRejectedSharedFun) \
376 V(SharedFunctionInfo, async_dispose_from_sync_dispose_shared_fun, \
377 AsyncDisposeFromSyncDisposeSharedFun) \
378 BUILTINS_WITH_SFI_ROOTS_LIST(V) \
382#define STRONG_MUTABLE_MOVABLE_ROOT_LIST(V) \
384 V(FixedArray, number_string_cache, NumberStringCache) \
386 V(RegisteredSymbolTable, public_symbol_table, PublicSymbolTable) \
387 V(RegisteredSymbolTable, api_symbol_table, ApiSymbolTable) \
388 V(RegisteredSymbolTable, api_private_symbol_table, ApiPrivateSymbolTable) \
389 V(WeakArrayList, script_list, ScriptList) \
390 V(FixedArray, materialized_objects, MaterializedObjects) \
391 V(WeakArrayList, detached_contexts, DetachedContexts) \
393 V(Object, feedback_vectors_for_profiling_tools, \
394 FeedbackVectorsForProfilingTools) \
395 V(HeapObject, serialized_objects, SerializedObjects) \
396 V(FixedArray, serialized_global_proxy_sizes, SerializedGlobalProxySizes) \
397 V(ArrayList, message_listeners, MessageListeners) \
399 V(HeapObject, current_microtask, CurrentMicrotask) \
401 V(HeapObject, weak_refs_keep_during_job, WeakRefsKeepDuringJob) \
402 V(Object, functions_marked_for_manual_optimization, \
403 FunctionsMarkedForManualOptimization) \
404 V(ArrayList, basic_block_profiling_data, BasicBlockProfilingData) \
405 V(WeakArrayList, shared_wasm_memories, SharedWasmMemories) \
407 V(HeapObject, locals_block_list_cache, DebugLocalsBlockListCache) \
408 IF_WASM(V, HeapObject, active_suspender, ActiveSuspender) \
409 IF_WASM(V, WeakFixedArray, js_to_wasm_wrappers, JSToWasmWrappers) \
410 IF_WASM(V, WeakFixedArray, wasm_canonical_rtts, WasmCanonicalRtts) \
412 V(FunctionTemplateInfo, error_stack_getter_fun_template, \
413 ErrorStackGetterSharedFun) \
414 V(FunctionTemplateInfo, error_stack_setter_fun_template, \
415 ErrorStackSetterSharedFun)
418#define SMI_ROOT_LIST(V) \
419 V(Smi, last_script_id, LastScriptId) \
420 V(Smi, last_debugging_id, LastDebuggingId) \
421 V(Smi, last_stack_trace_id, LastStackTraceId) \
424 V(Smi, next_template_serial_number, NextTemplateSerialNumber) \
425 V(Smi, construct_stub_create_deopt_pc_offset, \
426 ConstructStubCreateDeoptPCOffset) \
427 V(Smi, construct_stub_invoke_deopt_pc_offset, \
428 ConstructStubInvokeDeoptPCOffset) \
429 V(Smi, deopt_pc_offset_after_adapt_shadow_stack, \
430 DeoptPCOffsetAfterAdaptShadowStack) \
431 V(Smi, interpreter_entry_return_pc_offset, InterpreterEntryReturnPCOffset)
434#define INTERNALIZED_STRING_ROOT_LIST(V) \
435 IMPORTANT_INTERNALIZED_STRING_LIST_GENERATOR( \
436 INTERNALIZED_STRING_LIST_ADAPTER, V) \
437 NOT_IMPORTANT_INTERNALIZED_STRING_LIST_GENERATOR( \
438 INTERNALIZED_STRING_LIST_ADAPTER, V)
441#define SYMBOL_ROOT_LIST_ADAPTER(V, name, ...) V(Symbol, name, name)
444#define PRIVATE_SYMBOL_ROOT_LIST(V) \
445 PRIVATE_SYMBOL_LIST_GENERATOR(SYMBOL_ROOT_LIST_ADAPTER, V)
446#define PUBLIC_SYMBOL_ROOT_LIST(V) \
447 PUBLIC_SYMBOL_LIST_GENERATOR(SYMBOL_ROOT_LIST_ADAPTER, V)
448#define WELL_KNOWN_SYMBOL_ROOT_LIST(V) \
449 WELL_KNOWN_SYMBOL_LIST_GENERATOR(SYMBOL_ROOT_LIST_ADAPTER, V)
452#define NAME_FOR_PROTECTOR_ROOT_LIST(V) \
453 INTERNALIZED_STRING_FOR_PROTECTOR_LIST_GENERATOR( \
454 INTERNALIZED_STRING_LIST_ADAPTER, V) \
455 SYMBOL_FOR_PROTECTOR_LIST_GENERATOR(SYMBOL_ROOT_LIST_ADAPTER, V) \
456 PUBLIC_SYMBOL_FOR_PROTECTOR_LIST_GENERATOR(SYMBOL_ROOT_LIST_ADAPTER, V) \
457 WELL_KNOWN_SYMBOL_FOR_PROTECTOR_LIST_GENERATOR(SYMBOL_ROOT_LIST_ADAPTER, V)
461#define ACCESSOR_INFO_ROOT_LIST_ADAPTER(V, name, CamelName, ...) \
462 V(AccessorInfo, name##_accessor, CamelName##Accessor)
465#define ACCESSOR_INFO_ROOT_LIST(V) \
466 ACCESSOR_INFO_LIST_GENERATOR(ACCESSOR_INFO_ROOT_LIST_ADAPTER, V)
468#define READ_ONLY_ROOT_LIST(V) \
469 STRONG_READ_ONLY_ROOT_LIST(V) \
470 INTERNALIZED_STRING_ROOT_LIST(V) \
471 PRIVATE_SYMBOL_ROOT_LIST(V) \
472 PUBLIC_SYMBOL_ROOT_LIST(V) \
473 WELL_KNOWN_SYMBOL_ROOT_LIST(V) \
474 STRUCT_MAPS_LIST(V) \
475 TORQUE_DEFINED_MAP_ROOT_LIST(V) \
476 ALLOCATION_SITE_MAPS_LIST(V) \
477 NAME_FOR_PROTECTOR_ROOT_LIST(V) \
478 DATA_HANDLER_MAPS_LIST(V) \
480 V(Map, external_map, ExternalMap) \
481 V(Map, message_object_map, JSMessageObjectMap)
483#define MUTABLE_ROOT_LIST(V) \
484 STRONG_MUTABLE_IMMOVABLE_ROOT_LIST(V) \
485 STRONG_MUTABLE_MOVABLE_ROOT_LIST(V) \
488#define ROOT_LIST(V) \
489 READ_ONLY_ROOT_LIST(V) \
495#define COUNT_ROOT(...) +1
496#define DECL(type, name, CamelName) k##CamelName,
553#define FOR_PROTECTOR_CHECK(type, name, CamelName) \
554 static_assert(RootIndex::kFirstNameForProtector <= RootIndex::k##CamelName); \
555 static_assert(RootIndex::k##CamelName <= RootIndex::kLastNameForProtector);
557#undef FOR_PROTECTOR_CHECK
559#define ROOT_TYPE_FWD_DECL(Type, name, CamelName) class Type;
561#undef ROOT_TYPE_FWD_DECL
574 template <
typename T>
581#define ROOT_ACCESSOR(Type, name, CamelName) \
582 V8_INLINE IndirectHandle<Type> name();
589 size_t index =
static_cast<size_t>(root_index);
595 size_t index =
static_cast<size_t>(root_index);
601 size_t index =
static_cast<size_t>(root_index);
619 return static_cast<unsigned>(root_index) <=
625 return static_cast<unsigned>(root_index) <=
631 DCHECK_LE(c,
static_cast<unsigned>(RootIndex::klatin1_ff_string) -
632 static_cast<unsigned>(RootIndex::kascii_nul_string));
635 static_cast<unsigned>(RootIndex::kascii_nul_string) + c);
689 size_t index =
static_cast<size_t>(root_index);
722#define ROOT_ACCESSOR(Type, name, CamelName) \
723 V8_INLINE Tagged<Type> name() const; \
724 V8_INLINE Tagged<Type> unchecked_##name() const;
732 void VerifyNameForProtectors();
V8_INLINE Address address_at(RootIndex root_index) const
friend class DeserializerAllocator
V8_INLINE Address first_name_for_protector() const
V8_INLINE Tagged< Object > object_at(RootIndex root_index) const
void InitFromStaticRootsTable(Address cage_base)
MapWord one_pointer_filler_map_word()
Address * read_only_roots_
void Iterate(RootVisitor *visitor)
static constexpr size_t kEntriesCount
V8_INLINE void VerifyNameForProtectorsPages() const
V8_INLINE Tagged< Boolean > boolean_value(bool value) const
V8_INLINE Address last_name_for_protector() const
friend ReadOnlyRoots GetReadOnlyRoots()
V8_INLINE bool IsNameForProtector(Tagged< HeapObject > object) const
V8_INLINE ReadOnlyRoots(Heap *heap)
V8_INLINE ReadOnlyRoots(Address *ro_roots)
V8_INLINE bool is_initialized(RootIndex root_index) const
Address roots_[kEntriesCount]
V8_INLINE IndirectHandle< Object > handle_at(RootIndex root_index)
FullObjectSlot strong_or_read_only_roots_begin() const
static const char * root_names_[kEntriesCount]
Address & operator[](RootIndex root_index)
static constexpr size_t kEntriesCount
IndirectHandle< HeapNumber > FindHeapNumber(double value)
static const char * name(RootIndex root_index)
bool IsRootHandleLocation(Address *handle_location, RootIndex *index) const
Address const & operator[](RootIndex root_index) const
static constexpr int offset_of(RootIndex root_index)
FullObjectSlot smi_roots_begin() const
static constexpr RootIndex SingleCharacterStringIndex(int c)
FullObjectSlot strong_roots_end() const
FullObjectSlot slot(RootIndex root_index)
FullObjectSlot strong_or_read_only_roots_end() const
bool IsRootHandle(IndirectHandle< T > handle, RootIndex *index) const
FullObjectSlot strong_roots_begin() const
FullObjectSlot smi_roots_end() const
static constexpr bool IsReadOnly(RootIndex root_index)
FullObjectSlot read_only_roots_end() const
static constexpr bool IsImmortalImmovable(RootIndex root_index)
FullObjectSlot read_only_roots_begin() const
#define ROOT_ACCESSOR(Type, name, CamelName)
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
ReadOnlyRoots GetReadOnlyRoots()
constexpr int kSystemPointerSize
Handle< T > IndirectHandle
@ kLastImmortalImmovableRoot
@ kFirstBuiltinWithSfiRoot
@ kLastBuiltinWithSfiRoot
@ kFirstJSReceiverMapRoot
@ kImmortalImmovableRootsCount
@ kFirstImmortalImmovableRoot
@ kFirstStrongOrReadOnlyRoot
DECL(type, name, CamelName)
@ kLastStrongOrReadOnlyRoot
#define STRONG_MUTABLE_IMMOVABLE_ROOT_LIST(V)
#define BUILTINS_WITH_SFI_ROOTS_LIST(V)
#define STRONG_MUTABLE_MOVABLE_ROOT_LIST(V)
#define ROOT_TYPE_FWD_DECL(Type, name, CamelName)
#define NAME_FOR_PROTECTOR_ROOT_LIST(V)
#define FOR_PROTECTOR_CHECK(type, name, CamelName)
#define READ_ONLY_ROOT_LIST(V)
#define DCHECK_LE(v1, v2)
#define DCHECK_GE(v1, v2)
#define DCHECK_LT(v1, v2)