In the code review for:
JDK-8288139 JavaThread touches oop after GC barrier is detached
this topic came up:
https://github.com/openjdk/jdk19/pull/21#discussion_r898495754
Here's [~dholmes]' comment:
> I think the oop-touching-safety check should be done in
> threadObj() itself so that all callers are protected.
During the review, I agreed that threadObj() was a better placement,
but I didn't want to make that change yet because I thought it might
result in more issues that would need to be investigated. JDK-8288139
is about the failure due to the call to SharedRuntime::get_java_tid() and
I wanted to focus my fix on that exact failure mode.
This bug is for investigating moving the oop safety check from
SharedRuntime::get_java_tid() to JavaThread::threadObj().