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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 11418173: Canonicalize raw type (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 a36039d706331b88c37b34614cadfc3cd8200f2f..a99961168c454e40d923db260958081ab4bcd88d 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -3060,6 +3060,10 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
}
HInstruction analyzeTypeArgument(DartType argument, Node currentNode) {
+ if (argument == compiler.types.dynamicType) {
ngeoffray 2012/11/27 12:30:15 Please add a comment here.
Johnni Winther 2012/11/28 08:18:38 Done.
+ return graph.addConstantNull(constantSystem);
+ }
+
// These variables are shared between invocations of the helper methods.
HInstruction typeInfo;
StringBuffer template = new StringBuffer();
@@ -3119,7 +3123,7 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
} else if (type is InterfaceType) {
bool isFirstVariable = true;
InterfaceType interfaceType = type;
- bool hasTypeArguments = !interfaceType.typeArguments.isEmpty;
+ bool hasTypeArguments = !interfaceType.isRaw;
if (!isInQuotes) template.add("'");
template.add(backend.namer.getName(type.element));
if (hasTypeArguments) {
@@ -3156,6 +3160,7 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
Node currentNode,
HInstruction newObject) {
if (!compiler.world.needsRti(type.element)) return;
+ if (type.isRaw) return;
List<HInstruction> inputs = <HInstruction>[];
type.typeArguments.forEach((DartType argument) {
inputs.add(analyzeTypeArgument(argument, currentNode));
@@ -3194,7 +3199,7 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
}
} else if (element.isGenerativeConstructor()) {
ClassElement cls = element.getEnclosingClass();
- return new HBoundedType.exact(cls.type);
+ return new HBoundedType.exact(cls.thisType);
} else {
return HType.UNKNOWN;
}
@@ -3229,7 +3234,7 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
return;
}
if (compiler.world.needsRti(constructor.enclosingElement)) {
- if (!type.typeArguments.isEmpty) {
+ if (!type.isRaw) {
type.typeArguments.forEach((DartType argument) {
inputs.add(analyzeTypeArgument(argument, node));
});

Powered by Google App Engine
This is Rietveld 408576698