On Wed, 8 Jan 2025 05:35:34 GMT, Serguei Spitsyn <sspit...@openjdk.org> wrote:
> The fix looks good. It is a great and important finding - thanks! What was > bothering me is that the `EnterInterpOnlyModeClosure` is used in the > `JvmtiEventControllerPrivate::enter_interp_only_mode()` but no > `HandshakeClosure` is used in the > `JvmtiEventControllerPrivate::leave_interp_only_mode()`. The handshake use > for the `enter_interp_only_mode()` looks like a paranoid overkill to me. It > can be I just forgot the exact reason why it is used there. > I see. Yes, we still need the handshake in `JvmtiEventControllerPrivate::enter_interp_only_mode` to safely walk the stack of the target to deoptimize the frames. When leaving interpreter only mode we just decrement `_interp_only_mode/_saved_interp_only_mode` so I don’t think we need anything else, other than making sure the change is atomic, which I think we guarantee by holding `JvmtiThreadState_lock`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22931#issuecomment-2578238579