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

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

Issue 15414004: When recording the type of a captured variable/parameter, use the closure field it maps to. Otherwi… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 22937)
+++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy)
@@ -376,7 +376,7 @@
Element redirect = redirectionMapping[element];
HInstruction receiver = readLocal(closureData.closureElement);
HInstruction fieldGet = new HFieldGet(redirect, receiver);
- fieldGet.instructionType = builder.getTypeOfCapturedVariable(element);
+ fieldGet.instructionType = builder.getTypeOfCapturedVariable(redirect);
builder.add(fieldGet);
return fieldGet;
} else if (isBoxed(element)) {
@@ -389,7 +389,7 @@
assert(redirect.enclosingElement.isVariable());
HInstruction box = readLocal(redirect.enclosingElement);
HInstruction lookup = new HFieldGet(redirect, box);
- lookup.instructionType = builder.getTypeOfCapturedVariable(element);
+ lookup.instructionType = builder.getTypeOfCapturedVariable(redirect);
builder.add(lookup);
return lookup;
} else {
@@ -1014,6 +1014,7 @@
new Map<Element, HType>();
HType getTypeOfCapturedVariable(Element element) {
+ assert(element.isField());
return cachedTypesOfCapturedVariables.putIfAbsent(element, () {
return new HType.inferredTypeForElement(element, compiler);
});

Powered by Google App Engine
This is Rietveld 408576698