| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 } | 100 } |
| 101 if (elements === null) { | 101 if (elements === null) { |
| 102 elements = getCachedElements(element); | 102 elements = getCachedElements(element); |
| 103 } | 103 } |
| 104 if (isResolutionQueue) { | 104 if (isResolutionQueue) { |
| 105 compiler.world.registerUsedElement(element); | 105 compiler.world.registerUsedElement(element); |
| 106 } | 106 } |
| 107 | 107 |
| 108 queue.add(new WorkItem(element, elements, itemCompilationContextCreator())); | 108 queue.add(new WorkItem(element, elements, itemCompilationContextCreator())); |
| 109 | 109 |
| 110 // Enable runtime type support if we discover a method called runtimeType. |
| 111 if (element.isFunction() && element.name == Compiler.RUNTIME_TYPE) { |
| 112 compiler.enabledRuntimeType = true; |
| 113 } |
| 114 |
| 110 // Enable isolate support if we start using something from the | 115 // Enable isolate support if we start using something from the |
| 111 // isolate library. | 116 // isolate library. |
| 112 LibraryElement library = element.getLibrary(); | 117 LibraryElement library = element.getLibrary(); |
| 113 if (!compiler.hasIsolateSupport() | 118 if (!compiler.hasIsolateSupport() |
| 114 && library.uri.toString() == 'dart:isolate') { | 119 && library.uri.toString() == 'dart:isolate') { |
| 115 compiler.enableIsolateSupport(library); | 120 compiler.enableIsolateSupport(library); |
| 116 } | 121 } |
| 117 } | 122 } |
| 118 | 123 |
| 119 void eagerRecompile(Element element) { | 124 void eagerRecompile(Element element) { |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 void registerIsCheck(DartType type) { | 351 void registerIsCheck(DartType type) { |
| 347 universe.isChecks.add(type); | 352 universe.isChecks.add(type); |
| 348 } | 353 } |
| 349 | 354 |
| 350 void forEach(f(WorkItem work)) { | 355 void forEach(f(WorkItem work)) { |
| 351 while (!queue.isEmpty()) { | 356 while (!queue.isEmpty()) { |
| 352 f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst? | 357 f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst? |
| 353 } | 358 } |
| 354 } | 359 } |
| 355 } | 360 } |
| OLD | NEW |