| 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 class EnqueueTask extends CompilerTask { | 7 class EnqueueTask extends CompilerTask { |
| 8 final Enqueuer codegen; | 8 final Enqueuer codegen; |
| 9 final Enqueuer resolution; | 9 final Enqueuer resolution; |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 queue.add(new WorkItem(element, elements, itemCompilationContextCreator())); | 98 queue.add(new WorkItem(element, elements, itemCompilationContextCreator())); |
| 99 | 99 |
| 100 // Enable runtime type support if we discover a getter called runtimeType. | 100 // Enable runtime type support if we discover a getter called runtimeType. |
| 101 // We have to enable runtime type before hitting the codegen, so | 101 // We have to enable runtime type before hitting the codegen, so |
| 102 // that constructors know whether they need to generate code for | 102 // that constructors know whether they need to generate code for |
| 103 // runtime type. | 103 // runtime type. |
| 104 if (element.isGetter() && element.name == Compiler.RUNTIME_TYPE) { | 104 if (element.isGetter() && element.name == Compiler.RUNTIME_TYPE) { |
| 105 compiler.enabledRuntimeType = true; | 105 compiler.enabledRuntimeType = true; |
| 106 } else if (element == compiler.functionApplyMethod) { | 106 } else if (element == compiler.functionApplyMethod) { |
| 107 compiler.enabledFunctionApply = true; | 107 compiler.enabledFunctionApply = true; |
| 108 } else if (element == compiler.invokeOnMethod) { | |
| 109 compiler.enabledInvokeOn = true; | |
| 110 } | 108 } |
| 111 | 109 |
| 112 // Enable isolate support if we start using something from the | 110 // Enable isolate support if we start using something from the |
| 113 // isolate library. | 111 // isolate library. |
| 114 LibraryElement library = element.getLibrary(); | 112 LibraryElement library = element.getLibrary(); |
| 115 if (!compiler.hasIsolateSupport() | 113 if (!compiler.hasIsolateSupport() |
| 116 && library.uri.toString() == 'dart:isolate') { | 114 && library.uri.toString() == 'dart:isolate') { |
| 117 compiler.enableIsolateSupport(library); | 115 compiler.enableIsolateSupport(library); |
| 118 } | 116 } |
| 119 } | 117 } |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 | 364 |
| 367 String toString() => 'Enqueuer($name)'; | 365 String toString() => 'Enqueuer($name)'; |
| 368 | 366 |
| 369 registerUsedSelector(Selector selector) { | 367 registerUsedSelector(Selector selector) { |
| 370 Element interceptor = compiler.backend.getInterceptor(selector); | 368 Element interceptor = compiler.backend.getInterceptor(selector); |
| 371 if (interceptor != null) { | 369 if (interceptor != null) { |
| 372 registerStaticUse(interceptor); | 370 registerStaticUse(interceptor); |
| 373 } | 371 } |
| 374 } | 372 } |
| 375 } | 373 } |
| OLD | NEW |