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

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

Issue 2995113002: Share locals between members (Closed)
Patch Set: Rebased 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/locals.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_model/closure.dart
diff --git a/pkg/compiler/lib/src/js_model/closure.dart b/pkg/compiler/lib/src/js_model/closure.dart
index 1d067792809db0bda33bfcdfea1dff317ad5e3b4..f54d8e77dd9b8c930a34e64368080c6230a3d636 100644
--- a/pkg/compiler/lib/src/js_model/closure.dart
+++ b/pkg/compiler/lib/src/js_model/closure.dart
@@ -143,6 +143,7 @@ class KernelClosureConversionTask extends ClosureConversionTask<ir.Node> {
// We want the original declaration where that function is used to point
// to the correct closure class.
_memberClosureRepresentationMap[closureClass.callMethod] = closureClass;
+ _globalLocalsMap.setLocalsMap(closureClass.callMethod, localsMap);
if (node.parent is ir.Member) {
assert(_elementMap.getMember(node.parent) == member);
_memberClosureRepresentationMap[member] = closureClass;
@@ -425,13 +426,7 @@ class NodeBox {
}
class JClosureClass extends JClass {
- // TODO(efortuna): Storing this map here is so horrible. Instead store this on
- // the ScopeModel (because all of the closures share that localsMap) and then
- // set populate the getLocalVariable lookup with this localsMap for all the
- // closures.
- final KernelToLocalsMap localsMap;
-
- JClosureClass(this.localsMap, JLibrary library, int classIndex, String name)
+ JClosureClass(JLibrary library, int classIndex, String name)
: super(library, classIndex, name, isAbstract: false);
@override
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_model/locals.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698