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 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1143 } | 1143 } |
1144 | 1144 |
1145 const intptr_t pos = current->lifetime_position(); | 1145 const intptr_t pos = current->lifetime_position(); |
1146 ASSERT(IsInstructionStartPosition(pos)); | 1146 ASSERT(IsInstructionStartPosition(pos)); |
1147 | 1147 |
1148 ASSERT(locs->input_count() == current->InputCount()); | 1148 ASSERT(locs->input_count() == current->InputCount()); |
1149 | 1149 |
1150 // Normalize same-as-first-input output if input is specified as | 1150 // Normalize same-as-first-input output if input is specified as |
1151 // fixed register. | 1151 // fixed register. |
1152 if (locs->out(0).IsUnallocated() && | 1152 if (locs->out(0).IsUnallocated() && |
1153 (locs->out(0).policy() == Location::kSameAsFirstInput) && | 1153 (locs->out(0).policy() == Location::kSameAsFirstInput)) { |
1154 (locs->in(0).IsMachineRegister())) { | 1154 if (locs->in(0).IsPairLocation()) { |
1155 locs->set_out(0, locs->in(0)); | 1155 // Pair input, pair output. |
1156 PairLocation* in_pair = locs->in(0).AsPairLocation(); | |
1157 if (in_pair->At(0).IsMachineRegister() || | |
1158 in_pair->At(1).IsMachineRegister()) { | |
1159 locs->set_out(0, Location::Pair(in_pair->At(0), in_pair->At(1))); | |
Vyacheslav Egorov (Google)
2014/07/16 16:26:42
I wonder what happens if you have partial pair loc
Cutch
2014/07/16 16:39:29
Done.
| |
1160 } | |
1161 } else if (locs->in(0).IsMachineRegister()) { | |
1162 // Single input, single output. | |
1163 locs->set_out(0, locs->in(0)); | |
1164 } | |
1156 } | 1165 } |
1157 | 1166 |
1158 const bool output_same_as_first_input = | 1167 const bool output_same_as_first_input = |
1159 locs->out(0).IsUnallocated() && | 1168 locs->out(0).IsUnallocated() && |
1160 (locs->out(0).policy() == Location::kSameAsFirstInput); | 1169 (locs->out(0).policy() == Location::kSameAsFirstInput); |
1161 | 1170 |
1162 // Output is same as first input which is a pair. | 1171 // Output is same as first input which is a pair. |
1163 if (output_same_as_first_input && locs->in(0).IsPairLocation()) { | 1172 if (output_same_as_first_input && locs->in(0).IsPairLocation()) { |
1164 // Make out into a PairLocation. | 1173 // Make out into a PairLocation. |
1165 locs->set_out(0, Location::Pair(Location::RequiresRegister(), | 1174 locs->set_out(0, Location::Pair(Location::RequiresRegister(), |
(...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2887 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", | 2896 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", |
2888 function.ToFullyQualifiedCString()); | 2897 function.ToFullyQualifiedCString()); |
2889 FlowGraphPrinter printer(flow_graph_, true); | 2898 FlowGraphPrinter printer(flow_graph_, true); |
2890 printer.PrintBlocks(); | 2899 printer.PrintBlocks(); |
2891 OS::Print("----------------------------------------------\n"); | 2900 OS::Print("----------------------------------------------\n"); |
2892 } | 2901 } |
2893 } | 2902 } |
2894 | 2903 |
2895 | 2904 |
2896 } // namespace dart | 2905 } // namespace dart |
OLD | NEW |