aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xemscripten.py2
-rw-r--r--src/settings.js3
-rw-r--r--tests/test_core.py2
3 files changed, 3 insertions, 4 deletions
diff --git a/emscripten.py b/emscripten.py
index dbea6eb2..5576baba 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -578,7 +578,7 @@ var asm = (function(global, env, buffer) {
var HEAPU32 = new global.Uint32Array(buffer);
var HEAPF32 = new global.Float32Array(buffer);
var HEAPF64 = new global.Float64Array(buffer);
-''' % (asm_setup, "'use asm';" if not forwarded_json['Types']['hasInlineJS'] and not settings['SIDE_MODULE'] else "'almost asm';") + '\n' + asm_global_vars + '''
+''' % (asm_setup, "'use asm';" if not forwarded_json['Types']['hasInlineJS'] and not settings['SIDE_MODULE'] and settings['ASM_JS'] == 1 else "'almost asm';") + '\n' + asm_global_vars + '''
var __THREW__ = 0;
var threwValue = 0;
var setjmpId = 0;
diff --git a/src/settings.js b/src/settings.js
index d2b47dc8..42e31b3a 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -410,7 +410,8 @@ var HEADLESS = 0; // If 1, will include shim code that tries to 'fake' a browser
var BENCHMARK = 0; // If 1, will just time how long main() takes to execute, and not
// print out anything at all whatsoever. This is useful for benchmarking.
-var ASM_JS = 0; // If 1, generate code in asm.js format.
+var ASM_JS = 0; // If 1, generate code in asm.js format. If 2, emits the same code except
+ // for omitting 'use asm'
var PGO = 0; // Enables profile-guided optimization in the form of runtime checks for
// which functions are actually called. Emits a list during shutdown that you
diff --git a/tests/test_core.py b/tests/test_core.py
index 0cd619b0..b2147d49 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -3814,7 +3814,6 @@ def process(filename):
self.do_run(open(path_from_root('tests', 'emscripten_get_now.cpp')).read(), 'Timer resolution is good.')
def test_inlinejs(self):
- if Settings.ASM_JS: Settings.ASM_JS = 2 # skip validation, asm does not support random code
if not self.is_le32(): return self.skip('le32 needed for inline js')
src = r'''
#include <stdio.h>
@@ -3842,7 +3841,6 @@ def process(filename):
self.do_run(src, 'Inline JS is very cool\n3.64\n') # TODO 1\n2\n3\n1\n2\n3\n')
def test_inlinejs2(self):
- if Settings.ASM_JS: Settings.ASM_JS = 2 # skip validation, asm does not support random code
if not self.is_le32(): return self.skip('le32 needed for inline js')
src = r'''
#include <stdio.h>