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

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

Issue 3009043002: Handle variable declarations in inferrer (Closed)
Patch Set: 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 /// Indexed entity interfaces for modeling elements derived from Kernel IR. 5 /// Indexed entity interfaces for modeling elements derived from Kernel IR.
6 6
7 import '../elements/entities.dart'; 7 import '../elements/entities.dart';
8 8
9 abstract class _Indexed { 9 abstract class _Indexed {
10 int _index; 10 int _index;
(...skipping 26 matching lines...) Expand all
37 implements TypeVariableEntity { 37 implements TypeVariableEntity {
38 /// Type variable index used for fast lookup in [KernelToElementMapBase]. 38 /// Type variable index used for fast lookup in [KernelToElementMapBase].
39 int get typeVariableIndex => _index; 39 int get typeVariableIndex => _index;
40 } 40 }
41 41
42 abstract class IndexedTypedef extends _Indexed implements TypedefEntity { 42 abstract class IndexedTypedef extends _Indexed implements TypedefEntity {
43 /// Typedef index used for fast lookup in [KernelToElementMapBase]. 43 /// Typedef index used for fast lookup in [KernelToElementMapBase].
44 int get typedefIndex => _index; 44 int get typedefIndex => _index;
45 } 45 }
46 46
47 abstract class IndexedLocal extends _Indexed implements Local {
48 int get localIndex => _index;
49 }
50
47 /// Base implementation for an index based map of entities of type [E]. 51 /// Base implementation for an index based map of entities of type [E].
48 abstract class EntityMapBase<E extends _Indexed> { 52 abstract class EntityMapBase<E extends _Indexed> {
49 List<E> _list = <E>[]; 53 List<E> _list = <E>[];
50 54
51 /// Returns the [index]th entity in the map. 55 /// Returns the [index]th entity in the map.
52 E getEntity(int index) => _list[index]; 56 E getEntity(int index) => _list[index];
53 57
54 /// Returns the number entities in the map. 58 /// Returns the number entities in the map.
55 int get length => _list.length; 59 int get length => _list.length;
56 } 60 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 assert(entity._index == null); 142 assert(entity._index == null);
139 entity._index = _list.length; 143 entity._index = _list.length;
140 _list.add(entity); 144 _list.add(entity);
141 assert(data != null); 145 assert(data != null);
142 _data.add(data); 146 _data.add(data);
143 assert(env != null); 147 assert(env != null);
144 _env.add(env); 148 _env.add(env);
145 return entity; 149 return entity;
146 } 150 }
147 } 151 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/kernel/element_map.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698