| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 if (elements === null) { | 89 if (elements === null) { |
| 90 elements = getCachedElements(element); | 90 elements = getCachedElements(element); |
| 91 } | 91 } |
| 92 if (isResolutionQueue) { | 92 if (isResolutionQueue) { |
| 93 compiler.world.registerUsedElement(element); | 93 compiler.world.registerUsedElement(element); |
| 94 } | 94 } |
| 95 | 95 |
| 96 queue.add(new WorkItem(element, elements, itemCompilationContextCreator())); | 96 queue.add(new WorkItem(element, elements, itemCompilationContextCreator())); |
| 97 | 97 |
| 98 // Enable runtime type support if we discover a getter called runtimeType. | 98 // Enable runtime type support if we discover a getter called runtimeType. |
| 99 if (!isResolutionQueue && | 99 // We have to enable runtime type before hitting the codegen, so |
| 100 element.isGetter() && | 100 // that constructors know whether they need to generate code for |
| 101 element.name == Compiler.RUNTIME_TYPE) { | 101 // runtime type. |
| 102 if (element.isGetter() && element.name == Compiler.RUNTIME_TYPE) { |
| 102 compiler.enabledRuntimeType = true; | 103 compiler.enabledRuntimeType = true; |
| 103 } | 104 } |
| 104 | 105 |
| 105 // Enable isolate support if we start using something from the | 106 // Enable isolate support if we start using something from the |
| 106 // isolate library. | 107 // isolate library. |
| 107 LibraryElement library = element.getLibrary(); | 108 LibraryElement library = element.getLibrary(); |
| 108 if (!compiler.hasIsolateSupport() | 109 if (!compiler.hasIsolateSupport() |
| 109 && library.uri.toString() == 'dart:isolate') { | 110 && library.uri.toString() == 'dart:isolate') { |
| 110 compiler.enableIsolateSupport(library); | 111 compiler.enableIsolateSupport(library); |
| 111 } | 112 } |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 } | 353 } |
| 353 | 354 |
| 354 void forEach(f(WorkItem work)) { | 355 void forEach(f(WorkItem work)) { |
| 355 while (!queue.isEmpty()) { | 356 while (!queue.isEmpty()) { |
| 356 f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst? | 357 f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst? |
| 357 } | 358 } |
| 358 } | 359 } |
| 359 | 360 |
| 360 String toString() => 'Enqueuer($name)'; | 361 String toString() => 'Enqueuer($name)'; |
| 361 } | 362 } |
| OLD | NEW |