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

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

Issue 1409483002: dart2js cps: Speed up CPS IR integrity checker. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/insert_refinements.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/codegen/task.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/task.dart b/pkg/compiler/lib/src/js_backend/codegen/task.dart
index 28beb1c50daf9adff91436b8a72808ed048cf46e..5942d14f9723c50fec8ead5f677827c43e714a08 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/task.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/task.dart
@@ -185,29 +185,32 @@ class CpsFunctionCompiler implements FunctionCompiler {
}
}
- static bool checkCpsIntegrity(cps.FunctionDefinition node, String pass) {
- new CheckCpsIntegrity().check(node, pass);
+ bool checkCpsIntegrity(cps.FunctionDefinition node, String previousPass) {
+ cpsOptimizationTask.measureSubtask('Check integrity', () {
+ new CheckCpsIntegrity().check(node, previousPass);
+ });
return true; // So this can be used from assert().
}
cps.FunctionDefinition optimizeCpsIr(cps.FunctionDefinition cpsFunction) {
- TypeMaskSystem typeSystem = new TypeMaskSystem(compiler);
-
- applyCpsPass(new RedundantJoinEliminator(), cpsFunction);
- applyCpsPass(new RedundantPhiEliminator(), cpsFunction);
- applyCpsPass(new InsertRefinements(typeSystem), cpsFunction);
- applyCpsPass(new TypePropagator(compiler, typeSystem, this), cpsFunction);
- applyCpsPass(new RemoveRefinements(), cpsFunction);
- applyCpsPass(new ShrinkingReducer(), cpsFunction);
- applyCpsPass(new ScalarReplacer(compiler), cpsFunction);
- applyCpsPass(new MutableVariableEliminator(), cpsFunction);
- applyCpsPass(new RedundantJoinEliminator(), cpsFunction);
- applyCpsPass(new RedundantPhiEliminator(), cpsFunction);
- applyCpsPass(new BoundsChecker(typeSystem, compiler.world), cpsFunction);
- applyCpsPass(new ShrinkingReducer(), cpsFunction);
- applyCpsPass(new ShareInterceptors(), cpsFunction);
- applyCpsPass(new ShrinkingReducer(), cpsFunction);
-
+ cpsOptimizationTask.measure(() {
+ TypeMaskSystem typeSystem = new TypeMaskSystem(compiler);
+
+ applyCpsPass(new RedundantJoinEliminator(), cpsFunction);
+ applyCpsPass(new RedundantPhiEliminator(), cpsFunction);
+ applyCpsPass(new InsertRefinements(typeSystem), cpsFunction);
+ applyCpsPass(new TypePropagator(compiler, typeSystem, this), cpsFunction);
+ applyCpsPass(new RemoveRefinements(), cpsFunction);
+ applyCpsPass(new ShrinkingReducer(), cpsFunction);
+ applyCpsPass(new ScalarReplacer(compiler), cpsFunction);
+ applyCpsPass(new MutableVariableEliminator(), cpsFunction);
+ applyCpsPass(new RedundantJoinEliminator(), cpsFunction);
+ applyCpsPass(new RedundantPhiEliminator(), cpsFunction);
+ applyCpsPass(new BoundsChecker(typeSystem, compiler.world), cpsFunction);
+ applyCpsPass(new ShrinkingReducer(), cpsFunction);
+ applyCpsPass(new ShareInterceptors(), cpsFunction);
+ applyCpsPass(new ShrinkingReducer(), cpsFunction);
+ });
return cpsFunction;
}
@@ -222,8 +225,10 @@ class CpsFunctionCompiler implements FunctionCompiler {
return treeNode;
}
- static bool checkTreeIntegrity(tree_ir.FunctionDefinition node) {
- new CheckTreeIntegrity().check(node);
+ bool checkTreeIntegrity(tree_ir.FunctionDefinition node) {
+ treeOptimizationTask.measureSubtask('Check integrity', () {
+ new CheckTreeIntegrity().check(node);
+ });
return true; // So this can be used from assert().
}
@@ -236,11 +241,13 @@ class CpsFunctionCompiler implements FunctionCompiler {
assert(checkTreeIntegrity(node));
}
- applyTreePass(new StatementRewriter());
- applyTreePass(new VariableMerger());
- applyTreePass(new LoopRewriter());
- applyTreePass(new LogicalRewriter());
- applyTreePass(new PullIntoInitializers());
+ treeOptimizationTask.measure(() {
+ applyTreePass(new StatementRewriter());
+ applyTreePass(new VariableMerger());
+ applyTreePass(new LoopRewriter());
+ applyTreePass(new LogicalRewriter());
+ applyTreePass(new PullIntoInitializers());
+ });
return node;
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/insert_refinements.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698