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

Port 1134688ced

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}
This commit is contained in:
mbrandy 2016-03-22 09:57:10 -07:00 committed by Commit bot
parent 69e8bb4357
commit f0d88f9084
3 changed files with 13 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -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) {

View File

@ -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) {