From f75c05b7d2495ad4b87e57472ebff745048721d9 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sun, 2 Dec 2012 19:34:50 +0100 Subject: [PATCH] [masm] Cleanup: avoid redundant convertToValue() call in binop generation We already do that conversion to a constant VM::Value earlier. Change-Id: I142435f2be7c841f322ccfc34473b23cf85e6b5c Reviewed-by: Lars Knoll --- qv4isel_masm.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/qv4isel_masm.cpp b/qv4isel_masm.cpp index bb9e224..a0787a0 100644 --- a/qv4isel_masm.cpp +++ b/qv4isel_masm.cpp @@ -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); -- 2.7.4