RFR: 8329748: Change default value of AssertWXAtThreadSync to true
Tobias Holenstein
tholenstein at openjdk.org
Wed May 8 10:47:56 UTC 2024
On Wed, 8 May 2024 10:42:40 GMT, Tobias Holenstein <tholenstein at openjdk.org> wrote:
>> 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)
> Normally we would want to be in the WXExec state when executing in _thread_in_native.
I agree. So we would need to aquire `WXWrite` twice just for `ThreadStateTransition::transition_from_java` and again for `ThreadStateTransition::transition_from_native`. I think its a bit unfortune that `WXWrite` is needed for the state transition..
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19102#discussion_r1593828011
More information about the hotspot-dev
mailing list