Chromium Code Reviews| Index: pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart |
| diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart |
| index 5e784c1cc9e4e194aba654431229648da15ab3da..fcacd7535da2dbef67455f437fbd9691ff392f0d 100644 |
| --- a/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart |
| +++ b/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart |
| @@ -33,12 +33,6 @@ class CheckCpsIntegrity extends TrampolineRecursiveVisitor { |
| final List<Definition> definitions = []; |
| String previousPass; |
| - void setScope(Iterable<Definition> defs, ScopeType scope) { |
| - for (Definition def in defs) { |
| - inScope[def] = scope; |
| - } |
| - } |
|
asgerf
2015/10/15 10:13:29
This is an unused function I left here by accident
|
| - |
| void handleDeclaration(Definition def) { |
| definitions.add(def); |
| // Check the reference chain for cycles broken links. |
| @@ -77,8 +71,11 @@ class CheckCpsIntegrity extends TrampolineRecursiveVisitor { |
| } |
| void check(FunctionDefinition node, String previousPass) { |
| - topLevelNode = node; |
| + // [check] will be called multiple times per instance to avoid reallocating |
| + // the large [inScope] map. Reset the other fields. |
| + this.topLevelNode = node; |
| this.previousPass = previousPass; |
| + this.definitions.clear(); |
| ParentChecker.checkParents(node, this); |
| visit(node); |
| // Check for broken reference chains. We check this last, so out-of-scope |