Bug 1318926 - constant-fold asm.js RSh expressions again. r=nbp a=gchang
authorPip Cet <pipcet@gmail.com>
Sun, 20 Nov 2016 23:16:00 +0100
changeset 352645 287a87843f93f402f1bf4292ad4d28be98fe930a
parent 352644 faf338a9891a7af3a9c128c634f0a9e958bfb2da
child 352646 86def315a57917729644cd22f6c78e900145e49a
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp, gchang
bugs1318926
milestone52.0a2
Bug 1318926 - constant-fold asm.js RSh expressions again. r=nbp a=gchang
js/src/jit/MIR.cpp
--- a/js/src/jit/MIR.cpp
+++ b/js/src/jit/MIR.cpp
@@ -3107,16 +3107,21 @@ MBinaryArithInstruction::constantDoubleR
     bool typeChange = false;
     EvaluateConstantOperands(alloc, this, &typeChange);
     return typeChange;
 }
 
 MDefinition*
 MRsh::foldsTo(TempAllocator& alloc)
 {
+    MDefinition* f = MBinaryBitwiseInstruction::foldsTo(alloc);
+
+    if (f != this)
+        return f;
+
     MDefinition* lhs = getOperand(0);
     MDefinition* rhs = getOperand(1);
 
     if (!lhs->isLsh() || !rhs->isConstant() || rhs->type() != MIRType::Int32)
         return this;
 
     if (!lhs->getOperand(1)->isConstant() || lhs->getOperand(1)->type() != MIRType::Int32)
         return this;