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; |
108 } | 110 } |
109 | 111 |
110 // Enable isolate support if we start using something from the | 112 // Enable isolate support if we start using something from the |
111 // isolate library. | 113 // isolate library. |
112 LibraryElement library = element.getLibrary(); | 114 LibraryElement library = element.getLibrary(); |
113 if (!compiler.hasIsolateSupport() | 115 if (!compiler.hasIsolateSupport() |
114 && library.uri.toString() == 'dart:isolate') { | 116 && library.uri.toString() == 'dart:isolate') { |
115 compiler.enableIsolateSupport(library); | 117 compiler.enableIsolateSupport(library); |
116 } | 118 } |
117 } | 119 } |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 366 |
365 String toString() => 'Enqueuer($name)'; | 367 String toString() => 'Enqueuer($name)'; |
366 | 368 |
367 registerUsedSelector(Selector selector) { | 369 registerUsedSelector(Selector selector) { |
368 Element interceptor = compiler.backend.getInterceptor(selector); | 370 Element interceptor = compiler.backend.getInterceptor(selector); |
369 if (interceptor != null) { | 371 if (interceptor != null) { |
370 registerStaticUse(interceptor); | 372 registerStaticUse(interceptor); |
371 } | 373 } |
372 } | 374 } |
373 } | 375 } |
OLD | NEW |