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

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

Issue 2995113002: Share locals between members (Closed)
Patch Set: 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 153853ac9dc1b0c9b68e7d498e7b48d4c095e026..f0e06a513878a8b04ef0bd4f0977309cb153f772 100644
--- a/pkg/compiler/lib/src/js_model/closure.dart
+++ b/pkg/compiler/lib/src/js_model/closure.dart
@@ -139,6 +139,7 @@ class KernelClosureConversionTask extends ClosureConversionTask<ir.Node> {
// We want the original declaration where that function is used to point
// to the correct closure class.
_closureRepresentationMap[closureClass.callMethod] = closureClass;
+ _globalLocalsMap.setLocalsMap(closureClass.callMethod, localsMap);
Emily Fortuna 2017/08/17 19:01:59 what about grouping the locals map for all the cre
Johnni Winther 2017/08/18 14:59:39 This line means we are sharing the map for all tho
Entity entity;
if (node.parent is ir.Member) {
entity = _elementMap.getMember(node.parent);
@@ -398,13 +399,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;
Emily Fortuna 2017/08/17 19:01:59 if we get rid of this field, all JClosureClasses c
Johnni Winther 2017/08/18 14:59:39 It does have a better to `toString` and the right
-
- 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