Commit 8b917cd9 authored by Suraj Sharma's avatar Suraj Sharma Committed by Commit Bot

[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: I760a658c5bef7e12bc8f07b741245e9d1933164e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1529262
Commit-Queue: Suraj Sharma <surshar@microsoft.com>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60727}
parent 10fa91af
...@@ -16,6 +16,15 @@ ...@@ -16,6 +16,15 @@
#include 'src/objects/js-regexp-string-iterator.h' #include 'src/objects/js-regexp-string-iterator.h'
#include 'src/objects/module.h' #include 'src/objects/module.h'
#include 'src/objects/stack-frame-info.h' #include 'src/objects/stack-frame-info.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-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-segment-iterator.h'
#include 'src/objects/js-segmenter.h'
type void; type void;
type never; type never;
...@@ -484,6 +493,66 @@ extern class JSDate extends JSObject { ...@@ -484,6 +493,66 @@ extern class JSDate extends JSObject {
cache_stamp: Undefined | Smi | NaN; 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 JSLocale extends JSObject {
icu_locale: Foreign; // Managed<icu::Locale>
}
extern class JSDateTimeFormat extends JSObject {
icu_locale: Foreign; // Managed<icu::Locale>
icu_simple_date_format: Foreign; // Managed<icu::SimpleDateFormat>
icu_date_interval_format: Foreign; // Managed<icu::DateIntervalFormat>
bound_format: JSFunction | Undefined;
flags: Smi;
}
extern class JSListFormat extends JSObject {
locale: String;
icu_formatter: Foreign; // Managed<icu::ListFormatter>
flags: Smi;
}
extern class JSNumberFormat extends JSObject {
locale: String;
icu_number_format: Foreign; // Managed<icu::NumberFormat>
bound_format: JSFunction | Undefined;
flags: Smi;
}
extern class JSPluralRules extends JSObject {
locale: String;
flags: Smi;
icu_plural_rules: Foreign; // Managed<icu::PluralRules>
icu_decimal_format: Foreign; // Managed<icu::DecimalFormat>
}
extern class JSRelativeTimeFormat extends JSObject {
locale: String;
icu_formatter: Foreign; // Managed<icu::RelativeDateTimeFormatter>
flags: Smi;
}
extern class JSSegmenter extends JSObject {
locale: String;
icu_break_iterator: Foreign; // Managed<icu::BreakIterator>
flags: Smi;
}
extern class JSSegmentIterator extends JSObject {
icu_break_iterator: Foreign; // Managed<icu::BreakIterator>
unicode_string: Foreign; // Managed<icu::UnicodeString>
flags: Smi;
}
extern class JSAsyncFromSyncIterator extends JSObject { extern class JSAsyncFromSyncIterator extends JSObject {
sync_iterator: JSReceiver; sync_iterator: JSReceiver;
next: Object; next: Object;
......
...@@ -2161,62 +2161,64 @@ void JSCollator::JSCollatorVerify(Isolate* isolate) { ...@@ -2161,62 +2161,64 @@ void JSCollator::JSCollatorVerify(Isolate* isolate) {
void JSDateTimeFormat::JSDateTimeFormatVerify(Isolate* isolate) { void JSDateTimeFormat::JSDateTimeFormatVerify(Isolate* isolate) {
JSObjectVerify(isolate); JSObjectVerify(isolate);
VerifyObjectField(isolate, kICULocaleOffset); VerifyObjectField(isolate, kIcuLocaleOffset);
VerifyObjectField(isolate, kICUSimpleDateFormatOffset); VerifyObjectField(isolate, kIcuSimpleDateFormatOffset);
VerifyObjectField(isolate, kICUDateIntervalFormatOffset); VerifyObjectField(isolate, kIcuDateIntervalFormatOffset);
VerifySmiField(kFlagsOffset);
VerifyObjectField(isolate, kBoundFormatOffset); VerifyObjectField(isolate, kBoundFormatOffset);
VerifyObjectField(isolate, kFlagsOffset); CHECK(bound_format()->IsUndefined(isolate) || bound_format()->IsJSFunction());
} }
void JSListFormat::JSListFormatVerify(Isolate* isolate) { void JSListFormat::JSListFormatVerify(Isolate* isolate) {
JSObjectVerify(isolate); JSObjectVerify(isolate);
VerifyObjectField(isolate, kLocaleOffset); VerifyObjectField(isolate, kLocaleOffset);
VerifyObjectField(isolate, kICUFormatterOffset); VerifyObjectField(isolate, kIcuFormatterOffset);
VerifyObjectField(isolate, kFlagsOffset); VerifySmiField(kFlagsOffset);
} }
void JSLocale::JSLocaleVerify(Isolate* isolate) { void JSLocale::JSLocaleVerify(Isolate* isolate) {
JSObjectVerify(isolate); JSObjectVerify(isolate);
VerifyObjectField(isolate, kICULocaleOffset); VerifyObjectField(isolate, kIcuLocaleOffset);
} }
void JSNumberFormat::JSNumberFormatVerify(Isolate* isolate) { void JSNumberFormat::JSNumberFormatVerify(Isolate* isolate) {
CHECK(IsJSNumberFormat()); CHECK(IsJSNumberFormat());
JSObjectVerify(isolate); JSObjectVerify(isolate);
VerifyObjectField(isolate, kLocaleOffset); VerifyObjectField(isolate, kLocaleOffset);
VerifyObjectField(isolate, kICUNumberFormatOffset); VerifyObjectField(isolate, kIcuNumberFormatOffset);
VerifyObjectField(isolate, kBoundFormatOffset); VerifyObjectField(isolate, kBoundFormatOffset);
VerifyObjectField(isolate, kFlagsOffset); CHECK(bound_format()->IsUndefined(isolate) || bound_format()->IsJSFunction());
VerifySmiField(kFlagsOffset);
} }
void JSPluralRules::JSPluralRulesVerify(Isolate* isolate) { void JSPluralRules::JSPluralRulesVerify(Isolate* isolate) {
CHECK(IsJSPluralRules()); CHECK(IsJSPluralRules());
JSObjectVerify(isolate); JSObjectVerify(isolate);
VerifyObjectField(isolate, kLocaleOffset); VerifyObjectField(isolate, kLocaleOffset);
VerifyObjectField(isolate, kFlagsOffset); VerifySmiField(kFlagsOffset);
VerifyObjectField(isolate, kICUPluralRulesOffset); VerifyObjectField(isolate, kIcuPluralRulesOffset);
VerifyObjectField(isolate, kICUDecimalFormatOffset); VerifyObjectField(isolate, kIcuDecimalFormatOffset);
} }
void JSRelativeTimeFormat::JSRelativeTimeFormatVerify(Isolate* isolate) { void JSRelativeTimeFormat::JSRelativeTimeFormatVerify(Isolate* isolate) {
JSObjectVerify(isolate); JSObjectVerify(isolate);
VerifyObjectField(isolate, kLocaleOffset); VerifyObjectField(isolate, kLocaleOffset);
VerifyObjectField(isolate, kICUFormatterOffset); VerifyObjectField(isolate, kIcuFormatterOffset);
VerifyObjectField(isolate, kFlagsOffset); VerifySmiField(kFlagsOffset);
} }
void JSSegmentIterator::JSSegmentIteratorVerify(Isolate* isolate) { void JSSegmentIterator::JSSegmentIteratorVerify(Isolate* isolate) {
JSObjectVerify(isolate); JSObjectVerify(isolate);
VerifyObjectField(isolate, kICUBreakIteratorOffset); VerifyObjectField(isolate, kIcuBreakIteratorOffset);
VerifyObjectField(isolate, kUnicodeStringOffset); VerifyObjectField(isolate, kUnicodeStringOffset);
VerifyObjectField(isolate, kFlagsOffset); VerifySmiField(kFlagsOffset);
} }
void JSSegmenter::JSSegmenterVerify(Isolate* isolate) { void JSSegmenter::JSSegmenterVerify(Isolate* isolate) {
JSObjectVerify(isolate); JSObjectVerify(isolate);
VerifyObjectField(isolate, kLocaleOffset); VerifyObjectField(isolate, kLocaleOffset);
VerifyObjectField(isolate, kICUBreakIteratorOffset); VerifyObjectField(isolate, kIcuBreakIteratorOffset);
VerifyObjectField(isolate, kFlagsOffset); VerifySmiField(kFlagsOffset);
} }
#endif // V8_INTL_SUPPORT #endif // V8_INTL_SUPPORT
......
...@@ -20,11 +20,11 @@ namespace internal { ...@@ -20,11 +20,11 @@ namespace internal {
OBJECT_CONSTRUCTORS_IMPL(JSDateTimeFormat, JSObject) OBJECT_CONSTRUCTORS_IMPL(JSDateTimeFormat, JSObject)
ACCESSORS(JSDateTimeFormat, icu_locale, Managed<icu::Locale>, kICULocaleOffset) ACCESSORS(JSDateTimeFormat, icu_locale, Managed<icu::Locale>, kIcuLocaleOffset)
ACCESSORS(JSDateTimeFormat, icu_simple_date_format, ACCESSORS(JSDateTimeFormat, icu_simple_date_format,
Managed<icu::SimpleDateFormat>, kICUSimpleDateFormatOffset) Managed<icu::SimpleDateFormat>, kIcuSimpleDateFormatOffset)
ACCESSORS(JSDateTimeFormat, icu_date_interval_format, ACCESSORS(JSDateTimeFormat, icu_date_interval_format,
Managed<icu::DateIntervalFormat>, kICUDateIntervalFormatOffset) Managed<icu::DateIntervalFormat>, kIcuDateIntervalFormatOffset)
ACCESSORS(JSDateTimeFormat, bound_format, Object, kBoundFormatOffset) ACCESSORS(JSDateTimeFormat, bound_format, Object, kBoundFormatOffset)
SMI_ACCESSORS(JSDateTimeFormat, flags, kFlagsOffset) SMI_ACCESSORS(JSDateTimeFormat, flags, kFlagsOffset)
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "src/isolate.h" #include "src/isolate.h"
#include "src/objects/intl-objects.h" #include "src/objects/intl-objects.h"
#include "src/objects/managed.h" #include "src/objects/managed.h"
#include "torque-generated/class-definitions-from-dsl.h"
#include "unicode/uversion.h" #include "unicode/uversion.h"
// Has to be the last include (doesn't have include guards): // Has to be the last include (doesn't have include guards):
...@@ -92,18 +93,8 @@ class JSDateTimeFormat : public JSObject { ...@@ -92,18 +93,8 @@ class JSDateTimeFormat : public JSObject {
enum class DateTimeStyle { kUndefined, kFull, kLong, kMedium, kShort }; enum class DateTimeStyle { kUndefined, kFull, kLong, kMedium, kShort };
// Layout description. // 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, DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
JS_DATE_TIME_FORMAT_FIELDS) TORQUE_GENERATED_JSDATE_TIME_FORMAT_FIELDS)
#undef JS_DATE_TIME_FORMAT_FIELDS
inline void set_hour_cycle(Intl::HourCycle hour_cycle); inline void set_hour_cycle(Intl::HourCycle hour_cycle);
inline Intl::HourCycle hour_cycle() const; inline Intl::HourCycle hour_cycle() const;
......
...@@ -23,7 +23,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSListFormat, JSObject) ...@@ -23,7 +23,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSListFormat, JSObject)
// Base list format accessors. // Base list format accessors.
ACCESSORS(JSListFormat, locale, String, kLocaleOffset) ACCESSORS(JSListFormat, locale, String, kLocaleOffset)
ACCESSORS(JSListFormat, icu_formatter, Managed<icu::ListFormatter>, ACCESSORS(JSListFormat, icu_formatter, Managed<icu::ListFormatter>,
kICUFormatterOffset) kIcuFormatterOffset)
SMI_ACCESSORS(JSListFormat, flags, kFlagsOffset) SMI_ACCESSORS(JSListFormat, flags, kFlagsOffset)
inline void JSListFormat::set_style(Style style) { inline void JSListFormat::set_style(Style style) {
......
...@@ -105,16 +105,8 @@ class JSListFormat : public JSObject { ...@@ -105,16 +105,8 @@ class JSListFormat : public JSObject {
DECL_VERIFIER(JSListFormat) DECL_VERIFIER(JSListFormat)
// Layout description. // Layout description.
#define JS_LIST_FORMAT_FIELDS(V) \ DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
V(kJSListFormatOffset, kTaggedSize) \ TORQUE_GENERATED_JSLIST_FORMAT_FIELDS)
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
OBJECT_CONSTRUCTORS(JSListFormat, JSObject); OBJECT_CONSTRUCTORS(JSListFormat, JSObject);
}; };
......
...@@ -21,7 +21,7 @@ namespace internal { ...@@ -21,7 +21,7 @@ namespace internal {
OBJECT_CONSTRUCTORS_IMPL(JSLocale, JSObject) OBJECT_CONSTRUCTORS_IMPL(JSLocale, JSObject)
ACCESSORS(JSLocale, icu_locale, Managed<icu::Locale>, kICULocaleOffset) ACCESSORS(JSLocale, icu_locale, Managed<icu::Locale>, kIcuLocaleOffset)
CAST_ACCESSOR(JSLocale) CAST_ACCESSOR(JSLocale)
......
...@@ -58,12 +58,8 @@ class JSLocale : public JSObject { ...@@ -58,12 +58,8 @@ class JSLocale : public JSObject {
DECL_VERIFIER(JSLocale) DECL_VERIFIER(JSLocale)
// Layout description. // Layout description.
#define JS_LOCALE_FIELDS(V) \ DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
V(kICULocaleOffset, kTaggedSize) \ TORQUE_GENERATED_JSLOCALE_FIELDS)
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JS_LOCALE_FIELDS)
#undef JS_LOCALE_FIELDS
OBJECT_CONSTRUCTORS(JSLocale, JSObject); OBJECT_CONSTRUCTORS(JSLocale, JSObject);
}; };
......
...@@ -22,7 +22,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSNumberFormat, JSObject) ...@@ -22,7 +22,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSNumberFormat, JSObject)
ACCESSORS(JSNumberFormat, locale, String, kLocaleOffset) ACCESSORS(JSNumberFormat, locale, String, kLocaleOffset)
ACCESSORS(JSNumberFormat, icu_number_format, Managed<icu::NumberFormat>, ACCESSORS(JSNumberFormat, icu_number_format, Managed<icu::NumberFormat>,
kICUNumberFormatOffset) kIcuNumberFormatOffset)
ACCESSORS(JSNumberFormat, bound_format, Object, kBoundFormatOffset) ACCESSORS(JSNumberFormat, bound_format, Object, kBoundFormatOffset)
SMI_ACCESSORS(JSNumberFormat, flags, kFlagsOffset) SMI_ACCESSORS(JSNumberFormat, flags, kFlagsOffset)
......
...@@ -98,16 +98,8 @@ class JSNumberFormat : public JSObject { ...@@ -98,16 +98,8 @@ class JSNumberFormat : public JSObject {
inline CurrencyDisplay currency_display() const; inline CurrencyDisplay currency_display() const;
// Layout description. // Layout description.
#define JS_NUMBER_FORMAT_FIELDS(V) \ DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
V(kLocaleOffset, kTaggedSize) \ TORQUE_GENERATED_JSNUMBER_FORMAT_FIELDS)
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
// Bit positions in |flags|. // Bit positions in |flags|.
#define FLAGS_BIT_FIELDS(V, _) \ #define FLAGS_BIT_FIELDS(V, _) \
......
...@@ -874,15 +874,8 @@ class JSIteratorResult : public JSObject { ...@@ -874,15 +874,8 @@ class JSIteratorResult : public JSObject {
DECL_ACCESSORS(done, Object) DECL_ACCESSORS(done, Object)
// Layout description. // 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, DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
JS_ITERATOR_RESULT_FIELDS) TORQUE_GENERATED_JSITERATOR_RESULT_FIELDS)
#undef JS_ITERATOR_RESULT_FIELDS
// Indices of in-object properties. // Indices of in-object properties.
static const int kValueIndex = 0; static const int kValueIndex = 0;
...@@ -1204,15 +1197,8 @@ class JSGlobalObject : public JSObject { ...@@ -1204,15 +1197,8 @@ class JSGlobalObject : public JSObject {
DECL_VERIFIER(JSGlobalObject) DECL_VERIFIER(JSGlobalObject)
// Layout description. // Layout description.
#define JS_GLOBAL_OBJECT_FIELDS(V) \ DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
V(kNativeContextOffset, kTaggedSize) \ TORQUE_GENERATED_JSGLOBAL_OBJECT_FIELDS)
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
OBJECT_CONSTRUCTORS(JSGlobalObject, JSObject); OBJECT_CONSTRUCTORS(JSGlobalObject, JSObject);
}; };
......
...@@ -24,9 +24,9 @@ OBJECT_CONSTRUCTORS_IMPL(JSPluralRules, JSObject) ...@@ -24,9 +24,9 @@ OBJECT_CONSTRUCTORS_IMPL(JSPluralRules, JSObject)
ACCESSORS(JSPluralRules, locale, String, kLocaleOffset) ACCESSORS(JSPluralRules, locale, String, kLocaleOffset)
SMI_ACCESSORS(JSPluralRules, flags, kFlagsOffset) SMI_ACCESSORS(JSPluralRules, flags, kFlagsOffset)
ACCESSORS(JSPluralRules, icu_plural_rules, Managed<icu::PluralRules>, ACCESSORS(JSPluralRules, icu_plural_rules, Managed<icu::PluralRules>,
kICUPluralRulesOffset) kIcuPluralRulesOffset)
ACCESSORS(JSPluralRules, icu_decimal_format, Managed<icu::DecimalFormat>, ACCESSORS(JSPluralRules, icu_decimal_format, Managed<icu::DecimalFormat>,
kICUDecimalFormatOffset) kIcuDecimalFormatOffset)
inline void JSPluralRules::set_type(Type type) { inline void JSPluralRules::set_type(Type type) {
DCHECK_LT(type, Type::COUNT); DCHECK_LT(type, Type::COUNT);
......
...@@ -69,16 +69,8 @@ class JSPluralRules : public JSObject { ...@@ -69,16 +69,8 @@ class JSPluralRules : public JSObject {
STATIC_ASSERT(Type::ORDINAL <= TypeBits::kMax); STATIC_ASSERT(Type::ORDINAL <= TypeBits::kMax);
// Layout description. // Layout description.
#define JS_PLURAL_RULES_FIELDS(V) \ DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
V(kLocaleOffset, kTaggedSize) \ TORQUE_GENERATED_JSPLURAL_RULES_FIELDS)
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
DECL_ACCESSORS(locale, String) DECL_ACCESSORS(locale, String)
DECL_INT_ACCESSORS(flags) DECL_INT_ACCESSORS(flags)
......
...@@ -23,7 +23,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSRelativeTimeFormat, JSObject) ...@@ -23,7 +23,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSRelativeTimeFormat, JSObject)
// Base relative time format accessors. // Base relative time format accessors.
ACCESSORS(JSRelativeTimeFormat, locale, String, kLocaleOffset) ACCESSORS(JSRelativeTimeFormat, locale, String, kLocaleOffset)
ACCESSORS(JSRelativeTimeFormat, icu_formatter, ACCESSORS(JSRelativeTimeFormat, icu_formatter,
Managed<icu::RelativeDateTimeFormatter>, kICUFormatterOffset) Managed<icu::RelativeDateTimeFormatter>, kIcuFormatterOffset)
SMI_ACCESSORS(JSRelativeTimeFormat, flags, kFlagsOffset) SMI_ACCESSORS(JSRelativeTimeFormat, flags, kFlagsOffset)
inline void JSRelativeTimeFormat::set_style(Style style) { inline void JSRelativeTimeFormat::set_style(Style style) {
......
...@@ -106,17 +106,8 @@ class JSRelativeTimeFormat : public JSObject { ...@@ -106,17 +106,8 @@ class JSRelativeTimeFormat : public JSObject {
DECL_VERIFIER(JSRelativeTimeFormat) DECL_VERIFIER(JSRelativeTimeFormat)
// Layout description. // Layout description.
#define JS_RELATIVE_TIME_FORMAT_FIELDS(V) \
V(kJSRelativeTimeFormatOffset, kTaggedSize) \
V(kLocaleOffset, kTaggedSize) \
V(kICUFormatterOffset, kTaggedSize) \
V(kFlagsOffset, kTaggedSize) \
/* Header size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
JS_RELATIVE_TIME_FORMAT_FIELDS) TORQUE_GENERATED_JSRELATIVE_TIME_FORMAT_FIELDS)
#undef JS_RELATIVE_TIME_FORMAT_FIELDS
private: private:
static Style getStyle(const char* str); static Style getStyle(const char* str);
......
...@@ -22,7 +22,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSSegmentIterator, JSObject) ...@@ -22,7 +22,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSSegmentIterator, JSObject)
// Base segment iterator accessors. // Base segment iterator accessors.
ACCESSORS(JSSegmentIterator, icu_break_iterator, Managed<icu::BreakIterator>, ACCESSORS(JSSegmentIterator, icu_break_iterator, Managed<icu::BreakIterator>,
kICUBreakIteratorOffset) kIcuBreakIteratorOffset)
ACCESSORS(JSSegmentIterator, unicode_string, Managed<icu::UnicodeString>, ACCESSORS(JSSegmentIterator, unicode_string, Managed<icu::UnicodeString>,
kUnicodeStringOffset) kUnicodeStringOffset)
......
...@@ -90,16 +90,8 @@ class JSSegmentIterator : public JSObject { ...@@ -90,16 +90,8 @@ class JSSegmentIterator : public JSObject {
DECL_INT_ACCESSORS(flags) DECL_INT_ACCESSORS(flags)
// Layout description. // Layout description.
#define SEGMENTER_FIELDS(V) \ DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
/* Pointer fields. */ \ TORQUE_GENERATED_JSSEGMENT_ITERATOR_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
OBJECT_CONSTRUCTORS(JSSegmentIterator, JSObject); OBJECT_CONSTRUCTORS(JSSegmentIterator, JSObject);
}; };
......
...@@ -23,7 +23,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSSegmenter, JSObject) ...@@ -23,7 +23,7 @@ OBJECT_CONSTRUCTORS_IMPL(JSSegmenter, JSObject)
// Base segmenter accessors. // Base segmenter accessors.
ACCESSORS(JSSegmenter, locale, String, kLocaleOffset) ACCESSORS(JSSegmenter, locale, String, kLocaleOffset)
ACCESSORS(JSSegmenter, icu_break_iterator, Managed<icu::BreakIterator>, ACCESSORS(JSSegmenter, icu_break_iterator, Managed<icu::BreakIterator>,
kICUBreakIteratorOffset) kIcuBreakIteratorOffset)
SMI_ACCESSORS(JSSegmenter, flags, kFlagsOffset) SMI_ACCESSORS(JSSegmenter, flags, kFlagsOffset)
inline void JSSegmenter::set_granularity(Granularity granularity) { inline void JSSegmenter::set_granularity(Granularity granularity) {
......
...@@ -78,16 +78,8 @@ class JSSegmenter : public JSObject { ...@@ -78,16 +78,8 @@ class JSSegmenter : public JSObject {
DECL_VERIFIER(JSSegmenter) DECL_VERIFIER(JSSegmenter)
// Layout description. // Layout description.
#define JS_SEGMENTER_FIELDS(V) \ DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
V(kJSSegmenterOffset, kTaggedSize) \ TORQUE_GENERATED_JSSEGMENTER_FIELDS)
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
private: private:
static Granularity GetGranularity(const char* str); static Granularity GetGranularity(const char* str);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment