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.type_test_registry; | 5 library dart2js.js_emitter.type_test_registry; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common_elements.dart'; | 8 import '../common_elements.dart'; |
9 import '../elements/elements.dart' | 9 import '../elements/elements.dart' |
10 show ClassElement, ElementKind, MemberElement, MethodElement; | 10 show ClassElement, ElementKind, MemberElement, MethodElement; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 Set<ClassElement> computeClassesModifiedByEmitRuntimeTypeSupport() { | 90 Set<ClassElement> computeClassesModifiedByEmitRuntimeTypeSupport() { |
91 TypeChecks typeChecks = rtiChecks.requiredChecks; | 91 TypeChecks typeChecks = rtiChecks.requiredChecks; |
92 Set<ClassElement> result = new Set<ClassElement>(); | 92 Set<ClassElement> result = new Set<ClassElement>(); |
93 for (ClassElement cls in typeChecks.classes) { | 93 for (ClassElement cls in typeChecks.classes) { |
94 if (typeChecks[cls].isNotEmpty) result.add(cls); | 94 if (typeChecks[cls].isNotEmpty) result.add(cls); |
95 } | 95 } |
96 return result; | 96 return result; |
97 } | 97 } |
98 | 98 |
99 void computeRtiNeededClasses(RuntimeTypesSubstitutions rtiSubstitutions, | 99 void computeRtiNeededClasses(RuntimeTypesSubstitutions rtiSubstitutions, |
100 MirrorsData mirrorsData, Iterable<MemberElement> liveMembers) { | 100 MirrorsData mirrorsData, Iterable<MemberEntity> liveMembers) { |
101 _rtiNeededClasses = new Set<ClassEntity>(); | 101 _rtiNeededClasses = new Set<ClassEntity>(); |
102 | 102 |
103 void addClassWithSuperclasses(ClassElement cls) { | 103 void addClassWithSuperclasses(ClassElement cls) { |
104 _rtiNeededClasses.add(cls); | 104 _rtiNeededClasses.add(cls); |
105 for (ClassElement superclass = cls.superclass; | 105 for (ClassElement superclass = cls.superclass; |
106 superclass != null; | 106 superclass != null; |
107 superclass = superclass.superclass) { | 107 superclass = superclass.superclass) { |
108 _rtiNeededClasses.add(superclass); | 108 _rtiNeededClasses.add(superclass); |
109 } | 109 } |
110 } | 110 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 checkedFunctionTypes = new Set<ResolutionFunctionType>(); | 189 checkedFunctionTypes = new Set<ResolutionFunctionType>(); |
190 _codegenWorldBuilder.isChecks.forEach((ResolutionDartType t) { | 190 _codegenWorldBuilder.isChecks.forEach((ResolutionDartType t) { |
191 if (t is ResolutionInterfaceType) { | 191 if (t is ResolutionInterfaceType) { |
192 checkedClasses.add(t.element); | 192 checkedClasses.add(t.element); |
193 } else if (t is ResolutionFunctionType) { | 193 } else if (t is ResolutionFunctionType) { |
194 checkedFunctionTypes.add(t); | 194 checkedFunctionTypes.add(t); |
195 } | 195 } |
196 }); | 196 }); |
197 } | 197 } |
198 } | 198 } |
OLD | NEW |