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

Side by Side Diff: src/prettyprinter.cc

Issue 938443002: [es6] implement spread calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase + clang-format 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 <stdarg.h> 5 #include <stdarg.h>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/ast-value-factory.h" 9 #include "src/ast-value-factory.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 void CallPrinter::VisitCompareOperation(CompareOperation* node) { 369 void CallPrinter::VisitCompareOperation(CompareOperation* node) {
370 Print("("); 370 Print("(");
371 Find(node->left(), true); 371 Find(node->left(), true);
372 Print(" %s ", Token::String(node->op())); 372 Print(" %s ", Token::String(node->op()));
373 Find(node->right(), true); 373 Find(node->right(), true);
374 Print(")"); 374 Print(")");
375 } 375 }
376 376
377 377
378 void CallPrinter::VisitSpread(Spread* node) {
379 Print("(...");
380 Find(node->expression(), true);
381 Print(")");
382 }
383
384
378 void CallPrinter::VisitThisFunction(ThisFunction* node) {} 385 void CallPrinter::VisitThisFunction(ThisFunction* node) {}
379 386
380 387
381 void CallPrinter::VisitSuperReference(SuperReference* node) {} 388 void CallPrinter::VisitSuperReference(SuperReference* node) {}
382 389
383 390
384 void CallPrinter::FindStatements(ZoneList<Statement*>* statements) { 391 void CallPrinter::FindStatements(ZoneList<Statement*>* statements) {
385 if (statements == NULL) return; 392 if (statements == NULL) return;
386 for (int i = 0; i < statements->length(); i++) { 393 for (int i = 0; i < statements->length(); i++) {
387 Find(statements->at(i)); 394 Find(statements->at(i));
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 870
864 void PrettyPrinter::VisitCompareOperation(CompareOperation* node) { 871 void PrettyPrinter::VisitCompareOperation(CompareOperation* node) {
865 Print("("); 872 Print("(");
866 Visit(node->left()); 873 Visit(node->left());
867 Print(" %s ", Token::String(node->op())); 874 Print(" %s ", Token::String(node->op()));
868 Visit(node->right()); 875 Visit(node->right());
869 Print(")"); 876 Print(")");
870 } 877 }
871 878
872 879
880 void PrettyPrinter::VisitSpread(Spread* node) {
881 Print("(...");
882 Visit(node->expression());
883 Print(")");
884 }
885
886
873 void PrettyPrinter::VisitThisFunction(ThisFunction* node) { 887 void PrettyPrinter::VisitThisFunction(ThisFunction* node) {
874 Print("<this-function>"); 888 Print("<this-function>");
875 } 889 }
876 890
877 891
878 void PrettyPrinter::VisitSuperReference(SuperReference* node) { 892 void PrettyPrinter::VisitSuperReference(SuperReference* node) {
879 Print("<super-reference>"); 893 Print("<super-reference>");
880 } 894 }
881 895
882 896
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 } 1580 }
1567 1581
1568 1582
1569 void AstPrinter::VisitCompareOperation(CompareOperation* node) { 1583 void AstPrinter::VisitCompareOperation(CompareOperation* node) {
1570 IndentedScope indent(this, Token::Name(node->op())); 1584 IndentedScope indent(this, Token::Name(node->op()));
1571 Visit(node->left()); 1585 Visit(node->left());
1572 Visit(node->right()); 1586 Visit(node->right());
1573 } 1587 }
1574 1588
1575 1589
1590 void AstPrinter::VisitSpread(Spread* node) {
1591 IndentedScope indent(this, "...");
1592 Visit(node->expression());
1593 }
1594
1595
1576 void AstPrinter::VisitThisFunction(ThisFunction* node) { 1596 void AstPrinter::VisitThisFunction(ThisFunction* node) {
1577 IndentedScope indent(this, "THIS-FUNCTION"); 1597 IndentedScope indent(this, "THIS-FUNCTION");
1578 } 1598 }
1579 1599
1580 1600
1581 void AstPrinter::VisitSuperReference(SuperReference* node) { 1601 void AstPrinter::VisitSuperReference(SuperReference* node) {
1582 IndentedScope indent(this, "SUPER-REFERENCE"); 1602 IndentedScope indent(this, "SUPER-REFERENCE");
1583 } 1603 }
1584 1604
1585 #endif // DEBUG 1605 #endif // DEBUG
1586 1606
1587 } } // namespace v8::internal 1607 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/preparser.cc ('k') | src/runtime/runtime.h » ('j') | test/js-perf-test/JSTests.json » ('J')

Powered by Google App Engine
This is Rietveld 408576698