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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart

Issue 318723002: dart2dart: Restore loops with conditions and updates in backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: For loops and update expressions Created 6 years, 6 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } else { 230 } else {
231 ir.FunctionDefinition function = compiler.irBuilder.getIr(element); 231 ir.FunctionDefinition function = compiler.irBuilder.getIr(element);
232 tree.Builder builder = new tree.Builder(compiler); 232 tree.Builder builder = new tree.Builder(compiler);
233 tree.FunctionDefinition definition = builder.build(function); 233 tree.FunctionDefinition definition = builder.build(function);
234 assert(definition != null); 234 assert(definition != null);
235 compiler.tracer.traceCompilation(element.name, null, compiler); 235 compiler.tracer.traceCompilation(element.name, null, compiler);
236 compiler.tracer.traceGraph('Tree builder', definition); 236 compiler.tracer.traceGraph('Tree builder', definition);
237 treeElements = new TreeElementMapping(element); 237 treeElements = new TreeElementMapping(element);
238 new tree.StatementRewriter().rewrite(definition); 238 new tree.StatementRewriter().rewrite(definition);
239 compiler.tracer.traceGraph('Statement rewriter', definition); 239 compiler.tracer.traceGraph('Statement rewriter', definition);
240 new tree.LoopRewriter().rewrite(definition);
241 compiler.tracer.traceGraph('Loop rewriter', definition);
240 new tree.LogicalRewriter().rewrite(definition); 242 new tree.LogicalRewriter().rewrite(definition);
241 compiler.tracer.traceGraph('Logical rewriter', definition); 243 compiler.tracer.traceGraph('Logical rewriter', definition);
242 node = dart_codegen.emit(element, treeElements, definition); 244 node = dart_codegen.emit(element, treeElements, definition);
243 } 245 }
244 return new ElementAst(node, treeElements); 246 return new ElementAst(node, treeElements);
245 } 247 }
246 248
247 Set<Element> topLevelElements = new Set<Element>(); 249 Set<Element> topLevelElements = new Set<Element>();
248 Map<ClassElement, Set<Element>> classMembers = 250 Map<ClassElement, Set<Element>> classMembers =
249 new Map<ClassElement, Set<Element>>(); 251 new Map<ClassElement, Set<Element>>();
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 } 636 }
635 637
636 Constant compileMetadata(MetadataAnnotation metadata, 638 Constant compileMetadata(MetadataAnnotation metadata,
637 Node node, 639 Node node,
638 TreeElements elements) { 640 TreeElements elements) {
639 return measure(() { 641 return measure(() {
640 return constantCompiler.compileMetadata(metadata, node, elements); 642 return constantCompiler.compileMetadata(metadata, node, elements);
641 }); 643 });
642 } 644 }
643 } 645 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698