| 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 dart_backend; | 5 part of dart_backend; |
| 6 | 6 |
| 7 // TODO(ahe): This class is simply wrong. This backend should use | 7 // TODO(ahe): This class is simply wrong. This backend should use |
| 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, | 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, |
| 9 // TreeElements>] is what is needed. | 9 // TreeElements>] is what is needed. |
| 10 class ElementAst { | 10 class ElementAst { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 if (tracer != null) { | 139 if (tracer != null) { |
| 140 tracer.traceCompilation(element.name, null); | 140 tracer.traceCompilation(element.name, null); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void traceGraph(String title, var irObject) { | 143 void traceGraph(String title, var irObject) { |
| 144 if (tracer != null) { | 144 if (tracer != null) { |
| 145 tracer.traceGraph(title, irObject); | 145 tracer.traceGraph(title, irObject); |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 | 148 |
| 149 new TypePropagator(compiler, constantSystem, new TypeMaskSystem(compiler), | 149 // TODO(karlklose): enable type propagation for dart2dart when constant |
| 150 // types are correctly marked as instantiated (Issue 21880). |
| 151 new TypePropagator(compiler, constantSystem, new UnitTypeSystem(), |
| 150 compiler.internalError).rewrite(cpsDefinition); | 152 compiler.internalError).rewrite(cpsDefinition); |
| 151 traceGraph("Sparse constant propagation", cpsDefinition); | 153 traceGraph("Sparse constant propagation", cpsDefinition); |
| 152 new RedundantPhiEliminator().rewrite(cpsDefinition); | 154 new RedundantPhiEliminator().rewrite(cpsDefinition); |
| 153 traceGraph("Redundant phi elimination", cpsDefinition); | 155 traceGraph("Redundant phi elimination", cpsDefinition); |
| 154 new ShrinkingReducer().rewrite(cpsDefinition); | 156 new ShrinkingReducer().rewrite(cpsDefinition); |
| 155 traceGraph("Shrinking reductions", cpsDefinition); | 157 traceGraph("Shrinking reductions", cpsDefinition); |
| 156 | 158 |
| 157 // Do not rewrite the IR after variable allocation. Allocation | 159 // Do not rewrite the IR after variable allocation. Allocation |
| 158 // makes decisions based on an approximation of IR variable live | 160 // makes decisions based on an approximation of IR variable live |
| 159 // ranges that can be invalidated by transforming the IR. | 161 // ranges that can be invalidated by transforming the IR. |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 } | 519 } |
| 518 | 520 |
| 519 ConstantExpression compileMetadata(MetadataAnnotation metadata, | 521 ConstantExpression compileMetadata(MetadataAnnotation metadata, |
| 520 Node node, | 522 Node node, |
| 521 TreeElements elements) { | 523 TreeElements elements) { |
| 522 return measure(() { | 524 return measure(() { |
| 523 return constantCompiler.compileMetadata(metadata, node, elements); | 525 return constantCompiler.compileMetadata(metadata, node, elements); |
| 524 }); | 526 }); |
| 525 } | 527 } |
| 526 } | 528 } |
| OLD | NEW |