RFR: 8358821: patch_verified_entry causes problems, use nmethod entry barriers instead [v9]
Martin Doerr
mdoerr at openjdk.org
Wed Jun 25 14:51:33 UTC 2025
On Wed, 25 Jun 2025 09:56:52 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
>> src/hotspot/share/gc/shared/barrierSetNMethod.hpp line 52:
>>
>>> 50:
>>> 51: public:
>>> 52: BarrierSetNMethod() : _current_phase(initial) {}
>>
>> @fisk: The initial value doesn't match our initialization in the nmethod entry barrier code were we use 0. That causes all new nmethods to run through the barrier code when they are called for the first time. I think that is unnecessary and it slows down the startup a bit. All oops should already be correct after the nmethod got installed. And for ZGC, we call `nmethod_patch_barriers` in `ZNMethod::register_nmethod`. So, I don't see any need to execute the barrier code. We could change the initialization to use `_current_phase`. Do you agree? Should I file a new JBS issue?
>
> In other words, I think `disarm(nm);` is missing for some GCs. ZGC has it in `ZNMethod::register_nmethod`.
I've filed https://bugs.openjdk.org/browse/JDK-8360540. We don't need to discuss it here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25764#discussion_r2166924488
More information about the hotspot-dev
mailing list