Mercurial > hg > truffle
diff src/share/vm/runtime/sharedRuntime.cpp @ 1200:ba263cfb7611
6917766: JSR 292 needs its own deopt handler
Summary: We need to introduce a new MH deopt handler so we can easily determine if the deopt happened at a MH call site or not.
Reviewed-by: never, jrose
author | twisti |
---|---|
date | Fri, 29 Jan 2010 12:13:05 +0100 |
parents | cf0685d550f1 |
children | 24128c2ffa87 |
line wrap: on
line diff
--- a/src/share/vm/runtime/sharedRuntime.cpp Thu Jan 28 20:41:37 2010 -0800 +++ b/src/share/vm/runtime/sharedRuntime.cpp Fri Jan 29 12:13:05 2010 +0100 @@ -1033,10 +1033,20 @@ address sender_pc = caller_frame.pc(); CodeBlob* sender_cb = caller_frame.cb(); nmethod* sender_nm = sender_cb->as_nmethod_or_null(); + bool is_mh_invoke_via_adapter = false; // Direct c2c call or via adapter? + if (sender_nm != NULL && sender_nm->is_method_handle_return(sender_pc)) { + // If the callee_target is set, then we have come here via an i2c + // adapter. + methodOop callee = thread->callee_target(); + if (callee != NULL) { + assert(callee->is_method(), "sanity"); + is_mh_invoke_via_adapter = true; + } + } if (caller_frame.is_interpreted_frame() || - caller_frame.is_entry_frame() || - (sender_nm != NULL && sender_nm->is_method_handle_return(sender_pc))) { + caller_frame.is_entry_frame() || + is_mh_invoke_via_adapter) { methodOop callee = thread->callee_target(); guarantee(callee != NULL && callee->is_method(), "bad handshake"); thread->set_vm_result(callee); @@ -1417,7 +1427,7 @@ if (callee == cb || callee->is_adapter_blob()) { // static call or optimized virtual if (TraceCallFixup) { - tty->print("fixup callsite at " INTPTR_FORMAT " to compiled code for", caller_pc); + tty->print("fixup callsite at " INTPTR_FORMAT " to compiled code for", caller_pc); moop->print_short_name(tty); tty->print_cr(" to " INTPTR_FORMAT, entry_point); } @@ -1433,7 +1443,7 @@ } } else { if (TraceCallFixup) { - tty->print("already patched callsite at " INTPTR_FORMAT " to compiled code for", caller_pc); + tty->print("already patched callsite at " INTPTR_FORMAT " to compiled code for", caller_pc); moop->print_short_name(tty); tty->print_cr(" to " INTPTR_FORMAT, entry_point); }