@@ -43,25 +43,6 @@ part 'type_mask.dart';
4343part 'union_type_mask.dart' ;
4444part 'value_type_mask.dart' ;
4545
46- // TODO(60419): Go back to using a record as the key when it is no longer slower
47- // than using a data class.
48- final class _CanonicalizedTypeMaskKey {
49- final ClassEntity ? _base;
50- final _Flags _flags;
51-
52- const _CanonicalizedTypeMaskKey (this ._base, this ._flags);
53-
54- @override
55- int get hashCode => Object .hash (_base, _flags);
56-
57- @override
58- bool operator == (Object other) =>
59- identical (this , other) ||
60- other is _CanonicalizedTypeMaskKey &&
61- _base == other._base &&
62- _flags == other._flags;
63- }
64-
6546class CommonMasks with AbstractValueDomain {
6647 // TODO(sigmund): once we split out the backend common elements, depend
6748 // directly on those instead.
@@ -75,19 +56,15 @@ class CommonMasks with AbstractValueDomain {
7556
7657 final Map <TypeMask , Map <TypeMask , TypeMask >> _intersectionCache = {};
7758
78- final Map <_CanonicalizedTypeMaskKey , FlatTypeMask > _canonicalizedTypeMasks =
79- {};
59+ final Map <(ClassEntity ?, _Flags ), FlatTypeMask > _canonicalizedTypeMasks = {};
8060
8161 /// Return the cached mask for [base] with the given flags, or calls
8262 /// [createMask] to create the mask and cache it.
8363 FlatTypeMask _getCachedMask (
8464 ClassEntity ? base ,
8565 _Flags flags,
8666 FlatTypeMask Function () createMask,
87- ) => _canonicalizedTypeMasks.putIfAbsent (
88- _CanonicalizedTypeMaskKey (base , flags),
89- createMask,
90- );
67+ ) => _canonicalizedTypeMasks.putIfAbsent ((base , flags), createMask);
9168
9269 @override
9370 late final TypeMask internalTopType = TypeMask .subclass (
0 commit comments