Mercurial > hg > graal-compiler
diff src/cpu/x86/vm/stubGenerator_x86_64.cpp @ 6275:957c266d8bc5
Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 21 Aug 2012 10:39:19 +0200 |
parents | 33df1aeaebbf 1d7922586cf6 |
children | e522a00b91aa |
line wrap: on
line diff
--- a/src/cpu/x86/vm/stubGenerator_x86_64.cpp Mon Aug 20 15:21:31 2012 +0200 +++ b/src/cpu/x86/vm/stubGenerator_x86_64.cpp Tue Aug 21 10:39:19 2012 +0200 @@ -710,6 +710,21 @@ return start; } + // Support for intptr_t get_previous_sp() + // + // This routine is used to find the previous stack pointer for the + // caller. + address generate_get_previous_sp() { + StubCodeMark mark(this, "StubRoutines", "get_previous_sp"); + address start = __ pc(); + + __ movptr(rax, rsp); + __ addptr(rax, 8); // return address is at the top of the stack. + __ ret(0); + + return start; + } + //---------------------------------------------------------------------------------------------------- // Support for void verify_mxcsr() // @@ -2913,11 +2928,34 @@ __ addq(rsp, 8); __ ret(0); } - - // The intrinsic version of these seem to return the same value as - // the strict version. - StubRoutines::_intrinsic_exp = SharedRuntime::dexp; - StubRoutines::_intrinsic_pow = SharedRuntime::dpow; + { + StubCodeMark mark(this, "StubRoutines", "exp"); + StubRoutines::_intrinsic_exp = (double (*)(double)) __ pc(); + + __ subq(rsp, 8); + __ movdbl(Address(rsp, 0), xmm0); + __ fld_d(Address(rsp, 0)); + __ exp_with_fallback(0); + __ fstp_d(Address(rsp, 0)); + __ movdbl(xmm0, Address(rsp, 0)); + __ addq(rsp, 8); + __ ret(0); + } + { + StubCodeMark mark(this, "StubRoutines", "pow"); + StubRoutines::_intrinsic_pow = (double (*)(double,double)) __ pc(); + + __ subq(rsp, 8); + __ movdbl(Address(rsp, 0), xmm1); + __ fld_d(Address(rsp, 0)); + __ movdbl(Address(rsp, 0), xmm0); + __ fld_d(Address(rsp, 0)); + __ pow_with_fallback(0); + __ fstp_d(Address(rsp, 0)); + __ movdbl(xmm0, Address(rsp, 0)); + __ addq(rsp, 8); + __ ret(0); + } } #undef __ @@ -3060,17 +3098,10 @@ // platform dependent StubRoutines::x86::_get_previous_fp_entry = generate_get_previous_fp(); + StubRoutines::x86::_get_previous_sp_entry = generate_get_previous_sp(); StubRoutines::x86::_verify_mxcsr_entry = generate_verify_mxcsr(); - // Build this early so it's available for the interpreter. Stub - // expects the required and actual types as register arguments in - // j_rarg0 and j_rarg1 respectively. - StubRoutines::_throw_WrongMethodTypeException_entry = - generate_throw_exception("WrongMethodTypeException throw_exception", - CAST_FROM_FN_PTR(address, SharedRuntime::throw_WrongMethodTypeException), - rax, rcx); - // Build this early so it's available for the interpreter. StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception",