Merge
authorhseigel
Sun, 29 Mar 2015 09:21:15 -0400
changeset 30332 cdecfa325d0c
parent 30331 f07d88b6243c (diff)
parent 29716 838a9156720c (current diff)
child 30333 e8999e87feae
Merge
hotspot/make/linux/makefiles/arm.make
hotspot/make/linux/makefiles/ppc.make
hotspot/make/linux/platform_arm
hotspot/make/linux/platform_ppc
hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
jdk/make/Makefile
jdk/test/java/util/Properties/Basic.java
--- a/jdk/make/Import.gmk	Thu Mar 26 16:17:33 2015 +0100
+++ b/jdk/make/Import.gmk	Sun Mar 29 09:21:15 2015 -0400
@@ -32,11 +32,11 @@
 
 # Put the libraries here. Different locations for different target OS types.
 ifneq ($(OPENJDK_TARGET_OS), windows)
-  HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)
+  HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
   BASE_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)
   SA_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent$(OPENJDK_TARGET_CPU_LIBDIR)
 else
-  HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/jre/bin
+  HOTSPOT_LIB_DIR := $(HOTSPOT_DIST)/bin
   BASE_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base
   SA_INSTALL_LIBRARIES_HERE := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.hotspot.agent
 endif
@@ -80,11 +80,11 @@
 ################################################################################
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
-  JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig$(SHARED_LIBRARY_SUFFIX).dSYM) \
-      $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
+  JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig$(SHARED_LIBRARY_SUFFIX).dSYM) \
+      $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
 else
-  JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \
-      $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
+  JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \
+      $(wildcard $(HOTSPOT_DIST)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
 endif
 
 ifneq ($(OPENJDK_TARGET_OS), windows)
--- a/jdk/test/ProblemList.txt	Thu Mar 26 16:17:33 2015 +0100
+++ b/jdk/test/ProblemList.txt	Sun Mar 29 09:21:15 2015 -0400
@@ -136,13 +136,6 @@
 
 ############################################################################
 
-# jdk_management
-
-# 8058492
-java/lang/management/ThreadMXBean/FindDeadlocks.java                                      generic-all
-
-############################################################################
-
 # jdk_jmx
 
 # 8030957
--- a/jdk/test/java/lang/instrument/RedefineMethodInBacktrace.sh	Thu Mar 26 16:17:33 2015 +0100
+++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktrace.sh	Sun Mar 29 09:21:15 2015 -0400
@@ -77,7 +77,7 @@
 
 cat output.log
 
-MESG="Exception"
+MESG="Test failed"
 grep "$MESG" output.log
 result=$?
 if [ "$result" = 0 ]; then
--- a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceApp.java	Thu Mar 26 16:17:33 2015 +0100
+++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceApp.java	Sun Mar 29 09:21:15 2015 -0400
@@ -46,12 +46,15 @@
  * could be freed, since class redefinition didn't know about the backtraces.
  */
 public class RedefineMethodInBacktraceApp {
+    static boolean failed = false;
+
     public static void main(String args[]) throws Exception {
         System.out.println("Hello from RedefineMethodInBacktraceApp!");
-
         new RedefineMethodInBacktraceApp().doTest();
 
-        System.exit(0);
+        if (failed) {
+            throw new Exception("ERROR: RedefineMethodInBacktraceApp failed.");
+        }
     }
 
     public static CountDownLatch stop = new CountDownLatch(1);
@@ -63,13 +66,18 @@
     }
 
     private void doMethodInBacktraceTest() throws Exception {
-        Throwable t = getThrowableFromMethodToRedefine();
+        Throwable t1 = getThrowableFromMethodToRedefine();
+        Throwable t2 = getThrowableFromMethodToDelete();
 
         doRedefine(RedefineMethodInBacktraceTarget.class);
 
         doClassUnloading();
 
-        touchRedefinedMethodInBacktrace(t);
+        System.out.println("checking backtrace for throwable from methodToRedefine");
+        touchRedefinedMethodInBacktrace(t1);
+
+        System.out.println("checking backtrace for throwable from methodToDelete");
+        touchRedefinedMethodInBacktrace(t2);
     }
 
     private void doMethodInBacktraceTestB() throws Exception {
@@ -115,6 +123,10 @@
             if (!(thrownFromMethodToRedefine instanceof RuntimeException)) {
                 throw e;
             }
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.out.println("\nTest failed: unexpected exception: " + e.toString());
+            failed = true;
         }
         method = null;
         c = null;
@@ -122,15 +134,49 @@
         return thrownFromMethodToRedefine;
     }
 
+    private static Throwable getThrowableFromMethodToDelete() throws Exception {
+        Class<RedefineMethodInBacktraceTarget> c =
+                RedefineMethodInBacktraceTarget.class;
+        Method method = c.getMethod("callMethodToDelete");
+
+        Throwable thrownFromMethodToDelete = null;
+        try {
+            method.invoke(null);
+        } catch (InvocationTargetException e) {
+            thrownFromMethodToDelete = e.getCause();
+            if (!(thrownFromMethodToDelete instanceof RuntimeException)) {
+                throw e;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.out.println("\nTest failed: unexpected exception: " + e.toString());
+            failed = true;
+        }
+        return thrownFromMethodToDelete;
+    }
+
+
     private static void doClassUnloading() {
         // This will clean out old, unused redefined methods.
         System.gc();
     }
 
     private static void touchRedefinedMethodInBacktrace(Throwable throwable) {
+        throwable.printStackTrace();
         // Make sure that we can convert the backtrace, which is referring to
         // the redefined method, to a  StrackTraceElement[] without crashing.
-        throwable.getStackTrace();
+        StackTraceElement[] stackTrace = throwable.getStackTrace();
+        for (int i = 0; i < stackTrace.length; i++) {
+          StackTraceElement frame = stackTrace[i];
+          if (frame.getClassName() == null) {
+              System.out.println("\nTest failed: trace[" + i + "].getClassName() returned null");
+              failed = true;
+          }
+          if (frame.getMethodName() == null) {
+              System.out.println("\nTest failed: trace[" + i + "].getMethodName() returned null");
+              failed = true;
+          }
+        }
     }
 
     private static void doRedefine(Class<?> clazz) throws Exception {
--- a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget.java	Thu Mar 26 16:17:33 2015 +0100
+++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget.java	Sun Mar 29 09:21:15 2015 -0400
@@ -29,4 +29,13 @@
     public static void methodToRedefine() {
         throw new RuntimeException("Test exception");
     }
+
+    public static void callMethodToDelete() {
+        methodToDelete();
+    }
+
+    private static void methodToDelete() {
+        throw new RuntimeException("Test exception in methodToDelete");
+    }
+
 }
--- a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB.java	Thu Mar 26 16:17:33 2015 +0100
+++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB.java	Sun Mar 29 09:21:15 2015 -0400
@@ -37,4 +37,16 @@
             // ignore, test will fail
         }
     }
+
+    public static void callMethodToDelete() {
+        try {
+            // signal that we are here
+            RedefineMethodInBacktraceApp.called.countDown();
+
+            // wait until test is done
+            RedefineMethodInBacktraceApp.stop.await();
+        } catch (InterruptedException ex) {
+            // ignore, test will fail
+        }
+    }
 }
--- a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB_2.java	Thu Mar 26 16:17:33 2015 +0100
+++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTargetB_2.java	Sun Mar 29 09:21:15 2015 -0400
@@ -28,4 +28,7 @@
 public class RedefineMethodInBacktraceTargetB {
     public static void methodToRedefine() {
     }
+
+    public static void callMethodToDelete() {
+    }
 }
--- a/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget_2.java	Thu Mar 26 16:17:33 2015 +0100
+++ b/jdk/test/java/lang/instrument/RedefineMethodInBacktraceTarget_2.java	Sun Mar 29 09:21:15 2015 -0400
@@ -29,4 +29,8 @@
     public static void methodToRedefine() {
         throw new RuntimeException("Test exception 2");
     }
+
+    public static void callMethodToDelete() {
+        throw new RuntimeException("Test exception 2 in callMethodToDelete");
+    }
 }
--- a/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java	Thu Mar 26 16:17:33 2015 +0100
+++ b/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java	Sun Mar 29 09:21:15 2015 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -25,6 +25,7 @@
 /*
  * @test
  * @bug     5086470
+ * @key intermittent
  * @summary Basic Test for the following methods:
  *          - ThreadMXBean.findDeadlockedThreads()
  *          - ThreadMXBean.findMonitorDeadlockedThreads()
--- a/jdk/test/sun/tools/jps/JpsHelper.java	Thu Mar 26 16:17:33 2015 +0100
+++ b/jdk/test/sun/tools/jps/JpsHelper.java	Sun Mar 29 09:21:15 2015 -0400
@@ -151,6 +151,7 @@
      */
     public static OutputAnalyzer jps(List<String> vmArgs, List<String> toolArgs) throws Exception {
         JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jps");
+        launcher.addVMArg("-XX:+UsePerfData");
         if (vmArgs != null) {
             for (String vmArg : vmArgs) {
                 launcher.addVMArg(vmArg);