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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.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/ssa/builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index 162d7a8436088ffd7a5697922fc06a5e61058600..2b87a741c7611e632487fb76e546713a7c804723 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -2200,18 +2200,18 @@ class SsaBuilder extends ResolvedVisitor {
if (type == null) return original;
type = type.unalias(compiler);
assert(assertTypeInContext(type, original));
- if (type.kind == TypeKind.INTERFACE && !type.treatAsRaw) {
+ if (type.isInterfaceType && !type.treatAsRaw) {
TypeMask subtype = new TypeMask.subtype(type.element);
HInstruction representations = buildTypeArgumentRepresentations(type);
add(representations);
return new HTypeConversion.withTypeRepresentation(type, kind, subtype,
original, representations);
- } else if (type.kind == TypeKind.TYPE_VARIABLE) {
+ } else if (type.isTypeVariable) {
TypeMask subtype = original.instructionType;
HInstruction typeVariable = addTypeVariableReference(type);
return new HTypeConversion.withTypeRepresentation(type, kind, subtype,
original, typeVariable);
- } else if (type.kind == TypeKind.FUNCTION) {
+ } else if (type.isFunctionType) {
String name = kind == HTypeConversion.CAST_TYPE_CHECK
? '_asCheck' : '_assertCheck';
@@ -3142,7 +3142,7 @@ class SsaBuilder extends ResolvedVisitor {
HInstruction buildTypeArgumentRepresentations(DartType type) {
// Compute the representation of the type arguments, including access
// to the runtime type information for type variables as instructions.
- if (type.kind == TypeKind.TYPE_VARIABLE) {
+ if (type.isTypeVariable) {
return buildLiteralList(<HInstruction>[addTypeVariableReference(type)]);
} else {
assert(type.element.isClass);
@@ -3183,7 +3183,7 @@ class SsaBuilder extends ResolvedVisitor {
visit(node.receiver);
HInstruction expression = pop();
DartType type = elements.getType(node.typeAnnotationFromIsCheckOrCast);
- if (type.kind == TypeKind.MALFORMED_TYPE) {
+ if (type.isMalformed) {
ErroneousElement element = type.element;
generateTypeError(node, element.message);
} else {
@@ -3220,13 +3220,13 @@ class SsaBuilder extends ResolvedVisitor {
DartType type,
HInstruction expression) {
type = localsHandler.substInContext(type).unalias(compiler);
- if (type.kind == TypeKind.FUNCTION) {
+ if (type.isFunctionType) {
List arguments = [buildFunctionType(type), expression];
pushInvokeDynamic(
node, new Selector.call('_isTest', compiler.jsHelperLibrary, 1),
arguments);
return new HIs.compound(type, expression, pop(), backend.boolType);
- } else if (type.kind == TypeKind.TYPE_VARIABLE) {
+ } else if (type.isTypeVariable) {
HInstruction runtimeType = addTypeVariableReference(type);
Element helper = backend.getCheckSubtypeOfRuntimeType();
List<HInstruction> inputs = <HInstruction>[expression, runtimeType];
@@ -3251,7 +3251,7 @@ class SsaBuilder extends ResolvedVisitor {
pushInvokeStatic(node, helper, inputs, backend.boolType);
HInstruction call = pop();
return new HIs.compound(type, expression, call, backend.boolType);
- } else if (type.kind == TypeKind.MALFORMED_TYPE) {
+ } else if (type.isMalformed) {
ErroneousElement element = type.element;
generateTypeError(node, element.message);
HInstruction call = pop();
@@ -3929,7 +3929,7 @@ class SsaBuilder extends ResolvedVisitor {
return graph.addConstantNull(compiler);
}
- if (argument.kind == TypeKind.TYPE_VARIABLE) {
+ if (argument.isTypeVariable) {
return addTypeVariableReference(argument);
}
@@ -6325,7 +6325,7 @@ class TypeBuilder implements DartTypeVisitor<dynamic, SsaBuilder> {
}
void visitMalformedType(MalformedType type, SsaBuilder builder) {
- visitDynamicType(builder.compiler.types.dynamicType, builder);
+ visitDynamicType(const DynamicType(), builder);
}
void visitStatementType(StatementType type, SsaBuilder builder) {

Powered by Google App Engine
This is Rietveld 408576698