OLD | NEW |
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 /// Entity model for elements derived from Kernel IR. | 5 /// Entity model for elements derived from Kernel IR. |
6 | 6 |
7 import '../elements/elements.dart'; | 7 import '../elements/elements.dart'; |
8 import '../elements/entities.dart'; | 8 import '../elements/entities.dart'; |
9 | 9 |
10 class KLibrary implements LibraryEntity { | 10 class KLibrary implements LibraryEntity { |
11 /// Library index used for fast lookup in [KernelWorldBuilder]. | 11 /// Library index used for fast lookup in [KernelWorldBuilder]. |
12 final int libraryIndex; | 12 final int libraryIndex; |
13 final String name; | 13 final String name; |
14 final Uri canonicalUri; | 14 final Uri canonicalUri; |
15 | 15 |
16 KLibrary(this.libraryIndex, this.name, this.canonicalUri); | 16 KLibrary(this.libraryIndex, this.name, this.canonicalUri); |
17 | 17 |
18 String toString() => 'library($name)'; | 18 String toString() => 'library($name)'; |
19 } | 19 } |
20 | 20 |
21 class KClass implements ClassEntity { | 21 class KClass implements ClassEntity { |
22 final KLibrary library; | 22 final KLibrary library; |
23 | 23 |
24 /// Class index used for fast lookup in [KernelWorldBuilder]. | 24 /// Class index used for fast lookup in [KernelWorldBuilder]. |
25 final int classIndex; | 25 final int classIndex; |
| 26 |
26 final String name; | 27 final String name; |
| 28 final bool isAbstract; |
27 | 29 |
28 KClass(this.library, this.classIndex, this.name); | 30 KClass(this.library, this.classIndex, this.name, {this.isAbstract}); |
29 | 31 |
30 @override | 32 @override |
31 bool get isClosure => false; | 33 bool get isClosure => false; |
32 | 34 |
33 String toString() => 'class($name)'; | 35 String toString() => 'class($name)'; |
34 } | 36 } |
35 | 37 |
36 abstract class KMember implements MemberEntity { | 38 abstract class KMember implements MemberEntity { |
37 /// Member index used for fast lookup in [KernelWorldBuilder]. | 39 /// Member index used for fast lookup in [KernelWorldBuilder]. |
38 final int memberIndex; | 40 final int memberIndex; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 class KLocalFunction implements Local { | 208 class KLocalFunction implements Local { |
207 final String name; | 209 final String name; |
208 final MemberEntity memberContext; | 210 final MemberEntity memberContext; |
209 final Entity executableContext; | 211 final Entity executableContext; |
210 | 212 |
211 KLocalFunction(this.name, this.memberContext, this.executableContext); | 213 KLocalFunction(this.name, this.memberContext, this.executableContext); |
212 | 214 |
213 String toString() => | 215 String toString() => |
214 'local_function(${memberContext.name}.${name ?? '<anonymous>'})'; | 216 'local_function(${memberContext.name}.${name ?? '<anonymous>'})'; |
215 } | 217 } |
OLD | NEW |