| 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 2414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2425 mint_values_ = new BitVector(flow_graph_.max_virtual_register_number()); | 2425 mint_values_ = new BitVector(flow_graph_.max_virtual_register_number()); |
| 2426 | 2426 |
| 2427 for (BlockIterator it = flow_graph_.reverse_postorder_iterator(); | 2427 for (BlockIterator it = flow_graph_.reverse_postorder_iterator(); |
| 2428 !it.Done(); | 2428 !it.Done(); |
| 2429 it.Advance()) { | 2429 it.Advance()) { |
| 2430 BlockEntryInstr* block = it.Current(); | 2430 BlockEntryInstr* block = it.Current(); |
| 2431 // TODO(fschneider): Support unboxed mint representation for phis. | 2431 // TODO(fschneider): Support unboxed mint representation for phis. |
| 2432 for (ForwardInstructionIterator instr_it(block); | 2432 for (ForwardInstructionIterator instr_it(block); |
| 2433 !instr_it.Done(); | 2433 !instr_it.Done(); |
| 2434 instr_it.Advance()) { | 2434 instr_it.Advance()) { |
| 2435 Instruction* instr = instr_it.Current(); | 2435 Definition* defn = instr_it.Current()->AsDefinition(); |
| 2436 if (instr->IsDefinition() && instr->representation() == kUnboxedMint) { | 2436 if ((defn != NULL) && |
| 2437 mint_values_->Add(instr->AsDefinition()->ssa_temp_index()); | 2437 (defn->ssa_temp_index() >= 0) && |
| 2438 (defn->representation() == kUnboxedMint)) { |
| 2439 mint_values_->Add(defn->ssa_temp_index()); |
| 2438 } | 2440 } |
| 2439 } | 2441 } |
| 2440 } | 2442 } |
| 2441 } | 2443 } |
| 2442 | 2444 |
| 2443 | 2445 |
| 2444 void FlowGraphAllocator::AllocateRegisters() { | 2446 void FlowGraphAllocator::AllocateRegisters() { |
| 2445 CollectRepresentations(); | 2447 CollectRepresentations(); |
| 2446 | 2448 |
| 2447 EliminateEnvironmentUses(); | 2449 EliminateEnvironmentUses(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2509 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", | 2511 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", |
| 2510 function.ToFullyQualifiedCString()); | 2512 function.ToFullyQualifiedCString()); |
| 2511 FlowGraphPrinter printer(flow_graph_, true); | 2513 FlowGraphPrinter printer(flow_graph_, true); |
| 2512 printer.PrintBlocks(); | 2514 printer.PrintBlocks(); |
| 2513 OS::Print("----------------------------------------------\n"); | 2515 OS::Print("----------------------------------------------\n"); |
| 2514 } | 2516 } |
| 2515 } | 2517 } |
| 2516 | 2518 |
| 2517 | 2519 |
| 2518 } // namespace dart | 2520 } // namespace dart |
| OLD | NEW |