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

Unified Diff: pkg/compiler/lib/src/inferrer/node_tracer.dart

Issue 726383003: Compute more accurate bound on expected work when tracing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | « no previous file | pkg/compiler/lib/src/inferrer/type_graph_nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/node_tracer.dart
diff --git a/pkg/compiler/lib/src/inferrer/node_tracer.dart b/pkg/compiler/lib/src/inferrer/node_tracer.dart
index e5905ff2320ec7b1831296f39359afea7043de65..6534bbe5fb13d06e273c81146f90f38cbe4b4c11 100644
--- a/pkg/compiler/lib/src/inferrer/node_tracer.dart
+++ b/pkg/compiler/lib/src/inferrer/node_tracer.dart
@@ -104,14 +104,22 @@ abstract class TracerVisitor<T extends TypeInformation>
workList.add(info);
}
+ bool _wouldBeTooManyUsers(Set users) {
+ int seenSoFar = analyzedElements.length;
+ if (seenSoFar + users.length <= MAX_ANALYSIS_COUNT) return false;
+ int actualWork = users
+ .where((TypeInformation user) => !analyzedElements.contains(user.owner))
+ .length;
+ return seenSoFar + actualWork > MAX_ANALYSIS_COUNT;
+ }
+
void analyze() {
// Collect the [TypeInformation] where the list can flow in,
// as well as the operations done on all these [TypeInformation]s.
addNewEscapeInformation(tracedType);
while (!workList.isEmpty) {
currentUser = workList.removeLast();
- int expectedWork = analyzedElements.length + currentUser.users.length;
- if (expectedWork > MAX_ANALYSIS_COUNT) {
+ if (_wouldBeTooManyUsers(currentUser.users)) {
bailout('Too many users');
break;
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/inferrer/type_graph_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698