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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 | 878 |
879 | 879 |
880 void AstPrinter::VisitTryFinallyStatement(TryFinallyStatement* node) { | 880 void AstPrinter::VisitTryFinallyStatement(TryFinallyStatement* node) { |
881 IndentedScope indent(this, "TRY FINALLY", node->position()); | 881 IndentedScope indent(this, "TRY FINALLY", node->position()); |
882 PrintTryStatement(node); | 882 PrintTryStatement(node); |
883 PrintIndentedVisit("FINALLY", node->finally_block()); | 883 PrintIndentedVisit("FINALLY", node->finally_block()); |
884 } | 884 } |
885 | 885 |
886 void AstPrinter::PrintTryStatement(TryStatement* node) { | 886 void AstPrinter::PrintTryStatement(TryStatement* node) { |
887 PrintIndentedVisit("TRY", node->try_block()); | 887 PrintIndentedVisit("TRY", node->try_block()); |
888 PrintIndented("CATCH PREDICTED"); | 888 PrintIndented("CATCH PREDICTION"); |
889 Print(" %d\n", node->catch_predicted()); | 889 const char* prediction; |
| 890 switch (node->catch_prediction()) { |
| 891 case HandlerTable::UNCAUGHT: |
| 892 prediction = "UNCAUGHT"; |
| 893 break; |
| 894 case HandlerTable::CAUGHT: |
| 895 prediction = "CAUGHT"; |
| 896 break; |
| 897 case HandlerTable::PROMISE: |
| 898 prediction = "PROMISE"; |
| 899 break; |
| 900 } |
| 901 Print(" %s\n", prediction); |
890 } | 902 } |
891 | 903 |
892 void AstPrinter::VisitDebuggerStatement(DebuggerStatement* node) { | 904 void AstPrinter::VisitDebuggerStatement(DebuggerStatement* node) { |
893 IndentedScope indent(this, "DEBUGGER", node->position()); | 905 IndentedScope indent(this, "DEBUGGER", node->position()); |
894 } | 906 } |
895 | 907 |
896 | 908 |
897 void AstPrinter::VisitFunctionLiteral(FunctionLiteral* node) { | 909 void AstPrinter::VisitFunctionLiteral(FunctionLiteral* node) { |
898 IndentedScope indent(this, "FUNC LITERAL", node->position()); | 910 IndentedScope indent(this, "FUNC LITERAL", node->position()); |
899 PrintLiteralIndented("NAME", node->name(), false); | 911 PrintLiteralIndented("NAME", node->name(), false); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1175 | 1187 |
1176 void AstPrinter::VisitRewritableExpression(RewritableExpression* node) { | 1188 void AstPrinter::VisitRewritableExpression(RewritableExpression* node) { |
1177 Visit(node->expression()); | 1189 Visit(node->expression()); |
1178 } | 1190 } |
1179 | 1191 |
1180 | 1192 |
1181 #endif // DEBUG | 1193 #endif // DEBUG |
1182 | 1194 |
1183 } // namespace internal | 1195 } // namespace internal |
1184 } // namespace v8 | 1196 } // namespace v8 |
OLD | NEW |