Mercurial > hg > truffle
diff src/cpu/x86/vm/templateInterpreter_x86_32.cpp @ 12010:ca0165daa6ec
7187554: JSR 292: JVMTI PopFrame needs to handle appendix arguments
Summary: Restore the appendix argument after PopFrame() call
Reviewed-by: twisti, coleenp
Contributed-by: serguei.spitsyn@oracle.com
author | sspitsyn |
---|---|
date | Tue, 06 Aug 2013 16:33:59 -0700 |
parents | b800986664f4 |
children | ce0cc25bc5e2 |
line wrap: on
line diff
--- a/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Tue Aug 06 14:28:48 2013 +0400 +++ b/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Tue Aug 06 16:33:59 2013 -0700 @@ -1920,6 +1920,29 @@ __ get_thread(thread); __ movl(Address(thread, JavaThread::popframe_condition_offset()), JavaThread::popframe_inactive); +#if INCLUDE_JVMTI + if (EnableInvokeDynamic) { + Label L_done; + const Register local0 = rdi; + + __ cmpb(Address(rsi, 0), Bytecodes::_invokestatic); + __ jcc(Assembler::notEqual, L_done); + + // The member name argument must be restored if _invokestatic is re-executed after a PopFrame call. + // Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL. + + __ get_method(rdx); + __ movptr(rax, Address(local0, 0)); + __ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), rax, rdx, rsi); + + __ testptr(rax, rax); + __ jcc(Assembler::zero, L_done); + + __ movptr(Address(rbx, 0), rax); + __ bind(L_done); + } +#endif // INCLUDE_JVMTI + __ dispatch_next(vtos); // end of PopFrame support