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

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

Issue 10544027: Avoid creating new HThis at each closure access. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« 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: lib/compiler/implementation/ssa/builder.dart
===================================================================
--- lib/compiler/implementation/ssa/builder.dart (revision 8323)
+++ lib/compiler/implementation/ssa/builder.dart (working copy)
@@ -390,11 +390,7 @@
return directLocals[element];
} else if (isStoredInClosureField(element)) {
Element redirect = redirectionMapping[element];
- // We must not use the [LocalsHandler.readThis()] since that could
- // point to a captured this which would be stored in a closure-field
- // itself.
- HInstruction receiver = new HThis();
- builder.add(receiver);
+ HInstruction receiver = readLocal(closureData.closureElement);
HInstruction fieldGet = new HFieldGet(redirect, receiver);
builder.add(fieldGet);
return fieldGet;
@@ -460,11 +456,7 @@
directLocals[element] = value;
} else if (isStoredInClosureField(element)) {
Element redirect = redirectionMapping[element];
- // We must not use the [LocalsHandler.readThis()] since that could
- // point to a captured this which would be stored in a closure-field
- // itself.
- HInstruction receiver = new HThis();
- builder.add(receiver);
+ HInstruction receiver = readLocal(closureData.closureElement);
builder.add(new HFieldSet(redirect.name, receiver, value));
} else if (isBoxed(element)) {
Element redirect = redirectionMapping[element];
« 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