| 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.js.enqueue; | 5 library dart2js.js.enqueue; |
| 6 | 6 |
| 7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
| 8 | 8 |
| 9 import '../common/backend_api.dart' show Backend; | 9 import '../common/backend_api.dart' show Backend; |
| 10 import '../common/codegen.dart' show CodegenWorkItem; | 10 import '../common/codegen.dart' show CodegenWorkItem; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 if (!cls.isAbstract || isNative || mirrorUsage) { | 156 if (!cls.isAbstract || isNative || mirrorUsage) { |
| 157 _processInstantiatedClass(cls); | 157 _processInstantiatedClass(cls); |
| 158 } | 158 } |
| 159 }); | 159 }); |
| 160 } | 160 } |
| 161 | 161 |
| 162 bool checkNoEnqueuedInvokedInstanceMethods() { | 162 bool checkNoEnqueuedInvokedInstanceMethods() { |
| 163 return strategy.checkEnqueuerConsistency(this); | 163 return strategy.checkEnqueuerConsistency(this); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void checkClass(ClassElement cls) { |
| 167 cls.implementation.forEachMember(processInstantiatedClassMember); |
| 168 } |
| 169 |
| 166 void processInstantiatedClassMember(ClassElement cls, Element member) { | 170 void processInstantiatedClassMember(ClassElement cls, Element member) { |
| 167 assert(invariant(member, member.isDeclaration)); | 171 assert(invariant(member, member.isDeclaration)); |
| 168 if (isProcessed(member)) return; | 172 if (isProcessed(member)) return; |
| 169 if (!member.isInstanceMember) return; | 173 if (!member.isInstanceMember) return; |
| 170 String memberName = member.name; | 174 String memberName = member.name; |
| 171 | 175 |
| 172 if (member.isField) { | 176 if (member.isField) { |
| 173 // The obvious thing to test here would be "member.isNative", | 177 // The obvious thing to test here would be "member.isNative", |
| 174 // however, that only works after metadata has been parsed/analyzed, | 178 // however, that only works after metadata has been parsed/analyzed, |
| 175 // and that may not have happened yet. | 179 // and that may not have happened yet. |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 | 503 |
| 500 @override | 504 @override |
| 501 Iterable<ClassElement> get processedClasses => _processedClasses; | 505 Iterable<ClassElement> get processedClasses => _processedClasses; |
| 502 } | 506 } |
| 503 | 507 |
| 504 void removeFromSet(Map<String, Set<Element>> map, Element element) { | 508 void removeFromSet(Map<String, Set<Element>> map, Element element) { |
| 505 Set<Element> set = map[element.name]; | 509 Set<Element> set = map[element.name]; |
| 506 if (set == null) return; | 510 if (set == null) return; |
| 507 set.remove(element); | 511 set.remove(element); |
| 508 } | 512 } |
| OLD | NEW |