Index: src/arm64/full-codegen-arm64.cc |
diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc |
index dd47e0f1639d8d60957a4dbccc5673f1011cb09f..7342038af014df3c36ba379ec9ee3d83edc5fef3 100644 |
--- a/src/arm64/full-codegen-arm64.cc |
+++ b/src/arm64/full-codegen-arm64.cc |
@@ -241,6 +241,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(x3, fp, StandardFrameConstants::kCallerSPOffset + offset); |
+ __ Mov(x2, Smi::FromInt(num_parameters)); |
+ __ Mov(x1, Smi::FromInt(rest_index)); |
+ __ Push(x3, x2, x1); |
+ |
+ RestParamAccessStub stub(isolate()); |
+ __ CallStub(&stub); |
+ |
+ SetVar(rest_param, x0, x1, x2); |
+ } |
+ |
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; |