Index: src/x64/builtins-x64.cc |
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc |
index 478ea193e6383f52c7813442c8429476cc09cd54..a14fdf5b184a324196b06d39472a72fbe601d37d 100644 |
--- a/src/x64/builtins-x64.cc |
+++ b/src/x64/builtins-x64.cc |
@@ -2042,6 +2042,44 @@ static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { |
__ PushReturnAddressFrom(rcx); |
} |
+// static |
+void Builtins::Generate_AllocateInNewSpace(MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- rdx : requested object size (untagged) |
+ // -- rsp[0] : return address |
+ // ----------------------------------- |
+ Label runtime; |
+ __ Allocate(rdx, rax, rcx, rdi, &runtime, NO_ALLOCATION_FLAGS); |
+ __ Ret(); |
+ |
+ __ bind(&runtime); |
+ __ Integer32ToSmi(rdx, rdx); |
+ __ PopReturnAddressTo(rcx); |
+ __ Push(rdx); |
+ __ PushReturnAddressFrom(rcx); |
+ __ Move(rsi, Smi::FromInt(0)); |
+ __ TailCallRuntime(Runtime::kAllocateInNewSpace); |
+} |
+ |
+// static |
+void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- rdx : requested object size (untagged) |
+ // -- rsp[0] : return address |
+ // ----------------------------------- |
+ Label runtime; |
+ __ Allocate(rdx, rax, rcx, rdi, &runtime, PRETENURE); |
+ __ Ret(); |
+ |
+ __ bind(&runtime); |
+ __ Integer32ToSmi(rdx, rdx); |
+ __ PopReturnAddressTo(rcx); |
+ __ Push(rdx); |
+ __ Push(Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); |
+ __ PushReturnAddressFrom(rcx); |
+ __ Move(rsi, Smi::FromInt(0)); |
+ __ TailCallRuntime(Runtime::kAllocateInTargetSpace); |
+} |
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
// ----------- S t a t e ------------- |