JDK-8059877 : GWT branch frequencies pollution due to LF sharing
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Affected Version: 8u40,9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-10-07
  • Updated: 2017-08-24
  • Resolved: 2014-10-29
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.

To download the current JDK release, click here.
8u40Fixed 9 b38Fixed
Related Reports
Relates :  
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.