@@ -465,13 +465,19 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
465465 __ call_VM_leaf0 (CAST_FROM_FN_PTR (address, SharedRuntime::dtan));
466466 }
467467 } else if (kind == Interpreter::java_lang_math_tanh) {
468- assert (StubRoutines::dtanh () != nullptr , " not initialized " );
468+ if (StubRoutines::dtanh () != nullptr ) {
469469 __ movdbl (xmm0, Address (rsp, wordSize));
470470 __ call (RuntimeAddress (CAST_FROM_FN_PTR (address, StubRoutines::dtanh ())));
471+ } else {
472+ return nullptr ; // Fallback to default implementation
473+ }
471474 } else if (kind == Interpreter::java_lang_math_cbrt) {
472- assert (StubRoutines::dcbrt () != nullptr , " not initialized" );
473- __ movdbl (xmm0, Address (rsp, wordSize));
474- __ call (RuntimeAddress (CAST_FROM_FN_PTR (address, StubRoutines::dcbrt ())));
475+ if (StubRoutines::dcbrt () != nullptr ) {
476+ __ movdbl (xmm0, Address (rsp, wordSize));
477+ __ call (RuntimeAddress (CAST_FROM_FN_PTR (address, StubRoutines::dcbrt ())));
478+ } else {
479+ return nullptr ; // Fallback to default implementation
480+ }
475481 } else if (kind == Interpreter::java_lang_math_abs) {
476482 assert (StubRoutines::x86::double_sign_mask () != nullptr , " not initialized" );
477483 __ movdbl (xmm0, Address (rsp, wordSize));
0 commit comments