Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/elements/modelx.dart

Issue 52263003: Implement least upper bound. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 11 matching lines...) Expand all
22 FunctionType, 22 FunctionType,
23 Selector, 23 Selector,
24 Constant, 24 Constant,
25 Compiler, 25 Compiler,
26 isPrivateName; 26 isPrivateName;
27 27
28 import '../dart_types.dart'; 28 import '../dart_types.dart';
29 29
30 import '../scanner/scannerlib.dart' show Token, EOF_TOKEN; 30 import '../scanner/scannerlib.dart' show Token, EOF_TOKEN;
31 31
32 import '../ordered_typeset.dart' show OrderedTypeSet;
33
32 34
33 class ElementX implements Element { 35 class ElementX implements Element {
34 static int elementHashCode = 0; 36 static int elementHashCode = 0;
35 37
36 final String name; 38 final String name;
37 final ElementKind kind; 39 final ElementKind kind;
38 final Element enclosingElement; 40 final Element enclosingElement;
39 final int hashCode = ++elementHashCode; 41 final int hashCode = ++elementHashCode;
40 Link<MetadataAnnotation> metadata = const Link<MetadataAnnotation>(); 42 Link<MetadataAnnotation> metadata = const Link<MetadataAnnotation>();
41 43
(...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after
1687 Link<DartType> interfaces; 1689 Link<DartType> interfaces;
1688 String nativeTagInfo; 1690 String nativeTagInfo;
1689 int supertypeLoadState; 1691 int supertypeLoadState;
1690 int resolutionState; 1692 int resolutionState;
1691 bool get isResolved => resolutionState == STATE_DONE; 1693 bool get isResolved => resolutionState == STATE_DONE;
1692 1694
1693 // backendMembers are members that have been added by the backend to simplify 1695 // backendMembers are members that have been added by the backend to simplify
1694 // compilation. They don't have any user-side counter-part. 1696 // compilation. They don't have any user-side counter-part.
1695 Link<Element> backendMembers = const Link<Element>(); 1697 Link<Element> backendMembers = const Link<Element>();
1696 1698
1697 Link<DartType> allSupertypes; 1699 OrderedTypeSet allSupertypesAndSelf;
1700
1701 Link<DartType> get allSupertypes => allSupertypesAndSelf.supertypes;
1702
1703 int get hierarchyDepth => allSupertypesAndSelf.maxDepth;
1698 1704
1699 BaseClassElementX(String name, 1705 BaseClassElementX(String name,
1700 Element enclosing, 1706 Element enclosing,
1701 this.id, 1707 this.id,
1702 int initialState) 1708 int initialState)
1703 : supertypeLoadState = initialState, 1709 : supertypeLoadState = initialState,
1704 resolutionState = initialState, 1710 resolutionState = initialState,
1705 super(name, ElementKind.CLASS, enclosing); 1711 super(name, ElementKind.CLASS, enclosing);
1706 1712
1707 int get hashCode => id; 1713 int get hashCode => id;
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
2370 2376
2371 MetadataAnnotation ensureResolved(Compiler compiler) { 2377 MetadataAnnotation ensureResolved(Compiler compiler) {
2372 if (resolutionState == STATE_NOT_STARTED) { 2378 if (resolutionState == STATE_NOT_STARTED) {
2373 compiler.resolver.resolveMetadataAnnotation(this); 2379 compiler.resolver.resolveMetadataAnnotation(this);
2374 } 2380 }
2375 return this; 2381 return this;
2376 } 2382 }
2377 2383
2378 String toString() => 'MetadataAnnotation($value, $resolutionState)'; 2384 String toString() => 'MetadataAnnotation($value, $resolutionState)';
2379 } 2385 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698