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 library dart2js.enqueue; | 5 library dart2js.enqueue; |
6 | 6 |
7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
8 | 8 |
9 import 'cache_strategy.dart'; | 9 import 'cache_strategy.dart'; |
10 import 'common/backend_api.dart' show Backend; | 10 import 'common/backend_api.dart' show Backend; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 {bool mirrorUsage: false, | 210 {bool mirrorUsage: false, |
211 bool nativeUsage: false, | 211 bool nativeUsage: false, |
212 bool globalDependency: false}) { | 212 bool globalDependency: false}) { |
213 task.measure(() { | 213 task.measure(() { |
214 ClassElement cls = type.element; | 214 ClassElement cls = type.element; |
215 cls.ensureResolved(resolution); | 215 cls.ensureResolved(resolution); |
216 bool isNative = backend.isNative(cls); | 216 bool isNative = backend.isNative(cls); |
217 _universe.registerTypeInstantiation(type, | 217 _universe.registerTypeInstantiation(type, |
218 isNative: isNative, | 218 isNative: isNative, |
219 byMirrors: mirrorUsage, onImplemented: (ClassElement cls) { | 219 byMirrors: mirrorUsage, onImplemented: (ClassElement cls) { |
220 backend.registerImplementedClass(cls, this); | 220 backend.registerImplementedClass(cls, this); |
221 }); | 221 }); |
222 if (globalDependency && !mirrorUsage) { | 222 if (globalDependency && !mirrorUsage) { |
223 globalDependencies.registerDependency(type.element); | 223 globalDependencies.registerDependency(type.element); |
224 } | 224 } |
225 if (nativeUsage) { | 225 if (nativeUsage) { |
226 nativeEnqueuer.onInstantiatedType(type); | 226 nativeEnqueuer.onInstantiatedType(type); |
227 } | 227 } |
228 backend.registerInstantiatedType(type); | 228 backend.registerInstantiatedType(type); |
229 // TODO(johnniwinther): Share this reasoning with [Universe]. | 229 // TODO(johnniwinther): Share this reasoning with [Universe]. |
230 if (!cls.isAbstract || isNative || mirrorUsage) { | 230 if (!cls.isAbstract || isNative || mirrorUsage) { |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 } | 765 } |
766 | 766 |
767 typedef void _DeferredActionFunction(); | 767 typedef void _DeferredActionFunction(); |
768 | 768 |
769 class _DeferredAction { | 769 class _DeferredAction { |
770 final Element element; | 770 final Element element; |
771 final _DeferredActionFunction action; | 771 final _DeferredActionFunction action; |
772 | 772 |
773 _DeferredAction(this.element, this.action); | 773 _DeferredAction(this.element, this.action); |
774 } | 774 } |
OLD | NEW |