Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index 9b648a33704ab45b09ea7a743c807de807b1894c..d2325b821f41a43a6d138924cf6275eec97aeb52 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -5104,7 +5104,13 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) { |
PushSafepointRegistersScope scope(this); |
__ Integer32ToSmi(size, size); |
__ push(size); |
- CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr); |
+ if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { |
+ CallRuntimeFromDeferred( |
+ Runtime::kAllocateInOldPointerSpace, 1, instr); |
+ } else { |
+ CallRuntimeFromDeferred( |
+ Runtime::kAllocateInNewSpace, 1, instr); |
+ } |
__ StoreToSafepointRegisterSlot(result, rax); |
} |