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 1088493002: Assignment expressions in tree IR. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comments Created 5 years, 8 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
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 context.traceGraph('Tree builder', treeRoot); 175 context.traceGraph('Tree builder', treeRoot);
176 assert(checkTreeIntegrity(treeRoot)); 176 assert(checkTreeIntegrity(treeRoot));
177 177
178 // Transformations on the Tree IR. 178 // Transformations on the Tree IR.
179 void applyTreePass(tree_opt.Pass pass) { 179 void applyTreePass(tree_opt.Pass pass) {
180 pass.rewrite(treeRoot); 180 pass.rewrite(treeRoot);
181 context.traceGraph(pass.passName, treeRoot); 181 context.traceGraph(pass.passName, treeRoot);
182 assert(checkTreeIntegrity(treeRoot)); 182 assert(checkTreeIntegrity(treeRoot));
183 } 183 }
184 184
185 applyTreePass(new StatementRewriter()); 185 applyTreePass(new StatementRewriter(isDartMode: true));
186 applyTreePass(new VariableMerger()); 186 applyTreePass(new VariableMerger());
187 applyTreePass(new LoopRewriter()); 187 applyTreePass(new LoopRewriter());
188 applyTreePass(new LogicalRewriter()); 188 applyTreePass(new LogicalRewriter());
189 applyTreePass(new PullIntoInitializers());
189 190
190 // Backend-specific transformations. 191 // Backend-specific transformations.
191 new backend_ast_emitter.UnshadowParameters().unshadow(treeRoot); 192 new backend_ast_emitter.UnshadowParameters().unshadow(treeRoot);
192 context.traceGraph('Unshadow parameters', treeRoot); 193 context.traceGraph('Unshadow parameters', treeRoot);
193 194
194 TreeElementMapping treeElements = new TreeElementMapping(element); 195 TreeElementMapping treeElements = new TreeElementMapping(element);
195 backend_ast.RootNode backendAst = 196 backend_ast.RootNode backendAst = backend_ast_emitter.emit(treeRoot);
196 backend_ast_emitter.emit(treeRoot);
197 Node frontend_ast = backend2frontend.emit(treeElements, backendAst); 197 Node frontend_ast = backend2frontend.emit(treeElements, backendAst);
198 return new ElementAst(frontend_ast, treeElements); 198 return new ElementAst(frontend_ast, treeElements);
199 199
200 } 200 }
201 201
202 /** 202 /**
203 * Tells whether we should output given element. Corelib classes like 203 * Tells whether we should output given element. Corelib classes like
204 * Object should not be in the resulting code. 204 * Object should not be in the resulting code.
205 */ 205 */
206 @override 206 @override
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 } 556 }
557 557
558 void traceGraph(String title, var irObject) { 558 void traceGraph(String title, var irObject) {
559 compiler.tracer.traceGraph(title, irObject); 559 compiler.tracer.traceGraph(title, irObject);
560 } 560 }
561 561
562 DartTypes get dartTypes => compiler.types; 562 DartTypes get dartTypes => compiler.types;
563 563
564 InternalErrorFunction get internalError => compiler.internalError; 564 InternalErrorFunction get internalError => compiler.internalError;
565 } 565 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698