| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 219 |
| 220 void optimizeCpsAfterInlining(cps.FunctionDefinition cpsFunction) { | 220 void optimizeCpsAfterInlining(cps.FunctionDefinition cpsFunction) { |
| 221 cpsOptimizationTask.measure(() { | 221 cpsOptimizationTask.measure(() { |
| 222 applyCpsPass(new RedundantJoinEliminator(), cpsFunction); | 222 applyCpsPass(new RedundantJoinEliminator(), cpsFunction); |
| 223 applyCpsPass(new ShrinkingReducer(), cpsFunction); | 223 applyCpsPass(new ShrinkingReducer(), cpsFunction); |
| 224 applyCpsPass(new RedundantRefinementEliminator(typeSystem), cpsFunction); | 224 applyCpsPass(new RedundantRefinementEliminator(typeSystem), cpsFunction); |
| 225 applyCpsPass(new TypePropagator(this, recomputeAll: true), cpsFunction); | 225 applyCpsPass(new TypePropagator(this, recomputeAll: true), cpsFunction); |
| 226 applyCpsPass(new ShrinkingReducer(), cpsFunction); | 226 applyCpsPass(new ShrinkingReducer(), cpsFunction); |
| 227 applyCpsPass(new EagerlyLoadStatics(), cpsFunction); | 227 applyCpsPass(new EagerlyLoadStatics(), cpsFunction); |
| 228 applyCpsPass(new GVN(compiler, typeSystem), cpsFunction); | 228 applyCpsPass(new GVN(compiler, typeSystem), cpsFunction); |
| 229 applyCpsPass(new DuplicateBranchEliminator(), cpsFunction); |
| 230 applyCpsPass(new ShrinkingReducer(), cpsFunction); |
| 229 applyCpsPass(new UpdateRefinements(typeSystem), cpsFunction); | 231 applyCpsPass(new UpdateRefinements(typeSystem), cpsFunction); |
| 230 applyCpsPass(new BoundsChecker(typeSystem, compiler.world), cpsFunction); | 232 applyCpsPass(new BoundsChecker(typeSystem, compiler.world), cpsFunction); |
| 231 applyCpsPass(new LoopInvariantBranchMotion(), cpsFunction); | 233 applyCpsPass(new LoopInvariantBranchMotion(), cpsFunction); |
| 232 applyCpsPass(new ShrinkingReducer(), cpsFunction); | 234 applyCpsPass(new ShrinkingReducer(), cpsFunction); |
| 233 applyCpsPass(new ScalarReplacer(compiler), cpsFunction); | 235 applyCpsPass(new ScalarReplacer(compiler), cpsFunction); |
| 234 applyCpsPass(new MutableVariableEliminator(), cpsFunction); | 236 applyCpsPass(new MutableVariableEliminator(), cpsFunction); |
| 235 applyCpsPass(new RedundantJoinEliminator(), cpsFunction); | 237 applyCpsPass(new RedundantJoinEliminator(), cpsFunction); |
| 236 applyCpsPass(new RedundantPhiEliminator(), cpsFunction); | 238 applyCpsPass(new RedundantPhiEliminator(), cpsFunction); |
| 237 applyCpsPass(new ShrinkingReducer(), cpsFunction); | 239 applyCpsPass(new ShrinkingReducer(), cpsFunction); |
| 238 applyCpsPass(new OptimizeInterceptors(backend, typeSystem), cpsFunction); | 240 applyCpsPass(new OptimizeInterceptors(backend, typeSystem), cpsFunction); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 treeOptimizationTask] | 302 treeOptimizationTask] |
| 301 ..addAll(fallbackCompiler.tasks); | 303 ..addAll(fallbackCompiler.tasks); |
| 302 } | 304 } |
| 303 | 305 |
| 304 js.Node attachPosition(js.Node node, AstElement element) { | 306 js.Node attachPosition(js.Node node, AstElement element) { |
| 305 return node.withSourceInformation( | 307 return node.withSourceInformation( |
| 306 sourceInformationFactory.createBuilderForContext(element) | 308 sourceInformationFactory.createBuilderForContext(element) |
| 307 .buildDeclaration(element)); | 309 .buildDeclaration(element)); |
| 308 } | 310 } |
| 309 } | 311 } |
| OLD | NEW |