8295009: RISC-V: Interpreter intrinsify Thread.currentThread()

Reviewed-by: fyang, shade
This commit is contained in:
Yadong Wang 2022-10-16 10:36:26 +00:00 committed by Fei Yang
parent e7d0ab227f
commit d3781ac8a3
4 changed files with 15 additions and 4 deletions

View File

@ -1442,6 +1442,17 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
return entry_point;
}
// Method entry for java.lang.Thread.currentThread
address TemplateInterpreterGenerator::generate_currentThread() {
address entry_point = __ pc();
__ ld(x10, Address(xthread, JavaThread::vthread_offset()));
__ resolve_oop_handle(x10, t0, t1);
__ ret();
return entry_point;
}
//-----------------------------------------------------------------------------
// Exceptions

View File

@ -133,7 +133,7 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(const methodHan
case vmIntrinsics::_floatToRawIntBits: return java_lang_Float_floatToRawIntBits;
case vmIntrinsics::_longBitsToDouble: return java_lang_Double_longBitsToDouble;
case vmIntrinsics::_doubleToRawLongBits: return java_lang_Double_doubleToRawLongBits;
#if defined(AMD64) || defined(AARCH64)
#if defined(AMD64) || defined(AARCH64) || defined(RISCV64)
case vmIntrinsics::_currentThread: return java_lang_Thread_currentThread;
#endif
#endif // ZERO

View File

@ -201,7 +201,7 @@ void TemplateInterpreterGenerator::generate_all() {
method_entry(java_lang_math_fmaF )
method_entry(java_lang_math_fmaD )
method_entry(java_lang_ref_reference_get)
#if defined(AMD64) || defined(AARCH64)
#if defined(AMD64) || defined(AARCH64) || defined(RISCV64)
method_entry(java_lang_Thread_currentThread)
#endif
AbstractInterpreter::initialize_method_handle_entries();
@ -433,7 +433,7 @@ address TemplateInterpreterGenerator::generate_method_entry(
: // fall thru
case Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer
: entry_point = generate_CRC32C_updateBytes_entry(kind); break;
#if defined(AMD64) || defined(AARCH64)
#if defined(AMD64) || defined(AARCH64) || defined(RISCV64)
case Interpreter::java_lang_Thread_currentThread
: entry_point = generate_currentThread(); break;
#endif

View File

@ -94,7 +94,7 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator {
address generate_CRC32_update_entry();
address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind);
address generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind);
#if defined(AMD64) || defined(AARCH64)
#if defined(AMD64) || defined(AARCH64) || defined(RISCV64)
address generate_currentThread();
#endif
#ifdef IA32