RFR: 8357782: JVM JIT Causes Static Initialization Order Issue

Damon Fenacci dfenacci at openjdk.org
Thu Jun 12 07:08:33 UTC 2025


On Thu, 12 Jun 2025 06:54:32 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> src/hotspot/share/ci/ciInstanceKlass.cpp line 553:
>> 
>>> 551: 
>>> 552: bool ciInstanceKlass::has_class_initializer() {
>>> 553:   VM_ENTRY_MARK;
>> 
>> Out of curiosity: do we strictly need to add `VM_ENTRY_MARK` here (since it is only called from the compiler) or it is mostly to ensure it is VM-safe if called from "outside'?
>
> But it's needed exactly because we are calling from compiler, right? It will bring the compiler thread into the VM state which is required for accessing instance klass data.

Right! Thanks! I think I was seeing it the other way around.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25725#discussion_r2141879159


More information about the hotspot-compiler-dev mailing list