mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8257993: vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine/TestDescription.java crash intermittently
Reviewed-by: sspitsyn, hseigel, dholmes
This commit is contained in:
parent
46c9a860b6
commit
0a3e446ad9
1 changed files with 10 additions and 20 deletions
|
@ -821,24 +821,17 @@ void InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes::Code byte
|
||||||
CallInfo info;
|
CallInfo info;
|
||||||
constantPoolHandle pool(thread, last_frame.method()->constants());
|
constantPoolHandle pool(thread, last_frame.method()->constants());
|
||||||
|
|
||||||
|
methodHandle resolved_method;
|
||||||
|
|
||||||
{
|
{
|
||||||
JvmtiHideSingleStepping jhss(thread);
|
JvmtiHideSingleStepping jhss(thread);
|
||||||
LinkResolver::resolve_invoke(info, receiver, pool,
|
LinkResolver::resolve_invoke(info, receiver, pool,
|
||||||
last_frame.get_index_u2_cpcache(bytecode), bytecode,
|
last_frame.get_index_u2_cpcache(bytecode), bytecode,
|
||||||
CHECK);
|
CHECK);
|
||||||
if (JvmtiExport::can_hotswap_or_post_breakpoint()) {
|
if (JvmtiExport::can_hotswap_or_post_breakpoint() && info.resolved_method()->is_old()) {
|
||||||
int retry_count = 0;
|
resolved_method = methodHandle(THREAD, info.resolved_method()->get_new_method());
|
||||||
while (info.resolved_method()->is_old()) {
|
} else {
|
||||||
// It is very unlikely that method is redefined more than 100 times
|
resolved_method = methodHandle(THREAD, info.resolved_method());
|
||||||
// in the middle of resolve. If it is looping here more than 100 times
|
|
||||||
// means then there could be a bug here.
|
|
||||||
guarantee((retry_count++ < 100),
|
|
||||||
"Could not resolve to latest version of redefined method");
|
|
||||||
// method is redefined in the middle of resolve so re-try.
|
|
||||||
LinkResolver::resolve_invoke(info, receiver, pool,
|
|
||||||
last_frame.get_index_u2_cpcache(bytecode), bytecode,
|
|
||||||
CHECK);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} // end JvmtiHideSingleStepping
|
} // end JvmtiHideSingleStepping
|
||||||
|
|
||||||
|
@ -848,22 +841,20 @@ void InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes::Code byte
|
||||||
|
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
if (bytecode == Bytecodes::_invokeinterface) {
|
if (bytecode == Bytecodes::_invokeinterface) {
|
||||||
if (info.resolved_method()->method_holder() ==
|
if (resolved_method->method_holder() == SystemDictionary::Object_klass()) {
|
||||||
SystemDictionary::Object_klass()) {
|
|
||||||
// NOTE: THIS IS A FIX FOR A CORNER CASE in the JVM spec
|
// NOTE: THIS IS A FIX FOR A CORNER CASE in the JVM spec
|
||||||
// (see also CallInfo::set_interface for details)
|
// (see also CallInfo::set_interface for details)
|
||||||
assert(info.call_kind() == CallInfo::vtable_call ||
|
assert(info.call_kind() == CallInfo::vtable_call ||
|
||||||
info.call_kind() == CallInfo::direct_call, "");
|
info.call_kind() == CallInfo::direct_call, "");
|
||||||
Method* rm = info.resolved_method();
|
assert(resolved_method->is_final() || info.has_vtable_index(),
|
||||||
assert(rm->is_final() || info.has_vtable_index(),
|
|
||||||
"should have been set already");
|
"should have been set already");
|
||||||
} else if (!info.resolved_method()->has_itable_index()) {
|
} else if (!resolved_method->has_itable_index()) {
|
||||||
// Resolved something like CharSequence.toString. Use vtable not itable.
|
// Resolved something like CharSequence.toString. Use vtable not itable.
|
||||||
assert(info.call_kind() != CallInfo::itable_call, "");
|
assert(info.call_kind() != CallInfo::itable_call, "");
|
||||||
} else {
|
} else {
|
||||||
// Setup itable entry
|
// Setup itable entry
|
||||||
assert(info.call_kind() == CallInfo::itable_call, "");
|
assert(info.call_kind() == CallInfo::itable_call, "");
|
||||||
int index = info.resolved_method()->itable_index();
|
int index = resolved_method->itable_index();
|
||||||
assert(info.itable_index() == index, "");
|
assert(info.itable_index() == index, "");
|
||||||
}
|
}
|
||||||
} else if (bytecode == Bytecodes::_invokespecial) {
|
} else if (bytecode == Bytecodes::_invokespecial) {
|
||||||
|
@ -878,7 +869,6 @@ void InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes::Code byte
|
||||||
// methods must be checked for every call.
|
// methods must be checked for every call.
|
||||||
InstanceKlass* sender = pool->pool_holder();
|
InstanceKlass* sender = pool->pool_holder();
|
||||||
sender = sender->is_unsafe_anonymous() ? sender->unsafe_anonymous_host() : sender;
|
sender = sender->is_unsafe_anonymous() ? sender->unsafe_anonymous_host() : sender;
|
||||||
methodHandle resolved_method(THREAD, info.resolved_method());
|
|
||||||
|
|
||||||
switch (info.call_kind()) {
|
switch (info.call_kind()) {
|
||||||
case CallInfo::direct_call:
|
case CallInfo::direct_call:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue