| 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 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 // output [------- | 748 // output [------- |
| 749 // | 749 // |
| 750 BlockLocation(*out, pos, pos + 1); | 750 BlockLocation(*out, pos, pos + 1); |
| 751 | 751 |
| 752 if (range->vreg() == kTempVirtualRegister) return; | 752 if (range->vreg() == kTempVirtualRegister) return; |
| 753 | 753 |
| 754 // We need to emit move connecting fixed register with another location | 754 // We need to emit move connecting fixed register with another location |
| 755 // that will be allocated for this output's live range. | 755 // that will be allocated for this output's live range. |
| 756 // Special case: fixed output followed by a fixed input last use. | 756 // Special case: fixed output followed by a fixed input last use. |
| 757 UsePosition* use = range->first_use(); | 757 UsePosition* use = range->first_use(); |
| 758 |
| 759 // If the value has no uses we don't need to allocate it. |
| 760 if (use == NULL) return; |
| 761 |
| 758 if (use->pos() == (pos + 1)) { | 762 if (use->pos() == (pos + 1)) { |
| 759 // We have a use position on the parallel move. | 763 // We have a use position on the parallel move. |
| 760 ASSERT(use->location_slot()->IsUnallocated()); | 764 ASSERT(use->location_slot()->IsUnallocated()); |
| 761 *(use->location_slot()) = *out; | 765 *(use->location_slot()) = *out; |
| 762 | 766 |
| 763 // Remove first use. It was allocated. | 767 // Remove first use. It was allocated. |
| 764 range->set_first_use(range->first_use()->next()); | 768 range->set_first_use(range->first_use()->next()); |
| 765 } | 769 } |
| 766 | 770 |
| 767 // Shorten live range to the point of definition, this might make the range | 771 // Shorten live range to the point of definition, this might make the range |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1648 | 1652 |
| 1649 if (FLAG_trace_ssa_allocator) { | 1653 if (FLAG_trace_ssa_allocator) { |
| 1650 OS::Print("-- ir after allocation -------------------------\n"); | 1654 OS::Print("-- ir after allocation -------------------------\n"); |
| 1651 FlowGraphPrinter printer(Function::Handle(), block_order_, true); | 1655 FlowGraphPrinter printer(Function::Handle(), block_order_, true); |
| 1652 printer.PrintBlocks(); | 1656 printer.PrintBlocks(); |
| 1653 } | 1657 } |
| 1654 } | 1658 } |
| 1655 | 1659 |
| 1656 | 1660 |
| 1657 } // namespace dart | 1661 } // namespace dart |
| OLD | NEW |