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

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

Issue 14907008: Remove support for interface in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix constructor name bug. Created 7 years, 7 months 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 'dart:uri'; 7 import 'dart:uri';
8 import 'dart:collection' show LinkedHashMap; 8 import 'dart:collection' show LinkedHashMap;
9 9
10 import 'elements.dart'; 10 import 'elements.dart';
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 DartType type; 1081 DartType type;
1082 final Modifiers modifiers; 1082 final Modifiers modifiers;
1083 1083
1084 FunctionSignature functionSignature; 1084 FunctionSignature functionSignature;
1085 1085
1086 /** 1086 /**
1087 * A function declaration that should be parsed instead of the current one. 1087 * A function declaration that should be parsed instead of the current one.
1088 * The patch should be parsed as if it was in the current scope. Its 1088 * The patch should be parsed as if it was in the current scope. Its
1089 * signature must match this function's signature. 1089 * signature must match this function's signature.
1090 */ 1090 */
1091 // TODO(lrn): Consider using [defaultImplementation] to store the patch.
1092 FunctionElement patch = null; 1091 FunctionElement patch = null;
1093 FunctionElement origin = null; 1092 FunctionElement origin = null;
1094 1093
1095 /** 1094 /**
1096 * If this is a redirecting factory, [defaultImplementation] will be 1095 * If this is a redirecting factory, [defaultImplementation] will be
1097 * changed by the resolver to point to the redirection target. If 1096 * changed by the resolver to point to the redirection target.
1098 * this is an interface constructor, [defaultImplementation] will be
1099 * changed by the resolver to point to the default implementation.
1100 * Otherwise, [:identical(defaultImplementation, this):]. 1097 * Otherwise, [:identical(defaultImplementation, this):].
1101 */ 1098 */
1102 // TODO(ahe): Rename this field to redirectionTarget and remove 1099 // TODO(ahe): Rename this field to redirectionTarget.
1103 // mention of interface constructors above.
1104 FunctionElement defaultImplementation; 1100 FunctionElement defaultImplementation;
1105 1101
1106 FunctionElementX(SourceString name, 1102 FunctionElementX(SourceString name,
1107 ElementKind kind, 1103 ElementKind kind,
1108 Modifiers modifiers, 1104 Modifiers modifiers,
1109 Element enclosing) 1105 Element enclosing)
1110 : this.tooMuchOverloading(name, null, kind, modifiers, enclosing, null); 1106 : this.tooMuchOverloading(name, null, kind, modifiers, enclosing, null);
1111 1107
1112 FunctionElementX.node(SourceString name, 1108 FunctionElementX.node(SourceString name,
1113 FunctionExpression node, 1109 FunctionExpression node,
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 * type arguments. For instance should [:List:] be the [rawType] of the 1349 * type arguments. For instance should [:List:] be the [rawType] of the
1354 * [:List:] class element whereas [:List<dynamic>:] should be its own 1350 * [:List:] class element whereas [:List<dynamic>:] should be its own
1355 * instantiation of [InterfaceType] with [:dynamic:] as type argument. Using 1351 * instantiation of [InterfaceType] with [:dynamic:] as type argument. Using
1356 * this distinction, we can print the raw type with type arguments only when 1352 * this distinction, we can print the raw type with type arguments only when
1357 * the input source has used explicit type arguments. 1353 * the input source has used explicit type arguments.
1358 * 1354 *
1359 * This type is computed together with [thisType] in [computeType]. 1355 * This type is computed together with [thisType] in [computeType].
1360 */ 1356 */
1361 InterfaceType rawTypeCache; 1357 InterfaceType rawTypeCache;
1362 DartType supertype; 1358 DartType supertype;
1363 DartType defaultClass;
1364 Link<DartType> interfaces; 1359 Link<DartType> interfaces;
1365 SourceString nativeTagInfo; 1360 SourceString nativeTagInfo;
1366 int supertypeLoadState; 1361 int supertypeLoadState;
1367 int resolutionState; 1362 int resolutionState;
1368 1363
1369 // backendMembers are members that have been added by the backend to simplify 1364 // backendMembers are members that have been added by the backend to simplify
1370 // compilation. They don't have any user-side counter-part. 1365 // compilation. They don't have any user-side counter-part.
1371 Link<Element> backendMembers = const Link<Element>(); 1366 Link<Element> backendMembers = const Link<Element>();
1372 1367
1373 Link<DartType> allSupertypes; 1368 Link<DartType> allSupertypes;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1484 bool isPrivate = memberName.isPrivate(); 1479 bool isPrivate = memberName.isPrivate();
1485 for (ClassElement s = superclass; s != null; s = s.superclass) { 1480 for (ClassElement s = superclass; s != null; s = s.superclass) {
1486 // Private members from a different library are not visible. 1481 // Private members from a different library are not visible.
1487 if (isPrivate && !identical(library, s.getLibrary())) continue; 1482 if (isPrivate && !identical(library, s.getLibrary())) continue;
1488 Element e = s.lookupLocalMember(memberName); 1483 Element e = s.lookupLocalMember(memberName);
1489 if (e == null) continue; 1484 if (e == null) continue;
1490 // Static members are not inherited. 1485 // Static members are not inherited.
1491 if (e.modifiers.isStatic()) continue; 1486 if (e.modifiers.isStatic()) continue;
1492 return e; 1487 return e;
1493 } 1488 }
1494 if (isInterface()) {
1495 return lookupSuperInterfaceMember(memberName, getLibrary());
1496 }
1497 return null; 1489 return null;
1498 } 1490 }
1499 1491
1500 Element lookupSuperInterfaceMember(SourceString memberName, 1492 Element lookupSuperInterfaceMember(SourceString memberName,
1501 LibraryElement fromLibrary) { 1493 LibraryElement fromLibrary) {
1502 bool isPrivate = memberName.isPrivate(); 1494 bool isPrivate = memberName.isPrivate();
1503 for (InterfaceType t in interfaces) { 1495 for (InterfaceType t in interfaces) {
1504 ClassElement cls = t.element; 1496 ClassElement cls = t.element;
1505 Element e = cls.lookupLocalMember(memberName); 1497 Element e = cls.lookupLocalMember(memberName);
1506 if (e == null) continue; 1498 if (e == null) continue;
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1751 bool isSubclassOf(ClassElement cls) { 1743 bool isSubclassOf(ClassElement cls) {
1752 // Use [declaration] for both [this] and [cls], because 1744 // Use [declaration] for both [this] and [cls], because
1753 // declaration classes hold the superclass hierarchy. 1745 // declaration classes hold the superclass hierarchy.
1754 cls = cls.declaration; 1746 cls = cls.declaration;
1755 for (ClassElement s = declaration; s != null; s = s.superclass) { 1747 for (ClassElement s = declaration; s != null; s = s.superclass) {
1756 if (identical(s, cls)) return true; 1748 if (identical(s, cls)) return true;
1757 } 1749 }
1758 return false; 1750 return false;
1759 } 1751 }
1760 1752
1761 bool isInterface() => false;
1762 bool isNative() => nativeTagInfo != null; 1753 bool isNative() => nativeTagInfo != null;
1763 void setNative(String name) { 1754 void setNative(String name) {
1764 nativeTagInfo = new SourceString(name); 1755 nativeTagInfo = new SourceString(name);
1765 } 1756 }
1766 } 1757 }
1767 1758
1768 abstract class ClassElementX extends BaseClassElementX { 1759 abstract class ClassElementX extends BaseClassElementX {
1769 // Lazily applied patch of class members. 1760 // Lazily applied patch of class members.
1770 ClassElement patch = null; 1761 ClassElement patch = null;
1771 ClassElement origin = null; 1762 ClassElement origin = null;
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
2019 2010
2020 MetadataAnnotation ensureResolved(Compiler compiler) { 2011 MetadataAnnotation ensureResolved(Compiler compiler) {
2021 if (resolutionState == STATE_NOT_STARTED) { 2012 if (resolutionState == STATE_NOT_STARTED) {
2022 compiler.resolver.resolveMetadataAnnotation(this); 2013 compiler.resolver.resolveMetadataAnnotation(this);
2023 } 2014 }
2024 return this; 2015 return this;
2025 } 2016 }
2026 2017
2027 String toString() => 'MetadataAnnotation($value, $resolutionState)'; 2018 String toString() => 'MetadataAnnotation($value, $resolutionState)';
2028 } 2019 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698