On Thu, 20 Nov 2025 02:24:52 GMT, Serguei Spitsyn <[email protected]> wrote:

> This change fixes a long standing performance issue related to the debugger 
> single stepping that is using JVMTI `FramePop` events as a part of step over 
> handling. The performance issue is that the target thread continues its 
> execution in very slow `interp-only` mode in a context of frame marked for 
> `FramePop` notification with the JVMTI `NotifyFramePop`. It includes other 
> method calls recursively upon a return from the frame.
> 
> This fix is to avoid enforcing the `interp-only` execution mode for threads 
> when `FramePop` events are enabled with the JVMTI 
> `SetEventNotificationMode()`. Instead, the target frame has been deoptimized 
> and kept interpreted by disabling `OSR` optimization by the function 
> `InterpreterRuntime::frequency_counter_overflow_inner()`. (Big thanks to 
> @fisk for this suggestion!) Additionally, some tweaks are applied in several 
> places where the `java_thread->is_interp_only_mode()` is checked.
> The other details will be provided in the first PR request comment.
> 
> Testing:
>  - test `serviceability/jvmti/vthread/ThreadStateTest` was updated to provide 
> some extra test coverage
>  - submitted mach5 tiers 1-6
> 
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: 7da24777
Author:    Serguei Spitsyn <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/7da2477700a976e628d0cd18daa3e1e6d959a463
Stats:     500 lines in 28 files changed: 390 ins; 34 del; 76 mod

6960970: Debugger very slow during stepping

Co-authored-by: Patricio Chilano Mateo <[email protected]>
Reviewed-by: lmesnik, pchilanomate

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

PR: https://git.openjdk.org/jdk/pull/28407

Reply via email to