Index: src/mips/lithium-codegen-mips.cc |
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc |
index 0c2983f23e7c10e953084e2ccc85d885108b80d9..8b65653473a028f5a742c55770b234790bfecb80 100644 |
--- a/src/mips/lithium-codegen-mips.cc |
+++ b/src/mips/lithium-codegen-mips.cc |
@@ -5150,7 +5150,6 @@ void LCodeGen::DoAllocate(LAllocate* instr) { |
void LCodeGen::DoDeferredAllocate(LAllocate* instr) { |
- Register size = ToRegister(instr->size()); |
Register result = ToRegister(instr->result()); |
// TODO(3095996): Get rid of this. For now, we need to make the |
@@ -5159,8 +5158,16 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) { |
__ mov(result, zero_reg); |
PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); |
- __ SmiTag(size, size); |
- __ push(size); |
+ if (instr->size()->IsRegister()) { |
+ Register size = ToRegister(instr->size()); |
+ ASSERT(!size.is(result)); |
+ __ SmiTag(size); |
+ __ push(size); |
+ } else { |
+ int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
+ __ Push(Smi::FromInt(size)); |
+ } |
+ |
if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { |
CallRuntimeFromDeferred( |
Runtime::kAllocateInOldPointerSpace, 1, instr); |