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

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/task.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) 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 return true; // So this can be used from assert(). 201 return true; // So this can be used from assert().
202 } 202 }
203 203
204 tree_ir.FunctionDefinition optimizeTreeIR(tree_ir.FunctionDefinition node) { 204 tree_ir.FunctionDefinition optimizeTreeIR(tree_ir.FunctionDefinition node) {
205 void applyTreePass(tree_opt.Pass pass) { 205 void applyTreePass(tree_opt.Pass pass) {
206 pass.rewrite(node); 206 pass.rewrite(node);
207 traceGraph(pass.passName, node); 207 traceGraph(pass.passName, node);
208 assert(checkTreeIntegrity(node)); 208 assert(checkTreeIntegrity(node));
209 } 209 }
210 210
211 applyTreePass(new StatementRewriter()); 211 applyTreePass(new StatementRewriter(isDartMode: false));
212 applyTreePass(new VariableMerger()); 212 applyTreePass(new VariableMerger());
213 applyTreePass(new LoopRewriter()); 213 applyTreePass(new LoopRewriter());
214 applyTreePass(new LogicalRewriter()); 214 applyTreePass(new LogicalRewriter());
215 applyTreePass(new PullIntoInitializers());
215 216
216 return node; 217 return node;
217 } 218 }
218 219
219 js.Fun compileToJavaScript(CodegenWorkItem work, 220 js.Fun compileToJavaScript(CodegenWorkItem work,
220 tree_ir.FunctionDefinition definition) { 221 tree_ir.FunctionDefinition definition) {
221 CodeGenerator codeGen = new CodeGenerator(glue, work.registry); 222 CodeGenerator codeGen = new CodeGenerator(glue, work.registry);
222 223
223 return attachPosition(codeGen.buildFunction(definition), work.element); 224 return attachPosition(codeGen.buildFunction(definition), work.element);
224 } 225 }
225 226
226 Iterable<CompilerTask> get tasks { 227 Iterable<CompilerTask> get tasks {
227 // TODO(sigurdm): Make a better list of tasks. 228 // TODO(sigurdm): Make a better list of tasks.
228 return <CompilerTask>[irBuilderTask]..addAll(fallbackCompiler.tasks); 229 return <CompilerTask>[irBuilderTask]..addAll(fallbackCompiler.tasks);
229 } 230 }
230 231
231 js.Node attachPosition(js.Node node, AstElement element) { 232 js.Node attachPosition(js.Node node, AstElement element) {
232 return node.withSourceInformation( 233 return node.withSourceInformation(
233 StartEndSourceInformation.computeSourceInformation(element)); 234 StartEndSourceInformation.computeSourceInformation(element));
234 } 235 }
235 } 236 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698