Loading... (original) (raw)

Similarly to

JDK-8198418

, we can avoid some early LF creation in various benchmarks by adapting calls to the altMetafactory as exactly as possible in the BootstrapMethodInvoker.

As a test case, the following program loads and generates 29 fewer classes with a patch to invoke the altMetafactory BSM exactly:

public class ComparingInt {

public static void main(String ... args) {
java.util.Arrays.sort(args, java.util.Comparator.comparingInt(s -> s.hashCode()));
}
}