Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: src/arm64/full-codegen-arm64.cc

Issue 816913003: Implement ES6 rest parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable optimization of functions with rest parameters in parser Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/arm64/full-codegen-arm64.cc
diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc
index c6d32670ee7e5e99c9add5f014c7dc6a2c7cfd67..dca9244b2611d2ed5d72c8fc8edb46d29046325c 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.
@@ -263,7 +282,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()) {
Dmitry Lomov (no reviews) 2015/02/13 16:27:14 Is this just temporary and we later add support fo
caitp (gmail) 2015/02/13 16:30:45 This is specced (FunctionDeclarationInstantiation,
Dmitry Lomov (no reviews) 2015/02/13 16:41:08 Ah, thanks!
type = ArgumentsAccessStub::NEW_STRICT;
} else if (function()->has_duplicate_parameters()) {
type = ArgumentsAccessStub::NEW_SLOPPY_SLOW;
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/bailout-reason.h » ('j') | src/ia32/code-stubs-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698