| 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 part of ssa; | |
| 6 | |
| 7 /** | 5 /** |
| 8 * Instead of emitting each SSA instruction with a temporary variable | 6 * Instead of emitting each SSA instruction with a temporary variable |
| 9 * mark instructions that can be emitted at their use-site. | 7 * mark instructions that can be emitted at their use-site. |
| 10 * For example, in: | 8 * For example, in: |
| 11 * t0 = 4; | 9 * t0 = 4; |
| 12 * t1 = 3; | 10 * t1 = 3; |
| 13 * t2 = add(t0, t1); | 11 * t2 = add(t0, t1); |
| 14 * t0 and t1 would be marked and the resulting code would then be: | 12 * t0 and t1 would be marked and the resulting code would then be: |
| 15 * t2 = add(4, 3); | 13 * t2 = add(4, 3); |
| 16 */ | 14 */ |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 } | 340 } |
| 343 | 341 |
| 344 // If [thenInput] is defined in the first predecessor, then it is only used | 342 // If [thenInput] is defined in the first predecessor, then it is only used |
| 345 // by [phi] and can be generated at use site. | 343 // by [phi] and can be generated at use site. |
| 346 if (identical(thenInput.block, end.predecessors[0])) { | 344 if (identical(thenInput.block, end.predecessors[0])) { |
| 347 assert(thenInput.usedBy.length == 1); | 345 assert(thenInput.usedBy.length == 1); |
| 348 markAsGenerateAtUseSite(thenInput); | 346 markAsGenerateAtUseSite(thenInput); |
| 349 } | 347 } |
| 350 } | 348 } |
| 351 } | 349 } |
| OLD | NEW |