| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |