RFR (S): 8024616: JSR292: lazily initialize core NamedFunctions used for bootstrapping
vladimir.x.ivanov at oracle.com
Wed Sep 11 04:24:14 PDT 2013
75 lines changed: 14 ins; 2 del; 59 mod
A small set of NamedFunctions is pre-initialized to allow JSR292
bootstrapping. After 8022595, which enabled JSR292 initialization during
VM startup, they are instantiated even when JSR292 isn't used.
It leads to unnecessary work being done and a regression in startup time
(~20-25ms for HelloWorld application on my laptop). The major
contribution to this time is bytecode compilation of LF's for
The fix is to factor NamedFunctions used for bootstrapping into an inner
class to delay initialization till the first usage.
After the fix, JSR292 pre-init duration goes down to 2-3ms (from 25ms)
and no anonymous classes are produced, if JSR292 isn't used in the
Testing: concurrent loading & init order tests for java.lang.invoke,
JSR292 tests, octane.
More information about the hotspot-compiler-dev