Chromium Code Reviews| 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 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1278 void FlowGraphAllocator::AssignNonFreeRegister(LiveRange* unallocated, | 1278 void FlowGraphAllocator::AssignNonFreeRegister(LiveRange* unallocated, |
| 1279 Register reg) { | 1279 Register reg) { |
| 1280 TRACE_ALLOC(("assigning blocked register %s to live range %d\n", | 1280 TRACE_ALLOC(("assigning blocked register %s to live range %d\n", |
| 1281 Location::RegisterLocation(reg).Name(), | 1281 Location::RegisterLocation(reg).Name(), |
| 1282 unallocated->vreg())); | 1282 unallocated->vreg())); |
| 1283 | 1283 |
| 1284 intptr_t first_evicted = -1; | 1284 intptr_t first_evicted = -1; |
| 1285 for (intptr_t i = cpu_regs_[reg].length() - 1; i >= 0; i--) { | 1285 for (intptr_t i = cpu_regs_[reg].length() - 1; i >= 0; i--) { |
| 1286 LiveRange* allocated = cpu_regs_[reg][i]; | 1286 LiveRange* allocated = cpu_regs_[reg][i]; |
| 1287 if (allocated->vreg() < 0) continue; // Can't be evicted. | 1287 if (allocated->vreg() < 0) continue; // Can't be evicted. |
| 1288 if (EvictIntersection(allocated, | 1288 if (EvictIntersection(allocated, |
|
Kevin Millikin (Google)
2012/07/25 11:26:32
We probably don't need a line break here.
| |
| 1289 unallocated)) { | 1289 unallocated)) { |
| 1290 ASSERT(allocated->End() <= unallocated->Start()); | |
| 1291 ConvertAllUses(allocated); | |
| 1290 cpu_regs_[reg][i] = NULL; | 1292 cpu_regs_[reg][i] = NULL; |
| 1291 first_evicted = i; | 1293 first_evicted = i; |
| 1292 } | 1294 } |
| 1293 } | 1295 } |
| 1294 | 1296 |
| 1295 // Remove evicted ranges from the array. | 1297 // Remove evicted ranges from the array. |
| 1296 if (first_evicted != -1) RemoveEvicted(reg, first_evicted); | 1298 if (first_evicted != -1) RemoveEvicted(reg, first_evicted); |
| 1297 | 1299 |
| 1298 cpu_regs_[reg].Add(unallocated); | 1300 cpu_regs_[reg].Add(unallocated); |
| 1299 unallocated->set_assigned_location(Location::RegisterLocation(reg)); | 1301 unallocated->set_assigned_location(Location::RegisterLocation(reg)); |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1596 | 1598 |
| 1597 if (FLAG_trace_ssa_allocator) { | 1599 if (FLAG_trace_ssa_allocator) { |
| 1598 OS::Print("-- ir after allocation -------------------------\n"); | 1600 OS::Print("-- ir after allocation -------------------------\n"); |
| 1599 FlowGraphPrinter printer(Function::Handle(), block_order_, true); | 1601 FlowGraphPrinter printer(Function::Handle(), block_order_, true); |
| 1600 printer.PrintBlocks(); | 1602 printer.PrintBlocks(); |
| 1601 } | 1603 } |
| 1602 } | 1604 } |
| 1603 | 1605 |
| 1604 | 1606 |
| 1605 } // namespace dart | 1607 } // namespace dart |
| OLD | NEW |