changeset 12441:c19881ed4dd5

Merge
author mchung
date Thu, 08 Sep 2016 18:25:06 -0700
parents 909fa4cc8395 2464a42ecc18
children d79352d5e29a
files test/runtime/modules/AccessCheck/CheckRead.java test/runtime/modules/AccessCheck/DiffCL_CheckRead.java test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java test/runtime/modules/AccessCheck/ExpQualOther.java test/runtime/modules/AccessCheck/ExpQualToM1.java test/runtime/modules/AccessCheck/ExportAllUnnamed.java test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java test/runtime/modules/AccessCheck/Umod_ExpQualOther.java
diffstat 16 files changed, 49 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.hotspot.agent/share/classes/module-info.java	Thu Sep 08 17:42:03 2016 -0700
+++ b/src/jdk.hotspot.agent/share/classes/module-info.java	Thu Sep 08 18:25:06 2016 -0700
@@ -30,6 +30,6 @@
     requires java.scripting;
 
     // RMI needs to serialize types in this package
-    exports dynamic sun.jvm.hotspot.debugger.remote to java.rmi;
+    exports sun.jvm.hotspot.debugger.remote to java.rmi;
 
 }
--- a/src/share/vm/classfile/javaClasses.cpp	Thu Sep 08 17:42:03 2016 -0700
+++ b/src/share/vm/classfile/javaClasses.cpp	Thu Sep 08 18:25:06 2016 -0700
@@ -2146,6 +2146,13 @@
   oop classname = StringTable::intern((char*) str, CHECK);
   java_lang_StackTraceElement::set_declaringClass(element(), classname);
 
+  oop loader = holder->class_loader();
+  if (loader != NULL) {
+    oop loader_name = java_lang_ClassLoader::name(loader);
+    if (loader_name != NULL)
+      java_lang_StackTraceElement::set_classLoaderName(element(), loader_name);
+  }
+
   // The method can be NULL if the requested class version is gone
   Symbol* sym = !method.is_null() ? method->name() : holder->constants()->symbol_at(cpref);
 
@@ -3438,6 +3445,7 @@
 bool java_lang_ClassLoader::offsets_computed = false;
 int  java_lang_ClassLoader::_loader_data_offset = -1;
 int  java_lang_ClassLoader::parallelCapable_offset = -1;
+int  java_lang_ClassLoader::name_offset = -1;
 int  java_lang_ClassLoader::unnamedModule_offset = -1;
 
 ClassLoaderData** java_lang_ClassLoader::loader_data_addr(oop loader) {
@@ -3458,6 +3466,9 @@
   compute_optional_offset(parallelCapable_offset,
     k1, vmSymbols::parallelCapable_name(), vmSymbols::concurrenthashmap_signature());
 
+  compute_offset(name_offset,
+    k1, vmSymbols::name_name(), vmSymbols::string_signature());
+
   compute_offset(unnamedModule_offset,
     k1, vmSymbols::unnamedModule_name(), vmSymbols::module_signature());
 
@@ -3469,6 +3480,11 @@
   return loader->obj_field(parent_offset);
 }
 
+oop java_lang_ClassLoader::name(oop loader) {
+  assert(is_instance(loader), "loader must be oop");
+  return loader->obj_field(name_offset);
+}
+
 bool java_lang_ClassLoader::isAncestor(oop loader, oop cl) {
   assert(is_instance(loader), "loader must be oop");
   assert(cl == NULL || is_instance(cl), "cl argument must be oop");
@@ -3632,6 +3648,7 @@
 int java_lang_StackTraceElement::lineNumber_offset;
 int java_lang_StackTraceElement::moduleName_offset;
 int java_lang_StackTraceElement::moduleVersion_offset;
+int java_lang_StackTraceElement::classLoaderName_offset;
 int java_lang_StackFrameInfo::_declaringClass_offset;
 int java_lang_StackFrameInfo::_memberName_offset;
 int java_lang_StackFrameInfo::_bci_offset;
@@ -3676,6 +3693,10 @@
   element->obj_field_put(moduleVersion_offset, value);
 }
 
