Chromium Code Reviews| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 return ShouldReorderBlocks(parsed_function().function(), is_optimized) | 88 return ShouldReorderBlocks(parsed_function().function(), is_optimized) |
| 89 ? &optimized_block_order_ | 89 ? &optimized_block_order_ |
| 90 : &reverse_postorder_; | 90 : &reverse_postorder_; |
| 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(object); | 98 constant = new(isolate()) ConstantInstr(Object::ZoneHandle(object.raw())); |
|
srdjan
2014/09/11 17:38:11
isolate(), object.raw()
| |
| 99 constant->set_ssa_temp_index(alloc_ssa_temp_index()); | 99 constant->set_ssa_temp_index(alloc_ssa_temp_index()); |
| 100 AddToInitialDefinitions(constant); | 100 AddToInitialDefinitions(constant); |
| 101 constant_instr_pool_.Insert(constant); | 101 constant_instr_pool_.Insert(constant); |
| 102 } | 102 } |
| 103 return constant; | 103 return constant; |
| 104 } | 104 } |
| 105 | 105 |
| 106 | 106 |
| 107 void FlowGraph::AddToInitialDefinitions(Definition* defn) { | 107 void FlowGraph::AddToInitialDefinitions(Definition* defn) { |
| 108 // TODO(zerny): Set previous to the graph entry so it is accessible by | 108 // TODO(zerny): Set previous to the graph entry so it is accessible by |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1254 } | 1254 } |
| 1255 | 1255 |
| 1256 | 1256 |
| 1257 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, | 1257 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, |
| 1258 BlockEntryInstr* to) const { | 1258 BlockEntryInstr* to) const { |
| 1259 return available_at_[to->postorder_number()]->Contains( | 1259 return available_at_[to->postorder_number()]->Contains( |
| 1260 from->postorder_number()); | 1260 from->postorder_number()); |
| 1261 } | 1261 } |
| 1262 | 1262 |
| 1263 } // namespace dart | 1263 } // namespace dart |
| OLD | NEW |