Trace JSOP_ENUMELEM, for the group-assignment special case of destructuring assignment (532043, r=gal).

This commit is contained in:
Brendan Eich 2009-12-02 21:50:04 -08:00
parent 9ccccbbe6b
commit 05f85209b1
2 changed files with 18 additions and 6 deletions

View File

@ -11825,11 +11825,11 @@ TraceRecorder::initOrSetPropertyByIndex(LIns* obj_ins, LIns* index_ins, jsval* r
}
JS_REQUIRES_STACK AbortableRecordingStatus
TraceRecorder::record_JSOP_SETELEM()
TraceRecorder::setElem(int lval_spindex, int idx_spindex, int v_spindex)
{
jsval& v = stackval(-1);
jsval& idx = stackval(-2);
jsval& lval = stackval(-3);
jsval& v = stackval(v_spindex);
jsval& idx = stackval(idx_spindex);
jsval& lval = stackval(lval_spindex);
if (JSVAL_IS_PRIMITIVE(lval))
RETURN_STOP_A("left JSOP_SETELEM operand is not an object");
@ -11889,6 +11889,12 @@ TraceRecorder::record_JSOP_SETELEM()
return ARECORD_CONTINUE;
}
JS_REQUIRES_STACK AbortableRecordingStatus
TraceRecorder::record_JSOP_SETELEM()
{
return setElem(-3, -2, -1);
}
JS_REQUIRES_STACK AbortableRecordingStatus
TraceRecorder::record_JSOP_CALLNAME()
{
@ -12957,7 +12963,7 @@ TraceRecorder::record_JSOP_INITPROP()
JS_REQUIRES_STACK AbortableRecordingStatus
TraceRecorder::record_JSOP_INITELEM()
{
return record_JSOP_SETELEM();
return setElem(-3, -2, -1);
}
JS_REQUIRES_STACK AbortableRecordingStatus
@ -13415,7 +13421,11 @@ TraceRecorder::record_JSOP_EVAL()
JS_REQUIRES_STACK AbortableRecordingStatus
TraceRecorder::record_JSOP_ENUMELEM()
{
return ARECORD_STOP;
/*
* To quote from jsops.cpp's JSOP_ENUMELEM case:
* Funky: the value to set is under the [obj, id] pair.
*/
return setElem(-2, -1, -3);
}
JS_REQUIRES_STACK AbortableRecordingStatus

View File

@ -1273,6 +1273,8 @@ class TraceRecorder
JS_REQUIRES_STACK RecordingStatus initOrSetPropertyByIndex(nanojit::LIns* obj_ins,
nanojit::LIns* index_ins,
jsval* rvalp, bool init);
JS_REQUIRES_STACK AbortableRecordingStatus setElem(int lval_spindex, int idx_spindex,
int v_spindex);
JS_REQUIRES_STACK nanojit::LIns* box_jsval(jsval v, nanojit::LIns* v_ins);
JS_REQUIRES_STACK nanojit::LIns* unbox_jsval(jsval v, nanojit::LIns* v_ins, VMSideExit* exit);