+void java_lang_StackTraceElement::set_classLoaderName(oop element, oop value) {
+  element->obj_field_put(classLoaderName_offset, value);
+}
+
 // Support for java_lang_StackFrameInfo
 void java_lang_StackFrameInfo::set_declaringClass(oop element, oop value) {
   element->obj_field_put(_declaringClass_offset, value);
@@ -3795,6 +3816,7 @@
   // java_lang_StackTraceElement
   java_lang_StackTraceElement::moduleName_offset = java_lang_StackTraceElement::hc_moduleName_offset * x + header;
   java_lang_StackTraceElement::moduleVersion_offset = java_lang_StackTraceElement::hc_moduleVersion_offset * x + header;
+  java_lang_StackTraceElement::classLoaderName_offset = java_lang_StackTraceElement::hc_classLoaderName_offset * x + header;
   java_lang_StackTraceElement::declaringClass_offset = java_lang_StackTraceElement::hc_declaringClass_offset  * x + header;
   java_lang_StackTraceElement::methodName_offset = java_lang_StackTraceElement::hc_methodName_offset * x + header;
   java_lang_StackTraceElement::fileName_offset   = java_lang_StackTraceElement::hc_fileName_offset   * x + header;
--- a/src/share/vm/classfile/javaClasses.hpp	Thu Sep 08 17:42:03 2016 -0700
+++ b/src/share/vm/classfile/javaClasses.hpp	Thu Sep 08 18:25:06 2016 -0700
@@ -1237,6 +1237,7 @@
   static bool offsets_computed;
   static int parent_offset;
   static int parallelCapable_offset;
+  static int name_offset;
   static int unnamedModule_offset;
 
  public:
@@ -1246,6 +1247,7 @@
   static ClassLoaderData* loader_data(oop loader);
 
   static oop parent(oop loader);
+  static oop name(oop loader);
   static bool isAncestor(oop loader, oop cl);
 
   // Support for parallelCapable field
@@ -1305,14 +1307,16 @@
   enum {
     hc_moduleName_offset = 0,
     hc_moduleVersion_offset = 1,
-    hc_declaringClass_offset = 2,
-    hc_methodName_offset = 3,
-    hc_fileName_offset   = 4,
-    hc_lineNumber_offset = 5
+    hc_classLoaderName_offset = 2,
+    hc_declaringClass_offset = 3,
+    hc_methodName_offset = 4,
+    hc_fileName_offset   = 5,
+    hc_lineNumber_offset = 6
   };
 
   static int moduleName_offset;
   static int moduleVersion_offset;
+  static int classLoaderName_offset;
   static int declaringClass_offset;
   static int methodName_offset;
   static int fileName_offset;
@@ -1321,6 +1325,7 @@
   // Setters
   static void set_moduleName(oop element, oop value);
   static void set_moduleVersion(oop element, oop value);
+  static void set_classLoaderName(oop element, oop value);
   static void set_declaringClass(oop element, oop value);
   static void set_methodName(oop element, oop value);
   static void set_fileName(oop element, oop value);
--- a/src/share/vm/runtime/arguments.cpp	Thu Sep 08 17:42:03 2016 -0700
+++ b/src/share/vm/runtime/arguments.cpp	Thu Sep 08 18:25:06 2016 -0700
@@ -2544,6 +2544,7 @@
 
 unsigned int addreads_count = 0;
 unsigned int addexports_count = 0;
+unsigned int addexports_private_count = 0;
 unsigned int patch_mod_count = 0;
 const char* add_modules_value = NULL;
 
@@ -2798,6 +2799,10 @@
       if (!create_numbered_property("jdk.module.addexports", tail, addexports_count++)) {
         return JNI_ENOMEM;
       }
+    } else if (match_option(option, "--add-exports-private=", &tail)) {
+      if (!create_numbered_property("jdk.module.addexports.private", tail, addexports_private_count++)) {
+        return JNI_ENOMEM;
+      }
     } else if (match_option(option, "--add-modules=", &tail)) {
       add_modules_value = tail;
     } else if (match_option(option, "--limit-modules=", &tail)) {
--- a/test/runtime/modules/AccessCheck/CheckRead.java	Thu Sep 08 17:42:03 2016 -0700
+++ b/test/runtime/modules/AccessCheck/CheckRead.java	Thu Sep 08 18:25:06 2016 -0700
@@ -82,7 +82,7 @@
         ModuleDescriptor descriptor_m2 =
                 new ModuleDescriptor.Builder("m2")
                         .requires("java.base")
-                        .exports("p2", "m1")
+                        .exports("p2", Set.of("m1"))
                         .build();
 
         // Define module:     m3
--- a/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java	Thu Sep 08 17:42:03 2016 -0700
+++ b/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java	Thu Sep 08 18:25:06 2016 -0700
@@ -82,7 +82,7 @@
         ModuleDescriptor descriptor_m2 =
                 new ModuleDescriptor.Builder("m2")
                         .requires("java.base")
-                        .exports("p2", "m1")
+                        .exports("p2", Set.of("m1"))
                         .build();
 
         // Define module:     m3
--- a/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java	Thu Sep 08 17:42:03 2016 -0700
+++ b/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java	Thu Sep 08 18:25:06 2016 -0700
@@ -84,7 +84,7 @@
         ModuleDescriptor descriptor_m2 =
                 new ModuleDescriptor.Builder("m2")
                         .requires("java.base")
-                        .exports("p2", "m3")
+                        .exports("p2", Set.of("m3"))
                         .build();
 
         // Define module:     m3
--- a/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java	Thu Sep 08 17:42:03 2016 -0700
+++ b/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java	Thu Sep 08 18:25:06 2016 -0700
@@ -81,7 +81,7 @@
         ModuleDescriptor descriptor_m2 =
                 new ModuleDescriptor.Builder("m2")
                         .requires("java.base")
-                        .exports("p2", "m1")
+                        .exports("p2", Set.of("m1"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
--- a/test/runtime/modules/AccessCheck/ExpQualOther.java	Thu Sep 08 17:42:03 2016 -0700
+++ b/test/runtime/modules/AccessCheck/ExpQualOther.java	Thu Sep 08 18:25:06 2016 -0700
@@ -84,7 +84,7 @@
         ModuleDescriptor descriptor_m2 =
                 new ModuleDescriptor.Builder("m2")
                         .requires("java.base")
-                        .exports("p2", "m3")
+                        .exports("p2", Set.of("m3"))
                         .build();
 
         // Define module:     m3
--- a/test/runtime/modules/AccessCheck/ExpQualToM1.java	Thu Sep 08 17:42:03 2016 -0700
+++ b/test/runtime/modules/AccessCheck/ExpQualToM1.java	Thu Sep 08 18:25:06 2016 -0700
@@ -71,7 +71,7 @@
         ModuleDescriptor descriptor_m2 =
                 new ModuleDescriptor.Builder("m2")
                         .requires("java.base")
-                        .exports("p2", "m1")
+                        .exports("p2", Set.of("m1"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
--- a/test/runtime/modules/AccessCheck/ExportAllUnnamed.java	Thu Sep 08 17:42:03 2016 -0700
+++ b/test/runtime/modules/AccessCheck/ExportAllUnnamed.java	Thu Sep 08 18:25:06 2016 -0700
@@ -83,7 +83,7 @@
         ModuleDescriptor descriptor_m2 =
                 new ModuleDescriptor.Builder("m2")
                         .requires("java.base")
-                        .exports("p2", "m1")
+                        .exports("p2", Set.of("m1"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
--- a/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java	Thu Sep 08 17:42:03 2016 -0700
+++ b/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java	Thu Sep 08 18:25:06 2016 -0700
@@ -82,7 +82,7 @@
         ModuleDescriptor descriptor_m2 =
                 new ModuleDescriptor.Builder("m2")
                         .requires("java.base")
-                        .exports("p2", "m1")
+                        .exports("p2", Set.of("m1"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
--- a/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java	Thu Sep 08 17:42:03 2016 -0700
+++ b/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java	Thu Sep 08 18:25:06 2016 -0700
@@ -82,7 +82,7 @@
         ModuleDescriptor descriptor_m2 =
                 new ModuleDescriptor.Builder("m2")
                         .requires("java.base")
-                        .exports("p6", "m1")
+                        .exports("p6", Set.of("m1"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.
--- a/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java	Thu Sep 08 17:42:03 2016 -0700
+++ b/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java	Thu Sep 08 18:25:06 2016 -0700
@@ -82,7 +82,7 @@
         ModuleDescriptor descriptor_m2 =
                 new ModuleDescriptor.Builder("m2")
                         .requires("java.base")
-                        .exports("p6", "m3")
+                        .exports("p6", Set.of("m3"))
                         .build();
 
         // Define module:     m3
--- a/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java	Thu Sep 08 17:42:03 2016 -0700
+++ b/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java	Thu Sep 08 18:25:06 2016 -0700
@@ -82,7 +82,7 @@
         ModuleDescriptor descriptor_m2 =
                 new ModuleDescriptor.Builder("m2")
                         .requires("java.base")
-                        .exports("p2", "m3")
+                        .exports("p2", Set.of("m3"))
                         .build();
 
         // Define module:     m3
--- a/test/runtime/modules/ModuleStress/ModuleSameCLMain.java	Thu Sep 08 17:42:03 2016 -0700
+++ b/test/runtime/modules/ModuleStress/ModuleSameCLMain.java	Thu Sep 08 18:25:06 2016 -0700
@@ -68,7 +68,7 @@
         ModuleDescriptor descriptor_m2 =
                 new ModuleDescriptor.Builder("m2")
                         .requires("java.base")
-                        .exports("p2", "m1")
+                        .exports("p2", Set.of("m1"))
                         .build();
 
         // Set up a ModuleFinder containing all modules for this layer.