RFR: 8376568: Change Thread::getStackTrace to use handshake op for all cases

Alan Bateman alanb at openjdk.org
Thu Jan 29 09:03:48 UTC 2026


On Thu, 29 Jan 2026 04:57:11 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/classfile/javaClasses.cpp line 1914:
>> 
>>> 1912: 
>>> 1913:   bool has_java_thread = tlh.cv_internal_thread_to_JavaThread(jthread, &java_thread, &thread_oop);
>>> 1914:   assert((has_java_thread && thread_oop != nullptr) || !has_java_thread, "Missing Thread oop");
>> 
>> Suggestion:
>> 
>>   assert(!has_java_thread || thread_oop != nullptr, "Missing Thread oop");
>
> FWIW the same "shape" assert is in threadService.cpp

Thanks, that is a better assert.

We can change the assert in threadService.cpp too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29461#discussion_r2740604845


More information about the core-libs-dev mailing list