| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 applyCpsPass(new GVN(compiler, typeSystem), cpsFunction); | 213 applyCpsPass(new GVN(compiler, typeSystem), cpsFunction); |
| 214 applyCpsPass(new UpdateRefinements(typeSystem), cpsFunction); | 214 applyCpsPass(new UpdateRefinements(typeSystem), cpsFunction); |
| 215 applyCpsPass(new BoundsChecker(typeSystem, compiler.world), cpsFunction); | 215 applyCpsPass(new BoundsChecker(typeSystem, compiler.world), cpsFunction); |
| 216 applyCpsPass(new ShrinkingReducer(), cpsFunction); | 216 applyCpsPass(new ShrinkingReducer(), cpsFunction); |
| 217 applyCpsPass(new ScalarReplacer(compiler), cpsFunction); | 217 applyCpsPass(new ScalarReplacer(compiler), cpsFunction); |
| 218 applyCpsPass(new MutableVariableEliminator(), cpsFunction); | 218 applyCpsPass(new MutableVariableEliminator(), cpsFunction); |
| 219 applyCpsPass(new RedundantJoinEliminator(), cpsFunction); | 219 applyCpsPass(new RedundantJoinEliminator(), cpsFunction); |
| 220 applyCpsPass(new RedundantPhiEliminator(), cpsFunction); | 220 applyCpsPass(new RedundantPhiEliminator(), cpsFunction); |
| 221 applyCpsPass(new ShrinkingReducer(), cpsFunction); | 221 applyCpsPass(new ShrinkingReducer(), cpsFunction); |
| 222 applyCpsPass(new OptimizeInterceptors(backend), cpsFunction); | 222 applyCpsPass(new OptimizeInterceptors(backend), cpsFunction); |
| 223 applyCpsPass(new BackwardNullCheckRemover(), cpsFunction); |
| 223 applyCpsPass(new ShrinkingReducer(), cpsFunction); | 224 applyCpsPass(new ShrinkingReducer(), cpsFunction); |
| 224 }); | 225 }); |
| 225 return cpsFunction; | 226 return cpsFunction; |
| 226 } | 227 } |
| 227 | 228 |
| 228 tree_ir.FunctionDefinition compileToTreeIr(cps.FunctionDefinition cpsNode) { | 229 tree_ir.FunctionDefinition compileToTreeIr(cps.FunctionDefinition cpsNode) { |
| 229 applyCpsPass(new Finalize(backend), cpsNode); | 230 applyCpsPass(new Finalize(backend), cpsNode); |
| 230 tree_builder.Builder builder = new tree_builder.Builder( | 231 tree_builder.Builder builder = new tree_builder.Builder( |
| 231 reporter.internalError); | 232 reporter.internalError); |
| 232 tree_ir.FunctionDefinition treeNode = | 233 tree_ir.FunctionDefinition treeNode = |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 treeOptimizationTask] | 285 treeOptimizationTask] |
| 285 ..addAll(fallbackCompiler.tasks); | 286 ..addAll(fallbackCompiler.tasks); |
| 286 } | 287 } |
| 287 | 288 |
| 288 js.Node attachPosition(js.Node node, AstElement element) { | 289 js.Node attachPosition(js.Node node, AstElement element) { |
| 289 return node.withSourceInformation( | 290 return node.withSourceInformation( |
| 290 sourceInformationFactory.createBuilderForContext(element) | 291 sourceInformationFactory.createBuilderForContext(element) |
| 291 .buildDeclaration(element)); | 292 .buildDeclaration(element)); |
| 292 } | 293 } |
| 293 } | 294 } |
| OLD | NEW |