Diff
Modified: trunk/Source/_javascript_Core/CMakeLists.txt (243010 => 243011)
--- trunk/Source/_javascript_Core/CMakeLists.txt 2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/_javascript_Core/CMakeLists.txt 2019-03-15 21:33:09 UTC (rev 243011)
@@ -98,6 +98,7 @@
runtime/SymbolConstructor.cpp
runtime/SymbolPrototype.cpp
+ wasm/js/JSWebAssembly.cpp
wasm/js/WebAssemblyCompileErrorConstructor.cpp
wasm/js/WebAssemblyCompileErrorPrototype.cpp
wasm/js/WebAssemblyInstanceConstructor.cpp
Modified: trunk/Source/_javascript_Core/ChangeLog (243010 => 243011)
--- trunk/Source/_javascript_Core/ChangeLog 2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/_javascript_Core/ChangeLog 2019-03-15 21:33:09 UTC (rev 243011)
@@ -1,3 +1,31 @@
+2019-03-15 Yusuke Suzuki <[email protected]>
+
+ [JSC] Make more properties lazily-allocated in JSGlobalObject, including properties only used in JIT mode
+ https://bugs.webkit.org/show_bug.cgi?id=195816
+
+ Reviewed by Michael Saboff.
+
+ This patch makes more properties lazily-allocated in JSGlobalObject. This patch makes the following lazily-allocated.
+
+ 1. iteratorResultObjectStructure
+ 2. WebAssembly related objects except for JSWebAssembly top-level object.
+
+ * CMakeLists.txt:
+ * DerivedSources-input.xcfilelist:
+ * DerivedSources-output.xcfilelist:
+ * DerivedSources.make:
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::init):
+ (JSC::JSGlobalObject::visitChildren):
+ * runtime/JSGlobalObject.h:
+ (JSC::JSGlobalObject::iteratorResultObjectStructure const):
+ (JSC::JSGlobalObject::webAssemblyModuleRecordStructure const):
+ (JSC::JSGlobalObject::webAssemblyFunctionStructure const):
+ (JSC::JSGlobalObject::webAssemblyWrapperFunctionStructure const):
+ (JSC::JSGlobalObject::webAssemblyToJSCalleeStructure const):
+ * wasm/js/JSWebAssembly.cpp:
+ * wasm/js/JSWebAssembly.h:
+
2019-03-15 Dominik Infuehr <[email protected]>
[CMake] Move test .js files into testapiScripts
Modified: trunk/Source/_javascript_Core/DerivedSources-input.xcfilelist (243010 => 243011)
--- trunk/Source/_javascript_Core/DerivedSources-input.xcfilelist 2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/_javascript_Core/DerivedSources-input.xcfilelist 2019-03-15 21:33:09 UTC (rev 243011)
@@ -173,6 +173,7 @@
$(PROJECT_DIR)/wasm/generateWasmB3IRGeneratorInlinesHeader.py
$(PROJECT_DIR)/wasm/generateWasmOpsHeader.py
$(PROJECT_DIR)/wasm/generateWasmValidateInlinesHeader.py
+$(PROJECT_DIR)/wasm/js/JSWebAssembly.cpp
$(PROJECT_DIR)/wasm/js/WebAssemblyCompileErrorConstructor.cpp
$(PROJECT_DIR)/wasm/js/WebAssemblyCompileErrorPrototype.cpp
$(PROJECT_DIR)/wasm/js/WebAssemblyInstanceConstructor.cpp
Modified: trunk/Source/_javascript_Core/DerivedSources-output.xcfilelist (243010 => 243011)
--- trunk/Source/_javascript_Core/DerivedSources-output.xcfilelist 2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/_javascript_Core/DerivedSources-output.xcfilelist 2019-03-15 21:33:09 UTC (rev 243011)
@@ -39,6 +39,7 @@
$(BUILT_PRODUCTS_DIR)/DerivedSources/_javascript_Core/JSONObject.lut.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/_javascript_Core/JSPromiseConstructor.lut.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/_javascript_Core/JSPromisePrototype.lut.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/_javascript_Core/JSWebAssembly.lut.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/_javascript_Core/_javascript_Core_BUILTINS_DEPENDENCIES_LIST
$(BUILT_PRODUCTS_DIR)/DerivedSources/_javascript_Core/KeywordLookup.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/_javascript_Core/Lexer.lut.h
Modified: trunk/Source/_javascript_Core/DerivedSources.make (243010 => 243011)
--- trunk/Source/_javascript_Core/DerivedSources.make 2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/_javascript_Core/DerivedSources.make 2019-03-15 21:33:09 UTC (rev 243011)
@@ -160,6 +160,7 @@
JSONObject.lut.h \
JSPromiseConstructor.lut.h \
JSPromisePrototype.lut.h \
+ JSWebAssembly.lut.h \
MapPrototype.lut.h \
NumberConstructor.lut.h \
NumberPrototype.lut.h \
Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (243010 => 243011)
--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp 2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp 2019-03-15 21:33:09 UTC (rev 243011)
@@ -711,8 +711,6 @@
FOR_EACH_LAZY_BUILTIN_TYPE(CREATE_PROTOTYPE_FOR_LAZY_TYPE)
-#undef CREATE_PROTOTYPE_FOR_LAZY_TYPE
-
// Constructors
ObjectConstructor* objectConstructor = ObjectConstructor::create(vm, this, ObjectConstructor::createStructure(vm, this, m_functionPrototype.get()), m_objectPrototype.get());
@@ -825,7 +823,10 @@
FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE)
#undef PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE
- m_iteratorResultObjectStructure.set(vm, this, createIteratorResultObjectStructure(vm, *this));
+ m_iteratorResultObjectStructure.initLater(
+ [] (const Initializer<Structure>& init) {
+ init.set(createIteratorResultObjectStructure(init.vm, *init.owner));
+ });
m_evalFunction.initLater(
[] (const Initializer<JSFunction>& init) {
@@ -1043,34 +1044,41 @@
#if ENABLE(WEBASSEMBLY)
if (Options::useWebAssembly()) {
auto* webAssemblyPrototype = WebAssemblyPrototype::create(vm, this, WebAssemblyPrototype::createStructure(vm, this, m_objectPrototype.get()));
- m_webAssemblyStructure.set(vm, this, JSWebAssembly::createStructure(vm, this, webAssemblyPrototype));
- m_webAssemblyModuleRecordStructure.set(vm, this, WebAssemblyModuleRecord::createStructure(vm, this, m_objectPrototype.get()));
- m_webAssemblyFunctionStructure.set(vm, this, WebAssemblyFunction::createStructure(vm, this, m_functionPrototype.get()));
- m_webAssemblyWrapperFunctionStructure.set(vm, this, WebAssemblyWrapperFunction::createStructure(vm, this, m_functionPrototype.get()));
- m_webAssemblyToJSCalleeStructure.set(vm, this, WebAssemblyToJSCallee::createStructure(vm, this, jsNull()));
- auto* webAssembly = JSWebAssembly::create(vm, this, m_webAssemblyStructure.get());
+ m_webAssemblyModuleRecordStructure.initLater(
+ [] (const Initializer<Structure>& init) {
+ init.set(WebAssemblyModuleRecord::createStructure(init.vm, init.owner, init.owner->m_objectPrototype.get()));
+ });
+ m_webAssemblyFunctionStructure.initLater(
+ [] (const Initializer<Structure>& init) {
+ init.set(WebAssemblyFunction::createStructure(init.vm, init.owner, init.owner->m_functionPrototype.get()));
+ });
+ m_webAssemblyWrapperFunctionStructure.initLater(
+ [] (const Initializer<Structure>& init) {
+ init.set(WebAssemblyWrapperFunction::createStructure(init.vm, init.owner, init.owner->m_functionPrototype.get()));
+ });
+ m_webAssemblyToJSCalleeStructure.initLater(
+ [] (const Initializer<Structure>& init) {
+ init.set(WebAssemblyToJSCallee::createStructure(init.vm, init.owner, jsNull()));
+ });
+ 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_CONSTRUCTOR(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) do { \
- typedef capitalName ## Prototype Prototype; \
- typedef capitalName ## Constructor Constructor; \
- typedef JS ## capitalName JSObj; \
- auto* base = prototypeBase ## Prototype(); \
- auto* prototype = Prototype::create(vm, this, Prototype::createStructure(vm, this, base)); \
- auto* structure = JSObj::createStructure(vm, this, prototype); \
- auto* constructor = Constructor::create(vm, Constructor::createStructure(vm, this, this->functionPrototype()), prototype); \
- prototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, constructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); \
- m_ ## lowerName ## Prototype.set(vm, this, prototype); \
- m_ ## properName ## Structure.set(vm, this, structure); \
- webAssembly->putDirectWithoutTransition(vm, Identifier::fromString(this->globalExec(), #jsName), constructor, static_cast<unsigned>(PropertyAttribute::DontEnum)); \
- } while (0);
+#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))); \
+ });
- FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(CREATE_WEBASSEMBLY_CONSTRUCTOR)
+ FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(CREATE_WEBASSEMBLY_PROTOTYPE)
#undef CREATE_WEBASSEMBLY_CONSTRUCTOR
}
#endif // ENABLE(WEBASSEMBLY)
+#undef CREATE_PROTOTYPE_FOR_LAZY_TYPE
+
auto setupAdaptiveWatchpoint = [&] (JSObject* base, const Identifier& ident) -> ObjectPropertyCondition {
// Performing these gets should not throw.
ExecState* exec = globalExec();
@@ -1710,7 +1718,7 @@
visitor.append(thisObject->m_generatorFunctionStructure);
visitor.append(thisObject->m_asyncFunctionStructure);
visitor.append(thisObject->m_asyncGeneratorFunctionStructure);
- visitor.append(thisObject->m_iteratorResultObjectStructure);
+ thisObject->m_iteratorResultObjectStructure.visit(visitor);
visitor.append(thisObject->m_regExpMatchesArrayStructure);
visitor.append(thisObject->m_regExpMatchesArrayWithGroupsStructure);
thisObject->m_moduleRecordStructure.visit(visitor);
@@ -1729,27 +1737,25 @@
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)
+
+ FOR_EACH_LAZY_BUILTIN_TYPE(VISIT_LAZY_TYPE)
#if ENABLE(WEBASSEMBLY)
- visitor.append(thisObject->m_webAssemblyStructure);
- visitor.append(thisObject->m_webAssemblyModuleRecordStructure);
- visitor.append(thisObject->m_webAssemblyFunctionStructure);
- visitor.append(thisObject->m_webAssemblyWrapperFunctionStructure);
- visitor.append(thisObject->m_webAssemblyToJSCalleeStructure);
- FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(VISIT_SIMPLE_TYPE)
+ thisObject->m_webAssemblyModuleRecordStructure.visit(visitor);
+ thisObject->m_webAssemblyFunctionStructure.visit(visitor);
+ thisObject->m_webAssemblyWrapperFunctionStructure.visit(visitor);
+ thisObject->m_webAssemblyToJSCalleeStructure.visit(visitor);
+ FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(VISIT_LAZY_TYPE)
#endif // ENABLE(WEBASSEMBLY)
#undef VISIT_SIMPLE_TYPE
-
-#define VISIT_LAZY_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
- thisObject->m_ ## properName ## Structure.visit(visitor);
-
- FOR_EACH_LAZY_BUILTIN_TYPE(VISIT_LAZY_TYPE)
-
#undef VISIT_LAZY_TYPE
for (unsigned i = NumberOfTypedArrayTypes; i--;)
Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.h (243010 => 243011)
--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.h 2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.h 2019-03-15 21:33:09 UTC (rev 243011)
@@ -157,13 +157,13 @@
#if ENABLE(WEBASSEMBLY)
#define FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(macro) \
- macro(WebAssemblyCompileError, webAssemblyCompileError, WebAssemblyCompileError, WebAssemblyCompileError, CompileError, error) \
- macro(WebAssemblyInstance, webAssemblyInstance, WebAssemblyInstance, WebAssemblyInstance, Instance, object) \
- macro(WebAssemblyLinkError, webAssemblyLinkError, WebAssemblyLinkError, WebAssemblyLinkError, LinkError, error) \
- macro(WebAssemblyMemory, webAssemblyMemory, WebAssemblyMemory, WebAssemblyMemory, Memory, object) \
- macro(WebAssemblyModule, webAssemblyModule, WebAssemblyModule, WebAssemblyModule, Module, object) \
- macro(WebAssemblyRuntimeError, webAssemblyRuntimeError, WebAssemblyRuntimeError, WebAssemblyRuntimeError, RuntimeError, error) \
- macro(WebAssemblyTable, webAssemblyTable, WebAssemblyTable, WebAssemblyTable, Table, object)
+ 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)
#else
#define FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(macro)
#endif // ENABLE(WEBASSEMBLY)
@@ -373,7 +373,7 @@
WriteBarrier<Structure> m_asyncFunctionStructure;
WriteBarrier<Structure> m_asyncGeneratorFunctionStructure;
WriteBarrier<Structure> m_generatorFunctionStructure;
- WriteBarrier<Structure> m_iteratorResultObjectStructure;
+ LazyProperty<JSGlobalObject, Structure> m_iteratorResultObjectStructure;
WriteBarrier<Structure> m_regExpMatchesArrayStructure;
WriteBarrier<Structure> m_regExpMatchesArrayWithGroupsStructure;
LazyProperty<JSGlobalObject, Structure> m_moduleRecordStructure;
@@ -390,24 +390,24 @@
WriteBarrier<capitalName ## Prototype> m_ ## lowerName ## Prototype; \
WriteBarrier<Structure> m_ ## properName ## Structure;
+#define DEFINE_STORAGE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
+ 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)
- WriteBarrier<Structure> m_webAssemblyStructure;
- WriteBarrier<Structure> m_webAssemblyModuleRecordStructure;
- WriteBarrier<Structure> m_webAssemblyFunctionStructure;
- WriteBarrier<Structure> m_webAssemblyWrapperFunctionStructure;
- WriteBarrier<Structure> m_webAssemblyToJSCalleeStructure;
- FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(DEFINE_STORAGE_FOR_SIMPLE_TYPE)
+ LazyProperty<JSGlobalObject, Structure> m_webAssemblyModuleRecordStructure;
+ LazyProperty<JSGlobalObject, Structure> m_webAssemblyFunctionStructure;
+ LazyProperty<JSGlobalObject, Structure> m_webAssemblyWrapperFunctionStructure;
+ LazyProperty<JSGlobalObject, Structure> m_webAssemblyToJSCalleeStructure;
+ FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(DEFINE_STORAGE_FOR_LAZY_TYPE)
#endif // ENABLE(WEBASSEMBLY)
+ FOR_EACH_LAZY_BUILTIN_TYPE(DEFINE_STORAGE_FOR_LAZY_TYPE)
+
#undef DEFINE_STORAGE_FOR_SIMPLE_TYPE
-
-#define DEFINE_STORAGE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
- LazyClassStructure m_ ## properName ## Structure;
- FOR_EACH_LAZY_BUILTIN_TYPE(DEFINE_STORAGE_FOR_LAZY_TYPE)
#undef DEFINE_STORAGE_FOR_LAZY_TYPE
WriteBarrier<GetterSetter> m_speciesGetterSetter;
@@ -751,7 +751,7 @@
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(); }
+ Structure* iteratorResultObjectStructure() const { return m_iteratorResultObjectStructure.get(this); }
Structure* regExpMatchesArrayStructure() const { return m_regExpMatchesArrayStructure.get(); }
Structure* regExpMatchesArrayWithGroupsStructure() const { return m_regExpMatchesArrayWithGroupsStructure.get(); }
Structure* moduleRecordStructure() const { return m_moduleRecordStructure.get(this); }
@@ -762,10 +762,10 @@
Structure* restParameterStructure() const { return arrayStructureForIndexingTypeDuringAllocation(ArrayWithContiguous); }
Structure* originalRestParameterStructure() const { return originalArrayStructureForIndexingType(ArrayWithContiguous); }
#if ENABLE(WEBASSEMBLY)
- Structure* webAssemblyModuleRecordStructure() const { return m_webAssemblyModuleRecordStructure.get(); }
- Structure* webAssemblyFunctionStructure() const { return m_webAssemblyFunctionStructure.get(); }
- Structure* webAssemblyWrapperFunctionStructure() const { return m_webAssemblyWrapperFunctionStructure.get(); }
- Structure* webAssemblyToJSCalleeStructure() const { return m_webAssemblyToJSCalleeStructure.get(); }
+ Structure* webAssemblyModuleRecordStructure() const { return m_webAssemblyModuleRecordStructure.get(this); }
+ Structure* webAssemblyFunctionStructure() const { return m_webAssemblyFunctionStructure.get(this); }
+ Structure* webAssemblyWrapperFunctionStructure() const { return m_webAssemblyWrapperFunctionStructure.get(this); }
+ Structure* webAssemblyToJSCalleeStructure() const { return m_webAssemblyToJSCalleeStructure.get(this); }
#endif // ENABLE(WEBASSEMBLY)
#if ENABLE(INTL)
Structure* collatorStructure() { return m_collatorStructure.get(this); }
@@ -841,15 +841,16 @@
FOR_EACH_SIMPLE_BUILTIN_TYPE(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE)
FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE)
- FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(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) \
- Structure* properName ## Structure() { return m_ ## properName ## Structure.get(this); }
+ Structure* properName ## Structure() { return m_ ## properName ## Structure.get(this); } \
+ JSObject* properName ## Constructor() { return m_ ## properName ## Structure.constructor(this); }
FOR_EACH_LAZY_BUILTIN_TYPE(DEFINE_ACCESSORS_FOR_LAZY_TYPE)
+ FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(DEFINE_ACCESSORS_FOR_LAZY_TYPE)
#undef DEFINE_ACCESSORS_FOR_LAZY_TYPE
Modified: trunk/Source/_javascript_Core/wasm/js/JSWebAssembly.cpp (243010 => 243011)
--- trunk/Source/_javascript_Core/wasm/js/JSWebAssembly.cpp 2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/_javascript_Core/wasm/js/JSWebAssembly.cpp 2019-03-15 21:33:09 UTC (rev 243011)
@@ -34,8 +34,38 @@
STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSWebAssembly);
-const ClassInfo JSWebAssembly::s_info = { "WebAssembly", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWebAssembly) };
+#define DEFINE_CALLBACK_FOR_CONSTRUCTOR(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
+static JSValue create##capitalName(VM& vm, JSObject* object) \
+{ \
+ JSWebAssembly* webAssembly = jsCast<JSWebAssembly*>(object); \
+ JSGlobalObject* globalObject = webAssembly->globalObject(vm); \
+ return globalObject->properName##Constructor(); \
+}
+FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(DEFINE_CALLBACK_FOR_CONSTRUCTOR)
+
+#undef DEFINE_CALLBACK_FOR_CONSTRUCTOR
+
+}
+
+#include "JSWebAssembly.lut.h"
+
+namespace JSC {
+
+const ClassInfo JSWebAssembly::s_info = { "WebAssembly", &Base::s_info, &jsWebAssemblyTable, nullptr, CREATE_METHOD_TABLE(JSWebAssembly) };
+
+/* Source for JSWebAssembly.lut.h
+@begin jsWebAssemblyTable
+ CompileError createWebAssemblyCompileError DontEnum|PropertyCallback
+ Instance createWebAssemblyInstance DontEnum|PropertyCallback
+ LinkError createWebAssemblyLinkError DontEnum|PropertyCallback
+ Memory createWebAssemblyMemory DontEnum|PropertyCallback
+ Module createWebAssemblyModule DontEnum|PropertyCallback
+ RuntimeError createWebAssemblyRuntimeError DontEnum|PropertyCallback
+ Table createWebAssemblyTable DontEnum|PropertyCallback
+@end
+*/
+
JSWebAssembly* JSWebAssembly::create(VM& vm, JSGlobalObject*, Structure* structure)
{
auto* object = new (NotNull, allocateCell<JSWebAssembly>(vm.heap)) JSWebAssembly(vm, structure);
Modified: trunk/Source/_javascript_Core/wasm/js/JSWebAssembly.h (243010 => 243011)
--- trunk/Source/_javascript_Core/wasm/js/JSWebAssembly.h 2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/_javascript_Core/wasm/js/JSWebAssembly.h 2019-03-15 21:33:09 UTC (rev 243011)
@@ -58,7 +58,8 @@
class JSWebAssembly final : public JSNonFinalObject {
public:
- typedef JSNonFinalObject Base;
+ using Base = JSNonFinalObject;
+ static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
static JSWebAssembly* create(VM&, JSGlobalObject*, Structure*);
static Structure* createStructure(VM&, JSGlobalObject*, JSValue);