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

Side by Side Diff: pkg/compiler/lib/src/kernel/element_map.dart

Issue 3007743002: Add boxing for modified variables (Closed)
Patch Set: merged with master Created 3 years, 3 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
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 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 6
7 import '../closure.dart'; 7 import '../closure.dart';
8 import '../common.dart'; 8 import '../common.dart';
9 import '../constants/values.dart'; 9 import '../constants/values.dart';
10 import '../common_elements.dart'; 10 import '../common_elements.dart';
11 import '../elements/entities.dart'; 11 import '../elements/entities.dart';
12 import '../elements/jumps.dart'; 12 import '../elements/jumps.dart';
13 import '../elements/names.dart'; 13 import '../elements/names.dart';
14 import '../elements/types.dart'; 14 import '../elements/types.dart';
15 import '../js/js.dart' as js; 15 import '../js/js.dart' as js;
16 import '../js_backend/namer.dart'; 16 import '../js_backend/namer.dart';
17 import '../js_backend/native_data.dart'; 17 import '../js_backend/native_data.dart';
18 import '../js_emitter/code_emitter_task.dart'; 18 import '../js_emitter/code_emitter_task.dart';
19 import '../js_model/closure.dart' show JRecordField, KernelScopeInfo;
19 import '../native/native.dart' as native; 20 import '../native/native.dart' as native;
20 import '../types/types.dart'; 21 import '../types/types.dart';
21 import '../universe/call_structure.dart'; 22 import '../universe/call_structure.dart';
22 import '../universe/selector.dart'; 23 import '../universe/selector.dart';
23 import '../world.dart'; 24 import '../world.dart';
24 25
25 /// Interface that translates between Kernel IR nodes and entities. 26 /// Interface that translates between Kernel IR nodes and entities.
26 abstract class KernelToElementMap { 27 abstract class KernelToElementMap {
27 /// Access to the commonly used elements and types. 28 /// Access to the commonly used elements and types.
28 CommonElements get commonElements; 29 CommonElements get commonElements;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 /// context of [member]. 197 /// context of [member].
197 Spannable getSpannable(MemberEntity member, ir.Node node); 198 Spannable getSpannable(MemberEntity member, ir.Node node);
198 199
199 /// Returns the constructor body entity corresponding to [constructor]. 200 /// Returns the constructor body entity corresponding to [constructor].
200 FunctionEntity getConstructorBody(ir.Constructor node); 201 FunctionEntity getConstructorBody(ir.Constructor node);
201 202
202 /// Returns the uri for the deferred import [node]. 203 /// Returns the uri for the deferred import [node].
203 // TODO(johnniwinther): Avoid this method by deriving the uri directly from 204 // TODO(johnniwinther): Avoid this method by deriving the uri directly from
204 // the node. 205 // the node.
205 String getDeferredUri(ir.LibraryDependency node); 206 String getDeferredUri(ir.LibraryDependency node);
207
208 /// Make a record to ensure variables that are are declared in one scope and
209 /// modified in another get their values updated correctly.
210 Map<Local, JRecordField> makeRecordContainer(
211 KernelScopeInfo info, MemberEntity member, KernelToLocalsMap localsMap);
206 } 212 }
207 213
208 // TODO(johnniwinther,efortuna): Add more when needed. 214 // TODO(johnniwinther,efortuna): Add more when needed.
209 // TODO(johnniwinther): Should we split regular into method, field, etc.? 215 // TODO(johnniwinther): Should we split regular into method, field, etc.?
210 enum MemberKind { 216 enum MemberKind {
211 // A regular member defined by an [ir.Node]. 217 // A regular member defined by an [ir.Node].
212 regular, 218 regular,
213 // A constructor whose initializer is defined by an [ir.Constructor] node. 219 // A constructor whose initializer is defined by an [ir.Constructor] node.
214 constructor, 220 constructor,
215 // A constructor whose body is defined by an [ir.Constructor] node. 221 // A constructor whose body is defined by an [ir.Constructor] node.
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 uri = Uri.parse(node.location.file); 472 uri = Uri.parse(node.location.file);
467 break; 473 break;
468 } 474 }
469 node = node.parent; 475 node = node.parent;
470 } 476 }
471 if (uri != null) { 477 if (uri != null) {
472 return new SourceSpan(uri, offset, offset + 1); 478 return new SourceSpan(uri, offset, offset + 1);
473 } 479 }
474 return null; 480 return null;
475 } 481 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_model/js_strategy.dart ('k') | pkg/compiler/lib/src/kernel/element_map_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698