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

Coleen Phillimore coleenp at openjdk.java.net
Fri Mar 19 01:51:39 UTC 2021


On Thu, 18 Mar 2021 02:48:05 GMT, David Holmes <dholmes 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

Changes requested by coleenp (Reviewer).

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

> 1770:   ResourceMark rm(thread);
> 1771:   RegisterMap reg_map(thread, false);
> 1772:   frame stub_frame = thread->last_frame();

The call to thread->last_frame() may require JavaThread.  I think it's a good change to remove the thread parameter.

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

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


More information about the hotspot-runtime-dev mailing list