Chromium Code Reviews| Index: src/crankshaft/ia32/lithium-ia32.cc |
| diff --git a/src/crankshaft/ia32/lithium-ia32.cc b/src/crankshaft/ia32/lithium-ia32.cc |
| index 12f76194b9c4f741ee38006ccf2dd02131700c9f..4a99163ca94782447e22e10b404cc629ac9a701c 100644 |
| --- a/src/crankshaft/ia32/lithium-ia32.cc |
| +++ b/src/crankshaft/ia32/lithium-ia32.cc |
| @@ -2406,14 +2406,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); |
|
Michael Lippautz
2016/05/10 08:32:58
Why don't we need to add the pointer to the pointe
Hannes Payer (out of office)
2016/05/10 09:04:44
A folded allocation does not need a safepoint.
|
| + } else { |
| + info()->MarkAsDeferredCalling(); |
| + LOperand* context = UseAny(instr->context()); |
| + LOperand* temp = TempRegister(); |
| + LAllocate* result = new (zone()) LAllocate(context, size, temp); |
| + return AssignPointerMap(DefineAsRegister(result)); |
| + } |
| } |