Index: src/crankshaft/x64/lithium-x64.cc |
diff --git a/src/crankshaft/x64/lithium-x64.cc b/src/crankshaft/x64/lithium-x64.cc |
index 8a97b6871cf50c2bc23e3a427ac88c78f3f1bd69..04b39f638ddd89f5cb0c22ff6424e8891e333a05 100644 |
--- a/src/crankshaft/x64/lithium-x64.cc |
+++ b/src/crankshaft/x64/lithium-x64.cc |
@@ -2408,14 +2408,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)); |
+ } |
} |