[13] RFR (M): 8223216: C2: Unify class initialization checks between new, getstatic, and putstatic

dean.long at oracle.com dean.long at oracle.com
Fri May 3 17:54:09 UTC 2019


I like the refactoring.

Do you want to have a Runtime reviewer take a look at the new logic?

Can you explain why Parse::clinit_deopt() changed from testing for

InstanceKlass::fully_initialized

to testing for

InstanceKlass::being_initialized

instead?  How do we know we it is the initializing thread?

dl

On 5/1/19 4:37 PM, Vladimir Ivanov wrote:
> http://cr.openjdk.java.net/~vlivanov/8223216/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8223216
>
> (The patch has minor dependencies on 8223213 [1] I sent out for review 
> earlier.)
>
> C2 implements class initialization checks for new and 
> getstatic/putstatic differently: while "new" supports fast class 
> initialization checks, static field accesses rely on uncommon traps 
> which may lead to deoptimization/recompilation storms during 
> long-running class initialisation.
>
> Proposed patch unifies implementation between them and uses the 
> following barrier:
>    if (holder->is_initialized()) {
>      uncommon_trap(initialized, reinterpret);
>    }
>    if (!holder->is_reentrant_initialization(current_thread)) {
>      uncommon_trap(uninitialized, none);
>    }
>
> It also enhances checks for not-yet-initialized classes 
> (Compile::needs_clinit_barrier) and unifies the implementation between 
> new, invokestatic, and getfield/putfield.
>
> Testing: tier1-5, targeted microbenchmarks, new test from 8223213
>
> Thanks!
>
> Best regards,
> Vladimir Ivanov
>
> [1] http://cr.openjdk.java.net/~vlivanov/8223213/webrev.00/
>     https://bugs.openjdk.java.net/browse/JDK-8223213
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20190503/2544ad89/attachment-0001.html>


More information about the hotspot-compiler-dev mailing list