Fix failure to handle deep bail, and stop recording properly, in wake of bug 523452 (569843&569849, r=jorendorff).

This commit is contained in:
Brendan Eich 2010-06-03 11:08:58 -07:00
parent aa9aa411ea
commit d5e7d067e2
3 changed files with 31 additions and 5 deletions
js/src

@ -6594,7 +6594,8 @@ LeaveTree(TraceMonitor *tm, TracerState& state, VMSideExit* lr)
op == JSOP_INSTANCEOF ||
op == JSOP_ITER || op == JSOP_MOREITER || op == JSOP_ENDITER ||
op == JSOP_FORARG || op == JSOP_FORLOCAL ||
op == JSOP_FORNAME || op == JSOP_FORPROP || op == JSOP_FORELEM);
op == JSOP_FORNAME || op == JSOP_FORPROP || op == JSOP_FORELEM ||
op == JSOP_DELPROP || op == JSOP_DELELEM);
/*
* JSOP_SETELEM can be coalesced with a JSOP_POP in the interpeter.
@ -11066,17 +11067,22 @@ JS_REQUIRES_STACK AbortableRecordingStatus
TraceRecorder::record_JSOP_DELPROP()
{
jsval& lval = stackval(-1);
if (JSVAL_IS_PRIMITIVE(lval)) {
AbortRecording(cx, "JSOP_DELELEM on primitive base expression");
return ARECORD_STOP;
}
if (JSVAL_IS_PRIMITIVE(lval))
RETURN_STOP_A("JSOP_DELPROP on primitive base expression");
JSAtom* atom = atoms[GET_INDEX(cx->regs->pc)];
JS_ASSERT(ATOM_IS_STRING(atom));
enterDeepBailCall();
LIns* args[] = { INS_ATOM(atom), get(&lval), cx_ins };
LIns* rval_ins = lir->insCall(&DeleteStrKey_ci, args);
LIns* status_ins = lir->insLoad(LIR_ldi,
lirbuf->state,
offsetof(TracerState, builtinStatus), ACC_OTHER);
pendingGuardCondition = lir->insEqI_0(status_ins);
leaveDeepBailCall();
set(&lval, rval_ins);
return ARECORD_CONTINUE;
}
@ -11091,6 +11097,7 @@ TraceRecorder::record_JSOP_DELELEM()
jsval& idx = stackval(-1);
LIns* rval_ins;
enterDeepBailCall();
if (isInt32(idx)) {
LIns* args[] = { makeNumberInt32(get(&idx)), get(&lval), cx_ins };
rval_ins = lir->insCall(&DeleteIntKey_ci, args);
@ -11101,6 +11108,12 @@ TraceRecorder::record_JSOP_DELELEM()
RETURN_STOP_A("JSOP_DELELEM on non-int, non-string index");
}
LIns* status_ins = lir->insLoad(LIR_ldi,
lirbuf->state,
offsetof(TracerState, builtinStatus), ACC_OTHER);
pendingGuardCondition = lir->insEqI_0(status_ins);
leaveDeepBailCall();
set(&lval, rval_ins);
return ARECORD_CONTINUE;
}

@ -0,0 +1,4 @@
x = <x/>;
for each(l in [0, 0, 0, 0]) {
delete x.d;
}

@ -0,0 +1,9 @@
function g() {
function f(a) {
delete a.x;
}
for each(let w in [Infinity, String()]) {
let i = f(w);
}
}
g();