Chromium Code Reviews| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 if (isResolutionQueue && getCachedElements(element) !== null) return; | 94 if (isResolutionQueue && getCachedElements(element) !== null) return; |
| 95 compiler.internalErrorOnElement(element, "Work list is closed."); | 95 compiler.internalErrorOnElement(element, "Work list is closed."); |
| 96 } | 96 } |
| 97 if (!isResolutionQueue && | 97 if (!isResolutionQueue && |
| 98 element.kind === ElementKind.GENERATIVE_CONSTRUCTOR) { | 98 element.kind === ElementKind.GENERATIVE_CONSTRUCTOR) { |
| 99 registerInstantiatedClass(element.getEnclosingClass()); | 99 registerInstantiatedClass(element.getEnclosingClass()); |
| 100 } | 100 } |
| 101 if (elements === null) { | 101 if (elements === null) { |
| 102 elements = getCachedElements(element); | 102 elements = getCachedElements(element); |
| 103 } | 103 } |
| 104 if (isResolutionQueue && element.isMember() && element.isGetter()) { | |
| 105 compiler.world.getters.add(element); | |
|
kasperl
2012/09/11 07:39:11
I think this deserves its own method in world -- t
ngeoffray
2012/09/11 08:51:08
Done.
| |
| 106 } | |
| 104 | 107 |
| 105 queue.add(new WorkItem(element, elements, itemCompilationContextCreator())); | 108 queue.add(new WorkItem(element, elements, itemCompilationContextCreator())); |
| 106 | 109 |
| 107 // Enable isolate support if we start using something from the | 110 // Enable isolate support if we start using something from the |
| 108 // isolate library. | 111 // isolate library. |
| 109 LibraryElement library = element.getLibrary(); | 112 LibraryElement library = element.getLibrary(); |
| 110 if (!compiler.hasIsolateSupport() | 113 if (!compiler.hasIsolateSupport() |
| 111 && library.uri.toString() == 'dart:isolate') { | 114 && library.uri.toString() == 'dart:isolate') { |
| 112 compiler.enableIsolateSupport(library); | 115 compiler.enableIsolateSupport(library); |
| 113 } | 116 } |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 343 void registerIsCheck(DartType type) { | 346 void registerIsCheck(DartType type) { |
| 344 universe.isChecks.add(type); | 347 universe.isChecks.add(type); |
| 345 } | 348 } |
| 346 | 349 |
| 347 void forEach(f(WorkItem work)) { | 350 void forEach(f(WorkItem work)) { |
| 348 while (!queue.isEmpty()) { | 351 while (!queue.isEmpty()) { |
| 349 f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst? | 352 f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst? |
| 350 } | 353 } |
| 351 } | 354 } |
| 352 } | 355 } |
| OLD | NEW |