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

Unified Diff: src/compiler/bytecode-graph-builder.cc

Issue 1664593003: [Interpreter] Adds support for rest parameters to interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes comments. Created 4 years, 11 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
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index 44b0d39d7f9740461630f7251fce1621ea8de3eb..8119b873e56235d7d0d1a46932f4bca82af57782 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1017,19 +1017,25 @@ void BytecodeGraphBuilder::VisitCreateClosure() {
void BytecodeGraphBuilder::VisitCreateClosureWide() { VisitCreateClosure(); }
void BytecodeGraphBuilder::BuildCreateArguments(
- CreateArgumentsParameters::Type type) {
+ CreateArgumentsParameters::Type type, int rest_index) {
FrameStateBeforeAndAfter states(this);
- const Operator* op = javascript()->CreateArguments(type, 0);
+ const Operator* op = javascript()->CreateArguments(type, rest_index);
Node* object = NewNode(op, GetFunctionClosure());
environment()->BindAccumulator(object, &states);
}
void BytecodeGraphBuilder::VisitCreateMappedArguments() {
- BuildCreateArguments(CreateArgumentsParameters::kMappedArguments);
+ BuildCreateArguments(CreateArgumentsParameters::kMappedArguments, 0);
}
void BytecodeGraphBuilder::VisitCreateUnmappedArguments() {
- BuildCreateArguments(CreateArgumentsParameters::kUnmappedArguments);
+ BuildCreateArguments(CreateArgumentsParameters::kUnmappedArguments, 0);
+}
+
+void BytecodeGraphBuilder::VisitCreateRestArguments() {
+ int index =
+ Smi::cast(*bytecode_iterator().GetConstantForIndexOperand(0))->value();
+ BuildCreateArguments(CreateArgumentsParameters::kRestArray, index);
}
void BytecodeGraphBuilder::BuildCreateLiteral(const Operator* op) {
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698