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

Side by Side Diff: lib/compiler/implementation/enqueue.dart

Issue 10854140: Fix type inference for self-recursive functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add method for retreiving generated code for dart2js tests Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class EnqueueTask extends CompilerTask { 5 class EnqueueTask extends CompilerTask {
6 final Enqueuer codegen; 6 final Enqueuer codegen;
7 final Enqueuer resolution; 7 final Enqueuer resolution;
8 8
9 String get name() => 'Enqueue'; 9 String get name() => 'Enqueue';
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 resolvedElements = new Map<Element, TreeElements>(), 64 resolvedElements = new Map<Element, TreeElements>(),
65 recompilationCandidates = new RecompilationQueue(); 65 recompilationCandidates = new RecompilationQueue();
66 66
67 bool get isResolutionQueue() => compiler.enqueuer.resolution === this; 67 bool get isResolutionQueue() => compiler.enqueuer.resolution === this;
68 68
69 TreeElements getCachedElements(Element element) { 69 TreeElements getCachedElements(Element element) {
70 Element owner = element.getOutermostEnclosingMemberOrTopLevel(); 70 Element owner = element.getOutermostEnclosingMemberOrTopLevel();
71 return compiler.enqueuer.resolution.resolvedElements[owner]; 71 return compiler.enqueuer.resolution.resolvedElements[owner];
72 } 72 }
73 73
74 String lookupCode(Element element) =>
75 universe.generatedCode[element].toString();
76
74 void addToWorkList(Element element, [TreeElements elements]) { 77 void addToWorkList(Element element, [TreeElements elements]) {
75 if (element.isForeign()) return; 78 if (element.isForeign()) return;
76 if (compiler.phase == Compiler.PHASE_RECOMPILING) return; 79 if (compiler.phase == Compiler.PHASE_RECOMPILING) return;
77 if (queueIsClosed) { 80 if (queueIsClosed) {
78 if (isResolutionQueue && getCachedElements(element) !== null) return; 81 if (isResolutionQueue && getCachedElements(element) !== null) return;
79 compiler.internalErrorOnElement(element, "Work list is closed."); 82 compiler.internalErrorOnElement(element, "Work list is closed.");
80 } 83 }
81 if (!isResolutionQueue && 84 if (!isResolutionQueue &&
82 element.kind === ElementKind.GENERATIVE_CONSTRUCTOR) { 85 element.kind === ElementKind.GENERATIVE_CONSTRUCTOR) {
83 registerInstantiatedClass(element.getEnclosingClass()); 86 registerInstantiatedClass(element.getEnclosingClass());
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 void forEach(f(WorkItem work)) { 325 void forEach(f(WorkItem work)) {
323 while (!queue.isEmpty()) { 326 while (!queue.isEmpty()) {
324 do { 327 do {
325 f(queue.removeLast()); 328 f(queue.removeLast());
326 } while (!queue.isEmpty()); 329 } while (!queue.isEmpty());
327 // TODO(ahe): we shouldn't register the field closure invocations here. 330 // TODO(ahe): we shouldn't register the field closure invocations here.
328 registerFieldClosureInvocations(); 331 registerFieldClosureInvocations();
329 } 332 }
330 } 333 }
331 } 334 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/dart_backend/backend.dart ('k') | lib/compiler/implementation/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698