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

Unified Diff: lib/compiler/implementation/enqueue.dart

Issue 10537025: Prototype re-compiling methods in dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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: lib/compiler/implementation/enqueue.dart
diff --git a/lib/compiler/implementation/enqueue.dart b/lib/compiler/implementation/enqueue.dart
index 855c539fa1d4a28b9b0a875062deca3965ceb5cf..0e70796db5e85f3e2a29e9fec391cc0c85e51820 100644
--- a/lib/compiler/implementation/enqueue.dart
+++ b/lib/compiler/implementation/enqueue.dart
@@ -23,6 +23,8 @@ class Enqueuer {
final Set<ClassElement> seenClasses;
final Universe universe;
final Queue<WorkItem> queue;
+ final Queue<WorkItem> queue2;
ricow1 2012/06/07 06:35:49 I would probably call this recompilationCandidates
Søren Gjesse 2012/06/07 08:06:12 Done.
+ final Set<Element> inQueue2;
bool queueIsClosed = false;
EnqueueTask task;
@@ -30,9 +32,12 @@ class Enqueuer {
: instanceMembersByName = new Map<String, Link<Element>>(),
seenClasses = new Set<ClassElement>(),
universe = new Universe(),
- queue = new Queue<WorkItem>();
+ queue = new Queue<WorkItem>(),
+ queue2 = new Queue<WorkItem>(),
+ inQueue2 = new Set<Element>();
void addToWorkList(Element element, [TreeElements elements]) {
+ if (compiler.pass == 2) return;
if (queueIsClosed) {
compiler.internalErrorOnElement(element, "Work list is closed.");
}
@@ -42,6 +47,18 @@ class Enqueuer {
queue.add(new WorkItem(element, elements));
}
+ void addToWorkList2(Element element, [TreeElements elements]) {
+ if (queueIsClosed) {
+ compiler.internalErrorOnElement(element, "Work list is closed.");
+ }
+ if (inQueue2.contains(element)) return;
+ if (element.kind !== ElementKind.GENERATIVE_CONSTRUCTOR_BODY &&
+ element.kind !== ElementKind.GENERATIVE_CONSTRUCTOR) {
+ inQueue2.add(element);
+ queue2.add(new WorkItem(element, elements));
+ }
+ }
+
void registerInstantiatedClass(ClassElement cls) {
universe.instantiatedClasses.add(cls);
onRegisterInstantiatedClass(cls);

Powered by Google App Engine
This is Rietveld 408576698