From 829909fca2627eeeb1fc5e5268a7bcb8eb5ea7d1 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Tue, 29 Apr 2014 21:57:36 -0700 Subject: [PATCH] Bug 1002797 - Cancel off-thread Ion compilation when doing debug mode OSR. (r=jandem) --- js/src/jit-test/tests/debug/bug1002797.js | 15 +++++++++++++++ js/src/jit/BaselineDebugModeOSR.cpp | 2 ++ 2 files changed, 17 insertions(+) create mode 100644 js/src/jit-test/tests/debug/bug1002797.js diff --git a/js/src/jit-test/tests/debug/bug1002797.js b/js/src/jit-test/tests/debug/bug1002797.js new file mode 100644 index 000000000000..f7cbcfccf72c --- /dev/null +++ b/js/src/jit-test/tests/debug/bug1002797.js @@ -0,0 +1,15 @@ +var lfcode = new Array(); +lfcode.push(""); +lfcode.push("0"); +lfcode.push("newGlobal(\"1\").eval(\"(new Debugger).addAllGlobalsAsDebuggees();\");\n"); +while (true) { + var file = lfcode.shift(); if (file == undefined) { break; } + loadFile(file) +} +function loadFile(lfVarx) { + try { + if (lfVarx.substr(-3) != ".js" && lfVarx.length != 1) { + evaluate(lfVarx); + } else if (!isNaN(lfVarx)) {} + } catch (lfVare) { } +} diff --git a/js/src/jit/BaselineDebugModeOSR.cpp b/js/src/jit/BaselineDebugModeOSR.cpp index de0e8e668a52..01a64284e3e1 100644 --- a/js/src/jit/BaselineDebugModeOSR.cpp +++ b/js/src/jit/BaselineDebugModeOSR.cpp @@ -413,6 +413,8 @@ RecompileBaselineScriptForDebugMode(JSContext *cx, JSScript *script) IonSpew(IonSpew_BaselineDebugModeOSR, "Recompiling (%s:%d) for debug mode %s", script->filename(), script->lineno(), expectedDebugMode ? "ON" : "OFF"); + CancelOffThreadIonCompile(cx->compartment(), script); + if (script->hasIonScript()) Invalidate(cx, script, /* resetUses = */ false);