Don't get confused by unreachable opcodes before loop headers when picking chunk boundaries, bug 781859. r=jandem

This commit is contained in:
Brian Hackett 2012-10-23 07:45:34 -07:00
parent 9381b785f3
commit a50ee02f2f
4 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,25 @@
// |jit-test| error:ReferenceError
function e() {
try {} catch (e) {
return (actual = "FAIL");
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
}
while (t) continue;
}
e();

View File

@ -0,0 +1,9 @@
mjitChunkLimit(42);
Function("\
switch (/x/) {\
case 8:\
break;\
t(function(){})\
}\
while (false)(function(){})\
")()

View File

@ -0,0 +1,10 @@
mjitChunkLimit(10);
function e() {
try {
var t = undefined;
} catch (e) { }
while (t)
continue;
}
for (var i = 0; i < 20; i++)
e();

View File

@ -704,7 +704,7 @@ MakeJITScript(JSContext *cx, JSScript *script)
Bytecode *code = analysis->maybeCode(offset);
if (!code)
continue;
op = JSOP_NOP; /* Ignore edges from unreachable opcodes. */
/* Whether this should be the last opcode in the chunk. */
bool finishChunk = false;