<!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>[287582] 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/287582">287582</a></dd>
<dt>Author</dt> <dd>ysuzuki@apple.com</dd>
<dt>Date</dt> <dd>2022-01-04 13:25:43 -0800 (Tue, 04 Jan 2022)</dd>
</dl>

<h3>Log Message</h3>
<pre>[JSC] Remove JSWebAssemblyCalleeGroup cell
https://bugs.webkit.org/show_bug.cgi?id=234780

Reviewed by Saam Barati.

This cell is not observable to users. And this cell just holds Wasm-to-JS stubs,
but it is the same to all memory modes. Thus, we should just generate it in VM-linked
Wasm::Module (it means, we should have it in JSWebAssemblyModule), and we do not need
to have / allocate JSWebAssemblyCalleeGroup cell.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::finalizeUnconditionalFinalizers):
(JSC::Heap::deleteAllCodeBlocks):
* heap/Heap.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* wasm/WasmBinding.h:
* wasm/js/JSWebAssemblyCalleeGroup.cpp: Removed.
* wasm/js/JSWebAssemblyCalleeGroup.h: Removed.
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::visitChildrenImpl):
(JSC::JSWebAssemblyInstance::finalizeCreation):
* wasm/js/JSWebAssemblyInstance.h:
* wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::createStub):
(JSC::JSWebAssemblyModule::visitChildrenImpl):
(JSC::JSWebAssemblyModule::clearJSCallICs):
(JSC::JSWebAssemblyModule::finalizeUnconditionally):
(JSC::JSWebAssemblyModule::generateWasmToJSStubs):
(JSC::JSWebAssemblyModule::calleeGroup): Deleted.
(JSC::JSWebAssemblyModule::setCalleeGroup): Deleted.
* wasm/js/JSWebAssemblyModule.h:
* wasm/js/WebAssemblyModuleConstructor.cpp:
* wasm/js/WebAssemblyWrapperFunction.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreSourcestxt">trunk/Source/JavaScriptCore/Sources.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeapcpp">trunk/Source/JavaScriptCore/heap/Heap.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeaph">trunk/Source/JavaScriptCore/heap/Heap.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMcpp">trunk/Source/JavaScriptCore/runtime/VM.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMh">trunk/Source/JavaScriptCore/runtime/VM.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmBindingh">trunk/Source/JavaScriptCore/wasm/WasmBinding.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyInstancecpp">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyInstanceh">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyModulecpp">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyModuleh">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyModuleConstructorcpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyWrapperFunctionh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyWrapperFunction.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyCalleeGroupcpp">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCalleeGroup.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyCalleeGrouph">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCalleeGroup.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/ChangeLog       2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -1,5 +1,46 @@
</span><span class="cx"> 2022-01-04  Yusuke Suzuki  <ysuzuki@apple.com>
</span><span class="cx"> 
</span><ins>+        [JSC] Remove JSWebAssemblyCalleeGroup cell
+        https://bugs.webkit.org/show_bug.cgi?id=234780
+
+        Reviewed by Saam Barati.
+
+        This cell is not observable to users. And this cell just holds Wasm-to-JS stubs,
+        but it is the same to all memory modes. Thus, we should just generate it in VM-linked
+        Wasm::Module (it means, we should have it in JSWebAssemblyModule), and we do not need
+        to have / allocate JSWebAssemblyCalleeGroup cell.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * Sources.txt:
+        * heap/Heap.cpp:
+        (JSC::Heap::Heap):
+        (JSC::Heap::finalizeUnconditionalFinalizers):
+        (JSC::Heap::deleteAllCodeBlocks):
+        * heap/Heap.h:
+        * runtime/VM.cpp:
+        (JSC::VM::VM):
+        * runtime/VM.h:
+        * wasm/WasmBinding.h:
+        * wasm/js/JSWebAssemblyCalleeGroup.cpp: Removed.
+        * wasm/js/JSWebAssemblyCalleeGroup.h: Removed.
+        * wasm/js/JSWebAssemblyInstance.cpp:
+        (JSC::JSWebAssemblyInstance::visitChildrenImpl):
+        (JSC::JSWebAssemblyInstance::finalizeCreation):
+        * wasm/js/JSWebAssemblyInstance.h:
+        * wasm/js/JSWebAssemblyModule.cpp:
+        (JSC::JSWebAssemblyModule::createStub):
+        (JSC::JSWebAssemblyModule::visitChildrenImpl):
+        (JSC::JSWebAssemblyModule::clearJSCallICs):
+        (JSC::JSWebAssemblyModule::finalizeUnconditionally):
+        (JSC::JSWebAssemblyModule::generateWasmToJSStubs):
+        (JSC::JSWebAssemblyModule::calleeGroup): Deleted.
+        (JSC::JSWebAssemblyModule::setCalleeGroup): Deleted.
+        * wasm/js/JSWebAssemblyModule.h:
+        * wasm/js/WebAssemblyModuleConstructor.cpp:
+        * wasm/js/WebAssemblyWrapperFunction.h:
+
+2022-01-04  Yusuke Suzuki  <ysuzuki@apple.com>
+
</ins><span class="cx">         WebAssembly i32.atomic.wait timeout value incorrectly interpreted by factor 1000
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=234833
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj     2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -1654,7 +1654,6 @@
</span><span class="cx">          AD7B4B2E1FA3E29800C9DF79 /* WasmNameSection.h in Headers */ = {isa = PBXBuildFile; fileRef = AD7B4B2D1FA3E28600C9DF79 /* WasmNameSection.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          AD86A93E1AA4D88D002FE77F /* WeakGCMapInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = AD86A93D1AA4D87C002FE77F /* WeakGCMapInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          AD8FF3981EB5BDB20087FF82 /* WasmIndexOrName.h in Headers */ = {isa = PBXBuildFile; fileRef = AD8FF3951EB5BD850087FF82 /* WasmIndexOrName.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-               AD9E852F1E8A0C7C008DE39E /* JSWebAssemblyCalleeGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = AD9E852E1E8A0C6E008DE39E /* JSWebAssemblyCalleeGroup.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">           ADD8FA461EB3079700DF542F /* WasmNameSectionParser.h in Headers */ = {isa = PBXBuildFile; fileRef = ADD8FA431EB3077100DF542F /* WasmNameSectionParser.h */; };
</span><span class="cx">          ADE802991E08F1DE0058DE78 /* JSWebAssemblyLinkError.h in Headers */ = {isa = PBXBuildFile; fileRef = ADE802941E08F1C90058DE78 /* JSWebAssemblyLinkError.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          ADE8029A1E08F1DE0058DE78 /* WebAssemblyLinkErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = ADE802951E08F1C90058DE78 /* WebAssemblyLinkErrorConstructor.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -3970,7 +3969,6 @@
</span><span class="cx">          5373B4D422ADB31400803572 /* WeakObjectRefConstructor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WeakObjectRefConstructor.cpp; sourceTree = "<group>"; };
</span><span class="cx">          5381B9361E60E9660090F794 /* WasmFaultSignalHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmFaultSignalHandler.cpp; sourceTree = "<group>"; };
</span><span class="cx">          5381B9381E60E97D0090F794 /* WasmFaultSignalHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmFaultSignalHandler.h; sourceTree = "<group>"; };
</span><del>-               5383AA2F1E65E8A100A532FC /* JSWebAssemblyCalleeGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebAssemblyCalleeGroup.cpp; path = js/JSWebAssemblyCalleeGroup.cpp; sourceTree = "<group>"; };
</del><span class="cx">           538F15DD268FBBB300D601C4 /* UnifiedSource148.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnifiedSource148.cpp; path = "DerivedSources/JavaScriptCore/unified-sources/UnifiedSource148.cpp"; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">          538F15DE268FBBB300D601C4 /* UnifiedSource151.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnifiedSource151.cpp; path = "DerivedSources/JavaScriptCore/unified-sources/UnifiedSource151.cpp"; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">          538F15DF268FBBB300D601C4 /* UnifiedSource152.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnifiedSource152.cpp; path = "DerivedSources/JavaScriptCore/unified-sources/UnifiedSource152.cpp"; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="lines">@@ -4960,7 +4958,6 @@
</span><span class="cx">          AD8DD6D01F6708A30004EB52 /* JSToWasm.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = JSToWasm.cpp; path = js/JSToWasm.cpp; sourceTree = "<group>"; };
</span><span class="cx">          AD8FF3951EB5BD850087FF82 /* WasmIndexOrName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmIndexOrName.h; sourceTree = "<group>"; };
</span><span class="cx">          AD8FF3961EB5BD850087FF82 /* WasmIndexOrName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmIndexOrName.cpp; sourceTree = "<group>"; };
</span><del>-               AD9E852E1E8A0C6E008DE39E /* JSWebAssemblyCalleeGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWebAssemblyCalleeGroup.h; path = js/JSWebAssemblyCalleeGroup.h; sourceTree = "<group>"; };
</del><span class="cx">           ADB6F67C1E15D7500082F384 /* WasmPageCount.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmPageCount.cpp; sourceTree = "<group>"; };
</span><span class="cx">          ADD09AEE1F5F623F001313C2 /* WasmToJS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WasmToJS.h; path = js/WasmToJS.h; sourceTree = "<group>"; };
</span><span class="cx">          ADD09AEF1F5F623F001313C2 /* WasmToJS.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = WasmToJS.cpp; path = js/WasmToJS.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -9266,8 +9263,6 @@
</span><span class="cx">                          527CE35322555FDD00C6F382 /* JSToWasmICCallee.h */,
</span><span class="cx">                          ADD09AF21F624829001313C2 /* JSWebAssembly.cpp */,
</span><span class="cx">                          ADD09AF31F62482E001313C2 /* JSWebAssembly.h */,
</span><del>-                               5383AA2F1E65E8A100A532FC /* JSWebAssemblyCalleeGroup.cpp */,
-                               AD9E852E1E8A0C6E008DE39E /* JSWebAssemblyCalleeGroup.h */,
</del><span class="cx">                           AD2FCBA61DB58DA400B3E736 /* JSWebAssemblyCompileError.cpp */,
</span><span class="cx">                          AD2FCBA71DB58DA400B3E736 /* JSWebAssemblyCompileError.h */,
</span><span class="cx">                          14D01BDC26DEEF3700CAE0D0 /* JSWebAssemblyException.cpp */,
</span><span class="lines">@@ -10670,7 +10665,6 @@
</span><span class="cx">                          709FB8681AE335C60039D069 /* JSWeakSet.h in Headers */,
</span><span class="cx">                          7A9774A8206B82E4008D03D0 /* JSWeakValue.h in Headers */,
</span><span class="cx">                          AD5C36EB1F75AD73000BCAAF /* JSWebAssembly.h in Headers */,
</span><del>-                               AD9E852F1E8A0C7C008DE39E /* JSWebAssemblyCalleeGroup.h in Headers */,
</del><span class="cx">                           AD2FCBE31DB58DAD00B3E736 /* JSWebAssemblyCompileError.h in Headers */,
</span><span class="cx">                          14D01BED26DEEF3800CAE0D0 /* JSWebAssemblyException.h in Headers */,
</span><span class="cx">                          E3BF3C4D2390D1E8008BC752 /* JSWebAssemblyGlobal.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/Sources.txt (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/Sources.txt  2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/Sources.txt     2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -1113,7 +1113,6 @@
</span><span class="cx"> wasm/js/JSToWasm.h
</span><span class="cx"> wasm/js/JSToWasmICCallee.cpp
</span><span class="cx"> wasm/js/JSWebAssembly.cpp
</span><del>-wasm/js/JSWebAssemblyCalleeGroup.cpp
</del><span class="cx"> wasm/js/JSWebAssemblyCompileError.cpp
</span><span class="cx"> wasm/js/JSWebAssemblyException.cpp
</span><span class="cx"> wasm/js/JSWebAssemblyGlobal.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.cpp (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.cpp        2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/heap/Heap.cpp   2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -55,7 +55,6 @@
</span><span class="cx"> #include "JSWeakMap.h"
</span><span class="cx"> #include "JSWeakObjectRef.h"
</span><span class="cx"> #include "JSWeakSet.h"
</span><del>-#include "JSWebAssemblyCalleeGroup.h"
</del><span class="cx"> #include "MachineStackMarker.h"
</span><span class="cx"> #include "MarkStackMergingConstraint.h"
</span><span class="cx"> #include "MarkedJSValueRefArray.h"
</span><span class="lines">@@ -335,7 +334,6 @@
</span><span class="cx">     , intlSegmenterHeapCellType(IsoHeapCellType::Args<IntlSegmenter>())
</span><span class="cx">     , intlSegmentsHeapCellType(IsoHeapCellType::Args<IntlSegments>())
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><del>-    , webAssemblyCalleeGroupHeapCellType(IsoHeapCellType::Args<JSWebAssemblyCalleeGroup>())
</del><span class="cx">     , webAssemblyExceptionHeapCellType(IsoHeapCellType::Args<JSWebAssemblyException>())
</span><span class="cx">     , webAssemblyFunctionHeapCellType(IsoHeapCellType::Args<WebAssemblyFunction>())
</span><span class="cx">     , webAssemblyGlobalHeapCellType(IsoHeapCellType::Args<JSWebAssemblyGlobal>())
</span><span class="lines">@@ -714,8 +712,8 @@
</span><span class="cx">         finalizeMarkedUnconditionalFinalizers<JSFinalizationRegistry>(*m_finalizationRegistrySpace);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><del>-    if (m_webAssemblyCalleeGroupSpace)
-        finalizeMarkedUnconditionalFinalizers<JSWebAssemblyCalleeGroup>(*m_webAssemblyCalleeGroupSpace);
</del><ins>+    if (m_webAssemblyModuleSpace)
+        finalizeMarkedUnconditionalFinalizers<JSWebAssemblyModule>(*m_webAssemblyModuleSpace);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1036,10 +1034,10 @@
</span><span class="cx">         // points into a CodeBlock that could be dead. The IC will still succeed because
</span><span class="cx">         // it uses a callee check, but then it will call into dead code.
</span><span class="cx">         HeapIterationScope heapIterationScope(*this);
</span><del>-        if (m_webAssemblyCalleeGroupSpace) {
-            m_webAssemblyCalleeGroupSpace->forEachLiveCell([&] (HeapCell* cell, HeapCell::Kind kind) {
</del><ins>+        if (m_webAssemblyModuleSpace) {
+            m_webAssemblyModuleSpace->forEachLiveCell([&] (HeapCell* cell, HeapCell::Kind kind) {
</ins><span class="cx">                 ASSERT_UNUSED(kind, kind == HeapCell::JSCell);
</span><del>-                static_cast<JSWebAssemblyCalleeGroup*>(cell)->clearJSCallICs(vm);
</del><ins>+                static_cast<JSWebAssemblyModule*>(cell)->clearJSCallICs(vm);
</ins><span class="cx">             });
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -3274,7 +3272,6 @@
</span><span class="cx"> DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(intlSegmentsSpace, intlSegmentsHeapCellType, IntlSegments)
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><span class="cx"> DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(jsToWasmICCalleeSpace, cellHeapCellType, JSToWasmICCallee)
</span><del>-DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(webAssemblyCalleeGroupSpace, webAssemblyCalleeGroupHeapCellType, JSWebAssemblyCalleeGroup) // Hash:0x9ad995cd
</del><span class="cx"> DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(webAssemblyExceptionSpace, webAssemblyExceptionHeapCellType, JSWebAssemblyException)
</span><span class="cx"> DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(webAssemblyFunctionSpace, webAssemblyFunctionHeapCellType, WebAssemblyFunction) // Hash:0x8b7c32db
</span><span class="cx"> DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(webAssemblyGlobalSpace, webAssemblyGlobalHeapCellType, JSWebAssemblyGlobal)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.h (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.h  2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/heap/Heap.h     2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -785,7 +785,6 @@
</span><span class="cx">     IsoHeapCellType intlSegmenterHeapCellType;
</span><span class="cx">     IsoHeapCellType intlSegmentsHeapCellType;
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><del>-    IsoHeapCellType webAssemblyCalleeGroupHeapCellType;
</del><span class="cx">     IsoHeapCellType webAssemblyExceptionHeapCellType;
</span><span class="cx">     IsoHeapCellType webAssemblyFunctionHeapCellType;
</span><span class="cx">     IsoHeapCellType webAssemblyGlobalHeapCellType;
</span><span class="lines">@@ -967,7 +966,6 @@
</span><span class="cx">     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(intlSegmentsSpace)
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><span class="cx">     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(jsToWasmICCalleeSpace)
</span><del>-    DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(webAssemblyCalleeGroupSpace)
</del><span class="cx">     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(webAssemblyExceptionSpace)
</span><span class="cx">     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(webAssemblyFunctionSpace)
</span><span class="cx">     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(webAssemblyGlobalSpace)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.cpp (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.cpp       2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/runtime/VM.cpp  2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -77,7 +77,6 @@
</span><span class="cx"> #include "JSSet.h"
</span><span class="cx"> #include "JSSourceCode.h"
</span><span class="cx"> #include "JSTemplateObjectDescriptor.h"
</span><del>-#include "JSWebAssemblyCalleeGroup.h"
</del><span class="cx"> #include "LLIntData.h"
</span><span class="cx"> #include "LLIntExceptions.h"
</span><span class="cx"> #include "MarkedBlockInlines.h"
</span><span class="lines">@@ -270,9 +269,6 @@
</span><span class="cx">     evalExecutableStructure.set(*this, EvalExecutable::createStructure(*this, nullptr, jsNull()));
</span><span class="cx">     programExecutableStructure.set(*this, ProgramExecutable::createStructure(*this, nullptr, jsNull()));
</span><span class="cx">     functionExecutableStructure.set(*this, FunctionExecutable::createStructure(*this, nullptr, jsNull()));
</span><del>-#if ENABLE(WEBASSEMBLY)
-    webAssemblyCalleeGroupStructure.set(*this, JSWebAssemblyCalleeGroup::createStructure(*this, nullptr, jsNull()));
-#endif
</del><span class="cx">     moduleProgramExecutableStructure.set(*this, ModuleProgramExecutable::createStructure(*this, nullptr, jsNull()));
</span><span class="cx">     regExpStructure.set(*this, RegExp::createStructure(*this, nullptr, jsNull()));
</span><span class="cx">     symbolStructure.set(*this, Symbol::createStructure(*this, nullptr, jsNull()));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.h (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.h 2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/runtime/VM.h    2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -476,7 +476,6 @@
</span><span class="cx">     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(intlSegmentsSpace)
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><span class="cx">     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(jsToWasmICCalleeSpace)
</span><del>-    DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(webAssemblyCalleeGroupSpace)
</del><span class="cx">     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(webAssemblyExceptionSpace)
</span><span class="cx">     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(webAssemblyFunctionSpace)
</span><span class="cx">     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(webAssemblyGlobalSpace)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmBinding.h (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmBinding.h   2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/wasm/WasmBinding.h      2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><span class="cx"> 
</span><span class="cx"> #include "JITCompilation.h"
</span><ins>+#include "WasmBinding.h"
</ins><span class="cx"> #include "WasmFormat.h"
</span><span class="cx"> #include <wtf/Expected.h>
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyCalleeGroupcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCalleeGroup.cpp (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCalleeGroup.cpp 2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCalleeGroup.cpp    2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -1,104 +0,0 @@
</span><del>-/*
- * Copyright (C) 2017-2021 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSWebAssemblyCalleeGroup.h"
-
-#if ENABLE(WEBASSEMBLY)
-
-#include "JSCJSValueInlines.h"
-#include "JSCellInlines.h"
-#include "WasmModuleInformation.h"
-#include "WasmToJS.h"
-
-namespace JSC {
-
-const ClassInfo JSWebAssemblyCalleeGroup::s_info = { "WebAssemblyCalleeGroup", nullptr, nullptr, nullptr, CREATE_METHOD_TABLE(JSWebAssemblyCalleeGroup) };
-
-JSWebAssemblyCalleeGroup* JSWebAssemblyCalleeGroup::create(VM& vm, Ref<Wasm::CalleeGroup> calleeGroup, const Wasm::ModuleInformation& moduleInformation)
-{
-    auto* result = new (NotNull, allocateCell<JSWebAssemblyCalleeGroup>(vm)) JSWebAssemblyCalleeGroup(vm, WTFMove(calleeGroup), moduleInformation);
-    result->finishCreation(vm);
-    return result;
-}
-
-JSWebAssemblyCalleeGroup::JSWebAssemblyCalleeGroup(VM& vm, Ref<Wasm::CalleeGroup>&& calleeGroup, const Wasm::ModuleInformation& moduleInformation)
-    : Base(vm, vm.webAssemblyCalleeGroupStructure.get())
-    , m_calleeGroup(WTFMove(calleeGroup))
-    , m_wasmToJSExitStubs(m_calleeGroup->functionImportCount())
-{
-    // FIXME: We should not need to do this synchronously.
-    // https://bugs.webkit.org/show_bug.cgi?id=170567
-    for (unsigned importIndex = 0; importIndex < m_calleeGroup->functionImportCount(); ++importIndex) {
-        Wasm::SignatureIndex signatureIndex = moduleInformation.importFunctionSignatureIndices.at(importIndex);
-        auto binding = Wasm::wasmToJS(vm, m_callLinkInfos, signatureIndex, importIndex);
-        if (UNLIKELY(!binding)) {
-            switch (binding.error()) {
-            case Wasm::BindingFailure::OutOfMemory:
-                m_errorMessage = "Out of executable memory"_s;
-                return;
-            }
-            RELEASE_ASSERT_NOT_REACHED();
-        }
-        m_wasmToJSExitStubs[importIndex] = binding.value();
-    }
-}
-
-void JSWebAssemblyCalleeGroup::finishCreation(VM& vm)
-{
-    Base::finishCreation(vm);
-}
-
-void JSWebAssemblyCalleeGroup::destroy(JSCell* cell)
-{
-    static_cast<JSWebAssemblyCalleeGroup*>(cell)->JSWebAssemblyCalleeGroup::~JSWebAssemblyCalleeGroup();
-}
-
-void JSWebAssemblyCalleeGroup::clearJSCallICs(VM& vm)
-{
-    for (auto iter = m_callLinkInfos.begin(); !!iter; ++iter)
-        (*iter)->unlink(vm);
-}
-
-template<typename Visitor>
-void JSWebAssemblyCalleeGroup::visitChildrenImpl(JSCell* cell, Visitor& visitor)
-{
-    JSWebAssemblyCalleeGroup* thisObject = jsCast<JSWebAssemblyCalleeGroup*>(cell);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-
-    Base::visitChildren(thisObject, visitor);
-}
-
-DEFINE_VISIT_CHILDREN(JSWebAssemblyCalleeGroup);
-
-void JSWebAssemblyCalleeGroup::finalizeUnconditionally(VM& vm)
-{
-    for (auto iter = m_callLinkInfos.begin(); !!iter; ++iter)
-        (*iter)->visitWeak(vm);
-}
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyCalleeGrouph"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCalleeGroup.h (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCalleeGroup.h   2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyCalleeGroup.h      2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -1,99 +0,0 @@
</span><del>-/*
- * Copyright (C) 2017-2021 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(WEBASSEMBLY)
-
-#include "CallLinkInfo.h"
-#include "DeferredWorkTimer.h"
-#include "JSCast.h"
-#include "Structure.h"
-#include "WasmCallee.h"
-#include "WasmFormat.h"
-#include "WasmModule.h"
-#include <wtf/Bag.h>
-#include <wtf/Ref.h>
-#include <wtf/Vector.h>
-
-namespace JSC {
-
-class JSWebAssemblyMemory;
-
-namespace Wasm {
-class Plan;
-}
-
-class JSWebAssemblyCalleeGroup final : public JSCell {
-public:
-    typedef JSCell Base;
-    static constexpr unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
-
-    static JSWebAssemblyCalleeGroup* create(VM&, Ref<Wasm::CalleeGroup>, const Wasm::ModuleInformation&);
-    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
-    {
-        return Structure::create(vm, globalObject, prototype, TypeInfo(CellType, StructureFlags), info());
-    }
-
-    template<typename CellType, SubspaceAccess mode>
-    static IsoSubspace* subspaceFor(VM& vm)
-    {
-        return vm.webAssemblyCalleeGroupSpace<mode>();
-    }
-
-    Wasm::CalleeGroup& calleeGroup() { return m_calleeGroup.get(); }
-    
-    MacroAssemblerCodePtr<WasmEntryPtrTag> wasmToEmbedderStub(size_t importFunctionNum) { return m_wasmToJSExitStubs[importFunctionNum].code(); }
-
-    void finishCreation(VM&);
-
-    void clearJSCallICs(VM&);
-
-    bool runnable() const { return !m_errorMessage; }
-
-    String errorMessage()
-    {
-        ASSERT(!runnable());
-        return m_errorMessage;
-    }
-
-    void finalizeUnconditionally(VM&);
-
-private:
-    JSWebAssemblyCalleeGroup(VM&, Ref<Wasm::CalleeGroup>&&, const Wasm::ModuleInformation&);
-    DECLARE_EXPORT_INFO;
-    static constexpr bool needsDestruction = true;
-    static void destroy(JSCell*);
-    DECLARE_VISIT_CHILDREN;
-
-    Ref<Wasm::CalleeGroup> m_calleeGroup;
-    FixedVector<MacroAssemblerCodeRef<WasmEntryPtrTag>> m_wasmToJSExitStubs;
-    Bag<OptimizingCallLinkInfo> m_callLinkInfos;
-    String m_errorMessage;
-};
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyInstancecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp    2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp       2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -81,7 +81,6 @@
</span><span class="cx"> 
</span><span class="cx">     Base::visitChildren(thisObject, visitor);
</span><span class="cx">     visitor.append(thisObject->m_module);
</span><del>-    visitor.append(thisObject->m_calleeGroup);
</del><span class="cx">     visitor.append(thisObject->m_moduleRecord);
</span><span class="cx">     visitor.append(thisObject->m_memory);
</span><span class="cx">     for (auto& table : thisObject->m_tables)
</span><span class="lines">@@ -117,23 +116,6 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     RELEASE_ASSERT(wasmCalleeGroup->isSafeToRun(memoryMode()));
</span><del>-    JSWebAssemblyCalleeGroup* jsCalleeGroup = m_module->calleeGroup(memoryMode());
-    if (jsCalleeGroup) {
-        // A CalleeGroup might have already been compiled. If so, it means
-        // that the CalleeGroup we are trying to compile must be the same
-        // because we will never compile a CalleeGroup again once it's
-        // runnable.
-        ASSERT(&jsCalleeGroup->calleeGroup() == wasmCalleeGroup.ptr());
-        m_calleeGroup.set(vm, this, jsCalleeGroup);
-    } else {
-        jsCalleeGroup = JSWebAssemblyCalleeGroup::create(vm, WTFMove(wasmCalleeGroup), module()->module().moduleInformation());
-        if (UNLIKELY(!jsCalleeGroup->runnable())) {
-            throwException(globalObject, scope, createJSWebAssemblyLinkError(globalObject, vm, jsCalleeGroup->errorMessage()));
-            return;
-        }
-        m_calleeGroup.set(vm, this, jsCalleeGroup);
-        m_module->setCalleeGroup(vm, memoryMode(), jsCalleeGroup);
-    }
</del><span class="cx"> 
</span><span class="cx">     // In the module loader case, we will initialize all memory modes with the initial LLInt compilation
</span><span class="cx">     // results, so that later when memory imports become available, the appropriate CalleeGroup can be used.
</span><span class="lines">@@ -148,19 +130,13 @@
</span><span class="cx">             if (i == static_cast<uint8_t>(initialMode))
</span><span class="cx">                 continue;
</span><span class="cx">             Wasm::MemoryMode memoryMode = static_cast<Wasm::MemoryMode>(i);
</span><del>-            RefPtr<Wasm::CalleeGroup> calleeGroup = module()->module().calleeGroupFor(memoryMode);
-            jsCalleeGroup = JSWebAssemblyCalleeGroup::create(vm, calleeGroup.releaseNonNull(), module()->module().moduleInformation());
-            if (UNLIKELY(!jsCalleeGroup->runnable())) {
-                throwException(globalObject, scope, createJSWebAssemblyLinkError(globalObject, vm, jsCalleeGroup->errorMessage()));
-                return;
-            }
-            m_module->setCalleeGroup(vm, memoryMode, jsCalleeGroup);
</del><ins>+            module()->module().calleeGroupFor(memoryMode); // Materialize Wasm::CalleeGroup.
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (unsigned importFunctionNum = 0; importFunctionNum < instance().numImportFunctions(); ++importFunctionNum) {
</span><span class="cx">         auto* info = instance().importFunctionInfo(importFunctionNum);
</span><del>-        info->wasmToEmbedderStub = m_calleeGroup->wasmToEmbedderStub(importFunctionNum);
</del><ins>+        info->wasmToEmbedderStub = m_module->wasmToEmbedderStub(importFunctionNum);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_moduleRecord->prepareLink(vm, this);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyInstanceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h      2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h 2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><span class="cx"> 
</span><span class="cx"> #include "JSDestructibleObject.h"
</span><del>-#include "JSWebAssemblyCalleeGroup.h"
</del><span class="cx"> #include "JSWebAssemblyGlobal.h"
</span><span class="cx"> #include "JSWebAssemblyMemory.h"
</span><span class="cx"> #include "JSWebAssemblyTable.h"
</span><span class="lines">@@ -114,7 +113,6 @@
</span><span class="cx"> 
</span><span class="cx">     WriteBarrier<JSGlobalObject> m_globalObject;
</span><span class="cx">     WriteBarrier<JSWebAssemblyModule> m_module;
</span><del>-    WriteBarrier<JSWebAssemblyCalleeGroup> m_calleeGroup;
</del><span class="cx">     WriteBarrier<WebAssemblyModuleRecord> m_moduleRecord;
</span><span class="cx">     WriteBarrier<JSWebAssemblyMemory> m_memory;
</span><span class="cx">     FixedVector<WriteBarrier<JSWebAssemblyTable>> m_tables;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyModulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp      2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp 2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -29,11 +29,11 @@
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><span class="cx"> 
</span><span class="cx"> #include "JSCInlines.h"
</span><del>-#include "JSWebAssemblyCalleeGroup.h"
</del><span class="cx"> #include "JSWebAssemblyCompileError.h"
</span><span class="cx"> #include "WasmFormat.h"
</span><span class="cx"> #include "WasmModule.h"
</span><span class="cx"> #include "WasmModuleInformation.h"
</span><ins>+#include "WasmToJS.h"
</ins><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -52,6 +52,16 @@
</span><span class="cx"> 
</span><span class="cx">     auto* module = new (NotNull, allocateCell<JSWebAssemblyModule>(vm)) JSWebAssemblyModule(vm, structure, result.value().releaseNonNull());
</span><span class="cx">     module->finishCreation(vm);
</span><ins>+
+    auto error = module->generateWasmToJSStubs(vm);
+    if (UNLIKELY(!error)) {
+        switch (error.error()) {
+        case Wasm::BindingFailure::OutOfMemory:
+            throwException(globalObject, scope, createJSWebAssemblyLinkError(globalObject, vm, "Out of executable memory"_s));
+            return nullptr;
+        }
+        ASSERT_NOT_REACHED();
+    }
</ins><span class="cx">     return module;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -109,21 +119,11 @@
</span><span class="cx">     return m_module->signatureIndexFromFunctionIndexSpace(functionIndexSpace);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSWebAssemblyCalleeGroup* JSWebAssemblyModule::calleeGroup(Wasm::MemoryMode mode)
-{
-    return m_calleeGroups[static_cast<size_t>(mode)].get();
-}
-
</del><span class="cx"> Wasm::Module& JSWebAssemblyModule::module()
</span><span class="cx"> {
</span><span class="cx">     return m_module.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void JSWebAssemblyModule::setCalleeGroup(VM& vm, Wasm::MemoryMode mode, JSWebAssemblyCalleeGroup* calleeGroup)
-{
-    m_calleeGroups[static_cast<size_t>(mode)].set(vm, this, calleeGroup);
-}
-
</del><span class="cx"> template<typename Visitor>
</span><span class="cx"> void JSWebAssemblyModule::visitChildrenImpl(JSCell* cell, Visitor& visitor)
</span><span class="cx"> {
</span><span class="lines">@@ -132,12 +132,41 @@
</span><span class="cx"> 
</span><span class="cx">     Base::visitChildren(thisObject, visitor);
</span><span class="cx">     visitor.append(thisObject->m_exportSymbolTable);
</span><del>-    for (unsigned i = 0; i < Wasm::NumberOfMemoryModes; ++i)
-        visitor.append(thisObject->m_calleeGroups[i]);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> DEFINE_VISIT_CHILDREN(JSWebAssemblyModule);
</span><span class="cx"> 
</span><ins>+void JSWebAssemblyModule::clearJSCallICs(VM& vm)
+{
+    for (auto iter = m_callLinkInfos.begin(); !!iter; ++iter)
+        (*iter)->unlink(vm);
+}
+
+void JSWebAssemblyModule::finalizeUnconditionally(VM& vm)
+{
+    for (auto iter = m_callLinkInfos.begin(); !!iter; ++iter)
+        (*iter)->visitWeak(vm);
+}
+
+Expected<void, Wasm::BindingFailure> JSWebAssemblyModule::generateWasmToJSStubs(VM& vm)
+{
+    const Wasm::ModuleInformation& moduleInformation = m_module->moduleInformation();
+    if (moduleInformation.importFunctionCount()) {
+        Bag<OptimizingCallLinkInfo> callLinkInfos;
+        FixedVector<MacroAssemblerCodeRef<WasmEntryPtrTag>> stubs(moduleInformation.importFunctionCount());
+        for (unsigned importIndex = 0; importIndex < moduleInformation.importFunctionCount(); ++importIndex) {
+            Wasm::SignatureIndex signatureIndex = moduleInformation.importFunctionSignatureIndices.at(importIndex);
+            auto binding = Wasm::wasmToJS(vm, callLinkInfos, signatureIndex, importIndex);
+            if (UNLIKELY(!binding))
+                return makeUnexpected(binding.error());
+            stubs[importIndex] = binding.value();
+        }
+        m_wasmToJSExitStubs = WTFMove(stubs);
+        m_callLinkInfos = WTFMove(callLinkInfos);
+    }
+    return { };
+}
+
</ins><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(WEBASSEMBLY)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyModuleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h        2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h   2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -43,10 +43,10 @@
</span><span class="cx"> class Module;
</span><span class="cx"> struct ModuleInformation;
</span><span class="cx"> class Plan;
</span><ins>+enum class BindingFailure;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class SymbolTable;
</span><del>-class JSWebAssemblyCalleeGroup;
</del><span class="cx"> class JSWebAssemblyMemory;
</span><span class="cx"> 
</span><span class="cx"> class JSWebAssemblyModule final : public JSNonFinalObject {
</span><span class="lines">@@ -70,14 +70,15 @@
</span><span class="cx">     SymbolTable* exportSymbolTable() const;
</span><span class="cx">     Wasm::SignatureIndex signatureIndexFromFunctionIndexSpace(unsigned functionIndexSpace) const;
</span><span class="cx"> 
</span><del>-    JSWebAssemblyCalleeGroup* calleeGroup(Wasm::MemoryMode);
-    void setCalleeGroup(VM&, Wasm::MemoryMode, JSWebAssemblyCalleeGroup*);
</del><ins>+    Expected<void, Wasm::BindingFailure> generateWasmToJSStubs(VM&);
+    MacroAssemblerCodePtr<WasmEntryPtrTag> wasmToEmbedderStub(size_t importFunctionNum) { return m_wasmToJSExitStubs[importFunctionNum].code(); }
</ins><span class="cx"> 
</span><ins>+    void clearJSCallICs(VM&);
+    void finalizeUnconditionally(VM&);
+
</ins><span class="cx">     JS_EXPORT_PRIVATE Wasm::Module& module();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    friend class JSWebAssemblyCalleeGroup;
-
</del><span class="cx">     JSWebAssemblyModule(VM&, Structure*, Ref<Wasm::Module>&&);
</span><span class="cx">     void finishCreation(VM&);
</span><span class="cx">     DECLARE_VISIT_CHILDREN;
</span><span class="lines">@@ -84,7 +85,8 @@
</span><span class="cx"> 
</span><span class="cx">     Ref<Wasm::Module> m_module;
</span><span class="cx">     WriteBarrier<SymbolTable> m_exportSymbolTable;
</span><del>-    WriteBarrier<JSWebAssemblyCalleeGroup> m_calleeGroups[Wasm::NumberOfMemoryModes];
</del><ins>+    FixedVector<MacroAssemblerCodeRef<WasmEntryPtrTag>> m_wasmToJSExitStubs;
+    Bag<OptimizingCallLinkInfo> m_callLinkInfos;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyModuleConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp     2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp        2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include "JSWebAssemblyHelpers.h"
</span><span class="cx"> #include "JSWebAssemblyModule.h"
</span><span class="cx"> #include "ObjectConstructor.h"
</span><ins>+#include "WasmModule.h"
</ins><span class="cx"> #include "WasmModuleInformation.h"
</span><span class="cx"> #include "WebAssemblyModulePrototype.h"
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyWrapperFunctionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyWrapperFunction.h (287581 => 287582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyWrapperFunction.h 2022-01-04 20:59:30 UTC (rev 287581)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyWrapperFunction.h    2022-01-04 21:25:43 UTC (rev 287582)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><span class="cx"> 
</span><del>-#include "JSWebAssemblyCalleeGroup.h"
</del><span class="cx"> #include "WebAssemblyFunctionBase.h"
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span></span></pre>
</div>
</div>

</body>
</html>