Commit ede69c49 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [runtime] Turn ArgumentAccessStub into FastNewSloppyArgumentsStub.

  port e0129d0f (r33986)

  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.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34062}
parent c2abfe75
......@@ -269,23 +269,11 @@ void FullCodeGenerator::Generate() {
if (is_strict(language_mode()) || !has_simple_parameters()) {
FastNewStrictArgumentsStub stub(isolate());
__ CallStub(&stub);
} else if (literal()->has_duplicate_parameters()) {
__ Push(edi);
__ CallRuntime(Runtime::kNewSloppyArguments_Generic);
} else {
DCHECK(edi.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;
__ mov(ArgumentsAccessNewDescriptor::parameter_count(),
Immediate(Smi::FromInt(num_parameters)));
__ lea(ArgumentsAccessNewDescriptor::parameter_pointer(),
Operand(ebp, 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.
......@@ -59,11 +59,6 @@ const Register StringCompareDescriptor::LeftRegister() { return edx; }
const Register StringCompareDescriptor::RightRegister() { return eax; }
const Register ArgumentsAccessNewDescriptor::function() { return edi; }
const Register ArgumentsAccessNewDescriptor::parameter_count() { return ecx; }
const Register ArgumentsAccessNewDescriptor::parameter_pointer() { return edx; }
const Register ApiGetterDescriptor::function_address() { return edx; }
......@@ -98,6 +93,12 @@ void FastNewRestParameterDescriptor::InitializePlatformSpecific(
data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
}
void FastNewSloppyArgumentsDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {edi};
data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
}
void FastNewStrictArgumentsDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {edi};
......
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