JDK-8059877 : GWT branch frequencies pollution due to LF sharing
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
JEP-210 significantly improved sharing of LambdaForm instances.
The downside is regressions in peak performance on Octane/Nashorn due to branch frequencies pollution in GWT combinators.
Type profile pollution is tracked by JDK-8059879.
noreg-perf: fixes part of performance regressions on Octane benchmark
Java-only solution (a la CountedMethodHandle): http://cr.openjdk.java.net/~vlivanov/profiling/counting_wrapper.jdk.patch
Prototype for (1)+(2): http://cr.openjdk.java.net/~vlivanov/profiling/
3 hooks from VM are necessary: inOptimizer(), deoptimize() & getHistoricInt().
It could be fixed by some sort of profiling on method handle level:
(1) wrap target & fallback method handles into special reinvokers, which track how many times their target was invoked; then decide whether inline or not based on these counts;
(2) this information could be fed into optimizing JIT compiler (C2) to provide more accurate information than bytecode profile has.