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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 compiler.world.registerUsedElement(element); | 95 compiler.world.registerUsedElement(element); |
96 } | 96 } |
97 | 97 |
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.enableRuntimeTypeFunction(); |
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) { | 108 } else if (element == compiler.invokeOnMethod) { |
109 compiler.enabledInvokeOn = true; | 109 compiler.enabledInvokeOn = true; |
110 } | 110 } |
111 | 111 |
112 // Enable isolate support if we start using something from the | 112 // Enable isolate support if we start using something from the |
113 // isolate library. | 113 // isolate library. |
114 LibraryElement library = element.getLibrary(); | 114 LibraryElement library = element.getLibrary(); |
115 if (!compiler.hasIsolateSupport() | 115 if (!compiler.hasIsolateSupport() |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 366 |
367 String toString() => 'Enqueuer($name)'; | 367 String toString() => 'Enqueuer($name)'; |
368 | 368 |
369 registerUsedSelector(Selector selector) { | 369 registerUsedSelector(Selector selector) { |
370 Element interceptor = compiler.backend.getInterceptor(selector); | 370 Element interceptor = compiler.backend.getInterceptor(selector); |
371 if (interceptor != null) { | 371 if (interceptor != null) { |
372 registerStaticUse(interceptor); | 372 registerStaticUse(interceptor); |
373 } | 373 } |
374 } | 374 } |
375 } | 375 } |
OLD | NEW |