| 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 universe; | 5 library universe; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 ClassElement cls = type.element; | 512 ClassElement cls = type.element; |
| 513 if (!cls.isAbstract | 513 if (!cls.isAbstract |
| 514 // We can't use the closed-world assumption with native abstract | 514 // We can't use the closed-world assumption with native abstract |
| 515 // classes; a native abstract class may have non-abstract subclasses | 515 // classes; a native abstract class may have non-abstract subclasses |
| 516 // not declared to the program. Instances of these classes are | 516 // not declared to the program. Instances of these classes are |
| 517 // indistinguishable from the abstract class. | 517 // indistinguishable from the abstract class. |
| 518 || | 518 || |
| 519 isNative | 519 isNative |
| 520 // Likewise, if this registration comes from the mirror system, | 520 // Likewise, if this registration comes from the mirror system, |
| 521 // all bets are off. | 521 // all bets are off. |
| 522 // TODO(herhut): Track classes required by mirrors separately. | 522 // TODO(herhut): Track classes required by mirrors seperately. |
| 523 || | 523 || |
| 524 byMirrors) { | 524 byMirrors) { |
| 525 _directlyInstantiatedClasses.add(cls); | 525 _directlyInstantiatedClasses.add(cls); |
| 526 } | 526 } |
| 527 | 527 |
| 528 // TODO(johnniwinther): Replace this by separate more specific mappings that | 528 // TODO(johnniwinther): Replace this by separate more specific mappings that |
| 529 // include the type arguments. | 529 // include the type arguments. |
| 530 if (_implementedClasses.add(cls)) { | 530 if (_implementedClasses.add(cls)) { |
| 531 onImplemented(cls); | 531 onImplemented(cls); |
| 532 cls.allSupertypes.forEach((InterfaceType supertype) { | 532 cls.allSupertypes.forEach((InterfaceType supertype) { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 | 657 |
| 658 void forgetElement(Element element, Compiler compiler) { | 658 void forgetElement(Element element, Compiler compiler) { |
| 659 _directlyInstantiatedClasses.remove(element); | 659 _directlyInstantiatedClasses.remove(element); |
| 660 if (element is ClassElement) { | 660 if (element is ClassElement) { |
| 661 assert(invariant(element, element.thisType.isRaw, | 661 assert(invariant(element, element.thisType.isRaw, |
| 662 message: 'Generic classes not supported (${element.thisType}).')); | 662 message: 'Generic classes not supported (${element.thisType}).')); |
| 663 _instantiatedTypes..remove(element.rawType)..remove(element.thisType); | 663 _instantiatedTypes..remove(element.rawType)..remove(element.thisType); |
| 664 } | 664 } |
| 665 } | 665 } |
| 666 } | 666 } |
| OLD | NEW |