| 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/ast/prettyprinter.h" | 5 #include "src/ast/prettyprinter.h" |
| 6 | 6 |
| 7 #include <stdarg.h> | 7 #include <stdarg.h> |
| 8 | 8 |
| 9 #include "src/ast/ast-value-factory.h" | 9 #include "src/ast/ast-value-factory.h" |
| 10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
| (...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1424 PrintIndentedVisit("INIT", node->assign_iterator()); | 1424 PrintIndentedVisit("INIT", node->assign_iterator()); |
| 1425 PrintIndentedVisit("NEXT", node->next_result()); | 1425 PrintIndentedVisit("NEXT", node->next_result()); |
| 1426 PrintIndentedVisit("DONE", node->result_done()); | 1426 PrintIndentedVisit("DONE", node->result_done()); |
| 1427 PrintIndentedVisit("EACH", node->assign_each()); | 1427 PrintIndentedVisit("EACH", node->assign_each()); |
| 1428 PrintIndentedVisit("BODY", node->body()); | 1428 PrintIndentedVisit("BODY", node->body()); |
| 1429 } | 1429 } |
| 1430 | 1430 |
| 1431 | 1431 |
| 1432 void AstPrinter::VisitTryCatchStatement(TryCatchStatement* node) { | 1432 void AstPrinter::VisitTryCatchStatement(TryCatchStatement* node) { |
| 1433 IndentedScope indent(this, "TRY CATCH", node->position()); | 1433 IndentedScope indent(this, "TRY CATCH", node->position()); |
| 1434 PrintIndentedVisit("TRY", node->try_block()); | 1434 PrintTryStatement(node); |
| 1435 PrintLiteralWithModeIndented("CATCHVAR", | 1435 PrintLiteralWithModeIndented("CATCHVAR", |
| 1436 node->variable(), | 1436 node->variable(), |
| 1437 node->variable()->name()); | 1437 node->variable()->name()); |
| 1438 PrintIndentedVisit("CATCH", node->catch_block()); | 1438 PrintIndentedVisit("CATCH", node->catch_block()); |
| 1439 } | 1439 } |
| 1440 | 1440 |
| 1441 | 1441 |
| 1442 void AstPrinter::VisitTryFinallyStatement(TryFinallyStatement* node) { | 1442 void AstPrinter::VisitTryFinallyStatement(TryFinallyStatement* node) { |
| 1443 IndentedScope indent(this, "TRY FINALLY", node->position()); | 1443 IndentedScope indent(this, "TRY FINALLY", node->position()); |
| 1444 PrintIndentedVisit("TRY", node->try_block()); | 1444 PrintTryStatement(node); |
| 1445 PrintIndentedVisit("FINALLY", node->finally_block()); | 1445 PrintIndentedVisit("FINALLY", node->finally_block()); |
| 1446 } | 1446 } |
| 1447 | 1447 |
| 1448 void AstPrinter::PrintTryStatement(TryStatement* node) { |
| 1449 PrintIndentedVisit("TRY", node->try_block()); |
| 1450 PrintIndented("CATCH PREDICTED"); |
| 1451 Print(" %d\n", node->catch_predicted()); |
| 1452 } |
| 1448 | 1453 |
| 1449 void AstPrinter::VisitDebuggerStatement(DebuggerStatement* node) { | 1454 void AstPrinter::VisitDebuggerStatement(DebuggerStatement* node) { |
| 1450 IndentedScope indent(this, "DEBUGGER", node->position()); | 1455 IndentedScope indent(this, "DEBUGGER", node->position()); |
| 1451 } | 1456 } |
| 1452 | 1457 |
| 1453 | 1458 |
| 1454 void AstPrinter::VisitFunctionLiteral(FunctionLiteral* node) { | 1459 void AstPrinter::VisitFunctionLiteral(FunctionLiteral* node) { |
| 1455 IndentedScope indent(this, "FUNC LITERAL", node->position()); | 1460 IndentedScope indent(this, "FUNC LITERAL", node->position()); |
| 1456 PrintLiteralIndented("NAME", node->name(), false); | 1461 PrintLiteralIndented("NAME", node->name(), false); |
| 1457 PrintLiteralIndented("INFERRED NAME", node->inferred_name(), false); | 1462 PrintLiteralIndented("INFERRED NAME", node->inferred_name(), false); |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1732 | 1737 |
| 1733 void AstPrinter::VisitRewritableExpression(RewritableExpression* node) { | 1738 void AstPrinter::VisitRewritableExpression(RewritableExpression* node) { |
| 1734 Visit(node->expression()); | 1739 Visit(node->expression()); |
| 1735 } | 1740 } |
| 1736 | 1741 |
| 1737 | 1742 |
| 1738 #endif // DEBUG | 1743 #endif // DEBUG |
| 1739 | 1744 |
| 1740 } // namespace internal | 1745 } // namespace internal |
| 1741 } // namespace v8 | 1746 } // namespace v8 |
| OLD | NEW |