OLD | NEW |
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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 | 374 |
375 void CallPrinter::VisitCompareOperation(CompareOperation* node) { | 375 void CallPrinter::VisitCompareOperation(CompareOperation* node) { |
376 Print("("); | 376 Print("("); |
377 Find(node->left(), true); | 377 Find(node->left(), true); |
378 Print(" %s ", Token::String(node->op())); | 378 Print(" %s ", Token::String(node->op())); |
379 Find(node->right(), true); | 379 Find(node->right(), true); |
380 Print(")"); | 380 Print(")"); |
381 } | 381 } |
382 | 382 |
383 | 383 |
| 384 void CallPrinter::VisitSpreadOperation(SpreadOperation* node) { |
| 385 Print("(..."); |
| 386 Find(node->expression(), true); |
| 387 Print(")"); |
| 388 } |
| 389 |
| 390 |
384 void CallPrinter::VisitThisFunction(ThisFunction* node) {} | 391 void CallPrinter::VisitThisFunction(ThisFunction* node) {} |
385 | 392 |
386 | 393 |
387 void CallPrinter::VisitSuperReference(SuperReference* node) {} | 394 void CallPrinter::VisitSuperReference(SuperReference* node) {} |
388 | 395 |
389 | 396 |
390 void CallPrinter::FindStatements(ZoneList<Statement*>* statements) { | 397 void CallPrinter::FindStatements(ZoneList<Statement*>* statements) { |
391 if (statements == NULL) return; | 398 if (statements == NULL) return; |
392 for (int i = 0; i < statements->length(); i++) { | 399 for (int i = 0; i < statements->length(); i++) { |
393 Find(statements->at(i)); | 400 Find(statements->at(i)); |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 | 883 |
877 void PrettyPrinter::VisitCompareOperation(CompareOperation* node) { | 884 void PrettyPrinter::VisitCompareOperation(CompareOperation* node) { |
878 Print("("); | 885 Print("("); |
879 Visit(node->left()); | 886 Visit(node->left()); |
880 Print(" %s ", Token::String(node->op())); | 887 Print(" %s ", Token::String(node->op())); |
881 Visit(node->right()); | 888 Visit(node->right()); |
882 Print(")"); | 889 Print(")"); |
883 } | 890 } |
884 | 891 |
885 | 892 |
| 893 void PrettyPrinter::VisitSpreadOperation(SpreadOperation* node) { |
| 894 Print("(..."); |
| 895 Visit(node->expression()); |
| 896 Print(")"); |
| 897 } |
| 898 |
| 899 |
886 void PrettyPrinter::VisitThisFunction(ThisFunction* node) { | 900 void PrettyPrinter::VisitThisFunction(ThisFunction* node) { |
887 Print("<this-function>"); | 901 Print("<this-function>"); |
888 } | 902 } |
889 | 903 |
890 | 904 |
891 void PrettyPrinter::VisitSuperReference(SuperReference* node) { | 905 void PrettyPrinter::VisitSuperReference(SuperReference* node) { |
892 Print("<super-reference>"); | 906 Print("<super-reference>"); |
893 } | 907 } |
894 | 908 |
895 | 909 |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1586 } | 1600 } |
1587 | 1601 |
1588 | 1602 |
1589 void AstPrinter::VisitCompareOperation(CompareOperation* node) { | 1603 void AstPrinter::VisitCompareOperation(CompareOperation* node) { |
1590 IndentedScope indent(this, Token::Name(node->op())); | 1604 IndentedScope indent(this, Token::Name(node->op())); |
1591 Visit(node->left()); | 1605 Visit(node->left()); |
1592 Visit(node->right()); | 1606 Visit(node->right()); |
1593 } | 1607 } |
1594 | 1608 |
1595 | 1609 |
| 1610 void AstPrinter::VisitSpreadOperation(SpreadOperation* node) { |
| 1611 IndentedScope indent(this, "..."); |
| 1612 Visit(node->expression()); |
| 1613 } |
| 1614 |
| 1615 |
1596 void AstPrinter::VisitThisFunction(ThisFunction* node) { | 1616 void AstPrinter::VisitThisFunction(ThisFunction* node) { |
1597 IndentedScope indent(this, "THIS-FUNCTION"); | 1617 IndentedScope indent(this, "THIS-FUNCTION"); |
1598 } | 1618 } |
1599 | 1619 |
1600 | 1620 |
1601 void AstPrinter::VisitSuperReference(SuperReference* node) { | 1621 void AstPrinter::VisitSuperReference(SuperReference* node) { |
1602 IndentedScope indent(this, "SUPER-REFERENCE"); | 1622 IndentedScope indent(this, "SUPER-REFERENCE"); |
1603 } | 1623 } |
1604 | 1624 |
1605 #endif // DEBUG | 1625 #endif // DEBUG |
1606 | 1626 |
1607 } } // namespace v8::internal | 1627 } } // namespace v8::internal |
OLD | NEW |