Chromium Code Reviews| Index: src/x64/full-codegen-x64.cc |
| diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
| index b248dd1ebbf88f200e6ac44acdf87683e402f47c..7c2a1f3963090622c10881b5105851b660854cb6 100644 |
| --- a/src/x64/full-codegen-x64.cc |
| +++ b/src/x64/full-codegen-x64.cc |
| @@ -213,6 +213,7 @@ void FullCodeGenerator::Generate() { |
| if (var->IsContextSlot()) { |
| int parameter_offset = StandardFrameConstants::kCallerSPOffset + |
| (num_parameters - 1 - i) * kPointerSize; |
| + |
|
Dmitry Lomov (no reviews)
2015/02/11 00:30:50
Stray edit
caitp (gmail)
2015/02/11 21:05:54
Fixed.
|
| // Load parameter from stack. |
| __ movp(rax, Operand(rbp, parameter_offset)); |
| // Store it in the context. |
| @@ -232,6 +233,26 @@ void FullCodeGenerator::Generate() { |
| } |
| } |
| + // Possibly allocate RestParameters |
| + int rest_index; |
| + Variable* rest_param = scope()->rest_parameter(&rest_index); |
| + if (rest_param) { |
| + Comment cmnt(masm_, "[ Allocate rest parameter array"); |
| + |
| + int num_parameters = info->scope()->num_parameters(); |
| + int offset = num_parameters * kPointerSize; |
| + __ leap(rdx, |
| + Operand(rbp, StandardFrameConstants::kCallerSPOffset + offset)); |
| + __ Push(rdx); |
| + __ Push(Smi::FromInt(num_parameters)); |
| + __ Push(Smi::FromInt(rest_index)); |
| + |
| + RestParamAccessStub stub(isolate()); |
| + __ CallStub(&stub); |
| + |
| + SetVar(rest_param, rax, rbx, rdx); |
| + } |
| + |
| // Possibly allocate an arguments object. |
| Variable* arguments = scope()->arguments(); |
| if (arguments != NULL) { |
| @@ -255,7 +276,7 @@ void FullCodeGenerator::Generate() { |
| // The stub will rewrite receiver and parameter count if the previous |
| // stack frame was an arguments adapter frame. |
| ArgumentsAccessStub::Type type; |
| - if (is_strict(language_mode())) { |
| + if (is_strict(language_mode()) || !is_simple_parameter_list()) { |
| type = ArgumentsAccessStub::NEW_STRICT; |
| } else if (function()->has_duplicate_parameters()) { |
| type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; |