提交 aa40518d 编写于 作者: S sspitsyn

8017230: Internal Error (jvmtiRedefineClasses.cpp:1662): guarantee(false)...

8017230: Internal Error (jvmtiRedefineClasses.cpp:1662): guarantee(false) failed: insert_space_at() failed
Summary: Handle pending exceptions instead of firing a guarantee()
Reviewed-by: coleenp, dholmes
Contributed-by: serguei.spitsyn@oracle.com
上级 8d368d3b
......@@ -1590,11 +1590,23 @@ bool VM_RedefineClasses::rewrite_cp_refs_in_methods(
for (int i = methods->length() - 1; i >= 0; i--) {
methodHandle method(THREAD, methods->at(i));
methodHandle new_method;
rewrite_cp_refs_in_method(method, &new_method, CHECK_false);
rewrite_cp_refs_in_method(method, &new_method, THREAD);
if (!new_method.is_null()) {
// the method has been replaced so save the new method version
// even in the case of an exception. original method is on the
// deallocation list.
methods->at_put(i, new_method());
}
if (HAS_PENDING_EXCEPTION) {
Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
// RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
RC_TRACE_WITH_THREAD(0x00000002, THREAD,
("rewrite_cp_refs_in_method exception: '%s'", ex_name->as_C_string()));
// Need to clear pending exception here as the super caller sets
// the JVMTI_ERROR_INTERNAL if the returned value is false.
CLEAR_PENDING_EXCEPTION;
return false;
}
}
return true;
......@@ -1674,10 +1686,7 @@ void VM_RedefineClasses::rewrite_cp_refs_in_method(methodHandle method,
Pause_No_Safepoint_Verifier pnsv(&nsv);
// ldc is 2 bytes and ldc_w is 3 bytes
m = rc.insert_space_at(bci, 3, inst_buffer, THREAD);
if (m.is_null() || HAS_PENDING_EXCEPTION) {
guarantee(false, "insert_space_at() failed");
}
m = rc.insert_space_at(bci, 3, inst_buffer, CHECK);
}
// return the new method so that the caller can update
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册