| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 elements.modelx; | 5 library elements.modelx; |
| 6 | 6 |
| 7 import 'elements.dart'; | 7 import 'elements.dart'; |
| 8 import '../../compiler.dart' as api; | 8 import '../../compiler.dart' as api; |
| 9 import '../tree/tree.dart'; | 9 import '../tree/tree.dart'; |
| 10 import '../util/util.dart'; | 10 import '../util/util.dart'; |
| (...skipping 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1760 * This type is computed together with [thisType] in [computeType]. | 1760 * This type is computed together with [thisType] in [computeType]. |
| 1761 */ | 1761 */ |
| 1762 InterfaceType rawTypeCache; | 1762 InterfaceType rawTypeCache; |
| 1763 DartType supertype; | 1763 DartType supertype; |
| 1764 Link<DartType> interfaces; | 1764 Link<DartType> interfaces; |
| 1765 String nativeTagInfo; | 1765 String nativeTagInfo; |
| 1766 int supertypeLoadState; | 1766 int supertypeLoadState; |
| 1767 int resolutionState; | 1767 int resolutionState; |
| 1768 bool get isResolved => resolutionState == STATE_DONE; | 1768 bool get isResolved => resolutionState == STATE_DONE; |
| 1769 bool isProxy = false; | 1769 bool isProxy = false; |
| 1770 bool hasIncompleteHierarchy = false; | |
| 1771 | 1770 |
| 1772 // backendMembers are members that have been added by the backend to simplify | 1771 // backendMembers are members that have been added by the backend to simplify |
| 1773 // compilation. They don't have any user-side counter-part. | 1772 // compilation. They don't have any user-side counter-part. |
| 1774 Link<Element> backendMembers = const Link<Element>(); | 1773 Link<Element> backendMembers = const Link<Element>(); |
| 1775 | 1774 |
| 1776 OrderedTypeSet allSupertypesAndSelf; | 1775 OrderedTypeSet allSupertypesAndSelf; |
| 1777 | 1776 |
| 1778 Link<DartType> get allSupertypes => allSupertypesAndSelf.supertypes; | 1777 Link<DartType> get allSupertypes => allSupertypesAndSelf.supertypes; |
| 1779 | 1778 |
| 1780 int get hierarchyDepth => allSupertypesAndSelf.maxDepth; | 1779 int get hierarchyDepth => allSupertypesAndSelf.maxDepth; |
| 1781 | 1780 |
| 1782 Map<Name, Member> classMembers; | |
| 1783 Map<Name, MemberSignature> interfaceMembers; | |
| 1784 | |
| 1785 BaseClassElementX(String name, | 1781 BaseClassElementX(String name, |
| 1786 Element enclosing, | 1782 Element enclosing, |
| 1787 this.id, | 1783 this.id, |
| 1788 int initialState) | 1784 int initialState) |
| 1789 : supertypeLoadState = initialState, | 1785 : supertypeLoadState = initialState, |
| 1790 resolutionState = initialState, | 1786 resolutionState = initialState, |
| 1791 super(name, ElementKind.CLASS, enclosing); | 1787 super(name, ElementKind.CLASS, enclosing); |
| 1792 | 1788 |
| 1793 int get hashCode => id; | 1789 int get hashCode => id; |
| 1794 ClassElement get patch => super.patch; | 1790 ClassElement get patch => super.patch; |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 for (ClassElement s = declaration; s != null; s = s.superclass) { | 2144 for (ClassElement s = declaration; s != null; s = s.superclass) { |
| 2149 if (identical(s, cls)) return true; | 2145 if (identical(s, cls)) return true; |
| 2150 } | 2146 } |
| 2151 return false; | 2147 return false; |
| 2152 } | 2148 } |
| 2153 | 2149 |
| 2154 bool isNative() => nativeTagInfo != null; | 2150 bool isNative() => nativeTagInfo != null; |
| 2155 void setNative(String name) { | 2151 void setNative(String name) { |
| 2156 nativeTagInfo = name; | 2152 nativeTagInfo = name; |
| 2157 } | 2153 } |
| 2158 | |
| 2159 Member lookupClassMember(Name name) => classMembers[name]; | |
| 2160 | |
| 2161 void forEachClassMember(f(Member member)) { | |
| 2162 classMembers.forEach((_, member) => f(member)); | |
| 2163 } | |
| 2164 | |
| 2165 MemberSignature lookupInterfaceMember(Name name) => interfaceMembers[name]; | |
| 2166 | |
| 2167 void forEachInterfaceMember(f(MemberSignature member)) { | |
| 2168 interfaceMembers.forEach((_, member) => f(member)); | |
| 2169 } | |
| 2170 } | 2154 } |
| 2171 | 2155 |
| 2172 abstract class ClassElementX extends BaseClassElementX { | 2156 abstract class ClassElementX extends BaseClassElementX { |
| 2173 // Lazily applied patch of class members. | 2157 // Lazily applied patch of class members. |
| 2174 ClassElement patch = null; | 2158 ClassElement patch = null; |
| 2175 ClassElement origin = null; | 2159 ClassElement origin = null; |
| 2176 | 2160 |
| 2177 Link<Element> localMembers = const Link<Element>(); | 2161 Link<Element> localMembers = const Link<Element>(); |
| 2178 final ScopeX localScope = new ScopeX(); | 2162 final ScopeX localScope = new ScopeX(); |
| 2179 | 2163 |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2464 | 2448 |
| 2465 MetadataAnnotation ensureResolved(Compiler compiler) { | 2449 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 2466 if (resolutionState == STATE_NOT_STARTED) { | 2450 if (resolutionState == STATE_NOT_STARTED) { |
| 2467 compiler.resolver.resolveMetadataAnnotation(this); | 2451 compiler.resolver.resolveMetadataAnnotation(this); |
| 2468 } | 2452 } |
| 2469 return this; | 2453 return this; |
| 2470 } | 2454 } |
| 2471 | 2455 |
| 2472 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 2456 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 2473 } | 2457 } |
| OLD | NEW |