| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 if (cpsIntegrityChecker == null) { | 194 if (cpsIntegrityChecker == null) { |
| 195 cpsIntegrityChecker = new CheckCpsIntegrity(); | 195 cpsIntegrityChecker = new CheckCpsIntegrity(); |
| 196 } | 196 } |
| 197 cpsIntegrityChecker.check(node, previousPass); | 197 cpsIntegrityChecker.check(node, previousPass); |
| 198 }); | 198 }); |
| 199 return true; // So this can be used from assert(). | 199 return true; // So this can be used from assert(). |
| 200 } | 200 } |
| 201 | 201 |
| 202 cps.FunctionDefinition optimizeCpsIr(cps.FunctionDefinition cpsFunction) { | 202 cps.FunctionDefinition optimizeCpsIr(cps.FunctionDefinition cpsFunction) { |
| 203 cpsOptimizationTask.measure(() { | 203 cpsOptimizationTask.measure(() { |
| 204 TypeMaskSystem typeSystem = new TypeMaskSystem(compiler); | |
| 205 | |
| 206 applyCpsPass(new RedundantJoinEliminator(), cpsFunction); | 204 applyCpsPass(new RedundantJoinEliminator(), cpsFunction); |
| 207 applyCpsPass(new RedundantPhiEliminator(), cpsFunction); | 205 applyCpsPass(new RedundantPhiEliminator(), cpsFunction); |
| 208 applyCpsPass(new InsertRefinements(typeSystem), cpsFunction); | 206 applyCpsPass(new InsertRefinements(typeSystem), cpsFunction); |
| 209 applyCpsPass(new TypePropagator(compiler, typeSystem, this), cpsFunction); | 207 applyCpsPass(new TypePropagator(compiler, typeSystem, this), cpsFunction); |
| 210 applyCpsPass(new RedundantJoinEliminator(), cpsFunction); | 208 applyCpsPass(new RedundantJoinEliminator(), cpsFunction); |
| 211 applyCpsPass(new ShrinkingReducer(), cpsFunction); | 209 applyCpsPass(new ShrinkingReducer(), cpsFunction); |
| 212 applyCpsPass(new RedundantRefinementEliminator(typeSystem), cpsFunction); | 210 applyCpsPass(new RedundantRefinementEliminator(typeSystem), cpsFunction); |
| 213 applyCpsPass(new GVN(compiler), cpsFunction); | 211 applyCpsPass(new GVN(compiler), cpsFunction); |
| 214 applyCpsPass(new RemoveRefinements(), cpsFunction); | 212 applyCpsPass(new RemoveRefinements(), cpsFunction); |
| 215 applyCpsPass(new ShrinkingReducer(), cpsFunction); | 213 applyCpsPass(new ShrinkingReducer(), cpsFunction); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 treeOptimizationTask] | 281 treeOptimizationTask] |
| 284 ..addAll(fallbackCompiler.tasks); | 282 ..addAll(fallbackCompiler.tasks); |
| 285 } | 283 } |
| 286 | 284 |
| 287 js.Node attachPosition(js.Node node, AstElement element) { | 285 js.Node attachPosition(js.Node node, AstElement element) { |
| 288 return node.withSourceInformation( | 286 return node.withSourceInformation( |
| 289 sourceInformationFactory.createBuilderForContext(element) | 287 sourceInformationFactory.createBuilderForContext(element) |
| 290 .buildDeclaration(element)); | 288 .buildDeclaration(element)); |
| 291 } | 289 } |
| 292 } | 290 } |
| OLD | NEW |