Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index 17bdcf5f0a80016b5130f54a8f5f278a363bb0ab..4425045bd2ca1eab7b0b1c98339b63ffd9369211 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -236,6 +236,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. |
@@ -257,7 +277,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; |