Commit f0d88f90 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: Introduce a code stub version of Array.prototype.push

Port 1134688c

Original commit message:
    This roughly doubles performance for generic Array.prototype.push.

R=verwaest@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

Review URL: https://codereview.chromium.org/1823103002

Cr-Commit-Position: refs/heads/master@{#34999}
parent 69e8bb43
......@@ -3206,7 +3206,7 @@ void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
if (instr->hydrogen()->from_inlined()) {
__ subi(result, sp, Operand(2 * kPointerSize));
} else {
} else if (instr->hydrogen()->arguments_adaptor()) {
// Check if the calling frame is an arguments adaptor frame.
__ LoadP(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
__ LoadP(
......@@ -3228,6 +3228,8 @@ void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
__ mr(result, scratch);
__ bind(&done);
}
} else {
__ mr(result, fp);
}
}
......
......@@ -77,6 +77,10 @@ void InternalArrayNoArgumentConstructorStub::InitializeDescriptor(
InitializeInternalArrayConstructorDescriptor(isolate(), descriptor, 0);
}
void FastArrayPushStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
Address deopt_handler = Runtime::FunctionForId(Runtime::kArrayPush)->entry;
descriptor->Initialize(r3, deopt_handler, -1, JS_FUNCTION_STUB_MODE);
}
void InternalArraySingleArgumentConstructorStub::InitializeDescriptor(
CodeStubDescriptor* descriptor) {
......
......@@ -287,6 +287,12 @@ void InternalArrayConstructorDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void FastArrayPushDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
// stack param count needs (arg count)
Register registers[] = {r3};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void CompareDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment