[13] RFR (S): 8188133: C2: Static field accesses in clinit can trigger deoptimizations
Vladimir Ivanov
vladimir.x.ivanov at oracle.com
Thu Jan 31 19:29:59 UTC 2019
http://cr.openjdk.java.net/~vlivanov/8188133/webrev.00
https://bugs.openjdk.java.net/browse/JDK-8188133
The test case in the bug demonstrates a pathological case with
long-running static initializer: though it's allowed to access static
fields from the thread performing the initialization, C2 can't prove
that in general.
While solving the general problem doesn't seem worth the effort
(requires barriers on method entries), I propose to extend the logic to
cover simple cases: when static initializer is the root of the
compilation, all accesses to static fields of the corresponding class
are allowed. It extends the coverage to all inlinees from OSR
compilation of clinit.
Testing: hs-precheckin-comp, tier1-5
Best regards,
Vladimir Ivanov
More information about the hotspot-compiler-dev
mailing list