RFR: 8265327: Remove check_safepoint_and_suspend_for_native_trans() [v2]

Patricio Chilano Mateo pchilanomate at openjdk.java.net
Tue Apr 20 17:06:04 UTC 2021


On Tue, 20 Apr 2021 16:01:07 GMT, Richard Reingruber <rrich at openjdk.org> wrote:

>> Unless there is some significant performance issue with the lack of inlining I'd prefer to maintain code readability. And with Robbin's change is the inlining simplified anyway? Otherwise perhaps we should (re-)introduce is_any_suspend() to encapsulate the _suspend_flag checking?
>
> 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.

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

PR: https://git.openjdk.java.net/jdk/pull/3548


More information about the hotspot-runtime-dev mailing list