Bug 1466000 - Part 4: Remove emitAtopOp with NameNode*. r=efaust
authorTooru Fujisawa <arai_a@mac.com>
Tue, 09 Oct 2018 21:23:11 +0900
changeset 496201 3a968c6b847b250464c7b069ab29f640ce2148c3
parent 496200 b1c3a4c98e406a6b1c75f3e2cd195f4a01ad2d47
child 496202 31026dec4c105a910a5838bfd38041801ba40c33
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersefaust
bugs1466000
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1466000 - Part 4: Remove emitAtopOp with NameNode*. r=efaust
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/BytecodeEmitter.h
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -898,23 +898,16 @@ BytecodeEmitter::emitAtomOp(JSAtom* atom
     if (!makeAtomIndex(atom, &index)) {
         return false;
     }
 
     return emitIndexOp(op, index);
 }
 
 bool
-BytecodeEmitter::emitAtomOp(NameNode* nameNode, JSOp op)
-{
-    MOZ_ASSERT(nameNode->atom() != nullptr);
-    return emitAtomOp(nameNode->atom(), op);
-}
-
-bool
 BytecodeEmitter::emitInternedScopeOp(uint32_t index, JSOp op)
 {
     MOZ_ASSERT(JOF_OPTYPE(op) == JOF_SCOPE);
     MOZ_ASSERT(index < scopeList.length());
     return emitIndex32(op, index);
 }
 
 bool
