On Fri, 1 Nov 2024 03:54:24 GMT, Dan Heidinga <heidi...@openjdk.org> wrote:

>> Ioi Lam has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Fixed whitespace; fixed minimal build
>
> src/hotspot/share/cds/aotClassInitializer.cpp line 348:
> 
>> 346:     }
>> 347:     JavaValue result(T_VOID);
>> 348:     JavaCalls::call_static(&result, ik,
> 
> Based on the discussions in JDK-8342283, do we need a memory fence after the 
> call to runtimeSetup?
> 
> I think we do to be consistent with the non-AOTCache run as there is a fence 
> after `<clinit>` (when this code would normally run) due to the 
> initialization lock.

I think this is already done:

`runtimeSetup()` is called inside `InstanceKlass::call_class_initializer()`. 
When that returns, we will proceed to 
`InstanceKlass::set_initialization_state_and_notify()` which will perform the 
memory fencing. 

https://github.com/iklam/jdk/blob/6eebd18fc2820ffb179d431f179fc6af6d1be247/src/hotspot/share/oops/instanceKlass.cpp#L1276-L1300

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21642#discussion_r1827146321

Reply via email to