| Index: src/full-codegen/x64/full-codegen-x64.cc
|
| diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc
|
| index d440ae8c3b7b79bf29ea64039e7cc3f959be35e8..28ed7fb1230c4673ce9e4081808fbcb1a6b74b5b 100644
|
| --- a/src/full-codegen/x64/full-codegen-x64.cc
|
| +++ b/src/full-codegen/x64/full-codegen-x64.cc
|
| @@ -262,27 +262,31 @@ void FullCodeGenerator::Generate() {
|
| // Arguments object must be allocated after the context object, in
|
| // case the "arguments" or ".arguments" variables are in the context.
|
| Comment cmnt(masm_, "[ Allocate arguments object");
|
| - DCHECK(rdi.is(ArgumentsAccessNewDescriptor::function()));
|
| if (!function_in_register) {
|
| __ movp(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
|
| }
|
| - // The receiver is just before the parameters on the caller's stack.
|
| - int num_parameters = info->scope()->num_parameters();
|
| - int offset = num_parameters * kPointerSize;
|
| - __ Move(ArgumentsAccessNewDescriptor::parameter_count(),
|
| - Smi::FromInt(num_parameters));
|
| - __ leap(ArgumentsAccessNewDescriptor::parameter_pointer(),
|
| - Operand(rbp, 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.
|
| - bool is_unmapped = is_strict(language_mode()) || !has_simple_parameters();
|
| - ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType(
|
| - is_unmapped, literal()->has_duplicate_parameters());
|
| - ArgumentsAccessStub stub(isolate(), type);
|
| - __ CallStub(&stub);
|
| + if (is_strict(language_mode()) || !has_simple_parameters()) {
|
| + FastNewStrictArgumentsStub stub(isolate());
|
| + __ CallStub(&stub);
|
| + } else {
|
| + DCHECK(rdi.is(ArgumentsAccessNewDescriptor::function()));
|
| + // The receiver is just before the parameters on the caller's stack.
|
| + int num_parameters = info->scope()->num_parameters();
|
| + int offset = num_parameters * kPointerSize;
|
| + __ Move(ArgumentsAccessNewDescriptor::parameter_count(),
|
| + Smi::FromInt(num_parameters));
|
| + __ leap(ArgumentsAccessNewDescriptor::parameter_pointer(),
|
| + Operand(rbp, 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);
|
| + __ CallStub(&stub);
|
| + }
|
|
|
| SetVar(arguments, rax, rbx, rdx);
|
| }
|
|
|