src/share/vm/runtime/sharedRuntime.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/runtime/sharedRuntime.cpp	Tue Oct 20 22:07:04 2009
--- new/src/share/vm/runtime/sharedRuntime.cpp	Tue Oct 20 22:07:04 2009

*** 800,810 **** --- 800,810 ---- assert (receiver.is_null() || receiver->is_oop(), "wrong receiver"); LinkResolver::resolve_invoke(callinfo, receiver, constants, bytecode_index, bc, CHECK_(nullHandle)); #ifdef ASSERT // Check that the receiver klass is of the right subtype and that it is initialized for virtual calls ! if (bc != Bytecodes::_invokestatic && bc != Bytecodes::_invokedynamic) { assert(receiver.not_null(), "should have thrown exception"); KlassHandle receiver_klass (THREAD, receiver->klass()); klassOop rk = constants->klass_ref_at(bytecode_index, CHECK_(nullHandle)); // klass is already loaded KlassHandle static_receiver_klass (THREAD, rk);
*** 1025,1040 **** --- 1025,1049 ---- // safepoint is possible and have trouble gc'ing the compiled args. RegisterMap reg_map(thread, false); frame stub_frame = thread->last_frame(); assert(stub_frame.is_runtime_frame(), "sanity check"); frame caller_frame = stub_frame.sender(&reg_map); if (caller_frame.is_interpreted_frame() || caller_frame.is_entry_frame() ) { + + // MethodHandle invokes don't have a CompiledIC and should always + // simply redispatch to the callee_target. + address sender_pc = caller_frame.pc(); + CodeBlob* sender_cb = caller_frame.cb(); + nmethod* sender_nm = sender_cb->as_nmethod_or_null(); + + if (caller_frame.is_interpreted_frame() || + caller_frame.is_entry_frame() || + (sender_nm != NULL && sender_nm->is_method_handle_return(sender_pc))) { methodOop callee = thread->callee_target(); guarantee(callee != NULL && callee->is_method(), "bad handshake"); thread->set_vm_result(callee); thread->set_callee_target(NULL); ! return callee->get_c2i_entry(); ! return callee->from_compiled_entry(); } // Must be compiled to compiled path which is safe to stackwalk methodHandle callee_method; JRT_BLOCK

src/share/vm/runtime/sharedRuntime.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File