Merge
authoramurillo
Thu, 11 Feb 2016 13:58:43 -0800
changeset 35973 eadb1818d0a1
parent 35778 e2a3c03097de (current diff)
parent 35972 5f2b93839ab2 (diff)
child 35974 5d40126ca3c2
child 36120 192b3ccf06ba
child 36124 56fcd92b5c13
Merge
--- a/jdk/src/java.base/share/native/libjava/System.c	Fri Feb 12 00:20:16 2016 +0300
+++ b/jdk/src/java.base/share/native/libjava/System.c	Thu Feb 11 13:58:43 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -114,7 +114,7 @@
 #define VENDOR_URL_BUG "http://bugreport.java.com/bugreport/"
 #endif
 
-#define JAVA_MAX_SUPPORTED_VERSION 52
+#define JAVA_MAX_SUPPORTED_VERSION 53
 #define JAVA_MAX_SUPPORTED_MINOR_VERSION 0
 
 #ifdef JAVA_SPECIFICATION_VENDOR /* Third party may NOT overwrite this. */
--- a/jdk/src/jdk.jcmd/share/classes/sun/tools/jcmd/Arguments.java	Fri Feb 12 00:20:16 2016 +0300
+++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/jcmd/Arguments.java	Thu Feb 11 13:58:43 2016 -0800
@@ -119,7 +119,7 @@
         System.out.println("  If the pid is 0, commands will be sent to all Java processes.   ");
         System.out.println("  The main class argument will be used to match (either partially ");
         System.out.println("  or fully) the class used to start Java.                         ");
-        System.out.println("  If no options are given, lists Java processes (same as -p).     ");
+        System.out.println("  If no options are given, lists Java processes (same as -l).     ");
         System.out.println("                                                                  ");
         System.out.println("  PerfCounter.print display the counters exposed by this process  ");
         System.out.println("  -f  read and execute commands from the file                     ");
--- a/jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh	Fri Feb 12 00:20:16 2016 +0300
+++ b/jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh	Thu Feb 11 13:58:43 2016 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -106,7 +106,7 @@
 # run test
 ${TESTJAVA}${FS}bin${FS}java \
         ${TESTVMOPTS} \
-        -verbose:class -XX:+TraceClassLoading -cp . \
+        -verbose:class -Xlog:classload -cp . \
         -Dtest.classes=${TESTCLASSES} \
         Starter cross
 # -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass \
--- a/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh	Fri Feb 12 00:20:16 2016 +0300
+++ b/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh	Thu Feb 11 13:58:43 2016 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -102,7 +102,7 @@
 # run test
 ${TESTJAVA}${FS}bin${FS}java \
         ${TESTVMOPTS} \
-        -verbose:class -XX:+TraceClassLoading -cp . \
+        -verbose:class -Xlog:classload -cp . \
         -Dtest.classes=${TESTCLASSES} \
         Starter one-way
 # -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass \
--- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh	Fri Feb 12 00:20:16 2016 +0300
+++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh	Thu Feb 11 13:58:43 2016 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -80,5 +80,5 @@
 
 # Finally we run the test
 (cd "${TESTCLASSES}"; \
-  $JAVA ${TESTVMOPTS} -Xverify:none -XX:+TraceClassUnloading \
+  $JAVA ${TESTVMOPTS} -Xverify:none -Xlog:classunload \
     -javaagent:ClassUnloadTest.jar ClassUnloadTest "${OTHERDIR}" Bar.jar)
--- a/jdk/test/java/lang/ref/ReferenceEnqueuePending.java	Fri Feb 12 00:20:16 2016 +0300
+++ b/jdk/test/java/lang/ref/ReferenceEnqueuePending.java	Thu Feb 11 13:58:43 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -94,35 +94,52 @@
         }
 
         // Do a final collection to discover and process all
-        // Reference objects created above, allowing enough time
+        // Reference objects created above, allowing some time
         // for the ReferenceHandler thread to queue the References.
         forceGc(100);
         forceGc(100);
 
         // Verify that all WeakReference objects ended up queued.
-        checkResult(refQueue, obj, iterations-1);
+        checkResult(refQueue, iterations-1);
+
+        // Ensure the final weaky is live but won't be enqueued during
+        // result checking, by ensuring its referent remains live.
+        // This eliminates behavior changes resulting from different
+        // compiler optimizations.
+        Reference.reachabilityFence(weaky);
+        Reference.reachabilityFence(obj);
+
         System.out.println("Test passed.");
     }
 
+    private static NumberedWeakReference waitForReference(ReferenceQueue<Integer> queue) {
+        try {
+            return (NumberedWeakReference) queue.remove(30000); // 30sec
+        } catch (InterruptedException ie) {
+            return null;
+        }
+    }
+
     private static void checkResult(ReferenceQueue<Integer> queue,
-                                    Integer obj,
                                     int expected) {
         if (debug) {
             System.out.println("Reading the queue");
         }
 
         // Empty the queue and record numbers into a[];
-        NumberedWeakReference weakRead = (NumberedWeakReference) queue.poll();
+        NumberedWeakReference weakRead = waitForReference(queue);
         int length = 0;
         while (weakRead != null) {
             a[length++] = weakRead.number;
-            weakRead = (NumberedWeakReference) queue.poll();
+            if (length < expected) {
+                weakRead = waitForReference(queue);
+            } else {            // Check for unexpected extra entries.
+                weakRead = (NumberedWeakReference) queue.poll();
+            }
         }
         if (debug) {
             System.out.println("Reference Queue had " + length + " elements");
         }
-        // Use the last Reference object of those created above, so as to keep it "alive".
-        System.out.println("I must write " + obj + " to prevent compiler optimizations.");
 
 
         // verify the queued references: all but the last Reference object
--- a/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java	Fri Feb 12 00:20:16 2016 +0300
+++ b/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java	Thu Feb 11 13:58:43 2016 -0800
@@ -25,7 +25,7 @@
  * @test
  * @bug 4990825
  * @modules jdk.jvmstat/sun.jvmstat.monitor
- * @run main/othervm -XX:+UsePerfData -XX:PerfDataMemorySize=64k PrologSizeSanityCheck
+ * @run main/othervm -XX:+UsePerfData PrologSizeSanityCheck
  * @summary prolog size and overflow sanity checks
  */
 
--- a/jdk/test/sun/tools/jcmd/usage.out	Fri Feb 12 00:20:16 2016 +0300
+++ b/jdk/test/sun/tools/jcmd/usage.out	Thu Feb 11 13:58:43 2016 -0800
@@ -7,7 +7,7 @@
   If the pid is 0, commands will be sent to all Java processes.   
   The main class argument will be used to match (either partially 
   or fully) the class used to start Java.                         
-  If no options are given, lists Java processes (same as -p).     
+  If no options are given, lists Java processes (same as -l).     
                                                                   
   PerfCounter.print display the counters exposed by this process  
   -f  read and execute commands from the file