Bug 1262453: IonMonkey - Don't add resume point for constants, r=nbp
authorHannes Verschore <hv1989@gmail.com>
Wed, 13 Apr 2016 10:04:04 -0400
changeset 316808 5d944b43c2173abb3426503ced62074ba739e112
parent 316807 14af533af3819e9c26e57f0458784b07a82e92b2
child 316809 8e3a8e0f5a49457200f206905c6dee1353b47ed7
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1262453
milestone48.0a1
Bug 1262453: IonMonkey - Don't add resume point for constants, r=nbp
js/src/jit/IonBuilder.cpp
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -1803,26 +1803,29 @@ IonBuilder::inspectOpcode(JSOp op)
         return jsop_checkaliasedlet(ScopeCoordinate(pc));
 
       case JSOP_INITALIASEDLEXICAL:
         return jsop_setaliasedvar(ScopeCoordinate(pc));
 
       case JSOP_UNINITIALIZED:
         return pushConstant(MagicValue(JS_UNINITIALIZED_LEXICAL));
 
-      case JSOP_POP:
-        current->pop();
+      case JSOP_POP: {
+        MDefinition* def = current->pop();
 
         // POP opcodes frequently appear where values are killed, e.g. after
         // SET* opcodes. Place a resume point afterwards to avoid capturing
         // the dead value in later snapshots, except in places where that
         // resume point is obviously unnecessary.
         if (pc[JSOP_POP_LENGTH] == JSOP_POP)
             return true;
+        if (def->isConstant())
+            return true;
         return maybeInsertResume();
+      }
 
       case JSOP_POPN:
         for (uint32_t i = 0, n = GET_UINT16(pc); i < n; i++)
             current->pop();
         return true;
 
       case JSOP_DUPAT:
         current->pushSlot(current->stackDepth() - 1 - GET_UINT24(pc));