зеркало из https://github.com/mozilla/gecko-dev.git
Bug 844805, part 2 - Don't even set the pn_op field of PNK_DOT/ELEM nodes. r=Waldo.
This commit is contained in:
Родитель
bf19c644d1
Коммит
7c90f23b63
|
@ -1894,7 +1894,6 @@ EmitPropLHS(JSContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
|||
|
||||
do {
|
||||
/* Walk back up the list, emitting annotated name ops. */
|
||||
JS_ASSERT(pndot->getOp() == JSOP_GETPROP);
|
||||
if (!EmitAtomOp(cx, pndot, JSOP_GETPROP, bce))
|
||||
return false;
|
||||
|
||||
|
@ -3436,7 +3435,6 @@ EmitAssignment(JSContext *cx, BytecodeEmitter *bce, ParseNode *lhs, JSOp op, Par
|
|||
}
|
||||
break;
|
||||
case PNK_DOT:
|
||||
JS_ASSERT(lhs->getOp() == JSOP_SETPROP);
|
||||
if (!EmitIndexOp(cx, JSOP_SETPROP, atomIndex, bce))
|
||||
return false;
|
||||
break;
|
||||
|
@ -5032,12 +5030,10 @@ EmitCallOrNew(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
|||
return false;
|
||||
break;
|
||||
case PNK_DOT:
|
||||
JS_ASSERT(pn2->getOp() == JSOP_GETPROP);
|
||||
if (!EmitPropOp(cx, pn2, callop ? JSOP_CALLPROP : JSOP_GETPROP, bce))
|
||||
return false;
|
||||
break;
|
||||
case PNK_ELEM:
|
||||
JS_ASSERT(pn2->isOp(JSOP_GETELEM));
|
||||
if (!EmitElemOp(cx, pn2, callop ? JSOP_CALLELEM : JSOP_GETELEM, bce))
|
||||
return false;
|
||||
break;
|
||||
|
@ -5923,23 +5919,10 @@ frontend::EmitTree(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
|||
break;
|
||||
|
||||
case PNK_DOT:
|
||||
/*
|
||||
* Pop a stack operand, convert it to object, get a property named by
|
||||
* this bytecode's immediate-indexed atom operand, and push its value
|
||||
* (not a reference to it).
|
||||
*/
|
||||
JS_ASSERT(pn->getOp() == JSOP_GETPROP);
|
||||
ok = EmitPropOp(cx, pn, JSOP_GETPROP, bce);
|
||||
break;
|
||||
|
||||
case PNK_ELEM:
|
||||
/*
|
||||
* Pop two operands, convert the left one to object and the right one
|
||||
* to property name (atom or tagged int), get the named property, and
|
||||
* push its value. Set the "obj" register to the result of ToObject
|
||||
* on the left operand.
|
||||
*/
|
||||
JS_ASSERT(pn->getOp() == JSOP_GETELEM);
|
||||
ok = EmitElemOp(cx, pn, JSOP_GETELEM, bce);
|
||||
break;
|
||||
|
||||
|
|
|
@ -1165,7 +1165,7 @@ class PropertyAccess : public ParseNode
|
|||
{
|
||||
public:
|
||||
PropertyAccess(ParseNode *lhs, PropertyName *name, uint32_t begin, uint32_t end)
|
||||
: ParseNode(PNK_DOT, JSOP_GETPROP, PN_NAME, TokenPos(begin, end))
|
||||
: ParseNode(PNK_DOT, JSOP_NOP, PN_NAME, TokenPos(begin, end))
|
||||
{
|
||||
JS_ASSERT(lhs != NULL);
|
||||
JS_ASSERT(name != NULL);
|
||||
|
@ -1192,7 +1192,7 @@ class PropertyByValue : public ParseNode
|
|||
{
|
||||
public:
|
||||
PropertyByValue(ParseNode *lhs, ParseNode *propExpr, uint32_t begin, uint32_t end)
|
||||
: ParseNode(PNK_ELEM, JSOP_GETELEM, PN_BINARY, TokenPos(begin, end))
|
||||
: ParseNode(PNK_ELEM, JSOP_NOP, PN_BINARY, TokenPos(begin, end))
|
||||
{
|
||||
pn_u.binary.left = lhs;
|
||||
pn_u.binary.right = propExpr;
|
||||
|
|
Загрузка…
Ссылка в новой задаче