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

Unified Diff: src/compiler/bytecode-graph-builder.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/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index fd78979297d3212313f1cfe6093946dfa99adfa7..0ea14b21820489a10fd0b1a5ddf55f6f6d88cc69 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -995,26 +995,23 @@ void BytecodeGraphBuilder::VisitCreateClosure() {
void BytecodeGraphBuilder::VisitCreateClosureWide() { VisitCreateClosure(); }
-void BytecodeGraphBuilder::BuildCreateArguments(
- CreateArgumentsParameters::Type type, int rest_index) {
+void BytecodeGraphBuilder::BuildCreateArguments(CreateArgumentsType type) {
FrameStateBeforeAndAfter states(this);
- const Operator* op = javascript()->CreateArguments(type, rest_index);
+ const Operator* op = javascript()->CreateArguments(type);
Node* object = NewNode(op, GetFunctionClosure());
environment()->BindAccumulator(object, &states);
}
void BytecodeGraphBuilder::VisitCreateMappedArguments() {
- BuildCreateArguments(CreateArgumentsParameters::kMappedArguments, 0);
+ BuildCreateArguments(CreateArgumentsType::kMappedArguments);
}
void BytecodeGraphBuilder::VisitCreateUnmappedArguments() {
- BuildCreateArguments(CreateArgumentsParameters::kUnmappedArguments, 0);
+ BuildCreateArguments(CreateArgumentsType::kUnmappedArguments);
}
-void BytecodeGraphBuilder::VisitCreateRestArguments() {
- int index =
- Smi::cast(*bytecode_iterator().GetConstantForIndexOperand(0))->value();
- BuildCreateArguments(CreateArgumentsParameters::kRestArray, index);
+void BytecodeGraphBuilder::VisitCreateRestParameter() {
+ BuildCreateArguments(CreateArgumentsType::kRestParameter);
}
void BytecodeGraphBuilder::BuildCreateLiteral(const Operator* op) {

Powered by Google App Engine
This is Rietveld 408576698