changeset 1989:88688bc37dfc

Merge
author mchung
date Thu, 22 Sep 2016 15:24:43 -0700
parents d4b2baada058 0f5a26cc67b0
children e37ec15b4bed
files .hgtags
diffstat 6 files changed, 10 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/.jcheck/conf	Thu Sep 22 16:41:15 2016 +0000
+++ b/.jcheck/conf	Thu Sep 22 15:24:43 2016 -0700
@@ -1,1 +1,4 @@
 project=jdk9
+comments=lax
+tags=lax
+bugids=dup
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java	Thu Sep 22 16:41:15 2016 +0000
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java	Thu Sep 22 15:24:43 2016 -0700
@@ -316,7 +316,7 @@
     private final WeakValueCache<CodeSource, Class<?>> anonymousHostClasses = new WeakValueCache<>();
 
     private static final class AnonymousContextCodeInstaller extends ContextCodeInstaller {
-        private static final Unsafe UNSAFE = getUnsafe();
+        private static final Unsafe UNSAFE = Unsafe.getUnsafe();
         private static final String ANONYMOUS_HOST_CLASS_NAME = Compiler.SCRIPTS_PACKAGE.replace('/', '.') + ".AnonymousHost";
         private static final byte[] ANONYMOUS_HOST_CLASS_BYTES = getAnonymousHostClassBytes();
 
@@ -353,21 +353,6 @@
             cw.visitEnd();
             return cw.toByteArray();
         }
-
-        private static Unsafe getUnsafe() {
-            return AccessController.doPrivileged(new PrivilegedAction<Unsafe>() {
-                @Override
-                public Unsafe run() {
-                    try {
-                        final Field theUnsafeField = Unsafe.class.getDeclaredField("theUnsafe");
-                        theUnsafeField.setAccessible(true);
-                        return (Unsafe)theUnsafeField.get(null);
-                    } catch (final ReflectiveOperationException e) {
-                        throw new RuntimeException(e);
-                    }
-                }
-            });
-        }
     }
 
     /** Is Context global debug mode enabled ? */
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptLoader.java	Thu Sep 22 16:41:15 2016 +0000
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptLoader.java	Thu Sep 22 15:24:43 2016 -0700
@@ -69,10 +69,10 @@
     private Module createModule(final String moduleName) {
         final Module structMod = context.getStructLoader().getModule();
         final ModuleDescriptor descriptor
-                = new ModuleDescriptor.Builder(moduleName)
+                = ModuleDescriptor.module(moduleName)
                     .requires(NASHORN_MODULE.getName())
                     .requires(structMod.getName())
-                    .conceals(SCRIPTS_PKG)
+                    .contains(SCRIPTS_PKG)
                     .build();
 
         final Module mod = Context.createModuleTrusted(structMod.getLayer(), descriptor, this);
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/StructureLoader.java	Thu Sep 22 16:41:15 2016 +0000
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/StructureLoader.java	Thu Sep 22 15:24:43 2016 -0700
@@ -63,9 +63,9 @@
 
     private Module createModule(final String moduleName) {
         final ModuleDescriptor descriptor
-                = new ModuleDescriptor.Builder(moduleName)
+                = ModuleDescriptor.module(moduleName)
                     .requires(NASHORN_MODULE.getName())
-                    .conceals(SCRIPTS_PKG)
+                    .contains(SCRIPTS_PKG)
                     .build();
 
         final Module mod = Context.createModuleTrusted(descriptor, this);
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/scripts/ModuleGraphManipulator.java	Thu Sep 22 16:41:15 2016 +0000
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/scripts/ModuleGraphManipulator.java	Thu Sep 22 15:24:43 2016 -0700
@@ -62,7 +62,7 @@
         }
 
         // From this module add a qualified export to nashorn module
-        MY_MODULE.addExports(MY_PKG_NAME, nashornModule);
+        MY_MODULE.addExportsPrivate(MY_PKG_NAME, nashornModule);
     }
 
     // The following method is reflectively invoked from Nashorn
--- a/src/jdk.scripting.nashorn/share/classes/module-info.java	Thu Sep 22 16:41:15 2016 +0000
+++ b/src/jdk.scripting.nashorn/share/classes/module-info.java	Thu Sep 22 15:24:43 2016 -0700
@@ -25,7 +25,7 @@
 
 module jdk.scripting.nashorn {
     requires java.logging;
-    requires public java.scripting;
+    requires transitive java.scripting;
     requires jdk.dynalink;
 
     exports jdk.nashorn.api.scripting;