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

Side by Side Diff: src/prettyprinter.cc

Issue 11093074: Get rid of static module allocation, do it in code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed last comments; added other back-ends Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « src/parser.cc ('k') | src/property-details.h » ('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 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 PrintLiteral(node->name(), false); 115 PrintLiteral(node->name(), false);
116 } 116 }
117 117
118 118
119 void PrettyPrinter::VisitModuleUrl(ModuleUrl* node) { 119 void PrettyPrinter::VisitModuleUrl(ModuleUrl* node) {
120 Print("at "); 120 Print("at ");
121 PrintLiteral(node->url(), true); 121 PrintLiteral(node->url(), true);
122 } 122 }
123 123
124 124
125 void PrettyPrinter::VisitModuleStatement(ModuleStatement* node) {
126 Print("module ");
127 PrintLiteral(node->proxy()->name(), false);
128 Print(" ");
129 Visit(node->body());
130 }
131
132
125 void PrettyPrinter::VisitExpressionStatement(ExpressionStatement* node) { 133 void PrettyPrinter::VisitExpressionStatement(ExpressionStatement* node) {
126 Visit(node->expression()); 134 Visit(node->expression());
127 Print(";"); 135 Print(";");
128 } 136 }
129 137
130 138
131 void PrettyPrinter::VisitEmptyStatement(EmptyStatement* node) { 139 void PrettyPrinter::VisitEmptyStatement(EmptyStatement* node) {
132 Print(";"); 140 Print(";");
133 } 141 }
134 142
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 PrintIndentedVisit("MODULE", node->module()); 823 PrintIndentedVisit("MODULE", node->module());
816 PrintLiteralIndented("NAME", node->name(), false); 824 PrintLiteralIndented("NAME", node->name(), false);
817 } 825 }
818 826
819 827
820 void AstPrinter::VisitModuleUrl(ModuleUrl* node) { 828 void AstPrinter::VisitModuleUrl(ModuleUrl* node) {
821 PrintLiteralIndented("URL", node->url(), true); 829 PrintLiteralIndented("URL", node->url(), true);
822 } 830 }
823 831
824 832
833 void AstPrinter::VisitModuleStatement(ModuleStatement* node) {
834 IndentedScope indent(this, "MODULE");
835 PrintLiteralIndented("NAME", node->proxy()->name(), true);
836 PrintStatements(node->body()->statements());
837 }
838
839
825 void AstPrinter::VisitExpressionStatement(ExpressionStatement* node) { 840 void AstPrinter::VisitExpressionStatement(ExpressionStatement* node) {
826 Visit(node->expression()); 841 Visit(node->expression());
827 } 842 }
828 843
829 844
830 void AstPrinter::VisitEmptyStatement(EmptyStatement* node) { 845 void AstPrinter::VisitEmptyStatement(EmptyStatement* node) {
831 PrintIndented("EMPTY\n"); 846 PrintIndented("EMPTY\n");
832 } 847 }
833 848
834 849
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 } 1123 }
1109 1124
1110 1125
1111 void AstPrinter::VisitThisFunction(ThisFunction* node) { 1126 void AstPrinter::VisitThisFunction(ThisFunction* node) {
1112 IndentedScope indent(this, "THIS-FUNCTION"); 1127 IndentedScope indent(this, "THIS-FUNCTION");
1113 } 1128 }
1114 1129
1115 #endif // DEBUG 1130 #endif // DEBUG
1116 1131
1117 } } // namespace v8::internal 1132 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/property-details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698