Chromium Code Reviews| 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 |