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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_integrity.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/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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/codegen/task.dart » ('j') | pkg/compiler/lib/src/js_backend/codegen/task.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698