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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 1676883002: [runtime] Optimize and unify rest parameters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index e1bcb48a8d8d738ceb7ca40f7ca8a757668f4ac7..6a23812ae906566308e34373a9f4d98d59ef906c 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -587,7 +587,7 @@ void BytecodeGenerator::MakeBytecodeBody() {
// Build rest arguments array if it is used.
int rest_index;
Variable* rest_parameter = scope()->rest_parameter(&rest_index);
- VisitRestArgumentsArray(rest_parameter, rest_index);
+ VisitRestArgumentsArray(rest_parameter);
// Build assignment to {.this_function} variable if it is used.
VisitThisFunctionVariable(scope()->this_function_var());
@@ -2604,12 +2604,12 @@ void BytecodeGenerator::VisitArgumentsObject(Variable* variable) {
VisitVariableAssignment(variable, FeedbackVectorSlot::Invalid());
}
-void BytecodeGenerator::VisitRestArgumentsArray(Variable* rest, int index) {
+void BytecodeGenerator::VisitRestArgumentsArray(Variable* rest) {
if (rest == nullptr) return;
- // Allocate and initialize a new arguments object and assign to the {rest}
+ // Allocate and initialize a new rest parameter and assign to the {rest}
// variable.
- builder()->CreateRestArguments(index);
+ builder()->CreateArguments(CreateArgumentsType::kRestParameter);
DCHECK(rest->IsContextSlot() || rest->IsStackAllocated());
VisitVariableAssignment(rest, FeedbackVectorSlot::Invalid());
}

Powered by Google App Engine
This is Rietveld 408576698