[jdk17u-dev] RFR: 8256811: Delayed/missed jdwp class unloading events [v2]

Andrew John Hughes andrew at openjdk.org
Wed Sep 7 00:51:49 UTC 2022


On Thu, 18 Aug 2022 10:36:24 GMT, Andrew Dinn <adinn at openjdk.org> wrote:

>> Backport of patch to fix class unloading event notification.
>> 
>> This backport was originally developed by @zhengyu123 and involved some minor changes to the original patch.
>> 
>> n.b. the original patch required a follow up fix (cf JDK-8290908) which also needs backporting after this has been included.
>
> Andrew Dinn has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
> 
>  - Merge branch 'master' into JDK-8256811
>  - Backport 54854d9300479c22c416fd9d2fdb5c29fc1884bc

Backport mostly looks clean. The changes in `JvmtiExport::post_object_free` are appropriate, given the additions in JDK 19+ for virtual threads that are not present in 17.

I'm not 100% on the copyright additions which are not part of the original patch, as they may interfere with other backports. However, I guess they are needed at some point.

Most curious to me is this addition:

~~~
+-    JvmtiThreadState *state = thread->as_Java_thread()->jvmti_thread_state();
++    JvmtiThreadState *state = ((JavaThread*)thread)->jvmti_thread_state();
~~~

Is there a reason for altering this line? It doesn't seem related to any of the other changes, and, while the direct cast may be more performant than the method call, the existing usage with the method call seems safer.

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

PR: https://git.openjdk.org/jdk17u-dev/pull/635


More information about the jdk-updates-dev mailing list