| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/bit_vector.h" | 9 #include "vm/bit_vector.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 4580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4591 AddInstruction(new(Z) StopInstr(node->message())); | 4591 AddInstruction(new(Z) StopInstr(node->message())); |
| 4592 } | 4592 } |
| 4593 | 4593 |
| 4594 | 4594 |
| 4595 FlowGraph* FlowGraphBuilder::BuildGraph() { | 4595 FlowGraph* FlowGraphBuilder::BuildGraph() { |
| 4596 VMTagScope tagScope(thread(), | 4596 VMTagScope tagScope(thread(), |
| 4597 VMTag::kCompileFlowGraphBuilderTagId, | 4597 VMTag::kCompileFlowGraphBuilderTagId, |
| 4598 FLAG_profile_vm); | 4598 FLAG_profile_vm); |
| 4599 if (FLAG_support_ast_printer && FLAG_print_ast) { | 4599 if (FLAG_support_ast_printer && FLAG_print_ast) { |
| 4600 // Print the function ast before IL generation. | 4600 // Print the function ast before IL generation. |
| 4601 AstPrinter::PrintFunctionNodes(parsed_function()); | 4601 AstPrinter ast_printer; |
| 4602 ast_printer.PrintFunctionNodes(parsed_function()); |
| 4602 } | 4603 } |
| 4603 if (FLAG_support_ast_printer && FLAG_print_scopes) { | 4604 if (FLAG_support_ast_printer && FLAG_print_scopes) { |
| 4604 AstPrinter::PrintFunctionScope(parsed_function()); | 4605 AstPrinter ast_printer; |
| 4606 ast_printer.PrintFunctionScope(parsed_function()); |
| 4605 } | 4607 } |
| 4606 TargetEntryInstr* normal_entry = | 4608 TargetEntryInstr* normal_entry = |
| 4607 new(Z) TargetEntryInstr(AllocateBlockId(), | 4609 new(Z) TargetEntryInstr(AllocateBlockId(), |
| 4608 CatchClauseNode::kInvalidTryIndex); | 4610 CatchClauseNode::kInvalidTryIndex); |
| 4609 graph_entry_ = | 4611 graph_entry_ = |
| 4610 new(Z) GraphEntryInstr(parsed_function(), normal_entry, osr_id_); | 4612 new(Z) GraphEntryInstr(parsed_function(), normal_entry, osr_id_); |
| 4611 EffectGraphVisitor for_effect(this); | 4613 EffectGraphVisitor for_effect(this); |
| 4612 parsed_function().node_sequence()->Visit(&for_effect); | 4614 parsed_function().node_sequence()->Visit(&for_effect); |
| 4613 AppendFragment(normal_entry, for_effect); | 4615 AppendFragment(normal_entry, for_effect); |
| 4614 // Check that the graph is properly terminated. | 4616 // Check that the graph is properly terminated. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 4634 block_marks); | 4636 block_marks); |
| 4635 ASSERT(found); | 4637 ASSERT(found); |
| 4636 } | 4638 } |
| 4637 | 4639 |
| 4638 | 4640 |
| 4639 void FlowGraphBuilder::Bailout(const char* reason) const { | 4641 void FlowGraphBuilder::Bailout(const char* reason) const { |
| 4640 parsed_function_.Bailout("FlowGraphBuilder", reason); | 4642 parsed_function_.Bailout("FlowGraphBuilder", reason); |
| 4641 } | 4643 } |
| 4642 | 4644 |
| 4643 } // namespace dart | 4645 } // namespace dart |
| OLD | NEW |