< prev index next >

src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp

Print this page

        

*** 375,436 **** } else if (kind == Interpreter::java_lang_math_exp) { __ movdbl(xmm0, Address(rsp, wordSize)); if (StubRoutines::dexp() != NULL) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp()))); } else { ! __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dexp))); } } else if (kind == Interpreter::java_lang_math_log) { __ movdbl(xmm0, Address(rsp, wordSize)); if (StubRoutines::dlog() != NULL) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog()))); } else { ! __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dlog))); } } else if (kind == Interpreter::java_lang_math_log10) { __ movdbl(xmm0, Address(rsp, wordSize)); if (StubRoutines::dlog10() != NULL) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog10()))); } else { ! __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dlog10))); } } else if (kind == Interpreter::java_lang_math_sin) { __ movdbl(xmm0, Address(rsp, wordSize)); if (StubRoutines::dsin() != NULL) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dsin()))); } else { ! __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dsin))); } } else if (kind == Interpreter::java_lang_math_cos) { __ movdbl(xmm0, Address(rsp, wordSize)); if (StubRoutines::dcos() != NULL) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dcos()))); } else { ! __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dcos))); } } else if (kind == Interpreter::java_lang_math_pow) { __ movdbl(xmm1, Address(rsp, wordSize)); __ movdbl(xmm0, Address(rsp, 3 * wordSize)); if (StubRoutines::dpow() != NULL) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dpow()))); } else { ! __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dpow))); } } else if (kind == Interpreter::java_lang_math_tan) { __ movdbl(xmm0, Address(rsp, wordSize)); if (StubRoutines::dtan() != NULL) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dtan()))); } else { ! __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dtan))); } } else { __ fld_d(Address(rsp, wordSize)); switch (kind) { case Interpreter::java_lang_math_abs: __ fabs(); break; ! default : ShouldNotReachHere(); } // return double result in xmm0 for interpreter and compilers. __ subptr(rsp, 2*wordSize); --- 375,436 ---- } else if (kind == Interpreter::java_lang_math_exp) { __ movdbl(xmm0, Address(rsp, wordSize)); if (StubRoutines::dexp() != NULL) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp()))); } else { ! mathfunc(CAST_FROM_FN_PTR(address, SharedRuntime::dexp)); } } else if (kind == Interpreter::java_lang_math_log) { __ movdbl(xmm0, Address(rsp, wordSize)); if (StubRoutines::dlog() != NULL) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog()))); } else { ! mathfunc(CAST_FROM_FN_PTR(address, SharedRuntime::dlog)); } } else if (kind == Interpreter::java_lang_math_log10) { __ movdbl(xmm0, Address(rsp, wordSize)); if (StubRoutines::dlog10() != NULL) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog10()))); } else { ! mathfunc(CAST_FROM_FN_PTR(address, SharedRuntime::dlog10)); } } else if (kind == Interpreter::java_lang_math_sin) { __ movdbl(xmm0, Address(rsp, wordSize)); if (StubRoutines::dsin() != NULL) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dsin()))); } else { ! mathfunc(CAST_FROM_FN_PTR(address, SharedRuntime::dsin)); } } else if (kind == Interpreter::java_lang_math_cos) { __ movdbl(xmm0, Address(rsp, wordSize)); if (StubRoutines::dcos() != NULL) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dcos()))); } else { ! mathfunc(CAST_FROM_FN_PTR(address, SharedRuntime::dcos)); } } else if (kind == Interpreter::java_lang_math_pow) { __ movdbl(xmm1, Address(rsp, wordSize)); __ movdbl(xmm0, Address(rsp, 3 * wordSize)); if (StubRoutines::dpow() != NULL) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dpow()))); } else { ! mathfunc(CAST_FROM_FN_PTR(address, SharedRuntime::dpow)); } } else if (kind == Interpreter::java_lang_math_tan) { __ movdbl(xmm0, Address(rsp, wordSize)); if (StubRoutines::dtan() != NULL) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dtan()))); } else { ! mathfunc(CAST_FROM_FN_PTR(address, SharedRuntime::dtan)); } } else { __ fld_d(Address(rsp, wordSize)); switch (kind) { case Interpreter::java_lang_math_abs: __ fabs(); break; ! default: ShouldNotReachHere(); } // return double result in xmm0 for interpreter and compilers. __ subptr(rsp, 2*wordSize);
*** 445,449 **** --- 445,464 ---- __ mov(rsp, r13); __ jmp(rax); return entry_point; } + + void TemplateInterpreterGenerator::mathfunc(address runtime_entry) { + Label E, L; + __ subq(rsp, 0x20); + __ testl(rsp, 15); + __ jcc(Assembler::zero, L); + __ subq(rsp, 8); + __ call(RuntimeAddress(runtime_entry)); + __ addq(rsp, 8); + __ jmp(E); + __ bind(L); + __ call(RuntimeAddress(runtime_entry)); + __ bind(E); + __ addq(rsp, 0x20); + }
< prev index next >