| 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_allocator.h" | 5 #include "vm/flow_graph_allocator.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 #include "vm/il_printer.h" | 9 #include "vm/il_printer.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 } | 141 } |
| 142 | 142 |
| 143 // Process incoming parameters. | 143 // Process incoming parameters. |
| 144 GraphEntryInstr* graph_entry = postorder_[block_count - 1]->AsGraphEntry(); | 144 GraphEntryInstr* graph_entry = postorder_[block_count - 1]->AsGraphEntry(); |
| 145 for (intptr_t i = 0; i < graph_entry->start_env()->values().length(); i++) { | 145 for (intptr_t i = 0; i < graph_entry->start_env()->values().length(); i++) { |
| 146 Value* val = graph_entry->start_env()->values()[i]; | 146 Value* val = graph_entry->start_env()->values()[i]; |
| 147 if (val->IsUse()) { | 147 if (val->IsUse()) { |
| 148 const intptr_t vreg = val->AsUse()->definition()->ssa_temp_index(); | 148 const intptr_t vreg = val->AsUse()->definition()->ssa_temp_index(); |
| 149 kill_[0]->Add(vreg); | 149 kill_[graph_entry->postorder_number()]->Add(vreg); |
| 150 live_in_[0]->Remove(vreg); | 150 live_in_[graph_entry->postorder_number()]->Remove(vreg); |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 154 // Update initial live_in sets to match live_out sets. Has to be | 154 // Update initial live_in sets to match live_out sets. Has to be |
| 155 // done in a separate path because of backwards branches. | 155 // done in a separate path because of backwards branches. |
| 156 for (intptr_t i = 0; i < block_count; i++) { | 156 for (intptr_t i = 0; i < block_count; i++) { |
| 157 UpdateLiveIn(*postorder_[i]); | 157 UpdateLiveIn(*postorder_[i]); |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| (...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1648 | 1648 |
| 1649 if (FLAG_trace_ssa_allocator) { | 1649 if (FLAG_trace_ssa_allocator) { |
| 1650 OS::Print("-- ir after allocation -------------------------\n"); | 1650 OS::Print("-- ir after allocation -------------------------\n"); |
| 1651 FlowGraphPrinter printer(Function::Handle(), block_order_, true); | 1651 FlowGraphPrinter printer(Function::Handle(), block_order_, true); |
| 1652 printer.PrintBlocks(); | 1652 printer.PrintBlocks(); |
| 1653 } | 1653 } |
| 1654 } | 1654 } |
| 1655 | 1655 |
| 1656 | 1656 |
| 1657 } // namespace dart | 1657 } // namespace dart |
| OLD | NEW |