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

Unified Diff: pkg/compiler/lib/src/closure.dart

Issue 3007743002: Add boxing for modified variables (Closed)
Patch Set: merged with master Created 3 years, 4 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 | pkg/compiler/lib/src/js_model/closure.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/closure.dart
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
index cdc4083b34b5e3379d0749367aaed6ad0c47618d..a7edec4140187cf5555cd10763e374bcce93932b 100644
--- a/pkg/compiler/lib/src/closure.dart
+++ b/pkg/compiler/lib/src/closure.dart
@@ -541,13 +541,14 @@ class ClosureClassElement extends ClassElementX {
/// fields.
class BoxLocal extends Local {
final String name;
- final Entity executableContext;
final MemberEntity memberContext;
final int hashCode = _nextHashCode = (_nextHashCode + 10007).toUnsigned(30);
static int _nextHashCode = 0;
- BoxLocal(this.name, this.executableContext, this.memberContext);
+ BoxLocal(this.name, this.memberContext);
+
+ Entity get executableContext => memberContext;
String toString() => 'BoxLocal($name)';
}
@@ -1260,8 +1261,7 @@ class ClosureTranslator extends Visitor {
if (box == null) {
// TODO(floitsch): construct better box names.
String boxName = getBoxFieldName(closureFieldCounter++);
- box = new BoxLocal(
- boxName, executableContext, executableContext.memberContext);
+ box = new BoxLocal(boxName, executableContext.memberContext);
}
String elementName = variable.name;
String boxedName =
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_model/closure.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698