RFR: 8307532: Implement LM_LIGHTWEIGHT for Zero [v2]
Julian Waters
jwaters at openjdk.org
Tue Oct 1 15:45:39 UTC 2024
On Tue, 1 Oct 2024 13:46:11 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
>> This implements the remaining parts of LW locking in Zero. Much of the work has already been done by Axel, this basically only implements the missing part that handles synchronized JNI entries. I basically preserved the LM_LEGACY case, except that I shuffled the code a little to match what we do in monitorexit case in bytecodeInterpreter.cpp (but should be functionally equivalent). The LM_LIGHTWEIGHT and LM_MONITOR case (the latter of which has been broken, before) simply call into the runtime.
>>
>> With this change, we can now remove the block in arguments.cpp that deals with missing LM_LIGHTWEIGHT support.
>>
>> Testing:
>> - [x] bootcycle-images
>
> Roman Kennke has updated the pull request incrementally with two additional commits since the last revision:
>
> - Don't use monitor cache with Zero
> - Enable object monitor cache for zero
> > > The `LM_LIGHTWEIGHT` changes looks good to me.
> >
> >
> > >
> >
> >
> > > This also enables `UseObjectMonitorTable`. I believe `BasicLock::object_monitor_cache()` must be modified as well. Assuming that both `ZERO` and a supported platform (e.g. `X86`) can and will be defined in the same build.
> >
> >
> > >
> >
> >
> > > `ZERO` should return `nullptr` in `BasicLock::object_monitor_cache()` as well.
> >
> >
> > I might be missing something, but Zero cannot be combined with another VM variant in the configure step, so the risk of a CPU arch being defined at the same time as Zero cannot happen (The build system treats Zero a little strangely)
>
> No, this doesn't seem to be the case. I placed a STATIC_ASSERT in the #if defined ... block and it fired with ZERO. This means that yes, we _do_ get both ZERO and (e.g.) X86 defined at the same time. And it makes sense, too. ZERO is a JVM variant and X86, AARCH64, etc are CPU arches. It is entirely possible and reasonable to build zero JVM on x86 or aarch64.
That is very strange, the build system treats (Or is at least supposed to treat) Zero as a CPU arch. Might be time for me to revisit that code, either I made a mistake, or something is wrong. Thanks for the heads up
-------------
PR Comment: https://git.openjdk.org/jdk/pull/21220#issuecomment-2386364029
More information about the hotspot-dev
mailing list