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

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

Issue 1272673003: [es6] Re-implement rest parameters via desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Oops. Created 5 years, 3 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/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 10abec7b8824741217a09e39e69e8e35b4a9224c..4043c4ab2b7931b85153a10f4b2cf6f1022b0114 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -568,11 +568,6 @@ void AstGraphBuilder::CreateGraphBody(bool stack_check) {
// Build the arguments object if it is used.
BuildArgumentsObject(scope->arguments());
- // Build rest arguments array if it is used.
- int rest_index;
- Variable* rest_parameter = scope->rest_parameter(&rest_index);
- BuildRestArgumentsArray(rest_parameter, rest_index);
-
// Build assignment to {.this_function} variable if it is used.
BuildThisFunctionVariable(scope->this_function_var());
@@ -3192,24 +3187,6 @@ Node* AstGraphBuilder::BuildArgumentsObject(Variable* arguments) {
}
-Node* AstGraphBuilder::BuildRestArgumentsArray(Variable* rest, int index) {
- if (rest == NULL) return NULL;
-
- DCHECK(index >= 0);
- const Operator* op = javascript()->CallRuntime(Runtime::kNewRestParamSlow, 2);
- Node* object = NewNode(op, jsgraph()->SmiConstant(index),
- jsgraph()->SmiConstant(language_mode()));
-
- // Assign the object to the rest parameter variable.
- DCHECK(rest->IsContextSlot() || rest->IsStackAllocated());
- // This should never lazy deopt, so it is fine to send invalid bailout id.
- FrameStateBeforeAndAfter states(this, BailoutId::None());
- BuildVariableAssignment(rest, object, Token::ASSIGN, VectorSlotPair(),
- BailoutId::None(), states);
- return object;
-}
-
-
Node* AstGraphBuilder::BuildThisFunctionVariable(Variable* this_function_var) {
if (this_function_var == nullptr) return nullptr;
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/linkage.cc » ('j') | src/parser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698