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

Side by Side Diff: src/prettyprinter.cc

Issue 18143: Change the handling of catch blocks to use context extension objects... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 11 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
« no previous file with comments | « src/parser.cc ('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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 void PrettyPrinter::VisitArrayLiteral(ArrayLiteral* node) { 278 void PrettyPrinter::VisitArrayLiteral(ArrayLiteral* node) {
279 Print("[ "); 279 Print("[ ");
280 for (int i = 0; i < node->values()->length(); i++) { 280 for (int i = 0; i < node->values()->length(); i++) {
281 if (i != 0) Print(","); 281 if (i != 0) Print(",");
282 Visit(node->values()->at(i)); 282 Visit(node->values()->at(i));
283 } 283 }
284 Print(" ]"); 284 Print(" ]");
285 } 285 }
286 286
287 287
288 void PrettyPrinter::VisitCatchExtensionObject(CatchExtensionObject* node) {
289 Print("{ ");
290 Visit(node->key());
291 Print(": ");
292 Visit(node->value());
293 Print(" }");
294 }
295
296
288 void PrettyPrinter::VisitSlot(Slot* node) { 297 void PrettyPrinter::VisitSlot(Slot* node) {
289 switch (node->type()) { 298 switch (node->type()) {
290 case Slot::PARAMETER: 299 case Slot::PARAMETER:
291 Print("parameter[%d]", node->index()); 300 Print("parameter[%d]", node->index());
292 break; 301 break;
293 case Slot::LOCAL: 302 case Slot::LOCAL:
294 Print("frame[%d]", node->index()); 303 Print("frame[%d]", node->index());
295 break; 304 break;
296 case Slot::CONTEXT: 305 case Slot::CONTEXT:
297 Print(".context[%d]", node->index()); 306 Print(".context[%d]", node->index());
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 IndentedScope indent("ARRAY LITERAL"); 957 IndentedScope indent("ARRAY LITERAL");
949 if (node->values()->length() > 0) { 958 if (node->values()->length() > 0) {
950 IndentedScope indent("VALUES"); 959 IndentedScope indent("VALUES");
951 for (int i = 0; i < node->values()->length(); i++) { 960 for (int i = 0; i < node->values()->length(); i++) {
952 Visit(node->values()->at(i)); 961 Visit(node->values()->at(i));
953 } 962 }
954 } 963 }
955 } 964 }
956 965
957 966
967 void AstPrinter::VisitCatchExtensionObject(CatchExtensionObject* node) {
968 IndentedScope indent("CatchExtensionObject");
969 PrintIndentedVisit("KEY", node->key());
970 PrintIndentedVisit("VALUE", node->value());
971 }
972
973
958 void AstPrinter::VisitSlot(Slot* node) { 974 void AstPrinter::VisitSlot(Slot* node) {
959 PrintIndented("SLOT "); 975 PrintIndented("SLOT ");
960 switch (node->type()) { 976 switch (node->type()) {
961 case Slot::PARAMETER: 977 case Slot::PARAMETER:
962 Print("parameter[%d]", node->index()); 978 Print("parameter[%d]", node->index());
963 break; 979 break;
964 case Slot::LOCAL: 980 case Slot::LOCAL:
965 Print("frame[%d]", node->index()); 981 Print("frame[%d]", node->index());
966 break; 982 break;
967 case Slot::CONTEXT: 983 case Slot::CONTEXT:
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 1092
1077 void AstPrinter::VisitThisFunction(ThisFunction* node) { 1093 void AstPrinter::VisitThisFunction(ThisFunction* node) {
1078 IndentedScope indent("THIS-FUNCTION"); 1094 IndentedScope indent("THIS-FUNCTION");
1079 } 1095 }
1080 1096
1081 1097
1082 1098
1083 #endif // DEBUG 1099 #endif // DEBUG
1084 1100
1085 } } // namespace v8::internal 1101 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698