From 61815a22bdfe94f432bf787831eafcaffedb73ef Mon Sep 17 00:00:00 2001 From: Seth Brenith Date: Wed, 9 Oct 2019 09:55:52 -0700 Subject: [PATCH] Use consistent capitalization rules for instance types In preparation for allowing Torque to generate the list of instance types, I'd like to make the rules a bit more consistent for how instance types are spelled. This CL is my proposal for a system where every non-String instance type name is exactly equal to calling CapifyStringWithUnderscores on the corresponding class name and appending "_TYPE". This change is almost all find&replace; the only manual changes are in: - src/objects/instance-type.h - src/torque/utils.cc - tools/gen-postmortem-metadata.py This change is in response to the review comment https://chromium-review.googlesource.com/c/v8/v8/+/1757094/25/src/builtins/base.tq#132 Change-Id: Ife3857292669f54931708e934398b2684e60bea5 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1814888 Commit-Queue: Seth Brenith Reviewed-by: Michael Starzinger Reviewed-by: Tobias Tebbi Reviewed-by: Frank Tang Cr-Commit-Position: refs/heads/master@{#64199} --- src/builtins/builtins-intl-gen.cc | 3 +- src/builtins/builtins-object-gen.cc | 4 +- src/builtins/builtins-regexp-gen.cc | 8 +- src/codegen/code-stub-assembler.cc | 4 +- src/compiler/js-call-reducer.cc | 4 +- src/compiler/types.cc | 38 +++---- src/diagnostics/objects-debug.cc | 38 +++---- src/diagnostics/objects-printer.cc | 38 +++---- src/heap/factory.cc | 14 +-- src/init/bootstrapper.cc | 57 +++++----- src/objects/arguments.h | 13 +-- src/objects/instance-type.h | 110 ++++++++++---------- src/objects/js-array.h | 4 +- src/objects/js-break-iterator.h | 2 +- src/objects/js-collator.h | 2 +- src/objects/js-date-time-format.h | 2 +- src/objects/js-list-format.h | 2 +- src/objects/js-locale.h | 2 +- src/objects/js-number-format.h | 2 +- src/objects/js-objects.cc | 74 ++++++------- src/objects/js-objects.h | 8 +- src/objects/js-plural-rules.h | 2 +- src/objects/js-proxy.h | 2 +- src/objects/js-regexp.h | 4 +- src/objects/js-relative-time-format.h | 2 +- src/objects/js-segment-iterator.h | 2 +- src/objects/js-segmenter.h | 2 +- src/objects/js-weak-refs.h | 2 +- src/objects/map-inl.h | 2 +- src/objects/map.cc | 38 +++---- src/objects/objects-body-descriptors-inl.h | 38 +++---- src/objects/objects-definitions.h | 42 ++++---- src/objects/value-serializer.cc | 6 +- src/torque/utils.cc | 16 ++- src/wasm/wasm-js.cc | 20 ++-- src/wasm/wasm-objects.h | 2 +- test/cctest/test-inobject-slack-tracking.cc | 2 +- tools/debug_helper/get-object-properties.cc | 40 +++---- tools/gen-postmortem-metadata.py | 5 +- tools/heap-stats/categories.js | 30 +++--- tools/v8heapconst.py | 38 +++---- 41 files changed, 364 insertions(+), 360 deletions(-) diff --git a/src/builtins/builtins-intl-gen.cc b/src/builtins/builtins-intl-gen.cc index ecc08b404e..2330553721 100644 --- a/src/builtins/builtins-intl-gen.cc +++ b/src/builtins/builtins-intl-gen.cc @@ -158,8 +158,7 @@ void IntlBuiltinsAssembler::ListFormatCommon(TNode context, // 3. If lf does not have an [[InitializedListFormat]] internal slot, throw a // TypeError exception. - ThrowIfNotInstanceType(context, receiver, JS_INTL_LIST_FORMAT_TYPE, - method_name); + ThrowIfNotInstanceType(context, receiver, JS_LIST_FORMAT_TYPE, method_name); TNode list_format = CAST(receiver); TNode list = args.GetOptionalArgumentValue(0); diff --git a/src/builtins/builtins-object-gen.cc b/src/builtins/builtins-object-gen.cc index 46eecde524..a35990e2f5 100644 --- a/src/builtins/builtins-object-gen.cc +++ b/src/builtins/builtins-object-gen.cc @@ -758,8 +758,8 @@ TF_BUILTIN(ObjectToString, ObjectBuiltinsAssembler) { } kJumpTable[] = {{JS_OBJECT_TYPE, &if_object}, {JS_ARRAY_TYPE, &if_array}, {JS_FUNCTION_TYPE, &if_function}, - {JS_REGEXP_TYPE, &if_regexp}, - {JS_ARGUMENTS_TYPE, &if_arguments}, + {JS_REG_EXP_TYPE, &if_regexp}, + {JS_ARGUMENTS_OBJECT_TYPE, &if_arguments}, {JS_DATE_TYPE, &if_date}, {JS_BOUND_FUNCTION_TYPE, &if_function}, {JS_API_OBJECT_TYPE, &if_apiobject}, diff --git a/src/builtins/builtins-regexp-gen.cc b/src/builtins/builtins-regexp-gen.cc index 9b7c717627..be73125eda 100644 --- a/src/builtins/builtins-regexp-gen.cc +++ b/src/builtins/builtins-regexp-gen.cc @@ -744,7 +744,7 @@ RegExpBuiltinsAssembler::RegExpPrototypeExecBodyWithoutResult( TNode context, TNode maybe_regexp, TNode string, Label* if_didnotmatch, const bool is_fastpath) { if (!is_fastpath) { - ThrowIfNotInstanceType(context, maybe_regexp, JS_REGEXP_TYPE, + ThrowIfNotInstanceType(context, maybe_regexp, JS_REG_EXP_TYPE, "RegExp.prototype.exec"); } @@ -949,7 +949,7 @@ TNode RegExpBuiltinsAssembler::IsFastRegExpWithOriginalExec( GotoIfForceSlowPath(&out); #endif - TNode is_regexp = HasInstanceType(object, JS_REGEXP_TYPE); + TNode is_regexp = HasInstanceType(object, JS_REG_EXP_TYPE); var_result = is_regexp; GotoIfNot(is_regexp, &out); @@ -1446,7 +1446,7 @@ TF_BUILTIN(RegExpPrototypeCompile, RegExpBuiltinsAssembler) { TNode maybe_flags = CAST(Parameter(Descriptor::kFlags)); TNode context = CAST(Parameter(Descriptor::kContext)); - ThrowIfNotInstanceType(context, maybe_receiver, JS_REGEXP_TYPE, + ThrowIfNotInstanceType(context, maybe_receiver, JS_REG_EXP_TYPE, "RegExp.prototype.compile"); const TNode receiver = CAST(maybe_receiver); @@ -1591,7 +1591,7 @@ TNode RegExpBuiltinsAssembler::RegExpExec( BIND(&if_isnotcallable); { - ThrowIfNotInstanceType(context, maybe_regexp, JS_REGEXP_TYPE, + ThrowIfNotInstanceType(context, maybe_regexp, JS_REG_EXP_TYPE, "RegExp.prototype.exec"); var_result = CallBuiltin(Builtins::kRegExpPrototypeExecSlow, context, diff --git a/src/codegen/code-stub-assembler.cc b/src/codegen/code-stub-assembler.cc index 77ced89f77..de3aed77c0 100644 --- a/src/codegen/code-stub-assembler.cc +++ b/src/codegen/code-stub-assembler.cc @@ -6302,7 +6302,7 @@ TNode CodeStubAssembler::IsJSStringIterator( TNode CodeStubAssembler::IsJSRegExpStringIterator( SloppyTNode object) { - return HasInstanceType(object, JS_REGEXP_STRING_ITERATOR_TYPE); + return HasInstanceType(object, JS_REG_EXP_STRING_ITERATOR_TYPE); } TNode CodeStubAssembler::IsMap(SloppyTNode map) { @@ -6638,7 +6638,7 @@ TNode CodeStubAssembler::IsJSDataView(TNode object) { } TNode CodeStubAssembler::IsJSRegExp(SloppyTNode object) { - return HasInstanceType(object, JS_REGEXP_TYPE); + return HasInstanceType(object, JS_REG_EXP_TYPE); } TNode CodeStubAssembler::IsNumber(SloppyTNode object) { diff --git a/src/compiler/js-call-reducer.cc b/src/compiler/js-call-reducer.cc index 617449b2b6..0620f7b76e 100644 --- a/src/compiler/js-call-reducer.cc +++ b/src/compiler/js-call-reducer.cc @@ -3705,7 +3705,7 @@ Reduction JSCallReducer::ReduceJSCall(Node* node, case Builtins::kMapIteratorPrototypeNext: return ReduceCollectionIteratorPrototypeNext( node, OrderedHashMap::kEntrySize, factory()->empty_ordered_hash_map(), - FIRST_MAP_ITERATOR_TYPE, LAST_MAP_ITERATOR_TYPE); + FIRST_JS_MAP_ITERATOR_TYPE, LAST_JS_MAP_ITERATOR_TYPE); case Builtins::kSetPrototypeEntries: return ReduceCollectionIteration(node, CollectionKind::kSet, IterationKind::kEntries); @@ -3717,7 +3717,7 @@ Reduction JSCallReducer::ReduceJSCall(Node* node, case Builtins::kSetIteratorPrototypeNext: return ReduceCollectionIteratorPrototypeNext( node, OrderedHashSet::kEntrySize, factory()->empty_ordered_hash_set(), - FIRST_SET_ITERATOR_TYPE, LAST_SET_ITERATOR_TYPE); + FIRST_JS_SET_ITERATOR_TYPE, LAST_JS_SET_ITERATOR_TYPE); case Builtins::kDatePrototypeGetTime: return ReduceDatePrototypeGetTime(node); case Builtins::kDateNow: diff --git a/src/compiler/types.cc b/src/compiler/types.cc index 018c54c3d5..477c8acd08 100644 --- a/src/compiler/types.cc +++ b/src/compiler/types.cc @@ -183,7 +183,7 @@ Type::bitset BitsetType::Lub(const MapRefLike& map) { case HEAP_NUMBER_TYPE: return kNumber; case JS_OBJECT_TYPE: - case JS_ARGUMENTS_TYPE: + case JS_ARGUMENTS_OBJECT_TYPE: case JS_ERROR_TYPE: case JS_GLOBAL_OBJECT_TYPE: case JS_GLOBAL_PROXY_TYPE: @@ -207,16 +207,16 @@ Type::bitset BitsetType::Lub(const MapRefLike& map) { case JS_MESSAGE_OBJECT_TYPE: case JS_DATE_TYPE: #ifdef V8_INTL_SUPPORT - case JS_INTL_V8_BREAK_ITERATOR_TYPE: - case JS_INTL_COLLATOR_TYPE: - case JS_INTL_DATE_TIME_FORMAT_TYPE: - case JS_INTL_LIST_FORMAT_TYPE: - case JS_INTL_LOCALE_TYPE: - case JS_INTL_NUMBER_FORMAT_TYPE: - case JS_INTL_PLURAL_RULES_TYPE: - case JS_INTL_RELATIVE_TIME_FORMAT_TYPE: - case JS_INTL_SEGMENT_ITERATOR_TYPE: - case JS_INTL_SEGMENTER_TYPE: + case JS_V8_BREAK_ITERATOR_TYPE: + case JS_COLLATOR_TYPE: + case JS_DATE_TIME_FORMAT_TYPE: + case JS_LIST_FORMAT_TYPE: + case JS_LOCALE_TYPE: + case JS_NUMBER_FORMAT_TYPE: + case JS_PLURAL_RULES_TYPE: + case JS_RELATIVE_TIME_FORMAT_TYPE: + case JS_SEGMENT_ITERATOR_TYPE: + case JS_SEGMENTER_TYPE: #endif // V8_INTL_SUPPORT case JS_CONTEXT_EXTENSION_OBJECT_TYPE: case JS_GENERATOR_OBJECT_TYPE: @@ -225,8 +225,8 @@ Type::bitset BitsetType::Lub(const MapRefLike& map) { case JS_MODULE_NAMESPACE_TYPE: case JS_ARRAY_BUFFER_TYPE: case JS_ARRAY_ITERATOR_TYPE: - case JS_REGEXP_TYPE: // TODO(rossberg): there should be a RegExp type. - case JS_REGEXP_STRING_ITERATOR_TYPE: + case JS_REG_EXP_TYPE: + case JS_REG_EXP_STRING_ITERATOR_TYPE: case JS_TYPED_ARRAY_TYPE: case JS_DATA_VIEW_TYPE: case JS_SET_TYPE: @@ -244,12 +244,12 @@ Type::bitset BitsetType::Lub(const MapRefLike& map) { case JS_WEAK_REF_TYPE: case JS_WEAK_SET_TYPE: case JS_PROMISE_TYPE: - case WASM_EXCEPTION_TYPE: - case WASM_GLOBAL_TYPE: - case WASM_INSTANCE_TYPE: - case WASM_MEMORY_TYPE: - case WASM_MODULE_TYPE: - case WASM_TABLE_TYPE: + case WASM_EXCEPTION_OBJECT_TYPE: + case WASM_GLOBAL_OBJECT_TYPE: + case WASM_INSTANCE_OBJECT_TYPE: + case WASM_MEMORY_OBJECT_TYPE: + case WASM_MODULE_OBJECT_TYPE: + case WASM_TABLE_OBJECT_TYPE: case WEAK_CELL_TYPE: DCHECK(!map.is_callable()); DCHECK(!map.is_undetectable()); diff --git a/src/diagnostics/objects-debug.cc b/src/diagnostics/objects-debug.cc index effa6742e8..cf0160db49 100644 --- a/src/diagnostics/objects-debug.cc +++ b/src/diagnostics/objects-debug.cc @@ -259,25 +259,25 @@ void HeapObject::HeapObjectVerify(Isolate* isolate) { case JS_CONTEXT_EXTENSION_OBJECT_TYPE: JSObject::cast(*this).JSObjectVerify(isolate); break; - case WASM_MODULE_TYPE: + case WASM_MODULE_OBJECT_TYPE: WasmModuleObject::cast(*this).WasmModuleObjectVerify(isolate); break; - case WASM_TABLE_TYPE: + case WASM_TABLE_OBJECT_TYPE: WasmTableObject::cast(*this).WasmTableObjectVerify(isolate); break; - case WASM_MEMORY_TYPE: + case WASM_MEMORY_OBJECT_TYPE: WasmMemoryObject::cast(*this).WasmMemoryObjectVerify(isolate); break; - case WASM_GLOBAL_TYPE: + case WASM_GLOBAL_OBJECT_TYPE: WasmGlobalObject::cast(*this).WasmGlobalObjectVerify(isolate); break; - case WASM_EXCEPTION_TYPE: + case WASM_EXCEPTION_OBJECT_TYPE: WasmExceptionObject::cast(*this).WasmExceptionObjectVerify(isolate); break; - case WASM_INSTANCE_TYPE: + case WASM_INSTANCE_OBJECT_TYPE: WasmInstanceObject::cast(*this).WasmInstanceObjectVerify(isolate); break; - case JS_ARGUMENTS_TYPE: + case JS_ARGUMENTS_OBJECT_TYPE: JSArgumentsObject::cast(*this).JSArgumentsObjectVerify(isolate); break; case JS_GENERATOR_OBJECT_TYPE: @@ -366,10 +366,10 @@ void HeapObject::HeapObjectVerify(Isolate* isolate) { case JS_PROMISE_TYPE: JSPromise::cast(*this).JSPromiseVerify(isolate); break; - case JS_REGEXP_TYPE: + case JS_REG_EXP_TYPE: JSRegExp::cast(*this).JSRegExpVerify(isolate); break; - case JS_REGEXP_STRING_ITERATOR_TYPE: + case JS_REG_EXP_STRING_ITERATOR_TYPE: JSRegExpStringIterator::cast(*this).JSRegExpStringIteratorVerify(isolate); break; case FILLER_TYPE: @@ -426,34 +426,34 @@ void HeapObject::HeapObjectVerify(Isolate* isolate) { CodeDataContainer::cast(*this).CodeDataContainerVerify(isolate); break; #ifdef V8_INTL_SUPPORT - case JS_INTL_V8_BREAK_ITERATOR_TYPE: + case JS_V8_BREAK_ITERATOR_TYPE: JSV8BreakIterator::cast(*this).JSV8BreakIteratorVerify(isolate); break; - case JS_INTL_COLLATOR_TYPE: + case JS_COLLATOR_TYPE: JSCollator::cast(*this).JSCollatorVerify(isolate); break; - case JS_INTL_DATE_TIME_FORMAT_TYPE: + case JS_DATE_TIME_FORMAT_TYPE: JSDateTimeFormat::cast(*this).JSDateTimeFormatVerify(isolate); break; - case JS_INTL_LIST_FORMAT_TYPE: + case JS_LIST_FORMAT_TYPE: JSListFormat::cast(*this).JSListFormatVerify(isolate); break; - case JS_INTL_LOCALE_TYPE: + case JS_LOCALE_TYPE: JSLocale::cast(*this).JSLocaleVerify(isolate); break; - case JS_INTL_NUMBER_FORMAT_TYPE: + case JS_NUMBER_FORMAT_TYPE: JSNumberFormat::cast(*this).JSNumberFormatVerify(isolate); break; - case JS_INTL_PLURAL_RULES_TYPE: + case JS_PLURAL_RULES_TYPE: JSPluralRules::cast(*this).JSPluralRulesVerify(isolate); break; - case JS_INTL_RELATIVE_TIME_FORMAT_TYPE: + case JS_RELATIVE_TIME_FORMAT_TYPE: JSRelativeTimeFormat::cast(*this).JSRelativeTimeFormatVerify(isolate); break; - case JS_INTL_SEGMENT_ITERATOR_TYPE: + case JS_SEGMENT_ITERATOR_TYPE: JSSegmentIterator::cast(*this).JSSegmentIteratorVerify(isolate); break; - case JS_INTL_SEGMENTER_TYPE: + case JS_SEGMENTER_TYPE: JSSegmenter::cast(*this).JSSegmenterVerify(isolate); break; #endif // V8_INTL_SUPPORT diff --git a/src/diagnostics/objects-printer.cc b/src/diagnostics/objects-printer.cc index 9da737f3aa..bd6c068119 100644 --- a/src/diagnostics/objects-printer.cc +++ b/src/diagnostics/objects-printer.cc @@ -215,25 +215,25 @@ void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT case JS_API_OBJECT_TYPE: case JS_SPECIAL_API_OBJECT_TYPE: case JS_CONTEXT_EXTENSION_OBJECT_TYPE: - case JS_ARGUMENTS_TYPE: + case JS_ARGUMENTS_OBJECT_TYPE: case JS_ERROR_TYPE: // TODO(titzer): debug printing for more wasm objects - case WASM_EXCEPTION_TYPE: + case WASM_EXCEPTION_OBJECT_TYPE: JSObject::cast(*this).JSObjectPrint(os); break; - case WASM_MODULE_TYPE: + case WASM_MODULE_OBJECT_TYPE: WasmModuleObject::cast(*this).WasmModuleObjectPrint(os); break; - case WASM_MEMORY_TYPE: + case WASM_MEMORY_OBJECT_TYPE: WasmMemoryObject::cast(*this).WasmMemoryObjectPrint(os); break; - case WASM_TABLE_TYPE: + case WASM_TABLE_OBJECT_TYPE: WasmTableObject::cast(*this).WasmTableObjectPrint(os); break; - case WASM_GLOBAL_TYPE: + case WASM_GLOBAL_OBJECT_TYPE: WasmGlobalObject::cast(*this).WasmGlobalObjectPrint(os); break; - case WASM_INSTANCE_TYPE: + case WASM_INSTANCE_OBJECT_TYPE: WasmInstanceObject::cast(*this).WasmInstanceObjectPrint(os); break; case JS_ASYNC_FUNCTION_OBJECT_TYPE: @@ -247,10 +247,10 @@ void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT case JS_ARRAY_TYPE: JSArray::cast(*this).JSArrayPrint(os); break; - case JS_REGEXP_TYPE: + case JS_REG_EXP_TYPE: JSRegExp::cast(*this).JSRegExpPrint(os); break; - case JS_REGEXP_STRING_ITERATOR_TYPE: + case JS_REG_EXP_STRING_ITERATOR_TYPE: JSRegExpStringIterator::cast(*this).JSRegExpStringIteratorPrint(os); break; case ODDBALL_TYPE: @@ -362,34 +362,34 @@ void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT JSDataView::cast(*this).JSDataViewPrint(os); break; #ifdef V8_INTL_SUPPORT - case JS_INTL_V8_BREAK_ITERATOR_TYPE: + case JS_V8_BREAK_ITERATOR_TYPE: JSV8BreakIterator::cast(*this).JSV8BreakIteratorPrint(os); break; - case JS_INTL_COLLATOR_TYPE: + case JS_COLLATOR_TYPE: JSCollator::cast(*this).JSCollatorPrint(os); break; - case JS_INTL_DATE_TIME_FORMAT_TYPE: + case JS_DATE_TIME_FORMAT_TYPE: JSDateTimeFormat::cast(*this).JSDateTimeFormatPrint(os); break; - case JS_INTL_LIST_FORMAT_TYPE: + case JS_LIST_FORMAT_TYPE: JSListFormat::cast(*this).JSListFormatPrint(os); break; - case JS_INTL_LOCALE_TYPE: + case JS_LOCALE_TYPE: JSLocale::cast(*this).JSLocalePrint(os); break; - case JS_INTL_NUMBER_FORMAT_TYPE: + case JS_NUMBER_FORMAT_TYPE: JSNumberFormat::cast(*this).JSNumberFormatPrint(os); break; - case JS_INTL_PLURAL_RULES_TYPE: + case JS_PLURAL_RULES_TYPE: JSPluralRules::cast(*this).JSPluralRulesPrint(os); break; - case JS_INTL_RELATIVE_TIME_FORMAT_TYPE: + case JS_RELATIVE_TIME_FORMAT_TYPE: JSRelativeTimeFormat::cast(*this).JSRelativeTimeFormatPrint(os); break; - case JS_INTL_SEGMENT_ITERATOR_TYPE: + case JS_SEGMENT_ITERATOR_TYPE: JSSegmentIterator::cast(*this).JSSegmentIteratorPrint(os); break; - case JS_INTL_SEGMENTER_TYPE: + case JS_SEGMENTER_TYPE: JSSegmenter::cast(*this).JSSegmenterPrint(os); break; #endif // V8_INTL_SUPPORT diff --git a/src/heap/factory.cc b/src/heap/factory.cc index e5072a86aa..0d426f4591 100644 --- a/src/heap/factory.cc +++ b/src/heap/factory.cc @@ -1958,16 +1958,16 @@ Handle Factory::CopyJSObjectWithAllocationSite( // We can only clone regexps, normal objects, api objects, errors or arrays. // Copying anything else will break invariants. - CHECK(map->instance_type() == JS_REGEXP_TYPE || + CHECK(map->instance_type() == JS_REG_EXP_TYPE || map->instance_type() == JS_OBJECT_TYPE || map->instance_type() == JS_ERROR_TYPE || map->instance_type() == JS_ARRAY_TYPE || map->instance_type() == JS_API_OBJECT_TYPE || - map->instance_type() == WASM_GLOBAL_TYPE || - map->instance_type() == WASM_INSTANCE_TYPE || - map->instance_type() == WASM_MEMORY_TYPE || - map->instance_type() == WASM_MODULE_TYPE || - map->instance_type() == WASM_TABLE_TYPE || + map->instance_type() == WASM_GLOBAL_OBJECT_TYPE || + map->instance_type() == WASM_INSTANCE_OBJECT_TYPE || + map->instance_type() == WASM_MEMORY_OBJECT_TYPE || + map->instance_type() == WASM_MODULE_OBJECT_TYPE || + map->instance_type() == WASM_TABLE_OBJECT_TYPE || map->instance_type() == JS_SPECIAL_API_OBJECT_TYPE); DCHECK(site.is_null() || AllocationSite::CanTrack(map->instance_type())); @@ -2405,7 +2405,7 @@ Handle Factory::NewFunction(const NewFunctionArgs& args) { case JS_ARRAY_TYPE: elements_kind = PACKED_SMI_ELEMENTS; break; - case JS_ARGUMENTS_TYPE: + case JS_ARGUMENTS_OBJECT_TYPE: elements_kind = PACKED_ELEMENTS; break; default: diff --git a/src/init/bootstrapper.cc b/src/init/bootstrapper.cc index b2e7ee471e..3bb16fb954 100644 --- a/src/init/bootstrapper.cc +++ b/src/init/bootstrapper.cc @@ -2459,7 +2459,7 @@ void Genesis::InitializeGlobal(Handle global_object, { // -- R e g E x p // Builtin functions for RegExp.prototype. Handle regexp_fun = InstallFunction( - isolate_, global, "RegExp", JS_REGEXP_TYPE, + isolate_, global, "RegExp", JS_REG_EXP_TYPE, JSRegExp::kSize + JSRegExp::kInObjectFieldCount * kTaggedSize, JSRegExp::kInObjectFieldCount, factory->the_hole_value(), Builtins::kRegExpConstructor); @@ -2674,7 +2674,7 @@ void Genesis::InitializeGlobal(Handle global_object, true); Handle regexp_string_iterator_function = CreateFunction( - isolate(), "RegExpStringIterator", JS_REGEXP_STRING_ITERATOR_TYPE, + isolate(), "RegExpStringIterator", JS_REG_EXP_STRING_ITERATOR_TYPE, JSRegExpStringIterator::kSize, 0, regexp_string_iterator_prototype, Builtins::kIllegal); regexp_string_iterator_function->shared().set_native(false); @@ -2913,7 +2913,7 @@ void Genesis::InitializeGlobal(Handle global_object, { // -- D a t e T i m e F o r m a t Handle date_time_format_constructor = InstallFunction( - isolate_, intl, "DateTimeFormat", JS_INTL_DATE_TIME_FORMAT_TYPE, + isolate_, intl, "DateTimeFormat", JS_DATE_TIME_FORMAT_TYPE, JSDateTimeFormat::kSize, 0, factory->the_hole_value(), Builtins::kDateTimeFormatConstructor); date_time_format_constructor->shared().set_length(0); @@ -2951,10 +2951,10 @@ void Genesis::InitializeGlobal(Handle global_object, } { // -- N u m b e r F o r m a t - Handle number_format_constructor = InstallFunction( - isolate_, intl, "NumberFormat", JS_INTL_NUMBER_FORMAT_TYPE, - JSNumberFormat::kSize, 0, factory->the_hole_value(), - Builtins::kNumberFormatConstructor); + Handle number_format_constructor = + InstallFunction(isolate_, intl, "NumberFormat", JS_NUMBER_FORMAT_TYPE, + JSNumberFormat::kSize, 0, factory->the_hole_value(), + Builtins::kNumberFormatConstructor); number_format_constructor->shared().set_length(0); number_format_constructor->shared().DontAdaptArguments(); InstallWithIntrinsicDefaultProto( @@ -2983,8 +2983,8 @@ void Genesis::InitializeGlobal(Handle global_object, { // -- C o l l a t o r Handle collator_constructor = InstallFunction( - isolate_, intl, "Collator", JS_INTL_COLLATOR_TYPE, JSCollator::kSize, - 0, factory->the_hole_value(), Builtins::kCollatorConstructor); + isolate_, intl, "Collator", JS_COLLATOR_TYPE, JSCollator::kSize, 0, + factory->the_hole_value(), Builtins::kCollatorConstructor); collator_constructor->shared().DontAdaptArguments(); InstallWithIntrinsicDefaultProto(isolate_, collator_constructor, Context::INTL_COLLATOR_FUNCTION_INDEX); @@ -3008,7 +3008,7 @@ void Genesis::InitializeGlobal(Handle global_object, { // -- V 8 B r e a k I t e r a t o r Handle v8_break_iterator_constructor = InstallFunction( - isolate_, intl, "v8BreakIterator", JS_INTL_V8_BREAK_ITERATOR_TYPE, + isolate_, intl, "v8BreakIterator", JS_V8_BREAK_ITERATOR_TYPE, JSV8BreakIterator::kSize, 0, factory->the_hole_value(), Builtins::kV8BreakIteratorConstructor); v8_break_iterator_constructor->shared().DontAdaptArguments(); @@ -3043,10 +3043,10 @@ void Genesis::InitializeGlobal(Handle global_object, } { // -- P l u r a l R u l e s - Handle plural_rules_constructor = InstallFunction( - isolate_, intl, "PluralRules", JS_INTL_PLURAL_RULES_TYPE, - JSPluralRules::kSize, 0, factory->the_hole_value(), - Builtins::kPluralRulesConstructor); + Handle plural_rules_constructor = + InstallFunction(isolate_, intl, "PluralRules", JS_PLURAL_RULES_TYPE, + JSPluralRules::kSize, 0, factory->the_hole_value(), + Builtins::kPluralRulesConstructor); plural_rules_constructor->shared().DontAdaptArguments(); InstallWithIntrinsicDefaultProto( isolate_, plural_rules_constructor, @@ -3071,9 +3071,9 @@ void Genesis::InitializeGlobal(Handle global_object, { // -- R e l a t i v e T i m e F o r m a t Handle relative_time_format_fun = InstallFunction( - isolate(), intl, "RelativeTimeFormat", - JS_INTL_RELATIVE_TIME_FORMAT_TYPE, JSRelativeTimeFormat::kSize, 0, - factory->the_hole_value(), Builtins::kRelativeTimeFormatConstructor); + isolate(), intl, "RelativeTimeFormat", JS_RELATIVE_TIME_FORMAT_TYPE, + JSRelativeTimeFormat::kSize, 0, factory->the_hole_value(), + Builtins::kRelativeTimeFormatConstructor); relative_time_format_fun->shared().set_length(0); relative_time_format_fun->shared().DontAdaptArguments(); InstallWithIntrinsicDefaultProto( @@ -3103,10 +3103,10 @@ void Genesis::InitializeGlobal(Handle global_object, } { // -- L i s t F o r m a t - Handle list_format_fun = InstallFunction( - isolate(), intl, "ListFormat", JS_INTL_LIST_FORMAT_TYPE, - JSListFormat::kSize, 0, factory->the_hole_value(), - Builtins::kListFormatConstructor); + Handle list_format_fun = + InstallFunction(isolate(), intl, "ListFormat", JS_LIST_FORMAT_TYPE, + JSListFormat::kSize, 0, factory->the_hole_value(), + Builtins::kListFormatConstructor); list_format_fun->shared().set_length(0); list_format_fun->shared().DontAdaptArguments(); InstallWithIntrinsicDefaultProto( @@ -3133,7 +3133,7 @@ void Genesis::InitializeGlobal(Handle global_object, { // -- L o c a l e Handle locale_fun = InstallFunction( - isolate(), intl, "Locale", JS_INTL_LOCALE_TYPE, JSLocale::kSize, 0, + isolate(), intl, "Locale", JS_LOCALE_TYPE, JSLocale::kSize, 0, factory->the_hole_value(), Builtins::kLocaleConstructor); InstallWithIntrinsicDefaultProto(isolate(), locale_fun, Context::INTL_LOCALE_FUNCTION_INDEX); @@ -3791,7 +3791,7 @@ void Genesis::InitializeGlobal(Handle global_object, Handle arguments_string = factory->Arguments_string(); NewFunctionArgs args = NewFunctionArgs::ForBuiltinWithPrototype( arguments_string, isolate_->initial_object_prototype(), - JS_ARGUMENTS_TYPE, JSSloppyArgumentsObject::kSize, 2, + JS_ARGUMENTS_OBJECT_TYPE, JSSloppyArgumentsObject::kSize, 2, Builtins::kIllegal, MUTABLE); Handle function = factory->NewFunction(args); Handle map(function->initial_map(), isolate()); @@ -3848,8 +3848,9 @@ void Genesis::InitializeGlobal(Handle global_object, callee->set_setter(*poison); // Create the map. Allocate one in-object field for length. - Handle map = factory->NewMap( - JS_ARGUMENTS_TYPE, JSStrictArgumentsObject::kSize, PACKED_ELEMENTS, 1); + Handle map = + factory->NewMap(JS_ARGUMENTS_OBJECT_TYPE, + JSStrictArgumentsObject::kSize, PACKED_ELEMENTS, 1); // Create the descriptor array for the arguments object. Map::EnsureDescriptorSlack(isolate_, map, 2); @@ -4484,8 +4485,8 @@ void Genesis::InitializeGlobal_harmony_intl_segmenter() { .ToHandleChecked()); Handle segmenter_fun = InstallFunction( - isolate(), intl, "Segmenter", JS_INTL_SEGMENTER_TYPE, JSSegmenter::kSize, - 0, factory()->the_hole_value(), Builtins::kSegmenterConstructor); + isolate(), intl, "Segmenter", JS_SEGMENTER_TYPE, JSSegmenter::kSize, 0, + factory()->the_hole_value(), Builtins::kSegmenterConstructor); segmenter_fun->shared().set_length(0); segmenter_fun->shared().DontAdaptArguments(); InstallWithIntrinsicDefaultProto(isolate_, segmenter_fun, @@ -4544,7 +4545,7 @@ void Genesis::InitializeGlobal_harmony_intl_segmenter() { isolate()->factory()->SegmentIterator_string()) .ToHandleChecked(); Handle segment_iterator_fun = CreateFunction( - isolate(), name_string, JS_INTL_SEGMENT_ITERATOR_TYPE, + isolate(), name_string, JS_SEGMENT_ITERATOR_TYPE, JSSegmentIterator::kSize, 0, prototype, Builtins::kIllegal); segment_iterator_fun->shared().set_native(false); diff --git a/src/objects/arguments.h b/src/objects/arguments.h index a306ef592a..0a1e3e4ac9 100644 --- a/src/objects/arguments.h +++ b/src/objects/arguments.h @@ -16,7 +16,7 @@ namespace v8 { namespace internal { -// Superclass for all objects with instance type {JS_ARGUMENTS_TYPE} +// Superclass for all objects with instance type {JS_ARGUMENTS_OBJECT_TYPE} class JSArgumentsObject : public TorqueGeneratedJSArgumentsObject { public: @@ -25,15 +25,16 @@ class JSArgumentsObject }; // Common superclass for JSSloppyArgumentsObject and JSStrictArgumentsObject. -// Note that the instance type {JS_ARGUMENTS_TYPE} does _not_ guarantee the -// below layout, the in-object properties might have transitioned to dictionary -// mode already. Only use the below layout with the specific initial maps. +// Note that the instance type {JS_ARGUMENTS_OBJECT_TYPE} does _not_ guarantee +// the below layout, the in-object properties might have transitioned to +// dictionary mode already. Only use the below layout with the specific initial +// maps. class JSArgumentsObjectWithLength : public JSArgumentsObject { public: // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS( JSObject::kHeaderSize, - TORQUE_GENERATED_JSARGUMENTS_OBJECT_WITH_LENGTH_FIELDS) + TORQUE_GENERATED_JS_ARGUMENTS_OBJECT_WITH_LENGTH_FIELDS) // Indices of in-object properties. static const int kLengthIndex = 0; @@ -50,7 +51,7 @@ class JSSloppyArgumentsObject : public JSArgumentsObjectWithLength { public: DEFINE_FIELD_OFFSET_CONSTANTS( JSArgumentsObjectWithLength::kSize, - TORQUE_GENERATED_JSSLOPPY_ARGUMENTS_OBJECT_FIELDS) + TORQUE_GENERATED_JS_SLOPPY_ARGUMENTS_OBJECT_FIELDS) // Indices of in-object properties. static const int kCalleeIndex = kLengthIndex + 1; diff --git a/src/objects/instance-type.h b/src/objects/instance-type.h index 1fd021ad0c..e592022b89 100644 --- a/src/objects/instance-type.h +++ b/src/objects/instance-type.h @@ -263,7 +263,7 @@ enum InstanceType : uint16_t { // Like JS_OBJECT_TYPE, but created from API function. JS_API_OBJECT_TYPE = 0x0420, JS_OBJECT_TYPE, - JS_ARGUMENTS_TYPE, + JS_ARGUMENTS_OBJECT_TYPE, JS_ARRAY_BUFFER_TYPE, JS_ARRAY_ITERATOR_TYPE, JS_ARRAY_TYPE, @@ -280,8 +280,8 @@ enum InstanceType : uint16_t { JS_MAP_VALUE_ITERATOR_TYPE, JS_MESSAGE_OBJECT_TYPE, JS_PROMISE_TYPE, - JS_REGEXP_TYPE, - JS_REGEXP_STRING_ITERATOR_TYPE, + JS_REG_EXP_TYPE, + JS_REG_EXP_STRING_ITERATOR_TYPE, JS_SET_TYPE, JS_SET_KEY_VALUE_ITERATOR_TYPE, JS_SET_VALUE_ITERATOR_TYPE, @@ -296,24 +296,24 @@ enum InstanceType : uint16_t { JS_DATA_VIEW_TYPE, #ifdef V8_INTL_SUPPORT - JS_INTL_V8_BREAK_ITERATOR_TYPE, - JS_INTL_COLLATOR_TYPE, - JS_INTL_DATE_TIME_FORMAT_TYPE, - JS_INTL_LIST_FORMAT_TYPE, - JS_INTL_LOCALE_TYPE, - JS_INTL_NUMBER_FORMAT_TYPE, - JS_INTL_PLURAL_RULES_TYPE, - JS_INTL_RELATIVE_TIME_FORMAT_TYPE, - JS_INTL_SEGMENT_ITERATOR_TYPE, - JS_INTL_SEGMENTER_TYPE, + JS_V8_BREAK_ITERATOR_TYPE, + JS_COLLATOR_TYPE, + JS_DATE_TIME_FORMAT_TYPE, + JS_LIST_FORMAT_TYPE, + JS_LOCALE_TYPE, + JS_NUMBER_FORMAT_TYPE, + JS_PLURAL_RULES_TYPE, + JS_RELATIVE_TIME_FORMAT_TYPE, + JS_SEGMENT_ITERATOR_TYPE, + JS_SEGMENTER_TYPE, #endif // V8_INTL_SUPPORT - WASM_EXCEPTION_TYPE, - WASM_GLOBAL_TYPE, - WASM_INSTANCE_TYPE, - WASM_MEMORY_TYPE, - WASM_MODULE_TYPE, - WASM_TABLE_TYPE, + WASM_EXCEPTION_OBJECT_TYPE, + WASM_GLOBAL_OBJECT_TYPE, + WASM_INSTANCE_OBJECT_TYPE, + WASM_MEMORY_OBJECT_TYPE, + WASM_MODULE_OBJECT_TYPE, + WASM_TABLE_OBJECT_TYPE, JS_BOUND_FUNCTION_TYPE, JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE @@ -367,11 +367,11 @@ enum InstanceType : uint16_t { // wrappers. LAST_CUSTOM_ELEMENTS_RECEIVER = JS_PRIMITIVE_WRAPPER_TYPE, - FIRST_SET_ITERATOR_TYPE = JS_SET_KEY_VALUE_ITERATOR_TYPE, - LAST_SET_ITERATOR_TYPE = JS_SET_VALUE_ITERATOR_TYPE, + FIRST_JS_SET_ITERATOR_TYPE = JS_SET_KEY_VALUE_ITERATOR_TYPE, + LAST_JS_SET_ITERATOR_TYPE = JS_SET_VALUE_ITERATOR_TYPE, - FIRST_MAP_ITERATOR_TYPE = JS_MAP_KEY_ITERATOR_TYPE, - LAST_MAP_ITERATOR_TYPE = JS_MAP_VALUE_ITERATOR_TYPE, + FIRST_JS_MAP_ITERATOR_TYPE = JS_MAP_KEY_ITERATOR_TYPE, + LAST_JS_MAP_ITERATOR_TYPE = JS_MAP_VALUE_ITERATOR_TYPE, }; // This constant is defined outside of the InstanceType enum because the @@ -424,8 +424,8 @@ V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, V(FreeSpace, FREE_SPACE_TYPE) \ V(GlobalDictionary, GLOBAL_DICTIONARY_TYPE) \ V(HeapNumber, HEAP_NUMBER_TYPE) \ - V(JSArgumentsObject, JS_ARGUMENTS_TYPE) \ - V(JSArgumentsObjectWithLength, JS_ARGUMENTS_TYPE) \ + V(JSArgumentsObject, JS_ARGUMENTS_OBJECT_TYPE) \ + V(JSArgumentsObjectWithLength, JS_ARGUMENTS_OBJECT_TYPE) \ V(JSArray, JS_ARRAY_TYPE) \ V(JSArrayBuffer, JS_ARRAY_BUFFER_TYPE) \ V(JSArrayIterator, JS_ARRAY_ITERATOR_TYPE) \ @@ -449,10 +449,10 @@ V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, V(JSPrimitiveWrapper, JS_PRIMITIVE_WRAPPER_TYPE) \ V(JSPromise, JS_PROMISE_TYPE) \ V(JSProxy, JS_PROXY_TYPE) \ - V(JSRegExp, JS_REGEXP_TYPE) \ + V(JSRegExp, JS_REG_EXP_TYPE) \ V(JSRegExpResult, JS_ARRAY_TYPE) \ V(JSRegExpResultIndices, JS_ARRAY_TYPE) \ - V(JSRegExpStringIterator, JS_REGEXP_STRING_ITERATOR_TYPE) \ + V(JSRegExpStringIterator, JS_REG_EXP_STRING_ITERATOR_TYPE) \ V(JSSet, JS_SET_TYPE) \ V(JSStringIterator, JS_STRING_ITERATOR_TYPE) \ V(JSTypedArray, JS_TYPED_ARRAY_TYPE) \ @@ -488,28 +488,28 @@ V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, V(UncompiledDataWithoutPreparseData, \ UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_TYPE) \ V(UncompiledDataWithPreparseData, UNCOMPILED_DATA_WITH_PREPARSE_DATA_TYPE) \ - V(WasmExceptionObject, WASM_EXCEPTION_TYPE) \ - V(WasmGlobalObject, WASM_GLOBAL_TYPE) \ - V(WasmInstanceObject, WASM_INSTANCE_TYPE) \ - V(WasmMemoryObject, WASM_MEMORY_TYPE) \ - V(WasmModuleObject, WASM_MODULE_TYPE) \ - V(WasmTableObject, WASM_TABLE_TYPE) \ + V(WasmExceptionObject, WASM_EXCEPTION_OBJECT_TYPE) \ + V(WasmGlobalObject, WASM_GLOBAL_OBJECT_TYPE) \ + V(WasmInstanceObject, WASM_INSTANCE_OBJECT_TYPE) \ + V(WasmMemoryObject, WASM_MEMORY_OBJECT_TYPE) \ + V(WasmModuleObject, WASM_MODULE_OBJECT_TYPE) \ + V(WasmTableObject, WASM_TABLE_OBJECT_TYPE) \ V(WeakArrayList, WEAK_ARRAY_LIST_TYPE) \ V(WeakCell, WEAK_CELL_TYPE) #ifdef V8_INTL_SUPPORT -#define INSTANCE_TYPE_CHECKERS_SINGLE(V) \ - INSTANCE_TYPE_CHECKERS_SINGLE_BASE(V) \ - V(JSV8BreakIterator, JS_INTL_V8_BREAK_ITERATOR_TYPE) \ - V(JSCollator, JS_INTL_COLLATOR_TYPE) \ - V(JSDateTimeFormat, JS_INTL_DATE_TIME_FORMAT_TYPE) \ - V(JSListFormat, JS_INTL_LIST_FORMAT_TYPE) \ - V(JSLocale, JS_INTL_LOCALE_TYPE) \ - V(JSNumberFormat, JS_INTL_NUMBER_FORMAT_TYPE) \ - V(JSPluralRules, JS_INTL_PLURAL_RULES_TYPE) \ - V(JSRelativeTimeFormat, JS_INTL_RELATIVE_TIME_FORMAT_TYPE) \ - V(JSSegmentIterator, JS_INTL_SEGMENT_ITERATOR_TYPE) \ - V(JSSegmenter, JS_INTL_SEGMENTER_TYPE) +#define INSTANCE_TYPE_CHECKERS_SINGLE(V) \ + INSTANCE_TYPE_CHECKERS_SINGLE_BASE(V) \ + V(JSV8BreakIterator, JS_V8_BREAK_ITERATOR_TYPE) \ + V(JSCollator, JS_COLLATOR_TYPE) \ + V(JSDateTimeFormat, JS_DATE_TIME_FORMAT_TYPE) \ + V(JSListFormat, JS_LIST_FORMAT_TYPE) \ + V(JSLocale, JS_LOCALE_TYPE) \ + V(JSNumberFormat, JS_NUMBER_FORMAT_TYPE) \ + V(JSPluralRules, JS_PLURAL_RULES_TYPE) \ + V(JSRelativeTimeFormat, JS_RELATIVE_TIME_FORMAT_TYPE) \ + V(JSSegmentIterator, JS_SEGMENT_ITERATOR_TYPE) \ + V(JSSegmenter, JS_SEGMENTER_TYPE) #else @@ -517,16 +517,16 @@ V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, #endif // V8_INTL_SUPPORT -#define INSTANCE_TYPE_CHECKERS_RANGE(V) \ - V(Context, FIRST_CONTEXT_TYPE, LAST_CONTEXT_TYPE) \ - V(FixedArray, FIRST_FIXED_ARRAY_TYPE, LAST_FIXED_ARRAY_TYPE) \ - V(HashTable, FIRST_HASH_TABLE_TYPE, LAST_HASH_TABLE_TYPE) \ - V(JSMapIterator, FIRST_MAP_ITERATOR_TYPE, LAST_MAP_ITERATOR_TYPE) \ - V(JSSetIterator, FIRST_SET_ITERATOR_TYPE, LAST_SET_ITERATOR_TYPE) \ - V(Microtask, FIRST_MICROTASK_TYPE, LAST_MICROTASK_TYPE) \ - V(Module, FIRST_MODULE_TYPE, LAST_MODULE_TYPE) \ - V(Name, FIRST_NAME_TYPE, LAST_NAME_TYPE) \ - V(String, FIRST_STRING_TYPE, LAST_STRING_TYPE) \ +#define INSTANCE_TYPE_CHECKERS_RANGE(V) \ + V(Context, FIRST_CONTEXT_TYPE, LAST_CONTEXT_TYPE) \ + V(FixedArray, FIRST_FIXED_ARRAY_TYPE, LAST_FIXED_ARRAY_TYPE) \ + V(HashTable, FIRST_HASH_TABLE_TYPE, LAST_HASH_TABLE_TYPE) \ + V(JSMapIterator, FIRST_JS_MAP_ITERATOR_TYPE, LAST_JS_MAP_ITERATOR_TYPE) \ + V(JSSetIterator, FIRST_JS_SET_ITERATOR_TYPE, LAST_JS_SET_ITERATOR_TYPE) \ + V(Microtask, FIRST_MICROTASK_TYPE, LAST_MICROTASK_TYPE) \ + V(Module, FIRST_MODULE_TYPE, LAST_MODULE_TYPE) \ + V(Name, FIRST_NAME_TYPE, LAST_NAME_TYPE) \ + V(String, FIRST_STRING_TYPE, LAST_STRING_TYPE) \ V(WeakFixedArray, FIRST_WEAK_FIXED_ARRAY_TYPE, LAST_WEAK_FIXED_ARRAY_TYPE) #define INSTANCE_TYPE_CHECKERS_CUSTOM(V) \ diff --git a/src/objects/js-array.h b/src/objects/js-array.h index eb581c104e..c990151b27 100644 --- a/src/objects/js-array.h +++ b/src/objects/js-array.h @@ -108,7 +108,7 @@ class JSArray : public JSObject { static const int kPreallocatedArrayElements = 4; DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSARRAY_FIELDS) + TORQUE_GENERATED_JS_ARRAY_FIELDS) static const int kLengthDescriptorIndex = 0; @@ -178,7 +178,7 @@ class JSArrayIterator : public JSObject { inline void set_kind(IterationKind kind); DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSARRAY_ITERATOR_FIELDS) + TORQUE_GENERATED_JS_ARRAY_ITERATOR_FIELDS) private: DECL_INT_ACCESSORS(raw_kind) diff --git a/src/objects/js-break-iterator.h b/src/objects/js-break-iterator.h index 2b0209632e..ea66fe6732 100644 --- a/src/objects/js-break-iterator.h +++ b/src/objects/js-break-iterator.h @@ -72,7 +72,7 @@ class JSV8BreakIterator : public JSObject { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSV8BREAK_ITERATOR_FIELDS) + TORQUE_GENERATED_JS_V8_BREAK_ITERATOR_FIELDS) private: DECL_INT_ACCESSORS(raw_type) diff --git a/src/objects/js-collator.h b/src/objects/js-collator.h index ab029e64a3..0147b80ebb 100644 --- a/src/objects/js-collator.h +++ b/src/objects/js-collator.h @@ -48,7 +48,7 @@ class JSCollator : public JSObject { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSCOLLATOR_FIELDS) + TORQUE_GENERATED_JS_COLLATOR_FIELDS) DECL_ACCESSORS(icu_collator, Managed) DECL_ACCESSORS(bound_compare, Object) diff --git a/src/objects/js-date-time-format.h b/src/objects/js-date-time-format.h index 6d4fd920aa..acf99b3618 100644 --- a/src/objects/js-date-time-format.h +++ b/src/objects/js-date-time-format.h @@ -95,7 +95,7 @@ class JSDateTimeFormat : public JSObject { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSDATE_TIME_FORMAT_FIELDS) + TORQUE_GENERATED_JS_DATE_TIME_FORMAT_FIELDS) inline void set_hour_cycle(Intl::HourCycle hour_cycle); inline Intl::HourCycle hour_cycle() const; diff --git a/src/objects/js-list-format.h b/src/objects/js-list-format.h index df937722e6..1ff76790f9 100644 --- a/src/objects/js-list-format.h +++ b/src/objects/js-list-format.h @@ -104,7 +104,7 @@ class JSListFormat : public JSObject { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSLIST_FORMAT_FIELDS) + TORQUE_GENERATED_JS_LIST_FORMAT_FIELDS) OBJECT_CONSTRUCTORS(JSListFormat, JSObject); }; diff --git a/src/objects/js-locale.h b/src/objects/js-locale.h index fbedd8384d..f2fca3ce14 100644 --- a/src/objects/js-locale.h +++ b/src/objects/js-locale.h @@ -65,7 +65,7 @@ class JSLocale : public JSObject { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSLOCALE_FIELDS) + TORQUE_GENERATED_JS_LOCALE_FIELDS) OBJECT_CONSTRUCTORS(JSLocale, JSObject); }; diff --git a/src/objects/js-number-format.h b/src/objects/js-number-format.h index d0807e5bef..a5196f8d51 100644 --- a/src/objects/js-number-format.h +++ b/src/objects/js-number-format.h @@ -82,7 +82,7 @@ class JSNumberFormat : public JSObject { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSNUMBER_FORMAT_FIELDS) + TORQUE_GENERATED_JS_NUMBER_FORMAT_FIELDS) // Bit positions in |flags|. #define FLAGS_BIT_FIELDS(V, _) \ diff --git a/src/objects/js-objects.cc b/src/objects/js-objects.cc index 7dd621c8ab..e37ab8ce92 100644 --- a/src/objects/js-objects.cc +++ b/src/objects/js-objects.cc @@ -2120,15 +2120,15 @@ int JSObject::GetHeaderSize(InstanceType type, return JSWeakSet::kSize; case JS_PROMISE_TYPE: return JSPromise::kSize; - case JS_REGEXP_TYPE: + case JS_REG_EXP_TYPE: return JSRegExp::kSize; - case JS_REGEXP_STRING_ITERATOR_TYPE: + case JS_REG_EXP_STRING_ITERATOR_TYPE: return JSRegExpStringIterator::kSize; case JS_CONTEXT_EXTENSION_OBJECT_TYPE: return JSObject::kHeaderSize; case JS_MESSAGE_OBJECT_TYPE: return JSMessageObject::kSize; - case JS_ARGUMENTS_TYPE: + case JS_ARGUMENTS_OBJECT_TYPE: return JSObject::kHeaderSize; case JS_ERROR_TYPE: return JSObject::kHeaderSize; @@ -2137,38 +2137,38 @@ int JSObject::GetHeaderSize(InstanceType type, case JS_MODULE_NAMESPACE_TYPE: return JSModuleNamespace::kHeaderSize; #ifdef V8_INTL_SUPPORT - case JS_INTL_V8_BREAK_ITERATOR_TYPE: + case JS_V8_BREAK_ITERATOR_TYPE: return JSV8BreakIterator::kSize; - case JS_INTL_COLLATOR_TYPE: + case JS_COLLATOR_TYPE: return JSCollator::kSize; - case JS_INTL_DATE_TIME_FORMAT_TYPE: + case JS_DATE_TIME_FORMAT_TYPE: return JSDateTimeFormat::kSize; - case JS_INTL_LIST_FORMAT_TYPE: + case JS_LIST_FORMAT_TYPE: return JSListFormat::kSize; - case JS_INTL_LOCALE_TYPE: + case JS_LOCALE_TYPE: return JSLocale::kSize; - case JS_INTL_NUMBER_FORMAT_TYPE: + case JS_NUMBER_FORMAT_TYPE: return JSNumberFormat::kSize; - case JS_INTL_PLURAL_RULES_TYPE: + case JS_PLURAL_RULES_TYPE: return JSPluralRules::kSize; - case JS_INTL_RELATIVE_TIME_FORMAT_TYPE: + case JS_RELATIVE_TIME_FORMAT_TYPE: return JSRelativeTimeFormat::kSize; - case JS_INTL_SEGMENT_ITERATOR_TYPE: + case JS_SEGMENT_ITERATOR_TYPE: return JSSegmentIterator::kSize; - case JS_INTL_SEGMENTER_TYPE: + case JS_SEGMENTER_TYPE: return JSSegmenter::kSize; #endif // V8_INTL_SUPPORT - case WASM_GLOBAL_TYPE: + case WASM_GLOBAL_OBJECT_TYPE: return WasmGlobalObject::kSize; - case WASM_INSTANCE_TYPE: + case WASM_INSTANCE_OBJECT_TYPE: return WasmInstanceObject::kSize; - case WASM_MEMORY_TYPE: + case WASM_MEMORY_OBJECT_TYPE: return WasmMemoryObject::kSize; - case WASM_MODULE_TYPE: + case WASM_MODULE_OBJECT_TYPE: return WasmModuleObject::kSize; - case WASM_TABLE_TYPE: + case WASM_TABLE_OBJECT_TYPE: return WasmTableObject::kSize; - case WASM_EXCEPTION_TYPE: + case WASM_EXCEPTION_OBJECT_TYPE: return WasmExceptionObject::kSize; default: UNREACHABLE(); @@ -2376,7 +2376,7 @@ void JSObject::JSObjectShortPrint(StringStream* accumulator) { accumulator->Add(""); break; } - case JS_REGEXP_TYPE: { + case JS_REG_EXP_TYPE: { accumulator->Add(" GetPrivateEntries( @@ -1120,7 +1120,7 @@ class JSFunction : public JSObject { static Handle ToString(Handle function); DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSFUNCTION_FIELDS) + TORQUE_GENERATED_JS_FUNCTION_FIELDS) static constexpr int kSizeWithoutPrototype = kPrototypeOrInitialMapOffset; static constexpr int kSizeWithPrototype = kSize; @@ -1180,7 +1180,7 @@ class JSGlobalObject : public JSObject { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSGLOBAL_OBJECT_FIELDS) + TORQUE_GENERATED_JS_GLOBAL_OBJECT_FIELDS) OBJECT_CONSTRUCTORS(JSGlobalObject, JSObject); }; @@ -1319,7 +1319,7 @@ class JSMessageObject : public JSObject { DECL_VERIFIER(JSMessageObject) DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSMESSAGE_OBJECT_FIELDS) + TORQUE_GENERATED_JS_MESSAGE_OBJECT_FIELDS) // TODO(v8:8989): [torque] Support marker constants. static const int kPointerFieldsEndOffset = kStartPositionOffset; diff --git a/src/objects/js-plural-rules.h b/src/objects/js-plural-rules.h index 840efb07ed..0303266894 100644 --- a/src/objects/js-plural-rules.h +++ b/src/objects/js-plural-rules.h @@ -68,7 +68,7 @@ class JSPluralRules : public JSObject { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSPLURAL_RULES_FIELDS) + TORQUE_GENERATED_JS_PLURAL_RULES_FIELDS) DECL_ACCESSORS(locale, String) DECL_INT_ACCESSORS(flags) diff --git a/src/objects/js-proxy.h b/src/objects/js-proxy.h index 8e29c08bc1..c6bb844fe5 100644 --- a/src/objects/js-proxy.h +++ b/src/objects/js-proxy.h @@ -128,7 +128,7 @@ class JSProxyRevocableResult : public JSObject { public: // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS( - JSObject::kHeaderSize, TORQUE_GENERATED_JSPROXY_REVOCABLE_RESULT_FIELDS) + JSObject::kHeaderSize, TORQUE_GENERATED_JS_PROXY_REVOCABLE_RESULT_FIELDS) // Indices of in-object properties. static const int kProxyIndex = 0; diff --git a/src/objects/js-regexp.h b/src/objects/js-regexp.h index e141f35a49..03efd4913c 100644 --- a/src/objects/js-regexp.h +++ b/src/objects/js-regexp.h @@ -230,7 +230,7 @@ class JSRegExpResult : public JSArray { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(JSArray::kSize, - TORQUE_GENERATED_JSREG_EXP_RESULT_FIELDS) + TORQUE_GENERATED_JS_REG_EXP_RESULT_FIELDS) static Handle GetAndCacheIndices( Isolate* isolate, Handle regexp_result); @@ -260,7 +260,7 @@ class JSRegExpResultIndices : public JSArray { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS( - JSArray::kSize, TORQUE_GENERATED_JSREG_EXP_RESULT_INDICES_FIELDS) + JSArray::kSize, TORQUE_GENERATED_JS_REG_EXP_RESULT_INDICES_FIELDS) static Handle BuildIndices( Isolate* isolate, Handle match_info, diff --git a/src/objects/js-relative-time-format.h b/src/objects/js-relative-time-format.h index 6e405e345e..c642367988 100644 --- a/src/objects/js-relative-time-format.h +++ b/src/objects/js-relative-time-format.h @@ -107,7 +107,7 @@ class JSRelativeTimeFormat : public JSObject { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSRELATIVE_TIME_FORMAT_FIELDS) + TORQUE_GENERATED_JS_RELATIVE_TIME_FORMAT_FIELDS) private: static Style getStyle(const char* str); diff --git a/src/objects/js-segment-iterator.h b/src/objects/js-segment-iterator.h index cadb99e79d..1c71af8864 100644 --- a/src/objects/js-segment-iterator.h +++ b/src/objects/js-segment-iterator.h @@ -91,7 +91,7 @@ class JSSegmentIterator : public JSObject { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSSEGMENT_ITERATOR_FIELDS) + TORQUE_GENERATED_JS_SEGMENT_ITERATOR_FIELDS) OBJECT_CONSTRUCTORS(JSSegmentIterator, JSObject); }; diff --git a/src/objects/js-segmenter.h b/src/objects/js-segmenter.h index 641cf106fb..209c4682b3 100644 --- a/src/objects/js-segmenter.h +++ b/src/objects/js-segmenter.h @@ -78,7 +78,7 @@ class JSSegmenter : public JSObject { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSSEGMENTER_FIELDS) + TORQUE_GENERATED_JS_SEGMENTER_FIELDS) private: static Granularity GetGranularity(const char* str); diff --git a/src/objects/js-weak-refs.h b/src/objects/js-weak-refs.h index 56a1bf0409..8d61b125a1 100644 --- a/src/objects/js-weak-refs.h +++ b/src/objects/js-weak-refs.h @@ -66,7 +66,7 @@ class JSFinalizationGroup : public JSObject { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - TORQUE_GENERATED_JSFINALIZATION_GROUP_FIELDS) + TORQUE_GENERATED_JS_FINALIZATION_GROUP_FIELDS) // Bitfields in flags. using ScheduledForCleanupField = BitField; diff --git a/src/objects/map-inl.h b/src/objects/map-inl.h index b8eab630f4..e745bb0ee1 100644 --- a/src/objects/map-inl.h +++ b/src/objects/map-inl.h @@ -112,7 +112,7 @@ bool Map::IsMostGeneralFieldType(Representation representation, bool Map::CanHaveFastTransitionableElementsKind(InstanceType instance_type) { return instance_type == JS_ARRAY_TYPE || instance_type == JS_PRIMITIVE_WRAPPER_TYPE || - instance_type == JS_ARGUMENTS_TYPE; + instance_type == JS_ARGUMENTS_OBJECT_TYPE; } bool Map::CanHaveFastTransitionableElementsKind() const { diff --git a/src/objects/map.cc b/src/objects/map.cc index 712275550e..955e230167 100644 --- a/src/objects/map.cc +++ b/src/objects/map.cc @@ -244,7 +244,7 @@ VisitorId Map::GetVisitorId(Map map) { case CODE_DATA_CONTAINER_TYPE: return kVisitCodeDataContainer; - case WASM_INSTANCE_TYPE: + case WASM_INSTANCE_OBJECT_TYPE: return kVisitWasmInstanceObject; case PREPARSE_DATA_TYPE: @@ -258,7 +258,7 @@ VisitorId Map::GetVisitorId(Map map) { case JS_OBJECT_TYPE: case JS_ERROR_TYPE: - case JS_ARGUMENTS_TYPE: + case JS_ARGUMENTS_OBJECT_TYPE: case JS_ASYNC_FROM_SYNC_ITERATOR_TYPE: case JS_CONTEXT_EXTENSION_OBJECT_TYPE: case JS_GENERATOR_OBJECT_TYPE: @@ -279,27 +279,27 @@ VisitorId Map::GetVisitorId(Map map) { case JS_MAP_VALUE_ITERATOR_TYPE: case JS_STRING_ITERATOR_TYPE: case JS_PROMISE_TYPE: - case JS_REGEXP_TYPE: - case JS_REGEXP_STRING_ITERATOR_TYPE: + case JS_REG_EXP_TYPE: + case JS_REG_EXP_STRING_ITERATOR_TYPE: case JS_FINALIZATION_GROUP_CLEANUP_ITERATOR_TYPE: case JS_FINALIZATION_GROUP_TYPE: #ifdef V8_INTL_SUPPORT - case JS_INTL_V8_BREAK_ITERATOR_TYPE: - case JS_INTL_COLLATOR_TYPE: - case JS_INTL_DATE_TIME_FORMAT_TYPE: - case JS_INTL_LIST_FORMAT_TYPE: - case JS_INTL_LOCALE_TYPE: - case JS_INTL_NUMBER_FORMAT_TYPE: - case JS_INTL_PLURAL_RULES_TYPE: - case JS_INTL_RELATIVE_TIME_FORMAT_TYPE: - case JS_INTL_SEGMENT_ITERATOR_TYPE: - case JS_INTL_SEGMENTER_TYPE: + case JS_V8_BREAK_ITERATOR_TYPE: + case JS_COLLATOR_TYPE: + case JS_DATE_TIME_FORMAT_TYPE: + case JS_LIST_FORMAT_TYPE: + case JS_LOCALE_TYPE: + case JS_NUMBER_FORMAT_TYPE: + case JS_PLURAL_RULES_TYPE: + case JS_RELATIVE_TIME_FORMAT_TYPE: + case JS_SEGMENT_ITERATOR_TYPE: + case JS_SEGMENTER_TYPE: #endif // V8_INTL_SUPPORT - case WASM_EXCEPTION_TYPE: - case WASM_GLOBAL_TYPE: - case WASM_MEMORY_TYPE: - case WASM_MODULE_TYPE: - case WASM_TABLE_TYPE: + case WASM_EXCEPTION_OBJECT_TYPE: + case WASM_GLOBAL_OBJECT_TYPE: + case WASM_MEMORY_OBJECT_TYPE: + case WASM_MODULE_OBJECT_TYPE: + case WASM_TABLE_OBJECT_TYPE: case JS_BOUND_FUNCTION_TYPE: { const bool has_raw_data_fields = (FLAG_unbox_double_fields && !map.HasFastPointerLayout()) || diff --git a/src/objects/objects-body-descriptors-inl.h b/src/objects/objects-body-descriptors-inl.h index 4c980b2697..68164fdce6 100644 --- a/src/objects/objects-body-descriptors-inl.h +++ b/src/objects/objects-body-descriptors-inl.h @@ -913,7 +913,7 @@ ReturnType BodyDescriptorApply(InstanceType type, T1 p1, T2 p2, T3 p3, T4 p4) { return Op::template apply(p1, p2, p3, p4); case JS_OBJECT_TYPE: case JS_ERROR_TYPE: - case JS_ARGUMENTS_TYPE: + case JS_ARGUMENTS_OBJECT_TYPE: case JS_ASYNC_FROM_SYNC_ITERATOR_TYPE: case JS_PROMISE_TYPE: case JS_CONTEXT_EXTENSION_OBJECT_TYPE: @@ -933,8 +933,8 @@ ReturnType BodyDescriptorApply(InstanceType type, T1 p1, T2 p2, T3 p3, T4 p4) { case JS_MAP_KEY_VALUE_ITERATOR_TYPE: case JS_MAP_VALUE_ITERATOR_TYPE: case JS_STRING_ITERATOR_TYPE: - case JS_REGEXP_STRING_ITERATOR_TYPE: - case JS_REGEXP_TYPE: + case JS_REG_EXP_STRING_ITERATOR_TYPE: + case JS_REG_EXP_TYPE: case JS_GLOBAL_PROXY_TYPE: case JS_GLOBAL_OBJECT_TYPE: case JS_API_OBJECT_TYPE: @@ -944,24 +944,24 @@ ReturnType BodyDescriptorApply(InstanceType type, T1 p1, T2 p2, T3 p3, T4 p4) { case JS_FINALIZATION_GROUP_CLEANUP_ITERATOR_TYPE: case JS_FINALIZATION_GROUP_TYPE: #ifdef V8_INTL_SUPPORT - case JS_INTL_V8_BREAK_ITERATOR_TYPE: - case JS_INTL_COLLATOR_TYPE: - case JS_INTL_DATE_TIME_FORMAT_TYPE: - case JS_INTL_LIST_FORMAT_TYPE: - case JS_INTL_LOCALE_TYPE: - case JS_INTL_NUMBER_FORMAT_TYPE: - case JS_INTL_PLURAL_RULES_TYPE: - case JS_INTL_RELATIVE_TIME_FORMAT_TYPE: - case JS_INTL_SEGMENT_ITERATOR_TYPE: - case JS_INTL_SEGMENTER_TYPE: + case JS_V8_BREAK_ITERATOR_TYPE: + case JS_COLLATOR_TYPE: + case JS_DATE_TIME_FORMAT_TYPE: + case JS_LIST_FORMAT_TYPE: + case JS_LOCALE_TYPE: + case JS_NUMBER_FORMAT_TYPE: + case JS_PLURAL_RULES_TYPE: + case JS_RELATIVE_TIME_FORMAT_TYPE: + case JS_SEGMENT_ITERATOR_TYPE: + case JS_SEGMENTER_TYPE: #endif // V8_INTL_SUPPORT - case WASM_EXCEPTION_TYPE: - case WASM_GLOBAL_TYPE: - case WASM_MEMORY_TYPE: - case WASM_MODULE_TYPE: - case WASM_TABLE_TYPE: + case WASM_EXCEPTION_OBJECT_TYPE: + case WASM_GLOBAL_OBJECT_TYPE: + case WASM_MEMORY_OBJECT_TYPE: + case WASM_MODULE_OBJECT_TYPE: + case WASM_TABLE_OBJECT_TYPE: return Op::template apply(p1, p2, p3, p4); - case WASM_INSTANCE_TYPE: + case WASM_INSTANCE_OBJECT_TYPE: return Op::template apply(p1, p2, p3, p4); case JS_WEAK_MAP_TYPE: diff --git a/src/objects/objects-definitions.h b/src/objects/objects-definitions.h index b346b5b7d1..ba715181e6 100644 --- a/src/objects/objects-definitions.h +++ b/src/objects/objects-definitions.h @@ -183,7 +183,7 @@ namespace internal { V(JS_API_OBJECT_TYPE) \ V(JS_OBJECT_TYPE) \ \ - V(JS_ARGUMENTS_TYPE) \ + V(JS_ARGUMENTS_OBJECT_TYPE) \ V(JS_ARRAY_BUFFER_TYPE) \ V(JS_ARRAY_ITERATOR_TYPE) \ V(JS_ARRAY_TYPE) \ @@ -200,8 +200,8 @@ namespace internal { V(JS_MAP_VALUE_ITERATOR_TYPE) \ V(JS_MESSAGE_OBJECT_TYPE) \ V(JS_PROMISE_TYPE) \ - V(JS_REGEXP_TYPE) \ - V(JS_REGEXP_STRING_ITERATOR_TYPE) \ + V(JS_REG_EXP_TYPE) \ + V(JS_REG_EXP_STRING_ITERATOR_TYPE) \ V(JS_SET_TYPE) \ V(JS_SET_KEY_VALUE_ITERATOR_TYPE) \ V(JS_SET_VALUE_ITERATOR_TYPE) \ @@ -215,28 +215,28 @@ namespace internal { V(JS_DATA_VIEW_TYPE) #define INSTANCE_TYPE_LIST_AFTER_INTL(V) \ - V(WASM_EXCEPTION_TYPE) \ - V(WASM_GLOBAL_TYPE) \ - V(WASM_INSTANCE_TYPE) \ - V(WASM_MEMORY_TYPE) \ - V(WASM_MODULE_TYPE) \ - V(WASM_TABLE_TYPE) \ + V(WASM_EXCEPTION_OBJECT_TYPE) \ + V(WASM_GLOBAL_OBJECT_TYPE) \ + V(WASM_INSTANCE_OBJECT_TYPE) \ + V(WASM_MEMORY_OBJECT_TYPE) \ + V(WASM_MODULE_OBJECT_TYPE) \ + V(WASM_TABLE_OBJECT_TYPE) \ V(JS_BOUND_FUNCTION_TYPE) \ V(JS_FUNCTION_TYPE) #ifdef V8_INTL_SUPPORT -#define INSTANCE_TYPE_LIST(V) \ - INSTANCE_TYPE_LIST_BEFORE_INTL(V) \ - V(JS_INTL_V8_BREAK_ITERATOR_TYPE) \ - V(JS_INTL_COLLATOR_TYPE) \ - V(JS_INTL_DATE_TIME_FORMAT_TYPE) \ - V(JS_INTL_LIST_FORMAT_TYPE) \ - V(JS_INTL_LOCALE_TYPE) \ - V(JS_INTL_NUMBER_FORMAT_TYPE) \ - V(JS_INTL_PLURAL_RULES_TYPE) \ - V(JS_INTL_RELATIVE_TIME_FORMAT_TYPE) \ - V(JS_INTL_SEGMENT_ITERATOR_TYPE) \ - V(JS_INTL_SEGMENTER_TYPE) \ +#define INSTANCE_TYPE_LIST(V) \ + INSTANCE_TYPE_LIST_BEFORE_INTL(V) \ + V(JS_V8_BREAK_ITERATOR_TYPE) \ + V(JS_COLLATOR_TYPE) \ + V(JS_DATE_TIME_FORMAT_TYPE) \ + V(JS_LIST_FORMAT_TYPE) \ + V(JS_LOCALE_TYPE) \ + V(JS_NUMBER_FORMAT_TYPE) \ + V(JS_PLURAL_RULES_TYPE) \ + V(JS_RELATIVE_TIME_FORMAT_TYPE) \ + V(JS_SEGMENT_ITERATOR_TYPE) \ + V(JS_SEGMENTER_TYPE) \ INSTANCE_TYPE_LIST_AFTER_INTL(V) #else #define INSTANCE_TYPE_LIST(V) \ diff --git a/src/objects/value-serializer.cc b/src/objects/value-serializer.cc index ddcbd0fa36..47a5abdfd9 100644 --- a/src/objects/value-serializer.cc +++ b/src/objects/value-serializer.cc @@ -552,7 +552,7 @@ Maybe ValueSerializer::WriteJSReceiver(Handle receiver) { case JS_PRIMITIVE_WRAPPER_TYPE: return WriteJSPrimitiveWrapper( Handle::cast(receiver)); - case JS_REGEXP_TYPE: + case JS_REG_EXP_TYPE: WriteJSRegExp(JSRegExp::cast(*receiver)); return ThrowIfOutOfMemory(); case JS_MAP_TYPE: @@ -566,7 +566,7 @@ Maybe ValueSerializer::WriteJSReceiver(Handle receiver) { return WriteJSArrayBufferView(JSArrayBufferView::cast(*receiver)); case JS_ERROR_TYPE: return WriteJSError(Handle::cast(receiver)); - case WASM_MODULE_TYPE: { + case WASM_MODULE_OBJECT_TYPE: { auto enabled_features = wasm::WasmFeaturesFromIsolate(isolate_); if (!FLAG_wasm_disable_structured_cloning || enabled_features.threads) { // Only write WebAssembly modules if not disabled by a flag. @@ -574,7 +574,7 @@ Maybe ValueSerializer::WriteJSReceiver(Handle receiver) { } break; } - case WASM_MEMORY_TYPE: { + case WASM_MEMORY_OBJECT_TYPE: { auto enabled_features = wasm::WasmFeaturesFromIsolate(isolate_); if (enabled_features.threads) { return WriteWasmMemory(Handle::cast(receiver)); diff --git a/src/torque/utils.cc b/src/torque/utils.cc index 38862b31b0..4e757ac9e8 100644 --- a/src/torque/utils.cc +++ b/src/torque/utils.cc @@ -212,19 +212,25 @@ bool IsValidTypeName(const std::string& s) { } std::string CapifyStringWithUnderscores(const std::string& camellified_string) { + // Special case: JSAbc yields JS_ABC, not JSABC, for any Abc. + size_t js_position = camellified_string.find("JS"); + std::string result; - bool previousWasLower = false; - for (auto current : camellified_string) { - if (previousWasLower && isupper(current)) { + bool previousWasLowerOrDigit = false; + for (size_t index = 0; index < camellified_string.size(); ++index) { + char current = camellified_string[index]; + if ((previousWasLowerOrDigit && isupper(current)) || + (js_position != std::string::npos && + index == js_position + strlen("JS"))) { result += "_"; } if (current == '.' || current == '-') { result += "_"; - previousWasLower = false; + previousWasLowerOrDigit = false; continue; } result += toupper(current); - previousWasLower = (islower(current)); + previousWasLowerOrDigit = islower(current) || isdigit(current); } return result; } diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc index 6a83a425df..80d2fcb059 100644 --- a/src/wasm/wasm-js.cc +++ b/src/wasm/wasm-js.cc @@ -2033,8 +2033,8 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) { JSFunction::EnsureHasInitialMap(module_constructor); Handle module_proto( JSObject::cast(module_constructor->instance_prototype()), isolate); - Handle module_map = - isolate->factory()->NewMap(i::WASM_MODULE_TYPE, WasmModuleObject::kSize); + Handle module_map = isolate->factory()->NewMap( + i::WASM_MODULE_OBJECT_TYPE, WasmModuleObject::kSize); JSFunction::SetInitialMap(module_constructor, module_map, module_proto); InstallFunc(isolate, module_constructor, "imports", WebAssemblyModuleImports, 1); @@ -2054,7 +2054,7 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) { Handle instance_proto( JSObject::cast(instance_constructor->instance_prototype()), isolate); Handle instance_map = isolate->factory()->NewMap( - i::WASM_INSTANCE_TYPE, WasmInstanceObject::kSize); + i::WASM_INSTANCE_OBJECT_TYPE, WasmInstanceObject::kSize); JSFunction::SetInitialMap(instance_constructor, instance_map, instance_proto); InstallGetter(isolate, instance_proto, "exports", WebAssemblyInstanceGetExports); @@ -2074,8 +2074,8 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) { JSFunction::EnsureHasInitialMap(table_constructor); Handle table_proto( JSObject::cast(table_constructor->instance_prototype()), isolate); - Handle table_map = - isolate->factory()->NewMap(i::WASM_TABLE_TYPE, WasmTableObject::kSize); + Handle table_map = isolate->factory()->NewMap(i::WASM_TABLE_OBJECT_TYPE, + WasmTableObject::kSize); JSFunction::SetInitialMap(table_constructor, table_map, table_proto); InstallGetter(isolate, table_proto, "length", WebAssemblyTableGetLength); InstallFunc(isolate, table_proto, "grow", WebAssemblyTableGrow, 1); @@ -2095,8 +2095,8 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) { JSFunction::EnsureHasInitialMap(memory_constructor); Handle memory_proto( JSObject::cast(memory_constructor->instance_prototype()), isolate); - Handle memory_map = - isolate->factory()->NewMap(i::WASM_MEMORY_TYPE, WasmMemoryObject::kSize); + Handle memory_map = isolate->factory()->NewMap( + i::WASM_MEMORY_OBJECT_TYPE, WasmMemoryObject::kSize); JSFunction::SetInitialMap(memory_constructor, memory_map, memory_proto); InstallFunc(isolate, memory_proto, "grow", WebAssemblyMemoryGrow, 1); InstallGetter(isolate, memory_proto, "buffer", WebAssemblyMemoryGetBuffer); @@ -2114,8 +2114,8 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) { JSFunction::EnsureHasInitialMap(global_constructor); Handle global_proto( JSObject::cast(global_constructor->instance_prototype()), isolate); - Handle global_map = - isolate->factory()->NewMap(i::WASM_GLOBAL_TYPE, WasmGlobalObject::kSize); + Handle global_map = isolate->factory()->NewMap( + i::WASM_GLOBAL_OBJECT_TYPE, WasmGlobalObject::kSize); JSFunction::SetInitialMap(global_constructor, global_map, global_proto); InstallFunc(isolate, global_proto, "valueOf", WebAssemblyGlobalValueOf, 0); InstallGetterSetter(isolate, global_proto, "value", WebAssemblyGlobalGetValue, @@ -2136,7 +2136,7 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) { Handle exception_proto( JSObject::cast(exception_constructor->instance_prototype()), isolate); Handle exception_map = isolate->factory()->NewMap( - i::WASM_EXCEPTION_TYPE, WasmExceptionObject::kSize); + i::WASM_EXCEPTION_OBJECT_TYPE, WasmExceptionObject::kSize); JSFunction::SetInitialMap(exception_constructor, exception_map, exception_proto); } diff --git a/src/wasm/wasm-objects.h b/src/wasm/wasm-objects.h index b204b13057..a32e36f2ba 100644 --- a/src/wasm/wasm-objects.h +++ b/src/wasm/wasm-objects.h @@ -821,7 +821,7 @@ class WasmJSFunctionData : public Struct { // Layout description. DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, - TORQUE_GENERATED_WASM_JSFUNCTION_DATA_FIELDS) + TORQUE_GENERATED_WASM_JS_FUNCTION_DATA_FIELDS) OBJECT_CONSTRUCTORS(WasmJSFunctionData, Struct); }; diff --git a/test/cctest/test-inobject-slack-tracking.cc b/test/cctest/test-inobject-slack-tracking.cc index 6a25536dd5..e2de4df4fb 100644 --- a/test/cctest/test-inobject-slack-tracking.cc +++ b/test/cctest/test-inobject-slack-tracking.cc @@ -1112,7 +1112,7 @@ TEST(SubclassRegExpBuiltin) { v8::HandleScope scope(CcTest::isolate()); const int first_field = 1; - TestSubclassBuiltin("A1", JS_REGEXP_TYPE, "RegExp", "'o(..)h', 'g'", + TestSubclassBuiltin("A1", JS_REG_EXP_TYPE, "RegExp", "'o(..)h', 'g'", first_field); } diff --git a/tools/debug_helper/get-object-properties.cc b/tools/debug_helper/get-object-properties.cc index f8bc028700..8eeeb84093 100644 --- a/tools/debug_helper/get-object-properties.cc +++ b/tools/debug_helper/get-object-properties.cc @@ -34,7 +34,7 @@ namespace v8_debug_helper_internal { V(Foreign, FOREIGN_TYPE) \ V(FreeSpace, FREE_SPACE_TYPE) \ V(HeapNumber, HEAP_NUMBER_TYPE) \ - V(JSArgumentsObject, JS_ARGUMENTS_TYPE) \ + V(JSArgumentsObject, JS_ARGUMENTS_OBJECT_TYPE) \ V(JSArray, JS_ARRAY_TYPE) \ V(JSArrayBuffer, JS_ARRAY_BUFFER_TYPE) \ V(JSArrayIterator, JS_ARRAY_ITERATOR_TYPE) \ @@ -52,8 +52,8 @@ namespace v8_debug_helper_internal { V(JSModuleNamespace, JS_MODULE_NAMESPACE_TYPE) \ V(JSPromise, JS_PROMISE_TYPE) \ V(JSProxy, JS_PROXY_TYPE) \ - V(JSRegExp, JS_REGEXP_TYPE) \ - V(JSRegExpStringIterator, JS_REGEXP_STRING_ITERATOR_TYPE) \ + V(JSRegExp, JS_REG_EXP_TYPE) \ + V(JSRegExpStringIterator, JS_REG_EXP_STRING_ITERATOR_TYPE) \ V(JSSet, JS_SET_TYPE) \ V(JSStringIterator, JS_STRING_ITERATOR_TYPE) \ V(JSTypedArray, JS_TYPED_ARRAY_TYPE) \ @@ -71,27 +71,27 @@ namespace v8_debug_helper_internal { V(PropertyCell, PROPERTY_CELL_TYPE) \ V(SharedFunctionInfo, SHARED_FUNCTION_INFO_TYPE) \ V(Symbol, SYMBOL_TYPE) \ - V(WasmExceptionObject, WASM_EXCEPTION_TYPE) \ - V(WasmGlobalObject, WASM_GLOBAL_TYPE) \ - V(WasmMemoryObject, WASM_MEMORY_TYPE) \ - V(WasmModuleObject, WASM_MODULE_TYPE) \ - V(WasmTableObject, WASM_TABLE_TYPE) \ + V(WasmExceptionObject, WASM_EXCEPTION_OBJECT_TYPE) \ + V(WasmGlobalObject, WASM_GLOBAL_OBJECT_TYPE) \ + V(WasmMemoryObject, WASM_MEMORY_OBJECT_TYPE) \ + V(WasmModuleObject, WASM_MODULE_OBJECT_TYPE) \ + V(WasmTableObject, WASM_TABLE_OBJECT_TYPE) \ V(WeakArrayList, WEAK_ARRAY_LIST_TYPE) \ V(WeakCell, WEAK_CELL_TYPE) #ifdef V8_INTL_SUPPORT -#define TQ_INSTANCE_TYPES_SINGLE_NOSTRUCTS(V) \ - TQ_INSTANCE_TYPES_SINGLE_BASE(V) \ - V(JSV8BreakIterator, JS_INTL_V8_BREAK_ITERATOR_TYPE) \ - V(JSCollator, JS_INTL_COLLATOR_TYPE) \ - V(JSDateTimeFormat, JS_INTL_DATE_TIME_FORMAT_TYPE) \ - V(JSListFormat, JS_INTL_LIST_FORMAT_TYPE) \ - V(JSLocale, JS_INTL_LOCALE_TYPE) \ - V(JSNumberFormat, JS_INTL_NUMBER_FORMAT_TYPE) \ - V(JSPluralRules, JS_INTL_PLURAL_RULES_TYPE) \ - V(JSRelativeTimeFormat, JS_INTL_RELATIVE_TIME_FORMAT_TYPE) \ - V(JSSegmentIterator, JS_INTL_SEGMENT_ITERATOR_TYPE) \ - V(JSSegmenter, JS_INTL_SEGMENTER_TYPE) +#define TQ_INSTANCE_TYPES_SINGLE_NOSTRUCTS(V) \ + TQ_INSTANCE_TYPES_SINGLE_BASE(V) \ + V(JSV8BreakIterator, JS_V8_BREAK_ITERATOR_TYPE) \ + V(JSCollator, JS_COLLATOR_TYPE) \ + V(JSDateTimeFormat, JS_DATE_TIME_FORMAT_TYPE) \ + V(JSListFormat, JS_LIST_FORMAT_TYPE) \ + V(JSLocale, JS_LOCALE_TYPE) \ + V(JSNumberFormat, JS_NUMBER_FORMAT_TYPE) \ + V(JSPluralRules, JS_PLURAL_RULES_TYPE) \ + V(JSRelativeTimeFormat, JS_RELATIVE_TIME_FORMAT_TYPE) \ + V(JSSegmentIterator, JS_SEGMENT_ITERATOR_TYPE) \ + V(JSSegmenter, JS_SEGMENTER_TYPE) #else diff --git a/tools/gen-postmortem-metadata.py b/tools/gen-postmortem-metadata.py index d488b23167..102946b7b9 100644 --- a/tools/gen-postmortem-metadata.py +++ b/tools/gen-postmortem-metadata.py @@ -445,10 +445,7 @@ def load_objects_from_file(objfilename, checktypes): # way around. # for type in types: - # - # REGEXP behaves like REG_EXP, as in JS_REGEXP_TYPE => JSRegExp. - # - usetype = re.sub('_REGEXP_', '_REG_EXP_', type); + usetype = type # # Remove the "_TYPE" suffix and then convert to camel case, diff --git a/tools/heap-stats/categories.js b/tools/heap-stats/categories.js index 6560758f3e..0e87662488 100644 --- a/tools/heap-stats/categories.js +++ b/tools/heap-stats/categories.js @@ -32,7 +32,7 @@ const CATEGORIES = new Map([ 'GLOBAL_PROPERTIES_TYPE', 'HEAP_NUMBER_TYPE', 'INTERNALIZED_STRING_TYPE', - 'JS_ARGUMENTS_TYPE', + 'JS_ARGUMENTS_OBJECT_TYPE', 'JS_ARRAY_BUFFER_TYPE', 'JS_ARRAY_ITERATOR_TYPE', 'JS_ARRAY_TYPE', @@ -50,16 +50,16 @@ const CATEGORIES = new Map([ 'JS_GENERIC_ARRAY_VALUE_ITERATOR_TYPE', 'JS_GLOBAL_OBJECT_TYPE', 'JS_GLOBAL_PROXY_TYPE', - 'JS_INTL_COLLATOR_TYPE', - 'JS_INTL_DATE_TIME_FORMAT_TYPE', - 'JS_INTL_LIST_FORMAT_TYPE', - 'JS_INTL_LOCALE_TYPE', - 'JS_INTL_NUMBER_FORMAT_TYPE', - 'JS_INTL_PLURAL_RULES_TYPE', - 'JS_INTL_RELATIVE_TIME_FORMAT_TYPE', - 'JS_INTL_SEGMENT_ITERATOR_TYPE', - 'JS_INTL_SEGMENTER_TYPE', - 'JS_INTL_V8_BREAK_ITERATOR_TYPE', + 'JS_COLLATOR_TYPE', + 'JS_DATE_TIME_FORMAT_TYPE', + 'JS_LIST_FORMAT_TYPE', + 'JS_LOCALE_TYPE', + 'JS_NUMBER_FORMAT_TYPE', + 'JS_PLURAL_RULES_TYPE', + 'JS_RELATIVE_TIME_FORMAT_TYPE', + 'JS_SEGMENT_ITERATOR_TYPE', + 'JS_SEGMENTER_TYPE', + 'JS_V8_BREAK_ITERATOR_TYPE', 'JS_MAP_KEY_ITERATOR_TYPE', 'JS_MAP_KEY_VALUE_ITERATOR_TYPE', 'JS_MAP_TYPE', @@ -69,7 +69,7 @@ const CATEGORIES = new Map([ 'JS_PRIMITIVE_WRAPPER_TYPE', 'JS_PROMISE_TYPE', 'JS_PROXY_TYPE', - 'JS_REGEXP_TYPE', + 'JS_REG_EXP_TYPE', 'JS_SET_KEY_VALUE_ITERATOR_TYPE', 'JS_SET_TYPE', 'JS_SET_VALUE_ITERATOR_TYPE', @@ -96,9 +96,9 @@ const CATEGORIES = new Map([ 'UNCACHED_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE', 'UNCACHED_EXTERNAL_ONE_BYTE_STRING_TYPE', 'UNCACHED_EXTERNAL_STRING_TYPE', - 'WASM_INSTANCE_TYPE', - 'WASM_MEMORY_TYPE', - 'WASM_MODULE_TYPE', + 'WASM_INSTANCE_OBJECT_TYPE', + 'WASM_MEMORY_OBJECT_TYPE', + 'WASM_MODULE_OBJECT_TYPE', ]) ], [ diff --git a/tools/v8heapconst.py b/tools/v8heapconst.py index f6bb0824d1..aaa4a73a03 100644 --- a/tools/v8heapconst.py +++ b/tools/v8heapconst.py @@ -138,7 +138,7 @@ INSTANCE_TYPES = { 1041: "JS_PRIMITIVE_WRAPPER_TYPE", 1056: "JS_API_OBJECT_TYPE", 1057: "JS_OBJECT_TYPE", - 1058: "JS_ARGUMENTS_TYPE", + 1058: "JS_ARGUMENTS_OBJECT_TYPE", 1059: "JS_ARRAY_BUFFER_TYPE", 1060: "JS_ARRAY_ITERATOR_TYPE", 1061: "JS_ARRAY_TYPE", @@ -155,8 +155,8 @@ INSTANCE_TYPES = { 1072: "JS_MAP_VALUE_ITERATOR_TYPE", 1073: "JS_MESSAGE_OBJECT_TYPE", 1074: "JS_PROMISE_TYPE", - 1075: "JS_REGEXP_TYPE", - 1076: "JS_REGEXP_STRING_ITERATOR_TYPE", + 1075: "JS_REG_EXP_TYPE", + 1076: "JS_REG_EXP_STRING_ITERATOR_TYPE", 1077: "JS_SET_TYPE", 1078: "JS_SET_KEY_VALUE_ITERATOR_TYPE", 1079: "JS_SET_VALUE_ITERATOR_TYPE", @@ -168,22 +168,22 @@ INSTANCE_TYPES = { 1085: "JS_WEAK_SET_TYPE", 1086: "JS_TYPED_ARRAY_TYPE", 1087: "JS_DATA_VIEW_TYPE", - 1088: "JS_INTL_V8_BREAK_ITERATOR_TYPE", - 1089: "JS_INTL_COLLATOR_TYPE", - 1090: "JS_INTL_DATE_TIME_FORMAT_TYPE", - 1091: "JS_INTL_LIST_FORMAT_TYPE", - 1092: "JS_INTL_LOCALE_TYPE", - 1093: "JS_INTL_NUMBER_FORMAT_TYPE", - 1094: "JS_INTL_PLURAL_RULES_TYPE", - 1095: "JS_INTL_RELATIVE_TIME_FORMAT_TYPE", - 1096: "JS_INTL_SEGMENT_ITERATOR_TYPE", - 1097: "JS_INTL_SEGMENTER_TYPE", - 1098: "WASM_EXCEPTION_TYPE", - 1099: "WASM_GLOBAL_TYPE", - 1100: "WASM_INSTANCE_TYPE", - 1101: "WASM_MEMORY_TYPE", - 1102: "WASM_MODULE_TYPE", - 1103: "WASM_TABLE_TYPE", + 1088: "JS_V8_BREAK_ITERATOR_TYPE", + 1089: "JS_COLLATOR_TYPE", + 1090: "JS_DATE_TIME_FORMAT_TYPE", + 1091: "JS_LIST_FORMAT_TYPE", + 1092: "JS_LOCALE_TYPE", + 1093: "JS_NUMBER_FORMAT_TYPE", + 1094: "JS_PLURAL_RULES_TYPE", + 1095: "JS_RELATIVE_TIME_FORMAT_TYPE", + 1096: "JS_SEGMENT_ITERATOR_TYPE", + 1097: "JS_SEGMENTER_TYPE", + 1098: "WASM_EXCEPTION_OBJECT_TYPE", + 1099: "WASM_GLOBAL_OBJECT_TYPE", + 1100: "WASM_INSTANCE_OBJECT_TYPE", + 1101: "WASM_MEMORY_OBJECT_TYPE", + 1102: "WASM_MODULE_OBJECT_TYPE", + 1103: "WASM_TABLE_OBJECT_TYPE", 1104: "JS_BOUND_FUNCTION_TYPE", 1105: "JS_FUNCTION_TYPE", }