| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 void AstPrinter::PrintIndentedVisit(const char* s, Node* node) { | 702 void AstPrinter::PrintIndentedVisit(const char* s, Node* node) { |
| 703 IndentedScope indent(s); | 703 IndentedScope indent(s); |
| 704 Visit(node); | 704 Visit(node); |
| 705 } | 705 } |
| 706 | 706 |
| 707 | 707 |
| 708 const char* AstPrinter::PrintProgram(FunctionLiteral* program) { | 708 const char* AstPrinter::PrintProgram(FunctionLiteral* program) { |
| 709 Init(); | 709 Init(); |
| 710 { IndentedScope indent("FUNC"); | 710 { IndentedScope indent("FUNC"); |
| 711 PrintLiteralIndented("NAME", program->name(), true); | 711 PrintLiteralIndented("NAME", program->name(), true); |
| 712 PrintLiteralIndented("INFERRED NAME", program->inferred_name(), true); |
| 712 PrintParameters(program->scope()); | 713 PrintParameters(program->scope()); |
| 713 PrintDeclarations(program->scope()->declarations()); | 714 PrintDeclarations(program->scope()->declarations()); |
| 714 PrintStatements(program->body()); | 715 PrintStatements(program->body()); |
| 715 } | 716 } |
| 716 return Output(); | 717 return Output(); |
| 717 } | 718 } |
| 718 | 719 |
| 719 | 720 |
| 720 void AstPrinter::PrintDeclarations(ZoneList<Declaration*>* declarations) { | 721 void AstPrinter::PrintDeclarations(ZoneList<Declaration*>* declarations) { |
| 721 if (declarations->length() > 0) { | 722 if (declarations->length() > 0) { |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 | 879 |
| 879 | 880 |
| 880 void AstPrinter::VisitDebuggerStatement(DebuggerStatement* node) { | 881 void AstPrinter::VisitDebuggerStatement(DebuggerStatement* node) { |
| 881 IndentedScope indent("DEBUGGER"); | 882 IndentedScope indent("DEBUGGER"); |
| 882 } | 883 } |
| 883 | 884 |
| 884 | 885 |
| 885 void AstPrinter::VisitFunctionLiteral(FunctionLiteral* node) { | 886 void AstPrinter::VisitFunctionLiteral(FunctionLiteral* node) { |
| 886 IndentedScope indent("FUNC LITERAL"); | 887 IndentedScope indent("FUNC LITERAL"); |
| 887 PrintLiteralIndented("NAME", node->name(), false); | 888 PrintLiteralIndented("NAME", node->name(), false); |
| 889 PrintLiteralIndented("INFERRED NAME", node->inferred_name(), false); |
| 888 PrintParameters(node->scope()); | 890 PrintParameters(node->scope()); |
| 889 // We don't want to see the function literal in this case: it | 891 // We don't want to see the function literal in this case: it |
| 890 // will be printed via PrintProgram when the code for it is | 892 // will be printed via PrintProgram when the code for it is |
| 891 // generated. | 893 // generated. |
| 892 // PrintStatements(node->body()); | 894 // PrintStatements(node->body()); |
| 893 } | 895 } |
| 894 | 896 |
| 895 | 897 |
| 896 void AstPrinter::VisitFunctionBoilerplateLiteral( | 898 void AstPrinter::VisitFunctionBoilerplateLiteral( |
| 897 FunctionBoilerplateLiteral* node) { | 899 FunctionBoilerplateLiteral* node) { |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 | 1093 |
| 1092 void AstPrinter::VisitThisFunction(ThisFunction* node) { | 1094 void AstPrinter::VisitThisFunction(ThisFunction* node) { |
| 1093 IndentedScope indent("THIS-FUNCTION"); | 1095 IndentedScope indent("THIS-FUNCTION"); |
| 1094 } | 1096 } |
| 1095 | 1097 |
| 1096 | 1098 |
| 1097 | 1099 |
| 1098 #endif // DEBUG | 1100 #endif // DEBUG |
| 1099 | 1101 |
| 1100 } } // namespace v8::internal | 1102 } } // namespace v8::internal |
| OLD | NEW |