OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/gap-resolver.h" | 5 #include "src/compiler/gap-resolver.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 bool is_fp_loc_move = !kSimpleFPAliasing && destination.IsFPLocationOperand(); | 151 bool is_fp_loc_move = !kSimpleFPAliasing && destination.IsFPLocationOperand(); |
152 | 152 |
153 // Perform a depth-first traversal of the move graph to resolve dependencies. | 153 // Perform a depth-first traversal of the move graph to resolve dependencies. |
154 // Any unperformed, unpending move with a source the same as this one's | 154 // Any unperformed, unpending move with a source the same as this one's |
155 // destination blocks this one so recursively perform all such moves. | 155 // destination blocks this one so recursively perform all such moves. |
156 for (size_t i = 0; i < moves->size(); ++i) { | 156 for (size_t i = 0; i < moves->size(); ++i) { |
157 auto other = (*moves)[i]; | 157 auto other = (*moves)[i]; |
158 if (other->IsEliminated()) continue; | 158 if (other->IsEliminated()) continue; |
159 if (other->IsPending()) continue; | 159 if (other->IsPending()) continue; |
160 if (other->source().InterferesWith(destination)) { | 160 if (other->source().InterferesWith(destination)) { |
161 if (!kSimpleFPAliasing && is_fp_loc_move && | 161 if (is_fp_loc_move && |
162 LocationOperand::cast(other->source()).representation() > | 162 LocationOperand::cast(other->source()).representation() > |
163 split_rep_) { | 163 split_rep_) { |
164 // 'other' must also be an FP location move. Break it into fragments | 164 // 'other' must also be an FP location move. Break it into fragments |
165 // of the same size as 'move'. 'other' is set to one of the fragments, | 165 // of the same size as 'move'. 'other' is set to one of the fragments, |
166 // and the rest are appended to 'moves'. | 166 // and the rest are appended to 'moves'. |
167 other = Split(other, split_rep_, moves); | 167 other = Split(other, split_rep_, moves); |
168 // 'other' may not block destination now. | 168 // 'other' may not block destination now. |
169 if (!other->source().InterferesWith(destination)) continue; | 169 if (!other->source().InterferesWith(destination)) continue; |
170 } | 170 } |
171 // Though PerformMove can change any source operand in the move graph, | 171 // Though PerformMove can change any source operand in the move graph, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 other->set_source(destination); | 241 other->set_source(destination); |
242 } else if (destination.EqualsCanonicalized(other->source())) { | 242 } else if (destination.EqualsCanonicalized(other->source())) { |
243 other->set_source(source); | 243 other->set_source(source); |
244 } | 244 } |
245 } | 245 } |
246 } | 246 } |
247 } | 247 } |
248 } // namespace compiler | 248 } // namespace compiler |
249 } // namespace internal | 249 } // namespace internal |
250 } // namespace v8 | 250 } // namespace v8 |
OLD | NEW |