[masm] Cleanup: avoid redundant convertToValue() call in binop generation
authorSimon Hausmann <simon.hausmann@digia.com>
Sun, 2 Dec 2012 18:34:50 +0000 (19:34 +0100)
committerLars Knoll <lars.knoll@digia.com>
Tue, 4 Dec 2012 21:58:00 +0000 (22:58 +0100)
We already do that conversion to a constant VM::Value earlier.

Change-Id: I142435f2be7c841f322ccfc34473b23cf85e6b5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
qv4isel_masm.cpp

index bb9e224..a0787a0 100644 (file)
@@ -803,8 +803,8 @@ void InstructionSelection::generateBinOp(IR::AluOp operation, IR::Temp* target,
         return;
     }
 
-    VM::Value leftConst;
-    VM::Value rightConst;
+    Value leftConst = Value::undefinedValue();
+    Value rightConst = Value::undefinedValue();
 
     bool canDoInline = info.inlineMemOp && info.inlineImmOp;
 
@@ -853,8 +853,7 @@ void InstructionSelection::generateBinOp(IR::AluOp operation, IR::Temp* target,
 
             overflowCheck = (this->*info.inlineMemOp)(Overflow, rightValue, IntegerOpRegister);
         } else { // right->asConst()
-            VM::Value value = convertToValue(right->asConst());
-            overflowCheck = (this->*info.inlineImmOp)(Overflow, TrustedImm32(value.integerValue()), IntegerOpRegister);
+            overflowCheck = (this->*info.inlineImmOp)(Overflow, TrustedImm32(rightConst.integerValue()), IntegerOpRegister);
         }
 
         Address resultAddr = loadTempAddress(ScratchRegister, target);