RFR: 8273251: Call check_possible_safepoint() from SafepointMechanism::process_if_requested()
Coleen Phillimore
coleenp at openjdk.java.net
Wed Sep 1 21:59:33 UTC 2021
On Wed, 1 Sep 2021 20:53:46 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:
> Hi,
>
> Please review this small fix to call check_possible_safepoint() from SafepointMechanism::process_if_requested() and remove the same call from transition_and_process(). See the bug description for more detail.
> Since there were only two lines left of common code from transition_from_native() and transition_from_vm() I just removed transition_and_process() altogether. This also saves an unneeded extra transition to _thread_in_vm when transitioning from vm to Java.
>
> Testing tiers 1-6.
>
> Thanks,
> Patricio
Looks good to me!
src/hotspot/share/runtime/interfaceSupport.inline.hpp line 81:
> 79:
> 80: private:
> 81: static inline void transition_and_process(JavaThread *thread, JavaThreadState to, bool check_asyncs) {
src/hotspot/share/runtime/thread.cpp line 959:
> 957: assert_wx_state(WXWrite);
> 958: }
> 959: #endif
I was wondering why you moved this, but it's assert code so it makes sense to me to be with the other assert code. Maybe check_possible_safepoint could have a better name to encompass all these checking and assertions actions but I don't know what better name to give it.
With this code moved here, all the other callers where there's a possible safepoint but one not taken will also check this. Did you test on macosx aarch64 too?
-------------
Marked as reviewed by coleenp (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/5342
More information about the hotspot-runtime-dev
mailing list