| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/ast_printer.h" | 5 #include "vm/ast_printer.h" |
| 6 | 6 |
| 7 #include "vm/handles.h" | 7 #include "vm/handles.h" |
| 8 #include "vm/log.h" | 8 #include "vm/log.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/os.h" | 10 #include "vm/os.h" |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 ISL_Print("llev %d\n", child->loop_level()); | 499 ISL_Print("llev %d\n", child->loop_level()); |
| 500 PrintLocalScope(child, 0, indent + kScopeIndent); | 500 PrintLocalScope(child, 0, indent + kScopeIndent); |
| 501 IndentN(indent); | 501 IndentN(indent); |
| 502 ISL_Print("}\n"); | 502 ISL_Print("}\n"); |
| 503 child = child->sibling(); | 503 child = child->sibling(); |
| 504 } | 504 } |
| 505 } | 505 } |
| 506 | 506 |
| 507 | 507 |
| 508 void AstPrinter::PrintFunctionScope(const ParsedFunction& parsed_function) { | 508 void AstPrinter::PrintFunctionScope(const ParsedFunction& parsed_function) { |
| 509 HANDLESCOPE(Isolate::Current()); | 509 HANDLESCOPE(parsed_function.thread()); |
| 510 const Function& function = parsed_function.function(); | 510 const Function& function = parsed_function.function(); |
| 511 SequenceNode* node_sequence = parsed_function.node_sequence(); | 511 SequenceNode* node_sequence = parsed_function.node_sequence(); |
| 512 ASSERT(node_sequence != NULL); | 512 ASSERT(node_sequence != NULL); |
| 513 const LocalScope* scope = node_sequence->scope(); | 513 const LocalScope* scope = node_sequence->scope(); |
| 514 ASSERT(scope != NULL); | 514 ASSERT(scope != NULL); |
| 515 const char* function_name = function.ToFullyQualifiedCString(); | 515 const char* function_name = function.ToFullyQualifiedCString(); |
| 516 ISL_Print("Scope for function '%s'\n{scope %p ", function_name, scope); | 516 ISL_Print("Scope for function '%s'\n{scope %p ", function_name, scope); |
| 517 if (scope->HasContextLevel()) { | 517 if (scope->HasContextLevel()) { |
| 518 ISL_Print("ctx %d numctxvar %d ", | 518 ISL_Print("ctx %d numctxvar %d ", |
| 519 scope->context_level(), | 519 scope->context_level(), |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 scope->end_token_pos()); | 551 scope->end_token_pos()); |
| 552 pos++; | 552 pos++; |
| 553 } | 553 } |
| 554 // Visit remaining non-parameter variables and children scopes. | 554 // Visit remaining non-parameter variables and children scopes. |
| 555 PrintLocalScope(scope, pos, indent); | 555 PrintLocalScope(scope, pos, indent); |
| 556 ISL_Print("}\n"); | 556 ISL_Print("}\n"); |
| 557 } | 557 } |
| 558 | 558 |
| 559 | 559 |
| 560 void AstPrinter::PrintFunctionNodes(const ParsedFunction& parsed_function) { | 560 void AstPrinter::PrintFunctionNodes(const ParsedFunction& parsed_function) { |
| 561 HANDLESCOPE(Isolate::Current()); | 561 HANDLESCOPE(parsed_function.thread()); |
| 562 SequenceNode* node_sequence = parsed_function.node_sequence(); | 562 SequenceNode* node_sequence = parsed_function.node_sequence(); |
| 563 ASSERT(node_sequence != NULL); | 563 ASSERT(node_sequence != NULL); |
| 564 AstPrinter ast_printer; | 564 AstPrinter ast_printer; |
| 565 const char* function_name = | 565 const char* function_name = |
| 566 parsed_function.function().ToFullyQualifiedCString(); | 566 parsed_function.function().ToFullyQualifiedCString(); |
| 567 ISL_Print("Ast for function '%s' {\n", function_name); | 567 ISL_Print("Ast for function '%s' {\n", function_name); |
| 568 node_sequence->Visit(&ast_printer); | 568 node_sequence->Visit(&ast_printer); |
| 569 ISL_Print("}\n"); | 569 ISL_Print("}\n"); |
| 570 } | 570 } |
| 571 | 571 |
| 572 } // namespace dart | 572 } // namespace dart |
| OLD | NEW |