Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index d4c17ab4708a03ab49de4ff34fe5ede8f4c24c8d..10deb9a3a0d214b14e87f31bc91a8adf0c16fe32 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -1653,6 +1653,21 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { |
return result; |
} else if (instr->representation().IsDouble()) { |
return DoArithmeticD(Token::ADD, instr); |
+ } else if (instr->representation().IsExternal()) { |
+ ASSERT(instr->left()->representation().IsExternal()); |
+ ASSERT(instr->right()->representation().IsInteger32()); |
+ ASSERT(!instr->CheckFlag(HValue::kCanOverflow)); |
+ bool use_lea = LAddI::UseLea(instr); |
+ LOperand* left = UseRegisterAtStart(instr->left()); |
+ HValue* right_candidate = instr->right(); |
+ LOperand* right = use_lea |
+ ? UseRegisterOrConstantAtStart(right_candidate) |
+ : UseOrConstantAtStart(right_candidate); |
+ LAddI* add = new(zone()) LAddI(left, right); |
+ LInstruction* result = use_lea |
+ ? DefineAsRegister(add) |
+ : DefineSameAsFirst(add); |
+ return result; |
} else { |
return DoArithmeticT(Token::ADD, instr); |
} |