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 <seth.brenith@microsoft.com>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64199}
This commit is contained in:
Seth Brenith 2019-10-09 09:55:52 -07:00 committed by Commit Bot
parent 566ba7928c
commit 61815a22bd
41 changed files with 364 additions and 360 deletions

View File

@ -158,8 +158,7 @@ void IntlBuiltinsAssembler::ListFormatCommon(TNode<Context> 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<JSListFormat> list_format = CAST(receiver);
TNode<Object> list = args.GetOptionalArgumentValue(0);

View File

@ -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},

View File

@ -744,7 +744,7 @@ RegExpBuiltinsAssembler::RegExpPrototypeExecBodyWithoutResult(
TNode<Context> context, TNode<JSReceiver> maybe_regexp,
TNode<String> 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<BoolT> RegExpBuiltinsAssembler::IsFastRegExpWithOriginalExec(
GotoIfForceSlowPath(&out);
#endif
TNode<BoolT> is_regexp = HasInstanceType(object, JS_REGEXP_TYPE);
TNode<BoolT> 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<Object> maybe_flags = CAST(Parameter(Descriptor::kFlags));
TNode<Context> 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<JSRegExp> receiver = CAST(maybe_receiver);
@ -1591,7 +1591,7 @@ TNode<Object> 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,

View File

@ -6302,7 +6302,7 @@ TNode<BoolT> CodeStubAssembler::IsJSStringIterator(
TNode<BoolT> CodeStubAssembler::IsJSRegExpStringIterator(
SloppyTNode<HeapObject> object) {
return HasInstanceType(object, JS_REGEXP_STRING_ITERATOR_TYPE);
return HasInstanceType(object, JS_REG_EXP_STRING_ITERATOR_TYPE);
}
TNode<BoolT> CodeStubAssembler::IsMap(SloppyTNode<HeapObject> map) {
@ -6638,7 +6638,7 @@ TNode<BoolT> CodeStubAssembler::IsJSDataView(TNode<HeapObject> object) {
}
TNode<BoolT> CodeStubAssembler::IsJSRegExp(SloppyTNode<HeapObject> object) {
return HasInstanceType(object, JS_REGEXP_TYPE);
return HasInstanceType(object, JS_REG_EXP_TYPE);
}
TNode<BoolT> CodeStubAssembler::IsNumber(SloppyTNode<Object> object) {

View File

@ -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:

View File

@ -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());

View File

@ -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

View File

@ -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

View File

@ -1958,16 +1958,16 @@ Handle<JSObject> 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<JSFunction> 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:

View File

@ -2459,7 +2459,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
{ // -- R e g E x p
// Builtin functions for RegExp.prototype.
Handle<JSFunction> 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<JSGlobalObject> global_object,
true);
Handle<JSFunction> 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<JSGlobalObject> global_object,
{ // -- D a t e T i m e F o r m a t
Handle<JSFunction> 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<JSGlobalObject> global_object,
}
{ // -- N u m b e r F o r m a t
Handle<JSFunction> number_format_constructor = InstallFunction(
isolate_, intl, "NumberFormat", JS_INTL_NUMBER_FORMAT_TYPE,
JSNumberFormat::kSize, 0, factory->the_hole_value(),
Builtins::kNumberFormatConstructor);
Handle<JSFunction> 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<JSGlobalObject> global_object,
{ // -- C o l l a t o r
Handle<JSFunction> 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<JSGlobalObject> global_object,
{ // -- V 8 B r e a k I t e r a t o r
Handle<JSFunction> 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<JSGlobalObject> global_object,
}
{ // -- P l u r a l R u l e s
Handle<JSFunction> plural_rules_constructor = InstallFunction(
isolate_, intl, "PluralRules", JS_INTL_PLURAL_RULES_TYPE,
JSPluralRules::kSize, 0, factory->the_hole_value(),
Builtins::kPluralRulesConstructor);
Handle<JSFunction> 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<JSGlobalObject> global_object,
{ // -- R e l a t i v e T i m e F o r m a t
Handle<JSFunction> 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<JSGlobalObject> global_object,
}
{ // -- L i s t F o r m a t
Handle<JSFunction> list_format_fun = InstallFunction(
isolate(), intl, "ListFormat", JS_INTL_LIST_FORMAT_TYPE,
JSListFormat::kSize, 0, factory->the_hole_value(),
Builtins::kListFormatConstructor);
Handle<JSFunction> 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<JSGlobalObject> global_object,
{ // -- L o c a l e
Handle<JSFunction> 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<JSGlobalObject> global_object,
Handle<String> 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<JSFunction> function = factory->NewFunction(args);
Handle<Map> map(function->initial_map(), isolate());
@ -3848,8 +3848,9 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
callee->set_setter(*poison);
// Create the map. Allocate one in-object field for length.
Handle<Map> map = factory->NewMap(
JS_ARGUMENTS_TYPE, JSStrictArgumentsObject::kSize, PACKED_ELEMENTS, 1);
Handle<Map> 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<JSFunction> 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<JSFunction> 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);

View File

@ -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<JSArgumentsObject, JSObject> {
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;

View File

@ -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) \

View File

@ -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)

View File

@ -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)

View File

@ -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<icu::Collator>)
DECL_ACCESSORS(bound_compare, Object)

View File

@ -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;

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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, _) \

View File

@ -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("<JSWeakSet>");
break;
}
case JS_REGEXP_TYPE: {
case JS_REG_EXP_TYPE: {
accumulator->Add("<JSRegExp");
JSRegExp regexp = JSRegExp::cast(*this);
if (regexp.source().IsString()) {
@ -5196,16 +5196,16 @@ bool CanSubclassHaveInobjectProperties(InstanceType instance_type) {
case JS_FUNCTION_TYPE:
case JS_GENERATOR_OBJECT_TYPE:
#ifdef V8_INTL_SUPPORT
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_INTL_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:
case JS_V8_BREAK_ITERATOR_TYPE:
#endif
case JS_ASYNC_FUNCTION_OBJECT_TYPE:
case JS_ASYNC_GENERATOR_OBJECT_TYPE:
@ -5214,9 +5214,9 @@ bool CanSubclassHaveInobjectProperties(InstanceType instance_type) {
case JS_OBJECT_TYPE:
case JS_ERROR_TYPE:
case JS_FINALIZATION_GROUP_TYPE:
case JS_ARGUMENTS_TYPE:
case JS_ARGUMENTS_OBJECT_TYPE:
case JS_PROMISE_TYPE:
case JS_REGEXP_TYPE:
case JS_REG_EXP_TYPE:
case JS_SET_TYPE:
case JS_SPECIAL_API_OBJECT_TYPE:
case JS_TYPED_ARRAY_TYPE:
@ -5224,11 +5224,11 @@ bool CanSubclassHaveInobjectProperties(InstanceType instance_type) {
case JS_WEAK_MAP_TYPE:
case JS_WEAK_REF_TYPE:
case JS_WEAK_SET_TYPE:
case WASM_GLOBAL_TYPE:
case WASM_INSTANCE_TYPE:
case WASM_MEMORY_TYPE:
case WASM_MODULE_TYPE:
case WASM_TABLE_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:
return true;
case BIGINT_TYPE:

View File

@ -264,7 +264,7 @@ class JSReceiver : public HeapObject {
static const int kHashMask = PropertyArray::HashField::kMask;
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
TORQUE_GENERATED_JSRECEIVER_FIELDS)
TORQUE_GENERATED_JS_RECEIVER_FIELDS)
bool HasProxyInPrototype(Isolate* isolate);
V8_WARN_UNUSED_RESULT static MaybeHandle<FixedArray> GetPrivateEntries(
@ -1120,7 +1120,7 @@ class JSFunction : public JSObject {
static Handle<String> ToString(Handle<JSFunction> 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;

View File

@ -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)

View File

@ -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;

View File

@ -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<JSArray> GetAndCacheIndices(
Isolate* isolate, Handle<JSRegExpResult> 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<JSRegExpResultIndices> BuildIndices(
Isolate* isolate, Handle<RegExpMatchInfo> match_info,

View File

@ -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);

View File

@ -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);
};

View File

@ -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);

View File

@ -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<bool, 0, 1>;

View File

@ -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 {

View File

@ -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()) ||

View File

@ -913,7 +913,7 @@ ReturnType BodyDescriptorApply(InstanceType type, T1 p1, T2 p2, T3 p3, T4 p4) {
return Op::template apply<FeedbackVector::BodyDescriptor>(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<JSObject::BodyDescriptor>(p1, p2, p3, p4);
case WASM_INSTANCE_TYPE:
case WASM_INSTANCE_OBJECT_TYPE:
return Op::template apply<WasmInstanceObject::BodyDescriptor>(p1, p2, p3,
p4);
case JS_WEAK_MAP_TYPE:

View File

@ -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) \

View File

@ -552,7 +552,7 @@ Maybe<bool> ValueSerializer::WriteJSReceiver(Handle<JSReceiver> receiver) {
case JS_PRIMITIVE_WRAPPER_TYPE:
return WriteJSPrimitiveWrapper(
Handle<JSPrimitiveWrapper>::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<bool> ValueSerializer::WriteJSReceiver(Handle<JSReceiver> receiver) {
return WriteJSArrayBufferView(JSArrayBufferView::cast(*receiver));
case JS_ERROR_TYPE:
return WriteJSError(Handle<JSObject>::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<bool> ValueSerializer::WriteJSReceiver(Handle<JSReceiver> receiver) {
}
break;
}
case WASM_MEMORY_TYPE: {
case WASM_MEMORY_OBJECT_TYPE: {
auto enabled_features = wasm::WasmFeaturesFromIsolate(isolate_);
if (enabled_features.threads) {
return WriteWasmMemory(Handle<WasmMemoryObject>::cast(receiver));

View File

@ -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;
}

View File

@ -2033,8 +2033,8 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) {
JSFunction::EnsureHasInitialMap(module_constructor);
Handle<JSObject> module_proto(
JSObject::cast(module_constructor->instance_prototype()), isolate);
Handle<Map> module_map =
isolate->factory()->NewMap(i::WASM_MODULE_TYPE, WasmModuleObject::kSize);
Handle<Map> 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<JSObject> instance_proto(
JSObject::cast(instance_constructor->instance_prototype()), isolate);
Handle<Map> 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<JSObject> table_proto(
JSObject::cast(table_constructor->instance_prototype()), isolate);
Handle<Map> table_map =
isolate->factory()->NewMap(i::WASM_TABLE_TYPE, WasmTableObject::kSize);
Handle<Map> 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<JSObject> memory_proto(
JSObject::cast(memory_constructor->instance_prototype()), isolate);
Handle<Map> memory_map =
isolate->factory()->NewMap(i::WASM_MEMORY_TYPE, WasmMemoryObject::kSize);
Handle<Map> 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<JSObject> global_proto(
JSObject::cast(global_constructor->instance_prototype()), isolate);
Handle<Map> global_map =
isolate->factory()->NewMap(i::WASM_GLOBAL_TYPE, WasmGlobalObject::kSize);
Handle<Map> 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<JSObject> exception_proto(
JSObject::cast(exception_constructor->instance_prototype()), isolate);
Handle<Map> 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);
}

View File

@ -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);
};

View File

@ -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);
}

View File

@ -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

View File

@ -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,

View File

@ -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',
])
],
[

View File

@ -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",
}