diff --git a/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp index 143cd93f17e0bade70de087c064e606325312493..7d10f9ba013530ee95fb6a620ec5aa5879e632fb 100644 --- a/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp +++ b/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp @@ -420,7 +420,8 @@ int LIR_Assembler::emit_unwind_handler() { } if (compilation()->env()->dtrace_method_probes()) { - jobject2reg(method()->constant_encoding(), O0); + __ mov(G2_thread, O0); + jobject2reg(method()->constant_encoding(), O1); __ call(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), relocInfo::runtime_call_type); __ delayed()->nop(); } diff --git a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index 7e1be01c322ea7fa066984ac3dc667b667141544..63aebf2094a9f460c9bfb717b85dadb7946c38ff 100644 --- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -488,7 +488,9 @@ int LIR_Assembler::emit_unwind_handler() { } if (compilation()->env()->dtrace_method_probes()) { - __ movoop(Address(rsp, 0), method()->constant_encoding()); + __ get_thread(rax); + __ movptr(Address(rsp, 0), rax); + __ movoop(Address(rsp, sizeof(void*)), method()->constant_encoding()); __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit))); }