| OLD | NEW |
| 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 void applyTreePass(tree_opt.Pass pass) { | 272 void applyTreePass(tree_opt.Pass pass) { |
| 273 treeOptimizationTask.measureSubtask(pass.passName, () { | 273 treeOptimizationTask.measureSubtask(pass.passName, () { |
| 274 pass.rewrite(node); | 274 pass.rewrite(node); |
| 275 }); | 275 }); |
| 276 traceGraph(pass.passName, node); | 276 traceGraph(pass.passName, node); |
| 277 assert(checkTreeIntegrity(node)); | 277 assert(checkTreeIntegrity(node)); |
| 278 } | 278 } |
| 279 | 279 |
| 280 treeOptimizationTask.measure(() { | 280 treeOptimizationTask.measure(() { |
| 281 applyTreePass(new StatementRewriter()); | 281 applyTreePass(new StatementRewriter()); |
| 282 applyTreePass(new VariableMerger()); | 282 applyTreePass(new VariableMerger(minifying: compiler.enableMinification)); |
| 283 applyTreePass(new LoopRewriter()); | 283 applyTreePass(new LoopRewriter()); |
| 284 applyTreePass(new LogicalRewriter()); | 284 applyTreePass(new LogicalRewriter()); |
| 285 applyTreePass(new PullIntoInitializers()); | 285 applyTreePass(new PullIntoInitializers()); |
| 286 }); | 286 }); |
| 287 | 287 |
| 288 return node; | 288 return node; |
| 289 } | 289 } |
| 290 | 290 |
| 291 js.Fun compileToJavaScript(CodegenWorkItem work, | 291 js.Fun compileToJavaScript(CodegenWorkItem work, |
| 292 tree_ir.FunctionDefinition definition) { | 292 tree_ir.FunctionDefinition definition) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 308 treeOptimizationTask] | 308 treeOptimizationTask] |
| 309 ..addAll(fallbackCompiler.tasks); | 309 ..addAll(fallbackCompiler.tasks); |
| 310 } | 310 } |
| 311 | 311 |
| 312 js.Node attachPosition(js.Node node, AstElement element) { | 312 js.Node attachPosition(js.Node node, AstElement element) { |
| 313 return node.withSourceInformation( | 313 return node.withSourceInformation( |
| 314 sourceInformationFactory.createBuilderForContext(element) | 314 sourceInformationFactory.createBuilderForContext(element) |
| 315 .buildDeclaration(element)); | 315 .buildDeclaration(element)); |
| 316 } | 316 } |
| 317 } | 317 } |
| OLD | NEW |