From 57b30632d8b7e5ba6d063184030bc2308ab280ae Mon Sep 17 00:00:00 2001 From: Suraj Sharma Date: Thu, 25 Apr 2019 18:16:36 -0700 Subject: [PATCH] [torque] Convert few class layout definitions to torque. Converted JSGlobalObject, JSIteratorResult, JSLocale, JSDateTimeFormat, JSListFormat, JSNumberFormat, JSPluralRules, JSRelativeTimeFormat, JSSegmenter, JSAsyncFromSyncIterator to torque. Bug: v8:8952 Change-Id: Id912197054727815b481b2c683b93473bfcbd0c6 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1574491 Reviewed-by: Jakob Gruber Commit-Queue: Suraj Sharma Cr-Commit-Position: refs/heads/master@{#61099} --- BUILD.gn | 5 ++ src/builtins/base.tq | 10 ++++ src/objects-debug.cc | 38 +++++++------- src/objects/intl-objects.tq | 63 +++++++++++++++++++++++ src/objects/js-date-time-format-inl.h | 6 +-- src/objects/js-date-time-format.h | 13 +---- src/objects/js-list-format-inl.h | 2 +- src/objects/js-list-format.h | 11 +--- src/objects/js-locale-inl.h | 2 +- src/objects/js-locale.h | 8 +-- src/objects/js-number-format-inl.h | 2 +- src/objects/js-number-format.h | 12 +---- src/objects/js-objects.h | 20 ++----- src/objects/js-plural-rules-inl.h | 4 +- src/objects/js-plural-rules.h | 12 +---- src/objects/js-relative-time-format-inl.h | 2 +- src/objects/js-relative-time-format.h | 10 +--- src/objects/js-segment-iterator-inl.h | 2 +- src/objects/js-segment-iterator.h | 12 +---- src/objects/js-segmenter-inl.h | 2 +- src/objects/js-segmenter.h | 12 +---- 21 files changed, 127 insertions(+), 121 deletions(-) create mode 100644 src/objects/intl-objects.tq diff --git a/BUILD.gn b/BUILD.gn index 9f74c59257..5b6ba9872f 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -964,10 +964,15 @@ torque_files = [ "src/builtins/typed-array-slice.tq", "src/builtins/typed-array-some.tq", "src/builtins/typed-array-subarray.tq", + "src/objects/intl-objects.tq", "test/torque/test-torque.tq", "third_party/v8/builtins/array-sort.tq", ] +if (!v8_enable_i18n_support) { + torque_files -= [ "src/objects/intl-objects.tq" ] +} + torque_namespaces = [ "arguments", "array", diff --git a/src/builtins/base.tq b/src/builtins/base.tq index 5d61b0ff42..3b016230c5 100644 --- a/src/builtins/base.tq +++ b/src/builtins/base.tq @@ -524,6 +524,16 @@ extern class JSDate extends JSObject { cache_stamp: Undefined | Smi | NaN; } +extern class JSGlobalObject extends JSObject { + native_context: NativeContext; + global_proxy: JSGlobalProxy; +} + +extern class JSIteratorResult extends JSObject { + value: Object; + done: Boolean; +} + extern class JSAsyncFromSyncIterator extends JSObject { sync_iterator: JSReceiver; next: Object; diff --git a/src/objects-debug.cc b/src/objects-debug.cc index c63433b704..ed2f5e24f8 100644 --- a/src/objects-debug.cc +++ b/src/objects-debug.cc @@ -2237,62 +2237,64 @@ void JSCollator::JSCollatorVerify(Isolate* isolate) { void JSDateTimeFormat::JSDateTimeFormatVerify(Isolate* isolate) { JSObjectVerify(isolate); - VerifyObjectField(isolate, kICULocaleOffset); - VerifyObjectField(isolate, kICUSimpleDateFormatOffset); - VerifyObjectField(isolate, kICUDateIntervalFormatOffset); + VerifyObjectField(isolate, kIcuLocaleOffset); + VerifyObjectField(isolate, kIcuSimpleDateFormatOffset); + VerifyObjectField(isolate, kIcuDateIntervalFormatOffset); + VerifySmiField(kFlagsOffset); VerifyObjectField(isolate, kBoundFormatOffset); - VerifyObjectField(isolate, kFlagsOffset); + CHECK(bound_format()->IsUndefined(isolate) || bound_format()->IsJSFunction()); } void JSListFormat::JSListFormatVerify(Isolate* isolate) { JSObjectVerify(isolate); VerifyObjectField(isolate, kLocaleOffset); - VerifyObjectField(isolate, kICUFormatterOffset); - VerifyObjectField(isolate, kFlagsOffset); + VerifyObjectField(isolate, kIcuFormatterOffset); + VerifySmiField(kFlagsOffset); } void JSLocale::JSLocaleVerify(Isolate* isolate) { JSObjectVerify(isolate); - VerifyObjectField(isolate, kICULocaleOffset); + VerifyObjectField(isolate, kIcuLocaleOffset); } void JSNumberFormat::JSNumberFormatVerify(Isolate* isolate) { CHECK(IsJSNumberFormat()); JSObjectVerify(isolate); VerifyObjectField(isolate, kLocaleOffset); - VerifyObjectField(isolate, kICUNumberFormatOffset); + VerifyObjectField(isolate, kIcuNumberFormatOffset); VerifyObjectField(isolate, kBoundFormatOffset); - VerifyObjectField(isolate, kFlagsOffset); + CHECK(bound_format()->IsUndefined(isolate) || bound_format()->IsJSFunction()); + VerifySmiField(kFlagsOffset); } void JSPluralRules::JSPluralRulesVerify(Isolate* isolate) { CHECK(IsJSPluralRules()); JSObjectVerify(isolate); VerifyObjectField(isolate, kLocaleOffset); - VerifyObjectField(isolate, kFlagsOffset); - VerifyObjectField(isolate, kICUPluralRulesOffset); - VerifyObjectField(isolate, kICUDecimalFormatOffset); + VerifySmiField(kFlagsOffset); + VerifyObjectField(isolate, kIcuPluralRulesOffset); + VerifyObjectField(isolate, kIcuDecimalFormatOffset); } void JSRelativeTimeFormat::JSRelativeTimeFormatVerify(Isolate* isolate) { JSObjectVerify(isolate); VerifyObjectField(isolate, kLocaleOffset); - VerifyObjectField(isolate, kICUFormatterOffset); - VerifyObjectField(isolate, kFlagsOffset); + VerifyObjectField(isolate, kIcuFormatterOffset); + VerifySmiField(kFlagsOffset); } void JSSegmentIterator::JSSegmentIteratorVerify(Isolate* isolate) { JSObjectVerify(isolate); - VerifyObjectField(isolate, kICUBreakIteratorOffset); + VerifyObjectField(isolate, kIcuBreakIteratorOffset); VerifyObjectField(isolate, kUnicodeStringOffset); - VerifyObjectField(isolate, kFlagsOffset); + VerifySmiField(kFlagsOffset); } void JSSegmenter::JSSegmenterVerify(Isolate* isolate) { JSObjectVerify(isolate); VerifyObjectField(isolate, kLocaleOffset); - VerifyObjectField(isolate, kICUBreakIteratorOffset); - VerifyObjectField(isolate, kFlagsOffset); + VerifyObjectField(isolate, kIcuBreakIteratorOffset); + VerifySmiField(kFlagsOffset); } #endif // V8_INTL_SUPPORT diff --git a/src/objects/intl-objects.tq b/src/objects/intl-objects.tq new file mode 100644 index 0000000000..4b3292593f --- /dev/null +++ b/src/objects/intl-objects.tq @@ -0,0 +1,63 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include 'src/objects/js-number-format.h' +#include 'src/objects/js-objects.h' +#include 'src/objects/js-plural-rules.h' +#include 'src/objects/js-relative-time-format.h' +#include 'src/objects/js-date-time-format.h' +#include 'src/objects/js-list-format.h' +#include 'src/objects/js-locale.h' +#include 'src/objects/js-segment-iterator.h' +#include 'src/objects/js-segmenter.h' + +extern class JSDateTimeFormat extends JSObject { + icu_locale: Foreign; // Managed + icu_simple_date_format: Foreign; // Managed + icu_date_interval_format: Foreign; // Managed + bound_format: JSFunction | Undefined; + flags: Smi; +} + +extern class JSListFormat extends JSObject { + locale: String; + icu_formatter: Foreign; // Managed + flags: Smi; +} + +extern class JSNumberFormat extends JSObject { + locale: String; + icu_number_format: Foreign; // Managed + bound_format: JSFunction | Undefined; + flags: Smi; +} + +extern class JSPluralRules extends JSObject { + locale: String; + flags: Smi; + icu_plural_rules: Foreign; // Managed + icu_decimal_format: Foreign; // Managed +} + +extern class JSRelativeTimeFormat extends JSObject { + locale: String; + icu_formatter: Foreign; // Managed + flags: Smi; +} + +extern class JSLocale extends JSObject { + icu_locale: Foreign; // Managed +} + +extern class JSSegmenter extends JSObject { + locale: String; + icu_break_iterator: Foreign; // Managed + flags: Smi; +} + +extern class JSSegmentIterator extends JSObject { + icu_break_iterator: Foreign; // Managed + unicode_string: Foreign; // Managed + flags: Smi; +} diff --git a/src/objects/js-date-time-format-inl.h b/src/objects/js-date-time-format-inl.h index 1657241b07..9c9488dec3 100644 --- a/src/objects/js-date-time-format-inl.h +++ b/src/objects/js-date-time-format-inl.h @@ -20,11 +20,11 @@ namespace internal { OBJECT_CONSTRUCTORS_IMPL(JSDateTimeFormat, JSObject) -ACCESSORS(JSDateTimeFormat, icu_locale, Managed, kICULocaleOffset) +ACCESSORS(JSDateTimeFormat, icu_locale, Managed, kIcuLocaleOffset) ACCESSORS(JSDateTimeFormat, icu_simple_date_format, - Managed, kICUSimpleDateFormatOffset) + Managed, kIcuSimpleDateFormatOffset) ACCESSORS(JSDateTimeFormat, icu_date_interval_format, - Managed, kICUDateIntervalFormatOffset) + Managed, kIcuDateIntervalFormatOffset) ACCESSORS(JSDateTimeFormat, bound_format, Object, kBoundFormatOffset) SMI_ACCESSORS(JSDateTimeFormat, flags, kFlagsOffset) diff --git a/src/objects/js-date-time-format.h b/src/objects/js-date-time-format.h index cf73af2aa8..cb9a9ca1a2 100644 --- a/src/objects/js-date-time-format.h +++ b/src/objects/js-date-time-format.h @@ -15,6 +15,7 @@ #include "src/isolate.h" #include "src/objects/intl-objects.h" #include "src/objects/managed.h" +#include "torque-generated/class-definitions-from-dsl.h" #include "unicode/uversion.h" // Has to be the last include (doesn't have include guards): @@ -92,18 +93,8 @@ class JSDateTimeFormat : public JSObject { enum class DateTimeStyle { kUndefined, kFull, kLong, kMedium, kShort }; // Layout description. -#define JS_DATE_TIME_FORMAT_FIELDS(V) \ - V(kICULocaleOffset, kTaggedSize) \ - V(kICUSimpleDateFormatOffset, kTaggedSize) \ - V(kICUDateIntervalFormatOffset, kTaggedSize) \ - V(kBoundFormatOffset, kTaggedSize) \ - V(kFlagsOffset, kTaggedSize) \ - /* Total size. */ \ - V(kSize, 0) - DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - JS_DATE_TIME_FORMAT_FIELDS) -#undef JS_DATE_TIME_FORMAT_FIELDS + TORQUE_GENERATED_JSDATE_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-inl.h b/src/objects/js-list-format-inl.h index dd3f4dceb9..7f359a248c 100644 --- a/src/objects/js-list-format-inl.h +++ b/src/objects/js-list-format-inl.h @@ -23,7 +23,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSListFormat, JSObject) // Base list format accessors. ACCESSORS(JSListFormat, locale, String, kLocaleOffset) ACCESSORS(JSListFormat, icu_formatter, Managed, - kICUFormatterOffset) + kIcuFormatterOffset) SMI_ACCESSORS(JSListFormat, flags, kFlagsOffset) inline void JSListFormat::set_style(Style style) { diff --git a/src/objects/js-list-format.h b/src/objects/js-list-format.h index ee576b3ff2..bcd681996f 100644 --- a/src/objects/js-list-format.h +++ b/src/objects/js-list-format.h @@ -105,15 +105,8 @@ class JSListFormat : public JSObject { DECL_VERIFIER(JSListFormat) // Layout description. -#define JS_LIST_FORMAT_FIELDS(V) \ - V(kLocaleOffset, kTaggedSize) \ - V(kICUFormatterOffset, kTaggedSize) \ - V(kFlagsOffset, kTaggedSize) \ - /* Header size. */ \ - V(kSize, 0) - - DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JS_LIST_FORMAT_FIELDS) -#undef JS_LIST_FORMAT_FIELDS + DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, + TORQUE_GENERATED_JSLIST_FORMAT_FIELDS) OBJECT_CONSTRUCTORS(JSListFormat, JSObject); }; diff --git a/src/objects/js-locale-inl.h b/src/objects/js-locale-inl.h index 44e223ef06..c3614c13c6 100644 --- a/src/objects/js-locale-inl.h +++ b/src/objects/js-locale-inl.h @@ -21,7 +21,7 @@ namespace internal { OBJECT_CONSTRUCTORS_IMPL(JSLocale, JSObject) -ACCESSORS(JSLocale, icu_locale, Managed, kICULocaleOffset) +ACCESSORS(JSLocale, icu_locale, Managed, kIcuLocaleOffset) CAST_ACCESSOR(JSLocale) diff --git a/src/objects/js-locale.h b/src/objects/js-locale.h index 120ddeb965..ed73615f12 100644 --- a/src/objects/js-locale.h +++ b/src/objects/js-locale.h @@ -58,12 +58,8 @@ class JSLocale : public JSObject { DECL_VERIFIER(JSLocale) // Layout description. -#define JS_LOCALE_FIELDS(V) \ - V(kICULocaleOffset, kTaggedSize) \ - V(kSize, 0) - - DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JS_LOCALE_FIELDS) -#undef JS_LOCALE_FIELDS + DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, + TORQUE_GENERATED_JSLOCALE_FIELDS) OBJECT_CONSTRUCTORS(JSLocale, JSObject); }; diff --git a/src/objects/js-number-format-inl.h b/src/objects/js-number-format-inl.h index 3edf6f1ea3..491800b7e9 100644 --- a/src/objects/js-number-format-inl.h +++ b/src/objects/js-number-format-inl.h @@ -22,7 +22,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSNumberFormat, JSObject) ACCESSORS(JSNumberFormat, locale, String, kLocaleOffset) ACCESSORS(JSNumberFormat, icu_number_format, Managed, - kICUNumberFormatOffset) + kIcuNumberFormatOffset) ACCESSORS(JSNumberFormat, bound_format, Object, kBoundFormatOffset) SMI_ACCESSORS(JSNumberFormat, flags, kFlagsOffset) diff --git a/src/objects/js-number-format.h b/src/objects/js-number-format.h index 6857989c22..51cc401b06 100644 --- a/src/objects/js-number-format.h +++ b/src/objects/js-number-format.h @@ -98,16 +98,8 @@ class JSNumberFormat : public JSObject { inline CurrencyDisplay currency_display() const; // Layout description. -#define JS_NUMBER_FORMAT_FIELDS(V) \ - V(kLocaleOffset, kTaggedSize) \ - V(kICUNumberFormatOffset, kTaggedSize) \ - V(kBoundFormatOffset, kTaggedSize) \ - V(kFlagsOffset, kTaggedSize) \ - /* Total size. */ \ - V(kSize, 0) - - DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JS_NUMBER_FORMAT_FIELDS) -#undef JS_NUMBER_FORMAT_FIELDS + DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, + TORQUE_GENERATED_JSNUMBER_FORMAT_FIELDS) // Bit positions in |flags|. #define FLAGS_BIT_FIELDS(V, _) \ diff --git a/src/objects/js-objects.h b/src/objects/js-objects.h index c67f70c207..ece2991191 100644 --- a/src/objects/js-objects.h +++ b/src/objects/js-objects.h @@ -879,15 +879,8 @@ class JSIteratorResult : public JSObject { DECL_ACCESSORS(done, Object) // Layout description. -#define JS_ITERATOR_RESULT_FIELDS(V) \ - V(kValueOffset, kTaggedSize) \ - V(kDoneOffset, kTaggedSize) \ - /* Total size. */ \ - V(kSize, 0) - DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - JS_ITERATOR_RESULT_FIELDS) -#undef JS_ITERATOR_RESULT_FIELDS + TORQUE_GENERATED_JSITERATOR_RESULT_FIELDS) // Indices of in-object properties. static const int kValueIndex = 0; @@ -1209,15 +1202,8 @@ class JSGlobalObject : public JSObject { DECL_VERIFIER(JSGlobalObject) // Layout description. -#define JS_GLOBAL_OBJECT_FIELDS(V) \ - V(kNativeContextOffset, kTaggedSize) \ - V(kGlobalProxyOffset, kTaggedSize) \ - /* Header size. */ \ - V(kHeaderSize, 0) \ - V(kSize, 0) - - DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JS_GLOBAL_OBJECT_FIELDS) -#undef JS_GLOBAL_OBJECT_FIELDS + DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, + TORQUE_GENERATED_JSGLOBAL_OBJECT_FIELDS) OBJECT_CONSTRUCTORS(JSGlobalObject, JSObject); }; diff --git a/src/objects/js-plural-rules-inl.h b/src/objects/js-plural-rules-inl.h index f7248431e8..ded02a69c7 100644 --- a/src/objects/js-plural-rules-inl.h +++ b/src/objects/js-plural-rules-inl.h @@ -24,9 +24,9 @@ OBJECT_CONSTRUCTORS_IMPL(JSPluralRules, JSObject) ACCESSORS(JSPluralRules, locale, String, kLocaleOffset) SMI_ACCESSORS(JSPluralRules, flags, kFlagsOffset) ACCESSORS(JSPluralRules, icu_plural_rules, Managed, - kICUPluralRulesOffset) + kIcuPluralRulesOffset) ACCESSORS(JSPluralRules, icu_decimal_format, Managed, - kICUDecimalFormatOffset) + kIcuDecimalFormatOffset) inline void JSPluralRules::set_type(Type type) { DCHECK_LT(type, Type::COUNT); diff --git a/src/objects/js-plural-rules.h b/src/objects/js-plural-rules.h index 70c63a9a8f..0440bc1273 100644 --- a/src/objects/js-plural-rules.h +++ b/src/objects/js-plural-rules.h @@ -69,16 +69,8 @@ class JSPluralRules : public JSObject { STATIC_ASSERT(Type::ORDINAL <= TypeBits::kMax); // Layout description. -#define JS_PLURAL_RULES_FIELDS(V) \ - V(kLocaleOffset, kTaggedSize) \ - V(kFlagsOffset, kTaggedSize) \ - V(kICUPluralRulesOffset, kTaggedSize) \ - V(kICUDecimalFormatOffset, kTaggedSize) \ - /* Total size. */ \ - V(kSize, 0) - - DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JS_PLURAL_RULES_FIELDS) -#undef JS_PLURAL_RULES_FIELDS + DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, + TORQUE_GENERATED_JSPLURAL_RULES_FIELDS) DECL_ACCESSORS(locale, String) DECL_INT_ACCESSORS(flags) diff --git a/src/objects/js-relative-time-format-inl.h b/src/objects/js-relative-time-format-inl.h index 6b8b4550ac..23256b882f 100644 --- a/src/objects/js-relative-time-format-inl.h +++ b/src/objects/js-relative-time-format-inl.h @@ -23,7 +23,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSRelativeTimeFormat, JSObject) // Base relative time format accessors. ACCESSORS(JSRelativeTimeFormat, locale, String, kLocaleOffset) ACCESSORS(JSRelativeTimeFormat, icu_formatter, - Managed, kICUFormatterOffset) + Managed, kIcuFormatterOffset) SMI_ACCESSORS(JSRelativeTimeFormat, flags, kFlagsOffset) inline void JSRelativeTimeFormat::set_style(Style style) { diff --git a/src/objects/js-relative-time-format.h b/src/objects/js-relative-time-format.h index 8c8ef7bbce..b8247b4f79 100644 --- a/src/objects/js-relative-time-format.h +++ b/src/objects/js-relative-time-format.h @@ -109,16 +109,8 @@ class JSRelativeTimeFormat : public JSObject { DECL_VERIFIER(JSRelativeTimeFormat) // Layout description. -#define JS_RELATIVE_TIME_FORMAT_FIELDS(V) \ - V(kLocaleOffset, kTaggedSize) \ - V(kICUFormatterOffset, kTaggedSize) \ - V(kFlagsOffset, kTaggedSize) \ - /* Header size. */ \ - V(kSize, 0) - DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, - JS_RELATIVE_TIME_FORMAT_FIELDS) -#undef JS_RELATIVE_TIME_FORMAT_FIELDS + TORQUE_GENERATED_JSRELATIVE_TIME_FORMAT_FIELDS) private: static Style getStyle(const char* str); diff --git a/src/objects/js-segment-iterator-inl.h b/src/objects/js-segment-iterator-inl.h index 0c1a3e4eec..361332cd6e 100644 --- a/src/objects/js-segment-iterator-inl.h +++ b/src/objects/js-segment-iterator-inl.h @@ -22,7 +22,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSSegmentIterator, JSObject) // Base segment iterator accessors. ACCESSORS(JSSegmentIterator, icu_break_iterator, Managed, - kICUBreakIteratorOffset) + kIcuBreakIteratorOffset) ACCESSORS(JSSegmentIterator, unicode_string, Managed, kUnicodeStringOffset) diff --git a/src/objects/js-segment-iterator.h b/src/objects/js-segment-iterator.h index 0535704a68..9de44fbdec 100644 --- a/src/objects/js-segment-iterator.h +++ b/src/objects/js-segment-iterator.h @@ -90,16 +90,8 @@ class JSSegmentIterator : public JSObject { DECL_INT_ACCESSORS(flags) // Layout description. -#define SEGMENTER_FIELDS(V) \ - /* Pointer fields. */ \ - V(kICUBreakIteratorOffset, kTaggedSize) \ - V(kUnicodeStringOffset, kTaggedSize) \ - V(kFlagsOffset, kTaggedSize) \ - /* Total Size */ \ - V(kSize, 0) - - DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, SEGMENTER_FIELDS) -#undef SEGMENTER_FIELDS + DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, + TORQUE_GENERATED_JSSEGMENT_ITERATOR_FIELDS) OBJECT_CONSTRUCTORS(JSSegmentIterator, JSObject); }; diff --git a/src/objects/js-segmenter-inl.h b/src/objects/js-segmenter-inl.h index 05935fa905..2f126efa71 100644 --- a/src/objects/js-segmenter-inl.h +++ b/src/objects/js-segmenter-inl.h @@ -23,7 +23,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSSegmenter, JSObject) // Base segmenter accessors. ACCESSORS(JSSegmenter, locale, String, kLocaleOffset) ACCESSORS(JSSegmenter, icu_break_iterator, Managed, - kICUBreakIteratorOffset) + kIcuBreakIteratorOffset) SMI_ACCESSORS(JSSegmenter, flags, kFlagsOffset) inline void JSSegmenter::set_granularity(Granularity granularity) { diff --git a/src/objects/js-segmenter.h b/src/objects/js-segmenter.h index 4fd509eb0c..99df4476b0 100644 --- a/src/objects/js-segmenter.h +++ b/src/objects/js-segmenter.h @@ -78,16 +78,8 @@ class JSSegmenter : public JSObject { DECL_VERIFIER(JSSegmenter) // Layout description. -#define JS_SEGMENTER_FIELDS(V) \ - V(kJSSegmenterOffset, kTaggedSize) \ - V(kLocaleOffset, kTaggedSize) \ - V(kICUBreakIteratorOffset, kTaggedSize) \ - V(kFlagsOffset, kTaggedSize) \ - /* Header size. */ \ - V(kSize, 0) - - DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JS_SEGMENTER_FIELDS) -#undef JS_SEGMENTER_FIELDS + DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, + TORQUE_GENERATED_JSSEGMENTER_FIELDS) private: static Granularity GetGranularity(const char* str);