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

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/task.dart

Issue 979693003: Streamline the CPS IR Visitor interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Signal an error in visit methods that should not be called. 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 /// Generate code using the cps-based IR pipeline. 5 /// Generate code using the cps-based IR pipeline.
6 library code_generator_task; 6 library code_generator_task;
7 7
8 import 'glue.dart'; 8 import 'glue.dart';
9 import 'codegen.dart'; 9 import 'codegen.dart';
10 import 'unsugar.dart'; 10 import 'unsugar.dart';
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 158
159 new RedundantPhiEliminator().rewrite(cpsNode); 159 new RedundantPhiEliminator().rewrite(cpsNode);
160 traceGraph("Redundant phi elimination", cpsNode); 160 traceGraph("Redundant phi elimination", cpsNode);
161 new ShrinkingReducer().rewrite(cpsNode); 161 new ShrinkingReducer().rewrite(cpsNode);
162 traceGraph("Shrinking reductions", cpsNode); 162 traceGraph("Shrinking reductions", cpsNode);
163 163
164 // Do not rewrite the IR after variable allocation. Allocation 164 // Do not rewrite the IR after variable allocation. Allocation
165 // makes decisions based on an approximation of IR variable live 165 // makes decisions based on an approximation of IR variable live
166 // ranges that can be invalidated by transforming the IR. 166 // ranges that can be invalidated by transforming the IR.
167 new cps.RegisterAllocator().visit(cpsNode); 167 new cps.RegisterAllocator(compiler.internalError).visit(cpsNode);
168 return cpsNode; 168 return cpsNode;
169 } 169 }
170 170
171 tree_ir.FunctionDefinition compileToTreeIR(cps.FunctionDefinition cpsNode) { 171 tree_ir.FunctionDefinition compileToTreeIR(cps.FunctionDefinition cpsNode) {
172 tree_builder.Builder builder = new JsTreeBuilder( 172 tree_builder.Builder builder = new JsTreeBuilder(
173 compiler.internalError, compiler.identicalFunction, glue); 173 compiler.internalError, compiler.identicalFunction, glue);
174 tree_ir.FunctionDefinition treeNode = builder.buildFunction(cpsNode); 174 tree_ir.FunctionDefinition treeNode = builder.buildFunction(cpsNode);
175 assert(treeNode != null); 175 assert(treeNode != null);
176 traceGraph('Tree builder', treeNode); 176 traceGraph('Tree builder', treeNode);
177 return treeNode; 177 return treeNode;
(...skipping 25 matching lines...) Expand all
203 Iterable<CompilerTask> get tasks { 203 Iterable<CompilerTask> get tasks {
204 // TODO(sigurdm): Make a better list of tasks. 204 // TODO(sigurdm): Make a better list of tasks.
205 return <CompilerTask>[irBuilderTask]..addAll(fallbackCompiler.tasks); 205 return <CompilerTask>[irBuilderTask]..addAll(fallbackCompiler.tasks);
206 } 206 }
207 207
208 js.Node attachPosition(js.Node node, AstElement element) { 208 js.Node attachPosition(js.Node node, AstElement element) {
209 return node.withSourceInformation( 209 return node.withSourceInformation(
210 StartEndSourceInformation.computeSourceInformation(element)); 210 StartEndSourceInformation.computeSourceInformation(element));
211 } 211 }
212 } 212 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dart_backend/backend.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698