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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart

Issue 731503002: cps-ir: Split up main codegen and add a bailout exception to print out (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Refactor. Created 6 years, 1 month 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 | « no previous file | pkg/compiler/lib/src/js_backend/codegen/codegen.dart » ('j') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.ir_builder; 5 part of dart2js.ir_builder;
6 6
7 /** 7 /**
8 * This task iterates through all resolved elements and builds [ir.Node]s. The 8 * This task iterates through all resolved elements and builds [ir.Node]s. The
9 * nodes are stored in the [nodes] map and accessible through [hasIr] and 9 * nodes are stored in the [nodes] map and accessible through [hasIr] and
10 * [getIr]. 10 * [getIr].
(...skipping 23 matching lines...) Expand all
34 ir.FunctionDefinition getIr(Element element) => nodes[element.implementation]; 34 ir.FunctionDefinition getIr(Element element) => nodes[element.implementation];
35 35
36 ir.FunctionDefinition buildNode(AstElement element) { 36 ir.FunctionDefinition buildNode(AstElement element) {
37 if (!canBuild(element)) return null; 37 if (!canBuild(element)) return null;
38 TreeElements elementsMapping = element.resolvedAst.elements; 38 TreeElements elementsMapping = element.resolvedAst.elements;
39 element = element.implementation; 39 element = element.implementation;
40 return compiler.withCurrentElement(element, () { 40 return compiler.withCurrentElement(element, () {
41 SourceFile sourceFile = elementSourceFile(element); 41 SourceFile sourceFile = elementSourceFile(element);
42 IrBuilderVisitor builder = 42 IrBuilderVisitor builder =
43 new IrBuilderVisitor(elementsMapping, compiler, sourceFile); 43 new IrBuilderVisitor(elementsMapping, compiler, sourceFile);
44 ir.FunctionDefinition function; 44 return builder.buildFunction(element);
45 function = builder.buildFunction(element);
46
47 return function;
48 }); 45 });
49 } 46 }
50 47
51 void buildNodes() { 48 void buildNodes() {
52 measure(() { 49 measure(() {
53 Set<Element> resolved = compiler.enqueuer.resolution.resolvedElements; 50 Set<Element> resolved = compiler.enqueuer.resolution.resolvedElements;
54 resolved.forEach((AstElement element) { 51 resolved.forEach((AstElement element) {
55 ir.FunctionDefinition functionDefinition = buildNode(element); 52 ir.FunctionDefinition functionDefinition = buildNode(element);
56 if (functionDefinition != null) { 53 if (functionDefinition != null) {
57 nodes[element] = functionDefinition; 54 nodes[element] = functionDefinition;
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 node.visitChildren(this); 876 node.visitChildren(this);
880 } 877 }
881 878
882 visitFunctionExpression(ast.FunctionExpression node) { 879 visitFunctionExpression(ast.FunctionExpression node) {
883 FunctionElement oldFunction = currentFunction; 880 FunctionElement oldFunction = currentFunction;
884 currentFunction = elements[node]; 881 currentFunction = elements[node];
885 visit(node.body); 882 visit(node.body);
886 currentFunction = oldFunction; 883 currentFunction = oldFunction;
887 } 884 }
888 } 885 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/codegen/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698