changeset 14504:fa97a65164bc

Changes to communicate the j.l.r.Module for the boot loader's unnamed module to the JVM
author lfoltan
date Tue, 24 Nov 2015 09:02:30 -0500
parents 33d87582d833
children 5098cced084a
files make/mapfiles/libjava/mapfile-vers src/java.base/share/classes/jdk/internal/misc/BootLoader.java src/java.base/share/native/include/jvm.h src/java.base/share/native/libjava/BootLoader.c src/java.base/share/native/libjava/Module.c
diffstat 5 files changed, 19 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/make/mapfiles/libjava/mapfile-vers	Tue Nov 24 14:01:28 2015 +0100
+++ b/make/mapfiles/libjava/mapfile-vers	Tue Nov 24 09:02:30 2015 -0500
@@ -283,6 +283,7 @@
 
 		Java_jdk_internal_misc_BootLoader_getSystemPackageLocation;
 		Java_jdk_internal_misc_BootLoader_getSystemPackageNames;
+                Java_jdk_internal_misc_BootLoader_setBootLoaderUnnamedModule0;
 
 		Java_sun_misc_VMSupport_initAgentProperties;
 		Java_sun_misc_VMSupport_getVMTemporaryDirectory;
--- a/src/java.base/share/classes/jdk/internal/misc/BootLoader.java	Tue Nov 24 14:01:28 2015 +0100
+++ b/src/java.base/share/classes/jdk/internal/misc/BootLoader.java	Tue Nov 24 09:02:30 2015 -0500
@@ -44,8 +44,12 @@
     private BootLoader() { }
 
     // The unnamed module for the boot loader
-    private static final Module UNNAMED_MODULE
-        = SharedSecrets.getJavaLangReflectModuleAccess().defineUnnamedModule(null);
+    private static final Module UNNAMED_MODULE;
+    static {
+        UNNAMED_MODULE
+            = SharedSecrets.getJavaLangReflectModuleAccess().defineUnnamedModule(null);
+        setBootLoaderUnnamedModule0(UNNAMED_MODULE);
+    }
 
     // ServiceCatalog for the boot class loader
     private static final ServicesCatalog SERVICES_CATALOG = new ServicesCatalog();
@@ -147,4 +151,5 @@
 
     private static native String getSystemPackageLocation(String name);
     private static native String[] getSystemPackageNames();
+    private static native void setBootLoaderUnnamedModule0(Module module);
 }
--- a/src/java.base/share/native/include/jvm.h	Tue Nov 24 14:01:28 2015 +0100
+++ b/src/java.base/share/native/include/jvm.h	Tue Nov 24 09:02:30 2015 -0500
@@ -367,6 +367,9 @@
                  jobjectArray packages);
 
 JNIEXPORT void JNICALL
+JVM_SetBootLoaderUnnamedModule(JNIEnv *env, jobject module);
+
+JNIEXPORT void JNICALL
 JVM_AddReadsModule(JNIEnv *env, jobject from_module, jobject to_module);
 
 JNIEXPORT jboolean JNICALL
--- a/src/java.base/share/native/libjava/BootLoader.c	Tue Nov 24 14:01:28 2015 +0100
+++ b/src/java.base/share/native/libjava/BootLoader.c	Tue Nov 24 09:02:30 2015 -0500
@@ -39,3 +39,10 @@
 {
     return JVM_GetSystemPackages(env);
 }
+
+JNIEXPORT void JNICALL
+Java_jdk_internal_misc_BootLoader_setBootLoaderUnnamedModule0(JNIEnv *env, jclass cls, jobject module)
+{
+    JVM_SetBootLoaderUnnamedModule(env, module);
+}
+
--- a/src/java.base/share/native/libjava/Module.c	Tue Nov 24 14:01:28 2015 +0100
+++ b/src/java.base/share/native/libjava/Module.c	Tue Nov 24 09:02:30 2015 -0500
@@ -29,7 +29,7 @@
 #include "java_lang_reflect_Module.h"
 
 JNIEXPORT void JNICALL
-Java_java_lang_reflect_Module_defineModule0(JNIEnv *env, jclass cls, jclass module,
+Java_java_lang_reflect_Module_defineModule0(JNIEnv *env, jclass cls, jobject module,
                                             jstring version, jstring location,
                                             jobjectArray packages)
 {