RFR: 8369296: Add fast class init checks in interpreter for resolving ConstantPool entries for static field [v2]
Ashutosh Mehra
asmehra at openjdk.org
Tue Oct 7 18:25:31 UTC 2025
On Tue, 7 Oct 2025 18:07:09 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
> First, what do you mean "blocks"? It wait something with lock?
> Second, my question was that slow path in clinit_barrier will jump to L_clinit_barrier_slow which is before clinit_barrier there are no branch there so after call_VM we again will call clinit_barrier? what I am missing?
`clinit_barrier` itself doesn't block. Its a quick check for class fully initialized or the current thread is the init thread. If not, then it jumps to the slow path. In this case slow path is the call to `InterpreterRuntime::resolve_from_cache` which may initialize the klass or get blocked if the klass is being initialized by another thread.
After returning it again executes `clinit_barrier`. But this time the class should have initialized, so it just falls through.
Also, I think `clinit_barrier` is not a very accurate name because it doesn't cause initialization of the klass. I think `fast_clinit_check` better conveys what it is doing, but that renaming can be done later if required.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27676#issuecomment-3378062190
More information about the hotspot-dev
mailing list