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

Remove JVM_GetInterfaceVersion() and JVM_DTraceXXX

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 17
    • 17
    • hotspot
    • b08

    Description

      The following code was necessary when we had HSX, where a JDK can use different versions of libjvm.so, as long as they all support the same JVM_INTERFACE_VERSION.

      https://github.com/openjdk/jdk/blob/35c9da70316da21a6be2fd92a5e5b5f193bdd9d6/src/java.base/share/native/libjava/check_version.c#L31

      JNIEXPORT jint JNICALL
      DEF_JNI_OnLoad(JavaVM *vm, void *reserved)
      {
          jint vm_version = JVM_GetInterfaceVersion();
          if (vm_version != JVM_INTERFACE_VERSION) {
              JNIEnv *env;
              char buf[128];
              sprintf(buf, "JVM interface version mismatch: expecting %d, got %d.",
                      JVM_INTERFACE_VERSION, (int)vm_version);
              (*vm)->GetEnv(vm, (void **)&env, JNI_VERSION_1_2);
              if (env) {
                  (*env)->FatalError(env, buf);
              }
          }
          return JNI_VERSION_1_2;
      }

      HSX is no longer supported, and we have been modifying the APIs exposed by jvm.h without updating JVM_INTERFACE_VERSION.

      JVM_GetInterfaceVersion() and JVM_INTERFACE_VERSION, etc, should be removed.

      Also, implementations of APIs such as JVM_DTraceActivate, were removed in JDK-8068976, so their declarations should be removed from jvm.h

      Attachments

        Issue Links

          Activity

            People

              iklam Ioi Lam
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: