RFR: 8329748: Change default value of AssertWXAtThreadSync to true

Tobias Holenstein tholenstein at openjdk.org
Wed May 8 10:44:52 UTC 2024


On Mon, 6 May 2024 21:53:18 GMT, Dean Long <dlong at openjdk.org> wrote:

>> src/hotspot/share/jfr/support/jfrIntrinsics.cpp line 77:
>> 
>>> 75: void* JfrIntrinsicSupport::return_lease(JavaThread* jt) {
>>> 76:   DEBUG_ONLY(assert_precondition(jt);)
>>> 77:   MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, jt));
>> 
>> It seems like this could be moved down.  It doesn't seem to be needed for the Java --> native transition.  Is it needed for the JfrJavaEventWriter::flush() call?
>
> If it is only needed for the native --> Java transition below, why don't we do it lazily?  The interpreter and compilers already do this by calling check_special_condition_for_native_trans() only if a safepoint is detected.
> Normally we would want to be in the WXExec state when executing in _thread_in_native.

`WXWrite` is needed for 


JfrIntrinsicSupport::return_lease ->
ThreadStateTransition::transition_from_native ->
SafepointMechanism::process_if_requested_with_exit_check ->
SafepointMechanism::process_if_requested ->
JavaThread::check_possible_safepoint ->
assert_wx_state(WXWrite)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19102#discussion_r1593825099


More information about the hotspot-dev mailing list