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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 369 |
370 void CallPrinter::VisitCompareOperation(CompareOperation* node) { | 370 void CallPrinter::VisitCompareOperation(CompareOperation* node) { |
371 Print("("); | 371 Print("("); |
372 Find(node->left(), true); | 372 Find(node->left(), true); |
373 Print(" %s ", Token::String(node->op())); | 373 Print(" %s ", Token::String(node->op())); |
374 Find(node->right(), true); | 374 Find(node->right(), true); |
375 Print(")"); | 375 Print(")"); |
376 } | 376 } |
377 | 377 |
378 | 378 |
| 379 void CallPrinter::VisitSpreadOperation(SpreadOperation* node) { |
| 380 Print("(..."); |
| 381 Find(node->expression(), true); |
| 382 Print(")"); |
| 383 } |
| 384 |
| 385 |
379 void CallPrinter::VisitThisFunction(ThisFunction* node) {} | 386 void CallPrinter::VisitThisFunction(ThisFunction* node) {} |
380 | 387 |
381 | 388 |
382 void CallPrinter::VisitSuperReference(SuperReference* node) {} | 389 void CallPrinter::VisitSuperReference(SuperReference* node) {} |
383 | 390 |
384 | 391 |
385 void CallPrinter::FindStatements(ZoneList<Statement*>* statements) { | 392 void CallPrinter::FindStatements(ZoneList<Statement*>* statements) { |
386 if (statements == NULL) return; | 393 if (statements == NULL) return; |
387 for (int i = 0; i < statements->length(); i++) { | 394 for (int i = 0; i < statements->length(); i++) { |
388 Find(statements->at(i)); | 395 Find(statements->at(i)); |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 | 871 |
865 void PrettyPrinter::VisitCompareOperation(CompareOperation* node) { | 872 void PrettyPrinter::VisitCompareOperation(CompareOperation* node) { |
866 Print("("); | 873 Print("("); |
867 Visit(node->left()); | 874 Visit(node->left()); |
868 Print(" %s ", Token::String(node->op())); | 875 Print(" %s ", Token::String(node->op())); |
869 Visit(node->right()); | 876 Visit(node->right()); |
870 Print(")"); | 877 Print(")"); |
871 } | 878 } |
872 | 879 |
873 | 880 |
| 881 void PrettyPrinter::VisitSpreadOperation(SpreadOperation* node) { |
| 882 Print("(..."); |
| 883 Visit(node->expression()); |
| 884 Print(")"); |
| 885 } |
| 886 |
| 887 |
874 void PrettyPrinter::VisitThisFunction(ThisFunction* node) { | 888 void PrettyPrinter::VisitThisFunction(ThisFunction* node) { |
875 Print("<this-function>"); | 889 Print("<this-function>"); |
876 } | 890 } |
877 | 891 |
878 | 892 |
879 void PrettyPrinter::VisitSuperReference(SuperReference* node) { | 893 void PrettyPrinter::VisitSuperReference(SuperReference* node) { |
880 Print("<super-reference>"); | 894 Print("<super-reference>"); |
881 } | 895 } |
882 | 896 |
883 | 897 |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 } | 1581 } |
1568 | 1582 |
1569 | 1583 |
1570 void AstPrinter::VisitCompareOperation(CompareOperation* node) { | 1584 void AstPrinter::VisitCompareOperation(CompareOperation* node) { |
1571 IndentedScope indent(this, Token::Name(node->op())); | 1585 IndentedScope indent(this, Token::Name(node->op())); |
1572 Visit(node->left()); | 1586 Visit(node->left()); |
1573 Visit(node->right()); | 1587 Visit(node->right()); |
1574 } | 1588 } |
1575 | 1589 |
1576 | 1590 |
| 1591 void AstPrinter::VisitSpreadOperation(SpreadOperation* node) { |
| 1592 IndentedScope indent(this, "..."); |
| 1593 Visit(node->expression()); |
| 1594 } |
| 1595 |
| 1596 |
1577 void AstPrinter::VisitThisFunction(ThisFunction* node) { | 1597 void AstPrinter::VisitThisFunction(ThisFunction* node) { |
1578 IndentedScope indent(this, "THIS-FUNCTION"); | 1598 IndentedScope indent(this, "THIS-FUNCTION"); |
1579 } | 1599 } |
1580 | 1600 |
1581 | 1601 |
1582 void AstPrinter::VisitSuperReference(SuperReference* node) { | 1602 void AstPrinter::VisitSuperReference(SuperReference* node) { |
1583 IndentedScope indent(this, "SUPER-REFERENCE"); | 1603 IndentedScope indent(this, "SUPER-REFERENCE"); |
1584 } | 1604 } |
1585 | 1605 |
1586 #endif // DEBUG | 1606 #endif // DEBUG |
1587 | 1607 |
1588 } } // namespace v8::internal | 1608 } } // namespace v8::internal |
OLD | NEW |