diff --git a/js/src/jit-test/lib/asm.js b/js/src/jit-test/lib/asm.js index b73f5f5cbd27..fe40b6934ba2 100644 --- a/js/src/jit-test/lib/asm.js +++ b/js/src/jit-test/lib/asm.js @@ -34,7 +34,7 @@ function asmCompileCached() var quotedArgs = []; for (var i = 0; i < arguments.length; i++) quotedArgs.push("'" + arguments[i] + "'"); - var code = "var f = new Function(" + quotedArgs.join(',') + ");assertEq(isAsmJSModule(f), true);"; + var code = "setCachingEnabled(true); var f = new Function(" + quotedArgs.join(',') + ");assertEq(isAsmJSModule(f), true);"; nestedShell("--js-cache", "--no-js-cache-per-process", "--execute=" + code); var f = Function.apply(null, arguments); diff --git a/js/src/jit-test/tests/asm.js/testBullet.js b/js/src/jit-test/tests/asm.js/testBullet.js index af51081f282f..64a6377e77c4 100644 --- a/js/src/jit-test/tests/asm.js/testBullet.js +++ b/js/src/jit-test/tests/asm.js/testBullet.js @@ -2,6 +2,7 @@ // separate process and then load it again in this process, which should be a // cache hit. +setCachingEnabled(true); if (!isAsmJSCompilationAvailable()) quit(); @@ -9,7 +10,7 @@ if (!isAsmJSCompilationAvailable()) // bullet.js and not the nestedShell() call, so try first commenting out // nestedShell() (and the loadedFromCache assertion) to see if the error // reproduces. -var code = "setIonCheckGraphCoherency(false); load('" + libdir + "bullet.js'); runBullet()"; +var code = "setIonCheckGraphCoherency(false); setCachingEnabled(true); load('" + libdir + "bullet.js'); runBullet()"; nestedShell("--js-cache", "--no-js-cache-per-process", "--execute=" + code); setIonCheckGraphCoherency(false); load(libdir + 'bullet.js'); diff --git a/js/src/jit-test/tests/asm.js/testCaching.js b/js/src/jit-test/tests/asm.js/testCaching.js index 54469852957f..8cd3de6d7b13 100644 --- a/js/src/jit-test/tests/asm.js/testCaching.js +++ b/js/src/jit-test/tests/asm.js/testCaching.js @@ -1,5 +1,6 @@ load(libdir + "asm.js"); +setCachingEnabled(true); if (!isAsmJSCompilationAvailable() || !isCachingEnabled()) quit(); diff --git a/js/src/jit-test/tests/asm.js/testHeapAccess.js b/js/src/jit-test/tests/asm.js/testHeapAccess.js index 094ef8b04446..06d1a6848406 100644 --- a/js/src/jit-test/tests/asm.js/testHeapAccess.js +++ b/js/src/jit-test/tests/asm.js/testHeapAccess.js @@ -15,6 +15,8 @@ var code = asmCompile('glob', 'imp', 'b', USE_ASM + HEAP_IMPORTS + 'function f(i var f = asmLink(code, this, null, new ArrayBuffer(4096)); assertEq(f(0), 0); +setCachingEnabled(true); + var code = asmCompile('glob', 'imp', 'b', USE_ASM + HEAP_IMPORTS + 'function f(i) {i=i|0; i32[0] = i; return i8[0]|0}; return f'); var f = asmLink(code, this, null, new ArrayBuffer(4096)); assertEq(f(0),0); @@ -49,6 +51,8 @@ assertEq(f(0x100),0); assertEq(signalHandlersBefore, signalHandlersAfter); })(); +setCachingEnabled(false); + var code = asmCompile('glob', 'imp', 'b', USE_ASM + HEAP_IMPORTS + 'function f(i) {i=i|0; i32[0] = i; return u8[0]|0}; return f'); var f = asmLink(code, this, null, new ArrayBuffer(4096)); assertEq(f(0),0); diff --git a/js/src/jit-test/tests/asm.js/testSource.js b/js/src/jit-test/tests/asm.js/testSource.js index 0e671ce9d909..d5b885d1816a 100644 --- a/js/src/jit-test/tests/asm.js/testSource.js +++ b/js/src/jit-test/tests/asm.js/testSource.js @@ -1,3 +1,5 @@ +setCachingEnabled(true); + (function() { /* * NO ARGUMENT diff --git a/js/src/jit-test/tests/asm.js/testStackWalking.js b/js/src/jit-test/tests/asm.js/testStackWalking.js index 719994b78d00..f3787ab92436 100644 --- a/js/src/jit-test/tests/asm.js/testStackWalking.js +++ b/js/src/jit-test/tests/asm.js/testStackWalking.js @@ -20,6 +20,7 @@ function dumpStack() setJitCompilerOption("ion.usecount.trigger", 10); setJitCompilerOption("baseline.usecount.trigger", 0); setJitCompilerOption("offthread-compilation.enable", 0); +setCachingEnabled(true); var callFFI = asmCompile('global', 'ffis', USE_ASM + "var ffi=ffis.ffi; function f() { return ffi()|0 } return f"); diff --git a/js/src/jit-test/tests/asm.js/testTimeout-deactivate-reactivate-signals.js b/js/src/jit-test/tests/asm.js/testTimeout-deactivate-reactivate-signals.js index 4240441609a1..955d32ca9b1c 100644 --- a/js/src/jit-test/tests/asm.js/testTimeout-deactivate-reactivate-signals.js +++ b/js/src/jit-test/tests/asm.js/testTimeout-deactivate-reactivate-signals.js @@ -2,6 +2,8 @@ load(libdir + "asm.js"); +setCachingEnabled(true); + var jco = getJitCompilerOptions(); if (jco["signals.enable"] === 0 || !isCachingEnabled() || !isAsmJSCompilationAvailable()) quit(6); diff --git a/js/src/jit-test/tests/latin1/asm.js b/js/src/jit-test/tests/latin1/asm.js index 0026d3a865bc..ace4e7f52c41 100644 --- a/js/src/jit-test/tests/latin1/asm.js +++ b/js/src/jit-test/tests/latin1/asm.js @@ -1,5 +1,6 @@ load(libdir + "asm.js"); +setCachingEnabled(true); if (!isAsmJSCompilationAvailable() || !isCachingEnabled()) quit(); diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 878b36f43fd4..5e33e14902ca 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -130,7 +130,7 @@ static bool enableDisassemblyDumps = false; static bool printTiming = false; static const char *jsCacheDir = nullptr; static const char *jsCacheAsmJSPath = nullptr; -static bool jsCachingEnabled = true; +static bool jsCachingEnabled = false; mozilla::Atomic jsCacheOpened(false); static bool