| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 class SsaTypePropagator extends HGraphVisitor { | 5 class SsaTypePropagator extends HGraphVisitor implements OptimizationPhase { |
| 6 | 6 |
| 7 final Map<int, HInstruction> workmap; | 7 final Map<int, HInstruction> workmap; |
| 8 final List<int> worklist; | 8 final List<int> worklist; |
| 9 final Compiler compiler; | 9 final Compiler compiler; |
| 10 final String name = 'type propagator'; |
| 10 | 11 |
| 11 SsaTypePropagator(Compiler this.compiler) | 12 SsaTypePropagator(Compiler this.compiler) |
| 12 : workmap = new Map<int, HInstruction>(), | 13 : workmap = new Map<int, HInstruction>(), |
| 13 worklist = new List<int>(); | 14 worklist = new List<int>(); |
| 14 | 15 |
| 15 void visitGraph(HGraph graph) { | 16 void visitGraph(HGraph graph) { |
| 16 new TypeAnnotationReader(compiler).visitGraph(graph); | 17 new TypeAnnotationReader(compiler).visitGraph(graph); |
| 17 visitDominatorTree(graph); | 18 visitDominatorTree(graph); |
| 18 processWorklist(); | 19 processWorklist(); |
| 19 } | 20 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 parameter.type = HType.INTEGER; | 82 parameter.type = HType.INTEGER; |
| 82 } else if (type.toString() == 'String') { | 83 } else if (type.toString() == 'String') { |
| 83 parameter.type = HType.STRING; | 84 parameter.type = HType.STRING; |
| 84 } | 85 } |
| 85 } | 86 } |
| 86 | 87 |
| 87 void visitGraph(HGraph graph) { | 88 void visitGraph(HGraph graph) { |
| 88 visitDominatorTree(graph); | 89 visitDominatorTree(graph); |
| 89 } | 90 } |
| 90 } | 91 } |
| OLD | NEW |