Bug 1318926 - constant-fold asm.js RSh expressions again. r=nbp
authorPip Cet <pipcet@gmail.com>
Sun, 20 Nov 2016 23:16:00 +0100
changeset 323849 f77c4250f23a32162a7783608e2343800335f641
parent 323848 e9d1b6c753292df38efd11f5fc4c8989abc96ee1
child 323850 6d906f5908d1014d3eb6f5a38d2d00aaaa2cc45e
push id21
push usermaklebus@msu.edu
push dateThu, 01 Dec 2016 06:22:08 +0000
reviewersnbp
bugs1318926
milestone53.0a1
Bug 1318926 - constant-fold asm.js RSh expressions again. r=nbp
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;