Index: src/arm/lithium-arm.cc |
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc |
index 66c108d4fea7b70969aaa736178c184d7c7a1371..913957e806bef9fa9ea661b078ab07a2300416b7 100644 |
--- a/src/arm/lithium-arm.cc |
+++ b/src/arm/lithium-arm.cc |
@@ -552,6 +552,11 @@ LOperand* LChunkBuilder::UseRegisterOrConstantAtStart(HValue* value) { |
} |
+LOperand* LChunkBuilder::UseConstant(HValue* value) { |
+ return chunk_->DefineConstantOperand(HConstant::cast(value)); |
+} |
+ |
+ |
LOperand* LChunkBuilder::UseAny(HValue* value) { |
return value->IsConstant() |
? chunk_->DefineConstantOperand(HConstant::cast(value)) |
@@ -2378,7 +2383,9 @@ LInstruction* LChunkBuilder::DoAllocateObject(HAllocateObject* instr) { |
LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { |
info()->MarkAsDeferredCalling(); |
- LOperand* size = UseTempRegister(instr->size()); |
+ LOperand* size = instr->size()->IsConstant() |
+ ? UseConstant(instr->size()) |
+ : UseTempRegister(instr->size()); |
LOperand* temp1 = TempRegister(); |
LOperand* temp2 = TempRegister(); |
LAllocate* result = new(zone()) LAllocate(size, temp1, temp2); |