Commit 747d71e1 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[refactoring] Specify full type in ROOT_LIST

Instead of putting "Foo" as type into the list macro, and
then extending to "type*" at consumer macros, put "Foo*"
into the macro.
This is in preparation for incremental transition to ObjectPtr,
where some roots will return pointer types and others won't.
When that migration is complete, everything will be uniform
(and without "*") again.

Bug: v8:3770
Change-Id: Ib4a9900b1fc6e59f5fc924b779ed7e94dc136ad0
Reviewed-on: https://chromium-review.googlesource.com/c/1285397
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56798}
parent 5c46c24d
...@@ -16,10 +16,11 @@ ...@@ -16,10 +16,11 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
#define ROOT_ACCESSOR(type, name, CamelName) \ // TODO(jkummerow): Drop std::remove_pointer after the migration to ObjectPtr.
Handle<type> Factory::name() { \ #define ROOT_ACCESSOR(Type, name, CamelName) \
return Handle<type>( \ Handle<std::remove_pointer<Type>::type> Factory::name() { \
bit_cast<type**>(&isolate()->roots_table()[RootIndex::k##CamelName])); \ return Handle<std::remove_pointer<Type>::type>(bit_cast<Address*>( \
&isolate()->roots_table()[RootIndex::k##CamelName])); \
} }
ROOT_LIST(ROOT_ACCESSOR) ROOT_LIST(ROOT_ACCESSOR)
#undef ROOT_ACCESSOR #undef ROOT_ACCESSOR
......
...@@ -826,7 +826,9 @@ class V8_EXPORT_PRIVATE Factory { ...@@ -826,7 +826,9 @@ class V8_EXPORT_PRIVATE Factory {
inline Handle<String> Uint32ToString(uint32_t value, bool check_cache = true); inline Handle<String> Uint32ToString(uint32_t value, bool check_cache = true);
#define ROOT_ACCESSOR(type, name, CamelName) inline Handle<type> name(); // TODO(jkummerow): Drop std::remove_pointer after the migration to ObjectPtr.
#define ROOT_ACCESSOR(Type, name, CamelName) \
inline Handle<std::remove_pointer<Type>::type> name();
ROOT_LIST(ROOT_ACCESSOR) ROOT_LIST(ROOT_ACCESSOR)
#undef ROOT_ACCESSOR #undef ROOT_ACCESSOR
......
...@@ -55,15 +55,17 @@ HeapObject* AllocationResult::ToObjectChecked() { ...@@ -55,15 +55,17 @@ HeapObject* AllocationResult::ToObjectChecked() {
return HeapObject::cast(object_); return HeapObject::cast(object_);
} }
#define ROOT_ACCESSOR(type, name, CamelName) \ // TODO(jkummerow): Drop std::remove_pointer after the migration to ObjectPtr.
type* Heap::name() { \ #define ROOT_ACCESSOR(Type, name, CamelName) \
return type::cast(roots_table()[RootIndex::k##CamelName]); \ Type Heap::name() { \
return std::remove_pointer<Type>::type::cast( \
roots_table()[RootIndex::k##CamelName]); \
} }
MUTABLE_ROOT_LIST(ROOT_ACCESSOR) MUTABLE_ROOT_LIST(ROOT_ACCESSOR)
#undef ROOT_ACCESSOR #undef ROOT_ACCESSOR
#define ROOT_ACCESSOR(type, name, CamelName) \ #define ROOT_ACCESSOR(type, name, CamelName) \
void Heap::set_##name(type* value) { \ void Heap::set_##name(type value) { \
/* The deserializer makes use of the fact that these common roots are */ \ /* The deserializer makes use of the fact that these common roots are */ \
/* never in new space and never on a page that is being compacted. */ \ /* never in new space and never on a page that is being compacted. */ \
DCHECK_IMPLIES(deserialization_complete(), \ DCHECK_IMPLIES(deserialization_complete(), \
......
...@@ -651,7 +651,7 @@ class Heap { ...@@ -651,7 +651,7 @@ class Heap {
V8_INLINE RootsTable& roots_table() { return isolate_data_.roots(); } V8_INLINE RootsTable& roots_table() { return isolate_data_.roots(); }
// Heap root getters. // Heap root getters.
#define ROOT_ACCESSOR(type, name, CamelName) inline type* name(); #define ROOT_ACCESSOR(type, name, CamelName) inline type name();
MUTABLE_ROOT_LIST(ROOT_ACCESSOR) MUTABLE_ROOT_LIST(ROOT_ACCESSOR)
#undef ROOT_ACCESSOR #undef ROOT_ACCESSOR
...@@ -1391,8 +1391,7 @@ class Heap { ...@@ -1391,8 +1391,7 @@ class Heap {
return 0; return 0;
} }
#define ROOT_ACCESSOR(type, name, CamelName) \ #define ROOT_ACCESSOR(type, name, CamelName) inline void set_##name(type value);
inline void set_##name(type* value);
ROOT_LIST(ROOT_ACCESSOR) ROOT_LIST(ROOT_ACCESSOR)
#undef ROOT_ACCESSOR #undef ROOT_ACCESSOR
......
...@@ -352,9 +352,9 @@ namespace internal { ...@@ -352,9 +352,9 @@ namespace internal {
// Adapts one STRUCT_LIST_GENERATOR entry to the STRUCT_MAPS_LIST entry // Adapts one STRUCT_LIST_GENERATOR entry to the STRUCT_MAPS_LIST entry
#define STRUCT_MAPS_LIST_ADAPTER(V, NAME, Name, name) \ #define STRUCT_MAPS_LIST_ADAPTER(V, NAME, Name, name) \
V(Map, name##_map, Name##Map) V(Map*, name##_map, Name##Map)
// Produces (Map, struct_name_map, StructNameMap) entries // Produces (Map*, struct_name_map, StructNameMap) entries
#define STRUCT_MAPS_LIST(V) STRUCT_LIST_GENERATOR(STRUCT_MAPS_LIST_ADAPTER, V) #define STRUCT_MAPS_LIST(V) STRUCT_LIST_GENERATOR(STRUCT_MAPS_LIST_ADAPTER, V)
// //
...@@ -368,7 +368,7 @@ namespace internal { ...@@ -368,7 +368,7 @@ namespace internal {
// Adapts one ALLOCATION_SITE_LIST entry to the ALLOCATION_SITE_MAPS_LIST entry // Adapts one ALLOCATION_SITE_LIST entry to the ALLOCATION_SITE_MAPS_LIST entry
#define ALLOCATION_SITE_MAPS_LIST_ADAPTER(V, TYPE, Name, Size, name_size) \ #define ALLOCATION_SITE_MAPS_LIST_ADAPTER(V, TYPE, Name, Size, name_size) \
V(Map, name_size##_map, Name##Size##Map) V(Map*, name_size##_map, Name##Size##Map)
// Produces (Map, allocation_site_name_map, AllocationSiteNameMap) entries // Produces (Map, allocation_site_name_map, AllocationSiteNameMap) entries
#define ALLOCATION_SITE_MAPS_LIST(V) \ #define ALLOCATION_SITE_MAPS_LIST(V) \
...@@ -389,7 +389,7 @@ namespace internal { ...@@ -389,7 +389,7 @@ namespace internal {
// Adapts one DATA_HANDLER_LIST entry to the DATA_HANDLER_MAPS_LIST entry. // Adapts one DATA_HANDLER_LIST entry to the DATA_HANDLER_MAPS_LIST entry.
#define DATA_HANDLER_MAPS_LIST_ADAPTER(V, TYPE, Name, Size, name_size) \ #define DATA_HANDLER_MAPS_LIST_ADAPTER(V, TYPE, Name, Size, name_size) \
V(Map, name_size##_map, Name##Size##Map) V(Map*, name_size##_map, Name##Size##Map)
// Produces (Map, handler_name_map, HandlerNameMap) entries // Produces (Map, handler_name_map, HandlerNameMap) entries
#define DATA_HANDLER_MAPS_LIST(V) \ #define DATA_HANDLER_MAPS_LIST(V) \
......
...@@ -36,13 +36,16 @@ ReadOnlyRoots::ReadOnlyRoots(Heap* heap) ...@@ -36,13 +36,16 @@ ReadOnlyRoots::ReadOnlyRoots(Heap* heap)
ReadOnlyRoots::ReadOnlyRoots(Isolate* isolate) ReadOnlyRoots::ReadOnlyRoots(Isolate* isolate)
: roots_table_(isolate->roots_table()) {} : roots_table_(isolate->roots_table()) {}
#define ROOT_ACCESSOR(type, name, CamelName) \ // TODO(jkummerow): Drop std::remove_pointer after the migration to ObjectPtr.
type* ReadOnlyRoots::name() { \ #define ROOT_ACCESSOR(Type, name, CamelName) \
return type::cast(roots_table_[RootIndex::k##CamelName]); \ Type ReadOnlyRoots::name() const { \
} \ return std::remove_pointer<Type>::type::cast( \
Handle<type> ReadOnlyRoots::name##_handle() { \ roots_table_[RootIndex::k##CamelName]); \
return Handle<type>( \ } \
bit_cast<type**>(&roots_table_[RootIndex::k##CamelName])); \ Handle<std::remove_pointer<Type>::type> ReadOnlyRoots::name##_handle() \
const { \
return Handle<std::remove_pointer<Type>::type>( \
bit_cast<Address*>(&roots_table_[RootIndex::k##CamelName])); \
} }
READ_ONLY_ROOT_LIST(ROOT_ACCESSOR) READ_ONLY_ROOT_LIST(ROOT_ACCESSOR)
......
...@@ -30,284 +30,285 @@ class RootVisitor; ...@@ -30,284 +30,285 @@ class RootVisitor;
/* Cluster the most popular ones in a few cache lines here at the top. */ \ /* Cluster the most popular ones in a few cache lines here at the top. */ \
/* The first 32 entries are most often used in the startup snapshot and */ \ /* The first 32 entries are most often used in the startup snapshot and */ \
/* can use a shorter representation in the serialization format. */ \ /* can use a shorter representation in the serialization format. */ \
V(Map, free_space_map, FreeSpaceMap) \ V(Map*, free_space_map, FreeSpaceMap) \
V(Map, one_pointer_filler_map, OnePointerFillerMap) \ V(Map*, one_pointer_filler_map, OnePointerFillerMap) \
V(Map, two_pointer_filler_map, TwoPointerFillerMap) \ V(Map*, two_pointer_filler_map, TwoPointerFillerMap) \
V(Oddball, uninitialized_value, UninitializedValue) \ V(Oddball*, uninitialized_value, UninitializedValue) \
V(Oddball, undefined_value, UndefinedValue) \ V(Oddball*, undefined_value, UndefinedValue) \
V(Oddball, the_hole_value, TheHoleValue) \ V(Oddball*, the_hole_value, TheHoleValue) \
V(Oddball, null_value, NullValue) \ V(Oddball*, null_value, NullValue) \
V(Oddball, true_value, TrueValue) \ V(Oddball*, true_value, TrueValue) \
V(Oddball, false_value, FalseValue) \ V(Oddball*, false_value, FalseValue) \
V(String, empty_string, empty_string) \ V(String*, empty_string, empty_string) \
V(Map, meta_map, MetaMap) \ V(Map*, meta_map, MetaMap) \
V(Map, byte_array_map, ByteArrayMap) \ V(Map*, byte_array_map, ByteArrayMap) \
V(Map, fixed_array_map, FixedArrayMap) \ V(Map*, fixed_array_map, FixedArrayMap) \
V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ V(Map*, fixed_cow_array_map, FixedCOWArrayMap) \
V(Map, hash_table_map, HashTableMap) \ V(Map*, hash_table_map, HashTableMap) \
V(Map, symbol_map, SymbolMap) \ V(Map*, symbol_map, SymbolMap) \
V(Map, one_byte_string_map, OneByteStringMap) \ V(Map*, one_byte_string_map, OneByteStringMap) \
V(Map, one_byte_internalized_string_map, OneByteInternalizedStringMap) \ V(Map*, one_byte_internalized_string_map, OneByteInternalizedStringMap) \
V(Map, scope_info_map, ScopeInfoMap) \ V(Map*, scope_info_map, ScopeInfoMap) \
V(Map, shared_function_info_map, SharedFunctionInfoMap) \ V(Map*, shared_function_info_map, SharedFunctionInfoMap) \
V(Map, code_map, CodeMap) \ V(Map*, code_map, CodeMap) \
V(Map, function_context_map, FunctionContextMap) \ V(Map*, function_context_map, FunctionContextMap) \
V(Map, cell_map, CellMap) \ V(Map*, cell_map, CellMap) \
V(Map, global_property_cell_map, GlobalPropertyCellMap) \ V(Map*, global_property_cell_map, GlobalPropertyCellMap) \
V(Map, foreign_map, ForeignMap) \ V(Map*, foreign_map, ForeignMap) \
V(Map, heap_number_map, HeapNumberMap) \ V(Map*, heap_number_map, HeapNumberMap) \
V(Map, transition_array_map, TransitionArrayMap) \ V(Map*, transition_array_map, TransitionArrayMap) \
V(Map, feedback_vector_map, FeedbackVectorMap) \ V(Map*, feedback_vector_map, FeedbackVectorMap) \
V(ScopeInfo, empty_scope_info, EmptyScopeInfo) \ V(ScopeInfo*, empty_scope_info, EmptyScopeInfo) \
V(FixedArray, empty_fixed_array, EmptyFixedArray) \ V(FixedArray*, empty_fixed_array, EmptyFixedArray) \
V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ V(DescriptorArray*, empty_descriptor_array, EmptyDescriptorArray) \
/* Entries beyond the first 32 */ \ /* Entries beyond the first 32 */ \
/* Oddballs */ \ /* Oddballs */ \
V(Oddball, arguments_marker, ArgumentsMarker) \ V(Oddball*, arguments_marker, ArgumentsMarker) \
V(Oddball, exception, Exception) \ V(Oddball*, exception, Exception) \
V(Oddball, termination_exception, TerminationException) \ V(Oddball*, termination_exception, TerminationException) \
V(Oddball, optimized_out, OptimizedOut) \ V(Oddball*, optimized_out, OptimizedOut) \
V(Oddball, stale_register, StaleRegister) \ V(Oddball*, stale_register, StaleRegister) \
/* Context maps */ \ /* Context maps */ \
V(Map, native_context_map, NativeContextMap) \ V(Map*, native_context_map, NativeContextMap) \
V(Map, module_context_map, ModuleContextMap) \ V(Map*, module_context_map, ModuleContextMap) \
V(Map, eval_context_map, EvalContextMap) \ V(Map*, eval_context_map, EvalContextMap) \
V(Map, script_context_map, ScriptContextMap) \ V(Map*, script_context_map, ScriptContextMap) \
V(Map, await_context_map, AwaitContextMap) \ V(Map*, await_context_map, AwaitContextMap) \
V(Map, block_context_map, BlockContextMap) \ V(Map*, block_context_map, BlockContextMap) \
V(Map, catch_context_map, CatchContextMap) \ V(Map*, catch_context_map, CatchContextMap) \
V(Map, with_context_map, WithContextMap) \ V(Map*, with_context_map, WithContextMap) \
V(Map, debug_evaluate_context_map, DebugEvaluateContextMap) \ V(Map*, debug_evaluate_context_map, DebugEvaluateContextMap) \
V(Map, script_context_table_map, ScriptContextTableMap) \ V(Map*, script_context_table_map, ScriptContextTableMap) \
/* Maps */ \ /* Maps */ \
V(Map, feedback_metadata_map, FeedbackMetadataArrayMap) \ V(Map*, feedback_metadata_map, FeedbackMetadataArrayMap) \
V(Map, array_list_map, ArrayListMap) \ V(Map*, array_list_map, ArrayListMap) \
V(Map, bigint_map, BigIntMap) \ V(Map*, bigint_map, BigIntMap) \
V(Map, object_boilerplate_description_map, ObjectBoilerplateDescriptionMap) \ V(Map*, object_boilerplate_description_map, ObjectBoilerplateDescriptionMap) \
V(Map, bytecode_array_map, BytecodeArrayMap) \ V(Map*, bytecode_array_map, BytecodeArrayMap) \
V(Map, code_data_container_map, CodeDataContainerMap) \ V(Map*, code_data_container_map, CodeDataContainerMap) \
V(Map, descriptor_array_map, DescriptorArrayMap) \ V(Map*, descriptor_array_map, DescriptorArrayMap) \
V(Map, fixed_double_array_map, FixedDoubleArrayMap) \ V(Map*, fixed_double_array_map, FixedDoubleArrayMap) \
V(Map, global_dictionary_map, GlobalDictionaryMap) \ V(Map*, global_dictionary_map, GlobalDictionaryMap) \
V(Map, many_closures_cell_map, ManyClosuresCellMap) \ V(Map*, many_closures_cell_map, ManyClosuresCellMap) \
V(Map, module_info_map, ModuleInfoMap) \ V(Map*, module_info_map, ModuleInfoMap) \
V(Map, mutable_heap_number_map, MutableHeapNumberMap) \ V(Map*, mutable_heap_number_map, MutableHeapNumberMap) \
V(Map, name_dictionary_map, NameDictionaryMap) \ V(Map*, name_dictionary_map, NameDictionaryMap) \
V(Map, no_closures_cell_map, NoClosuresCellMap) \ V(Map*, no_closures_cell_map, NoClosuresCellMap) \
V(Map, number_dictionary_map, NumberDictionaryMap) \ V(Map*, number_dictionary_map, NumberDictionaryMap) \
V(Map, one_closure_cell_map, OneClosureCellMap) \ V(Map*, one_closure_cell_map, OneClosureCellMap) \
V(Map, ordered_hash_map_map, OrderedHashMapMap) \ V(Map*, ordered_hash_map_map, OrderedHashMapMap) \
V(Map, ordered_hash_set_map, OrderedHashSetMap) \ V(Map*, ordered_hash_set_map, OrderedHashSetMap) \
V(Map, pre_parsed_scope_data_map, PreParsedScopeDataMap) \ V(Map*, pre_parsed_scope_data_map, PreParsedScopeDataMap) \
V(Map, property_array_map, PropertyArrayMap) \ V(Map*, property_array_map, PropertyArrayMap) \
V(Map, side_effect_call_handler_info_map, SideEffectCallHandlerInfoMap) \ V(Map*, side_effect_call_handler_info_map, SideEffectCallHandlerInfoMap) \
V(Map, side_effect_free_call_handler_info_map, \ V(Map*, side_effect_free_call_handler_info_map, \
SideEffectFreeCallHandlerInfoMap) \ SideEffectFreeCallHandlerInfoMap) \
V(Map, next_call_side_effect_free_call_handler_info_map, \ V(Map*, next_call_side_effect_free_call_handler_info_map, \
NextCallSideEffectFreeCallHandlerInfoMap) \ NextCallSideEffectFreeCallHandlerInfoMap) \
V(Map, simple_number_dictionary_map, SimpleNumberDictionaryMap) \ V(Map*, simple_number_dictionary_map, SimpleNumberDictionaryMap) \
V(Map, sloppy_arguments_elements_map, SloppyArgumentsElementsMap) \ V(Map*, sloppy_arguments_elements_map, SloppyArgumentsElementsMap) \
V(Map, small_ordered_hash_map_map, SmallOrderedHashMapMap) \ V(Map*, small_ordered_hash_map_map, SmallOrderedHashMapMap) \
V(Map, small_ordered_hash_set_map, SmallOrderedHashSetMap) \ V(Map*, small_ordered_hash_set_map, SmallOrderedHashSetMap) \
V(Map, string_table_map, StringTableMap) \ V(Map*, string_table_map, StringTableMap) \
V(Map, uncompiled_data_without_pre_parsed_scope_map, \ V(Map*, uncompiled_data_without_pre_parsed_scope_map, \
UncompiledDataWithoutPreParsedScopeMap) \ UncompiledDataWithoutPreParsedScopeMap) \
V(Map, uncompiled_data_with_pre_parsed_scope_map, \ V(Map*, uncompiled_data_with_pre_parsed_scope_map, \
UncompiledDataWithPreParsedScopeMap) \ UncompiledDataWithPreParsedScopeMap) \
V(Map, weak_fixed_array_map, WeakFixedArrayMap) \ V(Map*, weak_fixed_array_map, WeakFixedArrayMap) \
V(Map, weak_array_list_map, WeakArrayListMap) \ V(Map*, weak_array_list_map, WeakArrayListMap) \
V(Map, ephemeron_hash_table_map, EphemeronHashTableMap) \ V(Map*, ephemeron_hash_table_map, EphemeronHashTableMap) \
/* String maps */ \ /* String maps */ \
V(Map, native_source_string_map, NativeSourceStringMap) \ V(Map*, native_source_string_map, NativeSourceStringMap) \
V(Map, string_map, StringMap) \ V(Map*, string_map, StringMap) \
V(Map, cons_one_byte_string_map, ConsOneByteStringMap) \ V(Map*, cons_one_byte_string_map, ConsOneByteStringMap) \
V(Map, cons_string_map, ConsStringMap) \ V(Map*, cons_string_map, ConsStringMap) \
V(Map, thin_one_byte_string_map, ThinOneByteStringMap) \ V(Map*, thin_one_byte_string_map, ThinOneByteStringMap) \
V(Map, thin_string_map, ThinStringMap) \ V(Map*, thin_string_map, ThinStringMap) \
V(Map, sliced_string_map, SlicedStringMap) \ V(Map*, sliced_string_map, SlicedStringMap) \
V(Map, sliced_one_byte_string_map, SlicedOneByteStringMap) \ V(Map*, sliced_one_byte_string_map, SlicedOneByteStringMap) \
V(Map, external_string_map, ExternalStringMap) \ V(Map*, external_string_map, ExternalStringMap) \
V(Map, external_string_with_one_byte_data_map, \ V(Map*, external_string_with_one_byte_data_map, \
ExternalStringWithOneByteDataMap) \ ExternalStringWithOneByteDataMap) \
V(Map, external_one_byte_string_map, ExternalOneByteStringMap) \ V(Map*, external_one_byte_string_map, ExternalOneByteStringMap) \
V(Map, uncached_external_string_map, UncachedExternalStringMap) \ V(Map*, uncached_external_string_map, UncachedExternalStringMap) \
V(Map, uncached_external_string_with_one_byte_data_map, \ V(Map*, uncached_external_string_with_one_byte_data_map, \
UncachedExternalStringWithOneByteDataMap) \ UncachedExternalStringWithOneByteDataMap) \
V(Map, internalized_string_map, InternalizedStringMap) \ V(Map*, internalized_string_map, InternalizedStringMap) \
V(Map, external_internalized_string_map, ExternalInternalizedStringMap) \ V(Map*, external_internalized_string_map, ExternalInternalizedStringMap) \
V(Map, external_internalized_string_with_one_byte_data_map, \ V(Map*, external_internalized_string_with_one_byte_data_map, \
ExternalInternalizedStringWithOneByteDataMap) \ ExternalInternalizedStringWithOneByteDataMap) \
V(Map, external_one_byte_internalized_string_map, \ V(Map*, external_one_byte_internalized_string_map, \
ExternalOneByteInternalizedStringMap) \ ExternalOneByteInternalizedStringMap) \
V(Map, uncached_external_internalized_string_map, \ V(Map*, uncached_external_internalized_string_map, \
UncachedExternalInternalizedStringMap) \ UncachedExternalInternalizedStringMap) \
V(Map, uncached_external_internalized_string_with_one_byte_data_map, \ V(Map*, uncached_external_internalized_string_with_one_byte_data_map, \
UncachedExternalInternalizedStringWithOneByteDataMap) \ UncachedExternalInternalizedStringWithOneByteDataMap) \
V(Map, uncached_external_one_byte_internalized_string_map, \ V(Map*, uncached_external_one_byte_internalized_string_map, \
UncachedExternalOneByteInternalizedStringMap) \ UncachedExternalOneByteInternalizedStringMap) \
V(Map, uncached_external_one_byte_string_map, \ V(Map*, uncached_external_one_byte_string_map, \
UncachedExternalOneByteStringMap) \ UncachedExternalOneByteStringMap) \
/* Array element maps */ \ /* Array element maps */ \
V(Map, fixed_uint8_array_map, FixedUint8ArrayMap) \ V(Map*, fixed_uint8_array_map, FixedUint8ArrayMap) \
V(Map, fixed_int8_array_map, FixedInt8ArrayMap) \ V(Map*, fixed_int8_array_map, FixedInt8ArrayMap) \
V(Map, fixed_uint16_array_map, FixedUint16ArrayMap) \ V(Map*, fixed_uint16_array_map, FixedUint16ArrayMap) \
V(Map, fixed_int16_array_map, FixedInt16ArrayMap) \ V(Map*, fixed_int16_array_map, FixedInt16ArrayMap) \
V(Map, fixed_uint32_array_map, FixedUint32ArrayMap) \ V(Map*, fixed_uint32_array_map, FixedUint32ArrayMap) \
V(Map, fixed_int32_array_map, FixedInt32ArrayMap) \ V(Map*, fixed_int32_array_map, FixedInt32ArrayMap) \
V(Map, fixed_float32_array_map, FixedFloat32ArrayMap) \ V(Map*, fixed_float32_array_map, FixedFloat32ArrayMap) \
V(Map, fixed_float64_array_map, FixedFloat64ArrayMap) \ V(Map*, fixed_float64_array_map, FixedFloat64ArrayMap) \
V(Map, fixed_uint8_clamped_array_map, FixedUint8ClampedArrayMap) \ V(Map*, fixed_uint8_clamped_array_map, FixedUint8ClampedArrayMap) \
V(Map, fixed_biguint64_array_map, FixedBigUint64ArrayMap) \ V(Map*, fixed_biguint64_array_map, FixedBigUint64ArrayMap) \
V(Map, fixed_bigint64_array_map, FixedBigInt64ArrayMap) \ V(Map*, fixed_bigint64_array_map, FixedBigInt64ArrayMap) \
/* Oddball maps */ \ /* Oddball maps */ \
V(Map, undefined_map, UndefinedMap) \ V(Map*, undefined_map, UndefinedMap) \
V(Map, the_hole_map, TheHoleMap) \ V(Map*, the_hole_map, TheHoleMap) \
V(Map, null_map, NullMap) \ V(Map*, null_map, NullMap) \
V(Map, boolean_map, BooleanMap) \ V(Map*, boolean_map, BooleanMap) \
V(Map, uninitialized_map, UninitializedMap) \ V(Map*, uninitialized_map, UninitializedMap) \
V(Map, arguments_marker_map, ArgumentsMarkerMap) \ V(Map*, arguments_marker_map, ArgumentsMarkerMap) \
V(Map, exception_map, ExceptionMap) \ V(Map*, exception_map, ExceptionMap) \
V(Map, termination_exception_map, TerminationExceptionMap) \ V(Map*, termination_exception_map, TerminationExceptionMap) \
V(Map, optimized_out_map, OptimizedOutMap) \ V(Map*, optimized_out_map, OptimizedOutMap) \
V(Map, stale_register_map, StaleRegisterMap) \ V(Map*, stale_register_map, StaleRegisterMap) \
V(Map, self_reference_marker_map, SelfReferenceMarkerMap) \ V(Map*, self_reference_marker_map, SelfReferenceMarkerMap) \
/* Canonical empty values */ \ /* Canonical empty values */ \
V(EnumCache, empty_enum_cache, EmptyEnumCache) \ V(EnumCache*, empty_enum_cache, EmptyEnumCache) \
V(PropertyArray, empty_property_array, EmptyPropertyArray) \ V(PropertyArray*, empty_property_array, EmptyPropertyArray) \
V(ByteArray, empty_byte_array, EmptyByteArray) \ V(ByteArray*, empty_byte_array, EmptyByteArray) \
V(ObjectBoilerplateDescription, empty_object_boilerplate_description, \ V(ObjectBoilerplateDescription*, empty_object_boilerplate_description, \
EmptyObjectBoilerplateDescription) \ EmptyObjectBoilerplateDescription) \
V(ArrayBoilerplateDescription, empty_array_boilerplate_description, \ V(ArrayBoilerplateDescription*, empty_array_boilerplate_description, \
EmptyArrayBoilerplateDescription) \ EmptyArrayBoilerplateDescription) \
V(FixedTypedArrayBase, empty_fixed_uint8_array, EmptyFixedUint8Array) \ V(FixedTypedArrayBase*, empty_fixed_uint8_array, EmptyFixedUint8Array) \
V(FixedTypedArrayBase, empty_fixed_int8_array, EmptyFixedInt8Array) \ V(FixedTypedArrayBase*, empty_fixed_int8_array, EmptyFixedInt8Array) \
V(FixedTypedArrayBase, empty_fixed_uint16_array, EmptyFixedUint16Array) \ V(FixedTypedArrayBase*, empty_fixed_uint16_array, EmptyFixedUint16Array) \
V(FixedTypedArrayBase, empty_fixed_int16_array, EmptyFixedInt16Array) \ V(FixedTypedArrayBase*, empty_fixed_int16_array, EmptyFixedInt16Array) \
V(FixedTypedArrayBase, empty_fixed_uint32_array, EmptyFixedUint32Array) \ V(FixedTypedArrayBase*, empty_fixed_uint32_array, EmptyFixedUint32Array) \
V(FixedTypedArrayBase, empty_fixed_int32_array, EmptyFixedInt32Array) \ V(FixedTypedArrayBase*, empty_fixed_int32_array, EmptyFixedInt32Array) \
V(FixedTypedArrayBase, empty_fixed_float32_array, EmptyFixedFloat32Array) \ V(FixedTypedArrayBase*, empty_fixed_float32_array, EmptyFixedFloat32Array) \
V(FixedTypedArrayBase, empty_fixed_float64_array, EmptyFixedFloat64Array) \ V(FixedTypedArrayBase*, empty_fixed_float64_array, EmptyFixedFloat64Array) \
V(FixedTypedArrayBase, empty_fixed_uint8_clamped_array, \ V(FixedTypedArrayBase*, empty_fixed_uint8_clamped_array, \
EmptyFixedUint8ClampedArray) \ EmptyFixedUint8ClampedArray) \
V(FixedTypedArrayBase, empty_fixed_biguint64_array, \ V(FixedTypedArrayBase*, empty_fixed_biguint64_array, \
EmptyFixedBigUint64Array) \ EmptyFixedBigUint64Array) \
V(FixedTypedArrayBase, empty_fixed_bigint64_array, EmptyFixedBigInt64Array) \ V(FixedTypedArrayBase*, empty_fixed_bigint64_array, EmptyFixedBigInt64Array) \
V(FixedArray, empty_sloppy_arguments_elements, EmptySloppyArgumentsElements) \ V(FixedArray*, empty_sloppy_arguments_elements, \
V(NumberDictionary, empty_slow_element_dictionary, \ EmptySloppyArgumentsElements) \
V(NumberDictionary*, empty_slow_element_dictionary, \
EmptySlowElementDictionary) \ EmptySlowElementDictionary) \
V(FixedArray, empty_ordered_hash_map, EmptyOrderedHashMap) \ V(FixedArray*, empty_ordered_hash_map, EmptyOrderedHashMap) \
V(FixedArray, empty_ordered_hash_set, EmptyOrderedHashSet) \ V(FixedArray*, empty_ordered_hash_set, EmptyOrderedHashSet) \
V(FeedbackMetadata, empty_feedback_metadata, EmptyFeedbackMetadata) \ V(FeedbackMetadata*, empty_feedback_metadata, EmptyFeedbackMetadata) \
V(PropertyCell, empty_property_cell, EmptyPropertyCell) \ V(PropertyCell*, empty_property_cell, EmptyPropertyCell) \
V(NameDictionary, empty_property_dictionary, EmptyPropertyDictionary) \ V(NameDictionary*, empty_property_dictionary, EmptyPropertyDictionary) \
V(InterceptorInfo, noop_interceptor_info, NoOpInterceptorInfo) \ V(InterceptorInfo*, noop_interceptor_info, NoOpInterceptorInfo) \
V(WeakFixedArray, empty_weak_fixed_array, EmptyWeakFixedArray) \ V(WeakFixedArray*, empty_weak_fixed_array, EmptyWeakFixedArray) \
V(WeakArrayList, empty_weak_array_list, EmptyWeakArrayList) \ V(WeakArrayList*, empty_weak_array_list, EmptyWeakArrayList) \
/* Special numbers */ \ /* Special numbers */ \
V(HeapNumber, nan_value, NanValue) \ V(HeapNumber*, nan_value, NanValue) \
V(HeapNumber, hole_nan_value, HoleNanValue) \ V(HeapNumber*, hole_nan_value, HoleNanValue) \
V(HeapNumber, infinity_value, InfinityValue) \ V(HeapNumber*, infinity_value, InfinityValue) \
V(HeapNumber, minus_zero_value, MinusZeroValue) \ V(HeapNumber*, minus_zero_value, MinusZeroValue) \
V(HeapNumber, minus_infinity_value, MinusInfinityValue) \ V(HeapNumber*, minus_infinity_value, MinusInfinityValue) \
/* Marker for self-references during code-generation */ \ /* Marker for self-references during code-generation */ \
V(HeapObject, self_reference_marker, SelfReferenceMarker) V(HeapObject*, self_reference_marker, SelfReferenceMarker)
// Mutable roots that are known to be immortal immovable, for which we can // Mutable roots that are known to be immortal immovable, for which we can
// safely skip write barriers. // safely skip write barriers.
#define STRONG_MUTABLE_IMMOVABLE_ROOT_LIST(V) \ #define STRONG_MUTABLE_IMMOVABLE_ROOT_LIST(V) \
ACCESSOR_INFO_ROOT_LIST(V) \ ACCESSOR_INFO_ROOT_LIST(V) \
/* Maps */ \ /* Maps */ \
V(Map, external_map, ExternalMap) \ V(Map*, external_map, ExternalMap) \
V(Map, message_object_map, JSMessageObjectMap) \ V(Map*, message_object_map, JSMessageObjectMap) \
/* Canonical empty values */ \ /* Canonical empty values */ \
V(Script, empty_script, EmptyScript) \ V(Script*, empty_script, EmptyScript) \
V(FeedbackCell, many_closures_cell, ManyClosuresCell) \ V(FeedbackCell*, many_closures_cell, ManyClosuresCell) \
V(Cell, invalid_prototype_validity_cell, InvalidPrototypeValidityCell) \ V(Cell*, invalid_prototype_validity_cell, InvalidPrototypeValidityCell) \
/* Protectors */ \ /* Protectors */ \
V(Cell, array_constructor_protector, ArrayConstructorProtector) \ V(Cell*, array_constructor_protector, ArrayConstructorProtector) \
V(PropertyCell, no_elements_protector, NoElementsProtector) \ V(PropertyCell*, no_elements_protector, NoElementsProtector) \
V(Cell, is_concat_spreadable_protector, IsConcatSpreadableProtector) \ V(Cell*, is_concat_spreadable_protector, IsConcatSpreadableProtector) \
V(PropertyCell, array_species_protector, ArraySpeciesProtector) \ V(PropertyCell*, array_species_protector, ArraySpeciesProtector) \
V(PropertyCell, typed_array_species_protector, TypedArraySpeciesProtector) \ V(PropertyCell*, typed_array_species_protector, TypedArraySpeciesProtector) \
V(PropertyCell, promise_species_protector, PromiseSpeciesProtector) \ V(PropertyCell*, promise_species_protector, PromiseSpeciesProtector) \
V(Cell, string_length_protector, StringLengthProtector) \ V(Cell*, string_length_protector, StringLengthProtector) \
V(PropertyCell, array_iterator_protector, ArrayIteratorProtector) \ V(PropertyCell*, array_iterator_protector, ArrayIteratorProtector) \
V(PropertyCell, array_buffer_neutering_protector, \ V(PropertyCell*, array_buffer_neutering_protector, \
ArrayBufferNeuteringProtector) \ ArrayBufferNeuteringProtector) \
V(PropertyCell, promise_hook_protector, PromiseHookProtector) \ V(PropertyCell*, promise_hook_protector, PromiseHookProtector) \
V(Cell, promise_resolve_protector, PromiseResolveProtector) \ V(Cell*, promise_resolve_protector, PromiseResolveProtector) \
V(PropertyCell, map_iterator_protector, MapIteratorProtector) \ V(PropertyCell*, map_iterator_protector, MapIteratorProtector) \
V(PropertyCell, promise_then_protector, PromiseThenProtector) \ V(PropertyCell*, promise_then_protector, PromiseThenProtector) \
V(PropertyCell, set_iterator_protector, SetIteratorProtector) \ V(PropertyCell*, set_iterator_protector, SetIteratorProtector) \
V(PropertyCell, string_iterator_protector, StringIteratorProtector) \ V(PropertyCell*, string_iterator_protector, StringIteratorProtector) \
/* Caches */ \ /* Caches */ \
V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \ V(FixedArray*, single_character_string_cache, SingleCharacterStringCache) \
V(FixedArray, string_split_cache, StringSplitCache) \ V(FixedArray*, string_split_cache, StringSplitCache) \
V(FixedArray, regexp_multiple_cache, RegExpMultipleCache) \ V(FixedArray*, regexp_multiple_cache, RegExpMultipleCache) \
/* Lists and dictionaries */ \ /* Lists and dictionaries */ \
V(MicrotaskQueue, default_microtask_queue, DefaultMicrotaskQueue) \ V(MicrotaskQueue*, default_microtask_queue, DefaultMicrotaskQueue) \
/* Indirection lists for isolate-independent builtins */ \ /* Indirection lists for isolate-independent builtins */ \
V(FixedArray, builtins_constants_table, BuiltinsConstantsTable) \ V(FixedArray*, builtins_constants_table, BuiltinsConstantsTable) \
/* Hash seed */ \ /* Hash seed */ \
V(ByteArray, hash_seed, HashSeed) \ V(ByteArray*, hash_seed, HashSeed) \
/* JS Entries */ \ /* JS Entries */ \
V(Code, js_entry_code, JsEntryCode) \ V(Code*, js_entry_code, JsEntryCode) \
V(Code, js_construct_entry_code, JsConstructEntryCode) \ V(Code*, js_construct_entry_code, JsConstructEntryCode) \
V(Code, js_run_microtasks_entry_code, JsRunMicrotasksEntryCode) V(Code*, js_run_microtasks_entry_code, JsRunMicrotasksEntryCode)
// These root references can be updated by the mutator. // These root references can be updated by the mutator.
#define STRONG_MUTABLE_MOVABLE_ROOT_LIST(V) \ #define STRONG_MUTABLE_MOVABLE_ROOT_LIST(V) \
/* Caches */ \ /* Caches */ \
V(FixedArray, number_string_cache, NumberStringCache) \ V(FixedArray*, number_string_cache, NumberStringCache) \
/* Lists and dictionaries */ \ /* Lists and dictionaries */ \
V(NameDictionary, public_symbol_table, PublicSymbolTable) \ V(NameDictionary*, public_symbol_table, PublicSymbolTable) \
V(NameDictionary, api_symbol_table, ApiSymbolTable) \ V(NameDictionary*, api_symbol_table, ApiSymbolTable) \
V(NameDictionary, api_private_symbol_table, ApiPrivateSymbolTable) \ V(NameDictionary*, api_private_symbol_table, ApiPrivateSymbolTable) \
V(WeakArrayList, script_list, ScriptList) \ V(WeakArrayList*, script_list, ScriptList) \
V(SimpleNumberDictionary, code_stubs, CodeStubs) \ V(SimpleNumberDictionary*, code_stubs, CodeStubs) \
V(FixedArray, materialized_objects, MaterializedObjects) \ V(FixedArray*, materialized_objects, MaterializedObjects) \
V(WeakArrayList, detached_contexts, DetachedContexts) \ V(WeakArrayList*, detached_contexts, DetachedContexts) \
V(WeakArrayList, retaining_path_targets, RetainingPathTargets) \ V(WeakArrayList*, retaining_path_targets, RetainingPathTargets) \
V(WeakArrayList, retained_maps, RetainedMaps) \ V(WeakArrayList*, retained_maps, RetainedMaps) \
/* Feedback vectors that we need for code coverage or type profile */ \ /* Feedback vectors that we need for code coverage or type profile */ \
V(Object, feedback_vectors_for_profiling_tools, \ V(Object*, feedback_vectors_for_profiling_tools, \
FeedbackVectorsForProfilingTools) \ FeedbackVectorsForProfilingTools) \
V(WeakArrayList, noscript_shared_function_infos, \ V(WeakArrayList*, noscript_shared_function_infos, \
NoScriptSharedFunctionInfos) \ NoScriptSharedFunctionInfos) \
V(FixedArray, serialized_objects, SerializedObjects) \ V(FixedArray*, serialized_objects, SerializedObjects) \
V(FixedArray, serialized_global_proxy_sizes, SerializedGlobalProxySizes) \ V(FixedArray*, serialized_global_proxy_sizes, SerializedGlobalProxySizes) \
V(TemplateList, message_listeners, MessageListeners) \ V(TemplateList*, message_listeners, MessageListeners) \
/* Support for async stack traces */ \ /* Support for async stack traces */ \
V(HeapObject, current_microtask, CurrentMicrotask) V(HeapObject*, current_microtask, CurrentMicrotask)
// Entries in this list are limited to Smis and are not visited during GC. // Entries in this list are limited to Smis and are not visited during GC.
#define SMI_ROOT_LIST(V) \ #define SMI_ROOT_LIST(V) \
V(Smi, stack_limit, StackLimit) \ V(Smi*, stack_limit, StackLimit) \
V(Smi, real_stack_limit, RealStackLimit) \ V(Smi*, real_stack_limit, RealStackLimit) \
V(Smi, last_script_id, LastScriptId) \ V(Smi*, last_script_id, LastScriptId) \
V(Smi, last_debugging_id, LastDebuggingId) \ V(Smi*, last_debugging_id, LastDebuggingId) \
/* To distinguish the function templates, so that we can find them in the */ \ /* To distinguish the function templates, so that we can find them in the */ \
/* function cache of the native context. */ \ /* function cache of the native context. */ \
V(Smi, next_template_serial_number, NextTemplateSerialNumber) \ V(Smi*, next_template_serial_number, NextTemplateSerialNumber) \
V(Smi, arguments_adaptor_deopt_pc_offset, ArgumentsAdaptorDeoptPCOffset) \ V(Smi*, arguments_adaptor_deopt_pc_offset, ArgumentsAdaptorDeoptPCOffset) \
V(Smi, construct_stub_create_deopt_pc_offset, \ V(Smi*, construct_stub_create_deopt_pc_offset, \
ConstructStubCreateDeoptPCOffset) \ ConstructStubCreateDeoptPCOffset) \
V(Smi, construct_stub_invoke_deopt_pc_offset, \ V(Smi*, construct_stub_invoke_deopt_pc_offset, \
ConstructStubInvokeDeoptPCOffset) \ ConstructStubInvokeDeoptPCOffset) \
V(Smi, interpreter_entry_return_pc_offset, InterpreterEntryReturnPCOffset) V(Smi*, interpreter_entry_return_pc_offset, InterpreterEntryReturnPCOffset)
// Adapts one INTERNALIZED_STRING_LIST_GENERATOR entry to // Adapts one INTERNALIZED_STRING_LIST_GENERATOR entry to
// the ROOT_LIST-compatible entry // the ROOT_LIST-compatible entry
#define INTERNALIZED_STRING_LIST_ADAPTER(V, name, ...) V(String, name, name) #define INTERNALIZED_STRING_LIST_ADAPTER(V, name, ...) V(String*, name, name)
// Produces (String, name, CamelCase) entries // Produces (String*, name, CamelCase) entries
#define INTERNALIZED_STRING_ROOT_LIST(V) \ #define INTERNALIZED_STRING_ROOT_LIST(V) \
INTERNALIZED_STRING_LIST_GENERATOR(INTERNALIZED_STRING_LIST_ADAPTER, V) INTERNALIZED_STRING_LIST_GENERATOR(INTERNALIZED_STRING_LIST_ADAPTER, V)
// Adapts one XXX_SYMBOL_LIST_GENERATOR entry to the ROOT_LIST-compatible entry // Adapts one XXX_SYMBOL_LIST_GENERATOR entry to the ROOT_LIST-compatible entry
#define SYMBOL_ROOT_LIST_ADAPTER(V, name, ...) V(Symbol, name, name) #define SYMBOL_ROOT_LIST_ADAPTER(V, name, ...) V(Symbol*, name, name)
// Produces (Symbol, name, CamelCase) entries // Produces (Symbol*, name, CamelCase) entries
#define PRIVATE_SYMBOL_ROOT_LIST(V) \ #define PRIVATE_SYMBOL_ROOT_LIST(V) \
PRIVATE_SYMBOL_LIST_GENERATOR(SYMBOL_ROOT_LIST_ADAPTER, V) PRIVATE_SYMBOL_LIST_GENERATOR(SYMBOL_ROOT_LIST_ADAPTER, V)
#define PUBLIC_SYMBOL_ROOT_LIST(V) \ #define PUBLIC_SYMBOL_ROOT_LIST(V) \
...@@ -318,9 +319,9 @@ class RootVisitor; ...@@ -318,9 +319,9 @@ class RootVisitor;
// Adapts one ACCESSOR_INFO_LIST_GENERATOR entry to the ROOT_LIST-compatible // Adapts one ACCESSOR_INFO_LIST_GENERATOR entry to the ROOT_LIST-compatible
// entry // entry
#define ACCESSOR_INFO_ROOT_LIST_ADAPTER(V, name, CamelName, ...) \ #define ACCESSOR_INFO_ROOT_LIST_ADAPTER(V, name, CamelName, ...) \
V(AccessorInfo, name##_accessor, CamelName##Accessor) V(AccessorInfo*, name##_accessor, CamelName##Accessor)
// Produces (AccessorInfo, name, CamelCase) entries // Produces (AccessorInfo*, name, CamelCase) entries
#define ACCESSOR_INFO_ROOT_LIST(V) \ #define ACCESSOR_INFO_ROOT_LIST(V) \
ACCESSOR_INFO_LIST_GENERATOR(ACCESSOR_INFO_ROOT_LIST_ADAPTER, V) ACCESSOR_INFO_LIST_GENERATOR(ACCESSOR_INFO_ROOT_LIST_ADAPTER, V)
...@@ -334,10 +335,10 @@ class RootVisitor; ...@@ -334,10 +335,10 @@ class RootVisitor;
ALLOCATION_SITE_MAPS_LIST(V) \ ALLOCATION_SITE_MAPS_LIST(V) \
DATA_HANDLER_MAPS_LIST(V) DATA_HANDLER_MAPS_LIST(V)
#define MUTABLE_ROOT_LIST(V) \ #define MUTABLE_ROOT_LIST(V) \
STRONG_MUTABLE_IMMOVABLE_ROOT_LIST(V) \ STRONG_MUTABLE_IMMOVABLE_ROOT_LIST(V) \
STRONG_MUTABLE_MOVABLE_ROOT_LIST(V) \ STRONG_MUTABLE_MOVABLE_ROOT_LIST(V) \
V(StringTable, string_table, StringTable) \ V(StringTable*, string_table, StringTable) \
SMI_ROOT_LIST(V) SMI_ROOT_LIST(V)
#define ROOT_LIST(V) \ #define ROOT_LIST(V) \
...@@ -495,9 +496,10 @@ class ReadOnlyRoots { ...@@ -495,9 +496,10 @@ class ReadOnlyRoots {
V8_INLINE explicit ReadOnlyRoots(Heap* heap); V8_INLINE explicit ReadOnlyRoots(Heap* heap);
V8_INLINE explicit ReadOnlyRoots(Isolate* isolate); V8_INLINE explicit ReadOnlyRoots(Isolate* isolate);
#define ROOT_ACCESSOR(type, name, CamelName) \ // TODO(jkummerow): Drop std::remove_pointer after the migration to ObjectPtr.
V8_INLINE class type* name(); \ #define ROOT_ACCESSOR(Type, name, CamelName) \
V8_INLINE Handle<type> name##_handle(); V8_INLINE class Type name() const; \
V8_INLINE Handle<std::remove_pointer<Type>::type> name##_handle() const;
READ_ONLY_ROOT_LIST(ROOT_ACCESSOR) READ_ONLY_ROOT_LIST(ROOT_ACCESSOR)
#undef ROOT_ACCESSOR #undef ROOT_ACCESSOR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment