Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 8a8fe378df08764741b2994b4bb023d7235b12ee..30e0682039b22cd04737ce8029734179d610d942 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -240,6 +240,25 @@ 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; |
+ __ add(r3, fp, Operand(StandardFrameConstants::kCallerSPOffset + offset)); |
+ __ mov(r2, Operand(Smi::FromInt(num_parameters))); |
+ __ mov(r1, Operand(Smi::FromInt(rest_index))); |
+ __ Push(r3, r2, r1); |
+ |
+ RestParamAccessStub stub(isolate()); |
+ __ CallStub(&stub); |
+ |
+ SetVar(rest_param, r0, r1, r2); |
+ } |
+ |
Variable* arguments = scope()->arguments(); |
if (arguments != NULL) { |
// Function uses arguments object. |
@@ -267,7 +286,7 @@ void FullCodeGenerator::Generate() { |
? ArgumentsAccessStub::HAS_NEW_TARGET |
: ArgumentsAccessStub::NO_NEW_TARGET; |
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; |