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

Add JVM TI support for redefining a module

XMLWordPrintable

      Agents that instrument code in modules may need to augment the set of modules that are read, exports, or services used/provided. We need to add a function to JVM TI to do this, RedefineModule has been proposed. A possible starting point is:

      struct _jvmtiModuleExports {
          const char* pkg_name;
          jint target_count;
          const jobject* targets;
      }

      struct _jvmtiModuleProvides {
          jclass service;
          jint provide_count;
          const jclass* impl_class;
      }

      jvmtiError (JNICALL *RedefineModule) (jvmtiEnv* env,
        jint reads_count,
        const jobject* reads,
        jint exports_count,
        const jvmtiModulesExport* exports,
        jint uses_count,
        const jclass* uses,
        jint provides_count,
        const jvmtiModuleProvides* provides)

      Implementation-wise then this function will likely just call the supporting methods in jdk.internal.module.Modules. The bulk of the effort will therefore be tests rather than implementation.

            sspitsyn Serguei Spitsyn
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: