зеркало из https://github.com/mozilla/gecko-dev.git
Bug 872813 - Remove decomposing opcodes. r=luke
This commit is contained in:
Родитель
224c6db112
Коммит
2fc978b16c
|
@ -196,14 +196,6 @@ UpdateDepth(JSContext *cx, BytecodeEmitter *bce, ptrdiff_t target)
|
|||
bce->maxStackDepth = bce->stackDepth;
|
||||
}
|
||||
|
||||
static inline void
|
||||
UpdateDecomposeLength(BytecodeEmitter *bce, unsigned start)
|
||||
{
|
||||
unsigned end = bce->offset();
|
||||
JS_ASSERT(unsigned(end - start) < 256);
|
||||
bce->code(start)[-1] = end - start;
|
||||
}
|
||||
|
||||
ptrdiff_t
|
||||
frontend::Emit1(JSContext *cx, BytecodeEmitter *bce, JSOp op)
|
||||
{
|
||||
|
@ -767,30 +759,6 @@ EmitAtomOp(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
|||
return EmitAtomOp(cx, pn->pn_atom, op, bce);
|
||||
}
|
||||
|
||||
static bool
|
||||
EmitAtomIncDec(JSContext *cx, JSAtom *atom, JSOp op, BytecodeEmitter *bce)
|
||||
{
|
||||
JS_ASSERT(JOF_OPTYPE(op) == JOF_ATOM);
|
||||
JS_ASSERT(js_CodeSpec[op].format & (JOF_INC | JOF_DEC));
|
||||
|
||||
jsatomid index;
|
||||
if (!bce->makeAtomIndex(atom, &index))
|
||||
return false;
|
||||
|
||||
const size_t len = 1 + UINT32_INDEX_LEN + 1;
|
||||
JS_ASSERT(size_t(js_CodeSpec[op].length) == len);
|
||||
ptrdiff_t offset = EmitCheck(cx, bce, len);
|
||||
if (offset < 0)
|
||||
return false;
|
||||
|
||||
jsbytecode *code = bce->code(offset);
|
||||
code[0] = jsbytecode(op);
|
||||
SET_UINT32_INDEX(code, index);
|
||||
UpdateDepth(cx, bce, offset);
|
||||
CheckTypeSet(cx, bce, op);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
EmitObjectOp(JSContext *cx, ObjectBox *objbox, JSOp op, BytecodeEmitter *bce)
|
||||
{
|
||||
|
@ -831,8 +799,7 @@ EmitAliasedVarOp(JSContext *cx, JSOp op, ScopeCoordinate sc, BytecodeEmitter *bc
|
|||
if (bce->blockChain)
|
||||
maybeBlockIndex = bce->objectList.indexOf(bce->blockChain);
|
||||
|
||||
bool decomposed = js_CodeSpec[op].format & JOF_DECOMPOSE;
|
||||
unsigned n = 2 * sizeof(uint16_t) + sizeof(uint32_t) + (decomposed ? 1 : 0);
|
||||
unsigned n = 2 * sizeof(uint16_t) + sizeof(uint32_t);
|
||||
JS_ASSERT(int(n) + 1 /* op */ == js_CodeSpec[op].length);
|
||||
|
||||
ptrdiff_t off = EmitN(cx, bce, op, n);
|
||||
|
@ -950,39 +917,35 @@ EmitVarOp(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
|||
case JSOP_GETARG: case JSOP_GETLOCAL: op = JSOP_GETALIASEDVAR; break;
|
||||
case JSOP_SETARG: case JSOP_SETLOCAL: op = JSOP_SETALIASEDVAR; break;
|
||||
case JSOP_CALLARG: case JSOP_CALLLOCAL: op = JSOP_CALLALIASEDVAR; break;
|
||||
case JSOP_INCARG: case JSOP_INCLOCAL: op = JSOP_INCALIASEDVAR; break;
|
||||
case JSOP_ARGINC: case JSOP_LOCALINC: op = JSOP_ALIASEDVARINC; break;
|
||||
case JSOP_DECARG: case JSOP_DECLOCAL: op = JSOP_DECALIASEDVAR; break;
|
||||
case JSOP_ARGDEC: case JSOP_LOCALDEC: op = JSOP_ALIASEDVARDEC; break;
|
||||
default: JS_NOT_REACHED("unexpected var op");
|
||||
}
|
||||
|
||||
return EmitAliasedVarOp(cx, op, pn, bce);
|
||||
}
|
||||
|
||||
static bool
|
||||
EmitVarIncDec(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
||||
static JSOp
|
||||
GetIncDecInfo(ParseNodeKind kind, bool *post)
|
||||
{
|
||||
JS_ASSERT(pn->isKind(PNK_NAME));
|
||||
JS_ASSERT(IsArgOp(op) || IsLocalOp(op));
|
||||
JS_ASSERT(js_CodeSpec[op].format & (JOF_INC | JOF_DEC));
|
||||
JS_ASSERT(!pn->pn_cookie.isFree());
|
||||
JS_ASSERT(kind == PNK_POSTINCREMENT || kind == PNK_PREINCREMENT ||
|
||||
kind == PNK_POSTDECREMENT || kind == PNK_PREDECREMENT);
|
||||
*post = kind == PNK_POSTINCREMENT || kind == PNK_POSTDECREMENT;
|
||||
return (kind == PNK_POSTINCREMENT || kind == PNK_PREINCREMENT) ? JSOP_ADD : JSOP_SUB;
|
||||
}
|
||||
|
||||
if (!EmitVarOp(cx, pn, op, bce))
|
||||
return false;
|
||||
static bool
|
||||
EmitVarIncDec(JSContext *cx, ParseNode *pn, BytecodeEmitter *bce)
|
||||
{
|
||||
JSOp op = pn->pn_kid->getOp();
|
||||
JS_ASSERT(IsLocalOp(op) || IsArgOp(op));
|
||||
JS_ASSERT(pn->pn_kid->isKind(PNK_NAME));
|
||||
JS_ASSERT(!pn->pn_kid->pn_cookie.isFree());
|
||||
|
||||
/* Remove the result to restore the stack depth before the INCALIASEDVAR. */
|
||||
bce->stackDepth--;
|
||||
|
||||
int start = bce->offset();
|
||||
|
||||
const JSCodeSpec &cs = js_CodeSpec[op];
|
||||
bool post = (cs.format & JOF_POST);
|
||||
JSOp binop = (cs.format & JOF_INC) ? JSOP_ADD : JSOP_SUB;
|
||||
bool post;
|
||||
JSOp binop = GetIncDecInfo(pn->getKind(), &post);
|
||||
JSOp getOp = IsLocalOp(op) ? JSOP_GETLOCAL : JSOP_GETARG;
|
||||
JSOp setOp = IsLocalOp(op) ? JSOP_SETLOCAL : JSOP_SETARG;
|
||||
|
||||
if (!EmitVarOp(cx, pn, getOp, bce)) // V
|
||||
if (!EmitVarOp(cx, pn->pn_kid, getOp, bce)) // V
|
||||
return false;
|
||||
if (Emit1(cx, bce, JSOP_POS) < 0) // N
|
||||
return false;
|
||||
|
@ -992,12 +955,11 @@ EmitVarIncDec(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
|||
return false;
|
||||
if (Emit1(cx, bce, binop) < 0) // N? N+1
|
||||
return false;
|
||||
if (!EmitVarOp(cx, pn, setOp, bce)) // N? N+1
|
||||
if (!EmitVarOp(cx, pn->pn_kid, setOp, bce)) // N? N+1
|
||||
return false;
|
||||
if (post && Emit1(cx, bce, JSOP_POP) < 0) // RESULT
|
||||
return false;
|
||||
|
||||
UpdateDecomposeLength(bce, start);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1161,10 +1123,6 @@ TryConvertToGname(BytecodeEmitter *bce, ParseNode *pn, JSOp *op)
|
|||
switch (*op) {
|
||||
case JSOP_NAME: *op = JSOP_GETGNAME; break;
|
||||
case JSOP_SETNAME: *op = JSOP_SETGNAME; break;
|
||||
case JSOP_INCNAME: *op = JSOP_INCGNAME; break;
|
||||
case JSOP_NAMEINC: *op = JSOP_GNAMEINC; break;
|
||||
case JSOP_DECNAME: *op = JSOP_DECGNAME; break;
|
||||
case JSOP_NAMEDEC: *op = JSOP_GNAMEDEC; break;
|
||||
case JSOP_SETCONST:
|
||||
/* Not supported. */
|
||||
return false;
|
||||
|
@ -1318,10 +1276,6 @@ BindNameToSlotHelper(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
|||
switch (op) {
|
||||
case JSOP_NAME: op = JSOP_GETARG; break;
|
||||
case JSOP_SETNAME: op = JSOP_SETARG; break;
|
||||
case JSOP_INCNAME: op = JSOP_INCARG; break;
|
||||
case JSOP_NAMEINC: op = JSOP_ARGINC; break;
|
||||
case JSOP_DECNAME: op = JSOP_DECARG; break;
|
||||
case JSOP_NAMEDEC: op = JSOP_ARGDEC; break;
|
||||
default: JS_NOT_REACHED("arg");
|
||||
}
|
||||
JS_ASSERT(!pn->isConst());
|
||||
|
@ -1334,10 +1288,6 @@ BindNameToSlotHelper(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
|||
case JSOP_NAME: op = JSOP_GETLOCAL; break;
|
||||
case JSOP_SETNAME: op = JSOP_SETLOCAL; break;
|
||||
case JSOP_SETCONST: op = JSOP_SETLOCAL; break;
|
||||
case JSOP_INCNAME: op = JSOP_INCLOCAL; break;
|
||||
case JSOP_NAMEINC: op = JSOP_LOCALINC; break;
|
||||
case JSOP_DECNAME: op = JSOP_DECLOCAL; break;
|
||||
case JSOP_NAMEDEC: op = JSOP_LOCALDEC; break;
|
||||
default: JS_NOT_REACHED("local");
|
||||
}
|
||||
break;
|
||||
|
@ -1820,19 +1770,15 @@ EmitElemOpBase(JSContext *cx, BytecodeEmitter *bce, JSOp op)
|
|||
}
|
||||
|
||||
static bool
|
||||
EmitPropOp(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce, bool callContext)
|
||||
EmitPropLHS(JSContext *cx, ParseNode *pn, JSOp *op, BytecodeEmitter *bce, bool callContext)
|
||||
{
|
||||
ParseNode *pn2, *pndot, *pnup, *pndown;
|
||||
ptrdiff_t top;
|
||||
|
||||
JS_ASSERT(pn->isArity(PN_NAME));
|
||||
pn2 = pn->maybeExpr();
|
||||
ParseNode *pn2 = pn->maybeExpr();
|
||||
|
||||
if (callContext) {
|
||||
JS_ASSERT(pn->isKind(PNK_DOT));
|
||||
JS_ASSERT(op == JSOP_GETPROP);
|
||||
op = JSOP_CALLPROP;
|
||||
} else if (op == JSOP_GETPROP && pn->isKind(PNK_DOT)) {
|
||||
JS_ASSERT(*op == JSOP_GETPROP);
|
||||
*op = JSOP_CALLPROP;
|
||||
} else if (*op == JSOP_GETPROP && pn->isKind(PNK_DOT)) {
|
||||
if (pn2->isKind(PNK_NAME)) {
|
||||
if (!BindNameToSlot(cx, bce, pn2))
|
||||
return false;
|
||||
|
@ -1845,9 +1791,9 @@ EmitPropOp(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce, bool cal
|
|||
* bottom up (reversing again as we go), to avoid excessive recursion.
|
||||
*/
|
||||
if (pn2->isKind(PNK_DOT)) {
|
||||
pndot = pn2;
|
||||
pnup = NULL;
|
||||
top = bce->offset();
|
||||
ParseNode *pndot = pn2;
|
||||
ParseNode *pnup = NULL, *pndown;
|
||||
ptrdiff_t top = bce->offset();
|
||||
for (;;) {
|
||||
/* Reverse pndot->pn_expr to point up, not down. */
|
||||
pndot->pn_offset = top;
|
||||
|
@ -1878,6 +1824,17 @@ EmitPropOp(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce, bool cal
|
|||
if (!EmitTree(cx, bce, pn2))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
EmitPropOp(JSContext *cx, ParseNode *pn, JSOp requested, BytecodeEmitter *bce, bool callContext)
|
||||
{
|
||||
JS_ASSERT(pn->isArity(PN_NAME));
|
||||
|
||||
JSOp op = requested;
|
||||
if (!EmitPropLHS(cx, pn, &op, bce, callContext))
|
||||
return false;
|
||||
|
||||
if (op == JSOP_CALLPROP && Emit1(cx, bce, JSOP_DUP) < 0)
|
||||
return false;
|
||||
|
@ -1895,28 +1852,20 @@ EmitPropOp(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce, bool cal
|
|||
}
|
||||
|
||||
static bool
|
||||
EmitPropIncDec(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
||||
EmitPropIncDec(JSContext *cx, ParseNode *pn, BytecodeEmitter *bce)
|
||||
{
|
||||
if (!EmitPropOp(cx, pn, op, bce, false))
|
||||
JS_ASSERT(pn->pn_kid->getKind() == PNK_DOT);
|
||||
|
||||
bool post;
|
||||
JSOp binop = GetIncDecInfo(pn->getKind(), &post);
|
||||
|
||||
JSOp get = JSOP_GETPROP;
|
||||
if (!EmitPropLHS(cx, pn->pn_kid, &get, bce, false)) // OBJ
|
||||
return false;
|
||||
|
||||
/*
|
||||
* The stack is the same depth before/after INCPROP, so no balancing to do
|
||||
* before the decomposed version.
|
||||
*/
|
||||
int start = bce->offset();
|
||||
|
||||
const JSCodeSpec *cs = &js_CodeSpec[op];
|
||||
JS_ASSERT(cs->format & JOF_PROP);
|
||||
JS_ASSERT(cs->format & (JOF_INC | JOF_DEC));
|
||||
|
||||
bool post = (cs->format & JOF_POST);
|
||||
JSOp binop = (cs->format & JOF_INC) ? JSOP_ADD : JSOP_SUB;
|
||||
|
||||
// OBJ
|
||||
JS_ASSERT(get == JSOP_GETPROP);
|
||||
if (Emit1(cx, bce, JSOP_DUP) < 0) // OBJ OBJ
|
||||
return false;
|
||||
if (!EmitAtomOp(cx, pn, JSOP_GETPROP, bce)) // OBJ V
|
||||
if (!EmitAtomOp(cx, pn->pn_kid, JSOP_GETPROP, bce)) // OBJ V
|
||||
return false;
|
||||
if (Emit1(cx, bce, JSOP_POS) < 0) // OBJ N
|
||||
return false;
|
||||
|
@ -1934,39 +1883,26 @@ EmitPropIncDec(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!EmitAtomOp(cx, pn, JSOP_SETPROP, bce)) // N? N+1
|
||||
if (!EmitAtomOp(cx, pn->pn_kid, JSOP_SETPROP, bce)) // N? N+1
|
||||
return false;
|
||||
if (post && Emit1(cx, bce, JSOP_POP) < 0) // RESULT
|
||||
return false;
|
||||
|
||||
UpdateDecomposeLength(bce, start);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
EmitNameIncDec(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
||||
EmitNameIncDec(JSContext *cx, ParseNode *pn, BytecodeEmitter *bce)
|
||||
{
|
||||
/* Emit the composite op, including the slack byte at the end. */
|
||||
if (!EmitAtomIncDec(cx, pn->pn_atom, op, bce))
|
||||
return false;
|
||||
|
||||
/* Remove the result to restore the stack depth before the INCNAME. */
|
||||
bce->stackDepth--;
|
||||
|
||||
int start = bce->offset();
|
||||
|
||||
const JSCodeSpec *cs = &js_CodeSpec[op];
|
||||
JS_ASSERT((cs->format & JOF_NAME) || (cs->format & JOF_GNAME));
|
||||
JS_ASSERT(cs->format & (JOF_INC | JOF_DEC));
|
||||
const JSCodeSpec *cs = &js_CodeSpec[pn->pn_kid->getOp()];
|
||||
|
||||
bool global = (cs->format & JOF_GNAME);
|
||||
bool post = (cs->format & JOF_POST);
|
||||
JSOp binop = (cs->format & JOF_INC) ? JSOP_ADD : JSOP_SUB;
|
||||
bool post;
|
||||
JSOp binop = GetIncDecInfo(pn->getKind(), &post);
|
||||
|
||||
if (!EmitAtomOp(cx, pn, global ? JSOP_BINDGNAME : JSOP_BINDNAME, bce)) // OBJ
|
||||
if (!EmitAtomOp(cx, pn->pn_kid, global ? JSOP_BINDGNAME : JSOP_BINDNAME, bce)) // OBJ
|
||||
return false;
|
||||
if (!EmitAtomOp(cx, pn, global ? JSOP_GETGNAME : JSOP_NAME, bce)) // OBJ V
|
||||
if (!EmitAtomOp(cx, pn->pn_kid, global ? JSOP_GETGNAME : JSOP_NAME, bce)) // OBJ V
|
||||
return false;
|
||||
if (Emit1(cx, bce, JSOP_POS) < 0) // OBJ N
|
||||
return false;
|
||||
|
@ -1984,18 +1920,16 @@ EmitNameIncDec(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!EmitAtomOp(cx, pn, global ? JSOP_SETGNAME : JSOP_SETNAME, bce)) // N? N+1
|
||||
if (!EmitAtomOp(cx, pn->pn_kid, global ? JSOP_SETGNAME : JSOP_SETNAME, bce)) // N? N+1
|
||||
return false;
|
||||
if (post && Emit1(cx, bce, JSOP_POP) < 0) // RESULT
|
||||
return false;
|
||||
|
||||
UpdateDecomposeLength(bce, start);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
EmitElemOp(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
||||
EmitElemOperands(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
||||
{
|
||||
ParseNode *left, *right;
|
||||
|
||||
|
@ -2041,33 +1975,26 @@ EmitElemOp(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
|||
|
||||
if (!EmitTree(cx, bce, right))
|
||||
return false;
|
||||
return EmitElemOpBase(cx, bce, op);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
EmitElemIncDec(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
||||
EmitElemOp(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
||||
{
|
||||
if (pn) {
|
||||
if (!EmitElemOp(cx, pn, op, bce))
|
||||
return false;
|
||||
} else {
|
||||
if (!EmitElemOpBase(cx, bce, op))
|
||||
return false;
|
||||
}
|
||||
if (Emit1(cx, bce, JSOP_NOP) < 0)
|
||||
return EmitElemOperands(cx, pn, op, bce) && EmitElemOpBase(cx, bce, op);
|
||||
}
|
||||
|
||||
static bool
|
||||
EmitElemIncDec(JSContext *cx, ParseNode *pn, BytecodeEmitter *bce)
|
||||
{
|
||||
JS_ASSERT(pn->pn_kid->getKind() == PNK_ELEM);
|
||||
|
||||
if (!EmitElemOperands(cx, pn->pn_kid, JSOP_GETELEM, bce))
|
||||
return false;
|
||||
|
||||
/* INCELEM pops two values and pushes one, so restore the initial depth. */
|
||||
bce->stackDepth++;
|
||||
|
||||
int start = bce->offset();
|
||||
|
||||
const JSCodeSpec *cs = &js_CodeSpec[op];
|
||||
JS_ASSERT(cs->format & JOF_ELEM);
|
||||
JS_ASSERT(cs->format & (JOF_INC | JOF_DEC));
|
||||
|
||||
bool post = (cs->format & JOF_POST);
|
||||
JSOp binop = (cs->format & JOF_INC) ? JSOP_ADD : JSOP_SUB;
|
||||
bool post;
|
||||
JSOp binop = GetIncDecInfo(pn->getKind(), &post);
|
||||
|
||||
/*
|
||||
* We need to convert the key to an object id first, so that we do not do
|
||||
|
@ -2103,8 +2030,6 @@ EmitElemIncDec(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
|||
if (post && Emit1(cx, bce, JSOP_POP) < 0) // RESULT
|
||||
return false;
|
||||
|
||||
UpdateDecomposeLength(bce, start);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -5111,45 +5036,44 @@ EmitIncOrDec(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
|||
{
|
||||
/* Emit lvalue-specialized code for ++/-- operators. */
|
||||
ParseNode *pn2 = pn->pn_kid;
|
||||
JSOp op = pn->getOp();
|
||||
switch (pn2->getKind()) {
|
||||
case PNK_DOT:
|
||||
if (!EmitPropIncDec(cx, pn2, op, bce))
|
||||
if (!EmitPropIncDec(cx, pn, bce))
|
||||
return false;
|
||||
break;
|
||||
case PNK_ELEM:
|
||||
if (!EmitElemIncDec(cx, pn2, op, bce))
|
||||
if (!EmitElemIncDec(cx, pn, bce))
|
||||
return false;
|
||||
break;
|
||||
case PNK_CALL:
|
||||
if (!EmitTree(cx, bce, pn2))
|
||||
return false;
|
||||
if (Emit1(cx, bce, op) < 0)
|
||||
return false;
|
||||
/*
|
||||
* This is dead code for the decompiler, don't generate
|
||||
* a decomposed version of the opcode. We do need to balance
|
||||
* the stacks in the decomposed version.
|
||||
*/
|
||||
JS_ASSERT(js_CodeSpec[op].format & JOF_DECOMPOSE);
|
||||
JS_ASSERT(js_CodeSpec[op].format & JOF_ELEM);
|
||||
if (Emit1(cx, bce, (JSOp)1) < 0)
|
||||
return false;
|
||||
if (Emit1(cx, bce, JSOP_POP) < 0)
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
JS_ASSERT(pn2->isKind(PNK_NAME));
|
||||
pn2->setOp(op);
|
||||
pn2->setOp(JSOP_SETNAME);
|
||||
if (!BindNameToSlot(cx, bce, pn2))
|
||||
return false;
|
||||
op = pn2->getOp();
|
||||
JSOp op = pn2->getOp();
|
||||
bool maySet;
|
||||
switch (op) {
|
||||
case JSOP_SETLOCAL:
|
||||
case JSOP_SETARG:
|
||||
case JSOP_SETNAME:
|
||||
case JSOP_SETGNAME:
|
||||
maySet = true;
|
||||
break;
|
||||
default:
|
||||
maySet = false;
|
||||
}
|
||||
if (op == JSOP_CALLEE) {
|
||||
if (Emit1(cx, bce, op) < 0)
|
||||
return false;
|
||||
} else if (!pn2->pn_cookie.isFree()) {
|
||||
if (js_CodeSpec[op].format & (JOF_INC | JOF_DEC)) {
|
||||
if (!EmitVarIncDec(cx, pn2, op, bce))
|
||||
if (maySet) {
|
||||
if (!EmitVarIncDec(cx, pn, bce))
|
||||
return false;
|
||||
} else {
|
||||
if (!EmitVarOp(cx, pn2, op, bce))
|
||||
|
@ -5157,8 +5081,8 @@ EmitIncOrDec(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
|||
}
|
||||
} else {
|
||||
JS_ASSERT(JOF_OPTYPE(op) == JOF_ATOM);
|
||||
if (js_CodeSpec[op].format & (JOF_INC | JOF_DEC)) {
|
||||
if (!EmitNameIncDec(cx, pn2, op, bce))
|
||||
if (maySet) {
|
||||
if (!EmitNameIncDec(cx, pn, bce))
|
||||
return false;
|
||||
} else {
|
||||
if (!EmitAtomOp(cx, pn2, op, bce))
|
||||
|
@ -5169,12 +5093,12 @@ EmitIncOrDec(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
|||
if (pn2->isConst()) {
|
||||
if (Emit1(cx, bce, JSOP_POS) < 0)
|
||||
return false;
|
||||
op = pn->getOp();
|
||||
if (!(js_CodeSpec[op].format & JOF_POST)) {
|
||||
bool post;
|
||||
JSOp binop = GetIncDecInfo(pn->getKind(), &post);
|
||||
if (!post) {
|
||||
if (Emit1(cx, bce, JSOP_ONE) < 0)
|
||||
return false;
|
||||
op = (js_CodeSpec[op].format & JOF_INC) ? JSOP_ADD : JSOP_SUB;
|
||||
if (Emit1(cx, bce, op) < 0)
|
||||
if (Emit1(cx, bce, binop) < 0)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4970,40 +4970,26 @@ template <>
|
|||
bool
|
||||
Parser<FullParseHandler>::setIncOpKid(ParseNode *pn, ParseNode *kid, TokenKind tt, bool preorder)
|
||||
{
|
||||
JSOp op;
|
||||
|
||||
if (!setLvalKid(pn, kid, incop_name_str[tt == TOK_DEC]))
|
||||
return false;
|
||||
|
||||
switch (kid->getKind()) {
|
||||
case PNK_NAME:
|
||||
op = (tt == TOK_INC)
|
||||
? (preorder ? JSOP_INCNAME : JSOP_NAMEINC)
|
||||
: (preorder ? JSOP_DECNAME : JSOP_NAMEDEC);
|
||||
handler.noteLValue(kid);
|
||||
break;
|
||||
|
||||
case PNK_DOT:
|
||||
op = (tt == TOK_INC)
|
||||
? (preorder ? JSOP_INCPROP : JSOP_PROPINC)
|
||||
: (preorder ? JSOP_DECPROP : JSOP_PROPDEC);
|
||||
break;
|
||||
|
||||
case PNK_CALL:
|
||||
if (!makeSetCall(kid, JSMSG_BAD_INCOP_OPERAND))
|
||||
return false;
|
||||
/* FALL THROUGH */
|
||||
break;
|
||||
|
||||
case PNK_DOT:
|
||||
case PNK_ELEM:
|
||||
op = (tt == TOK_INC)
|
||||
? (preorder ? JSOP_INCELEM : JSOP_ELEMINC)
|
||||
: (preorder ? JSOP_DECELEM : JSOP_ELEMDEC);
|
||||
break;
|
||||
|
||||
default:
|
||||
JS_ASSERT(0);
|
||||
op = JSOP_NOP;
|
||||
}
|
||||
pn->setOp(op);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -571,9 +571,6 @@ BaselineCompiler::emitBody()
|
|||
|
||||
switch (op) {
|
||||
default:
|
||||
// Ignore fat opcodes, we compile the decomposed version instead.
|
||||
if (js_CodeSpec[op].format & JOF_DECOMPOSE)
|
||||
break;
|
||||
IonSpew(IonSpew_BaselineAbort, "Unhandled op: %s", js_CodeName[op]);
|
||||
return Method_CantCompile;
|
||||
|
||||
|
|
|
@ -48,19 +48,15 @@ BytecodeAnalysis::init()
|
|||
JS_ASSERT(!infos_[chkpc - script_->code].initialized);
|
||||
#endif
|
||||
|
||||
// Treat decompose ops as no-ops which do not adjust the stack. We will
|
||||
// pick up the stack depths as we go through the decomposed version.
|
||||
if (!(js_CodeSpec[op].format & JOF_DECOMPOSE)) {
|
||||
unsigned nuses = GetUseCount(script_, offset);
|
||||
unsigned ndefs = GetDefCount(script_, offset);
|
||||
unsigned nuses = GetUseCount(script_, offset);
|
||||
unsigned ndefs = GetDefCount(script_, offset);
|
||||
|
||||
JS_ASSERT(stackDepth >= nuses);
|
||||
stackDepth -= nuses;
|
||||
stackDepth += ndefs;
|
||||
JS_ASSERT(stackDepth >= nuses);
|
||||
stackDepth -= nuses;
|
||||
stackDepth += ndefs;
|
||||
|
||||
// If stack depth exceeds max allowed by analysis, fail fast.
|
||||
JS_ASSERT(stackDepth <= BytecodeInfo::MAX_STACK_DEPTH);
|
||||
}
|
||||
// If stack depth exceeds max allowed by analysis, fail fast.
|
||||
JS_ASSERT(stackDepth <= BytecodeInfo::MAX_STACK_DEPTH);
|
||||
|
||||
if (op == JSOP_TABLESWITCH) {
|
||||
unsigned defaultOffset = offset + GET_JUMP_OFFSET(pc);
|
||||
|
|
|
@ -1090,10 +1090,6 @@ IonBuilder::snoopControlFlow(JSOp op)
|
|||
bool
|
||||
IonBuilder::inspectOpcode(JSOp op)
|
||||
{
|
||||
// Don't compile fat opcodes, run the decomposed version instead.
|
||||
if (js_CodeSpec[op].format & JOF_DECOMPOSE)
|
||||
return true;
|
||||
|
||||
switch (op) {
|
||||
case JSOP_NOP:
|
||||
case JSOP_LINENO:
|
||||
|
|
|
@ -254,18 +254,12 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
|
|||
if (!forwardJump)
|
||||
code->unconditional = true;
|
||||
|
||||
/*
|
||||
* Treat decompose ops as no-ops which do not adjust the stack. We will
|
||||
* pick up the stack depths as we go through the decomposed version.
|
||||
*/
|
||||
if (!(js_CodeSpec[op].format & JOF_DECOMPOSE)) {
|
||||
unsigned nuses = GetUseCount(script_, offset);
|
||||
unsigned ndefs = GetDefCount(script_, offset);
|
||||
unsigned nuses = GetUseCount(script_, offset);
|
||||
unsigned ndefs = GetDefCount(script_, offset);
|
||||
|
||||
JS_ASSERT(stackDepth >= nuses);
|
||||
stackDepth -= nuses;
|
||||
stackDepth += ndefs;
|
||||
}
|
||||
JS_ASSERT(stackDepth >= nuses);
|
||||
stackDepth -= nuses;
|
||||
stackDepth += ndefs;
|
||||
|
||||
switch (op) {
|
||||
|
||||
|
@ -533,10 +527,8 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
|
|||
break;
|
||||
|
||||
default:
|
||||
if (!(js_CodeSpec[op].format & JOF_DECOMPOSE)) {
|
||||
isJaegerCompileable = false;
|
||||
isJaegerInlineable = isIonInlineable = false;
|
||||
}
|
||||
isJaegerCompileable = false;
|
||||
isJaegerInlineable = isIonInlineable = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1272,11 +1264,6 @@ ScriptAnalysis::analyzeSSA(JSContext *cx)
|
|||
freezeNewValues(cx, offset);
|
||||
}
|
||||
|
||||
if (js_CodeSpec[op].format & JOF_DECOMPOSE) {
|
||||
offset = successorOffset;
|
||||
continue;
|
||||
}
|
||||
|
||||
unsigned nuses = GetUseCount(script_, offset);
|
||||
unsigned ndefs = GetDefCount(script_, offset);
|
||||
JS_ASSERT(stackDepth >= nuses);
|
||||
|
|
|
@ -168,15 +168,7 @@ ExtendedDef(jsbytecode *pc)
|
|||
{
|
||||
switch ((JSOp)*pc) {
|
||||
case JSOP_SETARG:
|
||||
case JSOP_INCARG:
|
||||
case JSOP_DECARG:
|
||||
case JSOP_ARGINC:
|
||||
case JSOP_ARGDEC:
|
||||
case JSOP_SETLOCAL:
|
||||
case JSOP_INCLOCAL:
|
||||
case JSOP_DECLOCAL:
|
||||
case JSOP_LOCALINC:
|
||||
case JSOP_LOCALDEC:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
@ -451,26 +443,6 @@ struct LifetimeVariable
|
|||
return firstWrite(loop->head, loop->backedge);
|
||||
}
|
||||
|
||||
/* Return true if the variable cannot decrease during the body of a loop. */
|
||||
bool nonDecreasing(JSScript *script, LoopAnalysis *loop) const {
|
||||
Lifetime *segment = lifetime ? lifetime : saved;
|
||||
while (segment && segment->start <= loop->backedge) {
|
||||
if (segment->start >= loop->head && segment->write) {
|
||||
switch (JSOp(script->code[segment->start])) {
|
||||
case JSOP_INCLOCAL:
|
||||
case JSOP_LOCALINC:
|
||||
case JSOP_INCARG:
|
||||
case JSOP_ARGINC:
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
segment = segment->next;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the variable is only written once in the body of a loop, offset of
|
||||
* that write. UINT32_MAX otherwise.
|
||||
|
@ -852,11 +824,6 @@ class ScriptAnalysis
|
|||
return JSOp(*next) == JSOP_POP && !jumpTarget(next);
|
||||
}
|
||||
|
||||
bool incrementInitialValueObserved(jsbytecode *pc) {
|
||||
const JSCodeSpec *cs = &js_CodeSpec[*pc];
|
||||
return (cs->format & JOF_POST) && !popGuaranteed(pc);
|
||||
}
|
||||
|
||||
const SSAValue &poppedValue(uint32_t offset, uint32_t which) {
|
||||
JS_ASSERT(offset < script_->length);
|
||||
JS_ASSERT(which < GetUseCount(script_, offset) +
|
||||
|
|
|
@ -3025,8 +3025,6 @@ TypeCompartment::markSetsUnknown(JSContext *cx, TypeObject *target)
|
|||
if (!script->analysis()->maybeCode(i))
|
||||
continue;
|
||||
jsbytecode *pc = script->code + i;
|
||||
if (js_CodeSpec[*pc].format & JOF_DECOMPOSE)
|
||||
continue;
|
||||
unsigned defCount = GetDefCount(script, i);
|
||||
if (ExtendedDef(pc))
|
||||
defCount++;
|
||||
|
@ -4090,13 +4088,6 @@ ScriptAnalysis::analyzeTypesBytecode(JSContext *cx, unsigned offset, TypeInferen
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Treat decomposed ops as no-ops, we will analyze the decomposed version
|
||||
* instead. (We do, however, need to look at introduced phi nodes).
|
||||
*/
|
||||
if (js_CodeSpec[*pc].format & JOF_DECOMPOSE)
|
||||
return true;
|
||||
|
||||
for (unsigned i = 0; i < defCount; i++) {
|
||||
InferSpew(ISpewOps, "typeSet: %sT%p%s pushed%u #%u:%05u",
|
||||
InferSpewColor(&pushed[i]), &pushed[i], InferSpewColorReset(),
|
||||
|
@ -5418,9 +5409,6 @@ ScriptAnalysis::printTypes(JSContext *cx)
|
|||
|
||||
jsbytecode *pc = script_->code + offset;
|
||||
|
||||
if (js_CodeSpec[*pc].format & JOF_DECOMPOSE)
|
||||
continue;
|
||||
|
||||
unsigned defCount = GetDefCount(script_, offset);
|
||||
if (!defCount)
|
||||
continue;
|
||||
|
@ -5499,9 +5487,6 @@ ScriptAnalysis::printTypes(JSContext *cx)
|
|||
|
||||
PrintBytecode(cx, script, pc);
|
||||
|
||||
if (js_CodeSpec[*pc].format & JOF_DECOMPOSE)
|
||||
continue;
|
||||
|
||||
if (js_CodeSpec[*pc].format & JOF_TYPESET) {
|
||||
TypeSet *types = TypeScript::BytecodeTypes(script_, pc);
|
||||
printf(" typeset %d:", (int) (types - script_->types->typeArray()));
|
||||
|
|
|
@ -972,11 +972,6 @@ JS_STATIC_ASSERT(JSOP_SETNAME_LENGTH == JSOP_SETPROP_LENGTH);
|
|||
JS_STATIC_ASSERT(JSOP_IFNE_LENGTH == JSOP_IFEQ_LENGTH);
|
||||
JS_STATIC_ASSERT(JSOP_IFNE == JSOP_IFEQ + 1);
|
||||
|
||||
/* For the fastest case inder JSOP_INCNAME, etc. */
|
||||
JS_STATIC_ASSERT(JSOP_INCNAME_LENGTH == JSOP_DECNAME_LENGTH);
|
||||
JS_STATIC_ASSERT(JSOP_INCNAME_LENGTH == JSOP_NAMEINC_LENGTH);
|
||||
JS_STATIC_ASSERT(JSOP_INCNAME_LENGTH == JSOP_NAMEDEC_LENGTH);
|
||||
|
||||
/*
|
||||
* Inline fast paths for iteration. js_IteratorMore and js_IteratorNext handle
|
||||
* all cases, but we inline the most frequently taken paths here.
|
||||
|
@ -2108,53 +2103,6 @@ BEGIN_CASE(JSOP_VOID)
|
|||
regs.sp[-1].setUndefined();
|
||||
END_CASE(JSOP_VOID)
|
||||
|
||||
BEGIN_CASE(JSOP_INCELEM)
|
||||
BEGIN_CASE(JSOP_DECELEM)
|
||||
BEGIN_CASE(JSOP_ELEMINC)
|
||||
BEGIN_CASE(JSOP_ELEMDEC)
|
||||
/* No-op */
|
||||
END_CASE(JSOP_INCELEM)
|
||||
|
||||
BEGIN_CASE(JSOP_INCPROP)
|
||||
BEGIN_CASE(JSOP_DECPROP)
|
||||
BEGIN_CASE(JSOP_PROPINC)
|
||||
BEGIN_CASE(JSOP_PROPDEC)
|
||||
BEGIN_CASE(JSOP_INCNAME)
|
||||
BEGIN_CASE(JSOP_DECNAME)
|
||||
BEGIN_CASE(JSOP_NAMEINC)
|
||||
BEGIN_CASE(JSOP_NAMEDEC)
|
||||
BEGIN_CASE(JSOP_INCGNAME)
|
||||
BEGIN_CASE(JSOP_DECGNAME)
|
||||
BEGIN_CASE(JSOP_GNAMEINC)
|
||||
BEGIN_CASE(JSOP_GNAMEDEC)
|
||||
/* No-op */
|
||||
END_CASE(JSOP_INCPROP)
|
||||
|
||||
BEGIN_CASE(JSOP_DECALIASEDVAR)
|
||||
BEGIN_CASE(JSOP_ALIASEDVARDEC)
|
||||
BEGIN_CASE(JSOP_INCALIASEDVAR)
|
||||
BEGIN_CASE(JSOP_ALIASEDVARINC)
|
||||
/* No-op */
|
||||
END_CASE(JSOP_ALIASEDVARINC)
|
||||
|
||||
BEGIN_CASE(JSOP_DECARG)
|
||||
BEGIN_CASE(JSOP_ARGDEC)
|
||||
BEGIN_CASE(JSOP_INCARG)
|
||||
BEGIN_CASE(JSOP_ARGINC)
|
||||
{
|
||||
/* No-op */
|
||||
}
|
||||
END_CASE(JSOP_ARGINC);
|
||||
|
||||
BEGIN_CASE(JSOP_DECLOCAL)
|
||||
BEGIN_CASE(JSOP_LOCALDEC)
|
||||
BEGIN_CASE(JSOP_INCLOCAL)
|
||||
BEGIN_CASE(JSOP_LOCALINC)
|
||||
{
|
||||
/* No-op */
|
||||
}
|
||||
END_CASE(JSOP_LOCALINC)
|
||||
|
||||
BEGIN_CASE(JSOP_THIS)
|
||||
if (!ComputeThis(cx, regs.fp()))
|
||||
goto error;
|
||||
|
|
|
@ -4178,14 +4178,6 @@ js::ReportIfUndeclaredVarAssignment(JSContext *cx, HandleString propname)
|
|||
* need to check name-access because this method is only supposed to be
|
||||
* called in assignment contexts.
|
||||
*/
|
||||
MOZ_ASSERT(*pc != JSOP_INCNAME);
|
||||
MOZ_ASSERT(*pc != JSOP_INCGNAME);
|
||||
MOZ_ASSERT(*pc != JSOP_NAMEINC);
|
||||
MOZ_ASSERT(*pc != JSOP_GNAMEINC);
|
||||
MOZ_ASSERT(*pc != JSOP_DECNAME);
|
||||
MOZ_ASSERT(*pc != JSOP_DECGNAME);
|
||||
MOZ_ASSERT(*pc != JSOP_NAMEDEC);
|
||||
MOZ_ASSERT(*pc != JSOP_GNAMEDEC);
|
||||
MOZ_ASSERT(*pc != JSOP_NAME);
|
||||
MOZ_ASSERT(*pc != JSOP_GETGNAME);
|
||||
if (*pc != JSOP_SETNAME && *pc != JSOP_SETGNAME)
|
||||
|
|
|
@ -1689,9 +1689,6 @@ static int
|
|||
SimulateOp(JSScript *script, JSOp op, const JSCodeSpec *cs,
|
||||
jsbytecode *pc, jsbytecode **pcstack, unsigned &pcdepth)
|
||||
{
|
||||
if (cs->format & JOF_DECOMPOSE)
|
||||
return pcdepth;
|
||||
|
||||
unsigned nuses = StackUses(script, pc);
|
||||
unsigned ndefs = StackDefs(script, pc);
|
||||
LOCAL_ASSERT(pcdepth >= nuses);
|
||||
|
|
|
@ -67,10 +67,9 @@ typedef enum JSOp {
|
|||
#define JOF_MODEMASK (7U<<5) /* mask for above addressing modes */
|
||||
#define JOF_SET (1U<<8) /* set (i.e., assignment) operation */
|
||||
/* (1U<<9) is unused*/
|
||||
#define JOF_DEC (1U<<10) /* decrement (--, not ++) opcode */
|
||||
#define JOF_INC (2U<<10) /* increment (++, not --) opcode */
|
||||
#define JOF_INCDEC (3U<<10) /* increment or decrement opcode */
|
||||
#define JOF_POST (1U<<12) /* postorder increment or decrement */
|
||||
/* (1U<<10) is unused*/
|
||||
/* (1U<<11) is unused*/
|
||||
/* (1U<<12) is unused*/
|
||||
/* (1U<<13) is unused*/
|
||||
#define JOF_DETECTING (1U<<14) /* object detection for warning-quelling */
|
||||
/* (1U<<15) is unused*/
|
||||
|
@ -93,9 +92,7 @@ typedef enum JSOp {
|
|||
/* (1U<<24) is unused */
|
||||
#define JOF_GNAME (1U<<25) /* predicted global name */
|
||||
#define JOF_TYPESET (1U<<26) /* has an entry in a script's type sets */
|
||||
#define JOF_DECOMPOSE (1U<<27) /* followed by an equivalent decomposed
|
||||
* version of the opcode */
|
||||
#define JOF_ARITH (1U<<28) /* unary or binary arithmetic opcode */
|
||||
#define JOF_ARITH (1U<<27) /* unary or binary arithmetic opcode */
|
||||
|
||||
/* Shorthands for type from format and type from opcode. */
|
||||
#define JOF_TYPE(fmt) ((fmt) & JOF_TYPEMASK)
|
||||
|
@ -550,7 +547,7 @@ class PCCounts
|
|||
return true;
|
||||
int format = js_CodeSpec[op].format;
|
||||
return !!(format & (JOF_NAME | JOF_GNAME | JOF_ELEM | JOF_PROP))
|
||||
&& !(format & (JOF_SET | JOF_INCDEC));
|
||||
&& !(format & JOF_SET);
|
||||
}
|
||||
|
||||
enum ElementCounts {
|
||||
|
@ -593,7 +590,7 @@ class PCCounts
|
|||
};
|
||||
|
||||
static bool arithOp(JSOp op) {
|
||||
return !!(js_CodeSpec[op].format & (JOF_INCDEC | JOF_ARITH));
|
||||
return !!(js_CodeSpec[op].format & JOF_ARITH);
|
||||
}
|
||||
|
||||
static size_t numCounts(JSOp op)
|
||||
|
|
|
@ -127,18 +127,18 @@ OPDEF(JSOP_DELELEM, 38, "delelem", NULL, 1, 2, 1, 15, JOF_BYTE |
|
|||
OPDEF(JSOP_TYPEOF, 39, js_typeof_str,NULL, 1, 1, 1, 15, JOF_BYTE|JOF_DETECTING)
|
||||
OPDEF(JSOP_VOID, 40, js_void_str, NULL, 1, 1, 1, 15, JOF_BYTE)
|
||||
|
||||
OPDEF(JSOP_INCNAME, 41, "incname", NULL, 6, 0, 1, 15, JOF_ATOM|JOF_NAME|JOF_INC|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_INCPROP, 42, "incprop", NULL, 6, 1, 1, 15, JOF_ATOM|JOF_PROP|JOF_INC|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_INCELEM, 43, "incelem", NULL, 2, 2, 1, 15, JOF_BYTE |JOF_ELEM|JOF_INC|JOF_TMPSLOT2|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_DECNAME, 44, "decname", NULL, 6, 0, 1, 15, JOF_ATOM|JOF_NAME|JOF_DEC|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_DECPROP, 45, "decprop", NULL, 6, 1, 1, 15, JOF_ATOM|JOF_PROP|JOF_DEC|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_DECELEM, 46, "decelem", NULL, 2, 2, 1, 15, JOF_BYTE |JOF_ELEM|JOF_DEC|JOF_TMPSLOT2|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_NAMEINC, 47, "nameinc", NULL, 6, 0, 1, 15, JOF_ATOM|JOF_NAME|JOF_INC|JOF_POST|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_PROPINC, 48, "propinc", NULL, 6, 1, 1, 15, JOF_ATOM|JOF_PROP|JOF_INC|JOF_POST|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_ELEMINC, 49, "eleminc", NULL, 2, 2, 1, 15, JOF_BYTE |JOF_ELEM|JOF_INC|JOF_POST|JOF_TMPSLOT2|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_NAMEDEC, 50, "namedec", NULL, 6, 0, 1, 15, JOF_ATOM|JOF_NAME|JOF_DEC|JOF_POST|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_PROPDEC, 51, "propdec", NULL, 6, 1, 1, 15, JOF_ATOM|JOF_PROP|JOF_DEC|JOF_POST|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_ELEMDEC, 52, "elemdec", NULL, 2, 2, 1, 15, JOF_BYTE |JOF_ELEM|JOF_DEC|JOF_POST|JOF_TMPSLOT2|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_UNUSED41, 41, "unused41", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED42, 42, "unused42", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED43, 43, "unused43", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED44, 44, "unused44", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED45, 45, "unused45", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED46, 46, "unused46", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED47, 47, "unused47", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED48, 48, "unused48", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED49, 49, "unused49", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED50, 50, "unused50", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED51, 51, "unused51", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED52, 52, "unused52", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
|
||||
OPDEF(JSOP_GETPROP, 53, "getprop", NULL, 5, 1, 1, 18, JOF_ATOM|JOF_PROP|JOF_TYPESET|JOF_TMPSLOT3)
|
||||
OPDEF(JSOP_SETPROP, 54, "setprop", NULL, 5, 2, 1, 3, JOF_ATOM|JOF_PROP|JOF_SET|JOF_DETECTING|JOF_TMPSLOT)
|
||||
|
@ -235,16 +235,14 @@ OPDEF(JSOP_INITELEM_INC,95, "initelem_inc", NULL, 1, 3, 2, 3, JOF_BYTE|J
|
|||
/* Initialize an array element. */
|
||||
OPDEF(JSOP_INITELEM_ARRAY,96, "initelem_array", NULL, 4, 2, 1, 3, JOF_UINT24|JOF_ELEM|JOF_SET|JOF_DETECTING)
|
||||
|
||||
/* Fast inc/dec ops for args and locals. */
|
||||
OPDEF(JSOP_INCARG, 97, "incarg", NULL, 3, 0, 1, 15, JOF_QARG |JOF_NAME|JOF_INC|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_DECARG, 98, "decarg", NULL, 3, 0, 1, 15, JOF_QARG |JOF_NAME|JOF_DEC|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_ARGINC, 99, "arginc", NULL, 3, 0, 1, 15, JOF_QARG |JOF_NAME|JOF_INC|JOF_POST|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_ARGDEC, 100, "argdec", NULL, 3, 0, 1, 15, JOF_QARG |JOF_NAME|JOF_DEC|JOF_POST|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
|
||||
OPDEF(JSOP_INCLOCAL, 101,"inclocal", NULL, 3, 0, 1, 15, JOF_LOCAL|JOF_NAME|JOF_INC|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_DECLOCAL, 102,"declocal", NULL, 3, 0, 1, 15, JOF_LOCAL|JOF_NAME|JOF_DEC|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_LOCALINC, 103,"localinc", NULL, 3, 0, 1, 15, JOF_LOCAL|JOF_NAME|JOF_INC|JOF_POST|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_LOCALDEC, 104,"localdec", NULL, 3, 0, 1, 15, JOF_LOCAL|JOF_NAME|JOF_DEC|JOF_POST|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_UNUSED97, 97, "unused97", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED98, 98, "unused98", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED99, 99, "unused99", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED100, 100, "unused100", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED101, 101, "unused101", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED102, 102, "unused102", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED103, 103, "unused103", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED104, 104, "unused104", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
|
||||
/* Leave a for-let-in block leaving its storage pushed (to be popped after enditer). */
|
||||
OPDEF(JSOP_LEAVEFORLETIN, 105,"leaveforletin",NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
|
@ -355,10 +353,11 @@ OPDEF(JSOP_FINALLY, 135,"finally", NULL, 1, 0, 2, 0, JOF_BYTE)
|
|||
OPDEF(JSOP_GETALIASEDVAR, 136,"getaliasedvar",NULL, 9, 0, 1, 19, JOF_SCOPECOORD|JOF_NAME|JOF_TYPESET)
|
||||
OPDEF(JSOP_CALLALIASEDVAR,137,"callaliasedvar",NULL, 9, 0, 1, 19, JOF_SCOPECOORD|JOF_NAME|JOF_TYPESET)
|
||||
OPDEF(JSOP_SETALIASEDVAR, 138,"setaliasedvar",NULL, 9, 1, 1, 3, JOF_SCOPECOORD|JOF_NAME|JOF_SET|JOF_DETECTING)
|
||||
OPDEF(JSOP_INCALIASEDVAR, 139,"incaliasedvar",NULL, 10, 0, 1, 15, JOF_SCOPECOORD|JOF_NAME|JOF_INC|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_DECALIASEDVAR, 140,"decaliasedvar",NULL, 10, 0, 1, 15, JOF_SCOPECOORD|JOF_NAME|JOF_DEC|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_ALIASEDVARINC, 141,"aliasedvarinc",NULL, 10, 0, 1, 15, JOF_SCOPECOORD|JOF_NAME|JOF_INC|JOF_POST|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_ALIASEDVARDEC, 142,"aliasedvardec",NULL, 10, 0, 1, 15, JOF_SCOPECOORD|JOF_NAME|JOF_DEC|JOF_POST|JOF_TMPSLOT3|JOF_DECOMPOSE)
|
||||
|
||||
OPDEF(JSOP_UNUSED139, 139, "unused139", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED140, 140, "unused140", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED141, 141, "unused141", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED142, 142, "unused142", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
|
||||
/*
|
||||
* Intrinsic names are emitted instead of JSOP_*NAME ops when the
|
||||
|
@ -390,10 +389,11 @@ OPDEF(JSOP_RETRVAL, 153,"retrval", NULL, 1, 0, 0, 0, JOF_BYTE)
|
|||
/* Free variable references that must either be found on the global or a ReferenceError */
|
||||
OPDEF(JSOP_GETGNAME, 154,"getgname", NULL, 5, 0, 1, 19, JOF_ATOM|JOF_NAME|JOF_TYPESET|JOF_GNAME)
|
||||
OPDEF(JSOP_SETGNAME, 155,"setgname", NULL, 5, 2, 1, 3, JOF_ATOM|JOF_NAME|JOF_SET|JOF_DETECTING|JOF_GNAME)
|
||||
OPDEF(JSOP_INCGNAME, 156,"incgname", NULL, 6, 0, 1, 15, JOF_ATOM|JOF_NAME|JOF_INC|JOF_TMPSLOT3|JOF_GNAME|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_DECGNAME, 157,"decgname", NULL, 6, 0, 1, 15, JOF_ATOM|JOF_NAME|JOF_DEC|JOF_TMPSLOT3|JOF_GNAME|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_GNAMEINC, 158,"gnameinc", NULL, 6, 0, 1, 15, JOF_ATOM|JOF_NAME|JOF_INC|JOF_POST|JOF_TMPSLOT3|JOF_GNAME|JOF_DECOMPOSE)
|
||||
OPDEF(JSOP_GNAMEDEC, 159,"gnamedec", NULL, 6, 0, 1, 15, JOF_ATOM|JOF_NAME|JOF_DEC|JOF_POST|JOF_TMPSLOT3|JOF_GNAME|JOF_DECOMPOSE)
|
||||
|
||||
OPDEF(JSOP_UNUSED156, 156, "unused156", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED157, 157, "unused157", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED158, 158, "unused158", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
OPDEF(JSOP_UNUSED159, 159, "unused159", NULL, 1, 0, 0, 0, JOF_BYTE)
|
||||
|
||||
/* Regular expression literal requiring special "fork on exec" handling. */
|
||||
OPDEF(JSOP_REGEXP, 160,"regexp", NULL, 5, 0, 1, 19, JOF_REGEXP)
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace js {
|
|||
* and saved versions. If deserialization fails, the data should be
|
||||
* invalidated if possible.
|
||||
*/
|
||||
static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - 143);
|
||||
static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - 144);
|
||||
|
||||
class XDRBuffer {
|
||||
public:
|
||||
|
|
Загрузка…
Ссылка в новой задаче