RFR: 8265327: Remove check_safepoint_and_suspend_for_native_trans() [v2]
David Holmes
dholmes at openjdk.java.net
Wed Apr 21 06:11:18 UTC 2021
On Tue, 20 Apr 2021 17:02:11 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:
>> IMHO it is straight forward to check for multiple bits using a mask.
>> I like that this improves fast paths e.g. of JNI calls.
>
> With Robbin's change is_external_suspend() will be gone since that check would be already embedded in the poll check. But because _suspend_flags is declared volatile the compilers will still generate two different checks for is_trace_suspend() || is_obj_deopt_suspend() instead of doing just one (checked that with gcc 10.2 and clang 12; without volatile only one check is made). After Robbin's change that line would become (_suspend_flags & (_obj_deopt JFR_ONLY(| _trace_flag))) != 0. I also would prefer this instead of having to jump to a different method but I don't mind encapsulating them.
I can live with it, but I highly doubt this has any observable affect on performance - especially taking into consideration the other code path changes that have been introduced in this change.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3548
More information about the hotspot-runtime-dev
mailing list