-
Enhancement
-
Resolution: Fixed
-
P3
-
9-repo-jigsaw
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.
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.
- blocks
-
JDK-8159144 Remove JNI functions AddModuleReads/CanReadModule
-
- Resolved
-
- relates to
-
JDK-8159173 Instrumentation needs a redefineModule method (#ReflectiveAccessByInstrumentationAgents)
-
- Resolved
-