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

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: Fixed failing bytecode-array-builder-unittest 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
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..509336bdf3772554842c79b56804e706e1c276bd 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 index) {
rmcilroy 2016/02/03 14:00:56 /s/index/rest_index
mythria 2016/02/03 15:56:15 Done.
FrameStateBeforeAndAfter states(this);
- const Operator* op = javascript()->CreateArguments(type, 0);
+ const Operator* op = javascript()->CreateArguments(type, 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) {

Powered by Google App Engine
This is Rietveld 408576698