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

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

Issue 16549004: Add type arguments to constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adjust test status. Created 7 years, 6 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 1cd2255ddc3b30cfbbc2a6efd1319821010383c1..349d214f9b11c5dce89fc49f6f08ad65dad0795e 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -3380,18 +3380,7 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
bool isRedirected = functionElement.isRedirectingFactory;
DartType expectedType = type;
if (isRedirected) {
- FunctionExpression functionNode = functionElement.parseNode(compiler);
- if (functionNode.isRedirectingFactory) {
- // Lookup the type used in the redirection.
- Return redirectionNode = functionNode.body;
- TreeElements treeElements =
- compiler.enqueuer.resolution.getCachedElements(
- functionElement.declaration);
- ClassElement targetClass = functionElement.getEnclosingClass();
- type = treeElements.getType(redirectionNode.expression)
- .subst(type.typeArguments, targetClass.typeVariables);
- }
- functionElement = functionElement.redirectionTarget;
+ type = functionElement.computeTargetType(compiler, type);
}
var inputs = <HInstruction>[];
@@ -3646,10 +3635,14 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
generateRuntimeError(node.send, message.toString());
}
} else if (node.isConst()) {
- // TODO(karlklose): add type representation
ConstantHandler handler = compiler.constantHandler;
Constant constant = handler.compileNodeWithDefinitions(node, elements);
stack.add(graph.addConstant(constant, compiler));
+ if (constant is ConstructedConstant) {
+ ConstructedConstant constructed = constant;
+ compiler.enqueuer.codegen.registerInstantiatedType(constructed.type,
ngeoffray 2013/06/17 09:15:03 Isn't this already done by the constant_handler?
+ elements);
+ }
if (isSymbolConstructor) {
ConstructedConstant symbol = constant;
StringConstant stringConstant = symbol.fields.single;

Powered by Google App Engine
This is Rietveld 408576698