@@ -2027,17 +2020,17 @@ BytecodeEmitter::emitPropLHS(PropertyAcc
 
     // pndown is a primary expression, not a dotted property reference.
     if (!emitTree(pndown)) {
         return false;
     }
 
     while (true) {
         // Walk back up the list, emitting annotated name ops.
-        if (!emitAtomOp(&pndot->key(), JSOP_GETPROP)) {
+        if (!emitAtomOp(pndot->key().atom(), JSOP_GETPROP)) {
             return false;
         }
 
         // Reverse the pndot->expression() link again.
         pnup = pndot->maybeExpression();
         pndot->setExpression(pndown);
         pndown = pndot;
         if (!pnup) {
@@ -2069,17 +2062,18 @@ BytecodeEmitter::emitPropOp(PropertyAcce
     if (!emitPropLHS(prop)) {
         return false;
     }
 
     if (op == JSOP_CALLPROP && !emit1(JSOP_DUP)) {
         return false;
     }
 
-    if (!emitAtomOp(&prop->key(), op)) {
+    JSAtom* atom = prop->key().atom();
+    if (!emitAtomOp(atom, op)) {
         return false;
     }
 
     if (op == JSOP_CALLPROP && !emit1(JSOP_SWAP)) {
         return false;
     }
 
     return true;
@@ -2088,17 +2082,18 @@ BytecodeEmitter::emitPropOp(PropertyAcce
 bool
 BytecodeEmitter::emitSuperGetProp(PropertyAccess* prop, bool isCall)
 {
     UnaryNode* base = &prop->expression().as<UnaryNode>();
     if (!emitSuperPropLHS(base, isCall)) {                // THIS? THIS SUPERBASE
         return false;
     }
 
-    if (!emitAtomOp(&prop->key(), JSOP_GETPROP_SUPER)) {  // THIS? PROP
+    JSAtom* atom = prop->key().atom();
+    if (!emitAtomOp(atom, JSOP_GETPROP_SUPER)) {          // THIS? PROP
         return false;
     }
 
     if (isCall) {
         if (!emit1(JSOP_SWAP))                            // PROP THIS
             return false;
     }
 
@@ -2125,17 +2120,18 @@ BytecodeEmitter::emitPropIncDec(UnaryNod
     } else {
         if (!emitPropLHS(prop)) {
             return false;                           // OBJ
         }
         if (!emit1(JSOP_DUP)) {                     // OBJ OBJ
             return false;
         }
     }
-    if (!emitAtomOp(&prop->key(), isSuper ? JSOP_GETPROP_SUPER : JSOP_GETPROP)) {
+    JSAtom* atom = prop->key().atom();
+    if (!emitAtomOp(atom, isSuper ? JSOP_GETPROP_SUPER : JSOP_GETPROP)) {
         return false;                               // THIS? OBJ V
     }
     if (!emit1(JSOP_POS)) {                         // ... N
         return false;
     }
     if (post) {
         if (!emit1(JSOP_DUP)) {                     // ... N N
             return false;
@@ -2170,17 +2166,17 @@ BytecodeEmitter::emitPropIncDec(UnaryNod
                 return false;
 
             }
         }
     }
 
     JSOp setOp = isSuper ? sc->strict() ? JSOP_STRICTSETPROP_SUPER : JSOP_SETPROP_SUPER
                          : sc->strict() ? JSOP_STRICTSETPROP : JSOP_SETPROP;
-    if (!emitAtomOp(&prop->key(), setOp)) {         // N? N+1
+    if (!emitAtomOp(atom, setOp)) {                 // N? N+1
         return false;
     }
     if (post) {
         if (!emit1(JSOP_POP)) {                     // N
             return false;
         }
     }
 
@@ -3107,17 +3103,17 @@ BytecodeEmitter::emitSetOrInitializeDest
             // The reference is already pushed by emitDestructuringLHSRef.
             PropertyAccess* prop = &target->as<PropertyAccess>();
             JSOp setOp;
             if (prop->isSuper()) {                        // THIS OBJ VAL
                 setOp = sc->strict() ? JSOP_STRICTSETPROP_SUPER : JSOP_SETPROP_SUPER;
             } else {                                      // OBJ VAL
                 setOp = sc->strict() ? JSOP_STRICTSETPROP : JSOP_SETPROP;
             }
-            if (!emitAtomOp(&prop->key(), setOp)) {       // VAL
+            if (!emitAtomOp(prop->key().atom(), setOp)) { // VAL
                 return false;
             }
             break;
           }
 
           case ParseNodeKind::Elem: {
             // The reference is already pushed by emitDestructuringLHSRef.
             PropertyByValue* elem = &target->as<PropertyByValue>();
@@ -6806,17 +6802,17 @@ BytecodeEmitter::emitExpressionStatement
 bool
 BytecodeEmitter::emitDeleteName(UnaryNode* deleteNode)
 {
     MOZ_ASSERT(deleteNode->isKind(ParseNodeKind::DeleteName));
 
     NameNode* nameExpr = &deleteNode->kid()->as<NameNode>();
     MOZ_ASSERT(nameExpr->isKind(ParseNodeKind::Name));
 
-    return emitAtomOp(nameExpr, JSOP_DELNAME);
+    return emitAtomOp(nameExpr->atom(), JSOP_DELNAME);
 }
 
 bool
 BytecodeEmitter::emitDeleteProperty(UnaryNode* deleteNode)
 {
     MOZ_ASSERT(deleteNode->isKind(ParseNodeKind::DeleteProp));
 
     PropertyAccess* propExpr = &deleteNode->kid()->as<PropertyAccess>();
@@ -9355,17 +9351,17 @@ BytecodeEmitter::emitTree(ParseNode* pn,
       case ParseNodeKind::TemplateStringList:
         if (!emitTemplateString(&pn->as<ListNode>())) {
             return false;
         }
         break;
 
       case ParseNodeKind::TemplateString:
       case ParseNodeKind::String:
-        if (!emitAtomOp(&pn->as<NameNode>(), JSOP_STRING)) {
+        if (!emitAtomOp(pn->as<NameNode>().atom(), JSOP_STRING)) {
             return false;
         }
         break;
 
       case ParseNodeKind::Number:
         if (!emitNumberOp(pn->as<NumericLiteral>().value())) {
             return false;
         }
--- a/js/src/frontend/BytecodeEmitter.h
+++ b/js/src/frontend/BytecodeEmitter.h
@@ -542,17 +542,16 @@ struct MOZ_STACK_CLASS BytecodeEmitter
 
     MOZ_MUST_USE bool emitGoto(NestableControl* target, JumpList* jumplist,
                                SrcNoteType noteType = SRC_NULL);
 
     MOZ_MUST_USE bool emitIndex32(JSOp op, uint32_t index);
     MOZ_MUST_USE bool emitIndexOp(JSOp op, uint32_t index);
 
     MOZ_MUST_USE bool emitAtomOp(JSAtom* atom, JSOp op);
-    MOZ_MUST_USE bool emitAtomOp(NameNode* nameNode, JSOp op);
 
     MOZ_MUST_USE bool emitArrayLiteral(ListNode* array);
     MOZ_MUST_USE bool emitArray(ParseNode* arrayHead, uint32_t count);
 
     MOZ_MUST_USE bool emitInternedScopeOp(uint32_t index, JSOp op);
     MOZ_MUST_USE bool emitInternedObjectOp(uint32_t index, JSOp op);
     MOZ_MUST_USE bool emitObjectOp(ObjectBox* objbox, JSOp op);
     MOZ_MUST_USE bool emitObjectPairOp(ObjectBox* objbox1, ObjectBox* objbox2, JSOp op);