[JSC] Do not initialize Wasm related data if Wasm is not enabled
authorysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Feb 2019 00:18:54 +0000 (00:18 +0000)
committerysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Feb 2019 00:18:54 +0000 (00:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194728

Reviewed by Mark Lam.

Under non-JIT mode, these data structures are unnecessary. Should not allocate extra memory for that.

* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/JSLock.cpp:
(JSC::JSLock::didAcquireLock):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241630 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/InitializeThreading.cpp
Source/JavaScriptCore/runtime/JSLock.cpp

index afbce2c..7dfb610 100644 (file)
@@ -1,3 +1,17 @@
+2019-02-15  Yusuke Suzuki  <ysuzuki@apple.com>
+
+        [JSC] Do not initialize Wasm related data if Wasm is not enabled
+        https://bugs.webkit.org/show_bug.cgi?id=194728
+
+        Reviewed by Mark Lam.
+
+        Under non-JIT mode, these data structures are unnecessary. Should not allocate extra memory for that.
+
+        * runtime/InitializeThreading.cpp:
+        (JSC::initializeThreading):
+        * runtime/JSLock.cpp:
+        (JSC::JSLock::didAcquireLock):
+
 2019-02-15  Ross Kirsling  <ross.kirsling@sony.com>
 
         [WTF] Add environment variable helpers
index 50a8052..2522ffd 100644 (file)
@@ -81,7 +81,8 @@ void initializeThreading()
         thread.setSavedLastStackTop(thread.stack().origin());
 
 #if ENABLE(WEBASSEMBLY)
-        Wasm::Thunks::initialize();
+        if (Options::useWebAssembly())
+            Wasm::Thunks::initialize();
 #endif
 
         if (VM::isInMiniMode())
index 35d590b..ece526d 100644 (file)
@@ -149,7 +149,8 @@ void JSLock::didAcquireLock()
 
     m_vm->heap.machineThreads().addCurrentThread();
 #if ENABLE(WEBASSEMBLY)
-    Wasm::startTrackingCurrentThread();
+    if (Options::useWebAssembly())
+        Wasm::startTrackingCurrentThread();
 #endif
 
 #if HAVE(MACH_EXCEPTIONS)