| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 for (intptr_t j = 0; j < values.length(); j++) { | 105 for (intptr_t j = 0; j < values.length(); j++) { |
| 106 Value* val = values[j]; | 106 Value* val = values[j]; |
| 107 if (val->IsUse()) { | 107 if (val->IsUse()) { |
| 108 const intptr_t use = val->AsUse()->definition()->ssa_temp_index(); | 108 const intptr_t use = val->AsUse()->definition()->ssa_temp_index(); |
| 109 if (!kill->Contains(use)) live_in->Add(use); | 109 if (!kill->Contains(use)) live_in->Add(use); |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 Definition* current_def = current->AsDefinition(); | 114 Definition* current_def = current->AsDefinition(); |
| 115 if ((current_def != NULL) && (current_def->ssa_temp_index() >= 0)) { | 115 if ((current_def != NULL) && (current_def->HasSSATemp())) { |
| 116 kill->Add(current_def->ssa_temp_index()); | 116 kill->Add(current_def->ssa_temp_index()); |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 | 120 |
| 121 // Update initial live_in sets to match live_out sets. Has to be | 121 // Update initial live_in sets to match live_out sets. Has to be |
| 122 // done in a separate path because of backwards branches. | 122 // done in a separate path because of backwards branches. |
| 123 for (intptr_t i = 0; i < block_count; i++) { | 123 for (intptr_t i = 0; i < block_count; i++) { |
| 124 UpdateLiveIn(*postorder_[i]); | 124 UpdateLiveIn(*postorder_[i]); |
| 125 } | 125 } |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 BlockLocation(Location::RegisterLocation(static_cast<Register>(reg)), | 511 BlockLocation(Location::RegisterLocation(static_cast<Register>(reg)), |
| 512 pos); | 512 pos); |
| 513 } | 513 } |
| 514 } | 514 } |
| 515 | 515 |
| 516 if (locs->out().IsRegister()) { | 516 if (locs->out().IsRegister()) { |
| 517 builder_->Bailout("ssa allocator: fixed outputs are not supported"); | 517 builder_->Bailout("ssa allocator: fixed outputs are not supported"); |
| 518 } | 518 } |
| 519 | 519 |
| 520 Definition* def = current->AsDefinition(); | 520 Definition* def = current->AsDefinition(); |
| 521 if ((def != NULL) && (def->ssa_temp_index() >= 0)) { | 521 if ((def != NULL) && (def->HasSSATemp())) { |
| 522 Define(output_same_as_first_input ? current : NULL, | 522 Define(output_same_as_first_input ? current : NULL, |
| 523 pos, | 523 pos, |
| 524 def->ssa_temp_index(), | 524 def->ssa_temp_index(), |
| 525 locs->out_slot()); | 525 locs->out_slot()); |
| 526 } | 526 } |
| 527 | 527 |
| 528 current = current->previous(); | 528 current = current->previous(); |
| 529 pos -= 2; | 529 pos -= 2; |
| 530 } | 530 } |
| 531 | 531 |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 | 948 |
| 949 if (FLAG_trace_ssa_allocator) { | 949 if (FLAG_trace_ssa_allocator) { |
| 950 OS::Print("-- ir after allocation -------------------------\n"); | 950 OS::Print("-- ir after allocation -------------------------\n"); |
| 951 FlowGraphPrinter printer(Function::Handle(), block_order_, true); | 951 FlowGraphPrinter printer(Function::Handle(), block_order_, true); |
| 952 printer.PrintBlocks(); | 952 printer.PrintBlocks(); |
| 953 } | 953 } |
| 954 } | 954 } |
| 955 | 955 |
| 956 | 956 |
| 957 } // namespace dart | 957 } // namespace dart |
| OLD | NEW |