In share/vm/jvmci/jvmciCodeInstaller.cpp (also share/cpu/*/vm/jvmciCodeInstaller_*.cpp), there are several places where error conditions are handled with "fatal".
They are usually handling conditions that should never happen in normal operation, indicating a compiler bug. For example:
if (constant->is_a(HotSpotObjectConstantImpl::klass())) {
pd_patch_OopConstant(pc_offset, constant);
} else if (constant->is_a(HotSpotMetaspaceConstantImpl::klass())) {
pd_patch_MetaspaceConstant(pc_offset, constant);
} else {
fatal("unknown constant type in data patch");
}
While a compiler bug can always crash the VM, in this particular case a better interface design would be to abort the current code installation operation, and throw an exception back to the calling Java code. The compiler can then decide what to do about it (e.g. bailout, log error, ...).
They are usually handling conditions that should never happen in normal operation, indicating a compiler bug. For example:
if (constant->is_a(HotSpotObjectConstantImpl::klass())) {
pd_patch_OopConstant(pc_offset, constant);
} else if (constant->is_a(HotSpotMetaspaceConstantImpl::klass())) {
pd_patch_MetaspaceConstant(pc_offset, constant);
} else {
fatal("unknown constant type in data patch");
}
While a compiler bug can always crash the VM, in this particular case a better interface design would be to abort the current code installation operation, and throw an exception back to the calling Java code. The compiler can then decide what to do about it (e.g. bailout, log error, ...).