Index: src/x87/full-codegen-x87.cc |
diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc |
index 0afe5c74d2b4679471ef790c471e00a43f065a3d..0b43f8439f008942ea75e377b3f2c8383da5ec4f 100644 |
--- a/src/x87/full-codegen-x87.cc |
+++ b/src/x87/full-codegen-x87.cc |
@@ -233,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; |
+ __ lea(edx, |
+ Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset)); |
+ __ push(edx); |
+ __ push(Immediate(Smi::FromInt(num_parameters))); |
+ __ push(Immediate(Smi::FromInt(rest_index))); |
+ |
+ RestParamAccessStub stub(isolate()); |
+ __ CallStub(&stub); |
+ |
+ SetVar(rest_param, eax, ebx, edx); |
+ } |
+ |
Variable* arguments = scope()->arguments(); |
if (arguments != NULL) { |
// Function uses arguments object. |
@@ -254,7 +274,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; |