OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.js_emitter.runtime_type_generator; | 5 library dart2js.js_emitter.runtime_type_generator; |
6 | 6 |
7 import '../closure.dart' show ClosureClassMap, ClosureFieldElement; | 7 import '../closure.dart' show ClosureClassMap, ClosureFieldElement; |
8 import '../common.dart'; | 8 import '../common.dart'; |
9 import '../common/names.dart' show Identifiers; | 9 import '../common/names.dart' show Identifiers; |
10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
11 import '../common_elements.dart' show CommonElements; | 11 import '../common_elements.dart' show CommonElements; |
12 import '../elements/resolution_types.dart' | 12 import '../elements/resolution_types.dart' |
13 show ResolutionDartType, ResolutionFunctionType, ResolutionTypeVariableType; | 13 show ResolutionDartType, ResolutionFunctionType; |
14 import '../elements/elements.dart' | 14 import '../elements/elements.dart' |
15 show | 15 show ClassElement, Element, FunctionElement, MixinApplicationElement; |
16 ClassElement, | |
17 Element, | |
18 FunctionElement, | |
19 MixinApplicationElement, | |
20 TypeVariableElement; | |
21 import '../js/js.dart' as jsAst; | 16 import '../js/js.dart' as jsAst; |
22 import '../js/js.dart' show js; | 17 import '../js/js.dart' show js; |
23 import '../js_backend/js_backend.dart' | 18 import '../js_backend/js_backend.dart' |
24 show | 19 show |
25 JavaScriptBackend, | 20 JavaScriptBackend, |
26 Namer, | 21 Namer, |
27 RuntimeTypesEncoder, | 22 RuntimeTypesEncoder, |
28 RuntimeTypesSubstitutions, | 23 RuntimeTypesSubstitutions, |
29 Substitution, | 24 Substitution, |
30 TypeCheck, | 25 TypeCheck, |
31 TypeChecks; | 26 TypeChecks; |
32 import '../util/util.dart' show Setlet; | 27 import '../util/util.dart' show Setlet; |
33 | 28 |
34 import 'code_emitter_task.dart' show CodeEmitterTask; | 29 import 'code_emitter_task.dart' show CodeEmitterTask; |
35 import 'model.dart'; | |
36 import 'type_test_registry.dart' show TypeTestRegistry; | 30 import 'type_test_registry.dart' show TypeTestRegistry; |
37 | 31 |
38 // Function signatures used in the generation of runtime type information. | 32 // Function signatures used in the generation of runtime type information. |
39 typedef void FunctionTypeSignatureEmitter( | 33 typedef void FunctionTypeSignatureEmitter( |
40 Element method, ResolutionFunctionType methodType); | 34 Element method, ResolutionFunctionType methodType); |
41 | 35 |
42 typedef void SubstitutionEmitter(Element element, {bool emitNull}); | 36 typedef void SubstitutionEmitter(Element element, {bool emitNull}); |
43 | 37 |
44 class TypeTestProperties { | 38 class TypeTestProperties { |
45 /// The index of the function type into the metadata. | 39 /// The index of the function type into the metadata. |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 317 |
324 // We need to also emit "is checks" for the superclass and its supertypes. | 318 // We need to also emit "is checks" for the superclass and its supertypes. |
325 ClassElement superclass = cls.superclass; | 319 ClassElement superclass = cls.superclass; |
326 if (superclass != null) { | 320 if (superclass != null) { |
327 tryEmitTest(superclass); | 321 tryEmitTest(superclass); |
328 _generateInterfacesIsTests( | 322 _generateInterfacesIsTests( |
329 superclass, generateIsTest, generateSubstitution, alreadyGenerated); | 323 superclass, generateIsTest, generateSubstitution, alreadyGenerated); |
330 } | 324 } |
331 } | 325 } |
332 } | 326 } |
OLD | NEW |