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 "src/prettyprinter.h" | 5 #include "src/prettyprinter.h" |
6 | 6 |
7 #include <stdarg.h> | 7 #include <stdarg.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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
788 | 788 |
789 void PrettyPrinter::VisitCallNew(CallNew* node) { | 789 void PrettyPrinter::VisitCallNew(CallNew* node) { |
790 Print("new ("); | 790 Print("new ("); |
791 Visit(node->expression()); | 791 Visit(node->expression()); |
792 Print(")"); | 792 Print(")"); |
793 PrintArguments(node->arguments()); | 793 PrintArguments(node->arguments()); |
794 } | 794 } |
795 | 795 |
796 | 796 |
797 void PrettyPrinter::VisitCallRuntime(CallRuntime* node) { | 797 void PrettyPrinter::VisitCallRuntime(CallRuntime* node) { |
798 Print("%%"); | 798 Print("%%%s\n", node->function()->name); |
Michael Starzinger
2015/08/26 09:43:22
Is node guaranteed to have a runtime function or i
Yang
2015/08/26 10:27:30
Done.
| |
799 PrintLiteral(node->name(), false); | |
800 PrintArguments(node->arguments()); | 799 PrintArguments(node->arguments()); |
801 } | 800 } |
802 | 801 |
803 | 802 |
804 void PrettyPrinter::VisitUnaryOperation(UnaryOperation* node) { | 803 void PrettyPrinter::VisitUnaryOperation(UnaryOperation* node) { |
805 Token::Value op = node->op(); | 804 Token::Value op = node->op(); |
806 bool needsSpace = | 805 bool needsSpace = |
807 op == Token::DELETE || op == Token::TYPEOF || op == Token::VOID; | 806 op == Token::DELETE || op == Token::TYPEOF || op == Token::VOID; |
808 Print("(%s%s", Token::String(op), needsSpace ? " " : ""); | 807 Print("(%s%s", Token::String(op), needsSpace ? " " : ""); |
809 Visit(node->expression()); | 808 Visit(node->expression()); |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1516 | 1515 |
1517 void AstPrinter::VisitCallNew(CallNew* node) { | 1516 void AstPrinter::VisitCallNew(CallNew* node) { |
1518 IndentedScope indent(this, "CALL NEW"); | 1517 IndentedScope indent(this, "CALL NEW"); |
1519 Visit(node->expression()); | 1518 Visit(node->expression()); |
1520 PrintArguments(node->arguments()); | 1519 PrintArguments(node->arguments()); |
1521 } | 1520 } |
1522 | 1521 |
1523 | 1522 |
1524 void AstPrinter::VisitCallRuntime(CallRuntime* node) { | 1523 void AstPrinter::VisitCallRuntime(CallRuntime* node) { |
1525 EmbeddedVector<char, 128> buf; | 1524 EmbeddedVector<char, 128> buf; |
1526 FormatICSlotNode(&buf, node, "CALL RUNTIME", node->CallRuntimeFeedbackSlot()); | |
1527 IndentedScope indent(this, buf.start()); | 1525 IndentedScope indent(this, buf.start()); |
1528 PrintLiteralIndented("NAME", node->name(), false); | 1526 Print("NAME %s\n", node->function()->name); |
Michael Starzinger
2015/08/26 09:43:22
Likewise.
Yang
2015/08/26 10:27:30
Done.
| |
1529 PrintArguments(node->arguments()); | 1527 PrintArguments(node->arguments()); |
1530 } | 1528 } |
1531 | 1529 |
1532 | 1530 |
1533 void AstPrinter::VisitUnaryOperation(UnaryOperation* node) { | 1531 void AstPrinter::VisitUnaryOperation(UnaryOperation* node) { |
1534 IndentedScope indent(this, Token::Name(node->op())); | 1532 IndentedScope indent(this, Token::Name(node->op())); |
1535 Visit(node->expression()); | 1533 Visit(node->expression()); |
1536 } | 1534 } |
1537 | 1535 |
1538 | 1536 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1577 | 1575 |
1578 void AstPrinter::VisitSuperCallReference(SuperCallReference* node) { | 1576 void AstPrinter::VisitSuperCallReference(SuperCallReference* node) { |
1579 IndentedScope indent(this, "SUPER-CALL-REFERENCE"); | 1577 IndentedScope indent(this, "SUPER-CALL-REFERENCE"); |
1580 } | 1578 } |
1581 | 1579 |
1582 | 1580 |
1583 #endif // DEBUG | 1581 #endif // DEBUG |
1584 | 1582 |
1585 } // namespace internal | 1583 } // namespace internal |
1586 } // namespace v8 | 1584 } // namespace v8 |
OLD | NEW |