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

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

Issue 1001793002: dart2js: Add support for do/while loops to the CPS backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 months 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
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // Transformations on the CPS IR. 153 // Transformations on the CPS IR.
154 void applyCpsPass(cps_opt.Pass pass) { 154 void applyCpsPass(cps_opt.Pass pass) {
155 pass.rewrite(cpsDefinition); 155 pass.rewrite(cpsDefinition);
156 context.traceGraph(pass.passName, cpsDefinition); 156 context.traceGraph(pass.passName, cpsDefinition);
157 assert(checkCpsIntegrity(cpsDefinition)); 157 assert(checkCpsIntegrity(cpsDefinition));
158 } 158 }
159 159
160 // TODO(karlklose): enable type propagation for dart2dart when constant 160 // TODO(karlklose): enable type propagation for dart2dart when constant
161 // types are correctly marked as instantiated (Issue 21880). 161 // types are correctly marked as instantiated (Issue 21880).
162 applyCpsPass(new TypePropagator(context.dartTypes, 162 applyCpsPass(new TypePropagator(context.dartTypes,
163 context.constantSystem, 163 context.constantSystem,
Johnni Winther 2015/03/12 12:38:07 Indent by 4 or align with `context.dartType`.
Kevin Millikin (Google) 2015/03/12 14:05:18 Oops, I totally misread the indentation. I'll cle
164 new UnitTypeSystem(), 164 new UnitTypeSystem(),
165 context.internalError)); 165 context.internalError));
166 applyCpsPass(new RedundantPhiEliminator()); 166 applyCpsPass(new RedundantPhiEliminator());
167 applyCpsPass(new ShrinkingReducer()); 167 applyCpsPass(new ShrinkingReducer());
168 168
169 // Do not rewrite the IR after variable allocation. Allocation 169 // Do not rewrite the IR after variable allocation. Allocation
170 // makes decisions based on an approximation of IR variable live 170 // makes decisions based on an approximation of IR variable live
171 // ranges that can be invalidated by transforming the IR. 171 // ranges that can be invalidated by transforming the IR.
172 new cps_ir.RegisterAllocator(context.internalError).visit(cpsDefinition); 172 new cps_ir.RegisterAllocator(context.internalError).visit(cpsDefinition);
173 173
174 tree_builder.Builder builder = 174 tree_builder.Builder builder =
175 new tree_builder.Builder(context.internalError); 175 new tree_builder.Builder(context.internalError);
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 } 560 }
561 561
562 void traceGraph(String title, var irObject) { 562 void traceGraph(String title, var irObject) {
563 compiler.tracer.traceGraph(title, irObject); 563 compiler.tracer.traceGraph(title, irObject);
564 } 564 }
565 565
566 DartTypes get dartTypes => compiler.types; 566 DartTypes get dartTypes => compiler.types;
567 567
568 InternalErrorFunction get internalError => compiler.internalError; 568 InternalErrorFunction get internalError => compiler.internalError;
569 } 569 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698