WebKit Bugzilla
Attachment 359715 Details for
Bug 193661
: [JSC] Intl constructors should fit in sizeof(InternalFunction)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193661-20190121173511.patch (text/plain), 46.80 KB, created by
Yusuke Suzuki
on 2019-01-21 17:35:12 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2019-01-21 17:35:12 PST
Size:
46.80 KB
patch
obsolete
>Subversion Revision: 240244 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index e37e391217f7e839e9b35b0d322ebfc3657a1030..26392f16c17960e8ca3cbaa9ea716b4f585d1d9b 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,113 @@ >+2019-01-21 Yusuke Suzuki <ysuzuki@apple.com> >+ >+ [JSC] Intl constructors should fit in sizeof(InternalFunction) >+ https://bugs.webkit.org/show_bug.cgi?id=193661 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Previously all the Intl constructors have their own subspace. This is because these constructors have different size from InternalFunction. >+ But it is too costly approach in terms of the memory usage since these constructors are only one per JSGlobalObject. This patch attempts to >+ reduce the memory size consumed by these Intl objects by holding instance structures in IntlObject instead of in each Intl constructors. >+ So that we can make sizeof(Intl constructors) == sizeof(InternalFunction) and drop costly subspaces. Since this patch drops subspaces in VM, >+ it also significantly reduces the sizeof(VM), from 76696 to 74680. >+ >+ This patchh also includes the preparation for making Intl properties lazy. But currently it is not possible since @Collator reference exists >+ in builtin code. >+ >+ * CMakeLists.txt: >+ * DerivedSources.make: >+ * runtime/IntlCollatorConstructor.cpp: >+ (JSC::IntlCollatorConstructor::create): >+ (JSC::IntlCollatorConstructor::finishCreation): >+ (JSC::constructIntlCollator): >+ (JSC::callIntlCollator): >+ (JSC::IntlCollatorConstructor::visitChildren): Deleted. >+ * runtime/IntlCollatorConstructor.h: >+ * runtime/IntlDateTimeFormatConstructor.cpp: >+ (JSC::IntlDateTimeFormatConstructor::create): >+ (JSC::IntlDateTimeFormatConstructor::finishCreation): >+ (JSC::constructIntlDateTimeFormat): >+ (JSC::callIntlDateTimeFormat): >+ (JSC::IntlDateTimeFormatConstructor::visitChildren): Deleted. >+ * runtime/IntlDateTimeFormatConstructor.h: >+ * runtime/IntlNumberFormatConstructor.cpp: >+ (JSC::IntlNumberFormatConstructor::create): >+ (JSC::IntlNumberFormatConstructor::finishCreation): >+ (JSC::constructIntlNumberFormat): >+ (JSC::callIntlNumberFormat): >+ (JSC::IntlNumberFormatConstructor::visitChildren): Deleted. >+ * runtime/IntlNumberFormatConstructor.h: >+ * runtime/IntlObject.cpp: >+ (JSC::createCollator): >+ (JSC::createNumberFormat): >+ (JSC::createDateTimeFormat): >+ (JSC::createPluralRulesConstructor): >+ (JSC::IntlObject::create): >+ (JSC::IntlObject::finishCreation): >+ (JSC::IntlObject::visitChildren): >+ * runtime/IntlObject.h: >+ * runtime/IntlPluralRulesConstructor.cpp: >+ (JSC::IntlPluralRulesConstructor::create): >+ (JSC::IntlPluralRulesConstructor::finishCreation): >+ (JSC::constructIntlPluralRules): >+ (JSC::IntlPluralRulesConstructor::visitChildren): Deleted. >+ * runtime/IntlPluralRulesConstructor.h: >+ * runtime/JSGlobalObject.cpp: >+ (JSC::JSGlobalObject::init): >+ (JSC::JSGlobalObject::visitChildren): >+ * runtime/JSGlobalObject.h: >+ (JSC::JSGlobalObject::intlObject const): >+ * runtime/VM.cpp: >+ (JSC::VM::VM): >+ * runtime/VM.h: >+ >+ * CMakeLists.txt: >+ * DerivedSources.make: >+ * runtime/IntlCollatorConstructor.cpp: >+ (JSC::IntlCollatorConstructor::create): >+ (JSC::IntlCollatorConstructor::finishCreation): >+ (JSC::constructIntlCollator): >+ (JSC::callIntlCollator): >+ (JSC::IntlCollatorConstructor::visitChildren): Deleted. >+ * runtime/IntlCollatorConstructor.h: >+ * runtime/IntlDateTimeFormatConstructor.cpp: >+ (JSC::IntlDateTimeFormatConstructor::create): >+ (JSC::IntlDateTimeFormatConstructor::finishCreation): >+ (JSC::constructIntlDateTimeFormat): >+ (JSC::callIntlDateTimeFormat): >+ (JSC::IntlDateTimeFormatConstructor::visitChildren): Deleted. >+ * runtime/IntlDateTimeFormatConstructor.h: >+ * runtime/IntlNumberFormatConstructor.cpp: >+ (JSC::IntlNumberFormatConstructor::create): >+ (JSC::IntlNumberFormatConstructor::finishCreation): >+ (JSC::constructIntlNumberFormat): >+ (JSC::callIntlNumberFormat): >+ (JSC::IntlNumberFormatConstructor::visitChildren): Deleted. >+ * runtime/IntlNumberFormatConstructor.h: >+ * runtime/IntlObject.cpp: >+ (JSC::createCollatorConstructor): >+ (JSC::createNumberFormatConstructor): >+ (JSC::createDateTimeFormatConstructor): >+ (JSC::createPluralRulesConstructor): >+ (JSC::IntlObject::create): >+ (JSC::IntlObject::finishCreation): >+ (JSC::IntlObject::visitChildren): >+ * runtime/IntlObject.h: >+ * runtime/IntlPluralRulesConstructor.cpp: >+ (JSC::IntlPluralRulesConstructor::create): >+ (JSC::IntlPluralRulesConstructor::finishCreation): >+ (JSC::constructIntlPluralRules): >+ (JSC::IntlPluralRulesConstructor::visitChildren): Deleted. >+ * runtime/IntlPluralRulesConstructor.h: >+ * runtime/JSGlobalObject.cpp: >+ (JSC::JSGlobalObject::init): >+ (JSC::JSGlobalObject::visitChildren): >+ * runtime/JSGlobalObject.h: >+ (JSC::JSGlobalObject::intlObject const): >+ * runtime/VM.cpp: >+ (JSC::VM::VM): >+ * runtime/VM.h: >+ > 2019-01-21 Caio Lima <ticaiolima@gmail.com> > > DoesGC rule is wrong for nodes with BigIntUse >diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt >index 6acdfb13426465bc48bf1d7a5db7775f3849a59d..fab4c61ba3bdf7480ec5f98e7736c24bcf00aa43 100644 >--- a/Source/JavaScriptCore/CMakeLists.txt >+++ b/Source/JavaScriptCore/CMakeLists.txt >@@ -75,6 +75,7 @@ set(JavaScriptCore_OBJECT_LUT_SOURCES > runtime/IntlDateTimeFormatPrototype.cpp > runtime/IntlNumberFormatConstructor.cpp > runtime/IntlNumberFormatPrototype.cpp >+ runtime/IntlObject.cpp > runtime/IntlPluralRulesConstructor.cpp > runtime/IntlPluralRulesPrototype.cpp > runtime/JSDataViewPrototype.cpp >diff --git a/Source/JavaScriptCore/DerivedSources.make b/Source/JavaScriptCore/DerivedSources.make >index 47d25172e8e5384503ed5c55a8a4d8a2868319b2..011a220149391b0e12d75c37a27a9bb8144e0f6e 100644 >--- a/Source/JavaScriptCore/DerivedSources.make >+++ b/Source/JavaScriptCore/DerivedSources.make >@@ -151,6 +151,7 @@ OBJECT_LUT_HEADERS = \ > IntlDateTimeFormatPrototype.lut.h \ > IntlNumberFormatConstructor.lut.h \ > IntlNumberFormatPrototype.lut.h \ >+ IntlObject.lut.h \ > IntlPluralRulesConstructor.lut.h \ > IntlPluralRulesPrototype.lut.h \ > JSDataViewPrototype.lut.h \ >diff --git a/Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp b/Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp >index af15bbb0f345dadddee5e924185571f0b3736868..d7b4390b46218b43c84f33f307014f14fbc89029 100644 >--- a/Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp >+++ b/Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp >@@ -60,10 +60,10 @@ const ClassInfo IntlCollatorConstructor::s_info = { "Function", &InternalFunctio > @end > */ > >-IntlCollatorConstructor* IntlCollatorConstructor::create(VM& vm, Structure* structure, IntlCollatorPrototype* collatorPrototype, Structure* collatorStructure) >+IntlCollatorConstructor* IntlCollatorConstructor::create(VM& vm, Structure* structure, IntlCollatorPrototype* collatorPrototype) > { > IntlCollatorConstructor* constructor = new (NotNull, allocateCell<IntlCollatorConstructor>(vm.heap)) IntlCollatorConstructor(vm, structure); >- constructor->finishCreation(vm, collatorPrototype, collatorStructure); >+ constructor->finishCreation(vm, collatorPrototype); > return constructor; > } > >@@ -77,13 +77,12 @@ IntlCollatorConstructor::IntlCollatorConstructor(VM& vm, Structure* structure) > { > } > >-void IntlCollatorConstructor::finishCreation(VM& vm, IntlCollatorPrototype* collatorPrototype, Structure* collatorStructure) >+void IntlCollatorConstructor::finishCreation(VM& vm, IntlCollatorPrototype* collatorPrototype) > { > Base::finishCreation(vm, "Collator"_s); > putDirectWithoutTransition(vm, vm.propertyNames->prototype, collatorPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); > putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); > collatorPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, this, static_cast<unsigned>(PropertyAttribute::DontEnum)); >- m_collatorStructure.set(vm, this, collatorStructure); > } > > static EncodedJSValue JSC_HOST_CALL constructIntlCollator(ExecState* state) >@@ -94,7 +93,7 @@ static EncodedJSValue JSC_HOST_CALL constructIntlCollator(ExecState* state) > // 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget. > // 2. Let collator be OrdinaryCreateFromConstructor(newTarget, %CollatorPrototype%). > // 3. ReturnIfAbrupt(collator). >- Structure* structure = InternalFunction::createSubclassStructure(state, state->newTarget(), jsCast<IntlCollatorConstructor*>(state->jsCallee())->collatorStructure()); >+ Structure* structure = InternalFunction::createSubclassStructure(state, state->newTarget(), jsCast<IntlCollatorConstructor*>(state->jsCallee())->collatorStructure(vm)); > RETURN_IF_EXCEPTION(scope, encodedJSValue()); > IntlCollator* collator = IntlCollator::create(vm, structure); > ASSERT(collator); >@@ -119,7 +118,7 @@ static EncodedJSValue JSC_HOST_CALL callIntlCollator(ExecState* state) > > // 2. Let collator be OrdinaryCreateFromConstructor(newTarget, %CollatorPrototype%). > // 3. ReturnIfAbrupt(collator). >- IntlCollator* collator = IntlCollator::create(vm, callee->collatorStructure()); >+ IntlCollator* collator = IntlCollator::create(vm, callee->collatorStructure(vm)); > ASSERT(collator); > > // 4. Return InitializeCollator(collator, locales, options). >@@ -144,16 +143,6 @@ EncodedJSValue JSC_HOST_CALL IntlCollatorConstructorFuncSupportedLocalesOf(ExecS > RELEASE_AND_RETURN(scope, JSValue::encode(supportedLocales(*state, globalObject->intlCollatorAvailableLocales(), requestedLocales, state->argument(1)))); > } > >-void IntlCollatorConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor) >-{ >- IntlCollatorConstructor* thisObject = jsCast<IntlCollatorConstructor*>(cell); >- ASSERT_GC_OBJECT_INHERITS(thisObject, info()); >- >- Base::visitChildren(thisObject, visitor); >- >- visitor.append(thisObject->m_collatorStructure); >-} >- > } // namespace JSC > > #endif // ENABLE(INTL) >diff --git a/Source/JavaScriptCore/runtime/IntlCollatorConstructor.h b/Source/JavaScriptCore/runtime/IntlCollatorConstructor.h >index c99cca7e3444489f60a7ae1654afd31e522442c4..c38ee227e2ebc31f059dfcb058a8c298f2800eff 100644 >--- a/Source/JavaScriptCore/runtime/IntlCollatorConstructor.h >+++ b/Source/JavaScriptCore/runtime/IntlCollatorConstructor.h >@@ -29,6 +29,7 @@ > #if ENABLE(INTL) > > #include "InternalFunction.h" >+#include "IntlObject.h" > > namespace JSC { > >@@ -40,27 +41,18 @@ class IntlCollatorConstructor final : public InternalFunction { > typedef InternalFunction Base; > static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable; > >- template<typename CellType> >- static IsoSubspace* subspaceFor(VM& vm) >- { >- return &vm.intlCollatorConstructorSpace; >- } >- >- static IntlCollatorConstructor* create(VM&, Structure*, IntlCollatorPrototype*, Structure*); >+ static IntlCollatorConstructor* create(VM&, Structure*, IntlCollatorPrototype*); > static Structure* createStructure(VM&, JSGlobalObject*, JSValue); > > DECLARE_INFO; > >- Structure* collatorStructure() const { return m_collatorStructure.get(); } >+ Structure* collatorStructure(VM& vm) const { return globalObject(vm)->intlObject()->collatorStructure(); } > > protected: >- void finishCreation(VM&, IntlCollatorPrototype*, Structure*); >+ void finishCreation(VM&, IntlCollatorPrototype*); > > private: > IntlCollatorConstructor(VM&, Structure*); >- static void visitChildren(JSCell*, SlotVisitor&); >- >- WriteBarrier<Structure> m_collatorStructure; > }; > > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp b/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp >index ed48bafa23de6e70d74b32df5960ea64a0bacdcc..cd66956d183de0e6ab882874239515b7a7b7ebb4 100644 >--- a/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp >+++ b/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp >@@ -57,10 +57,10 @@ const ClassInfo IntlDateTimeFormatConstructor::s_info = { "Function", &InternalF > @end > */ > >-IntlDateTimeFormatConstructor* IntlDateTimeFormatConstructor::create(VM& vm, Structure* structure, IntlDateTimeFormatPrototype* dateTimeFormatPrototype, Structure* dateTimeFormatStructure) >+IntlDateTimeFormatConstructor* IntlDateTimeFormatConstructor::create(VM& vm, Structure* structure, IntlDateTimeFormatPrototype* dateTimeFormatPrototype) > { > IntlDateTimeFormatConstructor* constructor = new (NotNull, allocateCell<IntlDateTimeFormatConstructor>(vm.heap)) IntlDateTimeFormatConstructor(vm, structure); >- constructor->finishCreation(vm, dateTimeFormatPrototype, dateTimeFormatStructure); >+ constructor->finishCreation(vm, dateTimeFormatPrototype); > return constructor; > } > >@@ -77,13 +77,12 @@ IntlDateTimeFormatConstructor::IntlDateTimeFormatConstructor(VM& vm, Structure* > { > } > >-void IntlDateTimeFormatConstructor::finishCreation(VM& vm, IntlDateTimeFormatPrototype* dateTimeFormatPrototype, Structure* dateTimeFormatStructure) >+void IntlDateTimeFormatConstructor::finishCreation(VM& vm, IntlDateTimeFormatPrototype* dateTimeFormatPrototype) > { > Base::finishCreation(vm, "DateTimeFormat"_s); > putDirectWithoutTransition(vm, vm.propertyNames->prototype, dateTimeFormatPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); > putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); > dateTimeFormatPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, this, static_cast<unsigned>(PropertyAttribute::DontEnum)); >- m_dateTimeFormatStructure.set(vm, this, dateTimeFormatStructure); > } > > static EncodedJSValue JSC_HOST_CALL constructIntlDateTimeFormat(ExecState* state) >@@ -94,7 +93,7 @@ static EncodedJSValue JSC_HOST_CALL constructIntlDateTimeFormat(ExecState* state > // 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget. > // 2. Let dateTimeFormat be OrdinaryCreateFromConstructor(newTarget, %DateTimeFormatPrototype%). > // 3. ReturnIfAbrupt(dateTimeFormat). >- Structure* structure = InternalFunction::createSubclassStructure(state, state->newTarget(), jsCast<IntlDateTimeFormatConstructor*>(state->jsCallee())->dateTimeFormatStructure()); >+ Structure* structure = InternalFunction::createSubclassStructure(state, state->newTarget(), jsCast<IntlDateTimeFormatConstructor*>(state->jsCallee())->dateTimeFormatStructure(vm)); > RETURN_IF_EXCEPTION(scope, encodedJSValue()); > IntlDateTimeFormat* dateTimeFormat = IntlDateTimeFormat::create(vm, structure); > ASSERT(dateTimeFormat); >@@ -118,7 +117,7 @@ static EncodedJSValue JSC_HOST_CALL callIntlDateTimeFormat(ExecState* state) > return JSValue::encode(constructIntlInstanceWithWorkaroundForLegacyIntlConstructor<IntlDateTimeFormat>(*state, state->thisValue(), callee, [&] (VM& vm) { > // 2. Let dateTimeFormat be OrdinaryCreateFromConstructor(newTarget, %DateTimeFormatPrototype%). > // 3. ReturnIfAbrupt(dateTimeFormat). >- IntlDateTimeFormat* dateTimeFormat = IntlDateTimeFormat::create(vm, callee->dateTimeFormatStructure()); >+ IntlDateTimeFormat* dateTimeFormat = IntlDateTimeFormat::create(vm, callee->dateTimeFormatStructure(vm)); > ASSERT(dateTimeFormat); > > // 4. Return InitializeDateTimeFormat(dateTimeFormat, locales, options). >@@ -145,16 +144,6 @@ EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatConstructorFuncSupportedLocalesOf > RELEASE_AND_RETURN(scope, JSValue::encode(supportedLocales(*state, availableLocales, requestedLocales, state->argument(1)))); > } > >-void IntlDateTimeFormatConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor) >-{ >- IntlDateTimeFormatConstructor* thisObject = jsCast<IntlDateTimeFormatConstructor*>(cell); >- ASSERT_GC_OBJECT_INHERITS(thisObject, info()); >- >- Base::visitChildren(thisObject, visitor); >- >- visitor.append(thisObject->m_dateTimeFormatStructure); >-} >- > } // namespace JSC > > #endif // ENABLE(INTL) >diff --git a/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.h b/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.h >index ff9bbba7e8bd57088871de3d8e1299c5a5e7686f..d9718ef5729b601983ba7d66eca4abc0468ac02b 100644 >--- a/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.h >+++ b/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.h >@@ -29,6 +29,7 @@ > #if ENABLE(INTL) > > #include "InternalFunction.h" >+#include "IntlObject.h" > > namespace JSC { > >@@ -40,27 +41,18 @@ class IntlDateTimeFormatConstructor final : public InternalFunction { > typedef InternalFunction Base; > static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable; > >- template<typename CellType> >- static IsoSubspace* subspaceFor(VM& vm) >- { >- return &vm.intlDateTimeFormatConstructorSpace; >- } >- >- static IntlDateTimeFormatConstructor* create(VM&, Structure*, IntlDateTimeFormatPrototype*, Structure*); >+ static IntlDateTimeFormatConstructor* create(VM&, Structure*, IntlDateTimeFormatPrototype*); > static Structure* createStructure(VM&, JSGlobalObject*, JSValue); > > DECLARE_INFO; > >- Structure* dateTimeFormatStructure() const { return m_dateTimeFormatStructure.get(); } >+ Structure* dateTimeFormatStructure(VM& vm) const { return globalObject(vm)->intlObject()->dateTimeFormatStructure(); } > > protected: >- void finishCreation(VM&, IntlDateTimeFormatPrototype*, Structure*); >+ void finishCreation(VM&, IntlDateTimeFormatPrototype*); > > private: > IntlDateTimeFormatConstructor(VM&, Structure*); >- static void visitChildren(JSCell*, SlotVisitor&); >- >- WriteBarrier<Structure> m_dateTimeFormatStructure; > }; > > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp b/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp >index 03ef39a82b8c785a30845f118b35ebdea26cd62e..304d2245089d7b447a197167ae94a32c5562f29f 100644 >--- a/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp >+++ b/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp >@@ -57,10 +57,10 @@ const ClassInfo IntlNumberFormatConstructor::s_info = { "Function", &Base::s_inf > @end > */ > >-IntlNumberFormatConstructor* IntlNumberFormatConstructor::create(VM& vm, Structure* structure, IntlNumberFormatPrototype* numberFormatPrototype, Structure* numberFormatStructure) >+IntlNumberFormatConstructor* IntlNumberFormatConstructor::create(VM& vm, Structure* structure, IntlNumberFormatPrototype* numberFormatPrototype) > { > IntlNumberFormatConstructor* constructor = new (NotNull, allocateCell<IntlNumberFormatConstructor>(vm.heap)) IntlNumberFormatConstructor(vm, structure); >- constructor->finishCreation(vm, numberFormatPrototype, numberFormatStructure); >+ constructor->finishCreation(vm, numberFormatPrototype); > return constructor; > } > >@@ -77,13 +77,12 @@ IntlNumberFormatConstructor::IntlNumberFormatConstructor(VM& vm, Structure* stru > { > } > >-void IntlNumberFormatConstructor::finishCreation(VM& vm, IntlNumberFormatPrototype* numberFormatPrototype, Structure* numberFormatStructure) >+void IntlNumberFormatConstructor::finishCreation(VM& vm, IntlNumberFormatPrototype* numberFormatPrototype) > { > Base::finishCreation(vm, "NumberFormat"_s); > putDirectWithoutTransition(vm, vm.propertyNames->prototype, numberFormatPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); > putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); > numberFormatPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, this, static_cast<unsigned>(PropertyAttribute::DontEnum)); >- m_numberFormatStructure.set(vm, this, numberFormatStructure); > } > > static EncodedJSValue JSC_HOST_CALL constructIntlNumberFormat(ExecState* state) >@@ -94,7 +93,7 @@ static EncodedJSValue JSC_HOST_CALL constructIntlNumberFormat(ExecState* state) > // 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget. > // 2. Let numberFormat be OrdinaryCreateFromConstructor(newTarget, %NumberFormatPrototype%). > // 3. ReturnIfAbrupt(numberFormat). >- Structure* structure = InternalFunction::createSubclassStructure(state, state->newTarget(), jsCast<IntlNumberFormatConstructor*>(state->jsCallee())->numberFormatStructure()); >+ Structure* structure = InternalFunction::createSubclassStructure(state, state->newTarget(), jsCast<IntlNumberFormatConstructor*>(state->jsCallee())->numberFormatStructure(vm)); > RETURN_IF_EXCEPTION(scope, encodedJSValue()); > IntlNumberFormat* numberFormat = IntlNumberFormat::create(vm, structure); > ASSERT(numberFormat); >@@ -118,7 +117,7 @@ static EncodedJSValue JSC_HOST_CALL callIntlNumberFormat(ExecState* state) > return JSValue::encode(constructIntlInstanceWithWorkaroundForLegacyIntlConstructor<IntlNumberFormat>(*state, state->thisValue(), callee, [&] (VM& vm) { > // 2. Let numberFormat be OrdinaryCreateFromConstructor(newTarget, %NumberFormatPrototype%). > // 3. ReturnIfAbrupt(numberFormat). >- IntlNumberFormat* numberFormat = IntlNumberFormat::create(vm, callee->numberFormatStructure()); >+ IntlNumberFormat* numberFormat = IntlNumberFormat::create(vm, callee->numberFormatStructure(vm)); > ASSERT(numberFormat); > > // 4. Return InitializeNumberFormat(numberFormat, locales, options). >@@ -145,16 +144,6 @@ EncodedJSValue JSC_HOST_CALL IntlNumberFormatConstructorFuncSupportedLocalesOf(E > RELEASE_AND_RETURN(scope, JSValue::encode(supportedLocales(*state, availableLocales, requestedLocales, state->argument(1)))); > } > >-void IntlNumberFormatConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor) >-{ >- IntlNumberFormatConstructor* thisObject = jsCast<IntlNumberFormatConstructor*>(cell); >- ASSERT_GC_OBJECT_INHERITS(thisObject, info()); >- >- Base::visitChildren(thisObject, visitor); >- >- visitor.append(thisObject->m_numberFormatStructure); >-} >- > } // namespace JSC > > #endif // ENABLE(INTL) >diff --git a/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.h b/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.h >index 5dc516e83dcbf56a7c527e0717eaea083ef40a26..26e229f335384bb312528ed262159d19ac8b4ffb 100644 >--- a/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.h >+++ b/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.h >@@ -29,6 +29,7 @@ > #if ENABLE(INTL) > > #include "InternalFunction.h" >+#include "IntlObject.h" > > namespace JSC { > >@@ -40,27 +41,18 @@ class IntlNumberFormatConstructor final : public InternalFunction { > typedef InternalFunction Base; > static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable; > >- template<typename CellType> >- static IsoSubspace* subspaceFor(VM& vm) >- { >- return &vm.intlNumberFormatConstructorSpace; >- } >- >- static IntlNumberFormatConstructor* create(VM&, Structure*, IntlNumberFormatPrototype*, Structure*); >+ static IntlNumberFormatConstructor* create(VM&, Structure*, IntlNumberFormatPrototype*); > static Structure* createStructure(VM&, JSGlobalObject*, JSValue); > > DECLARE_INFO; > >- Structure* numberFormatStructure() const { return m_numberFormatStructure.get(); } >+ Structure* numberFormatStructure(VM& vm) const { return globalObject(vm)->intlObject()->numberFormatStructure(); } > > protected: >- void finishCreation(VM&, IntlNumberFormatPrototype*, Structure*); >+ void finishCreation(VM&, IntlNumberFormatPrototype*); > > private: > IntlNumberFormatConstructor(VM&, Structure*); >- static void visitChildren(JSCell*, SlotVisitor&); >- >- WriteBarrier<Structure> m_numberFormatStructure; > }; > > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/IntlObject.cpp b/Source/JavaScriptCore/runtime/IntlObject.cpp >index 7a18b3dbd898063f543d97bb4d0a378f935c08f8..35c0b8822e191c91005c45ede669dcd67754cd75 100644 >--- a/Source/JavaScriptCore/runtime/IntlObject.cpp >+++ b/Source/JavaScriptCore/runtime/IntlObject.cpp >@@ -47,6 +47,7 @@ > #include "IntlPluralRulesPrototype.h" > #include "JSCInlines.h" > #include "JSCJSValueInlines.h" >+#include "LazyPropertyInlines.h" > #include "Lookup.h" > #include "ObjectPrototype.h" > #include "Options.h" >@@ -63,66 +64,104 @@ STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(IntlObject); > > static EncodedJSValue JSC_HOST_CALL intlObjectFuncGetCanonicalLocales(ExecState*); > >+static JSValue createCollatorConstructor(VM& vm, JSObject* object) >+{ >+ IntlObject* intlObject = jsCast<IntlObject*>(object); >+ JSGlobalObject* globalObject = intlObject->globalObject(vm); >+ return IntlCollatorConstructor::create(vm, IntlCollatorConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), jsCast<IntlCollatorPrototype*>(intlObject->collatorStructure()->storedPrototypeObject())); >+} >+ >+static JSValue createNumberFormatConstructor(VM& vm, JSObject* object) >+{ >+ IntlObject* intlObject = jsCast<IntlObject*>(object); >+ JSGlobalObject* globalObject = intlObject->globalObject(vm); >+ return IntlNumberFormatConstructor::create(vm, IntlNumberFormatConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), jsCast<IntlNumberFormatPrototype*>(intlObject->numberFormatStructure()->storedPrototypeObject())); >+} >+ >+static JSValue createDateTimeFormatConstructor(VM& vm, JSObject* object) >+{ >+ IntlObject* intlObject = jsCast<IntlObject*>(object); >+ JSGlobalObject* globalObject = intlObject->globalObject(vm); >+ return IntlDateTimeFormatConstructor::create(vm, IntlDateTimeFormatConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), jsCast<IntlDateTimeFormatPrototype*>(intlObject->dateTimeFormatStructure()->storedPrototypeObject())); >+} >+ >+static JSValue createPluralRulesConstructor(VM& vm, JSObject* object) >+{ >+ IntlObject* intlObject = jsCast<IntlObject*>(object); >+ JSGlobalObject* globalObject = intlObject->globalObject(vm); >+ return IntlPluralRulesConstructor::create(vm, IntlPluralRulesConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), jsCast<IntlPluralRulesPrototype*>(intlObject->pluralRulesStructure()->storedPrototypeObject())); >+} >+ > } > >+#include "IntlObject.lut.h" >+ > namespace JSC { > >+/* Source for IntlObject.lut.h >+@begin intlObjectTable >+ getCanonicalLocales intlObjectFuncGetCanonicalLocales DontEnum|Function 1 >+@end >+*/ >+ > struct MatcherResult { > String locale; > String extension; > size_t extensionIndex { 0 }; > }; > >-const ClassInfo IntlObject::s_info = { "Object", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(IntlObject) }; >+const ClassInfo IntlObject::s_info = { "Object", &Base::s_info, &intlObjectTable, nullptr, CREATE_METHOD_TABLE(IntlObject) }; > > IntlObject::IntlObject(VM& vm, Structure* structure) > : JSNonFinalObject(vm, structure) > { > } > >-IntlObject* IntlObject::create(VM& vm, JSGlobalObject* globalObject, Structure* structure) >+IntlObject* IntlObject::create(VM& vm, Structure* structure) > { > IntlObject* object = new (NotNull, allocateCell<IntlObject>(vm.heap)) IntlObject(vm, structure); >- object->finishCreation(vm, globalObject); >+ object->finishCreation(vm); > return object; > } > >-void IntlObject::finishCreation(VM& vm, JSGlobalObject* globalObject) >+void IntlObject::finishCreation(VM& vm) > { > Base::finishCreation(vm); > ASSERT(inherits(vm, info())); > >- // Set up Collator. >- IntlCollatorPrototype* collatorPrototype = IntlCollatorPrototype::create(vm, globalObject, IntlCollatorPrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); >- Structure* collatorStructure = IntlCollator::createStructure(vm, globalObject, collatorPrototype); >- IntlCollatorConstructor* collatorConstructor = IntlCollatorConstructor::create(vm, IntlCollatorConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), collatorPrototype, collatorStructure); >- >- // Set up NumberFormat. >- IntlNumberFormatPrototype* numberFormatPrototype = IntlNumberFormatPrototype::create(vm, globalObject, IntlNumberFormatPrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); >- Structure* numberFormatStructure = IntlNumberFormat::createStructure(vm, globalObject, numberFormatPrototype); >- IntlNumberFormatConstructor* numberFormatConstructor = IntlNumberFormatConstructor::create(vm, IntlNumberFormatConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), numberFormatPrototype, numberFormatStructure); >- >- // Set up DateTimeFormat. >- IntlDateTimeFormatPrototype* dateTimeFormatPrototype = IntlDateTimeFormatPrototype::create(vm, globalObject, IntlDateTimeFormatPrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); >- Structure* dateTimeFormatStructure = IntlDateTimeFormat::createStructure(vm, globalObject, dateTimeFormatPrototype); >- IntlDateTimeFormatConstructor* dateTimeFormatConstructor = IntlDateTimeFormatConstructor::create(vm, IntlDateTimeFormatConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), dateTimeFormatPrototype, dateTimeFormatStructure); >- >- // Set up PluralRules. >- IntlPluralRulesPrototype* pluralRulesPrototype = IntlPluralRulesPrototype::create(vm, globalObject, IntlPluralRulesPrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); >- Structure* pluralRulesStructure = IntlPluralRules::createStructure(vm, globalObject, pluralRulesPrototype); >- IntlPluralRulesConstructor* pluralRulesConstructor = IntlPluralRulesConstructor::create(vm, IntlPluralRulesConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), pluralRulesPrototype, pluralRulesStructure); >+ m_collatorStructure.initLater( >+ [] (const LazyProperty<IntlObject, Structure>::Initializer& init) { >+ JSGlobalObject* globalObject = jsCast<IntlObject*>(init.owner)->globalObject(init.vm); >+ IntlCollatorPrototype* collatorPrototype = IntlCollatorPrototype::create(init.vm, globalObject, IntlCollatorPrototype::createStructure(init.vm, globalObject, globalObject->objectPrototype())); >+ init.set(IntlCollator::createStructure(init.vm, globalObject, collatorPrototype)); >+ }); >+ m_numberFormatStructure.initLater( >+ [] (const LazyProperty<IntlObject, Structure>::Initializer& init) { >+ JSGlobalObject* globalObject = jsCast<IntlObject*>(init.owner)->globalObject(init.vm); >+ IntlNumberFormatPrototype* numberFormatPrototype = IntlNumberFormatPrototype::create(init.vm, globalObject, IntlNumberFormatPrototype::createStructure(init.vm, globalObject, globalObject->objectPrototype())); >+ init.set(IntlNumberFormat::createStructure(init.vm, globalObject, numberFormatPrototype)); >+ }); >+ m_dateTimeFormatStructure.initLater( >+ [] (const LazyProperty<IntlObject, Structure>::Initializer& init) { >+ JSGlobalObject* globalObject = jsCast<IntlObject*>(init.owner)->globalObject(init.vm); >+ IntlDateTimeFormatPrototype* dateTimeFormatPrototype = IntlDateTimeFormatPrototype::create(init.vm, globalObject, IntlDateTimeFormatPrototype::createStructure(init.vm, globalObject, globalObject->objectPrototype())); >+ init.set(IntlDateTimeFormat::createStructure(init.vm, globalObject, dateTimeFormatPrototype)); >+ }); >+ m_pluralRulesStructure.initLater( >+ [] (const LazyProperty<IntlObject, Structure>::Initializer& init) { >+ JSGlobalObject* globalObject = jsCast<IntlObject*>(init.owner)->globalObject(init.vm); >+ IntlPluralRulesPrototype* pluralRulesPrototype = IntlPluralRulesPrototype::create(init.vm, globalObject, IntlPluralRulesPrototype::createStructure(init.vm, globalObject, globalObject->objectPrototype())); >+ init.set(IntlPluralRules::createStructure(init.vm, globalObject, pluralRulesPrototype)); >+ }); >+ >+ putDirectWithoutTransition(vm, vm.propertyNames->Collator, createCollatorConstructor(vm, this), static_cast<unsigned>(PropertyAttribute::DontEnum)); >+ putDirectWithoutTransition(vm, vm.propertyNames->NumberFormat, createNumberFormatConstructor(vm, this), static_cast<unsigned>(PropertyAttribute::DontEnum)); >+ putDirectWithoutTransition(vm, vm.propertyNames->DateTimeFormat, createDateTimeFormatConstructor(vm, this), static_cast<unsigned>(PropertyAttribute::DontEnum)); > > // Constructor Properties of the Intl Object > // https://tc39.github.io/ecma402/#sec-constructor-properties-of-the-intl-object >- putDirectWithoutTransition(vm, vm.propertyNames->Collator, collatorConstructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); >- putDirectWithoutTransition(vm, vm.propertyNames->NumberFormat, numberFormatConstructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); >- putDirectWithoutTransition(vm, vm.propertyNames->DateTimeFormat, dateTimeFormatConstructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); > if (Options::useIntlPluralRules()) >- putDirectWithoutTransition(vm, vm.propertyNames->PluralRules, pluralRulesConstructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); >- >- // Function Properties of the Intl Object >- // https://tc39.github.io/ecma402/#sec-function-properties-of-the-intl-object >- putDirectNativeFunction(vm, globalObject, Identifier::fromString(&vm, "getCanonicalLocales"), 1, intlObjectFuncGetCanonicalLocales, NoIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum)); >+ putDirectWithoutTransition(vm, vm.propertyNames->PluralRules, createPluralRulesConstructor(vm, this), static_cast<unsigned>(PropertyAttribute::DontEnum)); > } > > Structure* IntlObject::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) >@@ -942,6 +981,19 @@ EncodedJSValue JSC_HOST_CALL intlObjectFuncGetCanonicalLocales(ExecState* state) > return JSValue::encode(localeArray); > } > >+void IntlObject::visitChildren(JSCell* cell, SlotVisitor& visitor) >+{ >+ IntlObject* thisObject = jsCast<IntlObject*>(cell); >+ ASSERT_GC_OBJECT_INHERITS(thisObject, info()); >+ >+ Base::visitChildren(thisObject, visitor); >+ >+ thisObject->m_collatorStructure.visit(visitor); >+ thisObject->m_numberFormatStructure.visit(visitor); >+ thisObject->m_dateTimeFormatStructure.visit(visitor); >+ thisObject->m_pluralRulesStructure.visit(visitor); >+} >+ > } // namespace JSC > > #endif // ENABLE(INTL) >diff --git a/Source/JavaScriptCore/runtime/IntlObject.h b/Source/JavaScriptCore/runtime/IntlObject.h >index b9d870e2013a510e15ce18b51a1cbd5325439007..d170059fda6db46e8cac51f12821242b606e8a8e 100644 >--- a/Source/JavaScriptCore/runtime/IntlObject.h >+++ b/Source/JavaScriptCore/runtime/IntlObject.h >@@ -44,18 +44,29 @@ class IntlPluralRulesPrototype; > class IntlObject final : public JSNonFinalObject { > public: > typedef JSNonFinalObject Base; >- static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot; >+ static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable | OverridesGetOwnPropertySlot; > >- static IntlObject* create(VM&, JSGlobalObject*, Structure*); >+ static IntlObject* create(VM&, Structure*); > static Structure* createStructure(VM&, JSGlobalObject*, JSValue); > > DECLARE_INFO; > >+ Structure* collatorStructure() { return m_collatorStructure.get(this); } >+ Structure* numberFormatStructure() { return m_numberFormatStructure.get(this); } >+ Structure* dateTimeFormatStructure() { return m_dateTimeFormatStructure.get(this); } >+ Structure* pluralRulesStructure() { return m_pluralRulesStructure.get(this); } >+ > protected: >- void finishCreation(VM&, JSGlobalObject*); >+ void finishCreation(VM&); > > private: >+ static void visitChildren(JSCell*, SlotVisitor&); >+ > IntlObject(VM&, Structure*); >+ LazyProperty<IntlObject, Structure> m_collatorStructure; >+ LazyProperty<IntlObject, Structure> m_numberFormatStructure; >+ LazyProperty<IntlObject, Structure> m_dateTimeFormatStructure; >+ LazyProperty<IntlObject, Structure> m_pluralRulesStructure; > }; > > String defaultLocale(ExecState&); >diff --git a/Source/JavaScriptCore/runtime/IntlPluralRulesConstructor.cpp b/Source/JavaScriptCore/runtime/IntlPluralRulesConstructor.cpp >index 2ae8b067ebed9d9c62a0f1bffec3822dafb5bc83..ace1f739254f0e6b47999ec6e198bad18b7196f2 100644 >--- a/Source/JavaScriptCore/runtime/IntlPluralRulesConstructor.cpp >+++ b/Source/JavaScriptCore/runtime/IntlPluralRulesConstructor.cpp >@@ -55,10 +55,10 @@ const ClassInfo IntlPluralRulesConstructor::s_info = { "Function", &InternalFunc > @end > */ > >-IntlPluralRulesConstructor* IntlPluralRulesConstructor::create(VM& vm, Structure* structure, IntlPluralRulesPrototype* pluralRulesPrototype, Structure* pluralRulesStructure) >+IntlPluralRulesConstructor* IntlPluralRulesConstructor::create(VM& vm, Structure* structure, IntlPluralRulesPrototype* pluralRulesPrototype) > { > IntlPluralRulesConstructor* constructor = new (NotNull, allocateCell<IntlPluralRulesConstructor>(vm.heap)) IntlPluralRulesConstructor(vm, structure); >- constructor->finishCreation(vm, pluralRulesPrototype, pluralRulesStructure); >+ constructor->finishCreation(vm, pluralRulesPrototype); > return constructor; > } > >@@ -75,13 +75,12 @@ IntlPluralRulesConstructor::IntlPluralRulesConstructor(VM& vm, Structure* struct > { > } > >-void IntlPluralRulesConstructor::finishCreation(VM& vm, IntlPluralRulesPrototype* pluralRulesPrototype, Structure* pluralRulesStructure) >+void IntlPluralRulesConstructor::finishCreation(VM& vm, IntlPluralRulesPrototype* pluralRulesPrototype) > { > Base::finishCreation(vm, "PluralRules"_s); > putDirectWithoutTransition(vm, vm.propertyNames->prototype, pluralRulesPrototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); > putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum); > pluralRulesPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, this, static_cast<unsigned>(PropertyAttribute::DontEnum)); >- m_pluralRulesStructure.set(vm, this, pluralRulesStructure); > } > > static EncodedJSValue JSC_HOST_CALL constructIntlPluralRules(ExecState* state) >@@ -91,7 +90,7 @@ static EncodedJSValue JSC_HOST_CALL constructIntlPluralRules(ExecState* state) > > // 13.2.1 Intl.PluralRules ([ locales [ , options ] ]) > // https://tc39.github.io/ecma402/#sec-intl.pluralrules >- Structure* structure = InternalFunction::createSubclassStructure(state, state->newTarget(), jsCast<IntlPluralRulesConstructor*>(state->jsCallee())->pluralRulesStructure()); >+ Structure* structure = InternalFunction::createSubclassStructure(state, state->newTarget(), jsCast<IntlPluralRulesConstructor*>(state->jsCallee())->pluralRulesStructure(vm)); > RETURN_IF_EXCEPTION(scope, encodedJSValue()); > IntlPluralRules* pluralRules = IntlPluralRules::create(vm, structure); > ASSERT(pluralRules); >@@ -127,16 +126,6 @@ EncodedJSValue JSC_HOST_CALL IntlPluralRulesConstructorFuncSupportedLocalesOf(Ex > RELEASE_AND_RETURN(scope, JSValue::encode(supportedLocales(*state, availableLocales, requestedLocales, state->argument(1)))); > } > >-void IntlPluralRulesConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor) >-{ >- IntlPluralRulesConstructor* thisObject = jsCast<IntlPluralRulesConstructor*>(cell); >- ASSERT_GC_OBJECT_INHERITS(thisObject, info()); >- >- Base::visitChildren(thisObject, visitor); >- >- visitor.append(thisObject->m_pluralRulesStructure); >-} >- > } // namespace JSC > > #endif // ENABLE(INTL) >diff --git a/Source/JavaScriptCore/runtime/IntlPluralRulesConstructor.h b/Source/JavaScriptCore/runtime/IntlPluralRulesConstructor.h >index 91af0ed4ef49d42ecd06a337064966041cb2d6e0..16cb469790a1cad33565ba25e38cd269af170e7e 100644 >--- a/Source/JavaScriptCore/runtime/IntlPluralRulesConstructor.h >+++ b/Source/JavaScriptCore/runtime/IntlPluralRulesConstructor.h >@@ -28,6 +28,7 @@ > #if ENABLE(INTL) > > #include "InternalFunction.h" >+#include "IntlObject.h" > > namespace JSC { > >@@ -39,27 +40,18 @@ class IntlPluralRulesConstructor final : public InternalFunction { > typedef InternalFunction Base; > static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable; > >- template<typename CellType> >- static IsoSubspace* subspaceFor(VM& vm) >- { >- return &vm.intlPluralRulesConstructorSpace; >- } >- >- static IntlPluralRulesConstructor* create(VM&, Structure*, IntlPluralRulesPrototype*, Structure*); >+ static IntlPluralRulesConstructor* create(VM&, Structure*, IntlPluralRulesPrototype*); > static Structure* createStructure(VM&, JSGlobalObject*, JSValue); > > DECLARE_INFO; > >- Structure* pluralRulesStructure() const { return m_pluralRulesStructure.get(); } >+ Structure* pluralRulesStructure(VM& vm) const { return globalObject(vm)->intlObject()->pluralRulesStructure(); } > > protected: >- void finishCreation(VM&, IntlPluralRulesPrototype*, Structure*); >+ void finishCreation(VM&, IntlPluralRulesPrototype*); > > private: > IntlPluralRulesConstructor(VM&, Structure*); >- static void visitChildren(JSCell*, SlotVisitor&); >- >- WriteBarrier<Structure> m_pluralRulesStructure; > }; > > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >index 1a61f9db30f4a89e2c248798ecd2529b5fdec4cb..695bee69639cd10727cebf430c3bac1e4fa407cf 100644 >--- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >@@ -782,8 +782,9 @@ putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Construct > putDirectWithoutTransition(vm, vm.propertyNames->eval, m_evalFunction.get(), static_cast<unsigned>(PropertyAttribute::DontEnum)); > > #if ENABLE(INTL) >- IntlObject* intl = IntlObject::create(vm, this, IntlObject::createStructure(vm, this, m_objectPrototype.get())); >+ IntlObject* intl = IntlObject::create(vm, IntlObject::createStructure(vm, this, m_objectPrototype.get())); > putDirectWithoutTransition(vm, vm.propertyNames->Intl, intl, static_cast<unsigned>(PropertyAttribute::DontEnum)); >+ m_intlObject.set(vm, this, intl); > #endif // ENABLE(INTL) > ReflectObject* reflectObject = ReflectObject::create(vm, this, ReflectObject::createStructure(vm, this, m_objectPrototype.get())); > putDirectWithoutTransition(vm, vm.propertyNames->Reflect, reflectObject, static_cast<unsigned>(PropertyAttribute::DontEnum)); >@@ -1559,6 +1560,7 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor) > visitor.append(thisObject->m_objectConstructor); > visitor.append(thisObject->m_promiseConstructor); > >+ visitor.append(thisObject->m_intlObject); > visitor.append(thisObject->m_nullGetterFunction); > visitor.append(thisObject->m_nullSetterFunction); > >diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.h b/Source/JavaScriptCore/runtime/JSGlobalObject.h >index b1d96ad3b58584b722871c682b18071aab9c42fa..193d226800a428c729c822245f041118860d5a97 100644 >--- a/Source/JavaScriptCore/runtime/JSGlobalObject.h >+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.h >@@ -80,6 +80,7 @@ class GetterSetter; > class GlobalCodeBlock; > class IndirectEvalExecutable; > class InputCursor; >+class IntlObject; > class JSArrayBuffer; > class JSArrayBufferConstructor; > class JSArrayBufferPrototype; >@@ -274,6 +275,7 @@ class JSGlobalObject : public JSSegmentedVariableObject { > WriteBarrier<JSPromiseConstructor> m_promiseConstructor; > WriteBarrier<JSInternalPromiseConstructor> m_internalPromiseConstructor; > >+ WriteBarrier<IntlObject> m_intlObject; > WriteBarrier<NullGetterFunction> m_nullGetterFunction; > WriteBarrier<NullSetterFunction> m_nullSetterFunction; > >@@ -583,6 +585,8 @@ class JSGlobalObject : public JSSegmentedVariableObject { > NativeErrorConstructor* typeErrorConstructor() const { return m_typeErrorConstructor.get(); } > NativeErrorConstructor* URIErrorConstructor() const { return m_URIErrorConstructor.get(this); } > >+ IntlObject* intlObject() const { return m_intlObject.get(); } >+ > NullGetterFunction* nullGetterFunction() const { return m_nullGetterFunction.get(); } > NullSetterFunction* nullSetterFunction() const { return m_nullSetterFunction.get(); } > >diff --git a/Source/JavaScriptCore/runtime/VM.cpp b/Source/JavaScriptCore/runtime/VM.cpp >index 7da563a0f5aadedcd1dfafa663321bb6b5d8deb5..d12b77d8cf54bf318dd52f509b206fb1eeeada07 100644 >--- a/Source/JavaScriptCore/runtime/VM.cpp >+++ b/Source/JavaScriptCore/runtime/VM.cpp >@@ -304,12 +304,6 @@ VM::VM(VMType vmType, HeapType heapType) > , generatorFunctionSpace ISO_SUBSPACE_INIT(heap, cellJSValueOOBHeapCellType.get(), JSGeneratorFunction) > , inferredValueSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), InferredValue) > , internalFunctionSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), InternalFunction) >-#if ENABLE(INTL) >- , intlCollatorConstructorSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), IntlCollatorConstructor) >- , intlDateTimeFormatConstructorSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), IntlDateTimeFormatConstructor) >- , intlNumberFormatConstructorSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), IntlNumberFormatConstructor) >- , intlPluralRulesConstructorSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), IntlPluralRulesConstructor) >-#endif > , nativeErrorConstructorSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), NativeErrorConstructor) > , nativeExecutableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), NativeExecutable) > , nativeStdFunctionSpace ISO_SUBSPACE_INIT(heap, cellJSValueOOBHeapCellType.get(), JSNativeStdFunction) >diff --git a/Source/JavaScriptCore/runtime/VM.h b/Source/JavaScriptCore/runtime/VM.h >index 79f4d3b93c52ed5c6b695806a181e2139bbbc838..8d9177b163ef2660c642de778a9502da53e9065b 100644 >--- a/Source/JavaScriptCore/runtime/VM.h >+++ b/Source/JavaScriptCore/runtime/VM.h >@@ -379,12 +379,6 @@ class VM : public ThreadSafeRefCounted<VM>, public DoublyLinkedListNode<VM> { > IsoSubspace generatorFunctionSpace; > IsoSubspace inferredValueSpace; > IsoSubspace internalFunctionSpace; >-#if ENABLE(INTL) >- IsoSubspace intlCollatorConstructorSpace; >- IsoSubspace intlDateTimeFormatConstructorSpace; >- IsoSubspace intlNumberFormatConstructorSpace; >- IsoSubspace intlPluralRulesConstructorSpace; >-#endif > IsoSubspace nativeErrorConstructorSpace; > IsoSubspace nativeExecutableSpace; > IsoSubspace nativeStdFunctionSpace;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193661
:
359710
|
359714
|
359715
|
359716
|
359717