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

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

Issue 1397953005: dart2js cps: Speed up integrity checking some more. (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
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 5942d14f9723c50fec8ead5f677827c43e714a08..7c0d3eae7641fe682c5607444c601a509f6d6c3b 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/task.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/task.dart
@@ -102,6 +102,7 @@ class CpsFunctionCompiler implements FunctionCompiler {
}
cps.FunctionDefinition cpsFunction = compileToCpsIr(element);
cpsFunction = optimizeCpsIr(cpsFunction);
+ cpsIntegrityChecker = null;
tree_ir.FunctionDefinition treeFunction = compileToTreeIr(cpsFunction);
treeFunction = optimizeTreeIr(treeFunction);
return compileToJavaScript(work, treeFunction);
@@ -185,9 +186,14 @@ class CpsFunctionCompiler implements FunctionCompiler {
}
}
+ CheckCpsIntegrity cpsIntegrityChecker;
+
bool checkCpsIntegrity(cps.FunctionDefinition node, String previousPass) {
cpsOptimizationTask.measureSubtask('Check integrity', () {
- new CheckCpsIntegrity().check(node, previousPass);
+ if (cpsIntegrityChecker == null) {
sra1 2015/10/15 23:06:52 Is this worth it?
asgerf 2015/10/16 07:43:30 It is necessary to ensure we get one instance per
+ cpsIntegrityChecker = new CheckCpsIntegrity();
+ }
+ cpsIntegrityChecker.check(node, previousPass);
});
return true; // So this can be used from assert().
}

Powered by Google App Engine
This is Rietveld 408576698