Index: src/crankshaft/x87/lithium-x87.cc |
diff --git a/src/crankshaft/x87/lithium-x87.cc b/src/crankshaft/x87/lithium-x87.cc |
index 65c1c4db3c8edc7677bfda4bfb53b28e7352cb02..830c6d5bf1259c0d9619d4b56fc6f317f89a578e 100644 |
--- a/src/crankshaft/x87/lithium-x87.cc |
+++ b/src/crankshaft/x87/lithium-x87.cc |
@@ -2399,14 +2399,19 @@ LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) { |
LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { |
- info()->MarkAsDeferredCalling(); |
- LOperand* context = UseAny(instr->context()); |
- LOperand* size = instr->size()->IsConstant() |
- ? UseConstant(instr->size()) |
- : UseTempRegister(instr->size()); |
- LOperand* temp = TempRegister(); |
- LAllocate* result = new(zone()) LAllocate(context, size, temp); |
- return AssignPointerMap(DefineAsRegister(result)); |
+ LOperand* size = instr->size()->IsConstant() ? UseConstant(instr->size()) |
+ : UseRegister(instr->size()); |
+ if (instr->IsAllocationFolded()) { |
+ LOperand* temp = TempRegister(); |
+ LFastAllocate* result = new (zone()) LFastAllocate(size, temp); |
+ return DefineAsRegister(result); |
+ } else { |
+ info()->MarkAsDeferredCalling(); |
+ LOperand* context = UseAny(instr->context()); |
+ LOperand* temp = TempRegister(); |
+ LAllocate* result = new (zone()) LAllocate(context, size, temp); |
+ return AssignPointerMap(DefineAsRegister(result)); |
+ } |
} |