| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 applyCpsPass(new DuplicateBranchEliminator(), cpsFunction); | 230 applyCpsPass(new DuplicateBranchEliminator(), cpsFunction); |
| 231 applyCpsPass(new ShrinkingReducer(), cpsFunction); | 231 applyCpsPass(new ShrinkingReducer(), cpsFunction); |
| 232 applyCpsPass(new UpdateRefinements(typeSystem), cpsFunction); | 232 applyCpsPass(new UpdateRefinements(typeSystem), cpsFunction); |
| 233 applyCpsPass(new BoundsChecker(typeSystem, compiler.world), cpsFunction); | 233 applyCpsPass(new BoundsChecker(typeSystem, compiler.world), cpsFunction); |
| 234 applyCpsPass(new LoopInvariantBranchMotion(), cpsFunction); | 234 applyCpsPass(new LoopInvariantBranchMotion(), cpsFunction); |
| 235 applyCpsPass(new ShrinkingReducer(), cpsFunction); | 235 applyCpsPass(new ShrinkingReducer(), cpsFunction); |
| 236 applyCpsPass(new ScalarReplacer(compiler), cpsFunction); | 236 applyCpsPass(new ScalarReplacer(compiler), cpsFunction); |
| 237 applyCpsPass(new MutableVariableEliminator(), cpsFunction); | 237 applyCpsPass(new MutableVariableEliminator(), cpsFunction); |
| 238 applyCpsPass(new RedundantJoinEliminator(), cpsFunction); | 238 applyCpsPass(new RedundantJoinEliminator(), cpsFunction); |
| 239 applyCpsPass(new RedundantPhiEliminator(), cpsFunction); | 239 applyCpsPass(new RedundantPhiEliminator(), cpsFunction); |
| 240 applyCpsPass(new UpdateRefinements(typeSystem), cpsFunction); |
| 240 applyCpsPass(new ShrinkingReducer(), cpsFunction); | 241 applyCpsPass(new ShrinkingReducer(), cpsFunction); |
| 241 applyCpsPass(new OptimizeInterceptors(backend, typeSystem), cpsFunction); | 242 applyCpsPass(new OptimizeInterceptors(backend, typeSystem), cpsFunction); |
| 242 applyCpsPass(new BackwardNullCheckRemover(typeSystem), cpsFunction); | 243 applyCpsPass(new BackwardNullCheckRemover(typeSystem), cpsFunction); |
| 243 applyCpsPass(new ShrinkingReducer(), cpsFunction); | 244 applyCpsPass(new ShrinkingReducer(), cpsFunction); |
| 244 }); | 245 }); |
| 245 } | 246 } |
| 246 | 247 |
| 247 tree_ir.FunctionDefinition compileToTreeIr(cps.FunctionDefinition cpsNode) { | 248 tree_ir.FunctionDefinition compileToTreeIr(cps.FunctionDefinition cpsNode) { |
| 248 applyCpsPass(new Finalize(backend), cpsNode); | 249 applyCpsPass(new Finalize(backend), cpsNode); |
| 249 tree_builder.Builder builder = new tree_builder.Builder( | 250 tree_builder.Builder builder = new tree_builder.Builder( |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 treeOptimizationTask] | 304 treeOptimizationTask] |
| 304 ..addAll(fallbackCompiler.tasks); | 305 ..addAll(fallbackCompiler.tasks); |
| 305 } | 306 } |
| 306 | 307 |
| 307 js.Node attachPosition(js.Node node, AstElement element) { | 308 js.Node attachPosition(js.Node node, AstElement element) { |
| 308 return node.withSourceInformation( | 309 return node.withSourceInformation( |
| 309 sourceInformationFactory.createBuilderForContext(element) | 310 sourceInformationFactory.createBuilderForContext(element) |
| 310 .buildDeclaration(element)); | 311 .buildDeclaration(element)); |
| 311 } | 312 } |
| 312 } | 313 } |
| OLD | NEW |