[Bug 433382] More efficient interpreter switch when computed goto is not available. r=brendan

This commit is contained in:
Igor Bukanov
2008-06-20 09:36:56 +02:00
parent f3ccee58c8
commit 46a8d347ba
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[] = {
@@ -2152,14 +2160,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:
/*
@@ -4993,8 +4993,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
@@ -5274,13 +5273,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