WebKit Bugzilla
Attachment 373701 Details for
Bug 199601
: JSGlobalObject type macros should support feature flags and WeakRef should have one
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199601-20190709014049.patch (text/plain), 30.69 KB, created by
Keith Miller
on 2019-07-09 01:40:50 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Keith Miller
Created:
2019-07-09 01:40:50 PDT
Size:
30.69 KB
patch
obsolete
>Subversion Revision: 247249 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 5db502cc6ae68b5afa63879a1afabc6911a3a96d..c09a484de1b9fbe20c585b4e567bf117e767d4cc 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,29 @@ >+2019-07-09 Keith Miller <keith_miller@apple.com> >+ >+ JSGlobalObject type macros should support feature flags and WeakRef should have one >+ https://bugs.webkit.org/show_bug.cgi?id=199601 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch refactors the various builtin type macros to have a >+ parameter, which is the feature flag enabling it. Since most >+ builtin types are enabled by default this patch adds a new global >+ bool typeExposedByDefault for clarity. Note, because static hash >+ tables have no concept of feature flags we can't use feature flags >+ with lazy properties. This is probably not a big deal as features >+ that are off by default won't be allocated anywhere we care about >+ memory usage anyway. >+ >+ * runtime/CommonIdentifiers.h: >+ * runtime/JSGlobalObject.cpp: >+ (JSC::JSGlobalObject::init): >+ (JSC::JSGlobalObject::visitChildren): >+ * runtime/JSGlobalObject.h: >+ (JSC::JSGlobalObject::stringObjectStructure const): >+ (JSC::JSGlobalObject::bigIntObjectStructure const): Deleted. >+ * runtime/Options.h: >+ * wasm/js/JSWebAssembly.cpp: >+ > 2019-07-08 Keith Miller <keith_miller@apple.com> > > Enable Intl.PluralRules and Intl.NumberFormatToParts by default >diff --git a/Source/JavaScriptCore/runtime/CommonIdentifiers.h b/Source/JavaScriptCore/runtime/CommonIdentifiers.h >index 0605910a3b1b7271a351ce4436eb686447364099..3e6f51c04693bdff21e7b98ccb01fe6126f7c1b6 100644 >--- a/Source/JavaScriptCore/runtime/CommonIdentifiers.h >+++ b/Source/JavaScriptCore/runtime/CommonIdentifiers.h >@@ -53,6 +53,7 @@ > macro(SharedArrayBuffer) \ > macro(String) \ > macro(Symbol) \ >+ macro(WeakRef) \ > macro(__defineGetter__) \ > macro(__defineSetter__) \ > macro(__lookupGetter__) \ >diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >index eace92b2afeb69dceab989333ceac21259419181..dd839383746d29ae14b419e1cdaf73fae6db1787 100644 >--- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >@@ -209,6 +209,13 @@ > > namespace JSC { > >+#define CHECK_FEATURE_FLAG_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ >+static_assert(std::is_same_v<std::remove_cv_t<decltype(featureFlag)>, bool> || std::is_same_v<std::remove_cv_t<decltype(featureFlag)>, bool&>); >+ >+FOR_EACH_SIMPLE_BUILTIN_TYPE(CHECK_FEATURE_FLAG_TYPE) >+FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(CHECK_FEATURE_FLAG_TYPE) >+FOR_EACH_LAZY_BUILTIN_TYPE(CHECK_FEATURE_FLAG_TYPE) >+ > static JSValue createProxyProperty(VM& vm, JSObject* object) > { > JSGlobalObject* global = jsCast<JSGlobalObject*>(object); >@@ -363,7 +370,6 @@ const GlobalObjectMethodTable JSGlobalObject::s_globalObjectMethodTable = { > Number JSGlobalObject::m_numberObjectStructure DontEnum|ClassStructure > Symbol JSGlobalObject::m_symbolObjectStructure DontEnum|ClassStructure > WeakMap JSGlobalObject::m_weakMapStructure DontEnum|ClassStructure >- WeakRef JSGlobalObject::m_weakObjectRefStructure DontEnum|ClassStructure > WeakSet JSGlobalObject::m_weakSetStructure DontEnum|ClassStructure > @end > */ >@@ -702,21 +708,17 @@ void JSGlobalObject::init(VM& vm) > m_generatorPrototype.set(vm, this, GeneratorPrototype::create(vm, this, GeneratorPrototype::createStructure(vm, this, m_iteratorPrototype.get()))); > m_asyncGeneratorPrototype.set(vm, this, AsyncGeneratorPrototype::create(vm, this, AsyncGeneratorPrototype::createStructure(vm, this, m_asyncIteratorPrototype.get()))); > >-#define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) do { \ >+#define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) if (featureFlag) { \ > m_ ## lowerName ## Prototype.set(vm, this, capitalName##Prototype::create(vm, this, capitalName##Prototype::createStructure(vm, this, m_ ## prototypeBase ## Prototype.get()))); \ > m_ ## properName ## Structure.set(vm, this, instanceType::createStructure(vm, this, m_ ## lowerName ## Prototype.get())); \ >- } while (0); >+ } > > FOR_EACH_SIMPLE_BUILTIN_TYPE(CREATE_PROTOTYPE_FOR_SIMPLE_TYPE) >- >- if (UNLIKELY(Options::useBigInt())) >- FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(CREATE_PROTOTYPE_FOR_SIMPLE_TYPE) >- > FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(CREATE_PROTOTYPE_FOR_SIMPLE_TYPE) > > #undef CREATE_PROTOTYPE_FOR_SIMPLE_TYPE > >-#define CREATE_PROTOTYPE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ >+#define CREATE_PROTOTYPE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) if (featureFlag) \ > m_ ## properName ## Structure.initLater(\ > [] (LazyClassStructure::Initializer& init) { \ > init.setPrototype(capitalName##Prototype::create(init.vm, init.global, capitalName##Prototype::createStructure(init.vm, init.global, init.global->m_ ## prototypeBase ## Prototype.get()))); \ >@@ -750,16 +752,12 @@ void JSGlobalObject::init(VM& vm) > AtomicsObject* atomicsObject = AtomicsObject::create(vm, this, AtomicsObject::createStructure(vm, this, m_objectPrototype.get())); > #endif > >-#define CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ >-capitalName ## Constructor* lowerName ## Constructor = capitalName ## Constructor::create(vm, capitalName ## Constructor::createStructure(vm, this, m_functionPrototype.get()), m_ ## lowerName ## Prototype.get(), m_speciesGetterSetter.get()); \ >-m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, lowerName ## Constructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); \ >+#define CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ >+capitalName ## Constructor* lowerName ## Constructor = featureFlag ? capitalName ## Constructor::create(vm, capitalName ## Constructor::createStructure(vm, this, m_functionPrototype.get()), m_ ## lowerName ## Prototype.get(), m_speciesGetterSetter.get()) : nullptr; \ >+ if (featureFlag) \ >+ m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, lowerName ## Constructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); \ > > FOR_EACH_SIMPLE_BUILTIN_TYPE(CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE) >- BigIntConstructor* bigIntConstructor = nullptr; >- if (UNLIKELY(Options::useBigInt())) { >- bigIntConstructor = BigIntConstructor::create(vm, BigIntConstructor::createStructure(vm, this, m_functionPrototype.get()), m_bigIntPrototype.get(), m_speciesGetterSetter.get()); >- m_bigIntPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, bigIntConstructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); >- } > > #undef CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE > >@@ -830,12 +828,12 @@ m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->c > putDirectWithoutTransition(vm, Identifier::fromString(exec, "Atomics"), atomicsObject, static_cast<unsigned>(PropertyAttribute::DontEnum)); > #endif > >-#define PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ >-putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Constructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); \ >+#define PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ >+ if (featureFlag) \ >+ putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Constructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); >+ > > FOR_EACH_SIMPLE_BUILTIN_TYPE_WITH_CONSTRUCTOR(PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE) >- if (UNLIKELY(Options::useBigInt())) >- FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE) > > #undef PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE > m_iteratorResultObjectStructure.initLater( >@@ -1084,13 +1082,15 @@ putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Construct > auto* webAssembly = JSWebAssembly::create(vm, this, JSWebAssembly::createStructure(vm, this, webAssemblyPrototype)); > putDirectWithoutTransition(vm, Identifier::fromString(exec, "WebAssembly"), webAssembly, static_cast<unsigned>(PropertyAttribute::DontEnum)); > >-#define CREATE_WEBASSEMBLY_PROTOTYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ >- m_ ## properName ## Structure.initLater(\ >- [] (LazyClassStructure::Initializer& init) { \ >- init.setPrototype(capitalName##Prototype::create(init.vm, init.global, capitalName##Prototype::createStructure(init.vm, init.global, init.global->prototypeBase ## Prototype()))); \ >- init.setStructure(instanceType::createStructure(init.vm, init.global, init.prototype)); \ >- init.setConstructor(capitalName ## Constructor::create(init.vm, capitalName ## Constructor::createStructure(init.vm, init.global, init.global->functionPrototype()), jsCast<capitalName ## Prototype*>(init.prototype))); \ >- }); >+#define CREATE_WEBASSEMBLY_PROTOTYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ >+ if (featureFlag) {\ >+ m_ ## properName ## Structure.initLater(\ >+ [] (LazyClassStructure::Initializer& init) { \ >+ init.setPrototype(capitalName##Prototype::create(init.vm, init.global, capitalName##Prototype::createStructure(init.vm, init.global, init.global->prototypeBase ## Prototype()))); \ >+ init.setStructure(instanceType::createStructure(init.vm, init.global, init.prototype)); \ >+ init.setConstructor(capitalName ## Constructor::create(init.vm, capitalName ## Constructor::createStructure(init.vm, init.global, init.global->functionPrototype()), jsCast<capitalName ## Prototype*>(init.prototype))); \ >+ }); \ >+ } > > FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(CREATE_WEBASSEMBLY_PROTOTYPE) > >@@ -1734,7 +1734,6 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor) > thisObject->m_boundFunctionStructure.visit(visitor); > visitor.append(thisObject->m_getterSetterStructure); > thisObject->m_nativeStdFunctionStructure.visit(visitor); >- visitor.append(thisObject->m_bigIntObjectStructure); > visitor.append(thisObject->m_regExpStructure); > visitor.append(thisObject->m_generatorFunctionStructure); > visitor.append(thisObject->m_asyncFunctionStructure); >@@ -1753,21 +1752,19 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor) > visitor.append(thisObject->m_sharedArrayBufferStructure); > #endif > >-#define VISIT_SIMPLE_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase) do { \ >+#define VISIT_SIMPLE_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) if (featureFlag) { \ > visitor.append(thisObject->m_ ## lowerName ## Prototype); \ > visitor.append(thisObject->m_ ## properName ## Structure); \ >- } while (0); >- >-#define VISIT_LAZY_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ >- thisObject->m_ ## properName ## Structure.visit(visitor); >+ } > > FOR_EACH_SIMPLE_BUILTIN_TYPE(VISIT_SIMPLE_TYPE) >- if (UNLIKELY(Options::useBigInt())) >- FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(VISIT_SIMPLE_TYPE) > FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(VISIT_SIMPLE_TYPE) > >+#define VISIT_LAZY_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) if (featureFlag) \ >+ thisObject->m_ ## properName ## Structure.visit(visitor); >+ > FOR_EACH_LAZY_BUILTIN_TYPE(VISIT_LAZY_TYPE) >- >+ > #if ENABLE(WEBASSEMBLY) > thisObject->m_webAssemblyModuleRecordStructure.visit(visitor); > thisObject->m_webAssemblyFunctionStructure.visit(visitor); >diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.h b/Source/JavaScriptCore/runtime/JSGlobalObject.h >index 02607c92748096b81399db4ebdec2e0b6bbc7974..369191ddf53daee58eef287a25b56d26e9cb5d1e 100644 >--- a/Source/JavaScriptCore/runtime/JSGlobalObject.h >+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.h >@@ -125,59 +125,58 @@ class WrapperMap; > > template<typename Watchpoint> class ObjectPropertyChangeAdaptiveWatchpoint; > >-#define DEFINE_STANDARD_BUILTIN(macro, upperName, lowerName) macro(upperName, lowerName, lowerName, JS ## upperName, upperName, object) >+constexpr bool typeExposedByDefault = true; > >-#define FOR_EACH_SIMPLE_BUILTIN_TYPE_WITH_CONSTRUCTOR(macro) \ >- macro(String, string, stringObject, StringObject, String, object) \ >- macro(Map, map, map, JSMap, Map, object) \ >- macro(Set, set, set, JSSet, Set, object) \ >- macro(JSPromise, promise, promise, JSPromise, Promise, object) >+#define DEFINE_STANDARD_BUILTIN(macro, upperName, lowerName) macro(upperName, lowerName, lowerName, JS ## upperName, upperName, object, typeExposedByDefault) > >-#define FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(macro) \ >- macro(BigInt, bigInt, bigIntObject, BigIntObject, BigInt, object) >+#define FOR_EACH_SIMPLE_BUILTIN_TYPE_WITH_CONSTRUCTOR(macro) \ >+ macro(String, string, stringObject, StringObject, String, object, typeExposedByDefault) \ >+ macro(Map, map, map, JSMap, Map, object, typeExposedByDefault) \ >+ macro(Set, set, set, JSSet, Set, object, typeExposedByDefault) \ >+ macro(JSPromise, promise, promise, JSPromise, Promise, object, typeExposedByDefault) \ >+ macro(BigInt, bigInt, bigIntObject, BigIntObject, BigInt, object, Options::useBigInt()) \ >+ macro(WeakObjectRef, weakObjectRef, weakObjectRef, JSWeakObjectRef, WeakRef, object, Options::useWeakRefs()) \ > > #define FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(macro) \ >- macro(StringIterator, stringIterator, stringIterator, JSStringIterator, StringIterator, iterator) \ >+ macro(StringIterator, stringIterator, stringIterator, JSStringIterator, StringIterator, iterator, typeExposedByDefault) \ > > #define FOR_EACH_SIMPLE_BUILTIN_TYPE(macro) \ > FOR_EACH_SIMPLE_BUILTIN_TYPE_WITH_CONSTRUCTOR(macro) \ >- macro(JSInternalPromise, internalPromise, internalPromise, JSInternalPromise, InternalPromise, object) \ >+ macro(JSInternalPromise, internalPromise, internalPromise, JSInternalPromise, InternalPromise, object, typeExposedByDefault) \ > > #define FOR_EACH_LAZY_BUILTIN_TYPE_WITH_DECLARATION(macro) \ >- macro(Boolean, boolean, booleanObject, BooleanObject, Boolean, object) \ >- macro(Date, date, date, DateInstance, Date, object) \ >- macro(Error, error, error, ErrorInstance, Error, object) \ >- macro(Number, number, numberObject, NumberObject, Number, object) \ >- macro(Symbol, symbol, symbolObject, SymbolObject, Symbol, object) \ >- macro(WeakObjectRef, weakObjectRef, weakObjectRef, JSWeakObjectRef, WeakRef, object) \ >+ macro(Boolean, boolean, booleanObject, BooleanObject, Boolean, object, typeExposedByDefault) \ >+ macro(Date, date, date, DateInstance, Date, object, typeExposedByDefault) \ >+ macro(Error, error, error, ErrorInstance, Error, object, typeExposedByDefault) \ >+ macro(Number, number, numberObject, NumberObject, Number, object, typeExposedByDefault) \ >+ macro(Symbol, symbol, symbolObject, SymbolObject, Symbol, object, typeExposedByDefault) \ > DEFINE_STANDARD_BUILTIN(macro, WeakMap, weakMap) \ > DEFINE_STANDARD_BUILTIN(macro, WeakSet, weakSet) \ > > #define FOR_EACH_LAZY_BUILTIN_TYPE(macro) \ > FOR_EACH_LAZY_BUILTIN_TYPE_WITH_DECLARATION(macro) \ >- macro(JSArrayBuffer, arrayBuffer, arrayBuffer, JSArrayBuffer, ArrayBuffer, object) \ >+ macro(JSArrayBuffer, arrayBuffer, arrayBuffer, JSArrayBuffer, ArrayBuffer, object, typeExposedByDefault) \ > > #if ENABLE(WEBASSEMBLY) > #define FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(macro) \ >- macro(WebAssemblyCompileError, webAssemblyCompileError, webAssemblyCompileError, JSWebAssemblyCompileError, CompileError, error) \ >- macro(WebAssemblyInstance, webAssemblyInstance, webAssemblyInstance, JSWebAssemblyInstance, Instance, object) \ >- macro(WebAssemblyLinkError, webAssemblyLinkError, webAssemblyLinkError, JSWebAssemblyLinkError, LinkError, error) \ >- macro(WebAssemblyMemory, webAssemblyMemory, webAssemblyMemory, JSWebAssemblyMemory, Memory, object) \ >- macro(WebAssemblyModule, webAssemblyModule, webAssemblyModule, JSWebAssemblyModule, Module, object) \ >- macro(WebAssemblyRuntimeError, webAssemblyRuntimeError, webAssemblyRuntimeError, JSWebAssemblyRuntimeError, RuntimeError, error) \ >- macro(WebAssemblyTable, webAssemblyTable, webAssemblyTable, JSWebAssemblyTable, Table, object) >+ macro(WebAssemblyCompileError, webAssemblyCompileError, webAssemblyCompileError, JSWebAssemblyCompileError, CompileError, error, typeExposedByDefault) \ >+ macro(WebAssemblyInstance, webAssemblyInstance, webAssemblyInstance, JSWebAssemblyInstance, Instance, object, typeExposedByDefault) \ >+ macro(WebAssemblyLinkError, webAssemblyLinkError, webAssemblyLinkError, JSWebAssemblyLinkError, LinkError, error, typeExposedByDefault) \ >+ macro(WebAssemblyMemory, webAssemblyMemory, webAssemblyMemory, JSWebAssemblyMemory, Memory, object, typeExposedByDefault) \ >+ macro(WebAssemblyModule, webAssemblyModule, webAssemblyModule, JSWebAssemblyModule, Module, object, typeExposedByDefault) \ >+ macro(WebAssemblyRuntimeError, webAssemblyRuntimeError, webAssemblyRuntimeError, JSWebAssemblyRuntimeError, RuntimeError, error, typeExposedByDefault) \ >+ macro(WebAssemblyTable, webAssemblyTable, webAssemblyTable, JSWebAssemblyTable, Table, object, typeExposedByDefault) > #else > #define FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(macro) > #endif // ENABLE(WEBASSEMBLY) > >-#define DECLARE_SIMPLE_BUILTIN_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ >+#define DECLARE_SIMPLE_BUILTIN_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ > class JS ## capitalName; \ > class capitalName ## Prototype; \ > class capitalName ## Constructor; > > class IteratorPrototype; > FOR_EACH_SIMPLE_BUILTIN_TYPE(DECLARE_SIMPLE_BUILTIN_TYPE) >-FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(DECLARE_SIMPLE_BUILTIN_TYPE) > FOR_EACH_LAZY_BUILTIN_TYPE_WITH_DECLARATION(DECLARE_SIMPLE_BUILTIN_TYPE) > FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(DECLARE_SIMPLE_BUILTIN_TYPE) > FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(DECLARE_SIMPLE_BUILTIN_TYPE) >@@ -388,15 +387,14 @@ public: > WriteBarrier<Structure> m_sharedArrayBufferStructure; > #endif > >-#define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ >+#define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ > WriteBarrier<capitalName ## Prototype> m_ ## lowerName ## Prototype; \ > WriteBarrier<Structure> m_ ## properName ## Structure; > >-#define DEFINE_STORAGE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ >+#define DEFINE_STORAGE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ > LazyClassStructure m_ ## properName ## Structure; > > FOR_EACH_SIMPLE_BUILTIN_TYPE(DEFINE_STORAGE_FOR_SIMPLE_TYPE) >- FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(DEFINE_STORAGE_FOR_SIMPLE_TYPE) > FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(DEFINE_STORAGE_FOR_SIMPLE_TYPE) > > #if ENABLE(WEBASSEMBLY) >@@ -753,7 +751,6 @@ public: > Structure* asyncFunctionStructure() const { return m_asyncFunctionStructure.get(); } > Structure* asyncGeneratorFunctionStructure() const { return m_asyncGeneratorFunctionStructure.get(); } > Structure* stringObjectStructure() const { return m_stringObjectStructure.get(); } >- Structure* bigIntObjectStructure() const { return m_bigIntObjectStructure.get(); } > Structure* iteratorResultObjectStructure() const { return m_iteratorResultObjectStructure.get(this); } > Structure* regExpMatchesArrayStructure() const { return m_regExpMatchesArrayStructure.get(); } > Structure* regExpMatchesArrayWithGroupsStructure() const { return m_regExpMatchesArrayWithGroupsStructure.get(); } >@@ -840,16 +837,15 @@ public: > return nullptr; > } > >-#define DEFINE_ACCESSORS_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ >+#define DEFINE_ACCESSORS_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ > Structure* properName ## Structure() { return m_ ## properName ## Structure.get(); } > > FOR_EACH_SIMPLE_BUILTIN_TYPE(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE) >- FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE) > FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE) > > #undef DEFINE_ACCESSORS_FOR_SIMPLE_TYPE > >-#define DEFINE_ACCESSORS_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ >+#define DEFINE_ACCESSORS_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ > Structure* properName ## Structure() { return m_ ## properName ## Structure.get(this); } \ > JSObject* properName ## Constructor() { return m_ ## properName ## Structure.constructor(this); } > >diff --git a/Source/JavaScriptCore/runtime/Options.h b/Source/JavaScriptCore/runtime/Options.h >index c6f74194c5d7cb66391fd63564e943cffe7fb43e..03a6c2d9958ada9d55f4d14a24fd6b00662f7fbe 100644 >--- a/Source/JavaScriptCore/runtime/Options.h >+++ b/Source/JavaScriptCore/runtime/Options.h >@@ -491,6 +491,7 @@ constexpr bool enableWebAssemblyStreamingApi = false; > v(bool, useCallICsForWebAssemblyToJSCalls, true, Normal, "If true, we will use CallLinkInfo to inline cache Wasm to JS calls.") \ > v(bool, useEagerWebAssemblyModuleHashing, false, Normal, "Unnamed WebAssembly modules are identified in backtraces through their hash, if available.") \ > v(bool, useWebAssemblyReferences, false, Normal, "Allow types from the wasm references spec.") \ >+ v(bool, useWeakRefs, false, Normal, "Expose the WeakRef constructor.") \ > v(bool, useBigInt, false, Normal, "If true, we will enable BigInt support.") \ > v(bool, useArrayAllocationProfiling, true, Normal, "If true, we will use our normal array allocation profiling. If false, the allocation profile will always claim to be undecided.") \ > v(bool, forcePolyProto, false, Normal, "If true, create_this will always create an object with a poly proto structure.") \ >diff --git a/Source/JavaScriptCore/wasm/js/JSWebAssembly.cpp b/Source/JavaScriptCore/wasm/js/JSWebAssembly.cpp >index b9d4f324c196cf9a4284c15ab4868094a27562e9..442ff50d645f7c38db04cb495ed795b09ba8981d 100644 >--- a/Source/JavaScriptCore/wasm/js/JSWebAssembly.cpp >+++ b/Source/JavaScriptCore/wasm/js/JSWebAssembly.cpp >@@ -34,7 +34,7 @@ namespace JSC { > > STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSWebAssembly); > >-#define DEFINE_CALLBACK_FOR_CONSTRUCTOR(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ >+#define DEFINE_CALLBACK_FOR_CONSTRUCTOR(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ > static JSValue create##capitalName(VM& vm, JSObject* object) \ > { \ > JSWebAssembly* webAssembly = jsCast<JSWebAssembly*>(object); \ >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index d09b05553bf7e20a71aae9d86a5d74ff1fa63d15..5f70e1b5b09104ddd0f3010510a42526c5528707 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,15 @@ >+2019-07-09 Keith Miller <keith_miller@apple.com> >+ >+ JSGlobalObject type macros should support feature flags and WeakRef should have one >+ https://bugs.webkit.org/show_bug.cgi?id=199601 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ JSC options need to be set before the window is created for the test. >+ >+ * DumpRenderTree/mac/DumpRenderTree.mm: >+ (resetWebViewToConsistentStateBeforeTesting): >+ > 2019-07-08 Fujii Hironori <Hironori.Fujii@sony.com> > > JSTestGlobalObject.cpp of bindings-generation-tests is failing for Windows Python >diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm >index 6660c32d9215a2c73717d9c336fbb780126eff5e..02ad95b3d07fd3f36c27ae36f68ed0ebfe326cd6 100644 >--- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm >+++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm >@@ -1841,6 +1841,8 @@ static void setJSCOptions(const TestOptions& options) > > static void resetWebViewToConsistentStateBeforeTesting(const TestOptions& options) > { >+ setJSCOptions(options); >+ > WebView *webView = [mainFrame webView]; > > #if PLATFORM(IOS_FAMILY) >@@ -1915,8 +1917,6 @@ static void resetWebViewToConsistentStateBeforeTesting(const TestOptions& option > [[NSPasteboard generalPasteboard] declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; > #endif > >- setJSCOptions(options); >- > WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting(options.additionalSupportedImageTypes.c_str()); > > [mainFrame _clearOpener]; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index cf57cd58962a65603323640ff7e0569abdb28ff4..33678a8355b9f586e45f70acc09149fa67d43128 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,21 @@ >+2019-07-09 Keith Miller <keith_miller@apple.com> >+ >+ JSGlobalObject type macros should support feature flags and WeakRef should have one >+ https://bugs.webkit.org/show_bug.cgi?id=199601 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add JSC option requirements for WeakRef tests. >+ >+ * js/script-tests/weakref-async-is-collected.js: >+ * js/script-tests/weakref-eventually-collects-values.js: >+ * js/script-tests/weakref-microtasks-dont-collect.js: >+ * js/script-tests/weakref-weakset-consistency.js: >+ * js/weakref-async-is-collected.html: >+ * js/weakref-eventually-collects-values.html: >+ * js/weakref-microtasks-dont-collect.html: >+ * js/weakref-weakset-consistency.html: >+ > 2019-07-08 Keith Miller <keith_miller@apple.com> > > Enable Intl.PluralRules and Intl.NumberFormatToParts by default >diff --git a/LayoutTests/js/script-tests/weakref-async-is-collected.js b/LayoutTests/js/script-tests/weakref-async-is-collected.js >index 3cec80398d6239b743004b02b00cc3927ee363b6..406637a430f9807542d188f43eb43177642973f8 100644 >--- a/LayoutTests/js/script-tests/weakref-async-is-collected.js >+++ b/LayoutTests/js/script-tests/weakref-async-is-collected.js >@@ -1,3 +1,5 @@ >+//@ requireOptions("--useWeakRefs=true") >+ > asyncTestStart(1); > function makeWeakRef() { return new WeakRef({foo: 1 }); } > noInline(makeWeakRef); >diff --git a/LayoutTests/js/script-tests/weakref-eventually-collects-values.js b/LayoutTests/js/script-tests/weakref-eventually-collects-values.js >index 8cf03945a14cce12d223e0f76f81b017c80eda61..5afff2303ac0686f3b7f9366f0e3f678ba6fee40 100644 >--- a/LayoutTests/js/script-tests/weakref-eventually-collects-values.js >+++ b/LayoutTests/js/script-tests/weakref-eventually-collects-values.js >@@ -1,3 +1,5 @@ >+//@ requireOptions("--useWeakRefs=true") >+ > asyncTestStart(1); > > function makeWeakRef() { return new WeakRef({foo: 1}); } >diff --git a/LayoutTests/js/script-tests/weakref-microtasks-dont-collect.js b/LayoutTests/js/script-tests/weakref-microtasks-dont-collect.js >index dd7e9afdcd2dff03caa353981162604482c5d864..ccec7000b601b4f491324eaabe0c9555a9e5f6fe 100644 >--- a/LayoutTests/js/script-tests/weakref-microtasks-dont-collect.js >+++ b/LayoutTests/js/script-tests/weakref-microtasks-dont-collect.js >@@ -1,3 +1,5 @@ >+//@ requireOptions("--useWeakRefs=true") >+ > asyncTestStart(1); > > function makeWeakRef() { return new WeakRef({foo: 1 }); } >diff --git a/LayoutTests/js/script-tests/weakref-weakset-consistency.js b/LayoutTests/js/script-tests/weakref-weakset-consistency.js >index 57941e99d998b4914fa3f98241d035907a2688fc..f3357dc0accb68d0638a05d3c92b90e740ed63be 100644 >--- a/LayoutTests/js/script-tests/weakref-weakset-consistency.js >+++ b/LayoutTests/js/script-tests/weakref-weakset-consistency.js >@@ -1,3 +1,5 @@ >+//@ requireOptions("--useWeakRefs=true") >+ > asyncTestStart(1); > function makeWeakRef() { return new WeakRef({foo: 1 }); } > noInline(makeWeakRef); >diff --git a/LayoutTests/js/weakref-async-is-collected.html b/LayoutTests/js/weakref-async-is-collected.html >index f50cfda5c8fb7bea3b5097b878cdd1a3c968e8cc..9fb64b1d8a073ec7eefc5184b9e81b270944be48 100644 >--- a/LayoutTests/js/weakref-async-is-collected.html >+++ b/LayoutTests/js/weakref-async-is-collected.html >@@ -1,4 +1,4 @@ >-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- webkit-test-runner [ jscOptions=--useWeakRefs=true ] --> > <html> > <head> > <script src="../resources/js-test-pre.js"></script> >diff --git a/LayoutTests/js/weakref-eventually-collects-values.html b/LayoutTests/js/weakref-eventually-collects-values.html >index f36d7d741afab9d93a948c5a425b66a8cb1124fb..90dcdaa72e8effdc2d322eaa0aa138099eefecd7 100644 >--- a/LayoutTests/js/weakref-eventually-collects-values.html >+++ b/LayoutTests/js/weakref-eventually-collects-values.html >@@ -1,4 +1,4 @@ >-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- webkit-test-runner [ jscOptions=--useWeakRefs=true ] --> > <html> > <head> > <script src="../resources/js-test-pre.js"></script> >diff --git a/LayoutTests/js/weakref-microtasks-dont-collect.html b/LayoutTests/js/weakref-microtasks-dont-collect.html >index 2c4853cd8f27c7fc8f7f4dd98a76fc0829fb6e7b..b7b9b9d0078ad93eeecd83df4b6211f28462c425 100644 >--- a/LayoutTests/js/weakref-microtasks-dont-collect.html >+++ b/LayoutTests/js/weakref-microtasks-dont-collect.html >@@ -1,4 +1,4 @@ >-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- webkit-test-runner [ jscOptions=--useWeakRefs=true ] --> > <html> > <head> > <script src="../resources/js-test-pre.js"></script> >diff --git a/LayoutTests/js/weakref-weakset-consistency.html b/LayoutTests/js/weakref-weakset-consistency.html >index c3ae9b608f3d3df7c4ca3c2ca45f79cfd672dcf3..04f2303d755c25134e79c63ca3be073fc62ada65 100644 >--- a/LayoutTests/js/weakref-weakset-consistency.html >+++ b/LayoutTests/js/weakref-weakset-consistency.html >@@ -1,4 +1,4 @@ >-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- webkit-test-runner [ jscOptions=--useWeakRefs=true ] --> > <html> > <head> > <script src="../resources/js-test-pre.js"></script>
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 199601
:
373683
|
373690
|
373693
|
373696
|
373701
|
373705
|
374144
|
374152