Title: [215517] trunk
Revision
215517
Author
[email protected]
Date
2017-04-19 10:12:37 -0700 (Wed, 19 Apr 2017)

Log Message

WebAssembly: don't expose any WebAssembly JS object if JIT is off
https://bugs.webkit.org/show_bug.cgi?id=170782

Reviewed by Saam Barati.

JSTests:

* wasm.yaml:
* wasm/noJIT/noJIT.js: Added.

Source/_javascript_Core:

It's unexpected that we expose the global WebAssembly object if no
JIT is present because it can't be used to compile or
instantiate. Other APIs such as Memory should also be Inaccessible
in those circumstances.

Also ensure that we don't pre-allocate fast memories if
WebAssembly won't be used, and don't mark our intention to use a
fast TLS slot for WebAssembly.

* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

Modified Paths

Added Paths

Diff

Modified: trunk/JSTests/ChangeLog (215516 => 215517)


--- trunk/JSTests/ChangeLog	2017-04-19 16:49:38 UTC (rev 215516)
+++ trunk/JSTests/ChangeLog	2017-04-19 17:12:37 UTC (rev 215517)
@@ -1,3 +1,13 @@
+2017-04-19  JF Bastien  <[email protected]>
+
+        WebAssembly: don't expose any WebAssembly JS object if JIT is off
+        https://bugs.webkit.org/show_bug.cgi?id=170782
+
+        Reviewed by Saam Barati.
+
+        * wasm.yaml:
+        * wasm/noJIT/noJIT.js: Added.
+
 2017-04-18  Mark Lam  <[email protected]>
 
         r211670 broke double to int conversion.

Added: trunk/JSTests/wasm/noJIT/noJIT.js (0 => 215517)


--- trunk/JSTests/wasm/noJIT/noJIT.js	                        (rev 0)
+++ trunk/JSTests/wasm/noJIT/noJIT.js	2017-04-19 17:12:37 UTC (rev 215517)
@@ -0,0 +1,2 @@
+if (typeof WebAssembly !== "undefined")
+    throw new Error("Expect WebAssembly global object is undefined if JIT is off");

Modified: trunk/JSTests/wasm.yaml (215516 => 215517)


--- trunk/JSTests/wasm.yaml	2017-04-19 16:49:38 UTC (rev 215516)
+++ trunk/JSTests/wasm.yaml	2017-04-19 17:12:37 UTC (rev 215517)
@@ -1,4 +1,4 @@
-# Copyright (C) 2016 Apple Inc. All rights reserved.
+# Copyright (C) 2016-2017 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -25,6 +25,8 @@
   cmd: runWebAssembly unless parseRunCommands
 - path: wasm/js-api/
   cmd: runWebAssembly unless parseRunCommands
+- path: wasm/noJIT/
+  cmd: runNoJIT unless parseRunCommands
 - path: wasm/function-tests
   cmd: runWebAssembly unless parseRunCommands
 - path: wasm/fuzz

Modified: trunk/Source/_javascript_Core/ChangeLog (215516 => 215517)


--- trunk/Source/_javascript_Core/ChangeLog	2017-04-19 16:49:38 UTC (rev 215516)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-04-19 17:12:37 UTC (rev 215517)
@@ -1,3 +1,22 @@
+2017-04-19  JF Bastien  <[email protected]>
+
+        WebAssembly: don't expose any WebAssembly JS object if JIT is off
+        https://bugs.webkit.org/show_bug.cgi?id=170782
+
+        Reviewed by Saam Barati.
+
+        It's unexpected that we expose the global WebAssembly object if no
+        JIT is present because it can't be used to compile or
+        instantiate. Other APIs such as Memory should also be Inaccessible
+        in those circumstances.
+
+        Also ensure that we don't pre-allocate fast memories if
+        WebAssembly won't be used, and don't mark our intention to use a
+        fast TLS slot for WebAssembly.
+
+        * runtime/Options.cpp:
+        (JSC::recomputeDependentOptions):
+
 2017-04-19  Yusuke Suzuki  <[email protected]>
 
         r211670 broke double to int conversion.

Modified: trunk/Source/_javascript_Core/runtime/Options.cpp (215516 => 215517)


--- trunk/Source/_javascript_Core/runtime/Options.cpp	2017-04-19 16:49:38 UTC (rev 215516)
+++ trunk/Source/_javascript_Core/runtime/Options.cpp	2017-04-19 17:12:37 UTC (rev 215517)
@@ -388,6 +388,15 @@
     if (!MacroAssemblerX86::supportsFloatingPoint())
         Options::useJIT() = false;
 #endif
+
+    if (!Options::useJIT())
+        Options::useWebAssembly() = false;
+
+    if (!Options::useWebAssembly()) {
+        Options::webAssemblyFastMemoryPreallocateCount() = 0;
+        Options::useWebAssemblyFastTLS() = false;
+    }
+    
     if (Options::dumpDisassembly()
         || Options::dumpDFGDisassembly()
         || Options::dumpFTLDisassembly()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to