mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 825966 part 2 - Mark JSOP_CASE/JSOP_DEFAULT targets as safepoint. r=bhackett
This commit is contained in:
parent
e31b84cd0b
commit
e8ac71ce39
18
js/src/jit-test/tests/jaeger/bug825966.js
Normal file
18
js/src/jit-test/tests/jaeger/bug825966.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
datediff = function(date1, date2, interval) {
|
||||||
|
var delta = 1;
|
||||||
|
switch(interval) {
|
||||||
|
case "day":
|
||||||
|
delta /= 24;
|
||||||
|
case "minute":
|
||||||
|
delta /= 60;
|
||||||
|
case Math:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return delta;
|
||||||
|
};
|
||||||
|
|
||||||
|
var diff = datediff(new Date("2012-04-28T14:30:00Z"), new Date("2012-04-29T14:30:00Z"), "day");
|
||||||
|
for (var i = 0; i < 50; i++) {
|
||||||
|
diff = datediff(new Date("2012-04-28T17:00:00Z"), new Date("2012-04-28T17:30:00Z"), "minute");
|
||||||
|
assertEq(diff, 1/60);
|
||||||
|
}
|
@ -600,21 +600,17 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
|
|||||||
|
|
||||||
/* Check basic jump opcodes, which may or may not have a fallthrough. */
|
/* Check basic jump opcodes, which may or may not have a fallthrough. */
|
||||||
if (jump) {
|
if (jump) {
|
||||||
/* Some opcodes behave differently on their branching path. */
|
|
||||||
unsigned newStackDepth = stackDepth;
|
|
||||||
|
|
||||||
switch (op) {
|
|
||||||
case JSOP_CASE:
|
|
||||||
/* Case instructions do not push the lvalue back when branching. */
|
/* Case instructions do not push the lvalue back when branching. */
|
||||||
|
unsigned newStackDepth = stackDepth;
|
||||||
|
if (op == JSOP_CASE)
|
||||||
newStackDepth--;
|
newStackDepth--;
|
||||||
break;
|
|
||||||
|
|
||||||
default:;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned targetOffset = offset + GET_JUMP_OFFSET(pc);
|
unsigned targetOffset = offset + GET_JUMP_OFFSET(pc);
|
||||||
if (!addJump(cx, targetOffset, &nextOffset, &forwardJump, &forwardLoop, newStackDepth))
|
if (!addJump(cx, targetOffset, &nextOffset, &forwardJump, &forwardLoop, newStackDepth))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (op == JSOP_CASE || op == JSOP_DEFAULT)
|
||||||
|
getCode(targetOffset).safePoint = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle any fallthrough from this opcode. */
|
/* Handle any fallthrough from this opcode. */
|
||||||
|
Loading…
Reference in New Issue
Block a user