| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 if (elements === null) { | 122 if (elements === null) { |
| 123 elements = getCachedElements(element); | 123 elements = getCachedElements(element); |
| 124 } | 124 } |
| 125 if (isResolutionQueue) { | 125 if (isResolutionQueue) { |
| 126 compiler.world.registerUsedElement(element); | 126 compiler.world.registerUsedElement(element); |
| 127 } | 127 } |
| 128 | 128 |
| 129 queue.add(new WorkItem(element, elements, itemCompilationContextCreator())); | 129 queue.add(new WorkItem(element, elements, itemCompilationContextCreator())); |
| 130 | 130 |
| 131 // Enable runtime type support if we discover a getter called runtimeType. | 131 // Enable runtime type support if we discover a getter called runtimeType. |
| 132 if (element.isGetter() && element.name == Compiler.RUNTIME_TYPE) { | 132 if (!isResolutionQueue && |
| 133 element.isGetter() && |
| 134 element.name == Compiler.RUNTIME_TYPE) { |
| 133 compiler.enabledRuntimeType = true; | 135 compiler.enabledRuntimeType = true; |
| 134 } | 136 } |
| 135 | 137 |
| 136 // Enable isolate support if we start using something from the | 138 // Enable isolate support if we start using something from the |
| 137 // isolate library. | 139 // isolate library. |
| 138 LibraryElement library = element.getLibrary(); | 140 LibraryElement library = element.getLibrary(); |
| 139 if (!compiler.hasIsolateSupport() | 141 if (!compiler.hasIsolateSupport() |
| 140 && library.uri.toString() == 'dart:isolate') { | 142 && library.uri.toString() == 'dart:isolate') { |
| 141 compiler.enableIsolateSupport(library); | 143 compiler.enableIsolateSupport(library); |
| 142 } | 144 } |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 } | 393 } |
| 392 | 394 |
| 393 void forEach(f(WorkItem work)) { | 395 void forEach(f(WorkItem work)) { |
| 394 while (!queue.isEmpty()) { | 396 while (!queue.isEmpty()) { |
| 395 f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst? | 397 f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst? |
| 396 } | 398 } |
| 397 } | 399 } |
| 398 | 400 |
| 399 String toString() => 'Enqueuer($name)'; | 401 String toString() => 'Enqueuer($name)'; |
| 400 } | 402 } |
| OLD | NEW |