Changeset 247474 in webkit
- Timestamp:
- Jul 15, 2019 9:37:37 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r247472 r247474 1 2019-07-15 Keith Miller <keith_miller@apple.com> 2 3 JSGlobalObject type macros should support feature flags and WeakRef should have one 4 https://bugs.webkit.org/show_bug.cgi?id=199601 5 6 Reviewed by Mark Lam. 7 8 Add JSC option requirements for WeakRef tests. 9 10 * js/script-tests/weakref-async-is-collected.js: 11 * js/script-tests/weakref-eventually-collects-values.js: 12 * js/script-tests/weakref-microtasks-dont-collect.js: 13 * js/script-tests/weakref-weakset-consistency.js: 14 * js/weakref-async-is-collected.html: 15 * js/weakref-eventually-collects-values.html: 16 * js/weakref-microtasks-dont-collect.html: 17 * js/weakref-weakset-consistency.html: 18 1 19 2019-07-15 Ryan Haddad <ryanhaddad@apple.com> 2 20 -
trunk/LayoutTests/js/script-tests/weakref-async-is-collected.js
r246565 r247474 1 //@ requireOptions("--useWeakRefs=true") 2 1 3 asyncTestStart(1); 2 4 function makeWeakRef() { return new WeakRef({foo: 1 }); } -
trunk/LayoutTests/js/script-tests/weakref-eventually-collects-values.js
r246565 r247474 1 //@ requireOptions("--useWeakRefs=true") 2 1 3 asyncTestStart(1); 2 4 -
trunk/LayoutTests/js/script-tests/weakref-microtasks-dont-collect.js
r246565 r247474 1 //@ requireOptions("--useWeakRefs=true") 2 1 3 asyncTestStart(1); 2 4 -
trunk/LayoutTests/js/script-tests/weakref-weakset-consistency.js
r246565 r247474 1 //@ requireOptions("--useWeakRefs=true") 2 1 3 asyncTestStart(1); 2 4 function makeWeakRef() { return new WeakRef({foo: 1 }); } -
trunk/LayoutTests/js/weakref-async-is-collected.html
r246565 r247474 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- webkit-test-runner [ jscOptions=--useWeakRefs=true ] --> 2 2 <html> 3 3 <head> -
trunk/LayoutTests/js/weakref-eventually-collects-values.html
r246565 r247474 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- webkit-test-runner [ jscOptions=--useWeakRefs=true ] --> 2 2 <html> 3 3 <head> -
trunk/LayoutTests/js/weakref-microtasks-dont-collect.html
r246565 r247474 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- webkit-test-runner [ jscOptions=--useWeakRefs=true ] --> 2 2 <html> 3 3 <head> -
trunk/LayoutTests/js/weakref-weakset-consistency.html
r246565 r247474 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- webkit-test-runner [ jscOptions=--useWeakRefs=true ] --> 2 2 <html> 3 3 <head> -
trunk/Source/JavaScriptCore/ChangeLog
r247471 r247474 1 2019-07-15 Keith Miller <keith_miller@apple.com> 2 3 JSGlobalObject type macros should support feature flags and WeakRef should have one 4 https://bugs.webkit.org/show_bug.cgi?id=199601 5 6 Reviewed by Mark Lam. 7 8 This patch refactors the various builtin type macros to have a 9 parameter, which is the feature flag enabling it. Since most 10 builtin types are enabled by default this patch adds a new global 11 bool typeExposedByDefault for clarity. Note, because static hash 12 tables have no concept of feature flags we can't use feature flags 13 with lazy properties. This is probably not a big deal as features 14 that are off by default won't be allocated anywhere we care about 15 memory usage anyway. 16 17 * runtime/CommonIdentifiers.h: 18 * runtime/JSGlobalObject.cpp: 19 (JSC::JSGlobalObject::init): 20 (JSC::JSGlobalObject::visitChildren): 21 * runtime/JSGlobalObject.h: 22 (JSC::JSGlobalObject::stringObjectStructure const): 23 (JSC::JSGlobalObject::bigIntObjectStructure const): Deleted. 24 * runtime/Options.h: 25 * wasm/js/JSWebAssembly.cpp: 26 1 27 2019-07-15 Keith Miller <keith_miller@apple.com> 2 28 -
trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h
r246567 r247474 54 54 macro(String) \ 55 55 macro(Symbol) \ 56 macro(WeakRef) \ 56 57 macro(__defineGetter__) \ 57 58 macro(__defineSetter__) \ -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r247457 r247474 232 232 namespace JSC { 233 233 234 #define CHECK_FEATURE_FLAG_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ 235 static_assert(std::is_same_v<std::remove_cv_t<decltype(featureFlag)>, bool> || std::is_same_v<std::remove_cv_t<decltype(featureFlag)>, bool&>); 236 237 FOR_EACH_SIMPLE_BUILTIN_TYPE(CHECK_FEATURE_FLAG_TYPE) 238 FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(CHECK_FEATURE_FLAG_TYPE) 239 FOR_EACH_LAZY_BUILTIN_TYPE(CHECK_FEATURE_FLAG_TYPE) 240 234 241 static JSValue createProxyProperty(VM& vm, JSObject* object) 235 242 { … … 386 393 Symbol JSGlobalObject::m_symbolObjectStructure DontEnum|ClassStructure 387 394 WeakMap JSGlobalObject::m_weakMapStructure DontEnum|ClassStructure 388 WeakRef JSGlobalObject::m_weakObjectRefStructure DontEnum|ClassStructure389 395 WeakSet JSGlobalObject::m_weakSetStructure DontEnum|ClassStructure 390 396 @end … … 725 731 m_asyncGeneratorPrototype.set(vm, this, AsyncGeneratorPrototype::create(vm, this, AsyncGeneratorPrototype::createStructure(vm, this, m_asyncIteratorPrototype.get()))); 726 732 727 #define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase ) do{ \733 #define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) if (featureFlag) { \ 728 734 m_ ## lowerName ## Prototype.set(vm, this, capitalName##Prototype::create(vm, this, capitalName##Prototype::createStructure(vm, this, m_ ## prototypeBase ## Prototype.get()))); \ 729 735 m_ ## properName ## Structure.set(vm, this, instanceType::createStructure(vm, this, m_ ## lowerName ## Prototype.get())); \ 730 } while (0);736 } 731 737 732 738 FOR_EACH_SIMPLE_BUILTIN_TYPE(CREATE_PROTOTYPE_FOR_SIMPLE_TYPE) 733 734 if (UNLIKELY(Options::useBigInt()))735 FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(CREATE_PROTOTYPE_FOR_SIMPLE_TYPE)736 737 739 FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(CREATE_PROTOTYPE_FOR_SIMPLE_TYPE) 738 740 739 741 #undef CREATE_PROTOTYPE_FOR_SIMPLE_TYPE 740 742 741 #define CREATE_PROTOTYPE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase )\743 #define CREATE_PROTOTYPE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) if (featureFlag) { \ 742 744 m_ ## properName ## Structure.initLater(\ 743 745 [] (LazyClassStructure::Initializer& init) { \ … … 745 747 init.setStructure(instanceType::createStructure(init.vm, init.global, init.prototype)); \ 746 748 init.setConstructor(capitalName ## Constructor::create(init.vm, capitalName ## Constructor::createStructure(init.vm, init.global, init.global->m_functionPrototype.get()), jsCast<capitalName ## Prototype*>(init.prototype), init.global->m_speciesGetterSetter.get())); \ 747 }); 749 }); \ 750 } 748 751 749 752 FOR_EACH_LAZY_BUILTIN_TYPE(CREATE_PROTOTYPE_FOR_LAZY_TYPE) … … 773 776 #endif 774 777 775 #define CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ 776 capitalName ## Constructor* lowerName ## Constructor = capitalName ## Constructor::create(vm, capitalName ## Constructor::createStructure(vm, this, m_functionPrototype.get()), m_ ## lowerName ## Prototype.get(), m_speciesGetterSetter.get()); \ 777 m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, lowerName ## Constructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); \ 778 #define CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ 779 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; \ 780 if (featureFlag) \ 781 m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, lowerName ## Constructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); \ 778 782 779 783 FOR_EACH_SIMPLE_BUILTIN_TYPE(CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE) 780 BigIntConstructor* bigIntConstructor = nullptr;781 if (UNLIKELY(Options::useBigInt())) {782 bigIntConstructor = BigIntConstructor::create(vm, BigIntConstructor::createStructure(vm, this, m_functionPrototype.get()), m_bigIntPrototype.get(), m_speciesGetterSetter.get());783 m_bigIntPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, bigIntConstructor, static_cast<unsigned>(PropertyAttribute::DontEnum));784 }785 784 786 785 #undef CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE … … 853 852 #endif 854 853 855 #define PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ 856 putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Constructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); \ 854 #define PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ 855 if (featureFlag) \ 856 putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Constructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); 857 857 858 858 859 FOR_EACH_SIMPLE_BUILTIN_TYPE_WITH_CONSTRUCTOR(PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE) 859 if (UNLIKELY(Options::useBigInt()))860 FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE)861 860 862 861 #undef PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE … … 1106 1105 putDirectWithoutTransition(vm, Identifier::fromString(exec, "WebAssembly"), webAssembly, static_cast<unsigned>(PropertyAttribute::DontEnum)); 1107 1106 1108 #define CREATE_WEBASSEMBLY_PROTOTYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ 1109 m_ ## properName ## Structure.initLater(\ 1110 [] (LazyClassStructure::Initializer& init) { \ 1111 init.setPrototype(capitalName##Prototype::create(init.vm, init.global, capitalName##Prototype::createStructure(init.vm, init.global, init.global->prototypeBase ## Prototype()))); \ 1112 init.setStructure(instanceType::createStructure(init.vm, init.global, init.prototype)); \ 1113 init.setConstructor(capitalName ## Constructor::create(init.vm, capitalName ## Constructor::createStructure(init.vm, init.global, init.global->functionPrototype()), jsCast<capitalName ## Prototype*>(init.prototype))); \ 1114 }); 1107 #define CREATE_WEBASSEMBLY_PROTOTYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ 1108 if (featureFlag) {\ 1109 m_ ## properName ## Structure.initLater(\ 1110 [] (LazyClassStructure::Initializer& init) { \ 1111 init.setPrototype(capitalName##Prototype::create(init.vm, init.global, capitalName##Prototype::createStructure(init.vm, init.global, init.global->prototypeBase ## Prototype()))); \ 1112 init.setStructure(instanceType::createStructure(init.vm, init.global, init.prototype)); \ 1113 init.setConstructor(capitalName ## Constructor::create(init.vm, capitalName ## Constructor::createStructure(init.vm, init.global, init.global->functionPrototype()), jsCast<capitalName ## Prototype*>(init.prototype))); \ 1114 }); \ 1115 } 1115 1116 1116 1117 FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(CREATE_WEBASSEMBLY_PROTOTYPE) … … 1756 1757 visitor.append(thisObject->m_getterSetterStructure); 1757 1758 thisObject->m_nativeStdFunctionStructure.visit(visitor); 1758 visitor.append(thisObject->m_bigIntObjectStructure);1759 1759 visitor.append(thisObject->m_regExpStructure); 1760 1760 visitor.append(thisObject->m_generatorFunctionStructure); … … 1775 1775 #endif 1776 1776 1777 #define VISIT_SIMPLE_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase ) do{ \1777 #define VISIT_SIMPLE_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) if (featureFlag) { \ 1778 1778 visitor.append(thisObject->m_ ## lowerName ## Prototype); \ 1779 1779 visitor.append(thisObject->m_ ## properName ## Structure); \ 1780 } while (0); 1781 1782 #define VISIT_LAZY_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase) \ 1783 thisObject->m_ ## properName ## Structure.visit(visitor); 1780 } 1784 1781 1785 1782 FOR_EACH_SIMPLE_BUILTIN_TYPE(VISIT_SIMPLE_TYPE) 1786 if (UNLIKELY(Options::useBigInt()))1787 FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(VISIT_SIMPLE_TYPE)1788 1783 FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(VISIT_SIMPLE_TYPE) 1789 1784 1785 #define VISIT_LAZY_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) if (featureFlag) \ 1786 thisObject->m_ ## properName ## Structure.visit(visitor); 1787 1790 1788 FOR_EACH_LAZY_BUILTIN_TYPE(VISIT_LAZY_TYPE) 1791 1789 1792 1790 #if ENABLE(WEBASSEMBLY) 1793 1791 thisObject->m_webAssemblyModuleRecordStructure.visit(visitor); -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r247346 r247474 126 126 template<typename Watchpoint> class ObjectPropertyChangeAdaptiveWatchpoint; 127 127 128 #define DEFINE_STANDARD_BUILTIN(macro, upperName, lowerName) macro(upperName, lowerName, lowerName, JS ## upperName, upperName, object) 128 constexpr bool typeExposedByDefault = true; 129 130 #define DEFINE_STANDARD_BUILTIN(macro, upperName, lowerName) macro(upperName, lowerName, lowerName, JS ## upperName, upperName, object, typeExposedByDefault) 129 131 130 132 #define FOR_EACH_SIMPLE_BUILTIN_TYPE_WITH_CONSTRUCTOR(macro) \ 131 macro(String, string, stringObject, StringObject, String, object) \ 132 macro(Map, map, map, JSMap, Map, object) \ 133 macro(Set, set, set, JSSet, Set, object) \ 134 macro(JSPromise, promise, promise, JSPromise, Promise, object) 135 136 #define FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(macro) \ 137 macro(BigInt, bigInt, bigIntObject, BigIntObject, BigInt, object) 133 macro(String, string, stringObject, StringObject, String, object, typeExposedByDefault) \ 134 macro(Map, map, map, JSMap, Map, object, typeExposedByDefault) \ 135 macro(Set, set, set, JSSet, Set, object, typeExposedByDefault) \ 136 macro(JSPromise, promise, promise, JSPromise, Promise, object, typeExposedByDefault) \ 137 macro(BigInt, bigInt, bigIntObject, BigIntObject, BigInt, object, Options::useBigInt()) \ 138 macro(WeakObjectRef, weakObjectRef, weakObjectRef, JSWeakObjectRef, WeakRef, object, Options::useWeakRefs()) \ 138 139 139 140 #define FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(macro) \ 140 macro(StringIterator, stringIterator, stringIterator, JSStringIterator, StringIterator, iterator ) \141 macro(StringIterator, stringIterator, stringIterator, JSStringIterator, StringIterator, iterator, typeExposedByDefault) \ 141 142 142 143 #define FOR_EACH_SIMPLE_BUILTIN_TYPE(macro) \ 143 144 FOR_EACH_SIMPLE_BUILTIN_TYPE_WITH_CONSTRUCTOR(macro) \ 144 macro(JSInternalPromise, internalPromise, internalPromise, JSInternalPromise, InternalPromise, object ) \145 macro(JSInternalPromise, internalPromise, internalPromise, JSInternalPromise, InternalPromise, object, typeExposedByDefault) \ 145 146 146 147 #define FOR_EACH_LAZY_BUILTIN_TYPE_WITH_DECLARATION(macro) \ 147 macro(Boolean, boolean, booleanObject, BooleanObject, Boolean, object) \ 148 macro(Date, date, date, DateInstance, Date, object) \ 149 macro(Error, error, error, ErrorInstance, Error, object) \ 150 macro(Number, number, numberObject, NumberObject, Number, object) \ 151 macro(Symbol, symbol, symbolObject, SymbolObject, Symbol, object) \ 152 macro(WeakObjectRef, weakObjectRef, weakObjectRef, JSWeakObjectRef, WeakRef, object) \ 148 macro(Boolean, boolean, booleanObject, BooleanObject, Boolean, object, typeExposedByDefault) \ 149 macro(Date, date, date, DateInstance, Date, object, typeExposedByDefault) \ 150 macro(Error, error, error, ErrorInstance, Error, object, typeExposedByDefault) \ 151 macro(Number, number, numberObject, NumberObject, Number, object, typeExposedByDefault) \ 152 macro(Symbol, symbol, symbolObject, SymbolObject, Symbol, object, typeExposedByDefault) \ 153 153 DEFINE_STANDARD_BUILTIN(macro, WeakMap, weakMap) \ 154 154 DEFINE_STANDARD_BUILTIN(macro, WeakSet, weakSet) \ … … 156 156 #define FOR_EACH_LAZY_BUILTIN_TYPE(macro) \ 157 157 FOR_EACH_LAZY_BUILTIN_TYPE_WITH_DECLARATION(macro) \ 158 macro(JSArrayBuffer, arrayBuffer, arrayBuffer, JSArrayBuffer, ArrayBuffer, object ) \158 macro(JSArrayBuffer, arrayBuffer, arrayBuffer, JSArrayBuffer, ArrayBuffer, object, typeExposedByDefault) \ 159 159 160 160 #if ENABLE(WEBASSEMBLY) 161 161 #define FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(macro) \ 162 macro(WebAssemblyCompileError, webAssemblyCompileError, webAssemblyCompileError, JSWebAssemblyCompileError, CompileError, error ) \163 macro(WebAssemblyInstance, webAssemblyInstance, webAssemblyInstance, JSWebAssemblyInstance, Instance, object ) \164 macro(WebAssemblyLinkError, webAssemblyLinkError, webAssemblyLinkError, JSWebAssemblyLinkError, LinkError, error ) \165 macro(WebAssemblyMemory, webAssemblyMemory, webAssemblyMemory, JSWebAssemblyMemory, Memory, object ) \166 macro(WebAssemblyModule, webAssemblyModule, webAssemblyModule, JSWebAssemblyModule, Module, object ) \167 macro(WebAssemblyRuntimeError, webAssemblyRuntimeError, webAssemblyRuntimeError, JSWebAssemblyRuntimeError, RuntimeError, error ) \168 macro(WebAssemblyTable, webAssemblyTable, webAssemblyTable, JSWebAssemblyTable, Table, object )162 macro(WebAssemblyCompileError, webAssemblyCompileError, webAssemblyCompileError, JSWebAssemblyCompileError, CompileError, error, typeExposedByDefault) \ 163 macro(WebAssemblyInstance, webAssemblyInstance, webAssemblyInstance, JSWebAssemblyInstance, Instance, object, typeExposedByDefault) \ 164 macro(WebAssemblyLinkError, webAssemblyLinkError, webAssemblyLinkError, JSWebAssemblyLinkError, LinkError, error, typeExposedByDefault) \ 165 macro(WebAssemblyMemory, webAssemblyMemory, webAssemblyMemory, JSWebAssemblyMemory, Memory, object, typeExposedByDefault) \ 166 macro(WebAssemblyModule, webAssemblyModule, webAssemblyModule, JSWebAssemblyModule, Module, object, typeExposedByDefault) \ 167 macro(WebAssemblyRuntimeError, webAssemblyRuntimeError, webAssemblyRuntimeError, JSWebAssemblyRuntimeError, RuntimeError, error, typeExposedByDefault) \ 168 macro(WebAssemblyTable, webAssemblyTable, webAssemblyTable, JSWebAssemblyTable, Table, object, typeExposedByDefault) 169 169 #else 170 170 #define FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(macro) 171 171 #endif // ENABLE(WEBASSEMBLY) 172 172 173 #define DECLARE_SIMPLE_BUILTIN_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase ) \173 #define DECLARE_SIMPLE_BUILTIN_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ 174 174 class JS ## capitalName; \ 175 175 class capitalName ## Prototype; \ … … 178 178 class IteratorPrototype; 179 179 FOR_EACH_SIMPLE_BUILTIN_TYPE(DECLARE_SIMPLE_BUILTIN_TYPE) 180 FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(DECLARE_SIMPLE_BUILTIN_TYPE)181 180 FOR_EACH_LAZY_BUILTIN_TYPE_WITH_DECLARATION(DECLARE_SIMPLE_BUILTIN_TYPE) 182 181 FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(DECLARE_SIMPLE_BUILTIN_TYPE) … … 389 388 #endif 390 389 391 #define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase ) \390 #define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ 392 391 WriteBarrier<capitalName ## Prototype> m_ ## lowerName ## Prototype; \ 393 392 WriteBarrier<Structure> m_ ## properName ## Structure; 394 393 395 #define DEFINE_STORAGE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase ) \394 #define DEFINE_STORAGE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ 396 395 LazyClassStructure m_ ## properName ## Structure; 397 396 398 397 FOR_EACH_SIMPLE_BUILTIN_TYPE(DEFINE_STORAGE_FOR_SIMPLE_TYPE) 399 FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(DEFINE_STORAGE_FOR_SIMPLE_TYPE)400 398 FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(DEFINE_STORAGE_FOR_SIMPLE_TYPE) 401 399 … … 754 752 Structure* asyncGeneratorFunctionStructure() const { return m_asyncGeneratorFunctionStructure.get(); } 755 753 Structure* stringObjectStructure() const { return m_stringObjectStructure.get(); } 756 Structure* bigIntObjectStructure() const { return m_bigIntObjectStructure.get(); }757 754 Structure* iteratorResultObjectStructure() const { return m_iteratorResultObjectStructure.get(this); } 758 755 Structure* regExpMatchesArrayStructure() const { return m_regExpMatchesArrayStructure.get(); } … … 841 838 } 842 839 843 #define DEFINE_ACCESSORS_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase ) \840 #define DEFINE_ACCESSORS_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ 844 841 Structure* properName ## Structure() { return m_ ## properName ## Structure.get(); } 845 842 846 843 FOR_EACH_SIMPLE_BUILTIN_TYPE(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE) 847 FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE)848 844 FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE) 849 845 850 846 #undef DEFINE_ACCESSORS_FOR_SIMPLE_TYPE 851 847 852 #define DEFINE_ACCESSORS_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase ) \848 #define DEFINE_ACCESSORS_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ 853 849 Structure* properName ## Structure() { return m_ ## properName ## Structure.get(this); } \ 854 850 JSObject* properName ## Constructor() { return m_ ## properName ## Structure.constructor(this); } -
trunk/Source/JavaScriptCore/runtime/Options.h
r247247 r247474 492 492 v(bool, useEagerWebAssemblyModuleHashing, false, Normal, "Unnamed WebAssembly modules are identified in backtraces through their hash, if available.") \ 493 493 v(bool, useWebAssemblyReferences, false, Normal, "Allow types from the wasm references spec.") \ 494 v(bool, useWeakRefs, false, Normal, "Expose the WeakRef constructor.") \ 494 495 v(bool, useBigInt, false, Normal, "If true, we will enable BigInt support.") \ 495 496 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.") \ -
trunk/Source/JavaScriptCore/wasm/js/JSWebAssembly.cpp
r247457 r247474 58 58 STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSWebAssembly); 59 59 60 #define DEFINE_CALLBACK_FOR_CONSTRUCTOR(capitalName, lowerName, properName, instanceType, jsName, prototypeBase ) \60 #define DEFINE_CALLBACK_FOR_CONSTRUCTOR(capitalName, lowerName, properName, instanceType, jsName, prototypeBase, featureFlag) \ 61 61 static JSValue create##capitalName(VM& vm, JSObject* object) \ 62 62 { \ -
trunk/Tools/ChangeLog
r247466 r247474 1 2019-07-15 Keith Miller <keith_miller@apple.com> 2 3 JSGlobalObject type macros should support feature flags and WeakRef should have one 4 https://bugs.webkit.org/show_bug.cgi?id=199601 5 6 Reviewed by Mark Lam. 7 8 JSC options need to be set before the window is created for the test. 9 10 * DumpRenderTree/mac/DumpRenderTree.mm: 11 (resetWebViewToConsistentStateBeforeTesting): 12 * DumpRenderTree/win/DumpRenderTree.cpp: 13 (setJSCOptions): 14 (resetWebViewToConsistentStateBeforeTesting): 15 1 16 2019-07-15 Said Abou-Hallawa <sabouhallawa@apple.com> 2 17 -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r246285 r247474 1842 1842 static void resetWebViewToConsistentStateBeforeTesting(const TestOptions& options) 1843 1843 { 1844 setJSCOptions(options); 1845 1844 1846 WebView *webView = [mainFrame webView]; 1845 1847 … … 1916 1918 #endif 1917 1919 1918 setJSCOptions(options);1919 1920 1920 WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting(options.additionalSupportedImageTypes.c_str()); 1921 1921 -
trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp
r245733 r247474 46 46 47 47 #include <CoreFoundation/CoreFoundation.h> 48 #include <JavaScriptCore/Options.h> 48 49 #include <JavaScriptCore/TestRunnerUtils.h> 49 50 #include <WebKitLegacy/WebKit.h> … … 66 67 #include <wtf/Vector.h> 67 68 #include <wtf/text/CString.h> 69 #include <wtf/text/StringBuilder.h> 68 70 #include <wtf/text/StringConcatenateNumbers.h> 69 71 #include <wtf/text/StringHash.h> … … 942 944 } 943 945 946 static void setJSCOptions(const TestOptions& options) 947 { 948 static WTF::StringBuilder savedOptions; 949 950 if (!savedOptions.isEmpty()) { 951 JSC::Options::setOptions(savedOptions.toString().ascii().data()); 952 savedOptions.clear(); 953 } 954 955 if (options.jscOptions.length()) { 956 JSC::Options::dumpAllOptionsInALine(savedOptions); 957 JSC::Options::setOptions(options.jscOptions.c_str()); 958 } 959 } 960 944 961 static void resetWebViewToConsistentStateBeforeTesting(const TestOptions& options) 945 962 { 963 setJSCOptions(options); 964 946 965 COMPtr<IWebView> webView; 947 966 if (FAILED(frame->webView(&webView)))
Note: See TracChangeset
for help on using the changeset viewer.