Igor's patch for bug 433382, r=me.

This commit is contained in:
Brendan Eich
2008-05-23 23:44:08 -07:00
parent 0efa6a88cf
commit ec73d20ccf
13 changed files with 281 additions and 247 deletions

View File

@@ -75,6 +75,14 @@
# include "jsnum.h"
#endif
#include "jsautooplen.h"
/* Verify JSOP_XXX_LENGTH constant definitions. */
#define OPDEF(op,val,name,token,length,nuses,ndefs,prec,format) \
JS_STATIC_ASSERT(op##_LENGTH == length);
#include "jsopcode.tbl"
#undef OPDEF
static const char js_incop_strs[][3] = {"++", "--"};
const JSCodeSpec js_CodeSpec[] = {
@@ -2148,14 +2156,6 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb, JSOp nextop)
todo = -2;
break;
case JSOP_SWAP:
/*
* We don't generate this opcode currently, and previously we
* did not need to decompile it. If old, serialized bytecode
* uses it still, we should fall through and set todo = -2.
*/
/* FALL THROUGH */
case JSOP_GOSUB:
case JSOP_GOSUBX:
/*
@@ -4936,8 +4936,7 @@ DecompileExpression(JSContext *cx, JSScript *script, JSFunction *fun,
/* None of these stack-writing ops generates novel values. */
JS_ASSERT(op != JSOP_CASE && op != JSOP_CASEX &&
op != JSOP_DUP && op != JSOP_DUP2 &&
op != JSOP_SWAP);
op != JSOP_DUP && op != JSOP_DUP2);
/*
* |this| could convert to a very long object initialiser, so cite it by
@@ -5209,13 +5208,6 @@ ReconstructPCStack(JSContext *cx, JSScript *script, jsbytecode *pc,
pcstack[pcdepth + 3] = pcstack[pcdepth + 1];
break;
case JSOP_SWAP:
JS_ASSERT(ndefs == 2);
pc2 = pcstack[pcdepth];
pcstack[pcdepth] = pcstack[pcdepth + 1];
pcstack[pcdepth + 1] = pc2;
break;
case JSOP_LEAVEBLOCKEXPR:
/*
* The decompiler wants to see [leaveblockexpr] on pcstack, not