<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[243011] trunk/Source/JavaScriptCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/243011">243011</a></dd>
<dt>Author</dt> <dd>ysuzuki@apple.com</dd>
<dt>Date</dt> <dd>2019-03-15 14:33:09 -0700 (Fri, 15 Mar 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[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:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreDerivedSourcesinputxcfilelist">trunk/Source/JavaScriptCore/DerivedSources-input.xcfilelist</a></li>
<li><a href="#trunkSourceJavaScriptCoreDerivedSourcesoutputxcfilelist">trunk/Source/JavaScriptCore/DerivedSources-output.xcfilelist</a></li>
<li><a href="#trunkSourceJavaScriptCoreDerivedSourcesmake">trunk/Source/JavaScriptCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjecth">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblycpp">trunk/Source/JavaScriptCore/wasm/js/JSWebAssembly.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyh">trunk/Source/JavaScriptCore/wasm/js/JSWebAssembly.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (243010 => 243011)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt       2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt  2019-03-15 21:33:09 UTC (rev 243011)
</span><span class="lines">@@ -98,6 +98,7 @@
</span><span class="cx">     runtime/SymbolConstructor.cpp
</span><span class="cx">     runtime/SymbolPrototype.cpp
</span><span class="cx"> 
</span><ins>+    wasm/js/JSWebAssembly.cpp
</ins><span class="cx">     wasm/js/WebAssemblyCompileErrorConstructor.cpp
</span><span class="cx">     wasm/js/WebAssemblyCompileErrorPrototype.cpp
</span><span class="cx">     wasm/js/WebAssemblyInstanceConstructor.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (243010 => 243011)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/JavaScriptCore/ChangeLog       2019-03-15 21:33:09 UTC (rev 243011)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2019-03-15  Yusuke Suzuki  <ysuzuki@apple.com>
+
+        [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:
+
</ins><span class="cx"> 2019-03-15  Dominik Infuehr  <dinfuehr@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         [CMake] Move test .js files into testapiScripts
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreDerivedSourcesinputxcfilelist"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/DerivedSources-input.xcfilelist (243010 => 243011)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/DerivedSources-input.xcfilelist      2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/JavaScriptCore/DerivedSources-input.xcfilelist 2019-03-15 21:33:09 UTC (rev 243011)
</span><span class="lines">@@ -173,6 +173,7 @@
</span><span class="cx"> $(PROJECT_DIR)/wasm/generateWasmB3IRGeneratorInlinesHeader.py
</span><span class="cx"> $(PROJECT_DIR)/wasm/generateWasmOpsHeader.py
</span><span class="cx"> $(PROJECT_DIR)/wasm/generateWasmValidateInlinesHeader.py
</span><ins>+$(PROJECT_DIR)/wasm/js/JSWebAssembly.cpp
</ins><span class="cx"> $(PROJECT_DIR)/wasm/js/WebAssemblyCompileErrorConstructor.cpp
</span><span class="cx"> $(PROJECT_DIR)/wasm/js/WebAssemblyCompileErrorPrototype.cpp
</span><span class="cx"> $(PROJECT_DIR)/wasm/js/WebAssemblyInstanceConstructor.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreDerivedSourcesoutputxcfilelist"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/DerivedSources-output.xcfilelist (243010 => 243011)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/DerivedSources-output.xcfilelist     2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/JavaScriptCore/DerivedSources-output.xcfilelist        2019-03-15 21:33:09 UTC (rev 243011)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/JSONObject.lut.h
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/JSPromiseConstructor.lut.h
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/JSPromisePrototype.lut.h
</span><ins>+$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/JSWebAssembly.lut.h
</ins><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/JavaScriptCore_BUILTINS_DEPENDENCIES_LIST
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/KeywordLookup.h
</span><span class="cx"> $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/Lexer.lut.h
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/DerivedSources.make (243010 => 243011)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/DerivedSources.make  2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/JavaScriptCore/DerivedSources.make     2019-03-15 21:33:09 UTC (rev 243011)
</span><span class="lines">@@ -160,6 +160,7 @@
</span><span class="cx">     JSONObject.lut.h \
</span><span class="cx">     JSPromiseConstructor.lut.h \
</span><span class="cx">     JSPromisePrototype.lut.h \
</span><ins>+    JSWebAssembly.lut.h \
</ins><span class="cx">     MapPrototype.lut.h \
</span><span class="cx">     NumberConstructor.lut.h \
</span><span class="cx">     NumberPrototype.lut.h \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (243010 => 243011)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp   2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp      2019-03-15 21:33:09 UTC (rev 243011)
</span><span class="lines">@@ -711,8 +711,6 @@
</span><span class="cx">     
</span><span class="cx">     FOR_EACH_LAZY_BUILTIN_TYPE(CREATE_PROTOTYPE_FOR_LAZY_TYPE)
</span><span class="cx">     
</span><del>-#undef CREATE_PROTOTYPE_FOR_LAZY_TYPE
-    
</del><span class="cx">     // Constructors
</span><span class="cx"> 
</span><span class="cx">     ObjectConstructor* objectConstructor = ObjectConstructor::create(vm, this, ObjectConstructor::createStructure(vm, this, m_functionPrototype.get()), m_objectPrototype.get());
</span><span class="lines">@@ -825,7 +823,10 @@
</span><span class="cx">         FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE)
</span><span class="cx"> 
</span><span class="cx"> #undef PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE
</span><del>-    m_iteratorResultObjectStructure.set(vm, this, createIteratorResultObjectStructure(vm, *this));
</del><ins>+    m_iteratorResultObjectStructure.initLater(
+        [] (const Initializer<Structure>& init) {
+            init.set(createIteratorResultObjectStructure(init.vm, *init.owner));
+        });
</ins><span class="cx">     
</span><span class="cx">     m_evalFunction.initLater(
</span><span class="cx">         [] (const Initializer<JSFunction>& init) {
</span><span class="lines">@@ -1043,34 +1044,41 @@
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><span class="cx">     if (Options::useWebAssembly()) {
</span><span class="cx">         auto* webAssemblyPrototype = WebAssemblyPrototype::create(vm, this, WebAssemblyPrototype::createStructure(vm, this, m_objectPrototype.get()));
</span><del>-        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());
</del><ins>+        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));
</ins><span class="cx">         putDirectWithoutTransition(vm, Identifier::fromString(exec, "WebAssembly"), webAssembly, static_cast<unsigned>(PropertyAttribute::DontEnum));
</span><span class="cx"> 
</span><del>-#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);
</del><ins>+#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))); \
+        });
</ins><span class="cx"> 
</span><del>-        FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(CREATE_WEBASSEMBLY_CONSTRUCTOR)
</del><ins>+        FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(CREATE_WEBASSEMBLY_PROTOTYPE)
</ins><span class="cx"> 
</span><span class="cx"> #undef CREATE_WEBASSEMBLY_CONSTRUCTOR
</span><span class="cx">     }
</span><span class="cx"> #endif // ENABLE(WEBASSEMBLY)
</span><span class="cx"> 
</span><ins>+#undef CREATE_PROTOTYPE_FOR_LAZY_TYPE
+
</ins><span class="cx">     auto setupAdaptiveWatchpoint = [&] (JSObject* base, const Identifier& ident) -> ObjectPropertyCondition {
</span><span class="cx">         // Performing these gets should not throw.
</span><span class="cx">         ExecState* exec = globalExec();
</span><span class="lines">@@ -1710,7 +1718,7 @@
</span><span class="cx">     visitor.append(thisObject->m_generatorFunctionStructure);
</span><span class="cx">     visitor.append(thisObject->m_asyncFunctionStructure);
</span><span class="cx">     visitor.append(thisObject->m_asyncGeneratorFunctionStructure);
</span><del>-    visitor.append(thisObject->m_iteratorResultObjectStructure);
</del><ins>+    thisObject->m_iteratorResultObjectStructure.visit(visitor);
</ins><span class="cx">     visitor.append(thisObject->m_regExpMatchesArrayStructure);
</span><span class="cx">     visitor.append(thisObject->m_regExpMatchesArrayWithGroupsStructure);
</span><span class="cx">     thisObject->m_moduleRecordStructure.visit(visitor);
</span><span class="lines">@@ -1729,27 +1737,25 @@
</span><span class="cx">         visitor.append(thisObject->m_ ## properName ## Structure); \
</span><span class="cx">     } while (0);
</span><span class="cx"> 
</span><ins>+#define VISIT_LAZY_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
+    thisObject->m_ ## properName ## Structure.visit(visitor);
+
</ins><span class="cx">     FOR_EACH_SIMPLE_BUILTIN_TYPE(VISIT_SIMPLE_TYPE)
</span><span class="cx">     if (UNLIKELY(Options::useBigInt()))
</span><span class="cx">         FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(VISIT_SIMPLE_TYPE)
</span><span class="cx">     FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(VISIT_SIMPLE_TYPE)
</span><ins>+
+    FOR_EACH_LAZY_BUILTIN_TYPE(VISIT_LAZY_TYPE)
</ins><span class="cx">     
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><del>-    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)
</del><ins>+    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)
</ins><span class="cx"> #endif // ENABLE(WEBASSEMBLY)
</span><span class="cx"> 
</span><span class="cx"> #undef VISIT_SIMPLE_TYPE
</span><del>-
-#define VISIT_LAZY_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
-    thisObject->m_ ## properName ## Structure.visit(visitor);
-    
-    FOR_EACH_LAZY_BUILTIN_TYPE(VISIT_LAZY_TYPE)
-
</del><span class="cx"> #undef VISIT_LAZY_TYPE
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = NumberOfTypedArrayTypes; i--;)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h (243010 => 243011)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h     2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2019-03-15 21:33:09 UTC (rev 243011)
</span><span class="lines">@@ -157,13 +157,13 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><span class="cx"> #define FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(macro) \
</span><del>-    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)
</del><ins>+    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)
</ins><span class="cx"> #else
</span><span class="cx"> #define FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(macro)
</span><span class="cx"> #endif // ENABLE(WEBASSEMBLY)
</span><span class="lines">@@ -373,7 +373,7 @@
</span><span class="cx">     WriteBarrier<Structure> m_asyncFunctionStructure;
</span><span class="cx">     WriteBarrier<Structure> m_asyncGeneratorFunctionStructure;
</span><span class="cx">     WriteBarrier<Structure> m_generatorFunctionStructure;
</span><del>-    WriteBarrier<Structure> m_iteratorResultObjectStructure;
</del><ins>+    LazyProperty<JSGlobalObject, Structure> m_iteratorResultObjectStructure;
</ins><span class="cx">     WriteBarrier<Structure> m_regExpMatchesArrayStructure;
</span><span class="cx">     WriteBarrier<Structure> m_regExpMatchesArrayWithGroupsStructure;
</span><span class="cx">     LazyProperty<JSGlobalObject, Structure> m_moduleRecordStructure;
</span><span class="lines">@@ -390,24 +390,24 @@
</span><span class="cx">     WriteBarrier<capitalName ## Prototype> m_ ## lowerName ## Prototype; \
</span><span class="cx">     WriteBarrier<Structure> m_ ## properName ## Structure;
</span><span class="cx"> 
</span><ins>+#define DEFINE_STORAGE_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
+    LazyClassStructure m_ ## properName ## Structure;
+
</ins><span class="cx">     FOR_EACH_SIMPLE_BUILTIN_TYPE(DEFINE_STORAGE_FOR_SIMPLE_TYPE)
</span><span class="cx">     FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(DEFINE_STORAGE_FOR_SIMPLE_TYPE)
</span><span class="cx">     FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(DEFINE_STORAGE_FOR_SIMPLE_TYPE)
</span><span class="cx">     
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><del>-    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)
</del><ins>+    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)
</ins><span class="cx"> #endif // ENABLE(WEBASSEMBLY)
</span><span class="cx"> 
</span><ins>+    FOR_EACH_LAZY_BUILTIN_TYPE(DEFINE_STORAGE_FOR_LAZY_TYPE)
+
</ins><span class="cx"> #undef DEFINE_STORAGE_FOR_SIMPLE_TYPE
</span><del>-
-#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)
</del><span class="cx"> #undef DEFINE_STORAGE_FOR_LAZY_TYPE
</span><span class="cx"> 
</span><span class="cx">     WriteBarrier<GetterSetter> m_speciesGetterSetter;
</span><span class="lines">@@ -751,7 +751,7 @@
</span><span class="cx">     Structure* asyncGeneratorFunctionStructure() const { return m_asyncGeneratorFunctionStructure.get(); }
</span><span class="cx">     Structure* stringObjectStructure() const { return m_stringObjectStructure.get(); }
</span><span class="cx">     Structure* bigIntObjectStructure() const { return m_bigIntObjectStructure.get(); }
</span><del>-    Structure* iteratorResultObjectStructure() const { return m_iteratorResultObjectStructure.get(); }
</del><ins>+    Structure* iteratorResultObjectStructure() const { return m_iteratorResultObjectStructure.get(this); }
</ins><span class="cx">     Structure* regExpMatchesArrayStructure() const { return m_regExpMatchesArrayStructure.get(); }
</span><span class="cx">     Structure* regExpMatchesArrayWithGroupsStructure() const { return m_regExpMatchesArrayWithGroupsStructure.get(); }
</span><span class="cx">     Structure* moduleRecordStructure() const { return m_moduleRecordStructure.get(this); }
</span><span class="lines">@@ -762,10 +762,10 @@
</span><span class="cx">     Structure* restParameterStructure() const { return arrayStructureForIndexingTypeDuringAllocation(ArrayWithContiguous); }
</span><span class="cx">     Structure* originalRestParameterStructure() const { return originalArrayStructureForIndexingType(ArrayWithContiguous); }
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><del>-    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(); }
</del><ins>+    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); }
</ins><span class="cx"> #endif // ENABLE(WEBASSEMBLY)
</span><span class="cx"> #if ENABLE(INTL)
</span><span class="cx">     Structure* collatorStructure() { return m_collatorStructure.get(this); }
</span><span class="lines">@@ -841,15 +841,16 @@
</span><span class="cx"> 
</span><span class="cx">     FOR_EACH_SIMPLE_BUILTIN_TYPE(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE)
</span><span class="cx">     FOR_BIG_INT_BUILTIN_TYPE_WITH_CONSTRUCTOR(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE)
</span><del>-    FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE)
</del><span class="cx">     FOR_EACH_BUILTIN_DERIVED_ITERATOR_TYPE(DEFINE_ACCESSORS_FOR_SIMPLE_TYPE)
</span><span class="cx"> 
</span><span class="cx"> #undef DEFINE_ACCESSORS_FOR_SIMPLE_TYPE
</span><span class="cx"> 
</span><span class="cx"> #define DEFINE_ACCESSORS_FOR_LAZY_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
</span><del>-    Structure* properName ## Structure() { return m_ ## properName ## Structure.get(this); }
</del><ins>+    Structure* properName ## Structure() { return m_ ## properName ## Structure.get(this); } \
+    JSObject* properName ## Constructor() { return m_ ## properName ## Structure.constructor(this); }
</ins><span class="cx"> 
</span><span class="cx">     FOR_EACH_LAZY_BUILTIN_TYPE(DEFINE_ACCESSORS_FOR_LAZY_TYPE)
</span><ins>+    FOR_EACH_WEBASSEMBLY_CONSTRUCTOR_TYPE(DEFINE_ACCESSORS_FOR_LAZY_TYPE)
</ins><span class="cx"> 
</span><span class="cx"> #undef DEFINE_ACCESSORS_FOR_LAZY_TYPE
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssembly.cpp (243010 => 243011)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssembly.cpp    2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssembly.cpp       2019-03-15 21:33:09 UTC (rev 243011)
</span><span class="lines">@@ -34,8 +34,38 @@
</span><span class="cx"> 
</span><span class="cx"> STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSWebAssembly);
</span><span class="cx"> 
</span><del>-const ClassInfo JSWebAssembly::s_info = { "WebAssembly", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWebAssembly) };
</del><ins>+#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(); \
+}
</ins><span class="cx"> 
</span><ins>+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
+*/
+
</ins><span class="cx"> JSWebAssembly* JSWebAssembly::create(VM& vm, JSGlobalObject*, Structure* structure)
</span><span class="cx"> {
</span><span class="cx">     auto* object = new (NotNull, allocateCell<JSWebAssembly>(vm.heap)) JSWebAssembly(vm, structure);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssembly.h (243010 => 243011)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssembly.h      2019-03-15 21:30:12 UTC (rev 243010)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssembly.h 2019-03-15 21:33:09 UTC (rev 243011)
</span><span class="lines">@@ -58,7 +58,8 @@
</span><span class="cx"> 
</span><span class="cx"> class JSWebAssembly final : public JSNonFinalObject {
</span><span class="cx"> public:
</span><del>-    typedef JSNonFinalObject Base;
</del><ins>+    using Base = JSNonFinalObject;
+    static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable;
</ins><span class="cx"> 
</span><span class="cx">     static JSWebAssembly* create(VM&, JSGlobalObject*, Structure*);
</span><span class="cx">     static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
</span></span></pre>
</div>
</div>

</body>
</html>