Emit JSOP_APPLY for .apply(...) similar to JSOP_EVAL for .eval(...) (462209, r=brendan).

This commit is contained in:
Andreas Gal
2008-10-29 13:30:41 -07:00
parent f328b2f244
commit 7b79539df3
7 changed files with 23 additions and 5 deletions

View File

@@ -213,7 +213,8 @@ js_GetVariableStackUseLength(JSOp op, jsbytecode *pc)
default:
/* stack: fun, this, [argc arguments] */
JS_ASSERT(op == JSOP_NEW || op == JSOP_CALL ||
op == JSOP_EVAL || op == JSOP_SETCALL);
op == JSOP_EVAL || op == JSOP_SETCALL ||
op == JSOP_APPLY);
return 2 + GET_ARGC(pc);
}
}
@@ -3419,6 +3420,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb, JSOp nextop)
case JSOP_NEW:
case JSOP_CALL:
case JSOP_EVAL:
case JSOP_APPLY:
#if JS_HAS_LVALUE_RETURN
case JSOP_SETCALL:
#endif
@@ -3449,7 +3451,9 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb, JSOp nextop)
op = (JSOp) ss->opcodes[ss->top-1];
lval = PopStr(ss,
(saveop == JSOP_NEW &&
(op == JSOP_CALL || op == JSOP_EVAL ||
(op == JSOP_CALL ||
op == JSOP_EVAL ||
op == JSOP_APPLY ||
(js_CodeSpec[op].format & JOF_CALLOP)))
? JSOP_NAME
: saveop);