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