<!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>[243312] 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/243312">243312</a></dd>
<dt>Author</dt> <dd>ysuzuki@apple.com</dd>
<dt>Date</dt> <dd>2019-03-21 12:14:12 -0700 (Thu, 21 Mar 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[JSC] Do not create JIT related data under non-JIT mode
https://bugs.webkit.org/show_bug.cgi?id=195982

Reviewed by Mark Lam.

We avoid creations of JIT related data structures under non-JIT mode.
This patch removes the following allocations.

1. JITThunks
2. FTLThunks
3. FixedVMPoolExecutableAllocator
4. noJITValueProfileSingleton since it is no longer used
5. ARM disassembler should be initialized when it is used
6. Wasm related data structures are accidentally allocated if VM::canUseJIT() == false &&
   Options::useWebAssembly() == true. Add Wasm::isSupported() function to check the both conditions.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/Heap.cpp:
(JSC::Heap::runEndPhase):
* jit/ExecutableAllocator.cpp:
(JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator):
(JSC::ExecutableAllocator::initializeUnderlyingAllocator):
(JSC::ExecutableAllocator::isValid const):
(JSC::ExecutableAllocator::underMemoryPressure):
(JSC::ExecutableAllocator::memoryPressureMultiplier):
(JSC::ExecutableAllocator::allocate):
(JSC::ExecutableAllocator::isValidExecutableMemory):
(JSC::ExecutableAllocator::getLock const):
(JSC::ExecutableAllocator::committedByteCount):
(JSC::ExecutableAllocator::dumpProfile):
(JSC::startOfFixedExecutableMemoryPoolImpl):
(JSC::endOfFixedExecutableMemoryPoolImpl):
(JSC::ExecutableAllocator::initialize):
(JSC::ExecutableAllocator::initializeAllocator): Deleted.
(JSC::ExecutableAllocator::ExecutableAllocator): Deleted.
(JSC::ExecutableAllocator::~ExecutableAllocator): Deleted.
* jit/ExecutableAllocator.h:
(JSC::ExecutableAllocatorBase::isValid const):
(JSC::ExecutableAllocatorBase::underMemoryPressure):
(JSC::ExecutableAllocatorBase::memoryPressureMultiplier):
(JSC::ExecutableAllocatorBase::dumpProfile):
(JSC::ExecutableAllocatorBase::allocate):
(JSC::ExecutableAllocatorBase::setJITEnabled):
(JSC::ExecutableAllocatorBase::isValidExecutableMemory):
(JSC::ExecutableAllocatorBase::committedByteCount):
(JSC::ExecutableAllocatorBase::getLock const):
(JSC::ExecutableAllocator::isValid const): Deleted.
(JSC::ExecutableAllocator::underMemoryPressure): Deleted.
(JSC::ExecutableAllocator::memoryPressureMultiplier): Deleted.
(JSC::ExecutableAllocator::allocate): Deleted.
(JSC::ExecutableAllocator::setJITEnabled): Deleted.
(JSC::ExecutableAllocator::isValidExecutableMemory): Deleted.
(JSC::ExecutableAllocator::committedByteCount): Deleted.
(JSC::ExecutableAllocator::getLock const): Deleted.
* jsc.cpp:
(functionWebAssemblyMemoryMode):
* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSLock.cpp:
(JSC::JSLock::didAcquireLock):
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/VM.cpp:
(JSC::enableAssembler):
(JSC::VM::canUseAssembler):
(JSC::VM::VM):
* runtime/VM.h:
* wasm/WasmCapabilities.h: Added.
(JSC::Wasm::isSupported):
* wasm/WasmFaultSignalHandler.cpp:
(JSC::Wasm::enableFastMemory):</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="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeapcpp">trunk/Source/JavaScriptCore/heap/Heap.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitExecutableAllocatorcpp">trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitExecutableAllocatorh">trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejsccpp">trunk/Source/JavaScriptCore/jsc.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeInitializeThreadingcpp">trunk/Source/JavaScriptCore/runtime/InitializeThreading.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSLockcpp">trunk/Source/JavaScriptCore/runtime/JSLock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeOptionscpp">trunk/Source/JavaScriptCore/runtime/Options.cpp</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="#trunkSourceJavaScriptCorewasmWasmFaultSignalHandlercpp">trunk/Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCorewasmWasmCapabilitiesh">trunk/Source/JavaScriptCore/wasm/WasmCapabilities.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 (243311 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt       2019-03-21 19:09:10 UTC (rev 243311)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt  2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -977,6 +977,7 @@
</span><span class="cx">     runtime/WriteBarrier.h
</span><span class="cx">     runtime/WriteBarrierInlines.h
</span><span class="cx"> 
</span><ins>+    wasm/WasmCapabilities.h
</ins><span class="cx">     wasm/WasmCodeBlock.h
</span><span class="cx">     wasm/WasmContext.h
</span><span class="cx">     wasm/WasmEmbedder.h
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (243311 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2019-03-21 19:09:10 UTC (rev 243311)
+++ trunk/Source/JavaScriptCore/ChangeLog       2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -1,5 +1,82 @@
</span><span class="cx"> 2019-03-21  Yusuke Suzuki  <ysuzuki@apple.com>
</span><span class="cx"> 
</span><ins>+        [JSC] Do not create JIT related data under non-JIT mode
+        https://bugs.webkit.org/show_bug.cgi?id=195982
+
+        Reviewed by Mark Lam.
+
+        We avoid creations of JIT related data structures under non-JIT mode.
+        This patch removes the following allocations.
+
+        1. JITThunks
+        2. FTLThunks
+        3. FixedVMPoolExecutableAllocator
+        4. noJITValueProfileSingleton since it is no longer used
+        5. ARM disassembler should be initialized when it is used
+        6. Wasm related data structures are accidentally allocated if VM::canUseJIT() == false &&
+           Options::useWebAssembly() == true. Add Wasm::isSupported() function to check the both conditions.
+
+        * CMakeLists.txt:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * heap/Heap.cpp:
+        (JSC::Heap::runEndPhase):
+        * jit/ExecutableAllocator.cpp:
+        (JSC::FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator):
+        (JSC::ExecutableAllocator::initializeUnderlyingAllocator):
+        (JSC::ExecutableAllocator::isValid const):
+        (JSC::ExecutableAllocator::underMemoryPressure):
+        (JSC::ExecutableAllocator::memoryPressureMultiplier):
+        (JSC::ExecutableAllocator::allocate):
+        (JSC::ExecutableAllocator::isValidExecutableMemory):
+        (JSC::ExecutableAllocator::getLock const):
+        (JSC::ExecutableAllocator::committedByteCount):
+        (JSC::ExecutableAllocator::dumpProfile):
+        (JSC::startOfFixedExecutableMemoryPoolImpl):
+        (JSC::endOfFixedExecutableMemoryPoolImpl):
+        (JSC::ExecutableAllocator::initialize):
+        (JSC::ExecutableAllocator::initializeAllocator): Deleted.
+        (JSC::ExecutableAllocator::ExecutableAllocator): Deleted.
+        (JSC::ExecutableAllocator::~ExecutableAllocator): Deleted.
+        * jit/ExecutableAllocator.h:
+        (JSC::ExecutableAllocatorBase::isValid const):
+        (JSC::ExecutableAllocatorBase::underMemoryPressure):
+        (JSC::ExecutableAllocatorBase::memoryPressureMultiplier):
+        (JSC::ExecutableAllocatorBase::dumpProfile):
+        (JSC::ExecutableAllocatorBase::allocate):
+        (JSC::ExecutableAllocatorBase::setJITEnabled):
+        (JSC::ExecutableAllocatorBase::isValidExecutableMemory):
+        (JSC::ExecutableAllocatorBase::committedByteCount):
+        (JSC::ExecutableAllocatorBase::getLock const):
+        (JSC::ExecutableAllocator::isValid const): Deleted.
+        (JSC::ExecutableAllocator::underMemoryPressure): Deleted.
+        (JSC::ExecutableAllocator::memoryPressureMultiplier): Deleted.
+        (JSC::ExecutableAllocator::allocate): Deleted.
+        (JSC::ExecutableAllocator::setJITEnabled): Deleted.
+        (JSC::ExecutableAllocator::isValidExecutableMemory): Deleted.
+        (JSC::ExecutableAllocator::committedByteCount): Deleted.
+        (JSC::ExecutableAllocator::getLock const): Deleted.
+        * jsc.cpp:
+        (functionWebAssemblyMemoryMode):
+        * runtime/InitializeThreading.cpp:
+        (JSC::initializeThreading):
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::init):
+        * runtime/JSLock.cpp:
+        (JSC::JSLock::didAcquireLock):
+        * runtime/Options.cpp:
+        (JSC::recomputeDependentOptions):
+        * runtime/VM.cpp:
+        (JSC::enableAssembler):
+        (JSC::VM::canUseAssembler):
+        (JSC::VM::VM):
+        * runtime/VM.h:
+        * wasm/WasmCapabilities.h: Added.
+        (JSC::Wasm::isSupported):
+        * wasm/WasmFaultSignalHandler.cpp:
+        (JSC::Wasm::enableFastMemory):
+
+2019-03-21  Yusuke Suzuki  <ysuzuki@apple.com>
+
</ins><span class="cx">         [JSC] Fix JSC build with newer ICU
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=196098
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (243311 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj     2019-03-21 19:09:10 UTC (rev 243311)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -1752,6 +1752,7 @@
</span><span class="cx">          E32AB2441DCD75F400D7533A /* MacroAssemblerHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = E380A76B1DCD7195000F89E6 /* MacroAssemblerHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          E334CBB521FD96A9000EB178 /* RegExpGlobalData.h in Headers */ = {isa = PBXBuildFile; fileRef = E334CBB321FD96A9000EB178 /* RegExpGlobalData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          E33637A61B63220200EE0840 /* ReflectObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E33637A41B63220200EE0840 /* ReflectObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+               E337B967224324EA0093A820 /* WasmCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = E337B966224324E50093A820 /* WasmCapabilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           E33B3E261B7ABD750048DB2E /* InspectorInstrumentationObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = E33B3E251B7ABD750048DB2E /* InspectorInstrumentationObject.lut.h */; };
</span><span class="cx">          E33E8D1D1B9013C300346B52 /* JSNativeStdFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = E33E8D1B1B9013C300346B52 /* JSNativeStdFunction.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          E33E8D211B9013DE00346B52 /* NativeStdFunctionCell.h in Headers */ = {isa = PBXBuildFile; fileRef = E33E8D1F1B9013DE00346B52 /* NativeStdFunctionCell.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -4693,6 +4694,7 @@
</span><span class="cx">          E334CBB321FD96A9000EB178 /* RegExpGlobalData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpGlobalData.h; sourceTree = "<group>"; };
</span><span class="cx">          E33637A31B63220200EE0840 /* ReflectObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReflectObject.cpp; sourceTree = "<group>"; };
</span><span class="cx">          E33637A41B63220200EE0840 /* ReflectObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReflectObject.h; sourceTree = "<group>"; };
</span><ins>+               E337B966224324E50093A820 /* WasmCapabilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WasmCapabilities.h; sourceTree = "<group>"; };
</ins><span class="cx">           E33B3E251B7ABD750048DB2E /* InspectorInstrumentationObject.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorInstrumentationObject.lut.h; sourceTree = "<group>"; };
</span><span class="cx">          E33E8D1A1B9013C300346B52 /* JSNativeStdFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNativeStdFunction.cpp; sourceTree = "<group>"; };
</span><span class="cx">          E33E8D1B1B9013C300346B52 /* JSNativeStdFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNativeStdFunction.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -5083,11 +5085,11 @@
</span><span class="cx">                          0F6183431C45F62A0072450B /* testair */,
</span><span class="cx">                          14BD59BF0A3E8F9000BAF59C /* testapi */,
</span><span class="cx">                          0FEC85AD1BDB5CF10080FF74 /* testb3 */,
</span><ins>+                               52CD0F642242F569004A18A5 /* testdfg */,
</ins><span class="cx">                           FE533CAC1F217DB40016A1FE /* testmasm */,
</span><span class="cx">                          79281BDC20B62B3E002E2A60 /* testmem */,
</span><span class="cx">                          6511230514046A4C002B101D /* testRegExp */,
</span><span class="cx">                          932F5BD90822A1C700736975 /* JavaScriptCore.framework */,
</span><del>-                               52CD0F642242F569004A18A5 /* testdfg */,
</del><span class="cx">                   );
</span><span class="cx">                  name = Products;
</span><span class="cx">                  sourceTree = "<group>";
</span><span class="lines">@@ -6493,6 +6495,7 @@
</span><span class="cx">                          525C0DD81E935847002184CD /* WasmCallee.h */,
</span><span class="cx">                          53FD04D11D7AB187003287D3 /* WasmCallingConvention.cpp */,
</span><span class="cx">                          53FD04D21D7AB187003287D3 /* WasmCallingConvention.h */,
</span><ins>+                               E337B966224324E50093A820 /* WasmCapabilities.h */,
</ins><span class="cx">                           526AC4B41E977C5D003500E1 /* WasmCodeBlock.cpp */,
</span><span class="cx">                          526AC4B51E977C5D003500E1 /* WasmCodeBlock.h */,
</span><span class="cx">                          AD412B321E7B2E8A008AF157 /* WasmContext.h */,
</span><span class="lines">@@ -9824,6 +9827,7 @@
</span><span class="cx">                          AD4B1DFA1DF244E20071AE32 /* WasmBinding.h in Headers */,
</span><span class="cx">                          525C0DDA1E935847002184CD /* WasmCallee.h in Headers */,
</span><span class="cx">                          53FD04D41D7AB291003287D3 /* WasmCallingConvention.h in Headers */,
</span><ins>+                               E337B967224324EA0093A820 /* WasmCapabilities.h in Headers */,
</ins><span class="cx">                           526AC4B71E977C5D003500E1 /* WasmCodeBlock.h in Headers */,
</span><span class="cx">                          AD412B341E7B2E9E008AF157 /* WasmContext.h in Headers */,
</span><span class="cx">                          7593C898BE714A64BE93A6E7 /* WasmContextInlines.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.cpp (243311 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.cpp        2019-03-21 19:09:10 UTC (rev 243311)
+++ trunk/Source/JavaScriptCore/heap/Heap.cpp   2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -1496,9 +1496,6 @@
</span><span class="cx">     if (vm()->typeProfiler())
</span><span class="cx">         vm()->typeProfiler()->invalidateTypeSetCache();
</span><span class="cx"> 
</span><del>-    if (ValueProfile* profile = vm()->noJITValueProfileSingleton.get())
-        *profile = ValueProfile(0);
-        
</del><span class="cx">     reapWeakHandles();
</span><span class="cx">     pruneStaleEntriesFromWeakGCMaps();
</span><span class="cx">     sweepArrayBuffers();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitExecutableAllocatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp (243311 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp  2019-03-21 19:09:10 UTC (rev 243311)
+++ trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp     2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -115,7 +115,6 @@
</span><span class="cx"> 
</span><span class="cx"> class FixedVMPoolExecutableAllocator;
</span><span class="cx"> static FixedVMPoolExecutableAllocator* allocator = nullptr;
</span><del>-static ExecutableAllocator* executableAllocator = nullptr;
</del><span class="cx"> 
</span><span class="cx"> static bool s_isJITEnabled = true;
</span><span class="cx"> static bool isJITEnabled()
</span><span class="lines">@@ -404,43 +403,29 @@
</span><span class="cx">     MacroAssemblerCodePtr<ExecutableMemoryPtrTag> m_memoryEnd;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-void ExecutableAllocator::initializeAllocator()
</del><ins>+FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator()
</ins><span class="cx"> {
</span><ins>+    m_reservation.deallocate();
+}
+
+void ExecutableAllocator::initializeUnderlyingAllocator()
+{
</ins><span class="cx">     ASSERT(!allocator);
</span><span class="cx">     allocator = new FixedVMPoolExecutableAllocator();
</span><span class="cx">     CodeProfiling::notifyAllocator(allocator);
</span><del>-
-    executableAllocator = new ExecutableAllocator;
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-ExecutableAllocator& ExecutableAllocator::singleton()
-{
-    ASSERT(allocator);
-    ASSERT(executableAllocator);
-    return *executableAllocator;
-}
-
-ExecutableAllocator::ExecutableAllocator()
-{
-    ASSERT(allocator);
-}
-
-ExecutableAllocator::~ExecutableAllocator()
-{
-}
-
-FixedVMPoolExecutableAllocator::~FixedVMPoolExecutableAllocator()
-{
-    m_reservation.deallocate();
-}
-
</del><span class="cx"> bool ExecutableAllocator::isValid() const
</span><span class="cx"> {
</span><ins>+    if (!allocator)
+        return Base::isValid();
</ins><span class="cx">     return !!allocator->bytesReserved();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ExecutableAllocator::underMemoryPressure()
</span><span class="cx"> {
</span><ins>+    if (!allocator)
+        return Base::underMemoryPressure();
</ins><span class="cx">     MetaAllocator::Statistics statistics = allocator->currentStatistics();
</span><span class="cx">     return statistics.bytesAllocated > statistics.bytesReserved / 2;
</span><span class="cx"> }
</span><span class="lines">@@ -447,6 +432,8 @@
</span><span class="cx"> 
</span><span class="cx"> double ExecutableAllocator::memoryPressureMultiplier(size_t addedMemoryUsage)
</span><span class="cx"> {
</span><ins>+    if (!allocator)
+        return Base::memoryPressureMultiplier(addedMemoryUsage);
</ins><span class="cx">     MetaAllocator::Statistics statistics = allocator->currentStatistics();
</span><span class="cx">     ASSERT(statistics.bytesAllocated <= statistics.bytesReserved);
</span><span class="cx">     size_t bytesAllocated = statistics.bytesAllocated + addedMemoryUsage;
</span><span class="lines">@@ -465,6 +452,8 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr<ExecutableMemoryHandle> ExecutableAllocator::allocate(size_t sizeInBytes, void* ownerUID, JITCompilationEffort effort)
</span><span class="cx"> {
</span><ins>+    if (!allocator)
+        return Base::allocate(sizeInBytes, ownerUID, effort);
</ins><span class="cx">     if (Options::logExecutableAllocation()) {
</span><span class="cx">         MetaAllocator::Statistics stats = allocator->currentStatistics();
</span><span class="cx">         dataLog("Allocating ", sizeInBytes, " bytes of executable memory with ", stats.bytesAllocated, " bytes allocated, ", stats.bytesReserved, " bytes reserved, and ", stats.bytesCommitted, " committed.\n");
</span><span class="lines">@@ -514,16 +503,22 @@
</span><span class="cx"> 
</span><span class="cx"> bool ExecutableAllocator::isValidExecutableMemory(const AbstractLocker& locker, void* address)
</span><span class="cx"> {
</span><ins>+    if (!allocator)
+        return Base::isValidExecutableMemory(locker, address);
</ins><span class="cx">     return allocator->isInAllocatedMemory(locker, address);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Lock& ExecutableAllocator::getLock() const
</span><span class="cx"> {
</span><ins>+    if (!allocator)
+        return Base::getLock();
</ins><span class="cx">     return allocator->getLock();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> size_t ExecutableAllocator::committedByteCount()
</span><span class="cx"> {
</span><ins>+    if (!allocator)
+        return Base::committedByteCount();
</ins><span class="cx">     return allocator->bytesCommitted();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -530,6 +525,8 @@
</span><span class="cx"> #if ENABLE(META_ALLOCATOR_PROFILE)
</span><span class="cx"> void ExecutableAllocator::dumpProfile()
</span><span class="cx"> {
</span><ins>+    if (!allocator)
+        return;
</ins><span class="cx">     allocator->dumpProfile();
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -536,11 +533,15 @@
</span><span class="cx"> 
</span><span class="cx"> void* startOfFixedExecutableMemoryPoolImpl()
</span><span class="cx"> {
</span><ins>+    if (!allocator)
+        return nullptr;
</ins><span class="cx">     return allocator->memoryStart();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void* endOfFixedExecutableMemoryPoolImpl()
</span><span class="cx"> {
</span><ins>+    if (!allocator)
+        return nullptr;
</ins><span class="cx">     return allocator->memoryEnd();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -551,13 +552,13 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><del>-#else // !ENABLE(JIT)
</del><ins>+#endif // ENABLE(JIT)
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx"> static ExecutableAllocator* executableAllocator;
</span><span class="cx"> 
</span><del>-void ExecutableAllocator::initializeAllocator()
</del><ins>+void ExecutableAllocator::initialize()
</ins><span class="cx"> {
</span><span class="cx">     executableAllocator = new ExecutableAllocator;
</span><span class="cx"> }
</span><span class="lines">@@ -569,5 +570,3 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><del>-
-#endif // ENABLE(JIT)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorejitExecutableAllocatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h (243311 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h    2019-03-21 19:09:10 UTC (rev 243311)
+++ trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h       2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -59,6 +59,39 @@
</span><span class="cx"> 
</span><span class="cx"> typedef WTF::MetaAllocatorHandle ExecutableMemoryHandle;
</span><span class="cx"> 
</span><ins>+class ExecutableAllocatorBase {
+    WTF_MAKE_FAST_ALLOCATED;
+    WTF_MAKE_NONCOPYABLE(ExecutableAllocatorBase);
+public:
+    bool isValid() const { return false; }
+
+    static bool underMemoryPressure() { return false; }
+
+    static double memoryPressureMultiplier(size_t) { return 1.0; }
+
+    static void dumpProfile() { }
+
+    RefPtr<ExecutableMemoryHandle> allocate(size_t, void*, JITCompilationEffort) { return nullptr; }
+
+    static void setJITEnabled(bool) { };
+    
+    bool isValidExecutableMemory(const AbstractLocker&, void*) { return false; }
+
+    static size_t committedByteCount() { return 0; }
+
+    Lock& getLock() const
+    {
+        return m_lock;
+    }
+
+protected:
+    ExecutableAllocatorBase() = default;
+    ~ExecutableAllocatorBase() = default;
+
+private:
+    mutable Lock m_lock;
+};
+
</ins><span class="cx"> #if ENABLE(JIT)
</span><span class="cx"> 
</span><span class="cx"> JS_EXPORT_PRIVATE void* startOfFixedExecutableMemoryPoolImpl();
</span><span class="lines">@@ -122,14 +155,13 @@
</span><span class="cx">     return memcpy(dst, src, n);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-class ExecutableAllocator {
-    WTF_MAKE_FAST_ALLOCATED;
-    WTF_MAKE_NONCOPYABLE(ExecutableAllocator);
-    enum ProtectionSetting { Writable, Executable };
</del><ins>+class ExecutableAllocator : private ExecutableAllocatorBase {
+public:
+    using Base = ExecutableAllocatorBase;
</ins><span class="cx"> 
</span><del>-public:
</del><span class="cx">     static ExecutableAllocator& singleton();
</span><del>-    static void initializeAllocator();
</del><ins>+    static void initialize();
+    static void initializeUnderlyingAllocator();
</ins><span class="cx"> 
</span><span class="cx">     bool isValid() const;
</span><span class="cx"> 
</span><span class="lines">@@ -152,44 +184,22 @@
</span><span class="cx">     static size_t committedByteCount();
</span><span class="cx"> 
</span><span class="cx">     Lock& getLock() const;
</span><ins>+
</ins><span class="cx"> private:
</span><del>-
-    ExecutableAllocator();
-    ~ExecutableAllocator();
</del><ins>+    ExecutableAllocator() = default;
+    ~ExecutableAllocator() = default;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #else
</span><span class="cx"> 
</span><del>-class ExecutableAllocator {
-    enum ProtectionSetting { Writable, Executable };
-
</del><ins>+class ExecutableAllocator : public ExecutableAllocatorBase {
</ins><span class="cx"> public:
</span><span class="cx">     static ExecutableAllocator& singleton();
</span><del>-    static void initializeAllocator();
</del><ins>+    static void initialize();
</ins><span class="cx"> 
</span><del>-    bool isValid() const { return false; }
-
-    static bool underMemoryPressure() { return false; }
-
-    static double memoryPressureMultiplier(size_t) { return 1.0; }
-
-    static void dumpProfile() { }
-
-    RefPtr<ExecutableMemoryHandle> allocate(size_t, void*, JITCompilationEffort) { return nullptr; }
-
-    static void setJITEnabled(bool) { };
-    
-    bool isValidExecutableMemory(const AbstractLocker&, void*) { return false; }
-
-    static size_t committedByteCount() { return 0; }
-
-    Lock& getLock() const
-    {
-        return m_lock;
-    }
-
</del><span class="cx"> private:
</span><del>-    mutable Lock m_lock;
</del><ins>+    ExecutableAllocator() = default;
+    ~ExecutableAllocator() = default;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> static inline void* performJITMemcpy(void *dst, const void *src, size_t n)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejsccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jsc.cpp (243311 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jsc.cpp      2019-03-21 19:09:10 UTC (rev 243311)
+++ trunk/Source/JavaScriptCore/jsc.cpp 2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -69,6 +69,7 @@
</span><span class="cx"> #include "SuperSampler.h"
</span><span class="cx"> #include "TestRunnerUtils.h"
</span><span class="cx"> #include "TypedArrayInlines.h"
</span><ins>+#include "WasmCapabilities.h"
</ins><span class="cx"> #include "WasmContext.h"
</span><span class="cx"> #include "WasmFaultSignalHandler.h"
</span><span class="cx"> #include "WasmMemory.h"
</span><span class="lines">@@ -2307,7 +2308,7 @@
</span><span class="cx">     VM& vm = exec->vm();
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx">     
</span><del>-    if (!Options::useWebAssembly())
</del><ins>+    if (!Wasm::isSupported())
</ins><span class="cx">         return throwVMTypeError(exec, scope, "WebAssemblyMemoryMode should only be called if the useWebAssembly option is set"_s);
</span><span class="cx"> 
</span><span class="cx">     if (JSObject* object = exec->argument(0).getObject()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeInitializeThreadingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/InitializeThreading.cpp (243311 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/InitializeThreading.cpp      2019-03-21 19:09:10 UTC (rev 243311)
+++ trunk/Source/JavaScriptCore/runtime/InitializeThreading.cpp 2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -40,8 +40,10 @@
</span><span class="cx"> #include "LLIntData.h"
</span><span class="cx"> #include "MacroAssemblerCodeRef.h"
</span><span class="cx"> #include "Options.h"
</span><ins>+#include "SigillCrashAnalyzer.h"
</ins><span class="cx"> #include "StructureIDTable.h"
</span><span class="cx"> #include "SuperSampler.h"
</span><ins>+#include "WasmCapabilities.h"
</ins><span class="cx"> #include "WasmThunks.h"
</span><span class="cx"> #include "WriteBarrier.h"
</span><span class="cx"> #include <mutex>
</span><span class="lines">@@ -68,11 +70,12 @@
</span><span class="cx">         WriteBarrierCounters::initialize();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(ASSEMBLER)
-        ExecutableAllocator::initializeAllocator();
-#endif
</del><ins>+        ExecutableAllocator::initialize();
</ins><span class="cx">         VM::computeCanUseJIT();
</span><span class="cx"> 
</span><ins>+        if (VM::canUseJIT() && Options::useSigillCrashAnalyzer())
+            enableSigillCrashAnalyzer();
+
</ins><span class="cx">         LLInt::initialize();
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx">         DisallowGC::initialize();
</span><span class="lines">@@ -83,7 +86,7 @@
</span><span class="cx">         thread.setSavedLastStackTop(thread.stack().origin());
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><del>-        if (Options::useWebAssembly())
</del><ins>+        if (Wasm::isSupported())
</ins><span class="cx">             Wasm::Thunks::initialize();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (243311 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp   2019-03-21 19:09:10 UTC (rev 243311)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp      2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -168,6 +168,7 @@
</span><span class="cx"> #include "SymbolObject.h"
</span><span class="cx"> #include "SymbolPrototype.h"
</span><span class="cx"> #include "VariableWriteFireDetail.h"
</span><ins>+#include "WasmCapabilities.h"
</ins><span class="cx"> #include "WeakGCMapInlines.h"
</span><span class="cx"> #include "WeakMapConstructor.h"
</span><span class="cx"> #include "WeakMapPrototype.h"
</span><span class="lines">@@ -1042,7 +1043,7 @@
</span><span class="cx">         exposeDollarVM(vm);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><del>-    if (Options::useWebAssembly()) {
</del><ins>+    if (Wasm::isSupported()) {
</ins><span class="cx">         auto* webAssemblyPrototype = WebAssemblyPrototype::create(vm, this, WebAssemblyPrototype::createStructure(vm, this, m_objectPrototype.get()));
</span><span class="cx">         m_webAssemblyModuleRecordStructure.initLater(
</span><span class="cx">             [] (const Initializer<Structure>& init) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSLockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSLock.cpp (243311 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSLock.cpp   2019-03-21 19:09:10 UTC (rev 243311)
+++ trunk/Source/JavaScriptCore/runtime/JSLock.cpp      2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #include "JSCInlines.h"
</span><span class="cx"> #include "MachineStackMarker.h"
</span><span class="cx"> #include "SamplingProfiler.h"
</span><ins>+#include "WasmCapabilities.h"
</ins><span class="cx"> #include "WasmMachineThreads.h"
</span><span class="cx"> #include <thread>
</span><span class="cx"> #include <wtf/StackPointer.h>
</span><span class="lines">@@ -149,7 +150,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_vm->heap.machineThreads().addCurrentThread();
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><del>-    if (Options::useWebAssembly())
</del><ins>+    if (Wasm::isSupported())
</ins><span class="cx">         Wasm::startTrackingCurrentThread();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeOptionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Options.cpp (243311 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Options.cpp  2019-03-21 19:09:10 UTC (rev 243311)
+++ trunk/Source/JavaScriptCore/runtime/Options.cpp     2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -420,8 +420,10 @@
</span><span class="cx">         Options::useJIT() = false;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (!Options::useJIT())
</del><ins>+    if (!Options::useJIT()) {
+        Options::useSigillCrashAnalyzer() = false;
</ins><span class="cx">         Options::useWebAssembly() = false;
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     if (!Options::useWebAssembly())
</span><span class="cx">         Options::useFastTLSForWasmContext() = false;
</span><span class="lines">@@ -510,9 +512,6 @@
</span><span class="cx">         Options::scribbleFreeCells() = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (Options::useSigillCrashAnalyzer())
-        enableSigillCrashAnalyzer();
-
</del><span class="cx">     if (Options::reservedZoneSize() < minimumReservedZoneSize)
</span><span class="cx">         Options::reservedZoneSize() = minimumReservedZoneSize;
</span><span class="cx">     if (Options::softReservedZoneSize() < Options::reservedZoneSize() + minimumReservedZoneSize)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.cpp (243311 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.cpp       2019-03-21 19:09:10 UTC (rev 243311)
+++ trunk/Source/JavaScriptCore/runtime/VM.cpp  2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -185,19 +185,23 @@
</span><span class="cx"> // just checks for ENABLE(JIT) or ENABLE(YARR_JIT) with this premise in mind.
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ASSEMBLER)
</span><del>-static bool enableAssembler(ExecutableAllocator& executableAllocator)
</del><ins>+static bool enableAssembler()
</ins><span class="cx"> {
</span><span class="cx">     if (!Options::useJIT() && !Options::useRegExpJIT())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (!executableAllocator.isValid()) {
</del><ins>+    char* canUseJITString = getenv("JavaScriptCoreUseJIT");
+    if (canUseJITString && !atoi(canUseJITString))
+        return false;
+
+    ExecutableAllocator::initializeUnderlyingAllocator();
+    if (!ExecutableAllocator::singleton().isValid()) {
</ins><span class="cx">         if (Options::crashIfCantAllocateJITMemory())
</span><span class="cx">             CRASH();
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    char* canUseJITString = getenv("JavaScriptCoreUseJIT");
-    return !canUseJITString || atoi(canUseJITString);
</del><ins>+    return true;
</ins><span class="cx"> }
</span><span class="cx"> #endif // ENABLE(!ASSEMBLER)
</span><span class="cx"> 
</span><span class="lines">@@ -207,7 +211,7 @@
</span><span class="cx">     static std::once_flag onceKey;
</span><span class="cx">     static bool enabled = false;
</span><span class="cx">     std::call_once(onceKey, [] {
</span><del>-        enabled = enableAssembler(ExecutableAllocator::singleton());
</del><ins>+        enabled = enableAssembler();
</ins><span class="cx">     });
</span><span class="cx">     return enabled;
</span><span class="cx"> #else
</span><span class="lines">@@ -407,14 +411,6 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Thread::current().setCurrentAtomicStringTable(existingEntryAtomicStringTable);
</span><del>-
-#if ENABLE(JIT)
-    jitStubs = std::make_unique<JITThunks>();
-#endif
-
-#if ENABLE(FTL_JIT)
-    ftlThunks = std::make_unique<FTL::Thunks>();
-#endif // ENABLE(FTL_JIT)
</del><span class="cx">     
</span><span class="cx"> #if !ENABLE(C_LOOP)
</span><span class="cx">     initializeHostCallReturnValue(); // This is needed to convince the linker not to drop host call return support.
</span><span class="lines">@@ -472,14 +468,15 @@
</span><span class="cx"> #if ENABLE(JIT)
</span><span class="cx">     // Make sure that any stubs that the JIT is going to use are initialized in non-compilation threads.
</span><span class="cx">     if (canUseJIT()) {
</span><ins>+        jitStubs = std::make_unique<JITThunks>();
+#if ENABLE(FTL_JIT)
+        ftlThunks = std::make_unique<FTL::Thunks>();
+#endif // ENABLE(FTL_JIT)
</ins><span class="cx">         getCTIInternalFunctionTrampolineFor(CodeForCall);
</span><span class="cx">         getCTIInternalFunctionTrampolineFor(CodeForConstruct);
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (!canUseJIT())
-        noJITValueProfileSingleton = std::make_unique<ValueProfile>(0);
-
</del><span class="cx">     if (Options::forceDebuggerBytecodeGeneration() || Options::alwaysUseShadowChicken())
</span><span class="cx">         ensureShadowChicken();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.h (243311 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.h 2019-03-21 19:09:10 UTC (rev 243311)
+++ trunk/Source/JavaScriptCore/runtime/VM.h    2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -804,8 +804,6 @@
</span><span class="cx">     RTTraceList* m_rtTraceList;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    std::unique_ptr<ValueProfile> noJITValueProfileSingleton;
-
</del><span class="cx">     JS_EXPORT_PRIVATE void resetDateCache();
</span><span class="cx"> 
</span><span class="cx">     RegExpCache* regExpCache() { return m_regExpCache; }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmCapabilitiesh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/wasm/WasmCapabilities.h (0 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmCapabilities.h                              (rev 0)
+++ trunk/Source/JavaScriptCore/wasm/WasmCapabilities.h 2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+/*
+ * Copyright (C) 2019 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
+
+#include "Options.h"
+#include "VM.h"
+
+namespace JSC {
+namespace Wasm {
+
+inline bool isSupported()
+{
+    return VM::canUseJIT() && Options::useWebAssembly();
+}
+
+} } // namespace JSC::Wasm
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmFaultSignalHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp (243311 => 243312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp      2019-03-21 19:09:10 UTC (rev 243311)
+++ trunk/Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp 2019-03-21 19:14:12 UTC (rev 243312)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "ExecutableAllocator.h"
</span><span class="cx"> #include "MachineContext.h"
</span><ins>+#include "WasmCapabilities.h"
</ins><span class="cx"> #include "WasmExceptionType.h"
</span><span class="cx"> #include "WasmMemory.h"
</span><span class="cx"> #include "WasmThunks.h"
</span><span class="lines">@@ -126,6 +127,9 @@
</span><span class="cx"> #if ENABLE(WEBASSEMBLY_FAST_MEMORY)
</span><span class="cx">     static std::once_flag once;
</span><span class="cx">     std::call_once(once, [] {
</span><ins>+        if (!Wasm::isSupported())
+            return;
+
</ins><span class="cx">         if (!Options::useWebAssemblyFastMemory())
</span><span class="cx">             return;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>