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

Side by Side Diff: src/ast-numbering.cc

Issue 1053773006: [es6] implement default/optional parameters (WIP / comments) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/scopes.h" 9 #include "src/scopes.h"
10 10
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 void AstNumberingVisitor::VisitArguments(ZoneList<Expression*>* arguments) { 516 void AstNumberingVisitor::VisitArguments(ZoneList<Expression*>* arguments) {
517 for (int i = 0; i < arguments->length(); i++) { 517 for (int i = 0; i < arguments->length(); i++) {
518 Visit(arguments->at(i)); 518 Visit(arguments->at(i));
519 } 519 }
520 } 520 }
521 521
522 522
523 void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) { 523 void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) {
524 IncrementNodeCount(); 524 IncrementNodeCount();
525 node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids())); 525 node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids()));
526 if (node->default_values()->length()) {
527 VisitArguments(node->default_values());
arv (Not doing code reviews) 2015/04/10 15:08:48 How are the default_values arguments?
caitp (gmail) 2015/04/10 15:28:00 They aren't, VisitArguments() will visit each elem
528 }
529
526 // We don't recurse into the declarations or body of the function literal: 530 // We don't recurse into the declarations or body of the function literal:
527 // you have to separately Renumber() each FunctionLiteral that you compile. 531 // you have to separately Renumber() each FunctionLiteral that you compile.
528 } 532 }
529 533
530 534
531 bool AstNumberingVisitor::Finish(FunctionLiteral* node) { 535 bool AstNumberingVisitor::Finish(FunctionLiteral* node) {
532 node->set_ast_properties(&properties_); 536 node->set_ast_properties(&properties_);
533 node->set_dont_optimize_reason(dont_optimize_reason()); 537 node->set_dont_optimize_reason(dont_optimize_reason());
534 return !HasStackOverflow(); 538 return !HasStackOverflow();
535 } 539 }
(...skipping 23 matching lines...) Expand all
559 } 563 }
560 564
561 565
562 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, 566 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone,
563 FunctionLiteral* function) { 567 FunctionLiteral* function) {
564 AstNumberingVisitor visitor(isolate, zone); 568 AstNumberingVisitor visitor(isolate, zone);
565 return visitor.Renumber(function); 569 return visitor.Renumber(function);
566 } 570 }
567 } 571 }
568 } // namespace v8::internal 572 } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698