mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 06:14:49 +02:00
6893081: method handle & invokedynamic code needs additional cleanup (post 6815692, 6858164)
During the work for 6829187 we have fixed a number of basic bugs which are logically grouped with 6815692 and 6858164 but which must be reviewed and pushed separately. Reviewed-by: kvn, never
This commit is contained in:
parent
14305ba3f4
commit
caf28727eb
32 changed files with 242 additions and 84 deletions
|
@ -802,7 +802,7 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread,
|
|||
|
||||
#ifdef ASSERT
|
||||
// Check that the receiver klass is of the right subtype and that it is initialized for virtual calls
|
||||
if (bc != Bytecodes::_invokestatic) {
|
||||
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));
|
||||
|
@ -1027,7 +1027,16 @@ JRT_BLOCK_ENTRY(address, SharedRuntime::handle_wrong_method(JavaThread* thread))
|
|||
frame stub_frame = thread->last_frame();
|
||||
assert(stub_frame.is_runtime_frame(), "sanity check");
|
||||
frame caller_frame = stub_frame.sender(®_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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue