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

David Holmes dholmes at openjdk.java.net
Thu Mar 18 12:55:41 UTC 2021


On Thu, 18 Mar 2021 12:19:34 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> All JRT_ENTRY routines are required to have a parameter, "JavaThread* thread", which must be the current thread. The JRT_ENTRY, and related macros, then use this parameter and also expose it as THREAD for use with exception macros. But the fact "thread" is the current thread is lost in some routines and we see strange calls to other code that pass both "thread" and "THREAD" as distinct parameters - primarily when a TRAPS method is involved.
>> 
>> This should be cleaned up along with a general check on misuse of TRAPS/THREAD. 
>> 
>> Testing: tiers 1-3
>> 
>> Thanks,
>> David
>
> src/hotspot/share/runtime/sharedRuntime.cpp line 2124:
> 
>> 2122:     Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
>> 2123:   }
>> 2124:   Handle h_obj(thread, obj);
> 
> Can you make this one 'current'?

Unfortunately not - the JRT_BLOCK_NO_ASYNC further down requires "thread".

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

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


More information about the hotspot-runtime-dev mailing list