Index: src/mips64/builtins-mips64.cc |
diff --git a/src/mips64/builtins-mips64.cc b/src/mips64/builtins-mips64.cc |
index 5ed48912ed4c82ed88945b951e94a10df5756590..ac8cfa2e134cc64afabc5c60487e3df0b36a53df 100644 |
--- a/src/mips64/builtins-mips64.cc |
+++ b/src/mips64/builtins-mips64.cc |
@@ -2724,6 +2724,40 @@ void Builtins::Generate_Construct(MacroAssembler* masm) { |
RelocInfo::CODE_TARGET); |
} |
+// static |
+void Builtins::Generate_AllocateInNewSpace(MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- a0 : requested object size (untagged) |
+ // -- ra : return address |
+ // ----------------------------------- |
+ Label runtime; |
+ __ Allocate(a0, v0, a1, a2, &runtime, NO_ALLOCATION_FLAGS); |
+ __ Ret(); |
+ |
+ __ bind(&runtime); |
+ __ SmiTag(a0); |
+ __ Push(a0); |
+ __ Move(cp, Smi::FromInt(0)); |
+ __ TailCallRuntime(Runtime::kAllocateInNewSpace); |
+} |
+ |
+// static |
+void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- a0 : requested object size (untagged) |
+ // -- ra : return address |
+ // ----------------------------------- |
+ Label runtime; |
+ __ Allocate(a0, v0, a1, a2, &runtime, PRETENURE); |
+ __ Ret(); |
+ |
+ __ bind(&runtime); |
+ __ SmiTag(a0); |
+ __ Move(a1, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); |
+ __ Push(a0, a1); |
+ __ Move(cp, Smi::FromInt(0)); |
+ __ TailCallRuntime(Runtime::kAllocateInTargetSpace); |
+} |
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
// State setup as expected by MacroAssembler::InvokePrologue. |