| 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 class SsaTypePropagator extends HGraphVisitor implements OptimizationPhase { | 5 class SsaTypePropagator extends HGraphVisitor implements OptimizationPhase { |
| 8 | 6 |
| 9 final Map<int, HInstruction> workmap; | 7 final Map<int, HInstruction> workmap; |
| 10 final List<int> worklist; | 8 final List<int> worklist; |
| 11 final Map<HInstruction, Function> pendingOptimizations; | 9 final Map<HInstruction, Function> pendingOptimizations; |
| 12 final HTypeMap types; | 10 final HTypeMap types; |
| 13 | 11 |
| 14 final Compiler compiler; | 12 final Compiler compiler; |
| 15 String get name => 'type propagator'; | 13 String get name => 'type propagator'; |
| 16 | 14 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 // TODO(ngeoffray): Allow speculative optimizations on | 201 // TODO(ngeoffray): Allow speculative optimizations on |
| 204 // non-primitive types? | 202 // non-primitive types? |
| 205 if (!desiredType.isPrimitive()) return newType; | 203 if (!desiredType.isPrimitive()) return newType; |
| 206 return newType.intersection(desiredType); | 204 return newType.intersection(desiredType); |
| 207 } | 205 } |
| 208 | 206 |
| 209 // Do not use speculative argument type optimization for now. | 207 // Do not use speculative argument type optimization for now. |
| 210 void considerForArgumentTypeOptimization(HInstruction instruction) { } | 208 void considerForArgumentTypeOptimization(HInstruction instruction) { } |
| 211 | 209 |
| 212 } | 210 } |
| OLD | NEW |