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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart

Issue 304153014: Remove element from DynamicType. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix infinite loop. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart b/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
index 57c42339322d0d597375c9cd8e68ab1fd25a3f0d..135e489eaae8d7ec618f96bf3c5eb2b87e9668c0 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
@@ -144,7 +144,7 @@ class RuntimeTypes {
Set<ClassElement> classesUsingTypeVariableTests = new Set<ClassElement>();
compiler.resolverWorld.isChecks.forEach((DartType type) {
- if (type.kind == TypeKind.TYPE_VARIABLE) {
+ if (type.isTypeVariable) {
TypeVariableElement variable = type.element;
classesUsingTypeVariableTests.add(variable.enclosingElement);
}
@@ -163,7 +163,7 @@ class RuntimeTypes {
// Compute the set of all classes and methods that need runtime type
// information.
compiler.resolverWorld.isChecks.forEach((DartType type) {
- if (type.kind == TypeKind.INTERFACE) {
+ if (type.isInterfaceType) {
InterfaceType itf = type;
if (!itf.treatAsRaw) {
potentiallyAddForRti(itf.element);
@@ -176,7 +176,7 @@ class RuntimeTypes {
// variables and function types containing type variables.
potentiallyAddForRti(contextClass);
}
- if (type.kind == TypeKind.FUNCTION) {
+ if (type.isFunctionType) {
void analyzeMethod(TypedElement method) {
DartType memberType = method.type;
ClassElement contextClass = Types.getClassContext(memberType);
@@ -227,7 +227,6 @@ class RuntimeTypes {
// argument is a superclass of the element of an instantiated type.
TypeCheckMapping result = new TypeCheckMapping();
for (ClassElement element in instantiated) {
- if (element == compiler.dynamicClass) continue;
if (checked.contains(element)) {
result.add(element, element, null);
}
@@ -264,7 +263,7 @@ class RuntimeTypes {
Set<DartType> instantiatedTypes =
new Set<DartType>.from(universe.instantiatedTypes);
for (DartType instantiatedType in universe.instantiatedTypes) {
- if (instantiatedType.kind == TypeKind.INTERFACE) {
+ if (instantiatedType.isInterfaceType) {
InterfaceType interface = instantiatedType;
FunctionType callType = interface.callType;
if (callType != null) {
@@ -313,7 +312,7 @@ class RuntimeTypes {
{bool isTypeArgument: false}) {
for (DartType type in types) {
directCollector.collect(type, isTypeArgument: isTypeArgument);
- if (type.kind == TypeKind.INTERFACE) {
+ if (type.isInterfaceType) {
ClassElement cls = type.element;
for (DartType supertype in cls.allSupertypes) {
superCollector.collect(supertype, isTypeArgument: isTypeArgument);
@@ -395,6 +394,7 @@ class RuntimeTypes {
String getTypeRepresentationForTypeConstant(DartType type) {
JavaScriptBackend backend = compiler.backend;
Namer namer = backend.namer;
+ if (type.isDynamic) return namer.getRuntimeTypeName(null);
String name = namer.uniqueNameForTypeConstantElement(type.element);
if (!type.element.isClass) return name;
InterfaceType interface = type;

Powered by Google App Engine
This is Rietveld 408576698