8271055: Crash during deoptimization with "assert(bb->is_reachable()) failed: getting result from unreachable basicblock" with -XX:+VerifyStack

Co-authored-by: Yi Yang <yyang@openjdk.org>
Co-authored-by: Yi Yang <qingfeng.yy@alibaba-inc.com>
Reviewed-by: vlivanov, thartmann
This commit is contained in:
Dean Long 2022-02-03 22:10:44 +00:00
parent b6935dfb86
commit e44dc638b8
3 changed files with 121 additions and 1 deletions

View file

@ -704,6 +704,21 @@ void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_arr
assert(f->is_interpreted_frame(), "must be interpreted");
}
#ifndef PRODUCT
static bool falls_through(Bytecodes::Code bc) {
switch (bc) {
// List may be incomplete. Here we really only care about bytecodes where compiled code
// can deoptimize.
case Bytecodes::_goto:
case Bytecodes::_goto_w:
case Bytecodes::_athrow:
return false;
default:
return true;
}
}
#endif
// Return BasicType of value being returned
JRT_LEAF(BasicType, Deoptimization::unpack_frames(JavaThread* thread, int exec_mode))
@ -801,7 +816,7 @@ JRT_LEAF(BasicType, Deoptimization::unpack_frames(JavaThread* thread, int exec_m
// calls. It seems to be hard to tell whether the compiler
// has emitted debug information matching the "state before"
// a given bytecode or the state after, so we try both
if (!Bytecodes::is_invoke(cur_code) && cur_code != Bytecodes::_athrow) {
if (!Bytecodes::is_invoke(cur_code) && falls_through(cur_code)) {
// Get expression stack size for the next bytecode
InterpreterOopMap next_mask;
OopMapCache::compute_one_oop_map(mh, str.bci(), &next_mask);