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

Side by Side Diff: pkg/compiler/lib/src/js_model/elements.dart

Issue 2972523002: Implement JsKernelToElementMap through KernelToElementMapBase (Closed)
Patch Set: Updated cf. comments Created 3 years, 5 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 library dart2js.js_model.elements; 5 library dart2js.js_model.elements;
6 6
7 import '../common_elements.dart'; 7 import '../common_elements.dart';
8 import '../constants/constant_system.dart'; 8 import '../constants/constant_system.dart';
9 import '../constants/values.dart';
10 import '../elements/elements.dart'; 9 import '../elements/elements.dart';
11 import '../elements/entities.dart'; 10 import '../elements/entities.dart';
12 import '../elements/names.dart'; 11 import '../elements/names.dart';
13 import '../elements/types.dart'; 12 import '../elements/types.dart';
14 import '../js_backend/backend_usage.dart'; 13 import '../js_backend/backend_usage.dart';
15 import '../js_backend/interceptor_data.dart'; 14 import '../js_backend/interceptor_data.dart';
16 import '../js_backend/native_data.dart'; 15 import '../js_backend/native_data.dart';
16 import '../kernel/elements.dart';
17 import '../native/behavior.dart'; 17 import '../native/behavior.dart';
18 import '../ordered_typeset.dart'; 18 import '../ordered_typeset.dart';
19 import '../universe/class_set.dart'; 19 import '../universe/class_set.dart';
20 import '../universe/function_set.dart'; 20 import '../universe/function_set.dart';
21 import '../universe/selector.dart'; 21 import '../universe/selector.dart';
22 import '../universe/world_builder.dart'; 22 import '../universe/world_builder.dart';
23 import '../world.dart'; 23 import '../world.dart';
24 24
25 /// Bidirectional map between 'frontend' and 'backend' elements. 25 /// Bidirectional map between 'frontend' and 'backend' elements.
26 /// 26 ///
(...skipping 10 matching lines...) Expand all
37 ClassEntity toBackendClass(ClassEntity cls) => cls; 37 ClassEntity toBackendClass(ClassEntity cls) => cls;
38 ClassEntity toFrontendClass(ClassEntity cls) => cls; 38 ClassEntity toFrontendClass(ClassEntity cls) => cls;
39 39
40 MemberEntity toBackendMember(MemberEntity member) => member; 40 MemberEntity toBackendMember(MemberEntity member) => member;
41 MemberEntity toFrontendMember(MemberEntity member) => member; 41 MemberEntity toFrontendMember(MemberEntity member) => member;
42 42
43 DartType toBackendType(DartType type) => type; 43 DartType toBackendType(DartType type) => type;
44 DartType toFrontendType(DartType type) => type; 44 DartType toFrontendType(DartType type) => type;
45 } 45 }
46 46
47 class JsToFrontendMapImpl implements JsToFrontendMap { 47 abstract class JsToFrontendMapBase implements JsToFrontendMap {
48 final Map<LibraryEntity, LibraryEntity> _toBackendLibrary =
49 <LibraryEntity, LibraryEntity>{};
50 final List<LibraryEntity> _frontendLibraryList = <LibraryEntity>[];
51
52 LibraryEntity toBackendLibrary(LibraryEntity library) {
53 return _toBackendLibrary.putIfAbsent(library, () {
54 JLibrary newLibrary = new JLibrary(
55 _toBackendLibrary.length, library.name, library.canonicalUri);
56 _frontendLibraryList.add(library);
57 return newLibrary;
58 });
59 }
60
61 LibraryEntity toFrontendLibrary(covariant JLibrary library) =>
62 _frontendLibraryList[library.libraryIndex];
63
64 final Map<ClassEntity, ClassEntity> _toBackendClass =
65 <ClassEntity, ClassEntity>{};
66 final List<ClassEntity> _frontendClassList = <ClassEntity>[];
67
68 ClassEntity toBackendClass(ClassEntity cls) {
69 return _toBackendClass.putIfAbsent(cls, () {
70 LibraryEntity library = toBackendLibrary(cls.library);
71 JClass newClass = new JClass(library, _toBackendClass.length, cls.name,
72 isAbstract: cls.isAbstract);
73 _frontendClassList.add(cls);
74 return newClass;
75 });
76 }
77
78 ClassEntity toFrontendClass(covariant JClass cls) =>
79 _frontendClassList[cls.classIndex];
80
81 final Map<MemberEntity, MemberEntity> _toBackendMember =
82 <MemberEntity, MemberEntity>{};
83 final List<MemberEntity> _frontendMemberList = <MemberEntity>[];
84
85 MemberEntity toBackendMember(MemberEntity member) {
86 return _toBackendMember.putIfAbsent(member, () {
87 LibraryEntity library = toBackendLibrary(member.library);
88 ClassEntity cls;
89 if (member.enclosingClass != null) {
90 cls = toBackendClass(member.enclosingClass);
91 }
92
93 JMember newMember;
94 Name memberName = new Name(member.memberName.text, library,
95 isSetter: member.memberName.isSetter);
96 if (member.isField) {
97 FieldEntity field = member;
98 newMember = new JField(
99 _toBackendMember.length, library, cls, memberName,
100 isStatic: field.isStatic,
101 isAssignable: field.isAssignable,
102 isConst: field.isConst);
103 } else if (member.isConstructor) {
104 ConstructorEntity constructor = member;
105 if (constructor.isFactoryConstructor) {
106 // TODO(redemption): This should be a JFunction.
107 newMember = new JFactoryConstructor(_toBackendMember.length, cls,
108 memberName, constructor.parameterStructure,
109 isExternal: constructor.isExternal,
110 isConst: constructor.isConst,
111 isFromEnvironmentConstructor:
112 constructor.isFromEnvironmentConstructor);
113 } else {
114 newMember = new JGenerativeConstructor(_toBackendMember.length, cls,
115 memberName, constructor.parameterStructure,
116 isExternal: constructor.isExternal, isConst: constructor.isConst);
117 }
118 } else if (member.isGetter) {
119 FunctionEntity getter = member;
120 newMember = new JGetter(_toBackendMember.length, library, cls,
121 memberName, getter.asyncMarker,
122 isStatic: getter.isStatic,
123 isExternal: getter.isExternal,
124 isAbstract: getter.isAbstract);
125 } else if (member.isSetter) {
126 FunctionEntity setter = member;
127 newMember = new JSetter(
128 _toBackendMember.length, library, cls, memberName,
129 isStatic: setter.isStatic,
130 isExternal: setter.isExternal,
131 isAbstract: setter.isAbstract);
132 } else {
133 FunctionEntity function = member;
134 newMember = new JMethod(_toBackendMember.length, library, cls,
135 memberName, function.parameterStructure, function.asyncMarker,
136 isStatic: function.isStatic,
137 isExternal: function.isExternal,
138 isAbstract: function.isAbstract);
139 }
140 _frontendMemberList.add(member);
141 return newMember;
142 });
143 }
144
145 MemberEntity toFrontendMember(covariant JMember member) =>
146 _frontendMemberList[member.memberIndex];
147
148 DartType toBackendType(DartType type) => 48 DartType toBackendType(DartType type) =>
149 const TypeConverter().visit(type, _toBackendEntity); 49 const TypeConverter().visit(type, _toBackendEntity);
150 DartType toFrontendType(DartType type) => 50 DartType toFrontendType(DartType type) =>
151 const TypeConverter().visit(type, _toFrontendEntity); 51 const TypeConverter().visit(type, _toFrontendEntity);
152 52
153 Entity _toBackendEntity(Entity entity) { 53 Entity _toBackendEntity(Entity entity) {
154 if (entity is ClassEntity) return toBackendClass(entity); 54 if (entity is ClassEntity) return toBackendClass(entity);
155 assert(entity is TypeVariableEntity); 55 assert(entity is TypeVariableEntity);
156 return _toBackendTypeVariable(entity); 56 return toBackendTypeVariable(entity);
57 }
58
59 Entity _toFrontendEntity(Entity entity) {
60 if (entity is ClassEntity) return toFrontendClass(entity);
61 assert(entity is TypeVariableEntity);
62 TypeVariableEntity typeVariable = toFrontendTypeVariable(entity);
63 assert(typeVariable != null, "No front end type variable for $entity");
64 return typeVariable;
157 } 65 }
158 66
159 final Map<TypeVariableEntity, TypeVariableEntity> _toBackendTypeVariableMap = 67 final Map<TypeVariableEntity, TypeVariableEntity> _toBackendTypeVariableMap =
160 <TypeVariableEntity, TypeVariableEntity>{}; 68 <TypeVariableEntity, TypeVariableEntity>{};
161 69
162 final Map<TypeVariableEntity, TypeVariableEntity> _toFrontendTypeVariableMap = 70 final Map<TypeVariableEntity, TypeVariableEntity> _toFrontendTypeVariableMap =
163 <TypeVariableEntity, TypeVariableEntity>{}; 71 <TypeVariableEntity, TypeVariableEntity>{};
164 72
165 TypeVariableEntity _toBackendTypeVariable(TypeVariableEntity typeVariable) { 73 TypeVariableEntity toBackendTypeVariable(TypeVariableEntity typeVariable) {
166 return _toBackendTypeVariableMap.putIfAbsent(typeVariable, () { 74 return _toBackendTypeVariableMap.putIfAbsent(typeVariable, () {
167 Entity typeDeclaration; 75 Entity typeDeclaration;
168 if (typeVariable.typeDeclaration is ClassEntity) { 76 if (typeVariable.typeDeclaration is ClassEntity) {
169 typeDeclaration = toBackendClass(typeVariable.typeDeclaration); 77 typeDeclaration = toBackendClass(typeVariable.typeDeclaration);
170 } else { 78 } else {
171 typeDeclaration = toBackendMember(typeVariable.typeDeclaration); 79 typeDeclaration = toBackendMember(typeVariable.typeDeclaration);
172 } 80 }
173 TypeVariableEntity newTypeVariable = new JTypeVariable( 81 TypeVariableEntity newTypeVariable =
174 typeDeclaration, typeVariable.name, typeVariable.index); 82 createTypeVariable(typeDeclaration, typeVariable);
175 _toFrontendTypeVariableMap[newTypeVariable] = typeVariable; 83 _toFrontendTypeVariableMap[newTypeVariable] = typeVariable;
176 return newTypeVariable; 84 return newTypeVariable;
177 }); 85 });
178 } 86 }
179 87
180 Entity _toFrontendEntity(Entity entity) { 88 TypeVariableEntity toFrontendTypeVariable(TypeVariableEntity typeVariable) {
181 if (entity is ClassEntity) return toFrontendClass(entity); 89 return _toFrontendTypeVariableMap[typeVariable];
182 assert(entity is TypeVariableEntity); 90 }
183 TypeVariableEntity typeVariable = _toFrontendTypeVariableMap[entity]; 91
184 assert(typeVariable != null, "No front end type variable for $entity"); 92 TypeVariableEntity createTypeVariable(
185 return typeVariable; 93 Entity typeDeclaration, TypeVariableEntity typeVariable) {
94 return new JTypeVariable(
95 typeDeclaration, typeVariable.name, typeVariable.index);
186 } 96 }
187 } 97 }
188 98
99 class JsElementCreatorMixin {
100 LibraryEntity createLibrary(IndexedLibrary library) {
101 return new JLibrary(
102 library.libraryIndex, library.name, library.canonicalUri);
103 }
104
105 ClassEntity createClass(LibraryEntity library, IndexedClass cls) {
106 return new JClass(library, cls.classIndex, cls.name,
107 isAbstract: cls.isAbstract);
108 }
109
110 MemberEntity createMember(
111 LibraryEntity library, ClassEntity cls, IndexedMember member) {
112 Name memberName = new Name(member.memberName.text, library,
113 isSetter: member.memberName.isSetter);
114 if (member.isField) {
115 IndexedField field = member;
116 return new JField(member.memberIndex, library, cls, memberName,
117 isStatic: field.isStatic,
118 isAssignable: field.isAssignable,
119 isConst: field.isConst);
120 } else if (member.isConstructor) {
121 IndexedConstructor constructor = member;
122 if (constructor.isFactoryConstructor) {
123 // TODO(redemption): This should be a JFunction.
124 return new JFactoryConstructor(
125 member.memberIndex, cls, memberName, constructor.parameterStructure,
126 isExternal: constructor.isExternal,
127 isConst: constructor.isConst,
128 isFromEnvironmentConstructor:
129 constructor.isFromEnvironmentConstructor);
130 } else {
131 return new JGenerativeConstructor(
132 member.memberIndex, cls, memberName, constructor.parameterStructure,
133 isExternal: constructor.isExternal, isConst: constructor.isConst);
134 }
135 } else if (member.isGetter) {
136 IndexedFunction getter = member;
137 return new JGetter(
138 member.memberIndex, library, cls, memberName, getter.asyncMarker,
139 isStatic: getter.isStatic,
140 isExternal: getter.isExternal,
141 isAbstract: getter.isAbstract);
142 } else if (member.isSetter) {
143 IndexedFunction setter = member;
144 return new JSetter(member.memberIndex, library, cls, memberName,
145 isStatic: setter.isStatic,
146 isExternal: setter.isExternal,
147 isAbstract: setter.isAbstract);
148 } else {
149 IndexedFunction function = member;
150 return new JMethod(member.memberIndex, library, cls, memberName,
151 function.parameterStructure, function.asyncMarker,
152 isStatic: function.isStatic,
153 isExternal: function.isExternal,
154 isAbstract: function.isAbstract);
155 }
156 }
157 }
158
189 typedef Entity EntityConverter(Entity cls); 159 typedef Entity EntityConverter(Entity cls);
190 160
191 class TypeConverter implements DartTypeVisitor<DartType, EntityConverter> { 161 class TypeConverter implements DartTypeVisitor<DartType, EntityConverter> {
192 const TypeConverter(); 162 const TypeConverter();
193 163
194 @override 164 @override
195 DartType visit(DartType type, EntityConverter converter) { 165 DartType visit(DartType type, EntityConverter converter) {
196 return type.accept(this, converter); 166 return type.accept(this, converter);
197 } 167 }
198 168
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 TypeVariableType type, EntityConverter converter) { 200 TypeVariableType type, EntityConverter converter) {
231 return new TypeVariableType(converter(type.element)); 201 return new TypeVariableType(converter(type.element));
232 } 202 }
233 203
234 @override 204 @override
235 DartType visitVoidType(VoidType type, EntityConverter converter) { 205 DartType visitVoidType(VoidType type, EntityConverter converter) {
236 return const VoidType(); 206 return const VoidType();
237 } 207 }
238 } 208 }
239 209
240 class JLibrary implements LibraryEntity { 210 class JLibrary implements LibraryEntity, IndexedLibrary {
241 /// Library index used for fast lookup in [JsToFrontendMapImpl]. 211 /// Library index used for fast lookup in [JsToFrontendMapImpl].
242 final int libraryIndex; 212 final int libraryIndex;
243 final String name; 213 final String name;
244 final Uri canonicalUri; 214 final Uri canonicalUri;
245 215
246 JLibrary(this.libraryIndex, this.name, this.canonicalUri); 216 JLibrary(this.libraryIndex, this.name, this.canonicalUri);
247 217
248 String toString() => 'library($name)'; 218 String toString() => 'library($name)';
249 } 219 }
250 220
251 class JClass implements ClassEntity { 221 class JClass implements ClassEntity, IndexedClass {
252 final JLibrary library; 222 final JLibrary library;
253 223
254 /// Class index used for fast lookup in [JsToFrontendMapImpl]. 224 /// Class index used for fast lookup in [JsToFrontendMapImpl].
255 final int classIndex; 225 final int classIndex;
256 226
257 final String name; 227 final String name;
258 final bool isAbstract; 228 final bool isAbstract;
259 229
260 JClass(this.library, this.classIndex, this.name, {this.isAbstract}); 230 JClass(this.library, this.classIndex, this.name, {this.isAbstract});
261 231
262 @override 232 @override
263 bool get isClosure => false; 233 bool get isClosure => false;
264 234
265 String toString() => 'class($name)'; 235 String toString() => 'class($name)';
266 } 236 }
267 237
268 abstract class JMember implements MemberEntity { 238 abstract class JMember implements MemberEntity, IndexedMember {
269 /// Member index used for fast lookup in [JsToFrontendMapImpl]. 239 /// Member index used for fast lookup in [JsToFrontendMapImpl].
270 final int memberIndex; 240 final int memberIndex;
271 final JLibrary library; 241 final JLibrary library;
272 final JClass enclosingClass; 242 final JClass enclosingClass;
273 final Name _name; 243 final Name _name;
274 final bool _isStatic; 244 final bool _isStatic;
275 245
276 JMember(this.memberIndex, this.library, this.enclosingClass, this._name, 246 JMember(this.memberIndex, this.library, this.enclosingClass, this._name,
277 {bool isStatic: false}) 247 {bool isStatic: false})
278 : _isStatic = isStatic; 248 : _isStatic = isStatic;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 283
314 @override 284 @override
315 bool get isTopLevel => enclosingClass == null; 285 bool get isTopLevel => enclosingClass == null;
316 286
317 String get _kind; 287 String get _kind;
318 288
319 String toString() => 289 String toString() =>
320 '$_kind(${enclosingClass != null ? '${enclosingClass.name}.' : ''}$name)'; 290 '$_kind(${enclosingClass != null ? '${enclosingClass.name}.' : ''}$name)';
321 } 291 }
322 292
323 abstract class JFunction extends JMember implements FunctionEntity { 293 abstract class JFunction extends JMember
294 implements FunctionEntity, IndexedFunction {
324 final ParameterStructure parameterStructure; 295 final ParameterStructure parameterStructure;
325 final bool isExternal; 296 final bool isExternal;
326 final AsyncMarker asyncMarker; 297 final AsyncMarker asyncMarker;
327 298
328 JFunction(int memberIndex, JLibrary library, JClass enclosingClass, Name name, 299 JFunction(int memberIndex, JLibrary library, JClass enclosingClass, Name name,
329 this.parameterStructure, this.asyncMarker, 300 this.parameterStructure, this.asyncMarker,
330 {bool isStatic: false, this.isExternal: false}) 301 {bool isStatic: false, this.isExternal: false})
331 : super(memberIndex, library, enclosingClass, name, isStatic: isStatic); 302 : super(memberIndex, library, enclosingClass, name, isStatic: isStatic);
332 } 303 }
333 304
334 abstract class JConstructor extends JFunction implements ConstructorEntity { 305 abstract class JConstructor extends JFunction
306 implements ConstructorEntity, IndexedConstructor {
335 final bool isConst; 307 final bool isConst;
336 308
337 JConstructor(int memberIndex, JClass enclosingClass, Name name, 309 JConstructor(int memberIndex, JClass enclosingClass, Name name,
338 ParameterStructure parameterStructure, {bool isExternal, this.isConst}) 310 ParameterStructure parameterStructure, {bool isExternal, this.isConst})
339 : super(memberIndex, enclosingClass.library, enclosingClass, name, 311 : super(memberIndex, enclosingClass.library, enclosingClass, name,
340 parameterStructure, AsyncMarker.SYNC, 312 parameterStructure, AsyncMarker.SYNC,
341 isExternal: isExternal); 313 isExternal: isExternal);
342 314
343 @override 315 @override
344 bool get isConstructor => true; 316 bool get isConstructor => true;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 403
432 @override 404 @override
433 bool get isAssignable => true; 405 bool get isAssignable => true;
434 406
435 @override 407 @override
436 bool get isSetter => true; 408 bool get isSetter => true;
437 409
438 String get _kind => 'setter'; 410 String get _kind => 'setter';
439 } 411 }
440 412
441 class JField extends JMember implements FieldEntity { 413 class JField extends JMember implements FieldEntity, IndexedField {
442 final bool isAssignable; 414 final bool isAssignable;
443 final bool isConst; 415 final bool isConst;
444 416
445 JField(int memberIndex, JLibrary library, JClass enclosingClass, Name name, 417 JField(int memberIndex, JLibrary library, JClass enclosingClass, Name name,
446 {bool isStatic, this.isAssignable, this.isConst}) 418 {bool isStatic, this.isAssignable, this.isConst})
447 : super(memberIndex, library, enclosingClass, name, isStatic: isStatic); 419 : super(memberIndex, library, enclosingClass, name, isStatic: isStatic);
448 420
449 @override 421 @override
450 bool get isField => true; 422 bool get isField => true;
451 423
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 687
716 @override 688 @override
717 bool get isFunctionApplyUsed => _backendUsage.isFunctionApplyUsed; 689 bool get isFunctionApplyUsed => _backendUsage.isFunctionApplyUsed;
718 690
719 @override 691 @override
720 bool get isMirrorsUsed => _backendUsage.isMirrorsUsed; 692 bool get isMirrorsUsed => _backendUsage.isMirrorsUsed;
721 693
722 @override 694 @override
723 bool get isNoSuchMethodUsed => _backendUsage.isNoSuchMethodUsed; 695 bool get isNoSuchMethodUsed => _backendUsage.isNoSuchMethodUsed;
724 } 696 }
725
726 class JsElementEnvironment implements ElementEnvironment {
727 final JsToFrontendMap _map;
728 final ElementEnvironment _elementEnvironment;
729
730 JsElementEnvironment(this._map, this._elementEnvironment);
731
732 @override
733 Iterable<ConstantValue> getMemberMetadata(MemberEntity member) {
734 throw new UnimplementedError('JsElementEnvironment.getMemberMetadata');
735 }
736
737 @override
738 bool isDeferredLoadLibraryGetter(MemberEntity member) {
739 throw new UnimplementedError(
740 'JsElementEnvironment.isDeferredLoadLibraryGetter');
741 }
742
743 @override
744 DartType getUnaliasedType(DartType type) {
745 throw new UnimplementedError('JsElementEnvironment.getUnaliasedType');
746 }
747
748 @override
749 FunctionType getLocalFunctionType(Local local) {
750 throw new UnimplementedError('JsElementEnvironment.getLocalFunctionType');
751 }
752
753 @override
754 FunctionType getFunctionType(FunctionEntity function) {
755 return _map.toBackendType(
756 _elementEnvironment.getFunctionType(_map.toFrontendMember(function)));
757 }
758
759 @override
760 DartType getTypeVariableBound(TypeVariableEntity typeVariable) {
761 throw new UnimplementedError('JsElementEnvironment.getTypeVariableBound');
762 }
763
764 @override
765 ClassEntity getEffectiveMixinClass(ClassEntity cls) {
766 throw new UnimplementedError('JsElementEnvironment.getEffectiveMixinClass');
767 }
768
769 @override
770 bool isUnnamedMixinApplication(ClassEntity cls) {
771 throw new UnimplementedError(
772 'JsElementEnvironment.isUnnamedMixinApplication');
773 }
774
775 @override
776 bool isMixinApplication(ClassEntity cls) {
777 throw new UnimplementedError('JsElementEnvironment.isMixinApplication');
778 }
779
780 @override
781 bool isGenericClass(ClassEntity cls) {
782 throw new UnimplementedError('JsElementEnvironment.isGenericClass');
783 }
784
785 @override
786 InterfaceType getThisType(ClassEntity cls) {
787 throw new UnimplementedError('JsElementEnvironment.getThisType');
788 }
789
790 @override
791 InterfaceType getRawType(ClassEntity cls) {
792 throw new UnimplementedError('JsElementEnvironment.getRawType');
793 }
794
795 @override
796 DartType get dynamicType {
797 throw new UnimplementedError('JsElementEnvironment.dynamicType');
798 }
799
800 @override
801 InterfaceType createInterfaceType(
802 ClassEntity cls, List<DartType> typeArguments) {
803 throw new UnimplementedError('JsElementEnvironment.createInterfaceType');
804 }
805
806 @override
807 void forEachMixin(ClassEntity cls, void f(ClassEntity mixin)) {
808 throw new UnimplementedError('JsElementEnvironment.forEachMixin');
809 }
810
811 @override
812 void forEachSupertype(ClassEntity cls, void f(InterfaceType supertype)) {
813 throw new UnimplementedError('JsElementEnvironment.forEachSupertype');
814 }
815
816 @override
817 ClassEntity getSuperClass(ClassEntity cls,
818 {bool skipUnnamedMixinApplications: false}) {
819 throw new UnimplementedError('JsElementEnvironment.getSuperClass');
820 }
821
822 @override
823 void forEachConstructor(
824 ClassEntity cls, void f(ConstructorEntity constructor)) {
825 throw new UnimplementedError('JsElementEnvironment.forEachConstructor');
826 }
827
828 @override
829 void forEachClassMember(
830 ClassEntity cls, void f(ClassEntity declarer, MemberEntity member)) {
831 throw new UnimplementedError('JsElementEnvironment.forEachClassMember');
832 }
833
834 @override
835 ConstructorEntity lookupConstructor(ClassEntity cls, String name,
836 {bool required: false}) {
837 throw new UnimplementedError('JsElementEnvironment.lookupConstructor');
838 }
839
840 @override
841 MemberEntity lookupClassMember(ClassEntity cls, String name,
842 {bool setter: false, bool required: false}) {
843 throw new UnimplementedError('JsElementEnvironment.lookupClassMember');
844 }
845
846 @override
847 MemberEntity lookupLibraryMember(LibraryEntity library, String name,
848 {bool setter: false, bool required: false}) {
849 throw new UnimplementedError('JsElementEnvironment.lookupLibraryMember');
850 }
851
852 @override
853 void forEachLibraryMember(
854 LibraryEntity library, void f(MemberEntity member)) {
855 _elementEnvironment.forEachLibraryMember(_map.toFrontendLibrary(library),
856 (MemberEntity member) {
857 f(_map.toBackendMember(member));
858 });
859 }
860
861 @override
862 ClassEntity lookupClass(LibraryEntity library, String name,
863 {bool required: false}) {
864 throw new UnimplementedError('JsElementEnvironment.lookupClass');
865 }
866
867 @override
868 void forEachClass(LibraryEntity library, void f(ClassEntity cls)) {
869 throw new UnimplementedError('JsElementEnvironment.forEachClass');
870 }
871
872 @override
873 LibraryEntity lookupLibrary(Uri uri, {bool required: false}) {
874 throw new UnimplementedError('JsElementEnvironment.lookupLibrary');
875 }
876
877 @override
878 String getLibraryName(LibraryEntity library) {
879 return _elementEnvironment.getLibraryName(_map.toFrontendLibrary(library));
880 }
881
882 @override
883 Iterable<LibraryEntity> get libraries {
884 throw new UnimplementedError('JsElementEnvironment.libraries');
885 }
886
887 @override
888 FunctionEntity get mainFunction {
889 return _map.toBackendMember(_elementEnvironment.mainFunction);
890 }
891
892 @override
893 LibraryEntity get mainLibrary {
894 return _map.toBackendLibrary(_elementEnvironment.mainLibrary);
895 }
896 }
897
898 class JsCommonElements implements CommonElements {
899 final JsToFrontendMap _map;
900 final CommonElements _commonElements;
901
902 JsCommonElements(this._map, this._commonElements);
903
904 @override
905 ClassEntity get objectClass =>
906 _map.toBackendClass(_commonElements.objectClass);
907
908 @override
909 ClassEntity get expectAssumeDynamicClass =>
910 _map.toBackendClass(_commonElements.expectAssumeDynamicClass);
911
912 @override
913 ClassEntity get expectTrustTypeAnnotationsClass =>
914 _map.toBackendClass(_commonElements.expectTrustTypeAnnotationsClass);
915
916 @override
917 ClassEntity get expectNoInlineClass =>
918 _map.toBackendClass(_commonElements.expectNoInlineClass);
919
920 @override
921 FunctionEntity get callInIsolate =>
922 _map.toBackendMember(_commonElements.callInIsolate);
923
924 @override
925 FunctionEntity get currentIsolate =>
926 _map.toBackendMember(_commonElements.currentIsolate);
927
928 @override
929 FunctionEntity get startRootIsolate =>
930 _map.toBackendMember(_commonElements.startRootIsolate);
931
932 @override
933 ClassEntity get jsBuiltinEnum =>
934 _map.toBackendClass(_commonElements.jsBuiltinEnum);
935
936 @override
937 ClassEntity get jsGetNameEnum =>
938 _map.toBackendClass(_commonElements.jsGetNameEnum);
939
940 @override
941 ClassEntity get typedArrayOfIntClass =>
942 _map.toBackendClass(_commonElements.typedArrayOfIntClass);
943
944 @override
945 ClassEntity get typedArrayClass =>
946 _map.toBackendClass(_commonElements.typedArrayClass);
947
948 @override
949 bool isSymbolValidatedConstructor(ConstructorEntity element) =>
950 _commonElements
951 .isSymbolValidatedConstructor(_map.toFrontendMember(element));
952
953 @override
954 FieldEntity get symbolImplementationField =>
955 _map.toBackendMember(_commonElements.symbolImplementationField);
956
957 @override
958 ConstructorEntity get symbolValidatedConstructor =>
959 _map.toBackendMember(_commonElements.symbolValidatedConstructor);
960
961 @override
962 final Selector symbolValidatedConstructorSelector = null;
963
964 @override
965 ClassEntity get symbolImplementationClass =>
966 _map.toBackendClass(_commonElements.symbolImplementationClass);
967
968 @override
969 FunctionEntity get hashCodeForNativeObject =>
970 _map.toBackendMember(_commonElements.hashCodeForNativeObject);
971
972 @override
973 FunctionEntity get toStringForNativeObject =>
974 _map.toBackendMember(_commonElements.toStringForNativeObject);
975
976 @override
977 FunctionEntity get convertRtiToRuntimeType =>
978 _map.toBackendMember(_commonElements.convertRtiToRuntimeType);
979
980 @override
981 FunctionEntity get defineProperty =>
982 _map.toBackendMember(_commonElements.defineProperty);
983
984 @override
985 FunctionEntity get cyclicThrowHelper =>
986 _map.toBackendMember(_commonElements.cyclicThrowHelper);
987
988 @override
989 FunctionEntity get createInvocationMirror =>
990 _map.toBackendMember(_commonElements.createInvocationMirror);
991
992 @override
993 FunctionEntity get fallThroughError =>
994 _map.toBackendMember(_commonElements.fallThroughError);
995
996 @override
997 FunctionEntity get createRuntimeType =>
998 _map.toBackendMember(_commonElements.createRuntimeType);
999
1000 @override
1001 FunctionEntity get throwNoSuchMethod =>
1002 _map.toBackendMember(_commonElements.throwNoSuchMethod);
1003
1004 @override
1005 FunctionEntity get checkDeferredIsLoaded =>
1006 _map.toBackendMember(_commonElements.checkDeferredIsLoaded);
1007
1008 @override
1009 FunctionEntity get subtypeOfRuntimeTypeCast =>
1010 _map.toBackendMember(_commonElements.subtypeOfRuntimeTypeCast);
1011
1012 @override
1013 FunctionEntity get assertSubtypeOfRuntimeType =>
1014 _map.toBackendMember(_commonElements.assertSubtypeOfRuntimeType);
1015
1016 @override
1017 FunctionEntity get checkSubtypeOfRuntimeType =>
1018 _map.toBackendMember(_commonElements.checkSubtypeOfRuntimeType);
1019
1020 @override
1021 FunctionEntity get functionTypeTest =>
1022 _map.toBackendMember(_commonElements.functionTypeTest);
1023
1024 @override
1025 FunctionEntity get subtypeCast =>
1026 _map.toBackendMember(_commonElements.subtypeCast);
1027
1028 @override
1029 FunctionEntity get assertSubtype =>
1030 _map.toBackendMember(_commonElements.assertSubtype);
1031
1032 @override
1033 FunctionEntity get checkSubtype =>
1034 _map.toBackendMember(_commonElements.checkSubtype);
1035
1036 @override
1037 FunctionEntity get assertIsSubtype =>
1038 _map.toBackendMember(_commonElements.assertIsSubtype);
1039
1040 @override
1041 FunctionEntity get runtimeTypeToString =>
1042 _map.toBackendMember(_commonElements.runtimeTypeToString);
1043
1044 @override
1045 FunctionEntity get getRuntimeTypeArgument =>
1046 _map.toBackendMember(_commonElements.getRuntimeTypeArgument);
1047
1048 @override
1049 FunctionEntity get getRuntimeTypeArguments =>
1050 _map.toBackendMember(_commonElements.getRuntimeTypeArguments);
1051
1052 @override
1053 FunctionEntity get computeSignature =>
1054 _map.toBackendMember(_commonElements.computeSignature);
1055
1056 @override
1057 FunctionEntity get getTypeArgumentByIndex =>
1058 _map.toBackendMember(_commonElements.getTypeArgumentByIndex);
1059
1060 @override
1061 FunctionEntity get getRuntimeTypeInfo =>
1062 _map.toBackendMember(_commonElements.getRuntimeTypeInfo);
1063
1064 @override
1065 FunctionEntity get setRuntimeTypeInfo =>
1066 _map.toBackendMember(_commonElements.setRuntimeTypeInfo);
1067
1068 @override
1069 FunctionEntity get traceFromException =>
1070 _map.toBackendMember(_commonElements.traceFromException);
1071
1072 @override
1073 FunctionEntity get closureConverter =>
1074 _map.toBackendMember(_commonElements.closureConverter);
1075
1076 @override
1077 FunctionEntity get throwExpressionHelper =>
1078 _map.toBackendMember(_commonElements.throwExpressionHelper);
1079
1080 @override
1081 FunctionEntity get wrapExceptionHelper =>
1082 _map.toBackendMember(_commonElements.wrapExceptionHelper);
1083
1084 @override
1085 FunctionEntity get stringInterpolationHelper =>
1086 _map.toBackendMember(_commonElements.stringInterpolationHelper);
1087
1088 @override
1089 FunctionEntity get checkString =>
1090 _map.toBackendMember(_commonElements.checkString);
1091
1092 @override
1093 FunctionEntity get checkNum => _map.toBackendMember(_commonElements.checkNum);
1094
1095 @override
1096 FunctionEntity get checkInt => _map.toBackendMember(_commonElements.checkInt);
1097
1098 @override
1099 FunctionEntity get throwConcurrentModificationError =>
1100 _map.toBackendMember(_commonElements.throwConcurrentModificationError);
1101
1102 @override
1103 FunctionEntity get checkConcurrentModificationError =>
1104 _map.toBackendMember(_commonElements.checkConcurrentModificationError);
1105
1106 @override
1107 FunctionEntity get throwAbstractClassInstantiationError => _map
1108 .toBackendMember(_commonElements.throwAbstractClassInstantiationError);
1109
1110 @override
1111 FunctionEntity get throwTypeError =>
1112 _map.toBackendMember(_commonElements.throwTypeError);
1113
1114 @override
1115 FunctionEntity get throwRuntimeError =>
1116 _map.toBackendMember(_commonElements.throwRuntimeError);
1117
1118 @override
1119 FunctionEntity get exceptionUnwrapper =>
1120 _map.toBackendMember(_commonElements.exceptionUnwrapper);
1121
1122 @override
1123 FunctionEntity get throwIndexOutOfRangeException =>
1124 _map.toBackendMember(_commonElements.throwIndexOutOfRangeException);
1125
1126 @override
1127 FunctionEntity get throwIllegalArgumentException =>
1128 _map.toBackendMember(_commonElements.throwIllegalArgumentException);
1129
1130 @override
1131 FunctionEntity get isJsIndexable =>
1132 _map.toBackendMember(_commonElements.isJsIndexable);
1133
1134 @override
1135 FunctionEntity get closureFromTearOff =>
1136 _map.toBackendMember(_commonElements.closureFromTearOff);
1137
1138 @override
1139 FunctionEntity get traceHelper =>
1140 _map.toBackendMember(_commonElements.traceHelper);
1141
1142 @override
1143 FunctionEntity get boolConversionCheck =>
1144 _map.toBackendMember(_commonElements.boolConversionCheck);
1145
1146 @override
1147 FunctionEntity get loadLibraryWrapper =>
1148 _map.toBackendMember(_commonElements.loadLibraryWrapper);
1149
1150 @override
1151 FunctionEntity get mainHasTooManyParameters =>
1152 _map.toBackendMember(_commonElements.mainHasTooManyParameters);
1153
1154 @override
1155 FunctionEntity get missingMain =>
1156 _map.toBackendMember(_commonElements.missingMain);
1157
1158 @override
1159 FunctionEntity get badMain => _map.toBackendMember(_commonElements.badMain);
1160
1161 @override
1162 FunctionEntity get requiresPreambleMarker =>
1163 _map.toBackendMember(_commonElements.requiresPreambleMarker);
1164
1165 @override
1166 FunctionEntity get getIsolateAffinityTagMarker =>
1167 _map.toBackendMember(_commonElements.getIsolateAffinityTagMarker);
1168
1169 @override
1170 FunctionEntity get assertUnreachableMethod =>
1171 _map.toBackendMember(_commonElements.assertUnreachableMethod);
1172
1173 @override
1174 FunctionEntity get assertHelper =>
1175 _map.toBackendMember(_commonElements.assertHelper);
1176
1177 @override
1178 FunctionEntity get assertThrow =>
1179 _map.toBackendMember(_commonElements.assertThrow);
1180
1181 @override
1182 FunctionEntity get assertTest =>
1183 _map.toBackendMember(_commonElements.assertTest);
1184
1185 @override
1186 FunctionEntity get invokeOnMethod =>
1187 _map.toBackendMember(_commonElements.invokeOnMethod);
1188
1189 @override
1190 ConstructorEntity get typeVariableConstructor =>
1191 _map.toBackendMember(_commonElements.typeVariableConstructor);
1192
1193 @override
1194 ClassEntity get nativeAnnotationClass =>
1195 _map.toBackendClass(_commonElements.nativeAnnotationClass);
1196
1197 @override
1198 ClassEntity get patchAnnotationClass =>
1199 _map.toBackendClass(_commonElements.patchAnnotationClass);
1200
1201 @override
1202 ClassEntity get annotationJSNameClass =>
1203 _map.toBackendClass(_commonElements.annotationJSNameClass);
1204
1205 @override
1206 ClassEntity get annotationReturnsClass =>
1207 _map.toBackendClass(_commonElements.annotationReturnsClass);
1208
1209 @override
1210 ClassEntity get annotationCreatesClass =>
1211 _map.toBackendClass(_commonElements.annotationCreatesClass);
1212
1213 @override
1214 ClassEntity get generalConstantMapClass =>
1215 _map.toBackendClass(_commonElements.generalConstantMapClass);
1216
1217 @override
1218 ClassEntity get constantProtoMapClass =>
1219 _map.toBackendClass(_commonElements.constantProtoMapClass);
1220
1221 @override
1222 ClassEntity get constantStringMapClass =>
1223 _map.toBackendClass(_commonElements.constantStringMapClass);
1224
1225 @override
1226 ClassEntity get constantMapClass =>
1227 _map.toBackendClass(_commonElements.constantMapClass);
1228
1229 @override
1230 ClassEntity get stackTraceHelperClass =>
1231 _map.toBackendClass(_commonElements.stackTraceHelperClass);
1232
1233 @override
1234 ClassEntity get VoidRuntimeType =>
1235 _map.toBackendClass(_commonElements.VoidRuntimeType);
1236
1237 @override
1238 ClassEntity get jsIndexingBehaviorInterface =>
1239 _map.toBackendClass(_commonElements.jsIndexingBehaviorInterface);
1240
1241 @override
1242 ClassEntity get jsInvocationMirrorClass =>
1243 _map.toBackendClass(_commonElements.jsInvocationMirrorClass);
1244
1245 @override
1246 ClassEntity get irRepresentationClass =>
1247 _map.toBackendClass(_commonElements.irRepresentationClass);
1248
1249 @override
1250 ClassEntity get forceInlineClass =>
1251 _map.toBackendClass(_commonElements.forceInlineClass);
1252
1253 @override
1254 ClassEntity get noInlineClass =>
1255 _map.toBackendClass(_commonElements.noInlineClass);
1256
1257 @override
1258 ClassEntity get noThrowsClass =>
1259 _map.toBackendClass(_commonElements.noThrowsClass);
1260
1261 @override
1262 ClassEntity get noSideEffectsClass =>
1263 _map.toBackendClass(_commonElements.noSideEffectsClass);
1264
1265 @override
1266 ClassEntity get typeVariableClass =>
1267 _map.toBackendClass(_commonElements.typeVariableClass);
1268
1269 @override
1270 ClassEntity get constMapLiteralClass =>
1271 _map.toBackendClass(_commonElements.constMapLiteralClass);
1272
1273 @override
1274 ClassEntity get typeLiteralClass =>
1275 _map.toBackendClass(_commonElements.typeLiteralClass);
1276
1277 @override
1278 ClassEntity get boundClosureClass =>
1279 _map.toBackendClass(_commonElements.boundClosureClass);
1280
1281 @override
1282 ClassEntity get closureClass =>
1283 _map.toBackendClass(_commonElements.closureClass);
1284
1285 @override
1286 FunctionEntity findHelperFunction(String name) {
1287 return _map.toBackendMember(_commonElements.findHelperFunction(name));
1288 }
1289
1290 @override
1291 ClassEntity get jsAnonymousClass =>
1292 _map.toBackendClass(_commonElements.jsAnonymousClass);
1293
1294 @override
1295 ClassEntity get jsAnnotationClass =>
1296 _map.toBackendClass(_commonElements.jsAnnotationClass);
1297
1298 @override
1299 FunctionEntity get jsStringOperatorAdd =>
1300 _map.toBackendMember(_commonElements.jsStringOperatorAdd);
1301
1302 @override
1303 FunctionEntity get jsStringToString =>
1304 _map.toBackendMember(_commonElements.jsStringToString);
1305
1306 @override
1307 FunctionEntity get jsStringSplit =>
1308 _map.toBackendMember(_commonElements.jsStringSplit);
1309
1310 @override
1311 FunctionEntity get jsArrayAdd =>
1312 _map.toBackendMember(_commonElements.jsArrayAdd);
1313
1314 @override
1315 FunctionEntity get jsArrayRemoveLast =>
1316 _map.toBackendMember(_commonElements.jsArrayRemoveLast);
1317
1318 @override
1319 ConstructorEntity get jsArrayTypedConstructor =>
1320 _map.toBackendMember(_commonElements.jsArrayTypedConstructor);
1321
1322 @override
1323 MemberEntity get jsIndexableLength =>
1324 _map.toBackendMember(_commonElements.jsIndexableLength);
1325
1326 @override
1327 FunctionEntity get getNativeInterceptorMethod =>
1328 _map.toBackendMember(_commonElements.getNativeInterceptorMethod);
1329
1330 @override
1331 FunctionEntity get getInterceptorMethod =>
1332 _map.toBackendMember(_commonElements.getInterceptorMethod);
1333
1334 @override
1335 FunctionEntity get findIndexForNativeSubclassType =>
1336 _map.toBackendMember(_commonElements.findIndexForNativeSubclassType);
1337
1338 @override
1339 ClassEntity get jsUInt31Class =>
1340 _map.toBackendClass(_commonElements.jsUInt31Class);
1341
1342 @override
1343 ClassEntity get jsUInt32Class =>
1344 _map.toBackendClass(_commonElements.jsUInt32Class);
1345
1346 @override
1347 ClassEntity get jsPositiveIntClass =>
1348 _map.toBackendClass(_commonElements.jsPositiveIntClass);
1349
1350 @override
1351 ClassEntity get jsUnmodifiableArrayClass =>
1352 _map.toBackendClass(_commonElements.jsUnmodifiableArrayClass);
1353
1354 @override
1355 ClassEntity get jsExtendableArrayClass =>
1356 _map.toBackendClass(_commonElements.jsExtendableArrayClass);
1357
1358 @override
1359 ClassEntity get jsFixedArrayClass =>
1360 _map.toBackendClass(_commonElements.jsFixedArrayClass);
1361
1362 @override
1363 ClassEntity get jsMutableArrayClass =>
1364 _map.toBackendClass(_commonElements.jsMutableArrayClass);
1365
1366 @override
1367 ClassEntity get jsMutableIndexableClass =>
1368 _map.toBackendClass(_commonElements.jsMutableIndexableClass);
1369
1370 @override
1371 ClassEntity get jsIndexableClass =>
1372 _map.toBackendClass(_commonElements.jsIndexableClass);
1373
1374 @override
1375 ClassEntity get jsJavaScriptObjectClass =>
1376 _map.toBackendClass(_commonElements.jsJavaScriptObjectClass);
1377
1378 @override
1379 ClassEntity get jsJavaScriptFunctionClass =>
1380 _map.toBackendClass(_commonElements.jsJavaScriptFunctionClass);
1381
1382 @override
1383 ClassEntity get jsUnknownJavaScriptObjectClass =>
1384 _map.toBackendClass(_commonElements.jsUnknownJavaScriptObjectClass);
1385
1386 @override
1387 ClassEntity get jsPlainJavaScriptObjectClass =>
1388 _map.toBackendClass(_commonElements.jsPlainJavaScriptObjectClass);
1389
1390 @override
1391 ClassEntity get jsBoolClass =>
1392 _map.toBackendClass(_commonElements.jsBoolClass);
1393
1394 @override
1395 ClassEntity get jsNullClass =>
1396 _map.toBackendClass(_commonElements.jsNullClass);
1397
1398 @override
1399 ClassEntity get jsDoubleClass =>
1400 _map.toBackendClass(_commonElements.jsDoubleClass);
1401
1402 @override
1403 ClassEntity get jsIntClass => _map.toBackendClass(_commonElements.jsIntClass);
1404
1405 @override
1406 ClassEntity get jsNumberClass =>
1407 _map.toBackendClass(_commonElements.jsNumberClass);
1408
1409 @override
1410 ClassEntity get jsArrayClass =>
1411 _map.toBackendClass(_commonElements.jsArrayClass);
1412
1413 @override
1414 ClassEntity get jsStringClass =>
1415 _map.toBackendClass(_commonElements.jsStringClass);
1416
1417 @override
1418 ClassEntity get jsInterceptorClass =>
1419 _map.toBackendClass(_commonElements.jsInterceptorClass);
1420
1421 @override
1422 ClassEntity get jsConstClass =>
1423 _map.toBackendClass(_commonElements.jsConstClass);
1424
1425 @override
1426 FunctionEntity get preserveLibraryNamesMarker =>
1427 _map.toBackendMember(_commonElements.preserveLibraryNamesMarker);
1428
1429 @override
1430 FunctionEntity get preserveUrisMarker =>
1431 _map.toBackendMember(_commonElements.preserveUrisMarker);
1432
1433 @override
1434 FunctionEntity get preserveMetadataMarker =>
1435 _map.toBackendMember(_commonElements.preserveMetadataMarker);
1436
1437 @override
1438 FunctionEntity get preserveNamesMarker =>
1439 _map.toBackendMember(_commonElements.preserveNamesMarker);
1440
1441 @override
1442 FunctionEntity get disableTreeShakingMarker =>
1443 _map.toBackendMember(_commonElements.disableTreeShakingMarker);
1444
1445 @override
1446 ConstructorEntity get streamIteratorConstructor =>
1447 _map.toBackendMember(_commonElements.streamIteratorConstructor);
1448
1449 @override
1450 ConstructorEntity get asyncStarControllerConstructor =>
1451 _map.toBackendMember(_commonElements.asyncStarControllerConstructor);
1452
1453 @override
1454 ClassEntity get asyncStarController =>
1455 _map.toBackendClass(_commonElements.asyncStarController);
1456
1457 @override
1458 ConstructorEntity get syncCompleterConstructor =>
1459 _map.toBackendMember(_commonElements.syncCompleterConstructor);
1460
1461 @override
1462 ConstructorEntity get syncStarIterableConstructor =>
1463 _map.toBackendMember(_commonElements.syncStarIterableConstructor);
1464
1465 @override
1466 ClassEntity get controllerStream =>
1467 _map.toBackendClass(_commonElements.controllerStream);
1468
1469 @override
1470 ClassEntity get futureImplementation =>
1471 _map.toBackendClass(_commonElements.futureImplementation);
1472
1473 @override
1474 ClassEntity get syncStarIterable =>
1475 _map.toBackendClass(_commonElements.syncStarIterable);
1476
1477 @override
1478 FunctionEntity get endOfIteration =>
1479 _map.toBackendMember(_commonElements.endOfIteration);
1480
1481 @override
1482 FunctionEntity get streamOfController =>
1483 _map.toBackendMember(_commonElements.streamOfController);
1484
1485 @override
1486 FunctionEntity get asyncStarHelper =>
1487 _map.toBackendMember(_commonElements.asyncStarHelper);
1488
1489 @override
1490 FunctionEntity get syncStarUncaughtError =>
1491 _map.toBackendMember(_commonElements.syncStarUncaughtError);
1492
1493 @override
1494 FunctionEntity get yieldSingle =>
1495 _map.toBackendMember(_commonElements.yieldSingle);
1496
1497 @override
1498 FunctionEntity get yieldStar =>
1499 _map.toBackendMember(_commonElements.yieldStar);
1500
1501 @override
1502 FunctionEntity get wrapBody => _map.toBackendMember(_commonElements.wrapBody);
1503
1504 @override
1505 FunctionEntity get asyncHelperAwait =>
1506 _map.toBackendMember(_commonElements.asyncHelperAwait);
1507
1508 @override
1509 FunctionEntity get asyncHelperRethrow =>
1510 _map.toBackendMember(_commonElements.asyncHelperRethrow);
1511
1512 @override
1513 FunctionEntity get asyncHelperReturn =>
1514 _map.toBackendMember(_commonElements.asyncHelperReturn);
1515
1516 @override
1517 FunctionEntity get asyncHelperStart =>
1518 _map.toBackendMember(_commonElements.asyncHelperStart);
1519
1520 @override
1521 bool isDefaultNoSuchMethodImplementation(FunctionEntity element) {
1522 return _commonElements
1523 .isDefaultNoSuchMethodImplementation(_map.toFrontendMember(element));
1524 }
1525
1526 @override
1527 FunctionEntity get objectNoSuchMethod =>
1528 _map.toBackendMember(_commonElements.objectNoSuchMethod);
1529
1530 @override
1531 FunctionEntity get mapLiteralUntypedEmptyMaker =>
1532 _map.toBackendMember(_commonElements.mapLiteralUntypedEmptyMaker);
1533
1534 @override
1535 FunctionEntity get mapLiteralUntypedMaker =>
1536 _map.toBackendMember(_commonElements.mapLiteralUntypedMaker);
1537
1538 @override
1539 ConstructorEntity get mapLiteralConstructorEmpty =>
1540 _map.toBackendMember(_commonElements.mapLiteralConstructorEmpty);
1541
1542 @override
1543 ConstructorEntity get mapLiteralConstructor =>
1544 _map.toBackendMember(_commonElements.mapLiteralConstructor);
1545
1546 @override
1547 ClassEntity get mapLiteralClass =>
1548 _map.toBackendClass(_commonElements.mapLiteralClass);
1549
1550 @override
1551 FunctionEntity get objectEquals =>
1552 _map.toBackendMember(_commonElements.objectEquals);
1553
1554 @override
1555 FunctionEntity get unresolvedTopLevelMethodError =>
1556 _map.toBackendMember(_commonElements.unresolvedTopLevelMethodError);
1557
1558 @override
1559 FunctionEntity get unresolvedTopLevelSetterError =>
1560 _map.toBackendMember(_commonElements.unresolvedTopLevelSetterError);
1561
1562 @override
1563 FunctionEntity get unresolvedTopLevelGetterError =>
1564 _map.toBackendMember(_commonElements.unresolvedTopLevelGetterError);
1565
1566 @override
1567 FunctionEntity get unresolvedStaticMethodError =>
1568 _map.toBackendMember(_commonElements.unresolvedStaticMethodError);
1569
1570 @override
1571 FunctionEntity get unresolvedStaticSetterError =>
1572 _map.toBackendMember(_commonElements.unresolvedStaticSetterError);
1573
1574 @override
1575 FunctionEntity get unresolvedStaticGetterError =>
1576 _map.toBackendMember(_commonElements.unresolvedStaticGetterError);
1577
1578 @override
1579 FunctionEntity get unresolvedConstructorError =>
1580 _map.toBackendMember(_commonElements.unresolvedConstructorError);
1581
1582 @override
1583 FunctionEntity get genericNoSuchMethod =>
1584 _map.toBackendMember(_commonElements.genericNoSuchMethod);
1585
1586 @override
1587 FunctionEntity get malformedTypeError =>
1588 _map.toBackendMember(_commonElements.malformedTypeError);
1589
1590 @override
1591 bool isDefaultEqualityImplementation(MemberEntity element) {
1592 return _commonElements
1593 .isDefaultEqualityImplementation(_map.toFrontendMember(element));
1594 }
1595
1596 @override
1597 InterfaceType get symbolImplementationType {
1598 return _map.toBackendType(_commonElements.symbolImplementationType);
1599 }
1600
1601 @override
1602 FieldEntity get symbolField =>
1603 _map.toBackendMember(_commonElements.symbolField);
1604
1605 @override
1606 InterfaceType getConstantMapTypeFor(InterfaceType sourceType,
1607 {bool hasProtoKey: false, bool onlyStringKeys: false}) {
1608 return _map.toBackendType(_commonElements.getConstantMapTypeFor(
1609 _map.toFrontendType(sourceType),
1610 hasProtoKey: hasProtoKey,
1611 onlyStringKeys: onlyStringKeys));
1612 }
1613
1614 @override
1615 bool isListSupertype(ClassEntity element) {
1616 return _commonElements.isListSupertype(_map.toFrontendClass(element));
1617 }
1618
1619 @override
1620 bool isStringOnlySupertype(ClassEntity element) {
1621 return _commonElements.isStringOnlySupertype(_map.toFrontendClass(element));
1622 }
1623
1624 @override
1625 bool isNumberOrStringSupertype(ClassEntity element) {
1626 return _commonElements
1627 .isNumberOrStringSupertype(_map.toFrontendClass(element));
1628 }
1629
1630 @override
1631 InterfaceType streamType([DartType elementType]) {
1632 return _map.toBackendType(
1633 _commonElements.streamType(_map.toFrontendType(elementType)));
1634 }
1635
1636 @override
1637 InterfaceType futureType([DartType elementType]) {
1638 return _map.toBackendType(
1639 _commonElements.futureType(_map.toFrontendType(elementType)));
1640 }
1641
1642 @override
1643 InterfaceType iterableType([DartType elementType]) {
1644 return _map.toBackendType(
1645 _commonElements.iterableType(_map.toFrontendType(elementType)));
1646 }
1647
1648 @override
1649 InterfaceType mapType([DartType keyType, DartType valueType]) {
1650 return _map.toBackendType(_commonElements.mapType(
1651 _map.toFrontendType(keyType), _map.toFrontendType(valueType)));
1652 }
1653
1654 @override
1655 InterfaceType listType([DartType elementType]) {
1656 return _map.toBackendType(
1657 _commonElements.listType(_map.toFrontendType(elementType)));
1658 }
1659
1660 @override
1661 InterfaceType get stackTraceType =>
1662 _map.toBackendType(_commonElements.stackTraceType);
1663
1664 @override
1665 InterfaceType get typeLiteralType =>
1666 _map.toBackendType(_commonElements.typeLiteralType);
1667
1668 @override
1669 InterfaceType get typeType => _map.toBackendType(_commonElements.typeType);
1670
1671 @override
1672 InterfaceType get nullType => _map.toBackendType(_commonElements.nullType);
1673
1674 @override
1675 InterfaceType get functionType =>
1676 _map.toBackendType(_commonElements.functionType);
1677
1678 @override
1679 InterfaceType get symbolType =>
1680 _map.toBackendType(_commonElements.symbolType);
1681
1682 @override
1683 InterfaceType get stringType =>
1684 _map.toBackendType(_commonElements.stringType);
1685
1686 @override
1687 InterfaceType get resourceType =>
1688 _map.toBackendType(_commonElements.resourceType);
1689
1690 @override
1691 InterfaceType get doubleType =>
1692 _map.toBackendType(_commonElements.doubleType);
1693
1694 @override
1695 InterfaceType get intType => _map.toBackendType(_commonElements.intType);
1696
1697 @override
1698 InterfaceType get numType => _map.toBackendType(_commonElements.numType);
1699
1700 @override
1701 InterfaceType get boolType => _map.toBackendType(_commonElements.boolType);
1702
1703 @override
1704 InterfaceType get objectType =>
1705 _map.toBackendType(_commonElements.objectType);
1706
1707 @override
1708 DynamicType get dynamicType =>
1709 _map.toBackendType(_commonElements.dynamicType);
1710
1711 @override
1712 bool isFilledListConstructor(ConstructorEntity element) {
1713 return _commonElements
1714 .isFilledListConstructor(_map.toFrontendMember(element));
1715 }
1716
1717 @override
1718 bool isUnnamedListConstructor(ConstructorEntity element) {
1719 return _commonElements
1720 .isUnnamedListConstructor(_map.toFrontendMember(element));
1721 }
1722
1723 @override
1724 bool isFunctionApplyMethod(MemberEntity element) {
1725 return _commonElements
1726 .isFunctionApplyMethod(_map.toFrontendMember(element));
1727 }
1728
1729 @override
1730 FunctionEntity get functionApplyMethod =>
1731 _map.toBackendMember(_commonElements.functionApplyMethod);
1732
1733 @override
1734 FunctionEntity get identicalFunction =>
1735 _map.toBackendMember(_commonElements.identicalFunction);
1736
1737 @override
1738 ClassEntity get deferredLibraryClass =>
1739 _map.toBackendClass(_commonElements.deferredLibraryClass);
1740
1741 @override
1742 bool isMirrorsUsedConstructor(ConstructorEntity element) {
1743 return _commonElements
1744 .isMirrorsUsedConstructor(_map.toFrontendMember(element));
1745 }
1746
1747 @override
1748 ClassEntity get mirrorsUsedClass =>
1749 _map.toBackendClass(_commonElements.mirrorsUsedClass);
1750
1751 @override
1752 bool isMirrorSystemGetNameFunction(MemberEntity element) {
1753 return _commonElements
1754 .isMirrorSystemGetNameFunction(_map.toFrontendMember(element));
1755 }
1756
1757 @override
1758 ClassEntity get mirrorSystemClass =>
1759 _map.toBackendClass(_commonElements.mirrorSystemClass);
1760
1761 @override
1762 bool isSymbolConstructor(ConstructorEntity element) {
1763 return _commonElements.isSymbolConstructor(_map.toFrontendMember(element));
1764 }
1765
1766 @override
1767 ConstructorEntity get symbolConstructorTarget =>
1768 _map.toBackendMember(_commonElements.symbolConstructorTarget);
1769
1770 @override
1771 ClassEntity get typedDataClass =>
1772 _map.toBackendClass(_commonElements.typedDataClass);
1773
1774 @override
1775 LibraryEntity get internalLibrary =>
1776 _map.toBackendLibrary(_commonElements.internalLibrary);
1777
1778 @override
1779 LibraryEntity get isolateHelperLibrary =>
1780 _map.toBackendLibrary(_commonElements.isolateHelperLibrary);
1781
1782 @override
1783 LibraryEntity get foreignLibrary =>
1784 _map.toBackendLibrary(_commonElements.foreignLibrary);
1785
1786 @override
1787 LibraryEntity get interceptorsLibrary =>
1788 _map.toBackendLibrary(_commonElements.interceptorsLibrary);
1789
1790 @override
1791 LibraryEntity get jsHelperLibrary =>
1792 _map.toBackendLibrary(_commonElements.jsHelperLibrary);
1793
1794 @override
1795 LibraryEntity get typedDataLibrary =>
1796 _map.toBackendLibrary(_commonElements.typedDataLibrary);
1797
1798 @override
1799 LibraryEntity get mirrorsLibrary =>
1800 _map.toBackendLibrary(_commonElements.mirrorsLibrary);
1801
1802 @override
1803 LibraryEntity get asyncLibrary =>
1804 _map.toBackendLibrary(_commonElements.asyncLibrary);
1805
1806 @override
1807 LibraryEntity get coreLibrary =>
1808 _map.toBackendLibrary(_commonElements.coreLibrary);
1809
1810 @override
1811 ClassEntity get streamClass =>
1812 _map.toBackendClass(_commonElements.streamClass);
1813
1814 @override
1815 ClassEntity get futureClass =>
1816 _map.toBackendClass(_commonElements.futureClass);
1817
1818 @override
1819 ClassEntity get iterableClass =>
1820 _map.toBackendClass(_commonElements.iterableClass);
1821
1822 @override
1823 ClassEntity get mapClass => _map.toBackendClass(_commonElements.mapClass);
1824
1825 @override
1826 ClassEntity get listClass => _map.toBackendClass(_commonElements.listClass);
1827
1828 @override
1829 ClassEntity get stackTraceClass =>
1830 _map.toBackendClass(_commonElements.stackTraceClass);
1831
1832 @override
1833 ClassEntity get typeClass => _map.toBackendClass(_commonElements.typeClass);
1834
1835 @override
1836 ClassEntity get nullClass => _map.toBackendClass(_commonElements.nullClass);
1837
1838 @override
1839 ClassEntity get symbolClass =>
1840 _map.toBackendClass(_commonElements.symbolClass);
1841
1842 @override
1843 ClassEntity get resourceClass =>
1844 _map.toBackendClass(_commonElements.resourceClass);
1845
1846 @override
1847 ClassEntity get functionClass =>
1848 _map.toBackendClass(_commonElements.functionClass);
1849
1850 @override
1851 ClassEntity get stringClass =>
1852 _map.toBackendClass(_commonElements.stringClass);
1853
1854 @override
1855 ClassEntity get doubleClass =>
1856 _map.toBackendClass(_commonElements.doubleClass);
1857
1858 @override
1859 ClassEntity get intClass => _map.toBackendClass(_commonElements.intClass);
1860
1861 @override
1862 ClassEntity get numClass => _map.toBackendClass(_commonElements.numClass);
1863
1864 @override
1865 ClassEntity get boolClass => _map.toBackendClass(_commonElements.boolClass);
1866
1867 @override
1868 FunctionEntity get throwUnsupportedError =>
1869 _map.toBackendMember(_commonElements.throwUnsupportedError);
1870 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/startup_emitter/emitter.dart ('k') | pkg/compiler/lib/src/js_model/js_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698