private CompilerState getJitCompilerState() {
    if (myIsCompilationEnabledMethod != null && myIsCompilationStoppedForeverMethod != null) {
      try {
        boolean compilationStateCurrentValue = (Boolean)myIsCompilationEnabledMethod.invoke(null);

        if ((Boolean)myIsCompilationStoppedForeverMethod.invoke(null)) {
          return CompilerState.STOPPED_FOREVER;
        }
        if (compilationStateCurrentValue) {
          return CompilerState.ENABLED;
        }
        return CompilerState.DISABLED;
      }
      catch (IllegalAccessException | InvocationTargetException | IllegalStateException e) {
        LOG.error("Could not perform compilation state check, disabling", e);
        myIsCompilationEnabledMethod = null;
        myIsCompilationStoppedForeverMethod = null;
      }
    }
    return CompilerState.STATE_UNKNOWN;
  }
private CompilerState getJitCompilerState()