Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: pkg/compiler/lib/src/dart_backend/backend.dart

Issue 800433003: First version of typr propagation in the new IR. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add type arguments, fix join and tests. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 ConstantPropagator(compiler, constantSystem).rewrite(cpsDefinition); 149 new TypePropagator(compiler, constantSystem, new TypeMaskSystem(compiler),
150 compiler.internalError).rewrite(cpsDefinition);
150 traceGraph("Sparse constant propagation", cpsDefinition); 151 traceGraph("Sparse constant propagation", cpsDefinition);
151 new RedundantPhiEliminator().rewrite(cpsDefinition); 152 new RedundantPhiEliminator().rewrite(cpsDefinition);
152 traceGraph("Redundant phi elimination", cpsDefinition); 153 traceGraph("Redundant phi elimination", cpsDefinition);
153 new ShrinkingReducer().rewrite(cpsDefinition); 154 new ShrinkingReducer().rewrite(cpsDefinition);
154 traceGraph("Shrinking reductions", cpsDefinition); 155 traceGraph("Shrinking reductions", cpsDefinition);
155 156
156 // Do not rewrite the IR after variable allocation. Allocation 157 // Do not rewrite the IR after variable allocation. Allocation
157 // makes decisions based on an approximation of IR variable live 158 // makes decisions based on an approximation of IR variable live
158 // ranges that can be invalidated by transforming the IR. 159 // ranges that can be invalidated by transforming the IR.
159 new cps_ir.RegisterAllocator().visit(cpsDefinition); 160 new cps_ir.RegisterAllocator().visit(cpsDefinition);
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 } 517 }
517 518
518 ConstantExpression compileMetadata(MetadataAnnotation metadata, 519 ConstantExpression compileMetadata(MetadataAnnotation metadata,
519 Node node, 520 Node node,
520 TreeElements elements) { 521 TreeElements elements) {
521 return measure(() { 522 return measure(() {
522 return constantCompiler.compileMetadata(metadata, node, elements); 523 return constantCompiler.compileMetadata(metadata, node, elements);
523 }); 524 });
524 } 525 }
525 } 526 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698