mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8140659: C1: invokedynamic call patching violates JVMS-6.5.invokedynamic
Reviewed-by: roland
This commit is contained in:
parent
a82be01120
commit
7adcd9a503
8 changed files with 23 additions and 16 deletions
|
@ -954,20 +954,25 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
|
|||
constantPoolHandle pool(thread, caller_method->constants());
|
||||
int index = bytecode.index();
|
||||
LinkResolver::resolve_invoke(info, Handle(), pool, index, bc, CHECK);
|
||||
appendix = info.resolved_appendix();
|
||||
switch (bc) {
|
||||
case Bytecodes::_invokehandle: {
|
||||
int cache_index = ConstantPool::decode_cpcache_index(index, true);
|
||||
assert(cache_index >= 0 && cache_index < pool->cache()->length(), "unexpected cache index");
|
||||
pool->cache()->entry_at(cache_index)->set_method_handle(pool, info);
|
||||
ConstantPoolCacheEntry* cpce = pool->cache()->entry_at(cache_index);
|
||||
cpce->set_method_handle(pool, info);
|
||||
appendix = info.resolved_appendix(); // just in case somebody already resolved the entry
|
||||
break;
|
||||
}
|
||||
case Bytecodes::_invokedynamic: {
|
||||
pool->invokedynamic_cp_cache_entry_at(index)->set_dynamic_call(pool, info);
|
||||
ConstantPoolCacheEntry* cpce = pool->invokedynamic_cp_cache_entry_at(index);
|
||||
cpce->set_dynamic_call(pool, info);
|
||||
appendix = cpce->appendix_if_resolved(pool); // just in case somebody already resolved the entry
|
||||
break;
|
||||
}
|
||||
default: fatal("unexpected bytecode for load_appendix_patching_id");
|
||||
}
|
||||
assert(appendix.not_null(), "%s @ %d (%s)",
|
||||
caller_method->name_and_sig_as_C_string(), bci, Bytecodes::name(bc));
|
||||
} else {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue