Merge
authoramurillo
Thu, 05 May 2016 12:35:54 -0700
changeset 38349 9bdb1e62c552
parent 37791 ae33107fd8b3 (current diff)
parent 38345 c4e8f0e57f7b (diff)
child 38350 da6c6f544dfb
Merge
jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties
--- a/jdk/src/java.base/share/classes/java/lang/Thread.java	Thu May 05 11:37:18 2016 +0100
+++ b/jdk/src/java.base/share/classes/java/lang/Thread.java	Thu May 05 12:35:54 2016 -0700
@@ -341,6 +341,45 @@
     }
 
     /**
+     * Indicates that the caller is momentarily unable to progress, until the
+     * occurrence of one or more actions on the part of other activities. By
+     * invoking this method within each iteration of a spin-wait loop construct,
+     * the calling thread indicates to the runtime that it is busy-waiting.
+     * The runtime may take action to improve the performance of invoking
+     * spin-wait loop constructions.
+     * <p>
+     * @apiNote
+     * As an example consider a method in a class that spins in a loop until
+     * some flag is set outside of that method. A call to the {@code onSpinWait}
+     * method should be placed inside the spin loop.
+     * <pre>{@code
+     *     class EventHandler {
+     *         volatile boolean eventNotificationNotReceived;
+     *         void waitForEventAndHandleIt() {
+     *             while ( eventNotificationNotReceived ) {
+     *                 java.lang.Thread.onSpinWait();
+     *             }
+     *             readAndProcessEvent();
+     *         }
+     *
+     *         void readAndProcessEvent() {
+     *             // Read event from some source and process it
+     *              . . .
+     *         }
+     *     }
+     * }</pre>
+     * <p>
+     * The code above would remain correct even if the {@code onSpinWait}
+     * method was not called at all. However on some architectures the Java
+     * Virtual Machine may issue the processor instructions to address such
+     * code patterns in a more beneficial way.
+     * <p>
+     * @since 9
+     */
+    @HotSpotIntrinsicCandidate
+    public static void onSpinWait() {}
+
+    /**
      * Initializes a Thread with the current AccessControlContext.
      * @see #init(ThreadGroup,Runnable,String,long,AccessControlContext,boolean)
      */
--- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties	Thu May 05 11:37:18 2016 +0100
+++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties	Thu May 05 12:35:54 2016 -0700
@@ -100,7 +100,6 @@
 \    -Xdiag            show additional diagnostic messages\n\
 \    -Xdiag:resolver   show resolver diagnostic messages\n\
 \    -Xnoclassgc       disable class garbage collection\n\
-\    -Xincgc           enable incremental garbage collection\n\
 \    -Xloggc:<file>    log GC status to a file with time stamps\n\
 \    -Xbatch           disable background compilation\n\
 \    -Xms<size>        set initial Java heap size\n\
--- a/jdk/src/java.base/share/native/include/jvmti.h	Thu May 05 11:37:18 2016 +0100
+++ b/jdk/src/java.base/share/native/include/jvmti.h	Thu May 05 12:35:54 2016 -0700
@@ -704,7 +704,8 @@
     unsigned int can_generate_resource_exhaustion_heap_events : 1;
     unsigned int can_generate_resource_exhaustion_threads_events : 1;
     unsigned int can_generate_early_vmstart : 1;
-    unsigned int : 6;
+    unsigned int can_generate_early_class_hook_events : 1;
+    unsigned int : 5;
     unsigned int : 16;
     unsigned int : 16;
     unsigned int : 16;
