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/growable_array.h" | 10 #include "vm/growable_array.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 91 } |
92 | 92 |
93 | 93 |
94 ConstantInstr* FlowGraph::GetConstant(const Object& object) { | 94 ConstantInstr* FlowGraph::GetConstant(const Object& object) { |
95 ConstantInstr* constant = constant_instr_pool_.Lookup(object); | 95 ConstantInstr* constant = constant_instr_pool_.Lookup(object); |
96 if (constant == NULL) { | 96 if (constant == NULL) { |
97 // Otherwise, allocate and add it to the pool. | 97 // Otherwise, allocate and add it to the pool. |
98 constant = new(isolate()) ConstantInstr( | 98 constant = new(isolate()) ConstantInstr( |
99 Object::ZoneHandle(isolate(), object.raw())); | 99 Object::ZoneHandle(isolate(), object.raw())); |
100 constant->set_ssa_temp_index(alloc_ssa_temp_index()); | 100 constant->set_ssa_temp_index(alloc_ssa_temp_index()); |
| 101 |
101 AddToInitialDefinitions(constant); | 102 AddToInitialDefinitions(constant); |
102 constant_instr_pool_.Insert(constant); | 103 constant_instr_pool_.Insert(constant); |
103 } | 104 } |
104 return constant; | 105 return constant; |
105 } | 106 } |
106 | 107 |
107 | 108 |
108 void FlowGraph::AddToInitialDefinitions(Definition* defn) { | 109 void FlowGraph::AddToInitialDefinitions(Definition* defn) { |
109 // TODO(zerny): Set previous to the graph entry so it is accessible by | 110 // TODO(zerny): Set previous to the graph entry so it is accessible by |
110 // GetBlock. Remove this once there is a direct pointer to the block. | 111 // GetBlock. Remove this once there is a direct pointer to the block. |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1255 } | 1256 } |
1256 | 1257 |
1257 | 1258 |
1258 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, | 1259 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, |
1259 BlockEntryInstr* to) const { | 1260 BlockEntryInstr* to) const { |
1260 return available_at_[to->postorder_number()]->Contains( | 1261 return available_at_[to->postorder_number()]->Contains( |
1261 from->postorder_number()); | 1262 from->postorder_number()); |
1262 } | 1263 } |
1263 | 1264 |
1264 } // namespace dart | 1265 } // namespace dart |
OLD | NEW |