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/object.h" | 8 #include "vm/object.h" |
9 #include "vm/os.h" | 9 #include "vm/os.h" |
10 #include "vm/parser.h" | 10 #include "vm/parser.h" |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 while (child != NULL) { | 411 while (child != NULL) { |
412 OS::Print("{scope "); | 412 OS::Print("{scope "); |
413 PrintLocalScope(child, 0); | 413 PrintLocalScope(child, 0); |
414 OS::Print("}"); | 414 OS::Print("}"); |
415 child = child->sibling(); | 415 child = child->sibling(); |
416 } | 416 } |
417 } | 417 } |
418 | 418 |
419 | 419 |
420 void AstPrinter::PrintFunctionScope(const ParsedFunction& parsed_function) { | 420 void AstPrinter::PrintFunctionScope(const ParsedFunction& parsed_function) { |
421 HANDLESCOPE(); | 421 HANDLESCOPE(Isolate::Current()); |
422 const Function& function = parsed_function.function(); | 422 const Function& function = parsed_function.function(); |
423 const Array& default_parameter_values = | 423 const Array& default_parameter_values = |
424 parsed_function.default_parameter_values(); | 424 parsed_function.default_parameter_values(); |
425 SequenceNode* node_sequence = parsed_function.node_sequence(); | 425 SequenceNode* node_sequence = parsed_function.node_sequence(); |
426 ASSERT(node_sequence != NULL); | 426 ASSERT(node_sequence != NULL); |
427 const LocalScope* scope = node_sequence->scope(); | 427 const LocalScope* scope = node_sequence->scope(); |
428 ASSERT(scope != NULL); | 428 ASSERT(scope != NULL); |
429 const char* function_name = function.ToFullyQualifiedCString(); | 429 const char* function_name = function.ToFullyQualifiedCString(); |
430 OS::Print("Scope for function '%s' {\n", function_name); | 430 OS::Print("Scope for function '%s' {\n", function_name); |
431 const int num_fixed_params = function.num_fixed_parameters(); | 431 const int num_fixed_params = function.num_fixed_parameters(); |
(...skipping 24 matching lines...) Expand all Loading... |
456 OS::Print(")"); | 456 OS::Print(")"); |
457 pos++; | 457 pos++; |
458 } | 458 } |
459 // Visit remaining non-parameter variables and children scopes. | 459 // Visit remaining non-parameter variables and children scopes. |
460 PrintLocalScope(scope, pos); | 460 PrintLocalScope(scope, pos); |
461 OS::Print("}\n"); | 461 OS::Print("}\n"); |
462 } | 462 } |
463 | 463 |
464 | 464 |
465 void AstPrinter::PrintFunctionNodes(const ParsedFunction& parsed_function) { | 465 void AstPrinter::PrintFunctionNodes(const ParsedFunction& parsed_function) { |
466 HANDLESCOPE(); | 466 HANDLESCOPE(Isolate::Current()); |
467 SequenceNode* node_sequence = parsed_function.node_sequence(); | 467 SequenceNode* node_sequence = parsed_function.node_sequence(); |
468 ASSERT(node_sequence != NULL); | 468 ASSERT(node_sequence != NULL); |
469 AstPrinter ast_printer; | 469 AstPrinter ast_printer; |
470 const char* function_name = | 470 const char* function_name = |
471 parsed_function.function().ToFullyQualifiedCString(); | 471 parsed_function.function().ToFullyQualifiedCString(); |
472 OS::Print("Ast for function '%s' {\n", function_name); | 472 OS::Print("Ast for function '%s' {\n", function_name); |
473 node_sequence->Visit(&ast_printer); | 473 node_sequence->Visit(&ast_printer); |
474 OS::Print("}\n"); | 474 OS::Print("}\n"); |
475 } | 475 } |
476 | 476 |
477 } // namespace dart | 477 } // namespace dart |
OLD | NEW |