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.h" | 5 #include "vm/flow_graph.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/flow_graph_builder.h" | 8 #include "vm/flow_graph_builder.h" |
9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
11 #include "vm/growable_array.h" | 11 #include "vm/growable_array.h" |
12 | 12 |
13 namespace dart { | 13 namespace dart { |
14 | 14 |
15 DECLARE_FLAG(bool, reorder_basic_blocks); | 15 DECLARE_FLAG(bool, reorder_basic_blocks); |
16 DECLARE_FLAG(bool, trace_optimization); | 16 DECLARE_FLAG(bool, trace_optimization); |
17 DECLARE_FLAG(bool, verify_compiler); | 17 DECLARE_FLAG(bool, verify_compiler); |
18 DEFINE_FLAG(bool, optimize_try_catch, true, "Optimization of try-catch"); | 18 DEFINE_FLAG(bool, optimize_try_catch, true, "Optimization of try-catch"); |
19 | 19 |
20 | 20 |
21 FlowGraph::FlowGraph(const FlowGraphBuilder& builder, | 21 FlowGraph::FlowGraph(const FlowGraphBuilder& builder, |
22 GraphEntryInstr* graph_entry, | 22 GraphEntryInstr* graph_entry, |
23 intptr_t max_block_id) | 23 intptr_t max_block_id) |
24 : parent_(), | 24 : parent_(), |
25 current_ssa_temp_index_(0), | 25 current_ssa_temp_index_(0), |
26 max_block_id_(max_block_id), | 26 max_block_id_(max_block_id), |
| 27 builder_(builder), |
27 parsed_function_(*builder.parsed_function()), | 28 parsed_function_(*builder.parsed_function()), |
28 num_copied_params_(builder.num_copied_params()), | 29 num_copied_params_(builder.num_copied_params()), |
29 num_non_copied_params_(builder.num_non_copied_params()), | 30 num_non_copied_params_(builder.num_non_copied_params()), |
30 num_stack_locals_(builder.num_stack_locals()), | 31 num_stack_locals_(builder.num_stack_locals()), |
31 graph_entry_(graph_entry), | 32 graph_entry_(graph_entry), |
32 preorder_(), | 33 preorder_(), |
33 postorder_(), | 34 postorder_(), |
34 reverse_postorder_(), | 35 reverse_postorder_(), |
35 optimized_block_order_(), | 36 optimized_block_order_(), |
36 block_effects_(NULL), | 37 block_effects_(NULL), |
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 } | 1169 } |
1169 | 1170 |
1170 | 1171 |
1171 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, | 1172 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, |
1172 BlockEntryInstr* to) const { | 1173 BlockEntryInstr* to) const { |
1173 return available_at_[to->postorder_number()]->Contains( | 1174 return available_at_[to->postorder_number()]->Contains( |
1174 from->postorder_number()); | 1175 from->postorder_number()); |
1175 } | 1176 } |
1176 | 1177 |
1177 } // namespace dart | 1178 } // namespace dart |
OLD | NEW |