| 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 { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 @override | 149 @override |
| 150 bool get isAssignable => true; | 150 bool get isAssignable => true; |
| 151 | 151 |
| 152 @override | 152 @override |
| 153 bool get isSetter => true; | 153 bool get isSetter => true; |
| 154 | 154 |
| 155 String get _kind => 'setter'; | 155 String get _kind => 'setter'; |
| 156 } | 156 } |
| 157 | 157 |
| 158 class KField extends KMember implements FieldEntity { | 158 class KField extends KMember implements FieldEntity { |
| 159 /// Field index used for fast lookup in [KernelWorldBuilder]. |
| 160 final int fieldIndex; |
| 159 final bool isAssignable; | 161 final bool isAssignable; |
| 160 | 162 |
| 161 KField(KClass enclosingClass, Name name, {bool isStatic, this.isAssignable}) | 163 KField(this.fieldIndex, KClass enclosingClass, Name name, |
| 164 {bool isStatic, this.isAssignable}) |
| 162 : super(enclosingClass, name, isStatic: isStatic); | 165 : super(enclosingClass, name, isStatic: isStatic); |
| 163 | 166 |
| 164 @override | 167 @override |
| 165 bool get isField => true; | 168 bool get isField => true; |
| 166 | 169 |
| 167 String get _kind => 'field'; | 170 String get _kind => 'field'; |
| 168 } | 171 } |
| 169 | 172 |
| 170 class KTypeVariable implements TypeVariableEntity { | 173 class KTypeVariable implements TypeVariableEntity { |
| 171 final Entity typeDeclaration; | 174 final Entity typeDeclaration; |
| 172 final String name; | 175 final String name; |
| 173 final int index; | 176 final int index; |
| 174 | 177 |
| 175 KTypeVariable(this.typeDeclaration, this.name, this.index); | 178 KTypeVariable(this.typeDeclaration, this.name, this.index); |
| 176 | 179 |
| 177 String toString() => 'type_variable(${typeDeclaration.name}.$name)'; | 180 String toString() => 'type_variable(${typeDeclaration.name}.$name)'; |
| 178 } | 181 } |
| 179 | 182 |
| 180 class KLocalFunction implements Local { | 183 class KLocalFunction implements Local { |
| 181 final String name; | 184 final String name; |
| 182 final MemberEntity memberContext; | 185 final MemberEntity memberContext; |
| 183 final Entity executableContext; | 186 final Entity executableContext; |
| 184 | 187 |
| 185 KLocalFunction(this.name, this.memberContext, this.executableContext); | 188 KLocalFunction(this.name, this.memberContext, this.executableContext); |
| 186 | 189 |
| 187 String toString() => | 190 String toString() => |
| 188 'local_function(${memberContext.name}.${name ?? '<anonymous>'})'; | 191 'local_function(${memberContext.name}.${name ?? '<anonymous>'})'; |
| 189 } | 192 } |
| OLD | NEW |