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

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

Issue 11413219: Canonicalize raw type (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comment 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..b654a69c5b6826035aca9baed36ea62a4a3d6d01 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -3060,6 +3060,11 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
}
HInstruction analyzeTypeArgument(DartType argument, Node currentNode) {
+ if (argument == compiler.types.dynamicType) {
+ // Represent [dynamic] as [null].
+ return graph.addConstantNull(constantSystem);
+ }
+
// These variables are shared between invocations of the helper methods.
HInstruction typeInfo;
StringBuffer template = new StringBuffer();
@@ -3119,7 +3124,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) {
@@ -3157,9 +3162,11 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
HInstruction newObject) {
if (!compiler.world.needsRti(type.element)) return;
List<HInstruction> inputs = <HInstruction>[];
- type.typeArguments.forEach((DartType argument) {
- inputs.add(analyzeTypeArgument(argument, currentNode));
- });
+ if (!type.isRaw) {
ahe 2012/11/29 10:09:08 if (!type.canElideArguments) { ...
+ type.typeArguments.forEach((DartType argument) {
+ inputs.add(analyzeTypeArgument(argument, currentNode));
+ });
+ }
callSetRuntimeTypeInfo(type.element, inputs, newObject);
}
@@ -3194,7 +3201,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 +3236,7 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
return;
}
if (compiler.world.needsRti(constructor.enclosingElement)) {
- if (!type.typeArguments.isEmpty) {
+ if (!type.isRaw) {
ahe 2012/11/29 10:09:08 ditto
type.typeArguments.forEach((DartType argument) {
inputs.add(analyzeTypeArgument(argument, node));
});

Powered by Google App Engine
This is Rietveld 408576698