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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 Print(" }"); | 290 Print(" }"); |
291 } | 291 } |
292 | 292 |
293 | 293 |
294 void PrettyPrinter::VisitSlot(Slot* node) { | 294 void PrettyPrinter::VisitSlot(Slot* node) { |
295 switch (node->type()) { | 295 switch (node->type()) { |
296 case Slot::PARAMETER: | 296 case Slot::PARAMETER: |
297 Print("parameter[%d]", node->index()); | 297 Print("parameter[%d]", node->index()); |
298 break; | 298 break; |
299 case Slot::LOCAL: | 299 case Slot::LOCAL: |
300 Print("frame[%d]", node->index()); | 300 Print("local[%d]", node->index()); |
301 break; | 301 break; |
302 case Slot::CONTEXT: | 302 case Slot::CONTEXT: |
303 Print(".context[%d]", node->index()); | 303 Print("context[%d]", node->index()); |
304 break; | 304 break; |
305 case Slot::LOOKUP: | 305 case Slot::LOOKUP: |
306 Print(".context["); | 306 Print("lookup["); |
307 PrintLiteral(node->var()->name(), false); | 307 PrintLiteral(node->var()->name(), false); |
308 Print("]"); | 308 Print("]"); |
309 break; | 309 break; |
310 default: | 310 default: |
311 UNREACHABLE(); | 311 UNREACHABLE(); |
312 } | 312 } |
313 } | 313 } |
314 | 314 |
315 | 315 |
316 void PrettyPrinter::VisitVariableProxy(VariableProxy* node) { | 316 void PrettyPrinter::VisitVariableProxy(VariableProxy* node) { |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 | 992 |
993 void AstPrinter::VisitCatchExtensionObject(CatchExtensionObject* node) { | 993 void AstPrinter::VisitCatchExtensionObject(CatchExtensionObject* node) { |
994 IndentedScope indent("CatchExtensionObject"); | 994 IndentedScope indent("CatchExtensionObject"); |
995 PrintIndentedVisit("KEY", node->key()); | 995 PrintIndentedVisit("KEY", node->key()); |
996 PrintIndentedVisit("VALUE", node->value()); | 996 PrintIndentedVisit("VALUE", node->value()); |
997 } | 997 } |
998 | 998 |
999 | 999 |
1000 void AstPrinter::VisitSlot(Slot* node) { | 1000 void AstPrinter::VisitSlot(Slot* node) { |
1001 PrintIndented("SLOT "); | 1001 PrintIndented("SLOT "); |
1002 switch (node->type()) { | 1002 PrettyPrinter::VisitSlot(node); |
1003 case Slot::PARAMETER: | |
1004 Print("parameter[%d]", node->index()); | |
1005 break; | |
1006 case Slot::LOCAL: | |
1007 Print("frame[%d]", node->index()); | |
1008 break; | |
1009 case Slot::CONTEXT: | |
1010 Print(".context[%d]", node->index()); | |
1011 break; | |
1012 case Slot::LOOKUP: | |
1013 Print(".context["); | |
1014 PrintLiteral(node->var()->name(), false); | |
1015 Print("]"); | |
1016 break; | |
1017 default: | |
1018 UNREACHABLE(); | |
1019 } | |
1020 Print("\n"); | 1003 Print("\n"); |
1021 } | 1004 } |
1022 | 1005 |
1023 | 1006 |
1024 void AstPrinter::VisitVariableProxy(VariableProxy* node) { | 1007 void AstPrinter::VisitVariableProxy(VariableProxy* node) { |
1025 PrintLiteralWithModeIndented("VAR PROXY", node->AsVariable(), node->name(), | 1008 PrintLiteralWithModeIndented("VAR PROXY", node->AsVariable(), node->name(), |
1026 node->type()); | 1009 node->type()); |
1027 Variable* var = node->var(); | 1010 Variable* var = node->var(); |
1028 if (var != NULL && var->rewrite() != NULL) { | 1011 if (var != NULL && var->rewrite() != NULL) { |
1029 IndentedScope indent; | 1012 IndentedScope indent; |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 AddAttribute("mode", Variable::Mode2String(decl->mode())); | 1530 AddAttribute("mode", Variable::Mode2String(decl->mode())); |
1548 } | 1531 } |
1549 Visit(decl->proxy()); | 1532 Visit(decl->proxy()); |
1550 if (decl->fun() != NULL) Visit(decl->fun()); | 1533 if (decl->fun() != NULL) Visit(decl->fun()); |
1551 } | 1534 } |
1552 | 1535 |
1553 | 1536 |
1554 #endif // DEBUG | 1537 #endif // DEBUG |
1555 | 1538 |
1556 } } // namespace v8::internal | 1539 } } // namespace v8::internal |
OLD | NEW |