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

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 1143243002: dart2js: Add comment in buildTypeArgumentRepresentations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index f210452a62ca79f4c87100395718d62112933112..9047841220c39ab7bc0180a582d4cecb2fb6fdfc 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -3561,10 +3561,15 @@ class SsaBuilder extends NewResolvedVisitor {
bool first = true;
List<js.Expression> templates = <js.Expression>[];
for (DartType argument in interface.typeArguments) {
- templates.add(rti.getTypeRepresentationWithPlaceholders(argument, (variable) {
- HInstruction runtimeType = addTypeVariableReference(variable);
- inputs.add(runtimeType);
- }, firstPlaceholderIndex : inputs.length));
+ // As we construct the template in stages, we have to make sure that for
+ // each part the generated sub-template's holes match the index of the
+ // inputs that are later used to instantiate it. We do this by starting
+ // the indexing with the number of inputs from previous sub-templates.
+ templates.add(
+ rti.getTypeRepresentationWithPlaceholders(argument, (variable) {
+ HInstruction runtimeType = addTypeVariableReference(variable);
+ inputs.add(runtimeType);
+ }, firstPlaceholderIndex: inputs.length));
}
// TODO(sra): This is a fresh template each time. We can't let the
// template manager build them.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698