--- a/jdk/src/java.instrument/share/native/libinstrument/InvocationAdapter.c	Thu May 05 11:37:18 2016 +0100
+++ b/jdk/src/java.instrument/share/native/libinstrument/InvocationAdapter.c	Thu May 05 12:35:54 2016 -0700
@@ -518,18 +518,22 @@
 splitPathList(const char* str, int* pathCount, char*** paths) {
     int count = 0;
     char** segments = NULL;
+    char** new_segments;
     char* c = (char*) str;
     while (*c != '\0') {
         while (*c == ' ') c++;          /* skip leading spaces */
         if (*c == '\0') {
             break;
         }
-        if (segments == NULL) {
-            segments = (char**)malloc( sizeof(char**) );
-        } else {
-            segments = (char**)realloc( segments, (count+1)*sizeof(char**) );
+        new_segments = (char**)realloc(segments, (count+1)*sizeof(char*));
+        if (new_segments == NULL) {
+            jplis_assert(0);
+            free(segments);
+            count = 0;
+            segments = NULL;
+            break;
         }
-        jplis_assert(segments != (char**)NULL);
+        segments = new_segments;
         segments[count++] = c;
         c = strchr(c, ' ');
         if (c == NULL) {
--- a/jdk/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/Commands.java	Thu May 05 11:37:18 2016 +0100
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/Commands.java	Thu May 05 12:35:54 2016 -0700
@@ -1534,7 +1534,6 @@
             PathSearchingVirtualMachine vm = (PathSearchingVirtualMachine)Env.vm();
             MessageOutput.println("base directory:", vm.baseDirectory());
             MessageOutput.println("classpath:", vm.classPath().toString());
-            MessageOutput.println("bootclasspath:", vm.bootClassPath().toString());
         } else {
             MessageOutput.println("The VM does not use paths");
         }
--- a/jdk/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources.java	Thu May 05 11:37:18 2016 +0100
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources.java	Thu May 05 12:35:54 2016 -0700
@@ -74,7 +74,6 @@
         {"Array element is not a method", "Array element is not a method"},
         {"Array index must be a integer type", "Array index must be a integer type"},
         {"base directory:", "base directory: {0}"},
-        {"bootclasspath:", "bootclasspath: {0}"},
         {"Breakpoint hit:", "Breakpoint hit: "},
         {"breakpoint", "breakpoint {0}"},
         {"Breakpoints set:", "Breakpoints set:"},
--- a/jdk/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java	Thu May 05 11:37:18 2016 +0100
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java	Thu May 05 12:35:54 2016 -0700
@@ -74,7 +74,6 @@
         {"Array element is not a method", "\u914D\u5217\u8981\u7D20\u306F\u30E1\u30BD\u30C3\u30C9\u3067\u306F\u3042\u308A\u307E\u305B\u3093"},
         {"Array index must be a integer type", "\u914D\u5217\u306E\u6DFB\u3048\u5B57\u306F\u6574\u6570\u578B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"},
         {"base directory:", "\u30D9\u30FC\u30B9\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA: {0}"},
-        {"bootclasspath:", "\u30D6\u30FC\u30C8\u30FB\u30AF\u30E9\u30B9\u30D1\u30B9: {0}"},
         {"Breakpoint hit:", "\u30D2\u30C3\u30C8\u3057\u305F\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8: "},
         {"breakpoint", "\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8{0}"},
         {"Breakpoints set:", "\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8:"},
--- a/jdk/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java	Thu May 05 11:37:18 2016 +0100
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTYResources_zh_CN.java	Thu May 05 12:35:54 2016 -0700
@@ -74,7 +74,6 @@
         {"Array element is not a method", "\u6570\u7EC4\u5143\u7D20\u4E0D\u662F\u65B9\u6CD5"},
         {"Array index must be a integer type", "\u6570\u7EC4\u7D22\u5F15\u5FC5\u987B\u4E3A\u6574\u6570\u7C7B\u578B"},
         {"base directory:", "\u57FA\u76EE\u5F55: {0}"},
-        {"bootclasspath:", "\u5F15\u5BFC\u7C7B\u8DEF\u5F84: {0}"},
         {"Breakpoint hit:", "\u65AD\u70B9\u547D\u4E2D: "},
         {"breakpoint", "\u65AD\u70B9{0}"},
         {"Breakpoints set:", "\u65AD\u70B9\u96C6:"},
--- a/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java	Thu May 05 11:37:18 2016 +0100
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java	Thu May 05 12:35:54 2016 -0700
@@ -1439,7 +1439,7 @@
    }
 
    public List<String> bootClassPath() {
-       return Arrays.asList(getClasspath().bootclasspaths);
+       return Collections.emptyList();
    }
 
    public String baseDirectory() {
--- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c	Thu May 05 11:37:18 2016 +0100
+++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c	Thu May 05 12:35:54 2016 -0700
@@ -126,7 +126,7 @@
             int writtenCount = 0;
             int i;
 
-            for (i=0; i<classCount; i++) {
+            for (i = 0; i < classCount; i++) {
                 jclass clazz = theClasses[i];
                 jint status = classStatus(clazz);
                 char *candidate_signature = NULL;
@@ -141,7 +141,13 @@
 
                 error = classSignature(clazz, &candidate_signature, NULL);
                 if (error != JVMTI_ERROR_NONE) {
-                    break;
+                  // Clazz become invalid since the time we get the class list
+                  // Skip this entry
+                  if (error == JVMTI_ERROR_INVALID_CLASS) {
+                    continue;
+                  }
+
+                  break;
                 }
 
                 if (strcmp(candidate_signature, signature) == 0) {
--- a/jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh	Thu May 05 11:37:18 2016 +0100
+++ b/jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh	Thu May 05 12:35:54 2016 -0700
@@ -106,7 +106,7 @@
 # run test
 ${TESTJAVA}${FS}bin${FS}java \
         ${TESTVMOPTS} \
-        -verbose:class -Xlog:classload -cp . \
+        -verbose:class -Xlog:class+load -cp . \
         -Dtest.classes=${TESTCLASSES} \
         Starter cross
 # -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass \
--- a/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh	Thu May 05 11:37:18 2016 +0100
+++ b/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh	Thu May 05 12:35:54 2016 -0700
@@ -102,7 +102,7 @@
 # run test
 ${TESTJAVA}${FS}bin${FS}java \
         ${TESTVMOPTS} \
-        -verbose:class -Xlog:classload -cp . \
+        -verbose:class -Xlog:class+load -cp . \
         -Dtest.classes=${TESTCLASSES} \
         Starter one-way
 # -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass \
--- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh	Thu May 05 11:37:18 2016 +0100
+++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh	Thu May 05 12:35:54 2016 -0700
@@ -80,5 +80,5 @@
 
 # Finally we run the test
 (cd "${TESTCLASSES}"; \
-  $JAVA ${TESTVMOPTS} -Xverify:none -Xlog:classunload \
+  $JAVA ${TESTVMOPTS} -Xverify:none -Xlog:class+unload \
     -javaagent:ClassUnloadTest.jar ClassUnloadTest "${OTHERDIR}" Bar.jar)
--- a/jdk/test/java/util/concurrent/locks/Lock/TimedAcquireLeak.java	Thu May 05 11:37:18 2016 +0100
+++ b/jdk/test/java/util/concurrent/locks/Lock/TimedAcquireLeak.java	Thu May 05 12:35:54 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -167,7 +167,7 @@
                             final String childPid,
                             final String className) {
         final String regex =
-            "(?m)^ *[0-9]+: +([0-9]+) +[0-9]+ +\\Q"+className+"\\E$";
+            "(?m)^ *[0-9]+: +([0-9]+) +[0-9]+ +\\Q"+className+"\\E(?:$| )";
         final Callable<Integer> objectsInUse =
             new Callable<Integer>() { public Integer call() {
                 Integer i = Integer.parseInt(