RFR: 8263709: Cleanup THREAD/TRAPS/CHECK usage in JRT_ENTRY routines

Ioi Lam iklam at openjdk.java.net
Fri Mar 19 00:34:40 UTC 2021


On Thu, 18 Mar 2021 23:57:34 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/runtime/sharedRuntime.cpp line 1661:
>> 
>>> 1659: 
>>> 1660: methodHandle SharedRuntime::handle_ic_miss_helper(TRAPS) {
>>> 1661:   JavaThread* thread = THREAD->as_Java_thread();
>> 
>> A general comment about the functions that took both `thread` and `TRAPS`, where you removed the `thread`:
>> 
>> Are we sure they cannot be called on a non-current thread?
>
> Everything goes back to the JRT macros where THREAD is created from thread, so they are always the same current thread instance.

Have you check all possible call paths? Could one of these functions be called from a place other than the JRT functions?

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

PR: https://git.openjdk.java.net/jdk/pull/3062


More information about the hotspot-runtime-dev mailing list