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

Andrew Dinn adinn at openjdk.org
Wed Sep 7 09:14:55 UTC 2022


On Wed, 7 Sep 2022 00:49:31 GMT, Andrew John Hughes <andrew at openjdk.org> wrote:

> 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.

No, there is no reason for it other that that it was in the patch Zhengyu originally started working on. Of course, the cast is safe because of the guard in the preceding `if` test. However, that's not a reason to put it into the backport. I'm not it even helps performance since as_Java_thread() just does a static cast. I'll remove it.

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

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


More information about the jdk-updates-dev mailing list