| 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 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 return i; | 1088 return i; |
| 1089 } | 1089 } |
| 1090 } | 1090 } |
| 1091 spill_slots_.Add(0); | 1091 spill_slots_.Add(0); |
| 1092 return spill_slots_.length() - 1; | 1092 return spill_slots_.length() - 1; |
| 1093 } | 1093 } |
| 1094 | 1094 |
| 1095 | 1095 |
| 1096 void FlowGraphAllocator::Spill(LiveRange* range) { | 1096 void FlowGraphAllocator::Spill(LiveRange* range) { |
| 1097 const intptr_t spill_index = AllocateSpillSlotFor(range); | 1097 const intptr_t spill_index = AllocateSpillSlotFor(range); |
| 1098 ASSERT(spill_slots_[spill_index] < range->Start()); | 1098 ASSERT(spill_slots_[spill_index] <= range->Start()); |
| 1099 spill_slots_[spill_index] = range->End(); | 1099 spill_slots_[spill_index] = range->End(); |
| 1100 range->set_assigned_location(Location::SpillSlot(spill_index)); | 1100 range->set_assigned_location(Location::SpillSlot(spill_index)); |
| 1101 ConvertAllUses(range); | 1101 ConvertAllUses(range); |
| 1102 } | 1102 } |
| 1103 | 1103 |
| 1104 | 1104 |
| 1105 intptr_t FlowGraphAllocator::FirstIntersectionWithAllocated( | 1105 intptr_t FlowGraphAllocator::FirstIntersectionWithAllocated( |
| 1106 Register reg, LiveRange* unallocated) { | 1106 Register reg, LiveRange* unallocated) { |
| 1107 intptr_t intersection = kMaxPosition; | 1107 intptr_t intersection = kMaxPosition; |
| 1108 for (intptr_t i = 0; i < cpu_regs_[reg].length(); i++) { | 1108 for (intptr_t i = 0; i < cpu_regs_[reg].length(); i++) { |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 | 1602 |
| 1603 if (FLAG_trace_ssa_allocator) { | 1603 if (FLAG_trace_ssa_allocator) { |
| 1604 OS::Print("-- ir after allocation -------------------------\n"); | 1604 OS::Print("-- ir after allocation -------------------------\n"); |
| 1605 FlowGraphPrinter printer(Function::Handle(), block_order_, true); | 1605 FlowGraphPrinter printer(Function::Handle(), block_order_, true); |
| 1606 printer.PrintBlocks(); | 1606 printer.PrintBlocks(); |
| 1607 } | 1607 } |
| 1608 } | 1608 } |
| 1609 | 1609 |
| 1610 | 1610 |
| 1611 } // namespace dart | 1611 } // namespace dart |
| OLD | NEW |