| 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 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 MoveOperands* move = | 906 MoveOperands* move = |
| 907 AddMoveAt(pos - 1, *in_ref, Location::Any()); | 907 AddMoveAt(pos - 1, *in_ref, Location::Any()); |
| 908 BlockLocation(*in_ref, pos - 1, pos + 1); | 908 BlockLocation(*in_ref, pos - 1, pos + 1); |
| 909 range->AddUseInterval(block->start_pos(), pos - 1); | 909 range->AddUseInterval(block->start_pos(), pos - 1); |
| 910 range->AddHintedUse(pos - 1, move->src_slot(), in_ref); | 910 range->AddHintedUse(pos - 1, move->src_slot(), in_ref); |
| 911 } else if (in_ref->IsUnallocated()) { | 911 } else if (in_ref->IsUnallocated()) { |
| 912 if (in_ref->policy() == Location::kWritableRegister) { | 912 if (in_ref->policy() == Location::kWritableRegister) { |
| 913 // Writable unallocated input. Expected shape of | 913 // Writable unallocated input. Expected shape of |
| 914 // live ranges: | 914 // live ranges: |
| 915 // | 915 // |
| 916 // j' i i' | 916 // i i' |
| 917 // value --* | 917 // value --* |
| 918 // temp [------) | 918 // temp [--) |
| 919 MoveOperands* move = AddMoveAt(pos - 1, | 919 MoveOperands* move = AddMoveAt(pos, |
| 920 Location::RequiresRegister(), | 920 Location::RequiresRegister(), |
| 921 Location::PrefersRegister()); | 921 Location::PrefersRegister()); |
| 922 | 922 |
| 923 // Add uses to the live range of the input. | 923 // Add uses to the live range of the input. |
| 924 range->AddUseInterval(block->start_pos(), pos - 1); | 924 range->AddUseInterval(block->start_pos(), pos); |
| 925 range->AddUse(pos - 1, move->src_slot()); | 925 range->AddUse(pos, move->src_slot()); |
| 926 | 926 |
| 927 // Create live range for the temporary. | 927 // Create live range for the temporary. |
| 928 LiveRange* temp = MakeLiveRangeForTemporary(); | 928 LiveRange* temp = MakeLiveRangeForTemporary(); |
| 929 temp->AddUseInterval(pos - 1, pos + 1); | 929 temp->AddUseInterval(pos, pos + 1); |
| 930 temp->AddHintedUse(pos - 1, in_ref, move->src_slot()); | 930 temp->AddHintedUse(pos, in_ref, move->src_slot()); |
| 931 temp->AddUse(pos + 1, move->dest_slot()); | 931 temp->AddUse(pos, move->dest_slot()); |
| 932 *in_ref = Location::RequiresRegister(); | 932 *in_ref = Location::RequiresRegister(); |
| 933 CompleteRange(temp, RegisterKindFromPolicy(*in_ref)); | 933 CompleteRange(temp, RegisterKindFromPolicy(*in_ref)); |
| 934 } else { | 934 } else { |
| 935 // Normal unallocated input. Expected shape of | 935 // Normal unallocated input. Expected shape of |
| 936 // live ranges: | 936 // live ranges: |
| 937 // | 937 // |
| 938 // i i' | 938 // i i' |
| 939 // value -----* | 939 // value -----* |
| 940 // | 940 // |
| 941 range->AddUseInterval(block->start_pos(), pos + 1); | 941 range->AddUseInterval(block->start_pos(), pos + 1); |
| (...skipping 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2781 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", | 2781 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", |
| 2782 function.ToFullyQualifiedCString()); | 2782 function.ToFullyQualifiedCString()); |
| 2783 FlowGraphPrinter printer(flow_graph_, true); | 2783 FlowGraphPrinter printer(flow_graph_, true); |
| 2784 printer.PrintBlocks(); | 2784 printer.PrintBlocks(); |
| 2785 OS::Print("----------------------------------------------\n"); | 2785 OS::Print("----------------------------------------------\n"); |
| 2786 } | 2786 } |
| 2787 } | 2787 } |
| 2788 | 2788 |
| 2789 | 2789 |
| 2790 } // namespace dart | 2790 } // namespace dart |
| OLD | NEW |