diff --git a/src/ppc/builtins-ppc.cc b/src/ppc/builtins-ppc.cc index 54d5008262..3c8ace7d54 100644 --- a/src/ppc/builtins-ppc.cc +++ b/src/ppc/builtins-ppc.cc @@ -2734,6 +2734,40 @@ void Builtins::Generate_Construct(MacroAssembler* masm) { RelocInfo::CODE_TARGET); } +// static +void Builtins::Generate_AllocateInNewSpace(MacroAssembler* masm) { + // ----------- S t a t e ------------- + // -- r4 : requested object size (untagged) + // -- lr : return address + // ----------------------------------- + Label runtime; + __ Allocate(r4, r3, r5, r6, &runtime, NO_ALLOCATION_FLAGS); + __ Ret(); + + __ bind(&runtime); + __ SmiTag(r4); + __ Push(r4); + __ LoadSmiLiteral(cp, Smi::FromInt(0)); + __ TailCallRuntime(Runtime::kAllocateInNewSpace); +} + +// static +void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) { + // ----------- S t a t e ------------- + // -- r4 : requested object size (untagged) + // -- lr : return address + // ----------------------------------- + Label runtime; + __ Allocate(r4, r3, r5, r6, &runtime, PRETENURE); + __ Ret(); + + __ bind(&runtime); + __ SmiTag(r4); + __ LoadSmiLiteral(r5, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); + __ Push(r4, r5); + __ LoadSmiLiteral(cp, Smi::FromInt(0)); + __ TailCallRuntime(Runtime::kAllocateInTargetSpace); +} void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { // ----------- S t a t e ------------- diff --git a/src/ppc/interface-descriptors-ppc.cc b/src/ppc/interface-descriptors-ppc.cc index e757f322dd..7465effc95 100644 --- a/src/ppc/interface-descriptors-ppc.cc +++ b/src/ppc/interface-descriptors-ppc.cc @@ -243,13 +243,6 @@ void AllocateHeapNumberDescriptor::InitializePlatformSpecific( SIMD128_TYPES(SIMD128_ALLOC_DESC) #undef SIMD128_ALLOC_DESC -void AllocateDescriptor::InitializePlatformSpecific( - CallInterfaceDescriptorData* data) { - Register registers[] = {r3}; - data->InitializePlatformSpecific(arraysize(registers), registers); -} - - void ArrayConstructorConstantArgCountDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { // register state diff --git a/src/ppc/macro-assembler-ppc.h b/src/ppc/macro-assembler-ppc.h index 6624998a0f..0c31f618a3 100644 --- a/src/ppc/macro-assembler-ppc.h +++ b/src/ppc/macro-assembler-ppc.h @@ -19,6 +19,7 @@ const Register kReturnRegister1 = {Register::kCode_r4}; const Register kReturnRegister2 = {Register::kCode_r5}; const Register kJSFunctionRegister = {Register::kCode_r4}; const Register kContextRegister = {Register::kCode_r30}; +const Register kAllocateSizeRegister = {Register::kCode_r4}; const Register kInterpreterAccumulatorRegister = {Register::kCode_r3}; const Register kInterpreterBytecodeOffsetRegister = {Register::kCode_r15}; const Register kInterpreterBytecodeArrayRegister = {Register::kCode_r16};