ArrayList.addAll() contains a semi-workaround for the megamorphic poisoning described on JDK-8368292 : it makes one virtual call to Collection.toArray(). Production profiling shows that further improvements are possible:
1. ArrayList.toArray() creates a defensive copy of the existing array, which is unnecessary inside the method.
2. Collections$SingletonSet falls back to AbstractCollection.toArray(), which is vulnerable to the exact megamorphic poisoning described in the other ticket.
Minor code changes will address #1 via a fast-path specific to ArrayList, and #2 via a type-specific override of toArray(), Collections$SingletonSet.toArray().
It is possible to enhance other instances of *.toArray(), but my available profiling data only supports these changes.