RFR: 8289004: investigate if SharedRuntime::get_java_tid parameter should be a JavaThread*

David Holmes dholmes at openjdk.org
Tue Oct 4 04:35:11 UTC 2022


On Mon, 3 Oct 2022 12:59:21 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

> Hi, please consider.
> 
> Yes it should be JavaThread*.
> But some additional places needed to use JavaThread*
> 
> Passes t1-3.

Changes look fine, but some additional changes needed in `get_java_tid`.

Thanks.

src/hotspot/share/runtime/sharedRuntime.cpp line 1004:

> 1002:     return 0;
> 1003:   }
> 1004:   guarantee(Thread::current() != thread || JavaThread::cast(thread)->is_oop_safe(),

You don't need the cast any more.

src/hotspot/share/runtime/sharedRuntime.cpp line 1006:

> 1004:   guarantee(Thread::current() != thread || JavaThread::cast(thread)->is_oop_safe(),
> 1005:             "current cannot touch oops after its GC barrier is detached.");
> 1006:   oop obj = JavaThread::cast(thread)->threadObj();

Again no cast needed.

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

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.org/jdk/pull/10532


More information about the hotspot-dev mailing list