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

Side by Side Diff: tests/compiler/dart2js/closure/closure_test.dart

Issue 2981423003: Move .getLocalFunction from KernelToElementMap to KernelToLocalsMap (Closed)
Patch Set: Updated cf. comments 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/world.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:io'; 5 import 'dart:io';
6 import 'package:async_helper/async_helper.dart'; 6 import 'package:async_helper/async_helper.dart';
7 import 'package:compiler/src/closure.dart'; 7 import 'package:compiler/src/closure.dart';
8 import 'package:compiler/src/common.dart'; 8 import 'package:compiler/src/common.dart';
9 import 'package:compiler/src/compiler.dart'; 9 import 'package:compiler/src/compiler.dart';
10 import 'package:compiler/src/diagnostics/diagnostic_listener.dart'; 10 import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 KernelToElementMapForBuilding elementMap, 107 KernelToElementMapForBuilding elementMap,
108 MemberEntity member, 108 MemberEntity member,
109 this._localsMap, 109 this._localsMap,
110 this.closureDataLookup) 110 this.closureDataLookup)
111 : this.info = closureDataLookup.getScopeInfo(member), 111 : this.info = closureDataLookup.getScopeInfo(member),
112 super(actualMap, sourceSpanMap); 112 super(actualMap, sourceSpanMap);
113 113
114 @override 114 @override
115 String computeNodeValue(ir.Node node) { 115 String computeNodeValue(ir.Node node) {
116 if (node is ir.VariableDeclaration) { 116 if (node is ir.VariableDeclaration) {
117 Local local = _localsMap.getLocal(node); 117 Local local = _localsMap.getLocalVariable(node);
118 return computeLocalValue(info, local); 118 return computeLocalValue(info, local);
119 } 119 }
120 // TODO(johnniwinther,efortuna): Collect data for other nodes? 120 // TODO(johnniwinther,efortuna): Collect data for other nodes?
121 return null; 121 return null;
122 } 122 }
123 123
124 @override 124 @override
125 String computeMemberValue(ir.Member member) { 125 String computeMemberValue(ir.Member member) {
126 // TODO(johnniwinther,efortuna): Collect data for the member 126 // TODO(johnniwinther,efortuna): Collect data for the member
127 // (has thisLocal, has box, etc.). 127 // (has thisLocal, has box, etc.).
128 return null; 128 return null;
129 } 129 }
130 } 130 }
131 131
132 /// Compute a string representation of the data stored for [local] in [info]. 132 /// Compute a string representation of the data stored for [local] in [info].
133 String computeLocalValue(ScopeInfo info, Local local) { 133 String computeLocalValue(ScopeInfo info, Local local) {
134 StringBuffer sb = new StringBuffer(); 134 StringBuffer sb = new StringBuffer();
135 if (info.localIsUsedInTryOrSync(local)) { 135 if (info.localIsUsedInTryOrSync(local)) {
136 sb.write('inTry'); 136 sb.write('inTry');
137 } 137 }
138 // TODO(johnniwinther,efortuna): Add more info (captured, boxed etc.). 138 // TODO(johnniwinther,efortuna): Add more info (captured, boxed etc.).
139 return sb.toString(); 139 return sb.toString();
140 } 140 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/world.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698