dart2js: swarm should not contain _LinkedCustomHashMap. #13661
Labels
closed-obsolete
Closed as the reported issue is no longer relevant
type-enhancement
A request for a change that isn't a bug
web-dart2js
swarm at r28020
Every call site in the generated code for LinkedHashMap_LinkedHashMap looks like
LinkedHashMap_LinkedHashMap(null, null, null, <varies>, <varies>);
The code is not specialized, which drags in _LinkedIdentityHashMap and _LinkedCustomHashMap$ which are otherwise unreferenced (this costs only ~2k, but still is unshaken)
LinkedHashMap_LinkedHashMap: function(equals, hashCode, isValidKey, $K, $V) {
var t1;
if (hashCode == null) {
if (equals == null) {
t1 = new P._LinkedHashMap(0, null, null, null, null, null, 0);
H.setRuntimeTypeInfo(t1, [$K, $V]);
return t1;
}
hashCode = P._defaultHashCode$closure;
} else {
if ((P.identityHashCode$closure == null ? hashCode == null : P.identityHashCode$closure === hashCode) && (P.identical$closure == null ? equals == null : P.identical$closure === equals)) {
t1 = new P._LinkedIdentityHashMap(0, null, null, null, null, null, 0);
H.setRuntimeTypeInfo(t1, [$K, $V]);
return t1;
}
if (equals == null)
equals = P._defaultEquals$closure;
}
return P._LinkedCustomHashMap$(equals, hashCode, isValidKey, $K, $V);
},
I could not repro this on a simpler example, and the similarly structured LinkedHashSet is optimized, so type inference on the larger program must be getting confused by something.
The text was updated successfully, but these errors were encountered: