Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8139589

[JVMCI] throw exceptions in faulty code installation operations

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • b96

      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, ...).

            rschatz Roland Schatz
            rschatz Roland Schatz
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: