Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Side by Side Diff: src/prettyprinter.cc

Issue 62146: Add name inference for anonymous functions to facilitate debugging and profiling of JS code. (Closed)
Patch Set: updated v8_base_arm project Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects-inl.h ('k') | src/rewriter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698