Index: src/s390/builtins-s390.cc |
diff --git a/src/s390/builtins-s390.cc b/src/s390/builtins-s390.cc |
index e02fd5b4d872f76b5b33c2aa13ee606e9c731b76..2d521db65e3fb6ef4dce1e0633884c4ff8c71a5c 100644 |
--- a/src/s390/builtins-s390.cc |
+++ b/src/s390/builtins-s390.cc |
@@ -2691,6 +2691,41 @@ void Builtins::Generate_Construct(MacroAssembler* masm) { |
RelocInfo::CODE_TARGET); |
} |
+// static |
+void Builtins::Generate_AllocateInNewSpace(MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- r3 : requested object size (untagged) |
+ // -- lr : return address |
+ // ----------------------------------- |
+ Label runtime; |
+ __ Allocate(r3, r2, r4, r5, &runtime, NO_ALLOCATION_FLAGS); |
+ __ Ret(); |
+ |
+ __ bind(&runtime); |
+ __ SmiTag(r3); |
+ __ Push(r3); |
+ __ LoadSmiLiteral(cp, Smi::FromInt(0)); |
+ __ TailCallRuntime(Runtime::kAllocateInNewSpace); |
+} |
+ |
+// static |
+void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- r3 : requested object size (untagged) |
+ // -- lr : return address |
+ // ----------------------------------- |
+ Label runtime; |
+ __ Allocate(r3, r2, r4, r5, &runtime, PRETENURE); |
+ __ Ret(); |
+ |
+ __ bind(&runtime); |
+ __ SmiTag(r3); |
+ __ LoadSmiLiteral(r4, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); |
+ __ Push(r3, r4); |
+ __ LoadSmiLiteral(cp, Smi::FromInt(0)); |
+ __ TailCallRuntime(Runtime::kAllocateInTargetSpace); |
+} |
+ |
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
// ----------- S t a t e ------------- |
// -- r2 : actual number of arguments |