OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 } | 290 } |
291 | 291 |
292 | 292 |
293 void PrettyPrinter::VisitFunctionLiteral(FunctionLiteral* node) { | 293 void PrettyPrinter::VisitFunctionLiteral(FunctionLiteral* node) { |
294 Print("("); | 294 Print("("); |
295 PrintFunctionLiteral(node); | 295 PrintFunctionLiteral(node); |
296 Print(")"); | 296 Print(")"); |
297 } | 297 } |
298 | 298 |
299 | 299 |
300 void PrettyPrinter::VisitSharedFunctionInfoLiteral( | 300 void PrettyPrinter::VisitNativeFunctionLiteral(NativeFunctionLiteral* node) { |
301 SharedFunctionInfoLiteral* node) { | |
302 Print("("); | 301 Print("("); |
303 PrintLiteral(node->shared_function_info(), true); | 302 PrintLiteral(node->name(), false); |
304 Print(")"); | 303 Print(")"); |
305 } | 304 } |
306 | 305 |
307 | 306 |
308 void PrettyPrinter::VisitConditional(Conditional* node) { | 307 void PrettyPrinter::VisitConditional(Conditional* node) { |
309 Visit(node->condition()); | 308 Visit(node->condition()); |
310 Print(" ? "); | 309 Print(" ? "); |
311 Visit(node->then_expression()); | 310 Visit(node->then_expression()); |
312 Print(" : "); | 311 Print(" : "); |
313 Visit(node->else_expression()); | 312 Visit(node->else_expression()); |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 PrintLiteralIndented("NAME", node->name(), false); | 974 PrintLiteralIndented("NAME", node->name(), false); |
976 PrintLiteralIndented("INFERRED NAME", node->inferred_name(), false); | 975 PrintLiteralIndented("INFERRED NAME", node->inferred_name(), false); |
977 PrintParameters(node->scope()); | 976 PrintParameters(node->scope()); |
978 // We don't want to see the function literal in this case: it | 977 // We don't want to see the function literal in this case: it |
979 // will be printed via PrintProgram when the code for it is | 978 // will be printed via PrintProgram when the code for it is |
980 // generated. | 979 // generated. |
981 // PrintStatements(node->body()); | 980 // PrintStatements(node->body()); |
982 } | 981 } |
983 | 982 |
984 | 983 |
985 void AstPrinter::VisitSharedFunctionInfoLiteral( | 984 void AstPrinter::VisitNativeFunctionLiteral(NativeFunctionLiteral* node) { |
986 SharedFunctionInfoLiteral* node) { | 985 IndentedScope indent(this, "NATIVE FUNC LITERAL"); |
987 IndentedScope indent(this, "FUNC LITERAL"); | 986 PrintLiteralIndented("NAME", node->name(), false); |
988 PrintLiteralIndented("SHARED INFO", node->shared_function_info(), true); | |
989 } | 987 } |
990 | 988 |
991 | 989 |
992 void AstPrinter::VisitConditional(Conditional* node) { | 990 void AstPrinter::VisitConditional(Conditional* node) { |
993 IndentedScope indent(this, "CONDITIONAL"); | 991 IndentedScope indent(this, "CONDITIONAL"); |
994 PrintIndentedVisit("CONDITION", node->condition()); | 992 PrintIndentedVisit("CONDITION", node->condition()); |
995 PrintIndentedVisit("THEN", node->then_expression()); | 993 PrintIndentedVisit("THEN", node->then_expression()); |
996 PrintIndentedVisit("ELSE", node->else_expression()); | 994 PrintIndentedVisit("ELSE", node->else_expression()); |
997 } | 995 } |
998 | 996 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1160 } | 1158 } |
1161 | 1159 |
1162 | 1160 |
1163 void AstPrinter::VisitThisFunction(ThisFunction* node) { | 1161 void AstPrinter::VisitThisFunction(ThisFunction* node) { |
1164 IndentedScope indent(this, "THIS-FUNCTION"); | 1162 IndentedScope indent(this, "THIS-FUNCTION"); |
1165 } | 1163 } |
1166 | 1164 |
1167 #endif // DEBUG | 1165 #endif // DEBUG |
1168 | 1166 |
1169 } } // namespace v8::internal | 1167 } } // namespace v8::internal |
OLD | NEW |