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

Side by Side Diff: pkg/compiler/lib/src/closure.dart

Issue 2994353002: Fix the locals lookup of variables and partial implementation of boxing of variables.
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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/field_naming_mixin.dart » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 'common/names.dart' show Identifiers; 5 import 'common/names.dart' show Identifiers;
6 import 'common/resolution.dart' show ParsingContext, Resolution; 6 import 'common/resolution.dart' show ParsingContext, Resolution;
7 import 'common/tasks.dart' show CompilerTask, Measurer; 7 import 'common/tasks.dart' show CompilerTask, Measurer;
8 import 'common.dart'; 8 import 'common.dart';
9 import 'compiler.dart' show Compiler; 9 import 'compiler.dart' show Compiler;
10 import 'constants/expressions.dart'; 10 import 'constants/expressions.dart';
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 1264
1265 for (LocalVariableElement variable in scopeVariables) { 1265 for (LocalVariableElement variable in scopeVariables) {
1266 // No need to box non-assignable elements. 1266 // No need to box non-assignable elements.
1267 if (!variable.isAssignable) continue; 1267 if (!variable.isAssignable) continue;
1268 if (!mutatedVariables.contains(variable)) continue; 1268 if (!mutatedVariables.contains(variable)) continue;
1269 boxCapturedVariable(variable); 1269 boxCapturedVariable(variable);
1270 } 1270 }
1271 if (!scopeMapping.isEmpty) { 1271 if (!scopeMapping.isEmpty) {
1272 CapturedScopeImpl scope = new CapturedScopeImpl(box, scopeMapping); 1272 CapturedScopeImpl scope = new CapturedScopeImpl(box, scopeMapping);
1273 closureData.capturingScopes[node] = scope; 1273 closureData.capturingScopes[node] = scope;
1274 print('adding capturing scope for $node to $closureData');
1274 assert(closureInfo[node] == null); 1275 assert(closureInfo[node] == null);
1275 closureInfo[node] = scope; 1276 closureInfo[node] = scope;
1276 } 1277 }
1277 } 1278 }
1278 1279
1279 void inNewScope(Node node, Function action) { 1280 void inNewScope(Node node, Function action) {
1280 List<LocalVariableElement> oldScopeVariables = scopeVariables; 1281 List<LocalVariableElement> oldScopeVariables = scopeVariables;
1281 scopeVariables = <LocalVariableElement>[]; 1282 scopeVariables = <LocalVariableElement>[];
1282 action(); 1283 action();
1283 attachCapturedScopeVariables(node); 1284 attachCapturedScopeVariables(node);
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 /// 1548 ///
1548 /// Move the below classes to a JS model eventually. 1549 /// Move the below classes to a JS model eventually.
1549 /// 1550 ///
1550 abstract class JSEntity implements MemberEntity { 1551 abstract class JSEntity implements MemberEntity {
1551 Local get declaredEntity; 1552 Local get declaredEntity;
1552 } 1553 }
1553 1554
1554 abstract class PrivatelyNamedJSEntity implements JSEntity { 1555 abstract class PrivatelyNamedJSEntity implements JSEntity {
1555 Entity get rootOfScope; 1556 Entity get rootOfScope;
1556 } 1557 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/field_naming_mixin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698