| Index: pkg/compiler/lib/src/kernel/closure.dart
|
| diff --git a/pkg/compiler/lib/src/kernel/closure.dart b/pkg/compiler/lib/src/kernel/closure.dart
|
| index 9354ae3c29280f351abcde25a64792e1cb9b5ab2..b8b9467c51177088f2593a1fc92621ed7406c04a 100644
|
| --- a/pkg/compiler/lib/src/kernel/closure.dart
|
| +++ b/pkg/compiler/lib/src/kernel/closure.dart
|
| @@ -44,14 +44,14 @@ class KernelClosureDataBuilder extends ir.Visitor {
|
| @override
|
| visitVariableGet(ir.VariableGet node) {
|
| if (_inTry) {
|
| - info.registerUsedInTryOrSync(_localsMap.getLocal(node.variable));
|
| + info.variablesUsedInTryOrSync.add(_localsMap.getLocal(node.variable));
|
| }
|
| }
|
|
|
| @override
|
| visitVariableSet(ir.VariableSet node) {
|
| if (_inTry) {
|
| - info.registerUsedInTryOrSync(_localsMap.getLocal(node.variable));
|
| + info.variablesUsedInTryOrSync.add(_localsMap.getLocal(node.variable));
|
| }
|
| node.visitChildren(this);
|
| }
|
| @@ -104,6 +104,12 @@ class KernelClosureConversionTask extends ClosureConversionTask<ir.Node> {
|
| return const LoopClosureRepresentationInfo();
|
| }
|
|
|
| + @override
|
| + ScopeInfo getScopeInfo(Entity entity) {
|
| + // TODO(efortuna): Specialize this function from the one below.
|
| + return getClosureRepresentationInfo(entity);
|
| + }
|
| +
|
| @override
|
| ClosureRepresentationInfo getClosureRepresentationInfo(Entity entity) {
|
| return _infoMap.putIfAbsent(entity, () {
|
| @@ -129,21 +135,15 @@ class KernelClosureConversionTask extends ClosureConversionTask<ir.Node> {
|
| // [ClosureRepresentationInfo].
|
| class KernelClosureRepresentationInfo extends ClosureRepresentationInfo {
|
| final ThisLocal thisLocal;
|
| - final Set<Local> _localsUsedInTryOrSync = new Set<Local>();
|
| + final Set<Local> variablesUsedInTryOrSync = new Set<Local>();
|
|
|
| KernelClosureRepresentationInfo(this.thisLocal);
|
|
|
| - void registerUsedInTryOrSync(Local local) {
|
| - _localsUsedInTryOrSync.add(local);
|
| - }
|
| -
|
| - bool variableIsUsedInTryOrSync(Local variable) =>
|
| - _localsUsedInTryOrSync.contains(variable);
|
| -
|
| String toString() {
|
| StringBuffer sb = new StringBuffer();
|
| sb.write('this=$thisLocal,');
|
| - sb.write('localsUsedInTryOrSync={${_localsUsedInTryOrSync.join(', ')}}');
|
| + sb.write(
|
| + 'variablesUsedInTryOrSync={${variablesUsedInTryOrSync.join(', ')}}');
|
| return sb.toString();
|
| }
|
| }
|
|
|