Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/task.dart

Issue 1444363002: dart2js cps: Global value numbering and loop-invariant code motion. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add test case Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
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); 204 TypeMaskSystem typeSystem = new TypeMaskSystem(compiler);
205 205
206 applyCpsPass(new RedundantJoinEliminator(), cpsFunction); 206 applyCpsPass(new RedundantJoinEliminator(), cpsFunction);
207 applyCpsPass(new RedundantPhiEliminator(), cpsFunction); 207 applyCpsPass(new RedundantPhiEliminator(), cpsFunction);
208 applyCpsPass(new InsertRefinements(typeSystem), cpsFunction); 208 applyCpsPass(new InsertRefinements(typeSystem), cpsFunction);
209 applyCpsPass(new TypePropagator(compiler, typeSystem, this), cpsFunction); 209 applyCpsPass(new TypePropagator(compiler, typeSystem, this), cpsFunction);
210 applyCpsPass(new ShareFinalFields(backend), cpsFunction); 210 applyCpsPass(new RedundantJoinEliminator(), cpsFunction);
211 applyCpsPass(new ShrinkingReducer(), cpsFunction);
212 applyCpsPass(new RedundantRefinementEliminator(typeSystem), cpsFunction);
213 applyCpsPass(new GVN(compiler), cpsFunction);
211 applyCpsPass(new RemoveRefinements(), cpsFunction); 214 applyCpsPass(new RemoveRefinements(), cpsFunction);
212 applyCpsPass(new ShrinkingReducer(), cpsFunction); 215 applyCpsPass(new ShrinkingReducer(), cpsFunction);
213 applyCpsPass(new ScalarReplacer(compiler), cpsFunction); 216 applyCpsPass(new ScalarReplacer(compiler), cpsFunction);
214 applyCpsPass(new MutableVariableEliminator(), cpsFunction); 217 applyCpsPass(new MutableVariableEliminator(), cpsFunction);
215 applyCpsPass(new RedundantJoinEliminator(), cpsFunction); 218 applyCpsPass(new RedundantJoinEliminator(), cpsFunction);
216 applyCpsPass(new RedundantPhiEliminator(), cpsFunction); 219 applyCpsPass(new RedundantPhiEliminator(), cpsFunction);
217 applyCpsPass(new BoundsChecker(typeSystem, compiler.world), cpsFunction); 220 applyCpsPass(new BoundsChecker(typeSystem, compiler.world), cpsFunction);
218 applyCpsPass(new ShrinkingReducer(), cpsFunction); 221 applyCpsPass(new ShrinkingReducer(), cpsFunction);
219 applyCpsPass(new ShareInterceptors(backend), cpsFunction); 222 applyCpsPass(new OptimizeInterceptors(backend), cpsFunction);
220 applyCpsPass(new ShrinkingReducer(), cpsFunction); 223 applyCpsPass(new ShrinkingReducer(), cpsFunction);
221 }); 224 });
222 return cpsFunction; 225 return cpsFunction;
223 } 226 }
224 227
225 tree_ir.FunctionDefinition compileToTreeIr(cps.FunctionDefinition cpsNode) { 228 tree_ir.FunctionDefinition compileToTreeIr(cps.FunctionDefinition cpsNode) {
226 tree_builder.Builder builder = new tree_builder.Builder( 229 tree_builder.Builder builder = new tree_builder.Builder(
227 reporter.internalError); 230 reporter.internalError);
228 tree_ir.FunctionDefinition treeNode = 231 tree_ir.FunctionDefinition treeNode =
229 treeBuilderTask.measure(() => builder.buildFunction(cpsNode)); 232 treeBuilderTask.measure(() => builder.buildFunction(cpsNode));
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 treeOptimizationTask] 283 treeOptimizationTask]
281 ..addAll(fallbackCompiler.tasks); 284 ..addAll(fallbackCompiler.tasks);
282 } 285 }
283 286
284 js.Node attachPosition(js.Node node, AstElement element) { 287 js.Node attachPosition(js.Node node, AstElement element) {
285 return node.withSourceInformation( 288 return node.withSourceInformation(
286 sourceInformationFactory.createBuilderForContext(element) 289 sourceInformationFactory.createBuilderForContext(element)
287 .buildDeclaration(element)); 290 .buildDeclaration(element));
288 } 291 }
289 } 292 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698