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

PPC: [runtime] Turn ArgumentAccessStub into FastNewSloppyArgumentsStub.

Port e0129d0f

Original commit message:
    Turn the fast case of ArgumentsAccessStub into a new stub
    FastNewSloppyArgumentsStub, which is similar to the existing
    FastNewStrictArgumentsStub, although not polished yet, and the slow
    case always went to the runtime anyway, so we can just directly emit
    a runtime call there.

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

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

Cr-Commit-Position: refs/heads/master@{#34005}
parent dd23044a
......@@ -283,23 +283,11 @@ void FullCodeGenerator::Generate() {
if (is_strict(language_mode()) || !has_simple_parameters()) {
FastNewStrictArgumentsStub stub(isolate());
__ CallStub(&stub);
} else if (literal()->has_duplicate_parameters()) {
__ Push(r4);
__ CallRuntime(Runtime::kNewSloppyArguments_Generic);
} else {
DCHECK(r4.is(ArgumentsAccessNewDescriptor::function()));
// Receiver is just before the parameters on the caller's stack.
int num_parameters = info->scope()->num_parameters();
int offset = num_parameters * kPointerSize;
__ LoadSmiLiteral(ArgumentsAccessNewDescriptor::parameter_count(),
Smi::FromInt(num_parameters));
__ addi(ArgumentsAccessNewDescriptor::parameter_pointer(), fp,
Operand(StandardFrameConstants::kCallerSPOffset + offset));
// Arguments to ArgumentsAccessStub:
// function, parameter pointer, parameter count.
// The stub will rewrite parameter pointer and parameter count if the
// previous stack frame was an arguments adapter frame.
ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType(
literal()->has_duplicate_parameters());
ArgumentsAccessStub stub(isolate(), type);
FastNewSloppyArgumentsStub stub(isolate());
__ CallStub(&stub);
}
......
This diff is collapsed.
......@@ -54,11 +54,6 @@ const Register StringCompareDescriptor::LeftRegister() { return r4; }
const Register StringCompareDescriptor::RightRegister() { return r3; }
const Register ArgumentsAccessNewDescriptor::function() { return r4; }
const Register ArgumentsAccessNewDescriptor::parameter_count() { return r5; }
const Register ArgumentsAccessNewDescriptor::parameter_pointer() { return r6; }
const Register ApiGetterDescriptor::function_address() { return r5; }
......@@ -93,6 +88,12 @@ void FastNewRestParameterDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void FastNewSloppyArgumentsDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {r4};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
void FastNewStrictArgumentsDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {r4};
......
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