Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index d15fe7ae2828a7c51271b6fc6a59f4d77f2b4a47..228ece926c5f01794a7b7392e3fd4d034a4a3912 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -2414,11 +2414,19 @@ void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) { |
__ b(vs, chunk_->GetAssemblyLabel(false_block)); |
} else { |
if (right->IsConstantOperand()) { |
- __ cmp(ToRegister(left), |
- Operand(ToInteger32(LConstantOperand::cast(right)))); |
+ int32_t value = ToInteger32(LConstantOperand::cast(right)); |
+ if (instr->hydrogen_value()->representation().IsSmi()) { |
+ __ cmp(ToRegister(left), Operand(Smi::FromInt(value))); |
+ } else { |
+ __ cmp(ToRegister(left), Operand(value)); |
+ } |
} else if (left->IsConstantOperand()) { |
- __ cmp(ToRegister(right), |
- Operand(ToInteger32(LConstantOperand::cast(left)))); |
+ int32_t value = ToInteger32(LConstantOperand::cast(left)); |
+ if (instr->hydrogen_value()->representation().IsSmi()) { |
+ __ cmp(ToRegister(right), Operand(Smi::FromInt(value))); |
+ } else { |
+ __ cmp(ToRegister(right), Operand(value)); |
+ } |
// We transposed the operands. Reverse the condition. |
cond = ReverseCondition(cond); |
} else { |