`MacroAssembler::call_VM_base` and related methods have this code to support passing the thread register, and getting it if `noreg` is passed:
```
// determine java_thread register
if (!java_thread->is_valid()) {
#ifdef _LP64
java_thread = r15_thread;
#else
java_thread = rdi;
get_thread(java_thread);
#endif // LP64
}
```
This never happens after 32-bit x86 removal. x86_64 always uses r15_thread. There are related `set_last_java_frame` and `reset_last_java_frame` methods that do the same. We can clean those up.
These are also the only major users of `MacroAssembler::get_thread` that we want to remove/rename to avoid falling into traps like JDK-8353176.
```
// determine java_thread register
if (!java_thread->is_valid()) {
#ifdef _LP64
java_thread = r15_thread;
#else
java_thread = rdi;
get_thread(java_thread);
#endif // LP64
}
```
This never happens after 32-bit x86 removal. x86_64 always uses r15_thread. There are related `set_last_java_frame` and `reset_last_java_frame` methods that do the same. We can clean those up.
These are also the only major users of `MacroAssembler::get_thread` that we want to remove/rename to avoid falling into traps like JDK-8353176.
- relates to
-
JDK-8353176 C1: x86 patching stub always calls Thread::current()
-
- Open
-