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

Unified Diff: sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart

Issue 27510002: Add a much simplified set implementation designed to waste little memory for small sets. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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: sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart b/sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart
index 2325cd90cbbe900853c2db5a4bd0f34f5e10a907..674856aee697ae20b8f1d430ed15271640a7b7e2 100644
--- a/sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart
+++ b/sdk/lib/_internal/compiler/implementation/inferrer/container_tracer.dart
@@ -133,7 +133,7 @@ class ContainerTracerVisitor implements TypeInformationVisitor {
// The set of [TypeInformation] where the traced container could
// flow in, and operations done on them.
- final Set<TypeInformation> allUsers = new Set<TypeInformation>();
+ final Setlet<TypeInformation> allUsers = new Setlet<TypeInformation>();
// The list of found assignments to the container.
final List<TypeInformation> assignments = <TypeInformation>[];
@@ -142,14 +142,16 @@ class ContainerTracerVisitor implements TypeInformationVisitor {
bool continueAnalyzing = true;
static const int MAX_ANALYSIS_COUNT = 11;
- final Set<Element> analyzedElements = new Set<Element>();
+ final Setlet<Element> analyzedElements = new Setlet<Element>();
ContainerTracerVisitor(this.container, inferrer)
: this.inferrer = inferrer, this.compiler = inferrer.compiler;
void run() {
// Add the assignments found at allocation site.
- assignments.addAll(container.elementType.assignments);
+ container.elementType.assignments.forEach((each) {
ahe 2013/10/16 13:57:07 Perhaps you want a "addTo" method on Setlet?
+ assignments.add(each);
+ });
// Collect the [TypeInformation] where the container can flow in,
// as well as the operations done on all these [TypeInformation]s.

Powered by Google App Engine
This is Rietveld 408576698