[9] RFR (XXS): 8058309: Unsafe.defineAnonymousClass deoptimization checks scale devastatingly poorly

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Wed Sep 17 15:02:40 UTC 2014


j.l.i.LambdaForm class has ~50-100 dependent nmethods on average. For 
every compiled LF, Unsafe.defineAnonymousClass() should validate all 
dependencies on parent class. Since thousands of LFs are compiled, VM 
wastes considerable amount of time re-validating dependencies. Most of 
the dependencies on j.l.i.LambdaForm are of type unique_concrete_method 
and can't be invalidated with the code generated for LFs.

The fix is to decouple compiled LambdaForms and j.l.i.LambdaForm class 
and use j.l.Object as a parent class instead. Since LambdaForm is 
already used as a host class, all access checks pass.

Reviewed-by: vlivanov, jrose, ?
Contributed-by: aleksey.shipilev at oracle.com

Testing: jck (api/java_lang/invoke), jdk/java/lang/invoke, 
jdk/java/util/streams w/ "-ea -esa" and COMPILE_THRESHOLD={0,30},

Aleksey refers to performance analysis in the bug [1].


Best regards,
Vladimir Ivanov

[1] http://cr.openjdk.java.net/~shade/8058309/usdacdependency.txt

More information about the core-libs-dev mailing list