| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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.h" | 10 #include "vm/flow_graph.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 } | 223 } |
| 224 } | 224 } |
| 225 | 225 |
| 226 // Process initial definitions, ie, constants and incoming parameters. | 226 // Process initial definitions, ie, constants and incoming parameters. |
| 227 for (intptr_t i = 0; i < graph_entry_->initial_definitions()->length(); i++) { | 227 for (intptr_t i = 0; i < graph_entry_->initial_definitions()->length(); i++) { |
| 228 Definition* def = (*graph_entry_->initial_definitions())[i]; | 228 Definition* def = (*graph_entry_->initial_definitions())[i]; |
| 229 const intptr_t vreg = def->ssa_temp_index(); | 229 const intptr_t vreg = def->ssa_temp_index(); |
| 230 kill_[graph_entry_->postorder_number()]->Add(vreg); | 230 kill_[graph_entry_->postorder_number()]->Add(vreg); |
| 231 live_in_[graph_entry_->postorder_number()]->Remove(vreg); | 231 live_in_[graph_entry_->postorder_number()]->Remove(vreg); |
| 232 } | 232 } |
| 233 | |
| 234 // Update initial live_in sets to match live_out sets. Has to be | |
| 235 // done in a separate path because of backwards branches. | |
| 236 for (intptr_t i = 0; i < block_count; i++) { | |
| 237 UpdateLiveIn(*postorder_[i]); | |
| 238 } | |
| 239 } | 233 } |
| 240 | 234 |
| 241 | 235 |
| 242 void LiveRange::AddUse(intptr_t pos, Location* location_slot) { | 236 void LiveRange::AddUse(intptr_t pos, Location* location_slot) { |
| 243 ASSERT(location_slot != NULL); | 237 ASSERT(location_slot != NULL); |
| 244 ASSERT((first_use_interval_->start_ <= pos) && | 238 ASSERT((first_use_interval_->start_ <= pos) && |
| 245 (pos <= first_use_interval_->end_)); | 239 (pos <= first_use_interval_->end_)); |
| 246 if ((uses_ != NULL) && | 240 if ((uses_ != NULL) && |
| 247 (uses_->pos() == pos) && | 241 (uses_->pos() == pos) && |
| 248 (uses_->location_slot() == location_slot)) { | 242 (uses_->location_slot() == location_slot)) { |
| (...skipping 2535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2784 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", | 2778 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", |
| 2785 function.ToFullyQualifiedCString()); | 2779 function.ToFullyQualifiedCString()); |
| 2786 FlowGraphPrinter printer(flow_graph_, true); | 2780 FlowGraphPrinter printer(flow_graph_, true); |
| 2787 printer.PrintBlocks(); | 2781 printer.PrintBlocks(); |
| 2788 OS::Print("----------------------------------------------\n"); | 2782 OS::Print("----------------------------------------------\n"); |
| 2789 } | 2783 } |
| 2790 } | 2784 } |
| 2791 | 2785 |
| 2792 | 2786 |
| 2793 } // namespace dart | 2787 } // namespace dart |
| OLD | NEW |