| 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/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 GrowableArray<BlockEntryInstr*>* FlowGraph::CodegenBlockOrder( | 114 GrowableArray<BlockEntryInstr*>* FlowGraph::CodegenBlockOrder( |
| 115 bool is_optimized) { | 115 bool is_optimized) { |
| 116 return ShouldReorderBlocks(function(), is_optimized) | 116 return ShouldReorderBlocks(function(), is_optimized) |
| 117 ? &optimized_block_order_ | 117 ? &optimized_block_order_ |
| 118 : &reverse_postorder_; | 118 : &reverse_postorder_; |
| 119 } | 119 } |
| 120 | 120 |
| 121 | 121 |
| 122 ConstantInstr* FlowGraph::GetConstant(const Object& object) { | 122 ConstantInstr* FlowGraph::GetConstant(const Object& object) { |
| 123 ConstantInstr* constant = constant_instr_pool_.Lookup(object); | 123 ConstantInstr* constant = constant_instr_pool_.LookupValue(object); |
| 124 if (constant == NULL) { | 124 if (constant == NULL) { |
| 125 // Otherwise, allocate and add it to the pool. | 125 // Otherwise, allocate and add it to the pool. |
| 126 constant = new(zone()) ConstantInstr( | 126 constant = new(zone()) ConstantInstr( |
| 127 Object::ZoneHandle(zone(), object.raw())); | 127 Object::ZoneHandle(zone(), object.raw())); |
| 128 constant->set_ssa_temp_index(alloc_ssa_temp_index()); | 128 constant->set_ssa_temp_index(alloc_ssa_temp_index()); |
| 129 | 129 |
| 130 AddToInitialDefinitions(constant); | 130 AddToInitialDefinitions(constant); |
| 131 constant_instr_pool_.Insert(constant); | 131 constant_instr_pool_.Insert(constant); |
| 132 } | 132 } |
| 133 return constant; | 133 return constant; |
| (...skipping 1914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2048 ReplaceCurrentInstruction(&it, current, replacement); | 2048 ReplaceCurrentInstruction(&it, current, replacement); |
| 2049 changed = true; | 2049 changed = true; |
| 2050 } | 2050 } |
| 2051 } | 2051 } |
| 2052 } | 2052 } |
| 2053 return changed; | 2053 return changed; |
| 2054 } | 2054 } |
| 2055 | 2055 |
| 2056 | 2056 |
| 2057 } // namespace dart | 2057 } // namespace dart |
| OLD | NEW |