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

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

Issue 12210138: Add substitution for classes that use type variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add deleted newline again. Created 7 years, 10 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 2ba5dddebc7ac0608480d7eabc9bd9ab74beb633..83080f18307ca558895ae52ad917adf9bfd36756 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -3181,11 +3181,20 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
// The type variable is stored in a parameter of the method.
inputs.add(localsHandler.readLocal(type.element));
} else if (member.isInstanceMember() ||
- member.isGenerativeConstructor()) {
- // The type variable is stored in [this].
+ member.isGenerativeConstructor()) {
+ // The type variable is stored on the object.
kasperl 2013/02/12 12:14:10 Extend the comment with an example of the kind of
karlklose 2013/02/12 13:22:30 Done.
int index = RuntimeTypeInformation.getTypeVariableIndex(type);
- pushInvokeHelper2(backend.getGetRuntimeTypeArgument(),
- localsHandler.readThis(),
+ HInstruction thisObject = localsHandler.readThis();
+ String substituionNameString =
kasperl 2013/02/12 12:14:10 substituion -> substitution
karlklose 2013/02/12 13:22:30 Done.
+ backend.namer.substitutionName(member.getEnclosingClass());
+ HInstruction substitutionName = graph.addConstantString(
+ new LiteralDartString(substituionNameString), null, constantSystem);
+ HInstruction substitution = createForeign('#[#]', HType.UNKNOWN,
+ <HInstruction>[thisObject, substitutionName]);
+ add(substitution);
+ pushInvokeHelper3(backend.getGetRuntimeTypeArgument(),
+ thisObject,
+ substitution,
graph.addConstantInt(index, constantSystem),
HType.UNKNOWN);
inputs.add(pop());

Powered by Google App Engine
This is Rietveld 408576698