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

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

Issue 2967933002: Bring js_model/model_test on par with compile_from_dill tests. (Closed)
Patch Set: 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.kernel.element_map; 5 library dart2js.kernel.element_map;
6 6
7 import 'package:kernel/ast.dart' as ir; 7 import 'package:kernel/ast.dart' as ir;
8 8
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/names.dart' show Identifiers; 10 import '../common/names.dart' show Identifiers;
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 return data.rawType; 406 return data.rawType;
407 } 407 }
408 408
409 FunctionType _getFunctionType(IndexedFunction function) { 409 FunctionType _getFunctionType(IndexedFunction function) {
410 FunctionData data = _memberData[function.memberIndex]; 410 FunctionData data = _memberData[function.memberIndex];
411 return data.getFunctionType(this); 411 return data.getFunctionType(this);
412 } 412 }
413 413
414 ClassEntity _getAppliedMixin(IndexedClass cls) { 414 ClassEntity _getAppliedMixin(IndexedClass cls) {
415 ClassData data = _classData[cls.classIndex]; 415 ClassData data = _classData[cls.classIndex];
416 _ensureThisAndRawType(cls, data); 416 _ensureSupertypes(cls, data);
417 return data.mixedInType?.element; 417 return data.mixedInType?.element;
418 } 418 }
419 419
420 bool _isMixinApplication(IndexedClass cls) { 420 bool _isMixinApplication(IndexedClass cls) {
421 ClassData data = _classData[cls.classIndex]; 421 ClassData data = _classData[cls.classIndex];
422 _ensureThisAndRawType(cls, data); 422 _ensureSupertypes(cls, data);
423 return data.isMixinApplication; 423 return data.isMixinApplication;
424 } 424 }
425 425
426 bool _isUnnamedMixinApplication(IndexedClass cls) { 426 bool _isUnnamedMixinApplication(IndexedClass cls) {
427 ClassEnv env = _classEnvs[cls.classIndex]; 427 ClassEnv env = _classEnvs[cls.classIndex];
428 return env.isUnnamedMixinApplication; 428 return env.isUnnamedMixinApplication;
429 } 429 }
430 430
431 void _forEachSupertype(IndexedClass cls, void f(InterfaceType supertype)) { 431 void _forEachSupertype(IndexedClass cls, void f(InterfaceType supertype)) {
432 ClassData data = _classData[cls.classIndex]; 432 ClassData data = _classData[cls.classIndex];
433 _ensureThisAndRawType(cls, data); 433 _ensureSupertypes(cls, data);
434 data.orderedTypeSet.supertypes.forEach(f); 434 data.orderedTypeSet.supertypes.forEach(f);
435 } 435 }
436 436
437 void _forEachMixin(IndexedClass cls, void f(ClassEntity mixin)) { 437 void _forEachMixin(IndexedClass cls, void f(ClassEntity mixin)) {
438 while (cls != null) { 438 while (cls != null) {
439 ClassData data = _classData[cls.classIndex]; 439 ClassData data = _classData[cls.classIndex];
440 _ensureThisAndRawType(cls, data); 440 _ensureSupertypes(cls, data);
441 if (data.mixedInType != null) { 441 if (data.mixedInType != null) {
442 f(data.mixedInType.element); 442 f(data.mixedInType.element);
443 } 443 }
444 cls = data.supertype?.element; 444 cls = data.supertype?.element;
445 } 445 }
446 } 446 }
447 447
448 void _forEachConstructor(IndexedClass cls, void f(ConstructorEntity member)) { 448 void _forEachConstructor(IndexedClass cls, void f(ConstructorEntity member)) {
449 ClassEnv env = _classEnvs[cls.classIndex]; 449 ClassEnv env = _classEnvs[cls.classIndex];
450 env.forEachConstructor((ir.Member member) { 450 env.forEachConstructor((ir.Member member) {
(...skipping 29 matching lines...) Expand all
480 InterfaceType supertype = 480 InterfaceType supertype =
481 orderedTypeSet.asInstanceOf(cls, _getHierarchyDepth(cls)); 481 orderedTypeSet.asInstanceOf(cls, _getHierarchyDepth(cls));
482 if (supertype != null) { 482 if (supertype != null) {
483 supertype = _substByContext(supertype, type); 483 supertype = _substByContext(supertype, type);
484 } 484 }
485 return supertype; 485 return supertype;
486 } 486 }
487 487
488 OrderedTypeSet _getOrderedTypeSet(IndexedClass cls) { 488 OrderedTypeSet _getOrderedTypeSet(IndexedClass cls) {
489 ClassData data = _classData[cls.classIndex]; 489 ClassData data = _classData[cls.classIndex];
490 _ensureThisAndRawType(cls, data); 490 _ensureSupertypes(cls, data);
491 return data.orderedTypeSet; 491 return data.orderedTypeSet;
492 } 492 }
493 493
494 int _getHierarchyDepth(IndexedClass cls) { 494 int _getHierarchyDepth(IndexedClass cls) {
495 ClassData data = _classData[cls.classIndex]; 495 ClassData data = _classData[cls.classIndex];
496 _ensureThisAndRawType(cls, data); 496 _ensureSupertypes(cls, data);
497 return data.orderedTypeSet.maxDepth; 497 return data.orderedTypeSet.maxDepth;
498 } 498 }
499 499
500 Iterable<InterfaceType> _getInterfaces(IndexedClass cls) { 500 Iterable<InterfaceType> _getInterfaces(IndexedClass cls) {
501 ClassData data = _classData[cls.classIndex]; 501 ClassData data = _classData[cls.classIndex];
502 _ensureThisAndRawType(cls, data); 502 _ensureSupertypes(cls, data);
503 return data.interfaces; 503 return data.interfaces;
504 } 504 }
505 505
506 Spannable _getSpannable(MemberEntity member, ir.Node node) { 506 Spannable _getSpannable(MemberEntity member, ir.Node node) {
507 return member; 507 return member;
508 } 508 }
509 509
510 ir.Member _getMemberNode(covariant IndexedMember member) { 510 ir.Member _getMemberNode(covariant IndexedMember member) {
511 return _memberData[member.memberIndex].node; 511 return _memberData[member.memberIndex].node;
512 } 512 }
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after
1541 final KernelToElementMapForImpactImpl elementMap; 1541 final KernelToElementMapForImpactImpl elementMap;
1542 1542
1543 KernelClosedWorld(this.elementMap, 1543 KernelClosedWorld(this.elementMap,
1544 {ElementEnvironment elementEnvironment, 1544 {ElementEnvironment elementEnvironment,
1545 DartTypes dartTypes, 1545 DartTypes dartTypes,
1546 CommonElements commonElements, 1546 CommonElements commonElements,
1547 ConstantSystem constantSystem, 1547 ConstantSystem constantSystem,
1548 NativeData nativeData, 1548 NativeData nativeData,
1549 InterceptorData interceptorData, 1549 InterceptorData interceptorData,
1550 BackendUsage backendUsage, 1550 BackendUsage backendUsage,
1551 ResolutionWorldBuilder resolutionWorldBuilder,
1552 Set<ClassEntity> implementedClasses, 1551 Set<ClassEntity> implementedClasses,
1553 Iterable<MemberEntity> liveInstanceMembers, 1552 Iterable<MemberEntity> liveInstanceMembers,
1553 Iterable<MemberEntity> assignedInstanceMembers,
1554 Set<TypedefElement> allTypedefs, 1554 Set<TypedefElement> allTypedefs,
1555 Map<ClassEntity, Set<ClassEntity>> mixinUses, 1555 Map<ClassEntity, Set<ClassEntity>> mixinUses,
1556 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses, 1556 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses,
1557 Map<ClassEntity, ClassHierarchyNode> classHierarchyNodes, 1557 Map<ClassEntity, ClassHierarchyNode> classHierarchyNodes,
1558 Map<ClassEntity, ClassSet> classSets}) 1558 Map<ClassEntity, ClassSet> classSets})
1559 : super( 1559 : super(
1560 elementEnvironment, 1560 elementEnvironment,
1561 dartTypes, 1561 dartTypes,
1562 commonElements, 1562 commonElements,
1563 constantSystem, 1563 constantSystem,
1564 nativeData, 1564 nativeData,
1565 interceptorData, 1565 interceptorData,
1566 backendUsage, 1566 backendUsage,
1567 resolutionWorldBuilder,
1568 implementedClasses, 1567 implementedClasses,
1569 liveInstanceMembers, 1568 liveInstanceMembers,
1569 assignedInstanceMembers,
1570 allTypedefs, 1570 allTypedefs,
1571 mixinUses, 1571 mixinUses,
1572 typesImplementedBySubclasses, 1572 typesImplementedBySubclasses,
1573 classHierarchyNodes, 1573 classHierarchyNodes,
1574 classSets); 1574 classSets);
1575 1575
1576 @override 1576 @override
1577 void registerClosureClass(ClassElement cls) { 1577 void registerClosureClass(ClassElement cls) {
1578 throw new UnimplementedError('KernelClosedWorld.registerClosureClass'); 1578 throw new UnimplementedError('KernelClosedWorld.registerClosureClass');
1579 } 1579 }
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1816 @override 1816 @override
1817 ir.Member getMemberNode(MemberEntity member) { 1817 ir.Member getMemberNode(MemberEntity member) {
1818 return _getMemberNode(member); 1818 return _getMemberNode(member);
1819 } 1819 }
1820 1820
1821 @override 1821 @override
1822 ir.Class getClassNode(ClassEntity cls) { 1822 ir.Class getClassNode(ClassEntity cls) {
1823 return _getClassNode(cls); 1823 return _getClassNode(cls);
1824 } 1824 }
1825 } 1825 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698