Both sides of a modulo have to be demotable before we can optimize using imod (456477, r=danderson).
authorAndreas Gal <gal@mozilla.com>
Mon, 22 Sep 2008 17:02:33 -0700
changeset 19602 3bba1048dc290d4c015702cedd1a6c8a3dc6f87c
parent 19600 f2e8595d2df7b06c0e8c6df12c788bd5aba048d0
child 19603 b50bfddb2f330a597e1ff519246b483ccf9a289f
push idunknown
push userunknown
push dateunknown
reviewersdanderson
bugs456477
milestone1.9.1b1pre
Both sides of a modulo have to be demotable before we can optimize using imod (456477, r=danderson).
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -678,17 +678,17 @@ public:
             if (isPromote(args[1])) {
                 LIns* args2[] = { s0, demote(out, args[1]), args[2], args[3] };
                 return out->insCall(F_Any_setelem_int, args2);
             }
             break;
           case F_dmod: 
             // FIXME: We should really have LIR_imod and LIR_idiv (455496).
             JS_ASSERT(s0->isQuad() && args[1]->isQuad());
-            if (args[1]->isconstq() && args[1]->constvalq() && isPromote(s0)) {
+            if (args[1]->isconstq() && args[1]->constvalq() && isPromote(args[1]) && isPromote(s0)) {
                 LIns* args2[] = { demote(out, s0), demote(out, args[1]) };
                 return out->ins1(LIR_i2f, out->insCall(F_imod, args2));
             }
             break;
         }
         return out->insCall(fid, args);
     }
 };