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

Side by Side Diff: src/prettyprinter.cc

Issue 7003058: A collection of context-related refactoring changes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 } 123 }
124 124
125 125
126 void PrettyPrinter::VisitWithEnterStatement(WithEnterStatement* node) { 126 void PrettyPrinter::VisitWithEnterStatement(WithEnterStatement* node) {
127 Print("<enter with> ("); 127 Print("<enter with> (");
128 Visit(node->expression()); 128 Visit(node->expression());
129 Print(") "); 129 Print(") ");
130 } 130 }
131 131
132 132
133 void PrettyPrinter::VisitWithExitStatement(WithExitStatement* node) { 133 void PrettyPrinter::VisitContextExitStatement(ContextExitStatement* node) {
134 Print("<exit with>"); 134 Print("<exit context>");
135 } 135 }
136 136
137 137
138 void PrettyPrinter::VisitSwitchStatement(SwitchStatement* node) { 138 void PrettyPrinter::VisitSwitchStatement(SwitchStatement* node) {
139 PrintLabels(node->labels()); 139 PrintLabels(node->labels());
140 Print("switch ("); 140 Print("switch (");
141 Visit(node->tag()); 141 Visit(node->tag());
142 Print(") { "); 142 Print(") { ");
143 ZoneList<CaseClause*>* cases = node->cases(); 143 ZoneList<CaseClause*>* cases = node->cases();
144 for (int i = 0; i < cases->length(); i++) 144 for (int i = 0; i < cases->length(); i++)
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 void AstPrinter::VisitReturnStatement(ReturnStatement* node) { 795 void AstPrinter::VisitReturnStatement(ReturnStatement* node) {
796 PrintIndentedVisit("RETURN", node->expression()); 796 PrintIndentedVisit("RETURN", node->expression());
797 } 797 }
798 798
799 799
800 void AstPrinter::VisitWithEnterStatement(WithEnterStatement* node) { 800 void AstPrinter::VisitWithEnterStatement(WithEnterStatement* node) {
801 PrintIndentedVisit("WITH ENTER", node->expression()); 801 PrintIndentedVisit("WITH ENTER", node->expression());
802 } 802 }
803 803
804 804
805 void AstPrinter::VisitWithExitStatement(WithExitStatement* node) { 805 void AstPrinter::VisitContextExitStatement(ContextExitStatement* node) {
806 PrintIndented("WITH EXIT\n"); 806 PrintIndented("CONTEXT EXIT\n");
807 } 807 }
808 808
809 809
810 void AstPrinter::VisitSwitchStatement(SwitchStatement* node) { 810 void AstPrinter::VisitSwitchStatement(SwitchStatement* node) {
811 IndentedScope indent(this, "SWITCH"); 811 IndentedScope indent(this, "SWITCH");
812 PrintLabelsIndented(NULL, node->labels()); 812 PrintLabelsIndented(NULL, node->labels());
813 PrintIndentedVisit("TAG", node->tag()); 813 PrintIndentedVisit("TAG", node->tag());
814 for (int i = 0; i < node->cases()->length(); i++) { 814 for (int i = 0; i < node->cases()->length(); i++) {
815 PrintCaseClause(node->cases()->at(i)); 815 PrintCaseClause(node->cases()->at(i));
816 } 816 }
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 Visit(stmt->expression()); 1190 Visit(stmt->expression());
1191 } 1191 }
1192 1192
1193 1193
1194 void JsonAstBuilder::VisitWithEnterStatement(WithEnterStatement* stmt) { 1194 void JsonAstBuilder::VisitWithEnterStatement(WithEnterStatement* stmt) {
1195 TagScope tag(this, "WithEnterStatement"); 1195 TagScope tag(this, "WithEnterStatement");
1196 Visit(stmt->expression()); 1196 Visit(stmt->expression());
1197 } 1197 }
1198 1198
1199 1199
1200 void JsonAstBuilder::VisitWithExitStatement(WithExitStatement* stmt) { 1200 void JsonAstBuilder::VisitContextExitStatement(ContextExitStatement* stmt) {
1201 TagScope tag(this, "WithExitStatement"); 1201 TagScope tag(this, "ContextExitStatement");
1202 } 1202 }
1203 1203
1204 1204
1205 void JsonAstBuilder::VisitSwitchStatement(SwitchStatement* stmt) { 1205 void JsonAstBuilder::VisitSwitchStatement(SwitchStatement* stmt) {
1206 TagScope tag(this, "SwitchStatement"); 1206 TagScope tag(this, "SwitchStatement");
1207 } 1207 }
1208 1208
1209 1209
1210 void JsonAstBuilder::VisitDoWhileStatement(DoWhileStatement* stmt) { 1210 void JsonAstBuilder::VisitDoWhileStatement(DoWhileStatement* stmt) {
1211 TagScope tag(this, "DoWhileStatement"); 1211 TagScope tag(this, "DoWhileStatement");
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 AddAttribute("mode", Variable::Mode2String(decl->mode())); 1465 AddAttribute("mode", Variable::Mode2String(decl->mode()));
1466 } 1466 }
1467 Visit(decl->proxy()); 1467 Visit(decl->proxy());
1468 if (decl->fun() != NULL) Visit(decl->fun()); 1468 if (decl->fun() != NULL) Visit(decl->fun());
1469 } 1469 }
1470 1470
1471 1471
1472 #endif // DEBUG 1472 #endif // DEBUG
1473 1473
1474 } } // namespace v8::internal 1474 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698