Chromium Code Reviews| 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(). |
| } |