[jdk19] RFR: 8288949: serviceability/jvmti/vthread/ContStackDepthTest/ContStackDepthTest.java failing [v2]

Serguei Spitsyn sspitsyn at openjdk.org
Sat Jul 2 07:40:49 UTC 2022


On Sat, 25 Jun 2022 01:23:47 GMT, Ron Pressler <rpressler at openjdk.org> wrote:

>> Please review the following bug fix:
>> 
>> `Continuation.enterSpecial` is a generated special nmethod (albeit not a Java method), with a well-known frame layout that calls `Continuation.enter`.
>> 
>> Because it is compiled, it resolves the call to `Continuation.enter` to its compiled version, if available. But this results in the compiled `Continuation.enter` being called even when the thread is in interp_only_mode.
>> 
>> This change does three things:
>> 
>> 1. When entering interp_only_mode, `Continuation::set_cont_fastpath_thread_state` will clear enterSpecial's resolved callsite to Continuation.enter.
>> 2. In interp_only_mode, `SharedRuntime::resolve_static_call_C` will return `Continuation.enter`'s c2i entry rather than `verified_code_entry`.
>> 3. In interp_only_mode, the c2i stub will not patch the callsite.
>> 
>> This fix isn't perfect, because a different thread, not in interp_only_mode, might patch the call. A longer-term solution is to create an "interpreted" version of `enterSpecial` and supporting an ad-hoc deoptimization. See https://bugs.openjdk.org/browse/JDK-8289128
>> 
>> 
>> Passes tiers 1-4 and Loom tiers 1-5.
>
> Ron Pressler has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Revert "Remove outdated comment"
>   
>   This reverts commit 8f571d76e34bc64ceb31894184fba4b909e8fbfe.

How was this change tested?
In fact, it is not easy to estimate the total impact of this change.
I hope, it impacts continuations only, but not very sure yet.

src/hotspot/share/runtime/continuation.cpp line 315:

> 313:   thread->set_cont_fastpath_thread_state(fast);
> 314:   if (thread->is_interp_only_mode() && ContinuationEntry::enter_special() != nullptr) {
> 315:     ContinuationEntry::enter_special()->clear_continuation_enter_special_inline_caches();

Will this call impact all JavaThread's, not only the one passed in the argument?
Just want to understand this better.
Would it be worth to add a comment explaining this aspect (if applicable)?

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

PR: https://git.openjdk.org/jdk19/pull/66


More information about the hotspot-runtime-dev mailing list