Merge
authorjwilhelm
Mon, 05 Jan 2015 15:00:30 +0100
changeset 28377 008dc727cf75
parent 28371 92e60e58ba8b (diff)
parent 28376 0845d2f43ff4 (current diff)
child 28378 b789f366d4c7
Merge
--- a/hotspot/agent/make/Makefile	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/agent/make/Makefile	Mon Jan 05 15:00:30 2015 +0100
@@ -58,15 +58,19 @@
 sun.jvm.hotspot.debugger.dummy \
 sun.jvm.hotspot.debugger.linux \
 sun.jvm.hotspot.debugger.linux.amd64 \
+sun.jvm.hotspot.debugger.linux.ppc64 \
 sun.jvm.hotspot.debugger.linux.x86 \
 sun.jvm.hotspot.debugger.posix \
 sun.jvm.hotspot.debugger.posix.elf \
+sun.jvm.hotspot.debugger.ppc64 \
 sun.jvm.hotspot.debugger.proc \
 sun.jvm.hotspot.debugger.proc.amd64 \
+sun.jvm.hotspot.debugger.proc.ppc64 \
 sun.jvm.hotspot.debugger.proc.sparc \
 sun.jvm.hotspot.debugger.proc.x86 \
 sun.jvm.hotspot.debugger.remote \
 sun.jvm.hotspot.debugger.remote.amd64 \
+sun.jvm.hotspot.debugger.remote.ppc64 \
 sun.jvm.hotspot.debugger.remote.sparc \
 sun.jvm.hotspot.debugger.remote.x86 \
 sun.jvm.hotspot.debugger.sparc \
@@ -93,9 +97,11 @@
 sun.jvm.hotspot.runtime.bsd_x86 \
 sun.jvm.hotspot.runtime.linux \
 sun.jvm.hotspot.runtime.linux_amd64 \
+sun.jvm.hotspot.runtime.linux_ppc64 \
 sun.jvm.hotspot.runtime.linux_sparc \
 sun.jvm.hotspot.runtime.linux_x86 \
 sun.jvm.hotspot.runtime.posix \
+sun.jvm.hotspot.runtime.ppc64 \
 sun.jvm.hotspot.runtime.solaris_amd64 \
 sun.jvm.hotspot.runtime.solaris_sparc \
 sun.jvm.hotspot.runtime.solaris_x86 \
@@ -142,15 +148,19 @@
 sun/jvm/hotspot/debugger/cdbg/basic/x86/*.java \
 sun/jvm/hotspot/debugger/dummy/*.java \
 sun/jvm/hotspot/debugger/linux/*.java \
+sun/jvm/hotspot/debugger/linux/ppc64/*.java \
 sun/jvm/hotspot/debugger/linux/x86/*.java \
 sun/jvm/hotspot/debugger/posix/*.java \
 sun/jvm/hotspot/debugger/posix/elf/*.java \
+sun/jvm/hotspot/debugger/ppc64/*.java \
 sun/jvm/hotspot/debugger/proc/*.java \
 sun/jvm/hotspot/debugger/proc/amd64/*.java \
+sun/jvm/hotspot/debugger/proc/ppc64/*.java \
 sun/jvm/hotspot/debugger/proc/sparc/*.java \
 sun/jvm/hotspot/debugger/proc/x86/*.java \
 sun/jvm/hotspot/debugger/remote/*.java \
 sun/jvm/hotspot/debugger/remote/amd64/*.java \
+sun/jvm/hotspot/debugger/remote/ppc64/*.java \
 sun/jvm/hotspot/debugger/remote/sparc/*.java \
 sun/jvm/hotspot/debugger/remote/x86/*.java \
 sun/jvm/hotspot/debugger/sparc/*.java \
@@ -174,9 +184,11 @@
 sun/jvm/hotspot/runtime/bsd_x86/*.java \
 sun/jvm/hotspot/runtime/linux/*.java \
 sun/jvm/hotspot/runtime/linux_amd64/*.java \
+sun/jvm/hotspot/runtime/linux_ppc64/*.java \
 sun/jvm/hotspot/runtime/linux_sparc/*.java \
 sun/jvm/hotspot/runtime/linux_x86/*.java \
 sun/jvm/hotspot/runtime/posix/*.java \
+sun/jvm/hotspot/runtime/ppc64/*.java \
 sun/jvm/hotspot/runtime/solaris_amd64/*.java \
 sun/jvm/hotspot/runtime/solaris_sparc/*.java \
 sun/jvm/hotspot/runtime/solaris_x86/*.java \
--- a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c	Mon Jan 05 15:00:30 2015 +0100
@@ -49,6 +49,10 @@
 #include "sun_jvm_hotspot_debugger_sparc_SPARCThreadContext.h"
 #endif
 
+#ifdef ppc64
+#include "sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext.h"
+#endif
+
 static jfieldID p_ps_prochandle_ID = 0;
 static jfieldID threadList_ID = 0;
 static jfieldID loadObjectList_ID = 0;
@@ -341,7 +345,7 @@
   return (err == PS_OK)? array : 0;
 }
 
-#if defined(i386) || defined(amd64) || defined(sparc) || defined(sparcv9)
+#if defined(i386) || defined(amd64) || defined(sparc) || defined(sparcv9) | defined(ppc64)
 JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_getThreadIntegerRegisterSet0
   (JNIEnv *env, jobject this_obj, jint lwp_id) {
 
@@ -366,6 +370,10 @@
 #if defined(sparc) || defined(sparcv9)
 #define NPRGREG sun_jvm_hotspot_debugger_sparc_SPARCThreadContext_NPRGREG
 #endif
+#ifdef ppc64
+#define NPRGREG sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext_NPRGREG
+#endif
+
 
   array = (*env)->NewLongArray(env, NPRGREG);
   CHECK_EXCEPTION_(0);
@@ -458,6 +466,45 @@
   regs[REG_INDEX(R_O7)]  = gregs.u_regs[14];
 #endif /* sparc */
 
+#ifdef ppc64
+#define REG_INDEX(reg) sun_jvm_hotspot_debugger_ppc64_PPC64ThreadContext_##reg
+
+  regs[REG_INDEX(LR)] = gregs.link;
+  regs[REG_INDEX(NIP)] = gregs.nip;
+  regs[REG_INDEX(R0)]  = gregs.gpr[0];
+  regs[REG_INDEX(R1)]  = gregs.gpr[1];
+  regs[REG_INDEX(R2)]  = gregs.gpr[2];
+  regs[REG_INDEX(R3)]  = gregs.gpr[3];
+  regs[REG_INDEX(R4)]  = gregs.gpr[4];
+  regs[REG_INDEX(R5)]  = gregs.gpr[5];
+  regs[REG_INDEX(R6)]  = gregs.gpr[6];
+  regs[REG_INDEX(R7)]  = gregs.gpr[7];
+  regs[REG_INDEX(R8)]  = gregs.gpr[8];
+  regs[REG_INDEX(R9)]  = gregs.gpr[9];
+  regs[REG_INDEX(R10)] = gregs.gpr[10];
+  regs[REG_INDEX(R11)] = gregs.gpr[11];
+  regs[REG_INDEX(R12)] = gregs.gpr[12];
+  regs[REG_INDEX(R13)] = gregs.gpr[13];
+  regs[REG_INDEX(R14)] = gregs.gpr[14];
+  regs[REG_INDEX(R15)] = gregs.gpr[15];
+  regs[REG_INDEX(R16)] = gregs.gpr[16];
+  regs[REG_INDEX(R17)] = gregs.gpr[17];
+  regs[REG_INDEX(R18)] = gregs.gpr[18];
+  regs[REG_INDEX(R19)] = gregs.gpr[19];
+  regs[REG_INDEX(R20)] = gregs.gpr[20];
+  regs[REG_INDEX(R21)] = gregs.gpr[21];
+  regs[REG_INDEX(R22)] = gregs.gpr[22];
+  regs[REG_INDEX(R23)] = gregs.gpr[23];
+  regs[REG_INDEX(R24)] = gregs.gpr[24];
+  regs[REG_INDEX(R25)] = gregs.gpr[25];
+  regs[REG_INDEX(R26)] = gregs.gpr[26];
+  regs[REG_INDEX(R27)] = gregs.gpr[27];
+  regs[REG_INDEX(R28)] = gregs.gpr[28];
+  regs[REG_INDEX(R29)] = gregs.gpr[29];
+  regs[REG_INDEX(R30)] = gregs.gpr[30];
+  regs[REG_INDEX(R31)] = gregs.gpr[31];
+
+#endif
 
   (*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT);
   return array;
--- a/hotspot/agent/src/os/linux/symtab.c	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/agent/src/os/linux/symtab.c	Mon Jan 05 15:00:30 2015 +0100
@@ -325,6 +325,12 @@
 
   // Reading of elf header
   struct elf_section *scn_cache = NULL;
+#if defined(ppc64) && !defined(ABI_ELFv2)
+  // Only big endian ppc64 (i.e. ABI_ELFv1) has 'official procedure descriptors' in ELF files
+  // see: http://refspecs.linuxfoundation.org/LSB_3.1.1/LSB-Core-PPC64/LSB-Core-PPC64/specialsections.html
+  struct elf_section *opd_sect = NULL;
+  ELF_SHDR *opd = NULL;
+#endif
   int cnt = 0;
   ELF_SHDR* shbuf = NULL;
   ELF_SHDR* cursct = NULL;
@@ -368,6 +374,14 @@
     cursct++;
   }
 
+#if defined(ppc64) && !defined(ABI_ELFv2)
+  opd_sect = find_section_by_name(".opd", fd, &ehdr, scn_cache);
+  if (opd_sect != NULL && opd_sect->c_data != NULL && opd_sect->c_shdr != NULL) {
+    // plausibility check
+    opd = opd_sect->c_shdr;
+  }
+#endif
+
   for (cnt = 1; cnt < ehdr.e_shnum; cnt++) {
     ELF_SHDR *shdr = scn_cache[cnt].c_shdr;
 
@@ -412,6 +426,7 @@
       // copy symbols info our symtab and enter them info the hash table
       for (j = 0; j < n; j++, syms++) {
         ENTRY item, *ret;
+        uintptr_t sym_value;
         char *sym_name = symtab->strs + syms->st_name;
 
         // skip non-object and non-function symbols
@@ -422,9 +437,19 @@
         if (*sym_name == '\0' || syms->st_shndx == SHN_UNDEF) continue;
 
         symtab->symbols[j].name   = sym_name;
-        symtab->symbols[j].offset = syms->st_value - baseaddr;
         symtab->symbols[j].size   = syms->st_size;
+        sym_value = syms->st_value;
 
+#if defined(ppc64) && !defined(ABI_ELFv2)
+        // see hotspot/src/share/vm/utilities/elfFuncDescTable.hpp for a detailed description
+        // of why we have to go this extra way via the '.opd' section on big endian ppc64
+        if (opd != NULL && *sym_name != '.' &&
+            (opd->sh_addr <= sym_value && sym_value <= opd->sh_addr + opd->sh_size)) {
+          sym_value = ((ELF_ADDR*)opd_sect->c_data)[(sym_value - opd->sh_addr) / sizeof(ELF_ADDR*)];
+        }
+#endif
+
+        symtab->symbols[j].offset = sym_value - baseaddr;
         item.key = sym_name;
         item.data = (void *)&(symtab->symbols[j]);
 
@@ -433,9 +458,17 @@
     }
   }
 
+#if defined(ppc64) && !defined(ABI_ELFv2)
+  // On Linux/PPC64 the debuginfo files contain an empty function descriptor
+  // section (i.e. '.opd' section) which makes the resolution of symbols
+  // with the above algorithm impossible (we would need the have both, the
+  // .opd section from the library and the symbol table from the debuginfo
+  // file which doesn't match with the current workflow.)
+  goto quit;
+#endif
+
   // Look for a separate debuginfo file.
   if (try_debuginfo) {
-
     // We prefer a debug symtab to an object's own symtab, so look in
     // the debuginfo file.  We stash a copy of the old symtab in case
     // there is no debuginfo.
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionPPC64.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionPPC64.java	Mon Jan 05 15:00:30 2015 +0100
@@ -34,6 +34,6 @@
   }
 
   public boolean isBigEndian() {
-    return true;
+    return "big".equals(System.getProperty("sun.cpu.endian"));
   }
 }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,14 +26,17 @@
 
 import java.io.*;
 import java.util.*;
+
 import sun.jvm.hotspot.debugger.*;
 import sun.jvm.hotspot.debugger.cdbg.*;
 import sun.jvm.hotspot.debugger.x86.*;
 import sun.jvm.hotspot.debugger.amd64.*;
 import sun.jvm.hotspot.debugger.sparc.*;
+import sun.jvm.hotspot.debugger.ppc64.*;
 import sun.jvm.hotspot.debugger.linux.x86.*;
 import sun.jvm.hotspot.debugger.linux.amd64.*;
 import sun.jvm.hotspot.debugger.linux.sparc.*;
+import sun.jvm.hotspot.debugger.linux.ppc64.*;
 import sun.jvm.hotspot.utilities.*;
 
 class LinuxCDebugger implements CDebugger {
@@ -96,7 +99,14 @@
        Address pc  = context.getRegisterAsAddress(SPARCThreadContext.R_O7);
        if (pc == null) return null;
        return new LinuxSPARCCFrame(dbg, sp, pc, LinuxDebuggerLocal.getAddressSize());
-    } else {
+    }  else if (cpu.equals("ppc64")) {
+        PPC64ThreadContext context = (PPC64ThreadContext) thread.getContext();
+        Address sp = context.getRegisterAsAddress(PPC64ThreadContext.SP);
+        if (sp == null) return null;
+        Address pc  = context.getRegisterAsAddress(PPC64ThreadContext.PC);
+        if (pc == null) return null;
+        return new LinuxPPC64CFrame(dbg, sp, pc, LinuxDebuggerLocal.getAddressSize());
+     } else {
        // Runtime exception thrown by LinuxThreadContextFactory if unknown cpu
        ThreadContext context = (ThreadContext) thread.getContext();
        return context.getTopFrame(dbg);
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java	Mon Jan 05 15:00:30 2015 +0100
@@ -29,6 +29,7 @@
 import sun.jvm.hotspot.debugger.linux.amd64.*;
 import sun.jvm.hotspot.debugger.linux.ia64.*;
 import sun.jvm.hotspot.debugger.linux.x86.*;
+import sun.jvm.hotspot.debugger.linux.ppc64.*;
 import sun.jvm.hotspot.debugger.linux.sparc.*;
 
 class LinuxThreadContextFactory {
@@ -42,6 +43,8 @@
          return new LinuxIA64ThreadContext(dbg);
       } else if (cpu.equals("sparc")) {
          return new LinuxSPARCThreadContext(dbg);
+      }  else if (cpu.equals("ppc64")) {
+          return new LinuxPPC64ThreadContext(dbg);
       } else  {
         try {
           Class tcc = Class.forName("sun.jvm.hotspot.debugger.linux." +
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64CFrame.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.debugger.linux.ppc64;
+
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.ppc64.*;
+import sun.jvm.hotspot.debugger.linux.*;
+import sun.jvm.hotspot.debugger.cdbg.*;
+import sun.jvm.hotspot.debugger.cdbg.basic.*;
+
+final public class LinuxPPC64CFrame extends BasicCFrame {
+  // package/class internals only
+
+  public LinuxPPC64CFrame(LinuxDebugger dbg, Address sp, Address pc, int address_size) {
+    super(dbg.getCDebugger());
+    this.sp = sp;
+    this.pc = pc;
+    this.dbg = dbg;
+    this.address_size = address_size;
+  }
+
+  // override base class impl to avoid ELF parsing
+  public ClosestSymbol closestSymbolToPC() {
+    // try native lookup in debugger.
+    return dbg.lookup(dbg.getAddressValue(pc()));
+  }
+
+  public Address pc() {
+    return pc;
+  }
+
+  public Address localVariableBase() {
+    return sp;
+  }
+
+  public CFrame sender(ThreadProxy thread) {
+    if (sp == null) {
+      return null;
+    }
+
+    Address nextSP = sp.getAddressAt(0);
+    if (nextSP == null) {
+      return null;
+    }
+    Address nextPC  = sp.getAddressAt(2 * address_size);
+    if (nextPC == null) {
+      return null;
+    }
+    return new LinuxPPC64CFrame(dbg, nextSP, nextPC, address_size);
+  }
+
+  public static int PPC64_STACK_BIAS = 0;
+  private static int address_size;
+  private Address pc;
+  private Address sp;
+  private LinuxDebugger dbg;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64ThreadContext.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.debugger.linux.ppc64;
+
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.ppc64.*;
+import sun.jvm.hotspot.debugger.linux.*;
+
+public class LinuxPPC64ThreadContext extends PPC64ThreadContext {
+  private LinuxDebugger debugger;
+
+  public LinuxPPC64ThreadContext(LinuxDebugger debugger) {
+    super();
+    this.debugger = debugger;
+  }
+
+  public void setRegisterAsAddress(int index, Address value) {
+    setRegister(index, debugger.getAddressValue(value));
+  }
+
+  public Address getRegisterAsAddress(int index) {
+    return debugger.newAddress(getRegister(index));
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ppc64/PPC64ThreadContext.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.debugger.ppc64;
+
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.cdbg.*;
+
+/** Specifies the thread context on ppc64 platforms; only a sub-portion
+ * of the context is guaranteed to be present on all operating
+ * systems. */
+
+public abstract class PPC64ThreadContext implements ThreadContext {
+
+  // NOTE: The indices for the various registers must be maintained as
+  // listed across various operating systems. However, only a small
+  // subset of the registers' values are guaranteed to be present (and
+  // must be present for the SA's stack walking to work).
+
+  public static final int R31 = 0;
+  public static final int R30 = 1;
+  public static final int R29 = 2;
+  public static final int R28 = 3;
+  public static final int R27 = 4;
+  public static final int R26 = 5;
+  public static final int R25 = 6;
+  public static final int R24 = 7;
+  public static final int R23 = 8;
+  public static final int R22 = 9;
+  public static final int R21 = 10;
+  public static final int R20 = 11;
+  public static final int R19 = 12;
+  public static final int R18 = 13;
+  public static final int R17 = 14;
+  public static final int R16 = 15;
+  public static final int R15 = 16;
+  public static final int R14 = 17;
+  public static final int R13 = 18;
+  public static final int R12 = 19;
+  public static final int R11 = 20;
+  public static final int R10 = 21;
+  public static final int R9 = 22;
+  public static final int R8 = 23;
+  public static final int R7 = 24;
+  public static final int R6 = 25;
+  public static final int R5 = 26;
+  public static final int R4 = 27;
+  public static final int R3 = 28;
+  public static final int R2 = 29;
+  public static final int R1 = 30;
+  public static final int R0 = 31;
+  public static final int NIP = 32;
+  public static final int LR = 33;
+
+  public static final int NPRGREG = 34;
+
+  private static final String[] regNames = {
+    "r31", "r30", "r29", "r28", "r27", "r26", "r25", "r24",
+    "r23", "r22", "r21", "r20", "r19", "r18", "r17", "r16",
+    "r15", "r14", "r13", "r12", "r11", "r10", "r9",  "r8",
+    "r7",  "r6",  "r5",  "r4",  "r3",   "r2", "r1",  "r0",
+    "nip", "link"
+  };
+
+  public static final int PC = NIP;
+  public static final int SP = R1;
+
+  private long[] data;
+
+  public PPC64ThreadContext() {
+    data = new long[NPRGREG];
+  }
+
+  public int getNumRegisters() {
+    return NPRGREG;
+  }
+
+  public String getRegisterName(int index) {
+    return regNames[index];
+  }
+
+  public void setRegister(int index, long value) {
+    data[index] = value;
+  }
+
+  public long getRegister(int index) {
+    return data[index];
+  }
+
+  public CFrame getTopFrame(Debugger dbg) {
+    return null;
+  }
+
+  /** This can't be implemented in this class since we would have to
+   * tie the implementation to, for example, the debugging system */
+  public abstract void setRegisterAsAddress(int index, Address value);
+
+  /** This can't be implemented in this class since we would have to
+   * tie the implementation to, for example, the debugging system */
+  public abstract Address getRegisterAsAddress(int index);
+
+}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java	Mon Jan 05 15:00:30 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -32,7 +32,9 @@
 import sun.jvm.hotspot.debugger.cdbg.*;
 import sun.jvm.hotspot.debugger.proc.amd64.*;
 import sun.jvm.hotspot.debugger.proc.sparc.*;
+import sun.jvm.hotspot.debugger.proc.ppc64.*;
 import sun.jvm.hotspot.debugger.proc.x86.*;
+import sun.jvm.hotspot.debugger.ppc64.*;
 import sun.jvm.hotspot.debugger.amd64.*;
 import sun.jvm.hotspot.debugger.sparc.*;
 import sun.jvm.hotspot.debugger.x86.*;
@@ -86,6 +88,10 @@
             threadFactory = new ProcAMD64ThreadFactory(this);
             pcRegIndex = AMD64ThreadContext.RIP;
             fpRegIndex = AMD64ThreadContext.RBP;
+        } else if (cpu.equals("ppc64")) {
+            threadFactory = new ProcPPC64ThreadFactory(this);
+            pcRegIndex = PPC64ThreadContext.PC;
+            fpRegIndex = PPC64ThreadContext.SP;
         } else {
           try {
             Class tfc = Class.forName("sun.jvm.hotspot.debugger.proc." +
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64Thread.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.debugger.proc.ppc64;
+
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.ppc64.*;
+import sun.jvm.hotspot.debugger.proc.*;
+import sun.jvm.hotspot.utilities.*;
+
+public class ProcPPC64Thread implements ThreadProxy {
+  private ProcDebugger debugger;
+  private int id;
+
+  public ProcPPC64Thread(ProcDebugger debugger, Address addr) {
+    this.debugger = debugger;
+
+    // FIXME: the size here should be configurable. However, making it
+    // so would produce a dependency on the "types" package from the
+    // debugger package, which is not desired.
+    this.id = (int) addr.getCIntegerAt(0, 4, true);
+  }
+
+  public ProcPPC64Thread(ProcDebugger debugger, long id) {
+    this.debugger = debugger;
+    this.id = (int) id;
+  }
+
+  public ThreadContext getContext() throws IllegalThreadStateException {
+    ProcPPC64ThreadContext context = new ProcPPC64ThreadContext(debugger);
+    long[] regs = debugger.getThreadIntegerRegisterSet(id);
+    if (Assert.ASSERTS_ENABLED) {
+      Assert.that(regs.length <= PPC64ThreadContext.NPRGREG, "size of register set is greater than " + PPC64ThreadContext.NPRGREG);
+    }
+    for (int i = 0; i < regs.length; i++) {
+      context.setRegister(i, regs[i]);
+    }
+    return context;
+  }
+
+  public boolean canSetContext() throws DebuggerException {
+    return false;
+  }
+
+  public void setContext(ThreadContext context)
+    throws IllegalThreadStateException, DebuggerException {
+    throw new DebuggerException("Unimplemented");
+  }
+
+  public String toString() {
+    return "t@" + id;
+  }
+
+  public boolean equals(Object obj) {
+    if ((obj == null) || !(obj instanceof ProcPPC64Thread)) {
+      return false;
+    }
+
+    return (((ProcPPC64Thread) obj).id == id);
+  }
+
+  public int hashCode() {
+    return id;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadContext.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.debugger.proc.ppc64;
+
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.ppc64.*;
+import sun.jvm.hotspot.debugger.proc.*;
+
+public class ProcPPC64ThreadContext extends PPC64ThreadContext {
+  private ProcDebugger debugger;
+
+  public ProcPPC64ThreadContext(ProcDebugger debugger) {
+    super();
+    this.debugger = debugger;
+  }
+
+  public void setRegisterAsAddress(int index, Address value) {
+    setRegister(index, debugger.getAddressValue(value));
+  }
+
+  public Address getRegisterAsAddress(int index) {
+    return debugger.newAddress(getRegister(index));
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadFactory.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.debugger.proc.ppc64;
+
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.proc.*;
+
+public class ProcPPC64ThreadFactory implements ProcThreadFactory {
+  private ProcDebugger debugger;
+
+  public ProcPPC64ThreadFactory(ProcDebugger debugger) {
+    this.debugger = debugger;
+  }
+
+  public ThreadProxy createThreadWrapper(Address threadIdentifierAddr) {
+    return new ProcPPC64Thread(debugger, threadIdentifierAddr);
+  }
+
+  public ThreadProxy createThreadWrapper(long id) {
+    return new ProcPPC64Thread(debugger, id);
+  }
+}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java	Mon Jan 05 15:00:30 2015 +0100
@@ -33,6 +33,7 @@
 import sun.jvm.hotspot.debugger.remote.sparc.*;
 import sun.jvm.hotspot.debugger.remote.x86.*;
 import sun.jvm.hotspot.debugger.remote.amd64.*;
+import sun.jvm.hotspot.debugger.remote.ppc64.*;
 
 /** An implementation of Debugger which wraps a
     RemoteDebugger, providing remote debugging via RMI.
@@ -70,6 +71,11 @@
         cachePageSize = 4096;
         cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize);
         unalignedAccessesOkay = true;
+      } else if (cpu.equals("ppc64")) {
+        threadFactory = new RemotePPC64ThreadFactory(this);
+        cachePageSize = 4096;
+        cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize);
+        unalignedAccessesOkay = true;
       } else {
         try {
           Class tf = Class.forName("sun.jvm.hotspot.debugger.remote." +
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64Thread.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.debugger.remote.ppc64;
+
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.ppc64.*;
+import sun.jvm.hotspot.debugger.remote.*;
+import sun.jvm.hotspot.utilities.*;
+
+public class RemotePPC64Thread extends RemoteThread  {
+  public RemotePPC64Thread(RemoteDebuggerClient debugger, Address addr) {
+    super(debugger, addr);
+  }
+
+  public RemotePPC64Thread(RemoteDebuggerClient debugger, long id) {
+    super(debugger, id);
+  }
+
+  public ThreadContext getContext() throws IllegalThreadStateException {
+    RemotePPC64ThreadContext context = new RemotePPC64ThreadContext(debugger);
+    long[] regs = (addr != null)? debugger.getThreadIntegerRegisterSet(addr) :
+                                  debugger.getThreadIntegerRegisterSet(id);
+    if (Assert.ASSERTS_ENABLED) {
+      Assert.that(regs.length == PPC64ThreadContext.NPRGREG, "size of register set must match");
+    }
+    for (int i = 0; i < regs.length; i++) {
+      context.setRegister(i, regs[i]);
+    }
+    return context;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadContext.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.debugger.remote.ppc64;
+
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.ppc64.*;
+import sun.jvm.hotspot.debugger.remote.*;
+
+public class RemotePPC64ThreadContext extends PPC64ThreadContext {
+  private RemoteDebuggerClient debugger;
+
+  public RemotePPC64ThreadContext(RemoteDebuggerClient debugger) {
+    super();
+    this.debugger = debugger;
+  }
+
+  /** This can't be implemented in this class since we would have to
+      tie the implementation to, for example, the debugging system */
+  public void setRegisterAsAddress(int index, Address value) {
+    setRegister(index, debugger.getAddressValue(value));
+  }
+
+  /** This can't be implemented in this class since we would have to
+      tie the implementation to, for example, the debugging system */
+  public Address getRegisterAsAddress(int index) {
+    return debugger.newAddress(getRegister(index));
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadFactory.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.debugger.remote.ppc64;
+
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.remote.*;
+
+public class RemotePPC64ThreadFactory implements RemoteThreadFactory {
+  private RemoteDebuggerClient debugger;
+
+  public RemotePPC64ThreadFactory(RemoteDebuggerClient debugger) {
+    this.debugger = debugger;
+  }
+
+  public ThreadProxy createThreadWrapper(Address threadIdentifierAddr) {
+    return new RemotePPC64Thread(debugger, threadIdentifierAddr);
+  }
+
+  public ThreadProxy createThreadWrapper(long id) {
+    return new RemotePPC64Thread(debugger, id);
+  }
+}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,6 +25,7 @@
 package sun.jvm.hotspot.runtime;
 
 import java.util.*;
+
 import sun.jvm.hotspot.debugger.*;
 import sun.jvm.hotspot.types.*;
 import sun.jvm.hotspot.runtime.solaris_sparc.SolarisSPARCJavaThreadPDAccess;
@@ -34,6 +35,7 @@
 import sun.jvm.hotspot.runtime.win32_x86.Win32X86JavaThreadPDAccess;
 import sun.jvm.hotspot.runtime.linux_x86.LinuxX86JavaThreadPDAccess;
 import sun.jvm.hotspot.runtime.linux_amd64.LinuxAMD64JavaThreadPDAccess;
+import sun.jvm.hotspot.runtime.linux_ppc64.LinuxPPC64JavaThreadPDAccess;
 import sun.jvm.hotspot.runtime.linux_sparc.LinuxSPARCJavaThreadPDAccess;
 import sun.jvm.hotspot.runtime.bsd_x86.BsdX86JavaThreadPDAccess;
 import sun.jvm.hotspot.runtime.bsd_amd64.BsdAMD64JavaThreadPDAccess;
@@ -87,6 +89,8 @@
                 access = new LinuxAMD64JavaThreadPDAccess();
             } else if (cpu.equals("sparc")) {
                 access = new LinuxSPARCJavaThreadPDAccess();
+            } else if (cpu.equals("ppc64")) {
+                access = new LinuxPPC64JavaThreadPDAccess();
             } else {
               try {
                 access = (JavaThreadPDAccess)
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VFrame.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VFrame.java	Mon Jan 05 15:00:30 2015 +0100
@@ -78,7 +78,7 @@
         }
 
         if (f.isRuntimeFrame()) {
-          // This is a conversion frame. Skip this frame and try again.
+          // This is a conversion frame or a Stub routine. Skip this frame and try again.
           RegisterMap tempMap = regMap.copy();
           Frame s = f.sender(tempMap);
           return newVFrame(s, tempMap, thread, unsafe, false);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_ppc64/LinuxPPC64JavaThreadPDAccess.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.runtime.linux_ppc64;
+
+import java.io.*;
+import java.util.*;
+
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.ppc64.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.runtime.ppc64.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
+
+public class LinuxPPC64JavaThreadPDAccess implements JavaThreadPDAccess {
+  private static AddressField  osThreadField;
+
+  // Field from OSThread
+  private static CIntegerField osThreadThreadIDField;
+
+  // This is currently unneeded but is being kept in case we change
+  // the currentFrameGuess algorithm
+  private static final long GUESS_SCAN_RANGE = 128 * 1024;
+
+  static {
+    VM.registerVMInitializedObserver(new Observer() {
+        public void update(Observable o, Object data) {
+          initialize(VM.getVM().getTypeDataBase());
+        }
+      });
+  }
+
+  private static synchronized void initialize(TypeDataBase db) {
+    Type type = db.lookupType("JavaThread");
+    osThreadField = type.getAddressField("_osthread");
+
+    Type osThreadType = db.lookupType("OSThread");
+    osThreadThreadIDField = osThreadType.getCIntegerField("_thread_id");
+  }
+
+  public Address getLastJavaFP(Address addr) {
+    return null;
+  }
+
+  public Address getLastJavaPC(Address addr) {
+    return null;
+  }
+
+  public Address getBaseOfStackPointer(Address addr) {
+    return null;
+  }
+
+  public Frame getLastFramePD(JavaThread thread, Address addr) {
+    Address fp = thread.getLastJavaFP();
+    if (fp == null) {
+      return null; // no information
+    }
+    return new PPC64Frame(thread.getLastJavaSP(), fp);
+  }
+
+  public RegisterMap newRegisterMap(JavaThread thread, boolean updateMap) {
+    return new PPC64RegisterMap(thread, updateMap);
+  }
+
+  public Frame getCurrentFrameGuess(JavaThread thread, Address addr) {
+    ThreadProxy t = getThreadProxy(addr);
+    PPC64ThreadContext context = (PPC64ThreadContext) t.getContext();
+    PPC64CurrentFrameGuess guesser = new PPC64CurrentFrameGuess(context, thread);
+    if (!guesser.run(GUESS_SCAN_RANGE)) {
+      return null;
+    }
+    if (guesser.getPC() == null) {
+      return new PPC64Frame(guesser.getSP(), guesser.getFP());
+    } else {
+      return new PPC64Frame(guesser.getSP(), guesser.getFP(), guesser.getPC());
+    }
+  }
+
+  public void printThreadIDOn(Address addr, PrintStream tty) {
+    tty.print(getThreadProxy(addr));
+  }
+
+  public void printInfoOn(Address threadAddr, PrintStream tty) {
+    tty.print("Thread id: ");
+    printThreadIDOn(threadAddr, tty);
+    // tty.println("\nPostJavaState: " + getPostJavaState(threadAddr));
+  }
+
+  public Address getLastSP(Address addr) {
+    ThreadProxy t = getThreadProxy(addr);
+    PPC64ThreadContext context = (PPC64ThreadContext) t.getContext();
+    return context.getRegisterAsAddress(PPC64ThreadContext.SP);
+  }
+
+  public Address getLastFP(Address addr) {
+    return getLastSP(addr).getAddressAt(0);
+  }
+
+  public ThreadProxy getThreadProxy(Address addr) {
+    // Addr is the address of the JavaThread.
+    // Fetch the OSThread (for now and for simplicity, not making a
+    // separate "OSThread" class in this package)
+    Address osThreadAddr = osThreadField.getValue(addr);
+    // Get the address of the _thread_id from the OSThread
+    Address threadIdAddr = osThreadAddr.addOffsetTo(osThreadThreadIDField.getOffset());
+
+    JVMDebugger debugger = VM.getVM().getDebugger();
+    return debugger.getThreadForIdentifierAddress(threadIdAddr);
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64CurrentFrameGuess.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.runtime.ppc64;
+
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.ppc64.*;
+import sun.jvm.hotspot.code.*;
+import sun.jvm.hotspot.interpreter.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.runtime.ppc64.*;
+
+/** <P> Should be able to be used on all ppc64 platforms we support
+    (Linux/ppc64) to implement JavaThread's "currentFrameGuess()"
+    functionality. Input is a PPC64ThreadContext; output is SP, FP,
+    and PC for an PPC64Frame. Instantiation of the PPC64Frame is left
+    to the caller, since we may need to subclass PPC64Frame to support
+    signal handler frames on Unix platforms. </P>
+ */
+
+public class PPC64CurrentFrameGuess {
+  private PPC64ThreadContext context;
+  private JavaThread       thread;
+  private Address          spFound;
+  private Address          fpFound;
+  private Address          pcFound;
+
+  private static final boolean DEBUG;
+  static {
+    DEBUG = System.getProperty("sun.jvm.hotspot.runtime.ppc64.PPC64Frame.DEBUG") != null;
+  }
+
+  public PPC64CurrentFrameGuess(PPC64ThreadContext context,
+                              JavaThread thread) {
+    this.context = context;
+    this.thread  = thread;
+  }
+
+  /** Returns false if not able to find a frame within a reasonable range. */
+  public boolean run(long regionInBytesToSearch) {
+    Address sp = context.getRegisterAsAddress(PPC64ThreadContext.SP);
+    Address pc = context.getRegisterAsAddress(PPC64ThreadContext.PC);
+    if (sp == null) {
+      // Bail out if no last java frame either
+      if (thread.getLastJavaSP() != null) {
+        Address javaSP = thread.getLastJavaSP();
+        Address javaFP = javaSP.getAddressAt(0);
+        setValues(javaSP, javaFP, null);
+        return true;
+      }
+      return false;
+    }
+    /* There is no frame pointer per se for the ppc64 architecture.  To mirror
+     * the behavior of the VM frame manager, we set fp to be the caller's (i.e., "sender's")
+     * stack pointer, which is the back chain value contained in our sp.
+     */
+    Address fp = sp.getAddressAt(0);
+    setValues(null, null, null); // Assume we're not going to find anything
+
+    VM vm = VM.getVM();
+    if (vm.isJavaPCDbg(pc)) {
+      if (vm.isClientCompiler()) {
+        // Topmost frame is a Java frame.
+        if (DEBUG) {
+          System.out.println("CurrentFrameGuess: choosing compiler frame: sp = " +
+                             sp + ", fp = " + fp + ", pc = " + pc);
+        }
+        setValues(sp, fp, pc);
+        return true;
+      } else {
+        if (vm.getInterpreter().contains(pc)) {
+          if (DEBUG) {
+            System.out.println("CurrentFrameGuess: choosing interpreter frame: sp = " +
+                               sp + ", fp = " + fp + ", pc = " + pc);
+          }
+          setValues(sp, fp, pc);
+          return true;
+        }
+
+        // This algorithm takes the current PC as a given and tries to
+        // find the correct corresponding SP by walking up the stack
+        // and repeatedly performing stackwalks (very inefficient).
+        for (long offset = 0;
+             offset < regionInBytesToSearch;
+             offset += vm.getAddressSize()) {
+          try {
+            Address curSP = sp.addOffsetTo(offset);
+            fp = curSP.getAddressAt(0);
+            Frame frame = new PPC64Frame(curSP, fp, pc);
+            RegisterMap map = thread.newRegisterMap(false);
+            while (frame != null) {
+              if (frame.isEntryFrame() && frame.entryFrameIsFirst()) {
+                // We were able to traverse all the way to the
+                // bottommost Java frame.
+                // This sp looks good. Keep it.
+                if (DEBUG) {
+                  System.out.println("CurrentFrameGuess: Choosing sp = " + curSP + ", pc = " + pc);
+                }
+                setValues(curSP, fp, pc);
+                return true;
+              }
+              frame = frame.sender(map);
+            }
+          } catch (Exception e) {
+            if (DEBUG) {
+              System.out.println("CurrentFrameGuess: Exception " + e + " at offset " + offset);
+            }
+            // Bad SP. Try another.
+          }
+        }
+
+        // Were not able to find a plausible SP to go with this PC.
+        // Bail out.
+        return false;
+
+      }
+    } else {
+      // If the current program counter was not known to us as a Java
+      // PC, we currently assume that we are in the run-time system
+      // and attempt to look to thread-local storage for saved java SP.
+      // Note that if this is null (because we were, in fact,
+      // in Java code, i.e., vtable stubs or similar, and the SA
+      // didn't have enough insight into the target VM to understand
+      // that) then we are going to lose the entire stack trace for
+      // the thread, which is sub-optimal. FIXME.
+
+      if (thread.getLastJavaSP() == null) {
+        if (DEBUG) {
+          System.out.println("CurrentFrameGuess: last java sp is null");
+        }
+        return false; // No known Java frames on stack
+      }
+
+      Address javaSP = thread.getLastJavaSP();
+      Address javaFP = javaSP.getAddressAt(0);
+      Address javaPC = thread.getLastJavaPC();
+      if (DEBUG) {
+        System.out.println("CurrentFrameGuess: choosing last Java frame: sp = " +
+                           javaSP + ", fp = " + javaFP + ", pc = " + javaPC);
+      }
+      setValues(javaSP, javaFP, javaPC);
+      return true;
+    }
+  }
+
+  public Address getSP() { return spFound; }
+  public Address getFP() { return fpFound; }
+  /** May be null if getting values from thread-local storage; take
+      care to call the correct PPC64Frame constructor to recover this if
+      necessary */
+  public Address getPC() { return pcFound; }
+
+  private void setValues(Address sp, Address fp, Address pc) {
+    spFound = sp;
+    fpFound = fp;
+    pcFound = pc;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,513 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.runtime.ppc64;
+
+import java.util.*;
+import sun.jvm.hotspot.code.*;
+import sun.jvm.hotspot.compiler.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.oops.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
+
+/** Specialization of and implementation of abstract methods of the
+    Frame class for the ppc64 family of CPUs. */
+
+public class PPC64Frame extends Frame {
+  private static final boolean DEBUG;
+  static {
+    DEBUG = System.getProperty("sun.jvm.hotspot.runtime.ppc64.PPC64Frame.DEBUG") != null;
+  }
+
+  // All frames
+  private static final int SENDER_SP_OFFSET           =  0;
+
+  // Interpreter frames
+  private static final int INTERPRETER_FRAME_MIRROR_OFFSET = -3; // for native calls only
+  private static final int INTERPRETER_FRAME_SENDER_SP_OFFSET = -4;
+  private static final int INTERPRETER_FRAME_LAST_SP_OFFSET = INTERPRETER_FRAME_SENDER_SP_OFFSET - 1;
+  private static final int INTERPRETER_FRAME_MDX_OFFSET = INTERPRETER_FRAME_LAST_SP_OFFSET -1;
+  private static final int INTERPRETER_FRAME_ESP_OFFSET = INTERPRETER_FRAME_MDX_OFFSET - 1;
+  private static final int INTERPRETER_FRAME_BCX_OFFSET = INTERPRETER_FRAME_ESP_OFFSET - 1;
+  private static final int INTERPRETER_FRAME_CACHE_OFFSET =INTERPRETER_FRAME_BCX_OFFSET - 1;
+  private static final int INTERPRETER_FRAME_MONITORS_OFFSET = INTERPRETER_FRAME_CACHE_OFFSET - 1;
+  private static final int INTERPRETER_FRAME_LOCALS_OFFSET = INTERPRETER_FRAME_MONITORS_OFFSET - 1;
+  private static final int INTERPRETER_FRAME_METHOD_OFFSET = INTERPRETER_FRAME_LOCALS_OFFSET - 1;
+  private static final int INTERPRETER_FRAME_INITIAL_SP_OFFSET = INTERPRETER_FRAME_BCX_OFFSET - 1; // FIXME: probably wrong, but unused anyway
+  private static final int INTERPRETER_FRAME_MONITOR_BLOCK_TOP_OFFSET = INTERPRETER_FRAME_INITIAL_SP_OFFSET;
+  private static final int INTERPRETER_FRAME_MONITOR_BLOCK_BOTTOM_OFFSET = INTERPRETER_FRAME_INITIAL_SP_OFFSET;
+
+  // Entry frames
+  private static int ENTRY_FRAME_CALL_WRAPPER_OFFSET;
+
+  // Native frames
+  private static int NATIVE_FRAME_INITIAL_PARAM_OFFSET;
+
+
+  static {
+    VM.registerVMInitializedObserver(new Observer() {
+      public void update(Observable o, Object data) {
+        initialize(VM.getVM().getTypeDataBase());
+      }
+    });
+  }
+
+  private static synchronized void initialize(TypeDataBase db) {
+    int abi_minframe_size = db.lookupIntConstant("frame::abi_minframe_size").intValue();
+    int entry_frame_locals_size = db.lookupIntConstant("frame::entry_frame_locals_size").intValue();
+    int wordLength = (int) VM.getVM().getAddressSize();
+    NATIVE_FRAME_INITIAL_PARAM_OFFSET = -abi_minframe_size/wordLength;
+    ENTRY_FRAME_CALL_WRAPPER_OFFSET = -entry_frame_locals_size/wordLength;
+  }
+
+
+  // an additional field beyond sp and pc:
+  Address raw_fp; // frame pointer
+  private Address raw_unextendedSP;
+
+  private PPC64Frame() {
+  }
+
+  private void adjustForDeopt() {
+    if ( pc != null) {
+      // Look for a deopt pc and if it is deopted convert to original pc
+      CodeBlob cb = VM.getVM().getCodeCache().findBlob(pc);
+      if (cb != null && cb.isJavaMethod()) {
+        NMethod nm = (NMethod) cb;
+        if (pc.equals(nm.deoptHandlerBegin())) {
+          if (Assert.ASSERTS_ENABLED) {
+            Assert.that(this.getUnextendedSP() != null, "null SP in Java frame");
+          }
+          // adjust pc if frame is deoptimized.
+          pc = this.getUnextendedSP().getAddressAt(nm.origPCOffset());
+          deoptimized = true;
+        }
+      }
+    }
+  }
+
+  public PPC64Frame(Address raw_sp, Address raw_fp, Address pc) {
+    this.raw_sp = raw_sp;
+    this.raw_unextendedSP = raw_sp;
+    if (raw_fp == null) {
+      this.raw_fp = raw_sp.getAddressAt(0);
+    } else {
+      this.raw_fp = raw_fp;
+    }
+    if (pc == null) {
+      this.pc = raw_sp.getAddressAt(2 * VM.getVM().getAddressSize());
+    } else {
+      this.pc = pc;
+    }
+    adjustUnextendedSP();
+
+    // Frame must be fully constructed before this call
+    adjustForDeopt();
+
+    if (DEBUG) {
+      System.out.println("PPC64Frame(sp, fp, pc): " + this);
+      dumpStack();
+    }
+  }
+
+  public PPC64Frame(Address raw_sp, Address raw_fp) {
+    this.raw_sp = raw_sp;
+    this.raw_unextendedSP = raw_sp;
+    if (raw_fp == null) {
+      this.raw_fp = raw_sp.getAddressAt(0);
+    } else {
+      this.raw_fp = raw_fp;
+    }
+    this.pc = raw_sp.getAddressAt(2 * VM.getVM().getAddressSize());
+    adjustUnextendedSP();
+
+    // Frame must be fully constructed before this call
+    adjustForDeopt();
+
+    if (DEBUG) {
+      System.out.println("PPC64Frame(sp, fp): " + this);
+      dumpStack();
+    }
+  }
+
+  public PPC64Frame(Address raw_sp, Address raw_unextendedSp, Address raw_fp, Address pc) {
+    this.raw_sp = raw_sp;
+    this.raw_unextendedSP = raw_unextendedSp;
+    if (raw_fp == null) {
+      this.raw_fp = raw_sp.getAddressAt(0);
+    } else {
+      this.raw_fp = raw_fp;
+    }
+    if (pc == null) {
+      this.pc = raw_sp.getAddressAt(2 * VM.getVM().getAddressSize());
+    } else {
+      this.pc = pc;
+    }
+    adjustUnextendedSP();
+
+    // Frame must be fully constructed before this call
+    adjustForDeopt();
+
+    if (DEBUG) {
+      System.out.println("PPC64Frame(sp, unextendedSP, fp, pc): " + this);
+      dumpStack();
+    }
+
+  }
+
+  public Object clone() {
+    PPC64Frame frame = new PPC64Frame();
+    frame.raw_sp = raw_sp;
+    frame.raw_unextendedSP = raw_unextendedSP;
+    frame.raw_fp = raw_fp;
+    frame.pc = pc;
+    frame.deoptimized = deoptimized;
+    return frame;
+  }
+
+  public boolean equals(Object arg) {
+    if (arg == null) {
+      return false;
+    }
+
+    if (!(arg instanceof PPC64Frame)) {
+      return false;
+    }
+
+    PPC64Frame other = (PPC64Frame) arg;
+
+    return (AddressOps.equal(getSP(), other.getSP()) &&
+        AddressOps.equal(getUnextendedSP(), other.getUnextendedSP()) &&
+        AddressOps.equal(getFP(), other.getFP()) &&
+        AddressOps.equal(getPC(), other.getPC()));
+  }
+
+  public int hashCode() {
+    if (raw_sp == null) {
+      return 0;
+    }
+
+    return raw_sp.hashCode();
+  }
+
+  public String toString() {
+    return "sp: " + (getSP() == null ? "null" : getSP().toString()) +
+        ", unextendedSP: " + (getUnextendedSP() == null ? "null" : getUnextendedSP().toString()) +
+        ", fp: " + (getFP() == null ? "null" : getFP().toString()) +
+        ", pc: " + (pc == null ? "null" : pc.toString());
+  }
+
+  // accessors for the instance variables
+  public Address getFP() { return raw_fp; }
+  public Address getSP() { return raw_sp; }
+  public Address getID() { return raw_sp; }
+
+  // FIXME: not implemented yet (should be done for Solaris/PPC64)
+  public boolean isSignalHandlerFrameDbg() { return false; }
+  public int     getSignalNumberDbg()      { return 0;     }
+  public String  getSignalNameDbg()        { return null;  }
+
+  public boolean isInterpretedFrameValid() {
+    if (Assert.ASSERTS_ENABLED) {
+      Assert.that(isInterpretedFrame(), "Not an interpreted frame");
+    }
+
+    // These are reasonable sanity checks
+    if (getFP() == null || getFP().andWithMask(0x3) != null) {
+      return false;
+    }
+
+    if (getSP() == null || getSP().andWithMask(0x3) != null) {
+      return false;
+    }
+
+    // These are hacks to keep us out of trouble.
+    // The problem with these is that they mask other problems
+    if (getFP().lessThanOrEqual(getSP())) {
+      // this attempts to deal with unsigned comparison above
+      return false;
+    }
+
+    if (getFP().minus(getSP()) > 4096 * VM.getVM().getAddressSize()) {
+      // stack frames shouldn't be large.
+      return false;
+    }
+
+    return true;
+  }
+
+  // FIXME: not applicable in current system
+  //  void    patch_pc(Thread* thread, address pc);
+
+  public Frame sender(RegisterMap regMap, CodeBlob cb) {
+    PPC64RegisterMap map = (PPC64RegisterMap) regMap;
+
+    if (Assert.ASSERTS_ENABLED) {
+      Assert.that(map != null, "map must be set");
+    }
+
+    // Default is we done have to follow them. The sender_for_xxx will
+    // update it accordingly
+    map.setIncludeArgumentOops(false);
+
+    if (isEntryFrame()) return senderForEntryFrame(map);
+    if (isInterpretedFrame()) return senderForInterpreterFrame(map);
+
+    if(cb == null) {
+      cb = VM.getVM().getCodeCache().findBlob(getPC());
+    } else {
+      if (Assert.ASSERTS_ENABLED) {
+        Assert.that(cb.equals(VM.getVM().getCodeCache().findBlob(getPC())), "Must be the same");
+      }
+    }
+
+    if (cb != null) {
+      return senderForCompiledFrame(map, cb);
+    }
+
+    // Must be native-compiled frame, i.e. the marshaling code for native
+    // methods that exists in the core system.
+    return new PPC64Frame(getSenderSP(), getLink(), getSenderPC());
+  }
+
+  private Frame senderForEntryFrame(PPC64RegisterMap map) {
+    if (DEBUG) {
+      System.out.println("senderForEntryFrame");
+    }
+    if (Assert.ASSERTS_ENABLED) {
+      Assert.that(map != null, "map must be set");
+    }
+    // Java frame called from C; skip all C frames and return top C
+    // frame of that chunk as the sender
+    PPC64JavaCallWrapper jcw = (PPC64JavaCallWrapper) getEntryFrameCallWrapper();
+    if (Assert.ASSERTS_ENABLED) {
+      Assert.that(!entryFrameIsFirst(), "next Java fp must be non zero");
+      Assert.that(jcw.getLastJavaSP().greaterThan(getSP()), "must be above this frame on stack");
+    }
+    PPC64Frame fr;
+    if (jcw.getLastJavaPC() != null) {
+      fr = new PPC64Frame(jcw.getLastJavaSP(), jcw.getLastJavaFP(), jcw.getLastJavaPC());
+    } else {
+      fr = new PPC64Frame(jcw.getLastJavaSP(), jcw.getLastJavaFP());
+    }
+    map.clear();
+    if (Assert.ASSERTS_ENABLED) {
+      Assert.that(map.getIncludeArgumentOops(), "should be set by clear");
+    }
+    return fr;
+  }
+
+  //------------------------------------------------------------------------------
+  // frame::adjust_unextended_sp
+  private void adjustUnextendedSP() {
+    raw_unextendedSP = getFP();
+  }
+  private Frame senderForInterpreterFrame(PPC64RegisterMap map) {
+    if (DEBUG) {
+      System.out.println("senderForInterpreterFrame");
+    }
+    Address unextendedSP = addressOfStackSlot(INTERPRETER_FRAME_SENDER_SP_OFFSET).getAddressAt(0);
+    Address sp = getSenderSP();
+
+    return new PPC64Frame(sp, unextendedSP, getLink(), getSenderPC());
+  }
+
+
+  private Frame senderForCompiledFrame(PPC64RegisterMap map, CodeBlob cb) {
+    if (DEBUG) {
+      System.out.println("senderForCompiledFrame");
+    }
+
+    //
+    // NOTE: some of this code is (unfortunately) duplicated in PPC64CurrentFrameGuess
+    //
+
+    if (Assert.ASSERTS_ENABLED) {
+      Assert.that(map != null, "map must be set");
+    }
+
+    // frame owned by optimizing compiler
+    if (Assert.ASSERTS_ENABLED) {
+      Assert.that(cb.getFrameSize() >= 0, "must have non-zero frame size");
+    }
+    Address senderSP = getSenderSP();
+
+    Address senderPC = getSenderPC();
+
+    if (map.getUpdateMap()) {
+      // Tell GC to use argument oopmaps for some runtime stubs that need it.
+      // For C1, the runtime stub might not have oop maps, so set this flag
+      // outside of update_register_map.
+      map.setIncludeArgumentOops(cb.callerMustGCArguments());
+
+      if (cb.getOopMaps() != null) {
+        OopMapSet.updateRegisterMap(this, cb, map, true);
+      }
+    }
+
+    return new PPC64Frame(senderSP, getLink(), senderPC);
+  }
+
+  protected boolean hasSenderPD() {
+    // FIXME
+    return true;
+  }
+
+  public long frameSize() {
+    return (getSenderSP().minus(getSP()) / VM.getVM().getAddressSize());
+  }
+
+  public Address getLink() {
+    return getSenderSP().getAddressAt(0);
+  }
+
+  public Address getUnextendedSP() { return raw_unextendedSP; }
+
+  // Return address:
+  public Address getSenderPC()     { return getSenderSP().getAddressAt(2 * VM.getVM().getAddressSize()); }
+
+  // return address of param, zero origin index.
+  // MPJ note:   Appears to be unused.
+  public Address getNativeParamAddr(int idx) {
+    return null;
+    // return addressOfStackSlot(NATIVE_FRAME_INITIAL_PARAM_OFFSET + idx);
+  }
+
+  public Address getSenderSP()     { return getFP(); }
+  public Address addressOfInterpreterFrameLocals() {
+    return addressOfStackSlot(INTERPRETER_FRAME_LOCALS_OFFSET);
+  }
+
+  private Address addressOfInterpreterFrameBCX() {
+    return addressOfStackSlot(INTERPRETER_FRAME_BCX_OFFSET);
+  }
+
+  public int getInterpreterFrameBCI() {
+    // FIXME: this is not atomic with respect to GC and is unsuitable
+    // for use in a non-debugging, or reflective, system. Need to
+    // figure out how to express this.
+    Address bcp = addressOfInterpreterFrameBCX().getAddressAt(0);
+    Address methodHandle = addressOfInterpreterFrameMethod().getAddressAt(0);
+    Method method = (Method)Metadata.instantiateWrapperFor(methodHandle);
+    return bcpToBci(bcp, method);
+  }
+
+  public Address addressOfInterpreterFrameMDX() {
+    return addressOfStackSlot(INTERPRETER_FRAME_MDX_OFFSET);
+  }
+
+  // FIXME
+  //inline int frame::interpreter_frame_monitor_size() {
+  //  return BasicObjectLock::size();
+  //}
+
+  // expression stack
+  // (the max_stack arguments are used by the GC; see class FrameClosure)
+
+  public Address addressOfInterpreterFrameExpressionStack() {
+    Address monitorEnd = interpreterFrameMonitorEnd().address();
+    return monitorEnd.addOffsetTo(-1 * VM.getVM().getAddressSize());
+  }
+
+  public int getInterpreterFrameExpressionStackDirection() { return -1; }
+
+  // top of expression stack
+  public Address addressOfInterpreterFrameTOS() {
+    return getSP();
+  }
+
+  /** Expression stack from top down */
+  public Address addressOfInterpreterFrameTOSAt(int slot) {
+    return addressOfInterpreterFrameTOS().addOffsetTo(slot * VM.getVM().getAddressSize());
+  }
+
+  public Address getInterpreterFrameSenderSP() {
+    if (Assert.ASSERTS_ENABLED) {
+      Assert.that(isInterpretedFrame(), "interpreted frame expected");
+    }
+    return addressOfStackSlot(INTERPRETER_FRAME_SENDER_SP_OFFSET).getAddressAt(0);
+  }
+
+  // Monitors
+  public BasicObjectLock interpreterFrameMonitorBegin() {
+    return new BasicObjectLock(addressOfStackSlot(INTERPRETER_FRAME_MONITOR_BLOCK_BOTTOM_OFFSET));
+  }
+
+  public BasicObjectLock interpreterFrameMonitorEnd() {
+    Address result = addressOfStackSlot(INTERPRETER_FRAME_MONITOR_BLOCK_TOP_OFFSET).getAddressAt(0);
+    if (Assert.ASSERTS_ENABLED) {
+      // make sure the pointer points inside the frame
+      Assert.that(AddressOps.gt(getFP(), result), "result must <  than frame pointer");
+      Assert.that(AddressOps.lte(getSP(), result), "result must >= than stack pointer");
+    }
+    return new BasicObjectLock(result);
+  }
+
+  public int interpreterFrameMonitorSize() {
+    return BasicObjectLock.size();
+  }
+
+  // Method
+  public Address addressOfInterpreterFrameMethod() {
+    return addressOfStackSlot(INTERPRETER_FRAME_METHOD_OFFSET);
+  }
+
+  // Constant pool cache
+  public Address addressOfInterpreterFrameCPCache() {
+    return addressOfStackSlot(INTERPRETER_FRAME_CACHE_OFFSET);
+  }
+
+  // Entry frames
+  public JavaCallWrapper getEntryFrameCallWrapper() {
+    return new PPC64JavaCallWrapper(addressOfStackSlot(ENTRY_FRAME_CALL_WRAPPER_OFFSET).getAddressAt(0));
+  }
+
+  protected Address addressOfSavedOopResult() {
+    // offset is 2 for compiler2 and 3 for compiler1
+    return getSP().addOffsetTo((VM.getVM().isClientCompiler() ? 2 : 3) *
+        VM.getVM().getAddressSize());
+  }
+
+  protected Address addressOfSavedReceiver() {
+    return getSP().addOffsetTo(-4 * VM.getVM().getAddressSize());
+  }
+
+  private void dumpStack() {
+    if (getFP() != null) {
+      for (Address addr = getSP().addOffsetTo(-5 * VM.getVM().getAddressSize());
+          AddressOps.lte(addr, getFP().addOffsetTo(5 * VM.getVM().getAddressSize()));
+          addr = addr.addOffsetTo(VM.getVM().getAddressSize())) {
+        System.out.println(addr + ": " + addr.getAddressAt(0));
+      }
+    } else {
+      for (Address addr = getSP().addOffsetTo(-5 * VM.getVM().getAddressSize());
+          AddressOps.lte(addr, getSP().addOffsetTo(20 * VM.getVM().getAddressSize()));
+          addr = addr.addOffsetTo(VM.getVM().getAddressSize())) {
+        System.out.println(addr + ": " + addr.getAddressAt(0));
+      }
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64JavaCallWrapper.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.runtime.ppc64;
+
+import java.util.*;
+
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.runtime.*;
+
+public class PPC64JavaCallWrapper extends JavaCallWrapper {
+
+  public PPC64JavaCallWrapper(Address addr) {
+    super(addr);
+  }
+
+  public Address getLastJavaFP() {
+    return null;
+  }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64RegisterMap.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 20014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.runtime.ppc64;
+
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+
+public class PPC64RegisterMap extends RegisterMap {
+
+  /** This is the only public constructor */
+  public PPC64RegisterMap(JavaThread thread, boolean updateMap) {
+    super(thread, updateMap);
+  }
+
+  protected PPC64RegisterMap(RegisterMap map) {
+    super(map);
+  }
+
+  public Object clone() {
+    PPC64RegisterMap retval = new PPC64RegisterMap(this);
+    return retval;
+  }
+
+  // no PD state to clear or copy:
+  protected void clearPD() {}
+  protected void initializePD() {}
+  protected void initializeFromPD(RegisterMap map) {}
+  protected Address getLocationPD(VMReg reg) { return null; }
+}
--- a/hotspot/make/aix/makefiles/ppc64.make	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/make/aix/makefiles/ppc64.make	Mon Jan 05 15:00:30 2015 +0100
@@ -46,7 +46,9 @@
 #  - 1540-1090 (I) The destructor of "..." might not be called.
 #  - 1500-010: (W) WARNING in ...: Infinite loop.  Program may not stop.
 #    There are several infinite loops in the vm, suppress.
-CFLAGS += -qsuppress=1540-1090 -qsuppress=1500-010
+#  - 1540-1639 (I) The behavior of long type bit fields has changed ...
+#                  ... long type bit fields now default to long, not int.
+CFLAGS += -qsuppress=1540-1090 -qsuppress=1500-010 -qsuppress=1540-1639
 
 # Suppress 
 #  - 540-1088 (W) The exception specification is being ignored.
--- a/hotspot/make/aix/makefiles/xlc.make	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/make/aix/makefiles/xlc.make	Mon Jan 05 15:00:30 2015 +0100
@@ -124,7 +124,7 @@
 # MAPFLAG = -Xlinker --version-script=FILENAME
 
 # Build shared library
-SHARED_FLAG = -q64 -b64 -bexpall -G -bnoentry -qmkshrobj -brtl -bnolibpath
+SHARED_FLAG = -q64 -b64 -bexpall -G -bnoentry -qmkshrobj -brtl -bnolibpath -bernotok
 
 #------------------------------------------------------------------------
 # Debug flags
--- a/hotspot/make/linux/makefiles/sa.make	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/make/linux/makefiles/sa.make	Mon Jan 05 15:00:30 2015 +0100
@@ -109,6 +109,7 @@
 	$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext
 	$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
 	$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.sparc.SPARCThreadContext
+	$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.ppc64.PPC64ThreadContext
 	$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.asm.Disassembler
 
 clean:
--- a/hotspot/make/sa.files	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/make/sa.files	Mon Jan 05 15:00:30 2015 +0100
@@ -51,16 +51,20 @@
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/dummy/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/amd64/*.java \
+$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/ppc64/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/x86/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/sparc/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/posix/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/posix/elf/*.java \
+$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/ppc64/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/amd64/*.java \
+$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/ppc64/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/sparc/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/x86/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/remote/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/remote/amd64/*.java \
+$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/remote/ppc64/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/remote/sparc/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/remote/x86/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/sparc/*.java \
@@ -90,12 +94,14 @@
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_amd64/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_x86/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_sparc/*.java \
+$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_ppc64/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/posix/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/solaris_amd64/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/solaris_sparc/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/solaris_x86/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/sparc/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/x86/*.java \
+$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/ppc64/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/tools/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/tools/jcore/*.java \
 $(AGENT_SRC_DIR)/sun/jvm/hotspot/tools/soql/*.java \
--- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -544,6 +544,9 @@
   cmplw(CCR0, Rindex, Rlength);
   sldi(RsxtIndex, RsxtIndex, index_shift);
   blt(CCR0, LnotOOR);
+  // Index should be in R17_tos, array should be in R4_ARG2.
+  mr(R17_tos, Rindex);
+  mr(R4_ARG2, Rarray);
   load_dispatch_table(Rtmp, (address*)Interpreter::_throw_ArrayIndexOutOfBoundsException_entry);
   mtctr(Rtmp);
   bctr();
@@ -1678,6 +1681,228 @@
   }
 }
 
+// Argument and return type profilig.
+// kills: tmp, tmp2, R0, CR0, CR1
+void InterpreterMacroAssembler::profile_obj_type(Register obj, Register mdo_addr_base,
+                                                 RegisterOrConstant mdo_addr_offs, Register tmp, Register tmp2) {
+  Label do_nothing, do_update;
+
+  // tmp2 = obj is allowed
+  assert_different_registers(obj, mdo_addr_base, tmp, R0);
+  assert_different_registers(tmp2, mdo_addr_base, tmp, R0);
+  const Register klass = tmp2;
+
+  verify_oop(obj);
+
+  ld(tmp, mdo_addr_offs, mdo_addr_base);
+
+  // Set null_seen if obj is 0.
+  cmpdi(CCR0, obj, 0);
+  ori(R0, tmp, TypeEntries::null_seen);
+  beq(CCR0, do_update);
+
+  load_klass(klass, obj);
+
+  clrrdi(R0, tmp, exact_log2(-TypeEntries::type_klass_mask));
+  // Basically same as andi(R0, tmp, TypeEntries::type_klass_mask);
+  cmpd(CCR1, R0, klass);
+  // Klass seen before, nothing to do (regardless of unknown bit).
+  //beq(CCR1, do_nothing);
+
+  andi_(R0, klass, TypeEntries::type_unknown);
+  // Already unknown. Nothing to do anymore.
+  //bne(CCR0, do_nothing);
+  crorc(/*CCR0 eq*/2, /*CCR1 eq*/4+2, /*CCR0 eq*/2); // cr0 eq = cr1 eq or cr0 ne
+  beq(CCR0, do_nothing);
+
+  clrrdi_(R0, tmp, exact_log2(-TypeEntries::type_mask));
+  orr(R0, klass, tmp); // Combine klass and null_seen bit (only used if (tmp & type_mask)==0).
+  beq(CCR0, do_update); // First time here. Set profile type.
+
+  // Different than before. Cannot keep accurate profile.
+  ori(R0, tmp, TypeEntries::type_unknown);
+
+  bind(do_update);
+  // update profile
+  std(R0, mdo_addr_offs, mdo_addr_base);
+
+  align(32, 12);
+  bind(do_nothing);
+}
+
+void InterpreterMacroAssembler::profile_arguments_type(Register callee, Register tmp1, Register tmp2, bool is_virtual) {
+  if (!ProfileInterpreter) {
+    return;
+  }
+
+  assert_different_registers(callee, tmp1, tmp2, R28_mdx);
+
+  if (MethodData::profile_arguments() || MethodData::profile_return()) {
+    Label profile_continue;
+
+    test_method_data_pointer(profile_continue);
+
+    int off_to_start = is_virtual ? in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size());
+
+    lbz(tmp1, in_bytes(DataLayout::tag_offset()) - off_to_start, R28_mdx);
+    cmpwi(CCR0, tmp1, is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag);
+    bne(CCR0, profile_continue);
+
+    if (MethodData::profile_arguments()) {
+      Label done;
+      int off_to_args = in_bytes(TypeEntriesAtCall::args_data_offset());
+      add(R28_mdx, off_to_args, R28_mdx);
+
+      for (int i = 0; i < TypeProfileArgsLimit; i++) {
+        if (i > 0 || MethodData::profile_return()) {
+          // If return value type is profiled we may have no argument to profile.
+          ld(tmp1, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args, R28_mdx);
+          cmpdi(CCR0, tmp1, (i+1)*TypeStackSlotEntries::per_arg_count());
+          addi(tmp1, tmp1, -i*TypeStackSlotEntries::per_arg_count());
+          blt(CCR0, done);
+        }
+        ld(tmp1, in_bytes(Method::const_offset()), callee);
+        lhz(tmp1, in_bytes(ConstMethod::size_of_parameters_offset()), tmp1);
+        // Stack offset o (zero based) from the start of the argument
+        // list, for n arguments translates into offset n - o - 1 from
+        // the end of the argument list. But there's an extra slot at
+        // the top of the stack. So the offset is n - o from Lesp.
+        ld(tmp2, in_bytes(TypeEntriesAtCall::stack_slot_offset(i))-off_to_args, R28_mdx);
+        subf(tmp1, tmp2, tmp1);
+
+        sldi(tmp1, tmp1, Interpreter::logStackElementSize);
+        ldx(tmp1, tmp1, R15_esp);
+
+        profile_obj_type(tmp1, R28_mdx, in_bytes(TypeEntriesAtCall::argument_type_offset(i))-off_to_args, tmp2, tmp1);
+
+        int to_add = in_bytes(TypeStackSlotEntries::per_arg_size());
+        addi(R28_mdx, R28_mdx, to_add);
+        off_to_args += to_add;
+      }
+
+      if (MethodData::profile_return()) {
+        ld(tmp1, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args, R28_mdx);
+        addi(tmp1, tmp1, -TypeProfileArgsLimit*TypeStackSlotEntries::per_arg_count());
+      }
+
+      bind(done);
+
+      if (MethodData::profile_return()) {
+        // We're right after the type profile for the last
+        // argument. tmp1 is the number of cells left in the
+        // CallTypeData/VirtualCallTypeData to reach its end. Non null
+        // if there's a return to profile.
+        assert(ReturnTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(), "can't move past ret type");
+        sldi(tmp1, tmp1, exact_log2(DataLayout::cell_size));
+        add(R28_mdx, tmp1, R28_mdx);
+      }
+    } else {
+      assert(MethodData::profile_return(), "either profile call args or call ret");
+      update_mdp_by_constant(in_bytes(TypeEntriesAtCall::return_only_size()));
+    }
+
+    // Mdp points right after the end of the
+    // CallTypeData/VirtualCallTypeData, right after the cells for the
+    // return value type if there's one.
+    align(32, 12);
+    bind(profile_continue);
+  }
+}
+
+void InterpreterMacroAssembler::profile_return_type(Register ret, Register tmp1, Register tmp2) {
+  assert_different_registers(ret, tmp1, tmp2);
+  if (ProfileInterpreter && MethodData::profile_return()) {
+    Label profile_continue;
+
+    test_method_data_pointer(profile_continue);
+
+    if (MethodData::profile_return_jsr292_only()) {
+      // If we don't profile all invoke bytecodes we must make sure
+      // it's a bytecode we indeed profile. We can't go back to the
+      // begining of the ProfileData we intend to update to check its
+      // type because we're right after it and we don't known its
+      // length.
+      lbz(tmp1, 0, R14_bcp);
+      lbz(tmp2, Method::intrinsic_id_offset_in_bytes(), R19_method);
+      cmpwi(CCR0, tmp1, Bytecodes::_invokedynamic);
+      cmpwi(CCR1, tmp1, Bytecodes::_invokehandle);
+      cror(/*CR0 eq*/2, /*CR1 eq*/4+2, /*CR0 eq*/2);
+      cmpwi(CCR1, tmp2, vmIntrinsics::_compiledLambdaForm);
+      cror(/*CR0 eq*/2, /*CR1 eq*/4+2, /*CR0 eq*/2);
+      bne(CCR0, profile_continue);
+    }
+
+    profile_obj_type(ret, R28_mdx, -in_bytes(ReturnTypeEntry::size()), tmp1, tmp2);
+
+    align(32, 12);
+    bind(profile_continue);
+  }
+}
+
+void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4) {
+  if (ProfileInterpreter && MethodData::profile_parameters()) {
+    Label profile_continue, done;
+
+    test_method_data_pointer(profile_continue);
+
+    // Load the offset of the area within the MDO used for
+    // parameters. If it's negative we're not profiling any parameters.
+    lwz(tmp1, in_bytes(MethodData::parameters_type_data_di_offset()) - in_bytes(MethodData::data_offset()), R28_mdx);
+    cmpwi(CCR0, tmp1, 0);
+    blt(CCR0, profile_continue);
+
+    // Compute a pointer to the area for parameters from the offset
+    // and move the pointer to the slot for the last
+    // parameters. Collect profiling from last parameter down.
+    // mdo start + parameters offset + array length - 1
+
+    // Pointer to the parameter area in the MDO.
+    const Register mdp = tmp1;
+    add(mdp, tmp1, R28_mdx);
+
+    // Pffset of the current profile entry to update.
+    const Register entry_offset = tmp2;
+    // entry_offset = array len in number of cells
+    ld(entry_offset, in_bytes(ArrayData::array_len_offset()), mdp);
+
+    int off_base = in_bytes(ParametersTypeData::stack_slot_offset(0));
+    assert(off_base % DataLayout::cell_size == 0, "should be a number of cells");
+
+    // entry_offset (number of cells)  = array len - size of 1 entry + offset of the stack slot field
+    addi(entry_offset, entry_offset, -TypeStackSlotEntries::per_arg_count() + (off_base / DataLayout::cell_size));
+    // entry_offset in bytes
+    sldi(entry_offset, entry_offset, exact_log2(DataLayout::cell_size));
+
+    Label loop;
+    align(32, 12);
+    bind(loop);
+
+    // Load offset on the stack from the slot for this parameter.
+    ld(tmp3, entry_offset, mdp);
+    sldi(tmp3, tmp3, Interpreter::logStackElementSize);
+    neg(tmp3, tmp3);
+    // Read the parameter from the local area.
+    ldx(tmp3, tmp3, R18_locals);
+
+    // Make entry_offset now point to the type field for this parameter.
+    int type_base = in_bytes(ParametersTypeData::type_offset(0));
+    assert(type_base > off_base, "unexpected");
+    addi(entry_offset, entry_offset, type_base - off_base);
+
+    // Profile the parameter.
+    profile_obj_type(tmp3, mdp, entry_offset, tmp4, tmp3);
+
+    // Go to next parameter.
+    int delta = TypeStackSlotEntries::per_arg_count() * DataLayout::cell_size + (type_base - off_base);
+    cmpdi(CCR0, entry_offset, off_base + delta);
+    addi(entry_offset, entry_offset, -delta);
+    bge(CCR0, loop);
+
+    align(32, 12);
+    bind(profile_continue);
+  }
+}
+
 // Add a InterpMonitorElem to stack (see frame_sparc.hpp).
 void InterpreterMacroAssembler::add_monitor_to_stack(bool stack_is_empty, Register Rtemp1, Register Rtemp2) {
 
@@ -2039,20 +2264,19 @@
   bne(CCR0, test);
 
   address fd = CAST_FROM_FN_PTR(address, verify_return_address);
-  unsigned int nbytes_save = 10*8; // 10 volatile gprs
-
-  save_LR_CR(Rtmp);
+  const int nbytes_save = 11*8; // volatile gprs except R0
+  save_volatile_gprs(R1_SP, -nbytes_save); // except R0
+  save_LR_CR(Rtmp); // Save in old frame.
   push_frame_reg_args(nbytes_save, Rtmp);
-  save_volatile_gprs(R1_SP, 112); // except R0
 
   load_const_optimized(Rtmp, fd, R0);
   mr_if_needed(R4_ARG2, reg);
   mr(R3_ARG1, R19_method);
   call_c(Rtmp); // call C
 
-  restore_volatile_gprs(R1_SP, 112); // except R0
   pop_frame();
   restore_LR_CR(Rtmp);
+  restore_volatile_gprs(R1_SP, -nbytes_save); // except R0
   b(skip);
 
   // Perform a more elaborate out-of-line call.
--- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -255,6 +255,12 @@
   void record_klass_in_profile(Register receiver, Register scratch1, Register scratch2, bool is_virtual_call);
   void record_klass_in_profile_helper(Register receiver, Register scratch1, Register scratch2, int start_row, Label& done, bool is_virtual_call);
 
+  // Argument and return type profiling.
+  void profile_obj_type(Register obj, Register mdo_addr_base, RegisterOrConstant mdo_addr_offs, Register tmp, Register tmp2);
+  void profile_arguments_type(Register callee, Register tmp1, Register tmp2, bool is_virtual);
+  void profile_return_type(Register ret, Register tmp1, Register tmp2);
+  void profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4);
+
 #endif // !CC_INTERP
 
   // Debugging
--- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -807,6 +807,7 @@
 
 // For verify_oops.
 void MacroAssembler::save_volatile_gprs(Register dst, int offset) {
+  std(R2,  offset, dst);   offset += 8;
   std(R3,  offset, dst);   offset += 8;
   std(R4,  offset, dst);   offset += 8;
   std(R5,  offset, dst);   offset += 8;
@@ -821,6 +822,7 @@
 
 // For verify_oops.
 void MacroAssembler::restore_volatile_gprs(Register src, int offset) {
+  ld(R2,  offset, src);   offset += 8;
   ld(R3,  offset, src);   offset += 8;
   ld(R4,  offset, src);   offset += 8;
   ld(R5,  offset, src);   offset += 8;
@@ -1187,6 +1189,16 @@
   call_VM(oop_result, entry_point, check_exceptions);
 }
 
+void MacroAssembler::call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, Register arg_3,
+                             bool check_exceptions) {
+  // R3_ARG1 is reserved for the thread
+  mr_if_needed(R4_ARG2, arg_1);
+  assert(arg_2 != R4_ARG2, "smashed argument");
+  mr_if_needed(R5_ARG3, arg_2);
+  mr_if_needed(R6_ARG4, arg_3);
+  call_VM(oop_result, entry_point, check_exceptions);
+}
+
 void MacroAssembler::call_VM_leaf(address entry_point) {
   call_VM_leaf_base(entry_point);
 }
@@ -3059,35 +3071,27 @@
   if (!VerifyOops) {
     return;
   }
-  // Will be preserved.
-  Register tmp = R11;
-  assert(oop != tmp, "precondition");
-  unsigned int nbytes_save = 10*8; // 10 volatile gprs
+
   address/* FunctionDescriptor** */fd = StubRoutines::verify_oop_subroutine_entry_address();
-  // save tmp
-  mr(R0, tmp);
-  // kill tmp
-  save_LR_CR(tmp);
+  const Register tmp = R11; // Will be preserved.
+  const int nbytes_save = 11*8; // Volatile gprs except R0.
+  save_volatile_gprs(R1_SP, -nbytes_save); // except R0
+
+  if (oop == tmp) mr(R4_ARG2, oop);
+  save_LR_CR(tmp); // save in old frame
   push_frame_reg_args(nbytes_save, tmp);
-  // restore tmp
-  mr(tmp, R0);
-  save_volatile_gprs(R1_SP, 112); // except R0
   // load FunctionDescriptor** / entry_address *
-  load_const(tmp, fd);
+  load_const_optimized(tmp, fd, R0);
   // load FunctionDescriptor* / entry_address
   ld(tmp, 0, tmp);
-  mr(R4_ARG2, oop);
-  load_const(R3_ARG1, (address)msg);
-  // call destination for its side effect
+  if (oop != tmp) mr_if_needed(R4_ARG2, oop);
+  load_const_optimized(R3_ARG1, (address)msg, R0);
+  // Call destination for its side effect.
   call_c(tmp);
-  restore_volatile_gprs(R1_SP, 112); // except R0
+
   pop_frame();
-  // save tmp
-  mr(R0, tmp);
-  // kill tmp
   restore_LR_CR(tmp);
-  // restore tmp
-  mr(tmp, R0);
+  restore_volatile_gprs(R1_SP, -nbytes_save); // except R0
 }
 
 const char* stop_types[] = {
--- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -369,6 +369,7 @@
   void call_VM(Register oop_result, address entry_point, bool check_exceptions = true);
   void call_VM(Register oop_result, address entry_point, Register arg_1, bool check_exceptions = true);
   void call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, bool check_exceptions = true);
+  void call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, Register arg3, bool check_exceptions = true);
   void call_VM_leaf(address entry_point);
   void call_VM_leaf(address entry_point, Register arg_1);
   void call_VM_leaf(address entry_point, Register arg_1, Register arg_2);
--- a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -100,10 +100,7 @@
   MacroAssembler* a = new MacroAssembler(&cb);
 
   // Patch the call.
-  if (ReoptimizeCallSequences &&
-      a->is_within_range_of_b(dest, addr_call)) {
-    a->bl(dest);
-  } else {
+  if (!ReoptimizeCallSequences || !a->is_within_range_of_b(dest, addr_call)) {
     address trampoline_stub_addr = get_trampoline();
 
     // We did not find a trampoline stub because the current codeblob
@@ -115,9 +112,12 @@
 
     // Patch the constant in the call's trampoline stub.
     NativeCallTrampolineStub_at(trampoline_stub_addr)->set_destination(dest);
+    dest = trampoline_stub_addr;
+  }
 
-    a->bl(trampoline_stub_addr);
-  }
+  OrderAccess::release();
+  a->bl(dest);
+
   ICache::ppc64_flush_icache_bytes(addr_call, code_size);
 }
 
--- a/hotspot/src/cpu/ppc/vm/ppc.ad	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/cpu/ppc/vm/ppc.ad	Mon Jan 05 15:00:30 2015 +0100
@@ -1936,8 +1936,9 @@
   // --------------------------------------------------------------------
   // Check for hi bits still needing moving. Only happens for misaligned
   // arguments to native calls.
-  if (src_hi == dst_hi)
+  if (src_hi == dst_hi) {
     return ppc64Opcode_none;               // Self copy; no move.
+  }
 
   ShouldNotReachHere();
   return ppc64Opcode_undefined;
@@ -1959,14 +1960,15 @@
 }
 
 uint MachNopNode::size(PhaseRegAlloc *ra_) const {
-   return _count * 4;
+  return _count * 4;
 }
 
 #ifndef PRODUCT
 void BoxLockNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
   int offset = ra_->reg2offset(in_RegMask(0).find_first_elem());
-  int reg = ra_->get_reg_first(this);
-  st->print("ADDI %s, SP, %d \t// box node", Matcher::regName[reg], offset);
+  char reg_str[128];
+  ra_->dump_register(this, reg_str);
+  st->print("ADDI    %s, SP, %d \t// box node", reg_str, offset);
 }
 #endif
 
--- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -91,7 +91,7 @@
 
   // Thread will be loaded to R3_ARG1.
   // Target class oop is in register R5_ARG3 by convention!
-  __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ClassCastException_verbose, R17_tos, R5_ARG3));
+  __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ClassCastException_verbose), R17_tos, R5_ARG3);
   // Above call must not return here since exception pending.
   DEBUG_ONLY(__ should_not_reach_here();)
   return entry;
@@ -172,6 +172,10 @@
   // Compiled code destroys templateTableBase, reload.
   __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R12_scratch2);
 
+  if (state == atos) {
+    __ profile_return_type(R3_RET, R11_scratch1, R12_scratch2);
+  }
+
   const Register cache = R11_scratch1;
   const Register size  = R12_scratch2;
   __ get_cache_and_index_at_bcp(cache, 1, index_size);
@@ -1189,6 +1193,10 @@
       __ li(R0, 1);
       __ stb(R0, in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()), R16_thread);
     }
+
+    // Argument and return type profiling.
+    __ profile_parameters_type(R3_ARG1, R4_ARG2, R5_ARG3, R6_ARG4);
+
     // Increment invocation counter and check for overflow.
     if (inc_counter) {
       generate_counter_incr(&invocation_counter_overflow, &profile_method, &profile_method_continue);
@@ -1469,6 +1477,8 @@
     __ resize_frame_absolute(R12_scratch2, R11_scratch1, R0);
     if (ProfileInterpreter) {
       __ set_method_data_pointer_for_bcp();
+      __ ld(R11_scratch1, 0, R1_SP);
+      __ std(R28_mdx, _ijava_state_neg(mdx), R11_scratch1);
     }
 #if INCLUDE_JVMTI
     Label L_done;
@@ -1480,13 +1490,11 @@
     // The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
     // Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
     __ ld(R4_ARG2, 0, R18_locals);
-    __ call_VM(R11_scratch1, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null),
-               R4_ARG2, R19_method, R14_bcp);
-
-    __ cmpdi(CCR0, R11_scratch1, 0);
+    __ MacroAssembler::call_VM(R4_ARG2, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), R4_ARG2, R19_method, R14_bcp, false);
+    __ restore_interpreter_state(R11_scratch1, /*bcp_and_mdx_only*/ true);
+    __ cmpdi(CCR0, R4_ARG2, 0);
     __ beq(CCR0, L_done);
-
-    __ std(R11_scratch1, wordSize, R15_esp);
+    __ std(R4_ARG2, wordSize, R15_esp);
     __ bind(L_done);
 #endif // INCLUDE_JVMTI
     __ dispatch_next(vtos);
--- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -3235,6 +3235,8 @@
   // Load target.
   __ addi(Rrecv_klass, Rrecv_klass, base + vtableEntry::method_offset_in_bytes());
   __ ldx(Rtarget_method, Rindex, Rrecv_klass);
+  // Argument and return type profiling.
+  __ profile_arguments_type(Rtarget_method, Rrecv_klass /* scratch1 */, Rtemp /* scratch2 */, true);
   __ call_from_interpreter(Rtarget_method, Rret, Rrecv_klass /* scratch1 */, Rtemp /* scratch2 */);
 }
 
@@ -3318,6 +3320,8 @@
   __ null_check_throw(Rrecv, -1, Rscratch1);
 
   __ profile_final_call(Rrecv, Rscratch1);
+  // Argument and return type profiling.
+  __ profile_arguments_type(Rmethod, Rscratch1, Rscratch2, true);
 
   // Do the call.
   __ call_from_interpreter(Rmethod, Rret_addr, Rscratch1, Rscratch2);
@@ -3339,6 +3343,8 @@
   __ null_check_throw(Rreceiver, -1, R11_scratch1);
 
   __ profile_call(R11_scratch1, R12_scratch2);
+  // Argument and return type profiling.
+  __ profile_arguments_type(Rmethod, R11_scratch1, R12_scratch2, false);
   __ call_from_interpreter(Rmethod, Rret_addr, R11_scratch1, R12_scratch2);
 }
 
@@ -3353,6 +3359,8 @@
   prepare_invoke(byte_no, R19_method, Rret_addr, noreg, noreg, Rflags, R11_scratch1);
 
   __ profile_call(R11_scratch1, R12_scratch2);
+  // Argument and return type profiling.
+  __ profile_arguments_type(R19_method, R11_scratch1, R12_scratch2, false);
   __ call_from_interpreter(R19_method, Rret_addr, R11_scratch1, R12_scratch2);
 }
 
@@ -3374,6 +3382,8 @@
 
   // Final call case.
   __ profile_final_call(Rtemp1, Rscratch);
+  // Argument and return type profiling.
+  __ profile_arguments_type(Rindex, Rscratch, Rrecv_klass /* scratch */, true);
   // Do the final call - the index (f2) contains the method.
   __ call_from_interpreter(Rindex, Rret, Rscratch, Rrecv_klass /* scratch */);
 
@@ -3425,6 +3435,8 @@
   __ cmpdi(CCR0, Rindex, 0);
   __ beq(CCR0, Lthrow_ame);
   // Found entry. Jump off!
+  // Argument and return type profiling.
+  __ profile_arguments_type(Rindex, Rscratch1, Rscratch2, true);
   __ call_from_interpreter(Rindex, Rret_addr, Rscratch1, Rscratch2);
 
   // Vtable entry was NULL => Throw abstract method error.
@@ -3468,6 +3480,8 @@
   // to be the callsite object the bootstrap method returned. This is passed to a
   // "link" method which does the dispatch (Most likely just grabs the MH stored
   // inside the callsite and does an invokehandle).
+  // Argument and return type profiling.
+  __ profile_arguments_type(Rmethod, Rscratch1, Rscratch2, false);
   __ call_from_interpreter(Rmethod, Rret_addr, Rscratch1 /* scratch1 */, Rscratch2 /* scratch2 */);
 }
 
@@ -3488,6 +3502,8 @@
   __ profile_final_call(Rrecv, Rscratch1);
 
   // Still no call from handle => We call the method handle interpreter here.
+  // Argument and return type profiling.
+  __ profile_arguments_type(Rmethod, Rscratch1, Rscratch2, true);
   __ call_from_interpreter(Rmethod, Rret_addr, Rscratch1 /* scratch1 */, Rscratch2 /* scratch2 */);
 }
 
--- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -134,13 +134,44 @@
   }
 
   assert(AllocatePrefetchLines > 0, "invalid value");
-  if (AllocatePrefetchLines < 1) // Set valid value in product VM.
+  if (AllocatePrefetchLines < 1) { // Set valid value in product VM.
     AllocatePrefetchLines = 1; // Conservative value.
+  }
 
-  if (AllocatePrefetchStyle == 3 && AllocatePrefetchDistance < cache_line_size)
+  if (AllocatePrefetchStyle == 3 && AllocatePrefetchDistance < cache_line_size) {
     AllocatePrefetchStyle = 1; // Fall back if inappropriate.
+  }
 
   assert(AllocatePrefetchStyle >= 0, "AllocatePrefetchStyle should be positive");
+
+  if (UseCRC32Intrinsics) {
+    if (!FLAG_IS_DEFAULT(UseCRC32Intrinsics))
+      warning("CRC32 intrinsics  are not available on this CPU");
+    FLAG_SET_DEFAULT(UseCRC32Intrinsics, false);
+  }
+
+  // The AES intrinsic stubs require AES instruction support.
+  if (UseAES) {
+    warning("AES instructions are not available on this CPU");
+    FLAG_SET_DEFAULT(UseAES, false);
+  }
+  if (UseAESIntrinsics) {
+    if (!FLAG_IS_DEFAULT(UseAESIntrinsics))
+      warning("AES intrinsics are not available on this CPU");
+    FLAG_SET_DEFAULT(UseAESIntrinsics, false);
+  }
+
+  if (UseSHA) {
+    warning("SHA instructions are not available on this CPU");
+    FLAG_SET_DEFAULT(UseSHA, false);
+  }
+  if (UseSHA1Intrinsics || UseSHA256Intrinsics || UseSHA512Intrinsics) {
+    warning("SHA intrinsics are not available on this CPU");
+    FLAG_SET_DEFAULT(UseSHA1Intrinsics, false);
+    FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
+    FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
+  }
+
 }
 
 void VM_Version::print_features() {
--- a/hotspot/src/os/aix/vm/os_aix.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/os/aix/vm/os_aix.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -124,12 +124,6 @@
 }
 #endif
 
-// Excerpts from systemcfg.h definitions newer than AIX 5.3
-#ifndef PV_7
-# define PV_7 0x200000          // Power PC 7
-# define PV_7_Compat 0x208000   // Power PC 7
-#endif
-
 #define MAX_PATH (2 * K)
 
 // for timer info max values which include all bits
@@ -140,17 +134,40 @@
 #define ERROR_MP_VMGETINFO_FAILED                    102
 #define ERROR_MP_VMGETINFO_CLAIMS_NO_SUPPORT_FOR_64K 103
 
-// the semantics in this file are thus that codeptr_t is a *real code ptr*
+// The semantics in this file are thus that codeptr_t is a *real code ptr*.
 // This means that any function taking codeptr_t as arguments will assume
 // a real codeptr and won't handle function descriptors (eg getFuncName),
 // whereas functions taking address as args will deal with function
-// descriptors (eg os::dll_address_to_library_name)
+// descriptors (eg os::dll_address_to_library_name).
 typedef unsigned int* codeptr_t;
 
-// typedefs for stackslots, stack pointers, pointers to op codes
+// Typedefs for stackslots, stack pointers, pointers to op codes.
 typedef unsigned long stackslot_t;
 typedef stackslot_t* stackptr_t;
 
+// Excerpts from systemcfg.h definitions newer than AIX 5.3.
+#ifndef PV_7
+#define PV_7 0x200000          /* Power PC 7 */
+#define PV_7_Compat 0x208000   /* Power PC 7 */
+#endif
+#ifndef PV_8
+#define PV_8 0x300000          /* Power PC 8 */
+#define PV_8_Compat 0x308000   /* Power PC 8 */
+#endif
+
+#define trcVerbose(fmt, ...) { /* PPC port */  \
+  if (Verbose) { \
+    fprintf(stderr, fmt, ##__VA_ARGS__); \
+    fputc('\n', stderr); fflush(stderr); \
+  } \
+}
+#define trc(fmt, ...)        /* PPC port */
+
+#define ERRBYE(s) { \
+    trcVerbose(s); \
+    return -1; \
+}
+
 // query dimensions of the stack of the calling thread
 static void query_stack_dimensions(address* p_stack_base, size_t* p_stack_size);
 
@@ -182,12 +199,12 @@
   return true;
 }
 
-// macro to check a given stack pointer against given stack limits and to die if test fails
+// Macro to check a given stack pointer against given stack limits and to die if test fails.
 #define CHECK_STACK_PTR(sp, stack_base, stack_size) { \
     guarantee(is_valid_stackpointer((stackptr_t)(sp), (stackptr_t)(stack_base), stack_size), "Stack Pointer Invalid"); \
 }
 
-// macro to check the current stack pointer against given stacklimits
+// Macro to check the current stack pointer against given stacklimits.
 #define CHECK_CURRENT_STACK_PTR(stack_base, stack_size) { \
   address sp; \
   sp = os::current_stack_pointer(); \
@@ -221,7 +238,7 @@
 static pid_t    _initial_pid       = 0;
 static int      SR_signum          = SIGUSR2; // Signal used to suspend/resume a thread (must be > SIGSEGV, see 4355769)
 static sigset_t SR_sigset;
-static pthread_mutex_t dl_mutex;           // Used to protect dlsym() calls */
+static pthread_mutex_t dl_mutex;              // Used to protect dlsym() calls.
 
 julong os::available_memory() {
   return Aix::available_memory();
@@ -253,7 +270,6 @@
   return false;
 }
 
-
 // Return true if user is running as root.
 
 bool os::have_special_privileges() {
@@ -284,8 +300,7 @@
 
   for (int i = 0; i < numFullDisclaimsNeeded; i ++) {
     if (::disclaim(p, maxDisclaimSize, DISCLAIM_ZEROMEM) != 0) {
-      //if (Verbose)
-      fprintf(stderr, "Cannot disclaim %p - %p (errno %d)\n", p, p + maxDisclaimSize, errno);
+      trc("Cannot disclaim %p - %p (errno %d)\n", p, p + maxDisclaimSize, errno);
       return false;
     }
     p += maxDisclaimSize;
@@ -293,8 +308,7 @@
 
   if (lastDisclaimSize > 0) {
     if (::disclaim(p, lastDisclaimSize, DISCLAIM_ZEROMEM) != 0) {
-      //if (Verbose)
-        fprintf(stderr, "Cannot disclaim %p - %p (errno %d)\n", p, p + lastDisclaimSize, errno);
+      trc("Cannot disclaim %p - %p (errno %d)\n", p, p + lastDisclaimSize, errno);
       return false;
     }
   }
@@ -334,11 +348,11 @@
 
 void os::Aix::initialize_system_info() {
 
-  // get the number of online(logical) cpus instead of configured
+  // Get the number of online(logical) cpus instead of configured.
   os::_processor_count = sysconf(_SC_NPROCESSORS_ONLN);
   assert(_processor_count > 0, "_processor_count must be > 0");
 
-  // retrieve total physical storage
+  // Retrieve total physical storage.
   os::Aix::meminfo_t mi;
   if (!os::Aix::get_meminfo(&mi)) {
     fprintf(stderr, "os::Aix::get_meminfo failed.\n"); fflush(stderr);
@@ -513,7 +527,6 @@
 
 } // end os::Aix::query_multipage_support()
 
-// The code for this method was initially derived from the version in os_linux.cpp.
 void os::init_system_properties_values() {
 
 #define DEFAULT_LIBPATH "/usr/lib:/lib"
@@ -603,10 +616,11 @@
   sigaction(sig, (struct sigaction*)NULL, &oact);
   void* ohlr = oact.sa_sigaction ? CAST_FROM_FN_PTR(void*, oact.sa_sigaction)
     : CAST_FROM_FN_PTR(void*, oact.sa_handler);
-  if (ohlr == CAST_FROM_FN_PTR(void*, SIG_IGN))
+  if (ohlr == CAST_FROM_FN_PTR(void*, SIG_IGN)) {
     return true;
-  else
+  } else {
     return false;
+  }
 }
 
 void os::Aix::signal_sets_init() {
@@ -780,6 +794,9 @@
 
   // get the processor version from _system_configuration
   switch (_system_configuration.version) {
+  case PV_8:
+    strcpy(pci->version, "Power PC 8");
+    break;
   case PV_7:
     strcpy(pci->version, "Power PC 7");
     break;
@@ -807,6 +824,9 @@
   case PV_7_Compat:
     strcpy(pci->version, "PV_7_Compat");
     break;
+  case PV_8_Compat:
+    strcpy(pci->version, "PV_8_Compat");
+    break;
   default:
     strcpy(pci->version, "unknown");
   }
@@ -942,7 +962,9 @@
 
   pthread_attr_destroy(&attr);
 
-  if (ret != 0) {
+  if (ret == 0) {
+    // PPC port traceOsMisc(("Created New Thread : pthread-id %u", tid));
+  } else {
     if (PrintMiscellaneous && (Verbose || WizardMode)) {
       perror("pthread_create()");
     }
@@ -1103,8 +1125,7 @@
   if (os::Aix::on_pase()) {
     Unimplemented();
     return 0;
-  }
-  else {
+  } else {
     // On AIX use the precision of processors real time clock
     // or time base registers.
     timebasestruct_t time;
@@ -1152,7 +1173,6 @@
   }
 }
 
-
 char * os::local_time_string(char *buf, size_t buflen) {
   struct tm t;
   time_t long_time;
@@ -1190,7 +1210,6 @@
   if (abort_hook != NULL) {
     abort_hook();
   }
-
 }
 
 // Note: os::abort() might be called very early during initialization, or
@@ -1222,8 +1241,7 @@
 // from src/solaris/hpi/src/system_md.c
 
 size_t os::lasterror(char *buf, size_t len) {
-
-  if (errno == 0)  return 0;
+  if (errno == 0) return 0;
 
   const char *s = ::strerror(errno);
   size_t n = ::strlen(s);
@@ -1236,6 +1254,7 @@
 }
 
 intx os::current_thread_id() { return (intx)pthread_self(); }
+
 int os::current_process_id() {
 
   // This implementation returns a unique pid, the pid of the
@@ -1372,9 +1391,9 @@
   if (offset) {
     *offset = -1;
   }
-  if (buf) {
-    buf[0] = '\0';
-  }
+  // Buf is not optional, but offset is optional.
+  assert(buf != NULL, "sanity check");
+  buf[0] = '\0';
 
   // Resolve function ptr literals first.
   addr = resolve_function_descriptor_to_code_pointer(addr);
@@ -1407,12 +1426,9 @@
     return 0;
   }
 
-  if (Verbose) {
-    fprintf(stderr, "pc outside any module");
-  }
+  trcVerbose("pc outside any module");
 
   return -1;
-
 }
 
 bool os::dll_address_to_library_name(address addr, char* buf,
@@ -1420,9 +1436,9 @@
   if (offset) {
     *offset = -1;
   }
-  if (buf) {
-      buf[0] = '\0';
-  }
+  // Buf is not optional, but offset is optional.
+  assert(buf != NULL, "sanity check");
+  buf[0] = '\0';
 
   // Resolve function ptr literals first.
   addr = resolve_function_descriptor_to_code_pointer(addr);
@@ -1437,7 +1453,7 @@
 }
 
 // Loads .dll/.so and in case of error it checks if .dll/.so was built
-// for the same architecture as Hotspot is running on
+// for the same architecture as Hotspot is running on.
 void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
 
   if (ebuf && ebuflen > 0) {
@@ -1600,7 +1616,6 @@
   st->cr();
 }
 
-
 static void print_signal_handler(outputStream* st, int sig,
                                  char* buf, size_t buflen);
 
@@ -1624,7 +1639,7 @@
 
 static char saved_jvm_path[MAXPATHLEN] = {0};
 
-// Find the full path to the current module, libjvm.so or libjvm_g.so
+// Find the full path to the current module, libjvm.so.
 void os::jvm_path(char *buf, jint buflen) {
   // Error checking.
   if (buflen < MAXPATHLEN) {
@@ -1695,7 +1710,7 @@
   // Do not block out synchronous signals in the signal handler.
   // Blocking synchronous signals only makes sense if you can really
   // be sure that those signals won't happen during signal handling,
-  // when the blocking applies.  Normal signal handlers are lean and
+  // when the blocking applies. Normal signal handlers are lean and
   // do not cause signals. But our signal handlers tend to be "risky"
   // - secondary SIGSEGV, SIGILL, SIGBUS' may and do happen.
   // On AIX, PASE there was a case where a SIGSEGV happened, followed
@@ -2861,13 +2876,9 @@
   param.sched_priority = newpri;
   int ret = pthread_setschedparam(thr, policy, &param);
 
-  if (Verbose) {
-    if (ret == 0) {
-      fprintf(stderr, "changed priority of thread %d to %d\n", (int)thr, newpri);
-    } else {
-      fprintf(stderr, "Could not changed priority for thread %d to %d (error %d, %s)\n",
-              (int)thr, newpri, ret, strerror(ret));
-    }
+  if (ret != 0) {
+    trcVerbose("Could not change priority for thread %d to %d (error %d, %s)",
+        (int)thr, newpri, ret, strerror(ret));
   }
   return (ret == 0) ? OS_OK : OS_ERR;
 }
@@ -2988,7 +2999,6 @@
   errno = old_errno;
 }
 
-
 static int SR_initialize() {
   struct sigaction act;
   char *s;
@@ -3187,7 +3197,6 @@
   JVM_handle_aix_signal(sig, info, uc, true);
 }
 
-
 // This boolean allows users to forward their own non-matching signals
 // to JVM_handle_aix_signal, harmlessly.
 bool os::Aix::signal_handlers_are_installed = false;
@@ -3381,7 +3390,7 @@
     set_signal_handler(SIGDANGER, true);
 
     if (libjsig_is_loaded) {
-      // Tell libjsig jvm finishes setting signal handlers
+      // Tell libjsig jvm finishes setting signal handlers.
       (*end_signal_setting)();
     }
 
@@ -3397,7 +3406,7 @@
         tty->print_cr("Info: AllowUserSignalHandlers is activated, all active signal checking is disabled");
         check_signals = false;
       }
-      // need to initialize check_signal_done
+      // Need to initialize check_signal_done.
       ::sigemptyset(&check_signal_done);
     }
   }
@@ -3471,7 +3480,6 @@
   st->cr();
 }
 
-
 #define DO_SIGNAL_CHECK(sig) \
   if (!sigismember(&check_signal_done, sig)) \
     os::Aix::check_signal_handler(sig)
@@ -3532,7 +3540,6 @@
     ? CAST_FROM_FN_PTR(address, act.sa_sigaction)
     : CAST_FROM_FN_PTR(address, act.sa_handler);
 
-
   switch(sig) {
   case SIGSEGV:
   case SIGBUS:
@@ -3685,15 +3692,13 @@
   pthread_mutex_init(&dl_mutex, NULL);
 }
 
-// this is called _after_ the global arguments have been parsed
+// This is called _after_ the global arguments have been parsed.
 jint os::init_2(void) {
 
-  if (Verbose) {
-    fprintf(stderr, "processor count: %d\n", os::_processor_count);
-    fprintf(stderr, "physical memory: %lu\n", Aix::_physical_memory);
-  }
-
-  // initially build up the loaded dll map
+  trcVerbose("processor count: %d", os::_processor_count);
+  trcVerbose("physical memory: %lu", Aix::_physical_memory);
+
+  // Initially build up the loaded dll map.
   LoadedLibraries::reload();
 
   const int page_size = Aix::page_size();
@@ -3743,7 +3748,7 @@
       }
 
       if (map_address != (address) MAP_FAILED) {
-        // map succeeded, but polling_page is not at wished address, unmap and continue.
+        // Map succeeded, but polling_page is not at wished address, unmap and continue.
         ::munmap(map_address, map_size);
         map_address = (address) MAP_FAILED;
       }
@@ -3797,7 +3802,7 @@
 
   // Make the stack size a multiple of the page size so that
   // the yellow/red zones can be guarded.
-  // note that this can be 0, if no default stacksize was set
+  // Note that this can be 0, if no default stacksize was set.
   JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes, vm_page_size()));
 
   Aix::libpthread_init();
@@ -4088,7 +4093,6 @@
   return fd;
 }
 
-
 // create binary file, rewriting existing file if required
 int os::create_binary_file(const char* path, bool rewrite_existing) {
   int oflags = O_WRONLY | O_CREAT;
@@ -4169,7 +4173,6 @@
   return mapped_address;
 }
 
-
 // Remap a block of memory.
 char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
                           char *addr, size_t bytes, bool read_only,
@@ -4217,14 +4220,14 @@
   jlong sys_time = 0;
   jlong user_time = 0;
 
-  // reimplemented using getthrds64().
+  // Reimplemented using getthrds64().
   //
-  // goes like this:
+  // Works like this:
   // For the thread in question, get the kernel thread id. Then get the
   // kernel thread statistics using that id.
   //
   // This only works of course when no pthread scheduling is used,
-  // ie there is a 1:1 relationship to kernel threads.
+  // i.e. there is a 1:1 relationship to kernel threads.
   // On AIX, see AIXTHREAD_SCOPE variable.
 
   pthread_t pthtid = thread->osthread()->pthread_id();
@@ -4371,14 +4374,12 @@
   memset(&uts, 0, sizeof(uts));
   strcpy(uts.sysname, "?");
   if (::uname(&uts) == -1) {
-    fprintf(stderr, "uname failed (%d)\n", errno);
+    trc("uname failed (%d)", errno);
     guarantee(0, "Could not determine whether we run on AIX or PASE");
   } else {
-    if (Verbose) {
-      fprintf(stderr,"uname says: sysname \"%s\" version \"%s\" release \"%s\" "
-              "node \"%s\" machine \"%s\"\n",
-              uts.sysname, uts.version, uts.release, uts.nodename, uts.machine);
-    }
+    trcVerbose("uname says: sysname \"%s\" version \"%s\" release \"%s\" "
+               "node \"%s\" machine \"%s\"\n",
+               uts.sysname, uts.version, uts.release, uts.nodename, uts.machine);
     const int major = atoi(uts.version);
     assert(major > 0, "invalid OS version");
     const int minor = atoi(uts.release);
@@ -4390,12 +4391,10 @@
       // We run on AIX. We do not support versions older than AIX 5.3.
       _on_pase = 0;
       if (_os_version < 0x0503) {
-        fprintf(stderr, "AIX release older than AIX 5.3 not supported.\n");
+        trc("AIX release older than AIX 5.3 not supported.");
         assert(false, "AIX release too old.");
       } else {
-        if (Verbose) {
-          fprintf(stderr, "We run on AIX %d.%d\n", major, minor);
-        }
+        trcVerbose("We run on AIX %d.%d\n", major, minor);
       }
     } else {
       assert(false, "unknown OS");
@@ -4403,7 +4402,6 @@
   }
 
   guarantee(_on_pase != -1 && _os_version, "Could not determine AIX/OS400 release");
-
 } // end: os::Aix::initialize_os_info()
 
 // Scan environment for important settings which might effect the VM.
@@ -4441,12 +4439,10 @@
   // Note: Setting XPG_SUS_ENV in the process is too late. Must be set earlier (before
   // exec() ? before loading the libjvm ? ....)
   p = ::getenv("XPG_SUS_ENV");
-  if (Verbose) {
-    fprintf(stderr, "XPG_SUS_ENV=%s.\n", p ? p : "<unset>");
-  }
+  trcVerbose("XPG_SUS_ENV=%s.", p ? p : "<unset>");
   if (p && strcmp(p, "ON") == 0) {
     _xpg_sus_mode = 1;
-    fprintf(stderr, "Unsupported setting: XPG_SUS_ENV=ON\n");
+    trc("Unsupported setting: XPG_SUS_ENV=ON");
     // This is not supported. Worst of all, it changes behaviour of mmap MAP_FIXED to
     // clobber address ranges. If we ever want to support that, we have to do some
     // testing first.
@@ -4458,10 +4454,7 @@
   // Switch off AIX internal (pthread) guard pages. This has
   // immediate effect for any pthread_create calls which follow.
   p = ::getenv("AIXTHREAD_GUARDPAGES");
-  if (Verbose) {
-    fprintf(stderr, "AIXTHREAD_GUARDPAGES=%s.\n", p ? p : "<unset>");
-    fprintf(stderr, "setting AIXTHREAD_GUARDPAGES=0.\n");
-  }
+  trcVerbose("AIXTHREAD_GUARDPAGES=%s.", p ? p : "<unset>");
   rc = ::putenv("AIXTHREAD_GUARDPAGES=0");
   guarantee(rc == 0, "");
 
@@ -4479,7 +4472,7 @@
   assert(os::Aix::on_aix(), "AIX only");
 
   if (!libperfstat::init()) {
-    fprintf(stderr, "libperfstat initialization failed.\n");
+    trc("libperfstat initialization failed.");
     assert(false, "libperfstat initialization failed");
   } else {
     if (Verbose) {
@@ -4651,7 +4644,6 @@
   return abstime;
 }
 
-
 // Test-and-clear _Event, always leaves _Event set to 0, returns immediately.
 // Conceptually TryPark() should be equivalent to park(0).
 
@@ -4732,7 +4724,7 @@
   while (_Event < 0) {
     status = pthread_cond_timedwait(_cond, _mutex, &abst);
     assert_status(status == 0 || status == ETIMEDOUT,
-          status, "cond_timedwait");
+                  status, "cond_timedwait");
     if (!FilterSpuriousWakeups) break;         // previous semantics
     if (status == ETIMEDOUT) break;
     // We consume and ignore EINTR and spurious wakeups.
@@ -4866,9 +4858,9 @@
   // Optional fast-path check:
   // Return immediately if a permit is available.
   if (_counter > 0) {
-      _counter = 0;
-      OrderAccess::fence();
-      return;
+    _counter = 0;
+    OrderAccess::fence();
+    return;
   }
 
   Thread* thread = Thread::current();
@@ -4890,7 +4882,6 @@
     unpackTime(&absTime, isAbsolute, time);
   }
 
-
   // Enter safepoint region
   // Beware of deadlocks such as 6317397.
   // The per-thread Parker:: mutex is a classic leaf-lock.
@@ -4978,7 +4969,6 @@
   }
 }
 
-
 extern char** environ;
 
 // Run the specified command in a separate process. Return its exit value,
@@ -4997,44 +4987,43 @@
   } else if (pid == 0) {
     // child process
 
-    // try to be consistent with system(), which uses "/usr/bin/sh" on AIX
+    // Try to be consistent with system(), which uses "/usr/bin/sh" on AIX.
     execve("/usr/bin/sh", argv, environ);
 
     // execve failed
     _exit(-1);
 
-  } else  {
+  } else {
     // copied from J2SE ..._waitForProcessExit() in UNIXProcess_md.c; we don't
     // care about the actual exit code, for now.
 
     int status;
 
-    // Wait for the child process to exit.  This returns immediately if
+    // Wait for the child process to exit. This returns immediately if
     // the child has already exited. */
     while (waitpid(pid, &status, 0) < 0) {
-        switch (errno) {
+      switch (errno) {
         case ECHILD: return 0;
         case EINTR: break;
         default: return -1;
-        }
+      }
     }
 
     if (WIFEXITED(status)) {
-       // The child exited normally; get its exit code.
-       return WEXITSTATUS(status);
+      // The child exited normally; get its exit code.
+      return WEXITSTATUS(status);
     } else if (WIFSIGNALED(status)) {
-       // The child exited because of a signal
-       // The best value to return is 0x80 + signal number,
-       // because that is what all Unix shells do, and because
-       // it allows callers to distinguish between process exit and
-       // process death by signal.
-       return 0x80 + WTERMSIG(status);
+      // The child exited because of a signal.
+      // The best value to return is 0x80 + signal number,
+      // because that is what all Unix shells do, and because
+      // it allows callers to distinguish between process exit and
+      // process death by signal.
+      return 0x80 + WTERMSIG(status);
     } else {
-       // Unknown exit code; pass it through
-       return status;
+      // Unknown exit code; pass it through.
+      return status;
     }
   }
-  // Remove warning.
   return -1;
 }
 
@@ -5049,7 +5038,7 @@
   struct stat statbuf;
   char buf[MAXPATHLEN];
   char libmawtpath[MAXPATHLEN];
-  const char *xawtstr  = "/xawt/libmawt.so";
+  const char *xawtstr = "/xawt/libmawt.so";
   const char *new_xawtstr = "/libawt_xawt.so";
 
   char *p;
--- a/hotspot/src/os/aix/vm/os_aix.hpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/os/aix/vm/os_aix.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -209,7 +209,7 @@
     return _can_use_16M_pages == 1 ? true : false;
   }
 
-  static address   ucontext_get_pc(ucontext_t* uc);
+  static address   ucontext_get_pc(const ucontext_t* uc);
   static intptr_t* ucontext_get_sp(ucontext_t* uc);
   static intptr_t* ucontext_get_fp(ucontext_t* uc);
   // Set PC into context. Needed for continuation after signal.
--- a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -91,8 +91,9 @@
 
 // Frame information (pc, sp, fp) retrieved via ucontext
 // always looks like a C-frame according to the frame
-// conventions in frame_ppc64.hpp.
-address os::Aix::ucontext_get_pc(ucontext_t * uc) {
+// conventions in frame_ppc.hpp.
+
+address os::Aix::ucontext_get_pc(const ucontext_t * uc) {
   return (address)uc->uc_mcontext.jmp_context.iar;
 }
 
@@ -486,7 +487,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 // thread stack
 
-size_t os::Aix::min_stack_allowed = 768*K;
+size_t os::Aix::min_stack_allowed = 128*K;
 
 // Aix is always in floating stack mode. The stack size for a new
 // thread can be set via pthread_attr_setstacksize().
@@ -499,7 +500,7 @@
   // because of the strange 'fallback logic' in os::create_thread().
   // Better set CompilerThreadStackSize in globals_<os_cpu>.hpp if you want to
   // specify a different stack size for compiler threads!
-  size_t s = (thr_type == os::compiler_thread ? 4 * M : 1024 * K);
+  size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
   return s;
 }
 
--- a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -23,8 +23,8 @@
  *
  */
 
-#ifndef OS_CPU_AIX_OJDKPPC_VM_OS_AIX_PPC_HPP
-#define OS_CPU_AIX_OJDKPPC_VM_OS_AIX_PPC_HPP
+#ifndef OS_CPU_AIX_PPC_VM_OS_AIX_PPC_HPP
+#define OS_CPU_AIX_PPC_VM_OS_AIX_PPC_HPP
 
   static void setup_fpu() {}
 
@@ -32,4 +32,4 @@
   // Note: Currently only used in 64 bit Windows implementations
   static bool register_code_area(char *low, char *high) { return true; }
 
-#endif // OS_CPU_AIX_OJDKPPC_VM_OS_AIX_PPC_HPP
+#endif // OS_CPU_AIX_PPC_VM_OS_AIX_PPC_HPP
--- a/hotspot/src/os_cpu/aix_ppc/vm/prefetch_aix_ppc.inline.hpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/os_cpu/aix_ppc/vm/prefetch_aix_ppc.inline.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -23,8 +23,8 @@
  *
  */
 
-#ifndef OS_CPU_AIX_PPC_64_VM_PREFETCH_AIX_PPC_64_INLINE_HPP
-#define OS_CPU_AIX_PPC_64_VM_PREFETCH_AIX_PPC_64_INLINE_HPP
+#ifndef OS_CPU_AIX_PPC_VM_PREFETCH_AIX_PPC_INLINE_HPP
+#define OS_CPU_AIX_PPC_VM_PREFETCH_AIX_PPC_INLINE_HPP
 
 #include "runtime/prefetch.hpp"
 
@@ -55,4 +55,4 @@
 #endif
 }
 
-#endif // OS_CPU_AIX_PPC_64_VM_PREFETCH_AIX_PPC_64_INLINE_HPP
+#endif // OS_CPU_AIX_PPC_VM_PREFETCH_AIX_PPC_INLINE_HPP
--- a/hotspot/src/os_cpu/aix_ppc/vm/threadLS_aix_ppc.hpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/os_cpu/aix_ppc/vm/threadLS_aix_ppc.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -23,8 +23,8 @@
  *
  */
 
-#ifndef OS_CPU_AIX_OJDKPPC_VM_THREADLS_AIX_PPC_HPP
-#define OS_CPU_AIX_OJDKPPC_VM_THREADLS_AIX_PPC_HPP
+#ifndef OS_CPU_AIX_PPC_VM_THREADLS_AIX_PPC_HPP
+#define OS_CPU_AIX_PPC_VM_THREADLS_AIX_PPC_HPP
 
   // Processor dependent parts of ThreadLocalStorage
 
@@ -33,4 +33,4 @@
     return (Thread *) os::thread_local_storage_at(thread_index());
   }
 
-#endif // OS_CPU_AIX_OJDKPPC_VM_THREADLS_AIX_PPC_HPP
+#endif // OS_CPU_AIX_PPC_VM_THREADLS_AIX_PPC_HPP
--- a/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.hpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -23,8 +23,8 @@
  *
  */
 
-#ifndef OS_CPU_AIX_OJDKPPC_VM_THREAD_AIX_PPC_HPP
-#define OS_CPU_AIX_OJDKPPC_VM_THREAD_AIX_PPC_HPP
+#ifndef OS_CPU_AIX_PPC_VM_THREAD_AIX_PPC_HPP
+#define OS_CPU_AIX_PPC_VM_THREAD_AIX_PPC_HPP
 
  private:
   void pd_initialize() {
@@ -76,4 +76,4 @@
 
   intptr_t* last_interpreter_fp() { return _last_interpreter_fp; }
 
-#endif // OS_CPU_AIX_OJDKPPC_VM_THREAD_AIX_PPC_HPP
+#endif // OS_CPU_AIX_PPC_VM_THREAD_AIX_PPC_HPP
--- a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -453,7 +453,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 // thread stack
 
-size_t os::Linux::min_stack_allowed = 768*K;
+size_t os::Linux::min_stack_allowed = 128*K;
 
 bool os::Linux::supports_variable_stack_size() { return true; }
 
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -786,17 +786,12 @@
   MetadataOnStackMark md_on_stack(has_redefined_a_class);
 
   if (has_redefined_a_class) {
-    // purge_previous_versions also cleans weak method links. Because
-    // one method's MDO can reference another method from another
-    // class loader, we need to first clean weak method links for all
-    // class loaders here. Below, we can then free redefined methods
-    // for all class loaders.
     for (ClassLoaderData* data = _head; data != NULL; data = data->next()) {
       data->classes_do(InstanceKlass::purge_previous_versions);
     }
   }
 
-  // Need to purge the previous version before deallocating.
+  // Should purge the previous version before deallocating.
   free_deallocate_lists();
 }
 
@@ -834,8 +829,6 @@
 
 void ClassLoaderDataGraph::free_deallocate_lists() {
   for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
-    // We need to keep this data until InstanceKlass::purge_previous_version has been
-    // called on all alive classes. See the comment in ClassLoaderDataGraph::clean_metaspaces.
     cld->free_deallocate_list();
   }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/compactHashtable.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,417 @@
+/*
+ * Copyright (c) 1997, 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "classfile/javaClasses.hpp"
+#include "memory/metaspaceShared.hpp"
+#include "utilities/numberSeq.hpp"
+#include <sys/stat.h>
+
+/////////////////////////////////////////////////////
+//
+// The compact hash table writer implementations
+//
+CompactHashtableWriter::CompactHashtableWriter(const char* table_name,
+                                               int num_entries,
+                                               CompactHashtableStats* stats) {
+  assert(DumpSharedSpaces, "dump-time only");
+  _table_name = table_name;
+  _num_entries = num_entries;
+  _num_buckets = number_of_buckets(_num_entries);
+  _buckets = NEW_C_HEAP_ARRAY(Entry*, _num_buckets, mtSymbol);
+  memset(_buckets, 0, sizeof(Entry*) * _num_buckets);
+
+  /* bucket sizes table */
+  _bucket_sizes = NEW_C_HEAP_ARRAY(juint, _num_buckets, mtSymbol);
+  memset(_bucket_sizes, 0, sizeof(juint) * _num_buckets);
+
+  stats->hashentry_count = _num_entries;
+  // Compact buckets' entries will have only the 4-byte offset, but
+  // we don't know how many there will be at this point. So use a
+  // conservative estimate here. The size is adjusted later when we
+  // write out the buckets.
+  stats->hashentry_bytes = _num_entries * 8;
+  stats->bucket_count    = _num_buckets;
+  stats->bucket_bytes    = (_num_buckets + 1) * (sizeof(juint));
+  _stats = stats;
+
+  // See compactHashtable.hpp for table layout
+  _required_bytes = sizeof(juint) * 2; // _base_address, written as 2 juints
+  _required_bytes+= sizeof(juint) +    // num_entries
+                    sizeof(juint) +    // num_buckets
+                    stats->hashentry_bytes +
+                    stats->bucket_bytes;
+}
+
+CompactHashtableWriter::~CompactHashtableWriter() {
+  for (int index = 0; index < _num_buckets; index++) {
+    Entry* next = NULL;
+    for (Entry* tent = _buckets[index]; tent; tent = next) {
+      next = tent->next();
+      delete tent;
+    }
+  }
+
+  FREE_C_HEAP_ARRAY(juint, _bucket_sizes);
+  FREE_C_HEAP_ARRAY(Entry*, _buckets);
+}
+
+// Calculate the number of buckets in the temporary hash table
+int CompactHashtableWriter::number_of_buckets(int num_entries) {
+  const int buksize = (int)SharedSymbolTableBucketSize;
+  int num_buckets = (num_entries + buksize - 1) / buksize;
+  num_buckets = (num_buckets + 1) & (~0x01);
+
+  return num_buckets;
+}
+
+// Add a symbol entry to the temporary hash table
+void CompactHashtableWriter::add(unsigned int hash, Entry* entry) {
+  int index = hash % _num_buckets;
+  entry->set_next(_buckets[index]);
+  _buckets[index] = entry;
+  _bucket_sizes[index] ++;
+}
+
+// Write the compact table's bucket infos
+juint* CompactHashtableWriter::dump_table(juint* p, juint** first_bucket,
+                                          NumberSeq* summary) {
+  int index;
+  juint* compact_table = p;
+  // Find the start of the buckets, skip the compact_bucket_infos table
+  // and the table end offset.
+  juint offset = _num_buckets + 1;
+  *first_bucket = compact_table + offset;
+
+  for (index = 0; index < _num_buckets; index++) {
+    int bucket_size = _bucket_sizes[index];
+    if (bucket_size == 1) {
+      // bucket with one entry is compacted and only has the symbol offset
+      compact_table[index] = BUCKET_INFO(offset, COMPACT_BUCKET_TYPE);
+      offset += bucket_size; // each entry contains symbol offset only
+    } else {
+      // regular bucket, each entry is a symbol (hash, offset) pair
+      compact_table[index] = BUCKET_INFO(offset, REGULAR_BUCKET_TYPE);
+      offset += bucket_size * 2; // each hash entry is 2 juints
+    }
+    if (offset & ~BUCKET_OFFSET_MASK) {
+      vm_exit_during_initialization("CompactHashtableWriter::dump_table: Overflow! "
+                                    "Too many symbols.");
+    }
+    summary->add(bucket_size);
+  }
+  // Mark the end of the table
+  compact_table[_num_buckets] = BUCKET_INFO(offset, TABLEEND_BUCKET_TYPE);
+
+  return compact_table;
+}
+
+// Write the compact table's entries
+juint* CompactHashtableWriter::dump_buckets(juint* compact_table, juint* p,
+                                            NumberSeq* summary) {
+  uintx base_address = uintx(MetaspaceShared::shared_rs()->base());
+  uintx max_delta    = uintx(MetaspaceShared::shared_rs()->size());
+  assert(max_delta <= 0x7fffffff, "range check");
+  int num_compact_buckets = 0;
+
+  assert(p != NULL, "sanity");
+  for (int index = 0; index < _num_buckets; index++) {
+    juint count = 0;
+    int bucket_size = _bucket_sizes[index];
+    int bucket_type = BUCKET_TYPE(compact_table[index]);
+
+    if (bucket_size == 1) {
+      assert(bucket_type == COMPACT_BUCKET_TYPE, "Bad bucket type");
+      num_compact_buckets ++;
+    }
+    for (Entry* tent = _buckets[index]; tent;
+         tent = tent->next()) {
+      if (bucket_type == REGULAR_BUCKET_TYPE) {
+        *p++ = juint(tent->hash()); // write symbol hash
+      }
+      uintx deltax = uintx(tent->value()) - base_address;
+      assert(deltax < max_delta, "range check");
+      juint delta = juint(deltax);
+      *p++ = delta; // write symbol offset
+      count ++;
+    }
+    assert(count == _bucket_sizes[index], "sanity");
+  }
+
+  // Adjust the hashentry_bytes in CompactHashtableStats. Each compact
+  // bucket saves 4-byte.
+  _stats->hashentry_bytes -= num_compact_buckets * 4;
+
+  return p;
+}
+
+// Write the compact table
+void CompactHashtableWriter::dump(char** top, char* end) {
+  NumberSeq summary;
+  char* old_top = *top;
+  juint* p = (juint*)(*top);
+
+  uintx base_address = uintx(MetaspaceShared::shared_rs()->base());
+
+  *p++ = high(base_address);
+  *p++ = low (base_address); // base address
+  *p++ = _num_entries;  // number of entries in the table
+  *p++ = _num_buckets;  // number of buckets in the table
+
+  juint* first_bucket = NULL;
+  juint* compact_table = dump_table(p, &first_bucket, &summary);
+  juint* bucket_end = dump_buckets(compact_table, first_bucket, &summary);
+
+  assert(bucket_end <= (juint*)end, "cannot write past end");
+  *top = (char*)bucket_end;
+
+  if (PrintSharedSpaces) {
+    double avg_cost = 0.0;
+    if (_num_entries > 0) {
+      avg_cost = double(_required_bytes)/double(_num_entries);
+    }
+    tty->print_cr("Shared %s table stats -------- base: " PTR_FORMAT, _table_name, (intptr_t)base_address);
+    tty->print_cr("Number of entries       : %9d", _num_entries);
+    tty->print_cr("Total bytes used        : %9d", (int)((*top) - old_top));
+    tty->print_cr("Average bytes per entry : %9.3f", avg_cost);
+    tty->print_cr("Average bucket size     : %9.3f", summary.avg());
+    tty->print_cr("Variance of bucket size : %9.3f", summary.variance());
+    tty->print_cr("Std. dev. of bucket size: %9.3f", summary.sd());
+    tty->print_cr("Maximum bucket size     : %9d", (int)summary.maximum());
+  }
+}
+
+/////////////////////////////////////////////////////////////
+//
+// The CompactHashtable implementation
+//
+template <class T, class N> const char* CompactHashtable<T, N>::init(const char* buffer) {
+  assert(!DumpSharedSpaces, "run-time only");
+  juint*p = (juint*)buffer;
+  juint upper = *p++;
+  juint lower = *p++;
+  _base_address = uintx(jlong_from(upper, lower));
+  _entry_count = *p++;
+  _bucket_count = *p++;
+  _buckets = p;
+  _table_end_offset = BUCKET_OFFSET(p[_bucket_count]); // located at the end of the bucket_info table
+
+  juint *end = _buckets + _table_end_offset;
+  return (const char*)end;
+}
+
+// Explicitly instantiate these types
+template class CompactHashtable<Symbol*, char>;
+
+#ifndef O_BINARY       // if defined (Win32) use binary files.
+#define O_BINARY 0     // otherwise do nothing.
+#endif
+
+////////////////////////////////////////////////////////
+//
+// HashtableTextDump
+//
+HashtableTextDump::HashtableTextDump(const char* filename) : _fd(-1) {
+  struct stat st;
+  if (os::stat(filename, &st) != 0) {
+    quit("Unable to get hashtable dump file size", filename);
+  }
+  _size = st.st_size;
+  _fd = open(filename, O_RDONLY | O_BINARY, 0);
+  if (_fd < 0) {
+    quit("Unable to open hashtable dump file", filename);
+  }
+  _base = os::map_memory(_fd, filename, 0, NULL, _size, true, false);
+  if (_base == NULL) {
+    quit("Unable to map hashtable dump file", filename);
+  }
+  _p = _base;
+  _end = _base + st.st_size;
+  _filename = filename;
+}
+
+HashtableTextDump::~HashtableTextDump() {
+  os::unmap_memory((char*)_base, _size);
+  if (_fd >= 0) {
+    close(_fd);
+  }
+}
+
+void HashtableTextDump::quit(const char* err, const char* msg) {
+  vm_exit_during_initialization(err, msg);
+}
+
+void HashtableTextDump::corrupted(const char *p) {
+  char info[60];
+  sprintf(info, "corrupted at pos %d", (int)(p - _base));
+  quit(info, _filename);
+}
+
+bool HashtableTextDump::skip_newline() {
+  if (_p[0] == '\r' && _p[1] == '\n') {
+    _p += 2;
+  } else if (_p[0] == '\n') {
+    _p += 1;
+  } else {
+    corrupted(_p);
+  }
+  return true;
+}
+
+int HashtableTextDump::skip(char must_be_char) {
+  corrupted_if(remain() < 1);
+  corrupted_if(*_p++ != must_be_char);
+  return 0;
+}
+
+void HashtableTextDump::skip_past(char c) {
+  for (;;) {
+    corrupted_if(remain() < 1);
+    if (*_p++ == c) {
+      return;
+    }
+  }
+}
+
+void HashtableTextDump::check_version(const char* ver) {
+  int len = (int)strlen(ver);
+  corrupted_if(remain() < len);
+  if (strncmp(_p, ver, len) != 0) {
+    quit("wrong version of hashtable dump file", _filename);
+  }
+  _p += len;
+  skip_newline();
+}
+
+
+int HashtableTextDump::scan_prefix() {
+  // Expect /[0-9]+: /
+  int utf8_length = get_num(':');
+  if (*_p != ' ') {
+    corrupted(_p);
+  }
+  _p++;
+  return utf8_length;
+}
+
+int HashtableTextDump::scan_prefix2() {
+  // Expect /[0-9]+ (-|)[0-9]+: /
+  int utf8_length = get_num(' ');
+  if (*_p == '-') {
+    _p++;
+  }
+  (void)get_num(':');
+  if (*_p != ' ') {
+    corrupted(_p);
+  }
+  _p++;
+  return utf8_length;
+}
+
+jchar HashtableTextDump::unescape(const char* from, const char* end, int count) {
+  jchar value = 0;
+
+  corrupted_if(from + count > end);
+
+  for (int i=0; i<count; i++) {
+    char c = *from++;
+    switch (c) {
+    case '0': case '1': case '2': case '3': case '4':
+    case '5': case '6': case '7': case '8': case '9':
+      value = (value << 4) + c - '0';
+      break;
+    case 'a': case 'b': case 'c':
+    case 'd': case 'e': case 'f':
+      value = (value << 4) + 10 + c - 'a';
+      break;
+    case 'A': case 'B': case 'C':
+    case 'D': case 'E': case 'F':
+      value = (value << 4) + 10 + c - 'A';
+      break;
+    default:
+      ShouldNotReachHere();
+    }
+  }
+  return value;
+}
+
+void HashtableTextDump::get_utf8(char* utf8_buffer, int utf8_length) {
+  // cache in local vars
+  const char* from = _p;
+  const char* end = _end;
+  char* to = utf8_buffer;
+  int n = utf8_length;
+
+  for (; n > 0 && from < end; n--) {
+    if (*from != '\\') {
+      *to++ = *from++;
+    } else {
+      corrupted_if(from + 2 > end);
+      char c = from[1];
+      from += 2;
+      switch (c) {
+      case 'x':
+        {
+          jchar value = unescape(from, end, 2);
+          from += 2;
+          assert(value <= 0xff, "sanity");
+          *to++ = (char)(value & 0xff);
+        }
+        break;
+      case 't':  *to++ = '\t'; break;
+      case 'n':  *to++ = '\n'; break;
+      case 'r':  *to++ = '\r'; break;
+      case '\\': *to++ = '\\'; break;
+      default:
+        ShouldNotReachHere();
+      }
+    }
+  }
+  corrupted_if(n > 0); // expected more chars but file has ended
+  _p = from;
+  skip_newline();
+}
+
+// NOTE: the content is NOT the same as
+// UTF8::as_quoted_ascii(const char* utf8_str, int utf8_length, char* buf, int buflen).
+// We want to escape \r\n\t so that output [1] is more readable; [2] can be more easily
+// parsed by scripts; [3] quickly processed by HashtableTextDump::get_utf8()
+void HashtableTextDump::put_utf8(outputStream* st, const char* utf8_string, int utf8_length) {
+  const char *c = utf8_string;
+  const char *end = c + utf8_length;
+  for (; c < end; c++) {
+    switch (*c) {
+    case '\t': st->print("\\t"); break;
+    case '\r': st->print("\\r"); break;
+    case '\n': st->print("\\n"); break;
+    case '\\': st->print("\\\\"); break;
+    default:
+      if (isprint(*c)) {
+        st->print("%c", *c);
+      } else {
+        st->print("\\x%02x", ((unsigned int)*c) & 0xff);
+      }
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/compactHashtable.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,405 @@
+/*
+ * Copyright (c) 1997, 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_CLASSFILE_COMPACTHASHTABLE_HPP
+#define SHARE_VM_CLASSFILE_COMPACTHASHTABLE_HPP
+
+#include "classfile/stringTable.hpp"
+#include "classfile/symbolTable.hpp"
+#include "memory/allocation.inline.hpp"
+#include "oops/symbol.hpp"
+#include "services/diagnosticCommand.hpp"
+#include "utilities/hashtable.hpp"
+
+class NumberSeq;
+
+// Stats for symbol tables in the CDS archive
+class CompactHashtableStats VALUE_OBJ_CLASS_SPEC {
+public:
+  int hashentry_count;
+  int hashentry_bytes;
+  int bucket_count;
+  int bucket_bytes;
+};
+
+/////////////////////////////////////////////////////////////////////////
+//
+// The compact hash table writer. Used at dump time for writing out
+// the compact table to the shared archive.
+//
+// At dump time, the CompactHashtableWriter obtains all entries from the
+// symbol table and adds them to a new temporary hash table. The hash
+// table size (number of buckets) is calculated using
+// '(num_entries + bucket_size - 1) / bucket_size'. The default bucket
+// size is 4 and can be changed by -XX:SharedSymbolTableBucketSize option.
+// 4 is chosen because it produces smaller sized bucket on average for
+// faster lookup. It also has relatively small number of empty buckets and
+// good distribution of the entries.
+//
+// We use a simple hash function (symbol_hash % num_bucket) for the table.
+// The new table is compacted when written out. Please see comments
+// above the CompactHashtable class for the table layout detail. The bucket
+// offsets are written to the archive as part of the compact table. The
+// bucket offset is encoded in the low 30-bit (0-29) and the bucket type
+// (regular or compact) are encoded in bit[31, 30]. For buckets with more
+// than one entry, both symbol hash and symbol offset are written to the
+// table. For buckets with only one entry, only the symbol offset is written
+// to the table and the buckets are tagged as compact in their type bits.
+// Buckets without entry are skipped from the table. Their offsets are
+// still written out for faster lookup.
+//
+class CompactHashtableWriter: public StackObj {
+public:
+  class Entry: public CHeapObj<mtSymbol> {
+    Entry* _next;
+    unsigned int _hash;
+    void* _literal;
+
+  public:
+    Entry(unsigned int hash, Symbol *symbol) : _next(NULL), _hash(hash), _literal(symbol) {}
+
+    void *value() {
+      return _literal;
+    }
+    Symbol *symbol() {
+      return (Symbol*)_literal;
+    }
+    unsigned int hash() {
+      return _hash;
+    }
+    Entry *next()           {return _next;}
+    void set_next(Entry *p) {_next = p;}
+  }; // class CompactHashtableWriter::Entry
+
+private:
+  static int number_of_buckets(int num_entries);
+
+  const char* _table_name;
+  int _num_entries;
+  int _num_buckets;
+  juint* _bucket_sizes;
+  Entry** _buckets;
+  int _required_bytes;
+  CompactHashtableStats* _stats;
+
+public:
+  // This is called at dump-time only
+  CompactHashtableWriter(const char* table_name, int num_entries, CompactHashtableStats* stats);
+  ~CompactHashtableWriter();
+
+  int get_required_bytes() {
+    return _required_bytes;
+  }
+
+  void add(unsigned int hash, Symbol* symbol) {
+    add(hash, new Entry(hash, symbol));
+  }
+
+private:
+  void add(unsigned int hash, Entry* entry);
+  juint* dump_table(juint* p, juint** first_bucket, NumberSeq* summary);
+  juint* dump_buckets(juint* table, juint* p, NumberSeq* summary);
+
+public:
+  void dump(char** top, char* end);
+};
+
+#define REGULAR_BUCKET_TYPE       0
+#define COMPACT_BUCKET_TYPE       1
+#define TABLEEND_BUCKET_TYPE      3
+#define BUCKET_OFFSET_MASK        0x3FFFFFFF
+#define BUCKET_OFFSET(info)       ((info) & BUCKET_OFFSET_MASK)
+#define BUCKET_TYPE_SHIFT         30
+#define BUCKET_TYPE(info)         (((info) & ~BUCKET_OFFSET_MASK) >> BUCKET_TYPE_SHIFT)
+#define BUCKET_INFO(offset, type) (((type) << BUCKET_TYPE_SHIFT) | ((offset) & BUCKET_OFFSET_MASK))
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// CompactHashtable is used to stored the CDS archive's symbol table. Used
+// at runtime only to access the compact table from the archive.
+//
+// Because these tables are read-only (no entries can be added/deleted) at run-time
+// and tend to have large number of entries, we try to minimize the footprint
+// cost per entry.
+//
+// Layout of compact symbol table in the shared archive:
+//
+//   uintx base_address;
+//   juint num_symbols;
+//   juint num_buckets;
+//   juint bucket_infos[num_buckets+1]; // bit[31,30]: type; bit[29-0]: offset
+//   juint table[]
+//
+// -----------------------------------
+// | base_address  | num_symbols     |
+// |---------------------------------|
+// | num_buckets   | bucket_info0    |
+// |---------------------------------|
+// | bucket_info1  | bucket_info2    |
+// | bucket_info3    ...             |
+// | ....          | table_end_info  |
+// |---------------------------------|
+// | entry0                          |
+// | entry1                          |
+// | entry2                          |
+// |                                 |
+// | ...                             |
+// -----------------------------------
+//
+// The size of the bucket_info table is 'num_buckets + 1'. Each entry of the
+// bucket_info table is a 32-bit encoding of the bucket type and bucket offset,
+// with the type in the left-most 2-bit and offset in the remaining 30-bit.
+// The last entry is a special type. It contains the offset of the last
+// bucket end. We use that information when traversing the compact table.
+//
+// There are two types of buckets, regular buckets and compact buckets. The
+// compact buckets have '01' in their highest 2-bit, and regular buckets have
+// '00' in their highest 2-bit.
+//
+// For normal buckets, each symbol's entry is 8 bytes in the table[]:
+//   juint hash;    /* symbol hash */
+//   juint offset;  /* Symbol* sym = (Symbol*)(base_address + offset) */
+//
+// For compact buckets, each entry has only the 4-byte 'offset' in the table[].
+//
+// See CompactHashtable::lookup() for how the table is searched at runtime.
+// See CompactHashtableWriter::dump() for how the table is written at CDS
+// dump time.
+//
+template <class T, class N> class CompactHashtable VALUE_OBJ_CLASS_SPEC {
+  uintx  _base_address;
+  juint  _entry_count;
+  juint  _bucket_count;
+  juint  _table_end_offset;
+  juint* _buckets;
+
+  inline bool equals(T entry, const char* name, int len) {
+    if (entry->equals(name, len)) {
+      assert(entry->refcount() == -1, "must be shared");
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+public:
+  CompactHashtable() {
+    _entry_count = 0;
+    _bucket_count = 0;
+    _table_end_offset = 0;
+    _buckets = 0;
+  }
+  const char* init(const char *buffer);
+
+  // Lookup an entry from the compact table
+  inline T lookup(const N* name, unsigned int hash, int len) {
+    if (_entry_count > 0) {
+      assert(!DumpSharedSpaces, "run-time only");
+      int index = hash % _bucket_count;
+      juint bucket_info = _buckets[index];
+      juint bucket_offset = BUCKET_OFFSET(bucket_info);
+      int   bucket_type = BUCKET_TYPE(bucket_info);
+      juint* bucket = _buckets + bucket_offset;
+      juint* bucket_end = _buckets;
+
+      if (bucket_type == COMPACT_BUCKET_TYPE) {
+        // the compact bucket has one entry with symbol offset only
+        T entry = (T)((void*)(_base_address + bucket[0]));
+        if (equals(entry, name, len)) {
+          return entry;
+        }
+      } else {
+        // This is a regular bucket, which has more than one
+        // entries. Each entry is a pair of symbol (hash, offset).
+        // Seek until the end of the bucket.
+        bucket_end += BUCKET_OFFSET(_buckets[index + 1]);
+        while (bucket < bucket_end) {
+          unsigned int h = (unsigned int)(bucket[0]);
+          if (h == hash) {
+            juint offset = bucket[1];
+            T entry = (T)((void*)(_base_address + offset));
+            if (equals(entry, name, len)) {
+              return entry;
+            }
+          }
+          bucket += 2;
+        }
+      }
+    }
+    return NULL;
+  }
+};
+
+////////////////////////////////////////////////////////////////////////
+//
+// Read/Write the contents of a hashtable textual dump (created by
+// SymbolTable::dump).
+// Because the dump file may be big (hundred of MB in extreme cases),
+// we use mmap for fast access when reading it.
+//
+class HashtableTextDump VALUE_OBJ_CLASS_SPEC {
+  int _fd;
+  const char* _base;
+  const char* _p;
+  const char* _end;
+  const char* _filename;
+  size_t      _size;
+public:
+  HashtableTextDump(const char* filename);
+  ~HashtableTextDump();
+
+  void quit(const char* err, const char* msg);
+
+  inline int remain() {
+    return (int)(_end - _p);
+  }
+
+  void corrupted(const char *p);
+
+  inline void corrupted_if(bool cond) {
+    if (cond) {
+      corrupted(_p);
+    }
+  }
+
+  bool skip_newline();
+  int skip(char must_be_char);
+  void skip_past(char c);
+  void check_version(const char* ver);
+
+  inline int get_num(char delim) {
+    const char* p   = _p;
+    const char* end = _end;
+    int num = 0;
+
+    while (p < end) {
+      char c = *p ++;
+      if ('0' <= c && c <= '9') {
+        num = num * 10 + (c - '0');
+      } else if (c == delim) {
+        _p = p;
+        return num;
+      } else {
+        corrupted(p-1);
+      }
+    }
+    corrupted(_end);
+    ShouldNotReachHere();
+    return 0;
+  }
+
+  int scan_prefix();
+  int scan_prefix2();
+
+  jchar unescape(const char* from, const char* end, int count);
+  void get_utf8(char* utf8_buffer, int utf8_length);
+  static void put_utf8(outputStream* st, const char* utf8_string, int utf8_length);
+};
+
+///////////////////////////////////////////////////////////////////////
+//
+// jcmd command support for symbol table and string table dumping:
+//   VM.symboltable -verbose: for dumping the symbol table
+//   VM.stringtable -verbose: for dumping the string table
+//
+class VM_DumpHashtable : public VM_Operation {
+private:
+  outputStream* _out;
+  int _which;
+  bool _verbose;
+public:
+  enum {
+    DumpSymbols = 1 << 0,
+    DumpStrings = 1 << 1,
+    DumpSysDict = 1 << 2  // not implemented yet
+  };
+  VM_DumpHashtable(outputStream* out, int which, bool verbose) {
+    _out = out;
+    _which = which;
+    _verbose = verbose;
+  }
+
+  virtual VMOp_Type type() const { return VMOp_DumpHashtable; }
+
+  virtual void doit() {
+    switch (_which) {
+    case DumpSymbols:
+      SymbolTable::dump(_out, _verbose);
+      break;
+    case DumpStrings:
+      StringTable::dump(_out, _verbose);
+      break;
+    default:
+      ShouldNotReachHere();
+    }
+  }
+};
+
+class SymboltableDCmd : public DCmdWithParser {
+protected:
+  DCmdArgument<bool> _verbose;
+public:
+  SymboltableDCmd(outputStream* output, bool heap);
+  static const char* name() {
+    return "VM.symboltable";
+  }
+  static const char* description() {
+    return "Dump symbol table.";
+  }
+  static const char* impact() {
+    return "Medium: Depends on Java content.";
+  }
+  static const JavaPermission permission() {
+    JavaPermission p = {"java.lang.management.ManagementPermission",
+                        "monitor", NULL};
+    return p;
+  }
+  static int num_arguments();
+  virtual void execute(DCmdSource source, TRAPS);
+};
+
+class StringtableDCmd : public DCmdWithParser {
+protected:
+  DCmdArgument<bool> _verbose;
+public:
+  StringtableDCmd(outputStream* output, bool heap);
+  static const char* name() {
+    return "VM.stringtable";
+  }
+  static const char* description() {
+    return "Dump string table.";
+  }
+  static const char* impact() {
+    return "Medium: Depends on Java content.";
+  }
+  static const JavaPermission permission() {
+    JavaPermission p = {"java.lang.management.ManagementPermission",
+                        "monitor", NULL};
+    return p;
+  }
+  static int num_arguments();
+  virtual void execute(DCmdSource source, TRAPS);
+};
+
+#endif // SHARE_VM_CLASSFILE_COMPACTHASHTABLE_HPP
--- a/hotspot/src/share/vm/classfile/stringTable.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/classfile/stringTable.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/altHashing.hpp"
+#include "classfile/compactHashtable.hpp"
 #include "classfile/javaClasses.hpp"
 #include "classfile/stringTable.hpp"
 #include "classfile/systemDictionary.hpp"
@@ -379,8 +380,36 @@
   }
 }
 
-void StringTable::dump(outputStream* st) {
-  the_table()->dump_table(st, "StringTable");
+void StringTable::dump(outputStream* st, bool verbose) {
+  if (!verbose) {
+    the_table()->dump_table(st, "StringTable");
+  } else {
+    Thread* THREAD = Thread::current();
+    st->print_cr("VERSION: 1.1");
+    for (int i = 0; i < the_table()->table_size(); ++i) {
+      HashtableEntry<oop, mtSymbol>* p = the_table()->bucket(i);
+      for ( ; p != NULL; p = p->next()) {
+        oop s = p->literal();
+        typeArrayOop value  = java_lang_String::value(s);
+        int          offset = java_lang_String::offset(s);
+        int          length = java_lang_String::length(s);
+
+        if (length <= 0) {
+          st->print("%d: ", length);
+        } else {
+          ResourceMark rm(THREAD);
+          jchar* chars = (jchar*)value->char_at_addr(offset);
+          int utf8_length = UNICODE::utf8_length(chars, length);
+          char* utf8_string = NEW_RESOURCE_ARRAY(char, utf8_length + 1);
+          UNICODE::convert_to_utf8(chars, length, utf8_string);
+
+          st->print("%d: ", utf8_length);
+          HashtableTextDump::put_utf8(st, utf8_string, utf8_length);
+        }
+        st->cr();
+      }
+    }
+  }
 }
 
 StringTable::VerifyRetTypes StringTable::compare_entries(
@@ -558,3 +587,28 @@
   _needs_rehashing = false;
   _the_table = new_table;
 }
+
+// Utility for dumping strings
+StringtableDCmd::StringtableDCmd(outputStream* output, bool heap) :
+                                 DCmdWithParser(output, heap),
+  _verbose("-verbose", "Dump the content of each string in the table",
+           "BOOLEAN", false, "false") {
+  _dcmdparser.add_dcmd_option(&_verbose);
+}
+
+void StringtableDCmd::execute(DCmdSource source, TRAPS) {
+  VM_DumpHashtable dumper(output(), VM_DumpHashtable::DumpStrings,
+                         _verbose.value());
+  VMThread::execute(&dumper);
+}
+
+int StringtableDCmd::num_arguments() {
+  ResourceMark rm;
+  StringtableDCmd* dcmd = new StringtableDCmd(NULL, false);
+  if (dcmd != NULL) {
+    DCmdMark mark(dcmd);
+    return dcmd->_dcmdparser.num_arguments();
+  } else {
+    return 0;
+  }
+}
--- a/hotspot/src/share/vm/classfile/stringTable.hpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/classfile/stringTable.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -118,7 +118,7 @@
 
   // Debugging
   static void verify();
-  static void dump(outputStream* st);
+  static void dump(outputStream* st, bool verbose=false);
 
   enum VerifyMesgModes {
     _verify_quietly    = 0,
--- a/hotspot/src/share/vm/classfile/symbolTable.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/classfile/symbolTable.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/altHashing.hpp"
+#include "classfile/compactHashtable.hpp"
 #include "classfile/javaClasses.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
@@ -47,6 +48,9 @@
 // Static arena for symbols that are not deallocated
 Arena* SymbolTable::_arena = NULL;
 bool SymbolTable::_needs_rehashing = false;
+bool SymbolTable::_lookup_shared_first = false;
+
+CompactHashtable<Symbol*, char> SymbolTable::_shared_table;
 
 Symbol* SymbolTable::allocate_symbol(const u1* name, int len, bool c_heap, TRAPS) {
   assert (len <= Symbol::max_length(), "should be checked by caller");
@@ -186,8 +190,8 @@
 
 // Lookup a symbol in a bucket.
 
-Symbol* SymbolTable::lookup(int index, const char* name,
-                              int len, unsigned int hash) {
+Symbol* SymbolTable::lookup_dynamic(int index, const char* name,
+                                    int len, unsigned int hash) {
   int count = 0;
   for (HashtableEntry<Symbol*, mtSymbol>* e = bucket(index); e != NULL; e = e->next()) {
     count++;  // count all entries in this bucket, not just ones with same hash
@@ -207,6 +211,34 @@
   return NULL;
 }
 
+Symbol* SymbolTable::lookup_shared(const char* name,
+                                   int len, unsigned int hash) {
+  return _shared_table.lookup(name, hash, len);
+}
+
+Symbol* SymbolTable::lookup(int index, const char* name,
+                            int len, unsigned int hash) {
+  Symbol* sym;
+  if (_lookup_shared_first) {
+    sym = lookup_shared(name, len, hash);
+    if (sym != NULL) {
+      return sym;
+    }
+    _lookup_shared_first = false;
+    return lookup_dynamic(index, name, len, hash);
+  } else {
+    sym = lookup_dynamic(index, name, len, hash);
+    if (sym != NULL) {
+      return sym;
+    }
+    sym = lookup_shared(name, len, hash);
+    if (sym != NULL) {
+      _lookup_shared_first = true;
+    }
+    return sym;
+  }
+}
+
 // Pick hashing algorithm.
 unsigned int SymbolTable::hash_symbol(const char* s, int len) {
   return use_alternate_hashcode() ?
@@ -483,10 +515,56 @@
   }
 }
 
-void SymbolTable::dump(outputStream* st) {
-  the_table()->dump_table(st, "SymbolTable");
+void SymbolTable::dump(outputStream* st, bool verbose) {
+  if (!verbose) {
+    the_table()->dump_table(st, "SymbolTable");
+  } else {
+    st->print_cr("VERSION: 1.0");
+    for (int i = 0; i < the_table()->table_size(); ++i) {
+      HashtableEntry<Symbol*, mtSymbol>* p = the_table()->bucket(i);
+      for ( ; p != NULL; p = p->next()) {
+        Symbol* s = (Symbol*)(p->literal());
+        const char* utf8_string = (const char*)s->bytes();
+        int utf8_length = s->utf8_length();
+        st->print("%d %d: ", utf8_length, s->refcount());
+        HashtableTextDump::put_utf8(st, utf8_string, utf8_length);
+        st->cr();
+      }
+    }
+  }
 }
 
+bool SymbolTable::copy_compact_table(char** top, char*end) {
+#if INCLUDE_CDS
+  CompactHashtableWriter ch_table("symbol", the_table()->number_of_entries(),
+                                  &MetaspaceShared::stats()->symbol);
+  if (*top + ch_table.get_required_bytes() > end) {
+    // not enough space left
+    return false;
+  }
+
+  for (int i = 0; i < the_table()->table_size(); ++i) {
+    HashtableEntry<Symbol*, mtSymbol>* p = the_table()->bucket(i);
+    for ( ; p != NULL; p = p->next()) {
+      Symbol* s = (Symbol*)(p->literal());
+      unsigned int fixed_hash = hash_symbol((char*)s->bytes(), s->utf8_length());
+      assert(fixed_hash == p->hash(), "must not rehash during dumping");
+      ch_table.add(fixed_hash, s);
+    }
+  }
+
+  char* old_top = *top;
+  ch_table.dump(top, end);
+
+  *top = (char*)align_pointer_up(*top, sizeof(void*));
+#endif
+  return true;
+}
+
+const char* SymbolTable::init_shared_table(const char* buffer) {
+  const char* end = _shared_table.init(buffer);
+  return (const char*)align_pointer_up(end, sizeof(void*));
+}
 
 //---------------------------------------------------------------------------
 // Non-product code
@@ -574,3 +652,29 @@
   }
 }
 #endif // PRODUCT
+
+
+// Utility for dumping symbols
+SymboltableDCmd::SymboltableDCmd(outputStream* output, bool heap) :
+                                 DCmdWithParser(output, heap),
+  _verbose("-verbose", "Dump the content of each symbol in the table",
+           "BOOLEAN", false, "false") {
+  _dcmdparser.add_dcmd_option(&_verbose);
+}
+
+void SymboltableDCmd::execute(DCmdSource source, TRAPS) {
+  VM_DumpHashtable dumper(output(), VM_DumpHashtable::DumpSymbols,
+                         _verbose.value());
+  VMThread::execute(&dumper);
+}
+
+int SymboltableDCmd::num_arguments() {
+  ResourceMark rm;
+  SymboltableDCmd* dcmd = new SymboltableDCmd(NULL, false);
+  if (dcmd != NULL) {
+    DCmdMark mark(dcmd);
+    return dcmd->_dcmdparser.num_arguments();
+  } else {
+    return 0;
+  }
+}
--- a/hotspot/src/share/vm/classfile/symbolTable.hpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/classfile/symbolTable.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -73,6 +73,8 @@
   operator Symbol*()                             { return _temp; }
 };
 
+template <class T, class N> class CompactHashtable;
+
 class SymbolTable : public RehashableHashtable<Symbol*, mtSymbol> {
   friend class VMStructs;
   friend class ClassFileParser;
@@ -83,11 +85,15 @@
 
   // Set if one bucket is out of balance due to hash algorithm deficiency
   static bool _needs_rehashing;
+  static bool _lookup_shared_first;
 
   // For statistics
   static int _symbols_removed;
   static int _symbols_counted;
 
+  // shared symbol table.
+  static CompactHashtable<Symbol*, char> _shared_table;
+
   Symbol* allocate_symbol(const u1* name, int len, bool c_heap, TRAPS); // Assumes no characters larger than 0x7F
 
   // Adding elements
@@ -106,6 +112,8 @@
     add(loader_data, cp, names_count, name, lengths, cp_indices, hashValues, THREAD);
   }
 
+  static Symbol* lookup_shared(const char* name, int len, unsigned int hash);
+  Symbol* lookup_dynamic(int index, const char* name, int len, unsigned int hash);
   Symbol* lookup(int index, const char* name, int len, unsigned int hash);
 
   SymbolTable()
@@ -144,20 +152,6 @@
     initialize_symbols(symbol_alloc_arena_size);
   }
 
-  static void create_table(HashtableBucket<mtSymbol>* t, int length,
-                           int number_of_entries) {
-    assert(_the_table == NULL, "One symbol table allowed.");
-
-    // If CDS archive used a different symbol table size, use that size instead
-    // which is better than giving an error.
-    SymbolTableSize = length/bucket_size();
-
-    _the_table = new SymbolTable(t, number_of_entries);
-    // if CDS give symbol table a default arena size since most symbols
-    // are already allocated in the shared misc section.
-    initialize_symbols();
-  }
-
   static unsigned int hash_symbol(const char* s, int len);
 
   static Symbol* lookup(const char* name, int len, TRAPS);
@@ -230,18 +224,12 @@
 
   // Debugging
   static void verify();
-  static void dump(outputStream* st);
+  static void dump(outputStream* st, bool verbose=false);
+  static void read(const char* filename, TRAPS);
 
   // Sharing
-  static void copy_buckets(char** top, char*end) {
-    the_table()->Hashtable<Symbol*, mtSymbol>::copy_buckets(top, end);
-  }
-  static void copy_table(char** top, char*end) {
-    the_table()->Hashtable<Symbol*, mtSymbol>::copy_table(top, end);
-  }
-  static void reverse(void* boundary = NULL) {
-    the_table()->Hashtable<Symbol*, mtSymbol>::reverse(boundary);
-  }
+  static bool copy_compact_table(char** top, char* end);
+  static const char* init_shared_table(const char* buffer);
 
   // Rehash the symbol table if it gets out of balance
   static void rehash_table();
--- a/hotspot/src/share/vm/classfile/verifier.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -2477,8 +2477,7 @@
     // of the current class.
     VerificationType objectref_type = new_class_type;
     if (name_in_supers(ref_class_type.name(), current_class())) {
-      Klass* ref_klass = load_class(
-        ref_class_type.name(), CHECK_VERIFY(this));
+      Klass* ref_klass = load_class(ref_class_type.name(), CHECK);
       Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method(
         vmSymbols::object_initializer_name(),
         cp->signature_ref_at(bcs->get_index_u2()),
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -42,6 +42,7 @@
 #include "gc_implementation/shared/isGCActiveMark.hpp"
 #include "gc_interface/collectedHeap.inline.hpp"
 #include "memory/allocation.hpp"
+#include "memory/cardGeneration.inline.hpp"
 #include "memory/cardTableRS.hpp"
 #include "memory/collectorPolicy.hpp"
 #include "memory/gcLocker.inline.hpp"
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -394,7 +394,11 @@
     // during deoptimization so the interpreter needs to skip it when
     // the frame is popped.
     thread->set_do_not_unlock_if_synchronized(true);
+#ifdef CC_INTERP
+    return (address) -1;
+#else
     return Interpreter::remove_activation_entry();
+#endif
   }
 
   // Need to do this check first since when _do_not_unlock_if_synchronized
--- a/hotspot/src/share/vm/memory/metaspaceShared.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/memory/metaspaceShared.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -48,6 +48,8 @@
 
 ReservedSpace* MetaspaceShared::_shared_rs = NULL;
 
+MetaspaceSharedStats MetaspaceShared::_stats;
+
 bool MetaspaceShared::_link_classes_made_progress;
 bool MetaspaceShared::_check_classes_made_progress;
 bool MetaspaceShared::_has_error_classes;
@@ -259,7 +261,7 @@
 #define SHAREDSPACE_OBJ_TYPES_DO(f) \
   METASPACE_OBJ_TYPES_DO(f) \
   f(SymbolHashentry) \
-  f(SymbolBuckets) \
+  f(SymbolBucket) \
   f(Other)
 
 #define SHAREDSPACE_OBJ_TYPE_DECLARE(name) name ## Type,
@@ -315,18 +317,16 @@
   int other_bytes = md_all + mc_all;
 
   // Calculate size of data that was not allocated by Metaspace::allocate()
-  int symbol_count = _counts[RO][MetaspaceObj::SymbolType];
-  int symhash_bytes = symbol_count * sizeof (HashtableEntry<Symbol*, mtSymbol>);
-  int symbuck_count = SymbolTable::the_table()->table_size();
-  int symbuck_bytes = symbuck_count * sizeof(HashtableBucket<mtSymbol>);
+  MetaspaceSharedStats *stats = MetaspaceShared::stats();
 
-  _counts[RW][SymbolHashentryType] = symbol_count;
-  _bytes [RW][SymbolHashentryType] = symhash_bytes;
-  other_bytes -= symhash_bytes;
+  // symbols
+  _counts[RW][SymbolHashentryType] = stats->symbol.hashentry_count;
+  _bytes [RW][SymbolHashentryType] = stats->symbol.hashentry_bytes;
+  other_bytes -= stats->symbol.hashentry_bytes;
 
-  _counts[RW][SymbolBucketsType] = symbuck_count;
-  _bytes [RW][SymbolBucketsType] = symbuck_bytes;
-  other_bytes -= symbuck_bytes;
+  _counts[RW][SymbolBucketType] = stats->symbol.bucket_count;
+  _bytes [RW][SymbolBucketType] = stats->symbol.bucket_bytes;
+  other_bytes -= stats->symbol.bucket_bytes;
 
   // TODO: count things like dictionary, vtable, etc
   _bytes[RW][OtherType] =  other_bytes;
@@ -424,6 +424,13 @@
 
   VMOp_Type type() const { return VMOp_PopulateDumpSharedSpace; }
   void doit();   // outline because gdb sucks
+
+private:
+  void handle_misc_data_space_failure(bool success) {
+    if (!success) {
+      report_out_of_shared_space(SharedMiscData);
+    }
+  }
 }; // class VM_PopulateDumpSharedSpace
 
 
@@ -517,9 +524,8 @@
   // buckets first [read-write], then copy the linked lists of entries
   // [read-only].
 
-  SymbolTable::reverse(md_top);
   NOT_PRODUCT(SymbolTable::verify());
-  SymbolTable::copy_buckets(&md_top, md_end);
+  handle_misc_data_space_failure(SymbolTable::copy_compact_table(&md_top, md_end));
 
   SystemDictionary::reverse();
   SystemDictionary::copy_buckets(&md_top, md_end);
@@ -528,7 +534,6 @@
   ClassLoader::copy_package_info_buckets(&md_top, md_end);
   ClassLoader::verify();
 
-  SymbolTable::copy_table(&md_top, md_end);
   SystemDictionary::copy_table(&md_top, md_end);
   ClassLoader::verify();
   ClassLoader::copy_package_info_table(&md_top, md_end);
@@ -1000,17 +1005,12 @@
   buffer += sizeof(intptr_t);
   buffer += vtable_size;
 
-  // Create the symbol table using the bucket array at this spot in the
-  // misc data space.  Since the symbol table is often modified, this
-  // region (of mapped pages) will be copy-on-write.
+  // Create the shared symbol table using the bucket array at this spot in the
+  // misc data space. (Todo: move this to read-only space. Currently
+  // this is mapped copy-on-write but will never be written into).
 
-  int symbolTableLen = *(intptr_t*)buffer;
-  buffer += sizeof(intptr_t);
-  int number_of_entries = *(intptr_t*)buffer;
-  buffer += sizeof(intptr_t);
-  SymbolTable::create_table((HashtableBucket<mtSymbol>*)buffer, symbolTableLen,
-                            number_of_entries);
-  buffer += symbolTableLen;
+  buffer = (char*)SymbolTable::init_shared_table(buffer);
+  SymbolTable::create_table();
 
   // Create the shared dictionary using the bucket array at this spot in
   // the misc data space.  Since the shared dictionary table is never
@@ -1019,7 +1019,7 @@
 
   int sharedDictionaryLen = *(intptr_t*)buffer;
   buffer += sizeof(intptr_t);
-  number_of_entries = *(intptr_t*)buffer;
+  int number_of_entries = *(intptr_t*)buffer;
   buffer += sizeof(intptr_t);
   SystemDictionary::set_shared_dictionary((HashtableBucket<mtClass>*)buffer,
                                           sharedDictionaryLen,
@@ -1041,18 +1041,10 @@
   ClassLoader::verify();
 
   // The following data in the shared misc data region are the linked
-  // list elements (HashtableEntry objects) for the symbol table, string
-  // table, and shared dictionary.  The heap objects referred to by the
-  // symbol table, string table, and shared dictionary are permanent and
-  // unmovable.  Since new entries added to the string and symbol tables
-  // are always added at the beginning of the linked lists, THESE LINKED
-  // LIST ELEMENTS ARE READ-ONLY.
+  // list elements (HashtableEntry objects) for the shared dictionary
+  // and package info table.
 
-  int len = *(intptr_t*)buffer; // skip over symbol table entries
-  buffer += sizeof(intptr_t);
-  buffer += len;
-
-  len = *(intptr_t*)buffer;     // skip over shared dictionary entries
+  int len = *(intptr_t*)buffer;     // skip over shared dictionary entries
   buffer += sizeof(intptr_t);
   buffer += len;
 
--- a/hotspot/src/share/vm/memory/metaspaceShared.hpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/memory/metaspaceShared.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -24,6 +24,7 @@
 #ifndef SHARE_VM_MEMORY_METASPACE_SHARED_HPP
 #define SHARE_VM_MEMORY_METASPACE_SHARED_HPP
 
+#include "classfile/compactHashtable.hpp"
 #include "memory/allocation.hpp"
 #include "memory/memRegion.hpp"
 #include "runtime/virtualspace.hpp"
@@ -45,12 +46,21 @@
 
 class FileMapInfo;
 
+class MetaspaceSharedStats VALUE_OBJ_CLASS_SPEC {
+public:
+  MetaspaceSharedStats() {
+    memset(this, 0, sizeof(*this));
+  }
+  CompactHashtableStats symbol;
+};
+
 // Class Data Sharing Support
 class MetaspaceShared : AllStatic {
 
   // CDS support
   static ReservedSpace* _shared_rs;
   static int _max_alignment;
+  static MetaspaceSharedStats _stats;
   static bool _link_classes_made_progress;
   static bool _check_classes_made_progress;
   static bool _has_error_classes;
@@ -123,6 +133,10 @@
                                       char** mc_top, char* mc_end);
   static void serialize(SerializeClosure* sc);
 
+  static MetaspaceSharedStats* stats() {
+    return &_stats;
+  }
+
   // JVM/TI RedefineClasses() support:
   // Remap the shared readonly space to shared readwrite, private if
   // sharing is enabled. Simply returns true if sharing is not enabled
--- a/hotspot/src/share/vm/memory/tenuredGeneration.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/memory/tenuredGeneration.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -28,6 +28,7 @@
 #include "gc_implementation/shared/parGCAllocBuffer.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/blockOffsetTable.inline.hpp"
+#include "memory/cardGeneration.inline.hpp"
 #include "memory/generationSpec.hpp"
 #include "memory/genMarkSweep.hpp"
 #include "memory/genOopClosures.inline.hpp"
--- a/hotspot/src/share/vm/memory/universe.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/memory/universe.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -1176,9 +1176,7 @@
 
   MemoryService::set_universe_heap(Universe::_collectedHeap);
 #if INCLUDE_CDS
-  if (UseSharedSpaces) {
-    SharedClassUtil::initialize(CHECK_false);
-  }
+  SharedClassUtil::initialize(CHECK_false);
 #endif
   return true;
 }
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -3543,11 +3543,12 @@
               ("purge: %s(%s): prev method @%d in version @%d is alive",
               method->name()->as_C_string(),
               method->signature()->as_C_string(), j, version));
+#ifdef ASSERT
             if (method->method_data() != NULL) {
-              // Clean out any weak method links for running methods
-              // (also should include not EMCP methods)
-              method->method_data()->clean_weak_method_links();
+              // Verify MethodData for running methods don't refer to old methods.
+              method->method_data()->verify_clean_weak_method_links();
             }
+#endif // ASSERT
           }
         }
       }
@@ -3561,15 +3562,17 @@
       deleted_count));
   }
 
-  // Clean MethodData of this class's methods so they don't refer to
+#ifdef ASSERT
+  // Verify clean MethodData for this class's methods, e.g. they don't refer to
   // old methods that are no longer running.
   Array<Method*>* methods = ik->methods();
   int num_methods = methods->length();
-  for (int index2 = 0; index2 < num_methods; ++index2) {
-    if (methods->at(index2)->method_data() != NULL) {
-      methods->at(index2)->method_data()->clean_weak_method_links();
+  for (int index = 0; index < num_methods; ++index) {
+    if (methods->at(index)->method_data() != NULL) {
+      methods->at(index)->method_data()->verify_clean_weak_method_links();
     }
   }
+#endif // ASSERT
 }
 
 void InstanceKlass::mark_newly_obsolete_methods(Array<Method*>* old_methods,
--- a/hotspot/src/share/vm/oops/methodData.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/oops/methodData.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -1283,6 +1283,11 @@
          DataLayout::compute_size_in_bytes(SpeculativeTrapData::static_cell_count()),
          "code needs to be adjusted");
 
+  // Do not create one of these if method has been redefined.
+  if (m != NULL && m->is_old()) {
+    return NULL;
+  }
+
   DataLayout* dp  = extra_data_base();
   DataLayout* end = args_data_limit();
 
@@ -1554,9 +1559,7 @@
 class CleanExtraDataMethodClosure : public CleanExtraDataClosure {
 public:
   CleanExtraDataMethodClosure() {}
-  bool is_live(Method* m) {
-    return !m->is_old() || m->on_stack();
-  }
+  bool is_live(Method* m) { return !m->is_old(); }
 };
 
 
@@ -1658,3 +1661,16 @@
   clean_extra_data(&cl);
   verify_extra_data_clean(&cl);
 }
+
+#ifdef ASSERT
+void MethodData::verify_clean_weak_method_links() {
+  for (ProfileData* data = first_data();
+       is_valid(data);
+       data = next_data(data)) {
+    data->verify_clean_weak_method_links();
+  }
+
+  CleanExtraDataMethodClosure cl;
+  verify_extra_data_clean(&cl);
+}
+#endif // ASSERT
--- a/hotspot/src/share/vm/oops/methodData.hpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/oops/methodData.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -254,6 +254,7 @@
 
   // Redefinition support
   void clean_weak_method_links();
+  DEBUG_ONLY(void verify_clean_weak_method_links();)
 };
 
 
@@ -511,6 +512,7 @@
 
   // Redefinition support
   virtual void clean_weak_method_links() {}
+  DEBUG_ONLY(virtual void verify_clean_weak_method_links() {})
 
   // CI translation: ProfileData can represent both MethodDataOop data
   // as well as CIMethodData data. This function is provided for translating
@@ -1971,6 +1973,7 @@
   }
 
   void set_method(Method* m) {
+    assert(!m->is_old(), "cannot add old methods");
     set_intptr_at(speculative_trap_method, (intptr_t)m);
   }
 
@@ -2480,6 +2483,7 @@
 
   void clean_method_data(BoolObjectClosure* is_alive);
   void clean_weak_method_links();
+  DEBUG_ONLY(void verify_clean_weak_method_links();)
   Mutex* extra_data_lock() { return &_extra_data_lock; }
 };
 
--- a/hotspot/src/share/vm/opto/callnode.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/opto/callnode.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -658,7 +658,7 @@
 
 void CallNode::dump_spec(outputStream *st) const {
   st->print(" ");
-  tf()->dump_on(st);
+  if (tf() != NULL)  tf()->dump_on(st);
   if (_cnt != COUNT_UNKNOWN)  st->print(" C=%f",_cnt);
   if (jvms() != NULL)  jvms()->dump_spec(st);
 }
--- a/hotspot/src/share/vm/opto/lcm.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/opto/lcm.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -417,8 +417,15 @@
   for (DUIterator_Last i2min, i2 = old_tst->last_outs(i2min); i2 >= i2min; --i2)
     old_tst->last_out(i2)->set_req(0, nul_chk);
   // Clean-up any dead code
-  for (uint i3 = 0; i3 < old_tst->req(); i3++)
+  for (uint i3 = 0; i3 < old_tst->req(); i3++) {
+    Node* in = old_tst->in(i3);
     old_tst->set_req(i3, NULL);
+    if (in->outcnt() == 0) {
+      // Remove dead input node
+      in->disconnect_inputs(NULL, C);
+      block->find_remove(in);
+    }
+  }
 
   latency_from_uses(nul_chk);
   latency_from_uses(best);
--- a/hotspot/src/share/vm/opto/loopnode.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/opto/loopnode.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -1147,7 +1147,7 @@
 // Dump special per-node info
 #ifndef PRODUCT
 void CountedLoopEndNode::dump_spec(outputStream *st) const {
-  if( in(TestValue)->is_Bool() ) {
+  if( in(TestValue) != NULL && in(TestValue)->is_Bool() ) {
     BoolTest bt( test_trip()); // Added this for g++.
 
     st->print("[");
--- a/hotspot/src/share/vm/opto/machnode.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/opto/machnode.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -473,8 +473,13 @@
 // Print any per-operand special info
 void MachNode::dump_spec(outputStream *st) const {
   uint cnt = num_opnds();
-  for( uint i=0; i<cnt; i++ )
-    _opnds[i]->dump_spec(st);
+  for( uint i=0; i<cnt; i++ ) {
+    if (_opnds[i] != NULL) {
+      _opnds[i]->dump_spec(st);
+    } else {
+      st->print(" _");
+    }
+  }
   const TypePtr *t = adr_type();
   if( t ) {
     Compile* C = Compile::current();
@@ -493,7 +498,11 @@
 //=============================================================================
 #ifndef PRODUCT
 void MachTypeNode::dump_spec(outputStream *st) const {
-  _bottom_type->dump_on(st);
+  if (_bottom_type != NULL) {
+    _bottom_type->dump_on(st);
+  } else {
+    st->print(" NULL");
+  }
 }
 #endif
 
@@ -635,7 +644,7 @@
 #ifndef PRODUCT
 void MachCallNode::dump_spec(outputStream *st) const {
   st->print("# ");
-  tf()->dump_on(st);
+  if (tf() != NULL)  tf()->dump_on(st);
   if (_cnt != COUNT_UNKNOWN)  st->print(" C=%f",_cnt);
   if (jvms() != NULL)  jvms()->dump_spec(st);
 }
--- a/hotspot/src/share/vm/opto/memnode.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/opto/memnode.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -4370,7 +4370,7 @@
   st->print(" {");
   Node* base_mem = base_memory();
   for( uint i = Compile::AliasIdxRaw; i < req(); i++ ) {
-    Node* mem = memory_at(i);
+    Node* mem = (in(i) != NULL) ? memory_at(i) : base_mem;
     if (mem == base_mem) { st->print(" -"); continue; }
     st->print( " N%d:", mem->_idx );
     Compile::current()->get_adr_type(i)->dump_on(st);
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -148,6 +148,10 @@
     _scratch_classes[i] = NULL;
   }
 
+  // Clean out MethodData pointing to old Method*
+  MethodDataCleaner clean_weak_method_links;
+  ClassLoaderDataGraph::classes_do(&clean_weak_method_links);
+
   // Disable any dependent concurrent compilations
   SystemDictionary::notice_modification();
 
@@ -155,8 +159,8 @@
   // See jvmtiExport.hpp for detailed explanation.
   JvmtiExport::set_has_redefined_a_class();
 
-// check_class() is optionally called for product bits, but is
-// always called for non-product bits.
+  // check_class() is optionally called for product bits, but is
+  // always called for non-product bits.
 #ifdef PRODUCT
   if (RC_TRACE_ENABLED(0x00004000)) {
 #endif
@@ -3445,6 +3449,22 @@
   }
 }
 
+// Clean method data for this class
+void VM_RedefineClasses::MethodDataCleaner::do_klass(Klass* k) {
+  if (k->oop_is_instance()) {
+    InstanceKlass *ik = InstanceKlass::cast(k);
+    // Clean MethodData of this class's methods so they don't refer to
+    // old methods that are no longer running.
+    Array<Method*>* methods = ik->methods();
+    int num_methods = methods->length();
+    for (int index = 0; index < num_methods; ++index) {
+      if (methods->at(index)->method_data() != NULL) {
+        methods->at(index)->method_data()->clean_weak_method_links();
+      }
+    }
+  }
+}
+
 void VM_RedefineClasses::update_jmethod_ids() {
   for (int j = 0; j < _matching_methods_length; ++j) {
     Method* old_method = _matching_old_methods[j];
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.hpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -511,6 +511,12 @@
     void do_klass(Klass* k);
   };
 
+  // Clean MethodData out
+  class MethodDataCleaner : public KlassClosure {
+   public:
+    MethodDataCleaner() {}
+    void do_klass(Klass* k);
+  };
  public:
   VM_RedefineClasses(jint class_count,
                      const jvmtiClassDefinition *class_defs,
--- a/hotspot/src/share/vm/prims/whitebox.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/prims/whitebox.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -69,6 +69,14 @@
 bool WhiteBox::_used = false;
 volatile bool WhiteBox::compilation_locked = false;
 
+class VM_WhiteBoxOperation : public VM_Operation {
+ public:
+  VM_WhiteBoxOperation()                         { }
+  VMOp_Type type()                  const        { return VMOp_WhiteBoxOperation; }
+  bool allow_nested_vm_operations() const        { return true; }
+};
+
+
 WB_ENTRY(jlong, WB_GetObjectAddress(JNIEnv* env, jobject o, jobject obj))
   return (jlong)(void*)JNIHandles::resolve(obj);
 WB_END
@@ -404,6 +412,43 @@
   return env->FromReflectedMethod(method);
 }
 
+// Deoptimizes all compiled frames and makes nmethods not entrant if it's requested
+class VM_WhiteBoxDeoptimizeFrames : public VM_WhiteBoxOperation {
+ private:
+  int _result;
+  const bool _make_not_entrant;
+ public:
+  VM_WhiteBoxDeoptimizeFrames(bool make_not_entrant) :
+        _result(0), _make_not_entrant(make_not_entrant) { }
+  int  result() const { return _result; }
+
+  void doit() {
+    for (JavaThread* t = Threads::first(); t != NULL; t = t->next()) {
+      if (t->has_last_Java_frame()) {
+        for (StackFrameStream fst(t, UseBiasedLocking); !fst.is_done(); fst.next()) {
+          frame* f = fst.current();
+          if (f->can_be_deoptimized() && !f->is_deoptimized_frame()) {
+            RegisterMap* reg_map = fst.register_map();
+            Deoptimization::deoptimize(t, *f, reg_map);
+            if (_make_not_entrant) {
+                nmethod* nm = CodeCache::find_nmethod(f->pc());
+                assert(nm != NULL, "sanity check");
+                nm->make_not_entrant();
+            }
+            ++_result;
+          }
+        }
+      }
+    }
+  }
+};
+
+WB_ENTRY(jint, WB_DeoptimizeFrames(JNIEnv* env, jobject o, jboolean make_not_entrant))
+  VM_WhiteBoxDeoptimizeFrames op(make_not_entrant == JNI_TRUE);
+  VMThread::execute(&op);
+  return op.result();
+WB_END
+
 WB_ENTRY(void, WB_DeoptimizeAll(JNIEnv* env, jobject o))
   MutexLockerEx mu(Compile_lock);
   CodeCache::mark_all_nmethods_for_deoptimization();
@@ -526,13 +571,6 @@
   return (mh->queued_for_compilation() || nm != NULL);
 WB_END
 
-class VM_WhiteBoxOperation : public VM_Operation {
- public:
-  VM_WhiteBoxOperation()                         { }
-  VMOp_Type type()                  const        { return VMOp_WhiteBoxOperation; }
-  bool allow_nested_vm_operations() const        { return true; }
-};
-
 class AlwaysFalseClosure : public BoolObjectClosure {
  public:
   bool do_object_b(oop p) { return false; }
@@ -761,7 +799,6 @@
   }
 WB_END
 
-
 WB_ENTRY(void, WB_LockCompilation(JNIEnv* env, jobject o, jlong timeout))
   WhiteBox::compilation_locked = true;
 WB_END
@@ -1209,6 +1246,7 @@
   {CC"NMTChangeTrackingLevel", CC"()Z",               (void*)&WB_NMTChangeTrackingLevel},
   {CC"NMTGetHashSize",      CC"()I",                  (void*)&WB_NMTGetHashSize     },
 #endif // INCLUDE_NMT
+  {CC"deoptimizeFrames",   CC"(Z)I",                  (void*)&WB_DeoptimizeFrames  },
   {CC"deoptimizeAll",      CC"()V",                   (void*)&WB_DeoptimizeAll     },
   {CC"deoptimizeMethod",   CC"(Ljava/lang/reflect/Executable;Z)I",
                                                       (void*)&WB_DeoptimizeMethod  },
--- a/hotspot/src/share/vm/runtime/globals.hpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -3779,6 +3779,9 @@
           NOT_LP64(LINUX_ONLY(2*G) NOT_LINUX(0)),                           \
           "Address to allocate shared memory region for class data")        \
                                                                             \
+  product(uintx, SharedSymbolTableBucketSize, 4,                            \
+          "Average number of symbols per bucket in shared table")           \
+                                                                            \
   diagnostic(bool, IgnoreUnverifiableClassesDuringDump, false,              \
           "Do not quit -Xshare:dump even if we encounter unverifiable "     \
           "classes. Just exclude them from the shared dictionary.")         \
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -2559,6 +2559,8 @@
   /**********************/                                                \
   /* frame              */                                                \
   /**********************/                                                \
+  NOT_ZERO(PPC64_ONLY(declare_constant(frame::abi_minframe_size)))        \
+  NOT_ZERO(PPC64_ONLY(declare_constant(frame::entry_frame_locals_size)))  \
                                                                           \
   NOT_ZERO(X86_ONLY(declare_constant(frame::entry_frame_call_wrapper_offset)))      \
   declare_constant(frame::pc_return_offset)                               \
--- a/hotspot/src/share/vm/runtime/vm_operations.hpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/runtime/vm_operations.hpp	Mon Jan 05 15:00:30 2015 +0100
@@ -100,6 +100,7 @@
   template(RotateGCLog)                           \
   template(WhiteBoxOperation)                     \
   template(ClassLoaderStatsOperation)             \
+  template(DumpHashtable)                         \
   template(MarkActiveNMethods)                    \
   template(PrintCompileQueue)                     \
   template(PrintCodeList)                         \
--- a/hotspot/src/share/vm/services/diagnosticCommand.cpp	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp	Mon Jan 05 15:00:30 2015 +0100
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/classLoaderStats.hpp"
+#include "classfile/compactHashtable.hpp"
 #include "gc_implementation/shared/vmGCOperations.hpp"
 #include "runtime/javaCalls.hpp"
 #include "runtime/os.hpp"
@@ -56,6 +57,8 @@
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassStatsDCmd>(full_export, true, false));
+  DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SymboltableDCmd>(full_export, true, false));
+  DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<StringtableDCmd>(full_export, true, false));
 #endif // INCLUDE_SERVICES
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RotateGCLogDCmd>(full_export, true, false));
--- a/hotspot/test/TEST.groups	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/TEST.groups	Mon Jan 05 15:00:30 2015 +0100
@@ -205,7 +205,6 @@
 compact1_minimal = \
   serviceability/ \
   compiler/ \
-  testlibrary_tests/ \
   sanity/ \
   runtime/ \
   gc/ \
--- a/hotspot/test/compiler/arguments/BMISupportedCPUTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/arguments/BMISupportedCPUTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -60,8 +60,11 @@
           VM will be launched with following flags:
           -XX:+<tested option> -version
         */
+        String errorString = String.format("JVM should start with '-XX:+%s'"
+                + " flag without any warnings", optionName);
         CommandLineOptionTest.verifySameJVMStartup(null,
-                new String[] { warningMessage }, ExitCode.OK,
+                new String[] { warningMessage }, errorString, errorString,
+                ExitCode.OK,
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
 
         /*
@@ -69,8 +72,11 @@
           VM will be launched with following flags:
           -XX:-<tested option> -version
         */
+        errorString = String.format("JVM should start with '-XX:-%s'"
+                + " flag without any warnings", optionName);
         CommandLineOptionTest.verifySameJVMStartup(null,
-                new String[] { warningMessage }, ExitCode.OK,
+                new String[] { warningMessage }, errorString,
+                errorString, ExitCode.OK,
                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
 
         /*
@@ -78,7 +84,9 @@
           VM will be launched with following flags:
           -version
         */
-        CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true");
+        CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
+                String.format("Option '%s' is expected to have default value "
+                    + "'true'", optionName));
 
         /*
           Verify that option could be explicitly turned off.
@@ -86,6 +94,8 @@
           -XX:-<tested option> -version
         */
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' is set to have value 'false'",
+                    optionName),
                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
     }
 }
--- a/hotspot/test/compiler/arguments/BMIUnsupportedCPUTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/arguments/BMIUnsupportedCPUTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -75,9 +75,13 @@
           warning. VM will be launched with following options:
           -XX:+<tested option> -version
         */
+        String errorString = String.format("JVM should start with '-XX:+%s' "
+                + "flag, but output should contain warning.", optionName);
         CommandLineOptionTest.verifySameJVMStartup(
                 new String[] { warningMessage }, new String[] { errorMessage },
-                ExitCode.OK, CommandLineOptionTest.prepareBooleanFlag(
+                errorString, String.format("Option '%s' is unsupported.%n"
+                + "Warning expected to be shown.", optionName), ExitCode.OK,
+                CommandLineOptionTest.prepareBooleanFlag(
                         optionName, true));
 
         /*
@@ -85,15 +89,21 @@
           VM will be launched with following options:
           -XX:-<tested option> -version
         */
+        errorString = String.format("JVM should start with '-XX:-%s' flag "
+                        + "without any warnings", optionName);
         CommandLineOptionTest.verifySameJVMStartup(null,
-                new String[] { warningMessage, errorMessage }, ExitCode.OK,
+                new String[] { warningMessage, errorMessage },
+                errorString, errorString, ExitCode.OK,
                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
 
         /*
-          Verify that on unsupported CPUs option is off by default.
-          VM will be launched with following options: -version
-        */
-        CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false");
+         * Verify that on unsupported CPUs option is off by default. VM will be
+         * launched with following options: -version
+         */
+        CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' is expected to have default value "
+                        + "'false' since feature required is not supported "
+                        + "on CPU", optionName));
 
         /*
           Verify that on unsupported CPUs option will be off even if
@@ -101,6 +111,9 @@
           following options: -XX:+<tested option> -version
         */
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' is expected to have default value"
+                        + " 'false' since feature required is not supported on"
+                        + " CPU even if user set another value.", optionName),
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
 
     }
@@ -118,11 +131,17 @@
           with following options: -XX:[+-]<tested option> -version
         */
         CommandLineOptionTest.verifySameJVMStartup(
-                new String[] { errorMessage }, null, ExitCode.FAIL,
+                new String[] { errorMessage }, null,
+                String.format("JVM startup should fail with '-XX:+%s' flag."
+                        + "%nOption should be unknown (non-X86CPU).",
+                        optionName), "", ExitCode.FAIL,
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
 
         CommandLineOptionTest.verifySameJVMStartup(
-                new String[] { errorMessage }, null, ExitCode.FAIL,
+                new String[] { errorMessage }, null,
+                String.format("JVM startup should fail with '-XX:-%s' flag."
+                        + "%nOption should be unknown (non-X86CPU)",
+                        optionName), "", ExitCode.FAIL,
                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
     }
 }
--- a/hotspot/test/compiler/arguments/CheckCompileThresholdScaling.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/arguments/CheckCompileThresholdScaling.java	Mon Jan 05 15:00:30 2015 +0100
@@ -330,7 +330,7 @@
         } catch (RuntimeException e) {
             // Check if tiered compilation is available in this JVM
             // Version. Throw exception only if it is available.
-            if (!(tiered && out.getOutput().contains("Client VM warning: TieredCompilation is disabled in this release."))) {
+            if (!(tiered && out.getOutput().contains("TieredCompilation is disabled in this release."))) {
                 throw new RuntimeException(e);
             }
         }
--- a/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 8031321
  * @summary Verify processing of UseBMI1Instructions option on CPU with
  *          BMI1 feature support.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestUseBMI1InstructionsOnSupportedCPU
  *        BMISupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 8031321
  * @summary Verify processing of UseBMI1Instructions option on CPU without
  *          BMI1 feature support.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestUseBMI1InstructionsOnUnsupportedCPU
  *        BMIUnsupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 8031321
  * @summary Verify processing of UseCountLeadingZerosInstruction option
  *          on CPU with LZCNT support.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestUseCountLeadingZerosInstructionOnSupportedCPU
  *        BMISupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 8031321
  * @summary Verify processing of UseCountLeadingZerosInstruction option
  *          on CPU without LZCNT support.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestUseCountLeadingZerosInstructionOnUnsupportedCPU
  *        BMIUnsupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 8031321
  * @summary Verify processing of UseCountTrailingZerosInstruction option
  *          on CPU with TZCNT (BMI1 feature) support.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestUseCountTrailingZerosInstructionOnSupportedCPU
  *        BMISupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
@@ -59,6 +59,9 @@
           -XX:-UseBMI1Instructions -version
         */
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                "Option 'UseCountTrailingZerosInstruction' should have "
+                    + "'false' value if all BMI1 instructions are explicitly"
+                    + " disabled (-XX:-UseBMI1Instructions flag used)",
                 TestUseCountTrailingZerosInstructionOnSupportedCPU.DISABLE_BMI);
 
         /*
@@ -68,6 +71,9 @@
           -XX:+UseCountTrailingZerosInstruction -version
         */
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
+                "Option 'UseCountTrailingZerosInstruction' should be able to "
+                    + "be turned on even if all BMI1 instructions are "
+                    + "disabled (-XX:-UseBMI1Instructions flag used)",
                 TestUseCountTrailingZerosInstructionOnSupportedCPU.DISABLE_BMI,
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
     }
--- a/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 8031321
  * @summary Verify processing of UseCountTrailingZerosInstruction option
  *          on CPU without TZCNT instruction (BMI1 feature) support.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestUseCountTrailingZerosInstructionOnUnsupportedCPU
  *        BMIUnsupportedCPUTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
@@ -59,6 +59,9 @@
           -XX:+UseBMI1Instructions -version
         */
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                "Feature bmi1 is not supported on current CPU. Option "
+                    + "UseCountTrailingZerosInstruction should have 'false'"
+                    + " value",
                 TestUseCountTrailingZerosInstructionOnUnsupportedCPU.
                         ENABLE_BMI);
 
@@ -68,6 +71,9 @@
           -version
         */
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                    "Feature bmi1 is not supported on current CPU. Option "
+                    + "UseCountTrailingZerosInstruction should have 'false'"
+                    + " value",
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true),
                 TestUseCountTrailingZerosInstructionOnUnsupportedCPU.
                         ENABLE_BMI);
--- a/hotspot/test/compiler/c2/6589834/Test_ia32.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/c2/6589834/Test_ia32.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 6589834
  * @summary Safepoint placed between stack pointer increment and decrement leads
  *          to interpreter's stack corruption after deoptimization.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build ClassFileInstaller sun.hotspot.WhiteBox com.oracle.java.testlibrary.*
  *        Test_ia32 InlinedArrayCloneTestCase
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java	Mon Jan 05 15:00:30 2015 +0100
@@ -33,7 +33,7 @@
  * @test TestAnonymousClassUnloading
  * @bug 8054402
  * @summary "Tests unloading of anonymous classes."
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @compile TestAnonymousClassUnloading.java
  * @run main ClassFileInstaller TestAnonymousClassUnloading
  *                              sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java	Mon Jan 05 15:00:30 2015 +0100
@@ -31,7 +31,7 @@
  * @test MethodUnloadingTest
  * @bug 8029443
  * @summary "Tests the unloading of methods to to class unloading"
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestMethodUnloading
  * @build WorkerClass
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/codecache/CheckSegmentedCodeCache.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/codecache/CheckSegmentedCodeCache.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
 /*
  * @test CheckSegmentedCodeCache
  * @bug 8015774
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @summary "Checks VM options related to the segmented code cache"
  * @build CheckSegmentedCodeCache
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/codecache/OverflowCodeCacheTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/codecache/OverflowCodeCacheTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -34,7 +34,7 @@
 /*
  * @test OverflowCodeCacheTest
  * @bug 8059550
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build OverflowCodeCacheTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/TestAndnI.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/TestAndnI.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of ANDN instruction
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestAndnI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/TestAndnL.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/TestAndnL.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of ANDN instruction
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestAndnL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/TestBlsiI.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsiI.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSI instruction
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestBlsiI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/TestBlsiL.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsiL.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSI instruction
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestBlsiL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/TestBlsmskI.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsmskI.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSMSK instruction
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestBlsmskI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/TestBlsmskL.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsmskL.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSMSK instruction
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestBlsmskL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/TestBlsrI.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsrI.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSR instruction
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestBlsrI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/TestBlsrL.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/TestBlsrL.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of BLSR instruction
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestBlsrL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/TestLzcntI.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/TestLzcntI.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of intrinsic
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestLzcntI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/TestLzcntL.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/TestLzcntL.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of intrinsic
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestLzcntL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/TestTzcntI.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/TestTzcntI.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of intrinsic
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestTzcntI BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/TestTzcntL.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/TestTzcntL.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031321
  * @summary Verify that results of computations are the same w/
  *          and w/o usage of intrinsic
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestTzcntL BMITestRunner Expr
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestI.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestI.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @library /testlibrary /../../test/lib /compiler/whitebox ..
  * @build AddnTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestL.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/AddnTestL.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @library /testlibrary /../../test/lib /compiler/whitebox ..
  * @build AddnTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @library /testlibrary /../../test/lib /compiler/whitebox ..
  * @build BlsiTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @library /testlibrary /../../test/lib /compiler/whitebox ..
  * @build BlsiTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @library /testlibrary /../../test/lib /compiler/whitebox ..
  * @build BlsmskTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @library /testlibrary /../../test/lib /compiler/whitebox ..
  * @build BlsmskTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @library /testlibrary /../../test/lib /compiler/whitebox ..
  * @build BlsrTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @library /testlibrary /../../test/lib /compiler/whitebox ..
  * @build BlsrTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @library /testlibrary /../../test/lib /compiler/whitebox ..
  * @build LZcntTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @library /testlibrary /../../test/lib /compiler/whitebox ..
  * @build LZcntTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @library /testlibrary /../../test/lib /compiler/whitebox ..
  * @build TZcntTestI
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8031321
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox ..
+ * @library /testlibrary /../../test/lib /compiler/whitebox ..
  * @build TZcntTestL
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/classcast/NullCheckDroppingsTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/classcast/NullCheckDroppingsTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test NullCheckDroppingsTest
  * @bug 8054492
  * @summary "Casting can result in redundant null checks in generated code"
- * @library /testlibrary /testlibrary/whitebox /testlibrary/com/oracle/java/testlibrary
+ * @library /testlibrary /../../test/lib /testlibrary/com/oracle/java/testlibrary
  * @build NullCheckDroppingsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
  * @build AddExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
  * @build AddExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
  * @build DecrementExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
  * @build DecrementExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
  * @build IncrementExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
  * @build IncrementExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
  * @build MultiplyExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
  * @build MultiplyExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
  * @build NegateExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
  * @build NegateExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
  * @build SubtractExactIntTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  *          /compiler/testlibrary
  * @build SubtractExactLongTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8035968
  * @summary Verify UseSHA1Intrinsics option processing on supported CPU,
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary testcases
+ * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
  * @build TestUseSHA1IntrinsicsOptionOnSupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8035968
  * @summary Verify UseSHA1Intrinsics option processing on unsupported CPU,
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary testcases
+ * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
  * @build TestUseSHA1IntrinsicsOptionOnUnsupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8035968
  * @summary Verify UseSHA256Intrinsics option processing on supported CPU,
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary testcases
+ * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
  * @build TestUseSHA256IntrinsicsOptionOnSupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8035968
  * @summary Verify UseSHA256Intrinsics option processing on unsupported CPU,
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary testcases
+ * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
  * @build TestUseSHA256IntrinsicsOptionOnUnsupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8035968
  * @summary Verify UseSHA512Intrinsics option processing on supported CPU.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary testcases
+ * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
  * @build TestUseSHA512IntrinsicsOptionOnSupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8035968
  * @summary Verify UseSHA512Intrinsics option processing on unsupported CPU,
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary testcases
+ * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
  * @build TestUseSHA512IntrinsicsOptionOnUnsupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8035968
  * @summary Verify UseSHA option processing on supported CPU,
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary testcases
+ * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
  * @build TestUseSHAOptionOnSupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8035968
  * @summary Verify UseSHA option processing on unsupported CPU.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary testcases
+ * @library /testlibrary /../../test/lib /compiler/testlibrary testcases
  * @build TestUseSHAOptionOnUnsupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -41,30 +41,42 @@
 
     @Override
     protected void verifyWarnings() throws Throwable {
+        String shouldPassMessage = String.format("JVM should start with "
+                + "option '%s' without any warnings", optionName);
         // Verify that on non-x86 and non-SPARC CPU usage of SHA-related
         // options will not cause any warnings.
         CommandLineOptionTest.verifySameJVMStartup(null,
-                new String[] { ".*" + optionName + ".*" }, ExitCode.OK,
+                new String[] { ".*" + optionName + ".*" }, shouldPassMessage,
+                shouldPassMessage, ExitCode.OK,
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
 
         CommandLineOptionTest.verifySameJVMStartup(null,
-                new String[] { ".*" + optionName + ".*" }, ExitCode.OK,
+                new String[] { ".*" + optionName + ".*" }, shouldPassMessage,
+                shouldPassMessage, ExitCode.OK,
                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
     }
 
     @Override
     protected void verifyOptionValues() throws Throwable {
         // Verify that option is disabled by default.
-        CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false");
+        CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' should be disabled by default",
+                        optionName));
 
         // Verify that option is disabled even if it was explicitly enabled
         // using CLI options.
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' should be off on unsupported "
+                        + "CPU even if set to true directly", optionName),
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
 
         // Verify that option is disabled when it explicitly disabled
         // using CLI options.
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' should be off on unsupported CPU"
+                        + " even if '%s' flag set to JVM", optionName,
+                        CommandLineOptionTest.prepareBooleanFlag(
+                        SHAOptionsBase.USE_SHA_OPTION, true)),
                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
     }
 }
--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedSparcCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedSparcCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -39,17 +39,24 @@
 
     @Override
     protected void verifyWarnings() throws Throwable {
+
+        String shouldPassMessage = String.format("JVM should start with option"
+                + " '%s' without any warnings", optionName);
         // Verify that there are no warning when option is explicitly enabled.
         CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
-                }, ExitCode.OK,
+                }, shouldPassMessage, shouldPassMessage, ExitCode.OK,
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
 
         // Verify that option could be disabled even if +UseSHA was passed to
         // JVM.
         CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
-                }, ExitCode.OK,
+                }, shouldPassMessage, String.format("It should be able to "
+                        + "disable option '%s' even if %s was passed to JVM",
+                        optionName, CommandLineOptionTest.prepareBooleanFlag(
+                            SHAOptionsBase.USE_SHA_OPTION, true)),
+                ExitCode.OK,
                 CommandLineOptionTest.prepareBooleanFlag(
                         SHAOptionsBase.USE_SHA_OPTION, true),
                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
@@ -58,7 +65,11 @@
         // all SHA intrinsics via -UseSHA without any warnings.
         CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
-                }, ExitCode.OK,
+                }, shouldPassMessage, String.format("It should be able to "
+                        + "enable option '%s' even if %s was passed to JVM",
+                        optionName, CommandLineOptionTest.prepareBooleanFlag(
+                            SHAOptionsBase.USE_SHA_OPTION, false)),
+                ExitCode.OK,
                 CommandLineOptionTest.prepareBooleanFlag(
                         SHAOptionsBase.USE_SHA_OPTION, false),
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
@@ -66,19 +77,30 @@
 
     @Override
     protected void verifyOptionValues() throws Throwable {
-        // Verify that on supported CPU option is enabled by default.
-        CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true");
+        // Verify that "It should be able to disable option "
+
+        CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
+                String.format("Option '%s' should be enabled by default",
+                        optionName));
 
         // Verify that it is possible to explicitly enable the option.
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
+                String.format("Option '%s' was set to have value 'true'",
+                        optionName),
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
 
         // Verify that it is possible to explicitly disable the option.
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' was set to have value 'false'",
+                        optionName),
                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
 
         // verify that option is disabled when -UseSHA was passed to JVM.
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' should have value 'false' when %s"
+                        + " flag set to JVM", optionName,
+                        CommandLineOptionTest.prepareBooleanFlag(
+                            SHAOptionsBase.USE_SHA_OPTION, false)),
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true),
                 CommandLineOptionTest.prepareBooleanFlag(
                         SHAOptionsBase.USE_SHA_OPTION, false));
@@ -86,6 +108,10 @@
         // Verify that it is possible to explicitly disable the tested option
         // even if +UseSHA was passed to JVM.
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' should have value 'false' if set so"
+                        + " even if %s flag set to JVM", optionName,
+                        CommandLineOptionTest.prepareBooleanFlag(
+                            SHAOptionsBase.USE_SHA_OPTION, true)),
                 CommandLineOptionTest.prepareBooleanFlag(
                         SHAOptionsBase.USE_SHA_OPTION, true),
                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -41,25 +41,35 @@
 
     @Override
     protected void verifyWarnings() throws Throwable {
+        String shouldPassMessage = String.format("JVM startup should pass with"
+                + "option '-XX:-%s' without any warnings", optionName);
         //Verify that option could be disabled without any warnings.
         CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
-                }, ExitCode.OK,
+                }, shouldPassMessage, shouldPassMessage, ExitCode.OK,
                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
     }
 
     @Override
     protected void verifyOptionValues() throws Throwable {
         // Verify that option is disabled by default.
-        CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false");
+        CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' should be disabled by default",
+                        optionName));
 
         // Verify that option is disabled even if it was explicitly enabled
         // using CLI options.
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' should be off on unsupported "
+                        + "SparcCPU even if set to true directly", optionName),
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
 
         // Verify that option is disabled when +UseSHA was passed to JVM.
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' should be off on unsupported "
+                        + "SparcCPU even if %s flag set to JVM",
+                        optionName, CommandLineOptionTest.prepareBooleanFlag(
+                            SHAOptionsBase.USE_SHA_OPTION, true)),
                 CommandLineOptionTest.prepareBooleanFlag(
                         SHAOptionsBase.USE_SHA_OPTION, true));
     }
--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -38,33 +38,45 @@
 
     @Override
     protected void verifyWarnings() throws Throwable {
+        String shouldPassMessage = String.format("JVM should start with '-XX:+"
+                + "%s' flag, but output should contain warning.", optionName);
         // Verify that when the tested option is explicitly enabled, then
         // a warning will occur in VM output.
         CommandLineOptionTest.verifySameJVMStartup(new String[] {
                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
-                }, null, ExitCode.OK,
+                }, null, shouldPassMessage, shouldPassMessage, ExitCode.OK,
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
 
+        shouldPassMessage = String.format("JVM should start with '-XX:-%s' "
+                + "flag without any warnings", optionName);
         // Verify that the tested option could be explicitly disabled without
         // a warning.
         CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
-                }, ExitCode.OK,
+                }, shouldPassMessage, shouldPassMessage, ExitCode.OK,
                 CommandLineOptionTest.prepareBooleanFlag(optionName, false));
     }
 
     @Override
     protected void verifyOptionValues() throws Throwable {
         // Verify that the tested option is disabled by default.
-        CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false");
+        CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' should be disabled by default",
+                        optionName));
 
         // Verify that it is not possible to explicitly enable the option.
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' should be off on unsupported "
+                        + "X86CPU even if set to true directly", optionName),
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
 
         // Verify that the tested option is disabled even if +UseSHA was passed
         // to JVM.
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "false",
+                String.format("Option '%s' should be off on unsupported "
+                        + "X86CPU even if %s flag set to JVM",
+                        optionName, CommandLineOptionTest.prepareBooleanFlag(
+                            SHAOptionsBase.USE_SHA_OPTION, true)),
                 CommandLineOptionTest.prepareBooleanFlag(
                         SHAOptionsBase.USE_SHA_OPTION, true));
     }
--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -50,10 +50,13 @@
     }
     @Override
     protected void verifyWarnings() throws Throwable {
-        // Verify that attempt to enable the tested option will cause a warning.
+        String shouldPassMessage = String.format("JVM should start with "
+                + "'-XX:+%s' flag, but output should contain warning.",
+                optionName);
+        // Verify that attempt to enable the tested option will cause a warning
         CommandLineOptionTest.verifySameJVMStartup(new String[] {
                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
-                }, null, ExitCode.OK,
+                }, null, shouldPassMessage, shouldPassMessage, ExitCode.OK,
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
     }
 }
--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedSparcCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedSparcCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -39,16 +39,22 @@
                 IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE));
 
         Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION,
-                "Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION
-                        + " option only.");
+                String.format("Test case should be used for '%s' option only.",
+                        SHAOptionsBase.USE_SHA_OPTION));
     }
 
     @Override
     protected void verifyWarnings() throws Throwable {
+        String shouldPassMessage = String.format("JVM startup should pass when"
+                        + " %s was passed and all UseSHA*Intrinsics options "
+                        + "were disabled",
+                        CommandLineOptionTest.prepareBooleanFlag(
+                            SHAOptionsBase.USE_SHA_OPTION, true));
         // Verify that there will be no warnings when +UseSHA was passed and
         // all UseSHA*Intrinsics options were disabled.
         CommandLineOptionTest.verifySameJVMStartup(
-                null, new String[] { ".*UseSHA.*" }, ExitCode.OK,
+                null, new String[] { ".*UseSHA.*" }, shouldPassMessage,
+                shouldPassMessage, ExitCode.OK,
                 CommandLineOptionTest.prepareBooleanFlag(
                         SHAOptionsBase.USE_SHA_OPTION, true),
                 CommandLineOptionTest.prepareBooleanFlag(
@@ -61,10 +67,12 @@
 
     @Override
     protected void verifyOptionValues() throws Throwable {
-        // Verify that UseSHA is disabled when all UseSHA*Intrinscs are
+        // Verify that UseSHA is disabled when all UseSHA*Intrinsics are
         // disabled.
         CommandLineOptionTest.verifyOptionValueForSameVM(
-                SHAOptionsBase.USE_SHA_OPTION, "false",
+                SHAOptionsBase.USE_SHA_OPTION, "false", String.format(
+                "'%s' option should be disabled when all UseSHA*Intrinsics are"
+                        + " disabled", SHAOptionsBase.USE_SHA_OPTION),
                 CommandLineOptionTest.prepareBooleanFlag(
                         SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, false),
                 CommandLineOptionTest.prepareBooleanFlag(
@@ -73,9 +81,14 @@
                         SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, false));
 
         CommandLineOptionTest.verifyOptionValueForSameVM(
-                // Verify that UseSHA is disabled when all UseSHA*Intrinscs are
+                // Verify that UseSHA is disabled when all UseSHA*Intrinsics are
                 // disabled even if it was explicitly enabled.
                 SHAOptionsBase.USE_SHA_OPTION, "false",
+                String.format("'%s' option should be disabled when all "
+                        + "UseSHA*Intrinsics are disabled even if %s flag set "
+                        + "to JVM", SHAOptionsBase.USE_SHA_OPTION,
+                        CommandLineOptionTest.prepareBooleanFlag(
+                             SHAOptionsBase.USE_SHA_OPTION, true)),
                 CommandLineOptionTest.prepareBooleanFlag(
                         SHAOptionsBase.USE_SHA_OPTION, true),
                 CommandLineOptionTest.prepareBooleanFlag(
@@ -89,6 +102,11 @@
         // if all UseSHA*Intrinsics options were enabled.
         CommandLineOptionTest.verifyOptionValueForSameVM(
                 SHAOptionsBase.USE_SHA_OPTION, "false",
+                String.format("'%s' option should be disabled if %s flag "
+                        + "set even if all UseSHA*Intrinsics were enabled",
+                        SHAOptionsBase.USE_SHA_OPTION,
+                        CommandLineOptionTest.prepareBooleanFlag(
+                            SHAOptionsBase.USE_SHA_OPTION, false)),
                 CommandLineOptionTest.prepareBooleanFlag(
                         SHAOptionsBase.USE_SHA_OPTION, false),
                 CommandLineOptionTest.prepareBooleanFlag(
--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedSparcCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedSparcCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -48,18 +48,24 @@
     @Override
     protected void verifyWarnings() throws Throwable {
         // Verify that attempt to use UseSHA option will cause a warning.
+        String shouldPassMessage = String.format("JVM startup should pass with"
+                + " '%s' option on unsupported SparcCPU, but there should be"
+                + "the message shown.", optionName);
         CommandLineOptionTest.verifySameJVMStartup(new String[] {
                         SHAOptionsBase.getWarningForUnsupportedCPU(optionName)
-                }, null, ExitCode.OK,
+                }, null, shouldPassMessage, shouldPassMessage, ExitCode.OK,
                 CommandLineOptionTest.prepareBooleanFlag(optionName, true));
     }
 
     @Override
     protected void verifyOptionValues() throws Throwable {
         // Verify that UseSHA option remains disabled even if all
-        // UseSHA*Intrincs options were enabled.
+        // UseSHA*Intrinsics were enabled.
         CommandLineOptionTest.verifyOptionValueForSameVM(
-                SHAOptionsBase.USE_SHA_OPTION, "false",
+                SHAOptionsBase.USE_SHA_OPTION, "false", String.format(
+                    "%s option should be disabled on unsupported SparcCPU"
+                        + " even if all UseSHA*Intrinsics options were enabled.",
+                    SHAOptionsBase.USE_SHA_OPTION),
                 CommandLineOptionTest.prepareBooleanFlag(
                         SHAOptionsBase.USE_SHA1_INTRINSICS_OPTION, true),
                 CommandLineOptionTest.prepareBooleanFlag(
@@ -68,9 +74,14 @@
                         SHAOptionsBase.USE_SHA512_INTRINSICS_OPTION, true));
 
         // Verify that UseSHA option remains disabled even if all
-        // UseSHA*Intrincs options were enabled and UseSHA was enabled as well.
+        // UseSHA*Intrinsics options were enabled and UseSHA was enabled as well.
         CommandLineOptionTest.verifyOptionValueForSameVM(
-                SHAOptionsBase.USE_SHA_OPTION, "false",
+                SHAOptionsBase.USE_SHA_OPTION, "false", String.format(
+                    "%s option should be disabled on unsupported SparcCPU"
+                        + " even if all UseSHA*Intrinsics options were enabled"
+                        + " and %s was enabled as well",
+                    SHAOptionsBase.USE_SHA_OPTION,
+                    SHAOptionsBase.USE_SHA_OPTION),
                 CommandLineOptionTest.prepareBooleanFlag(
                         SHAOptionsBase.USE_SHA_OPTION, true),
                 CommandLineOptionTest.prepareBooleanFlag(
--- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8035968
  * @summary Verify that SHA-1 intrinsic is actually used.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary ../
+ * @library /testlibrary /../../test/lib /compiler/testlibrary ../
  * @build TestSHA intrinsics.Verifier TestSHA1Intrinsics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @test
  * @bug 8035968
  * @summary Verify that SHA-1 multi block intrinsic is actually used.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary ../
+ * @library /testlibrary /../../test/lib /compiler/testlibrary ../
  * @build TestSHA intrinsics.Verifier TestSHA1MultiBlockIntrinsics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @test
  * @bug 8035968
  * @summary Verify that SHA-256 intrinsic is actually used.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary ../
+ * @library /testlibrary /../../test/lib /compiler/testlibrary ../
  * @build TestSHA intrinsics.Verifier TestSHA256Intrinsics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @test
  * @bug 8035968
  * @summary Verify that SHA-256 multi block intrinsic is actually used.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary ../
+ * @library /testlibrary /../../test/lib /compiler/testlibrary ../
  * @build TestSHA intrinsics.Verifier TestSHA256MultiBlockIntrinsics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @test
  * @bug 8035968
  * @summary Verify that SHA-512 intrinsic is actually used.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary ../
+ * @library /testlibrary /../../test/lib /compiler/testlibrary ../
  * @build TestSHA intrinsics.Verifier TestSHA512Intrinsics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @test
  * @bug 8035968
  * @summary Verify that SHA-512 multi block intrinsic is actually used.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary ../
+ * @library /testlibrary /../../test/lib /compiler/testlibrary ../
  * @build TestSHA intrinsics.Verifier TestSHA512MultiBlockIntrinsics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8066103
  * @summary C2's range check smearing allows out of bound array accesses
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox /testlibrary/com/oracle/java/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  * @build TestRangeCheckSmearing
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main ClassFileInstaller com.oracle.java.testlibrary.Platform
--- a/hotspot/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -121,7 +121,9 @@
      */
     protected void runNonX86TestCases() throws Throwable {
         CommandLineOptionTest.verifySameJVMStartup(
-                new String[] { errorMessage }, null, ExitCode.FAIL,
+                new String[] { errorMessage }, null,
+                String.format("Option '%s' should be unknown on non-X86CPUs.%n"
+                + "JVM startup should fail", optionName), "", ExitCode.FAIL,
                 prepareOptionValue(defaultValue));
     }
 
@@ -136,12 +138,18 @@
 
     protected void verifyJVMStartup() throws Throwable {
         String optionValue = prepareOptionValue(defaultValue);
+        String shouldFailMessage = String.format("VM option '%s' is "
+                + "experimental.%nVM startup expected to fail without "
+                + "-XX:+UnlockExperimentalVMOptions option", optionName);
+        String shouldPassMessage = String.format("VM option '%s' is "
+                + "experimental%nVM startup should pass with "
+                + "-XX:+UnlockExperimentalVMOptions option", optionName);
         if (isExperimental) {
             // verify that option is experimental
             CommandLineOptionTest.verifySameJVMStartup(
                     new String[] { experimentalOptionError },
-                    new String[] { errorMessage }, ExitCode.FAIL,
-                    optionValue);
+                    new String[] { errorMessage }, shouldFailMessage,
+                    shouldFailMessage, ExitCode.FAIL, optionValue);
             // verify that it could be passed if experimental options
             // are unlocked
             CommandLineOptionTest.verifySameJVMStartup(null,
@@ -149,13 +157,19 @@
                             experimentalOptionError,
                             errorMessage
                     },
+                    shouldPassMessage,
+                    "JVM should start without any warnings or errors",
                     ExitCode.OK,
                     CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                     optionValue);
         } else {
             // verify that option could be passed
             CommandLineOptionTest.verifySameJVMStartup(null,
-                    new String[]{errorMessage}, ExitCode.OK, optionValue);
+                    new String[]{errorMessage},
+                    String.format("VM startup shuld pass with '%s' option",
+                            optionName),
+                    "JVM should start without any warnings or errors",
+                    ExitCode.OK, optionValue);
         }
     }
 
@@ -164,10 +178,14 @@
         if (isExperimental) {
             CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
                     defaultValue,
+                    String.format("Option '%s' is expected to have '%s' "
+                            + "default value", optionName, defaultValue),
                     CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
         } else {
             CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
-                    defaultValue);
+                    defaultValue,
+                    String.format("Option '%s' is expected to have '%s' "
+                            + "default value", optionName, defaultValue));
         }
         // verify other specified option values
         if (optionValues == null) {
@@ -178,11 +196,15 @@
             if (isExperimental) {
                 CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
                         value,
+                        String.format("Option '%s' is set to have '%s' value",
+                                optionName, value),
                         CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                         prepareOptionValue(value));
             } else {
                 CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
-                        value, prepareOptionValue(value));
+                        value,
+                        String.format("Option '%s' is set to have '%s' value",
+                                optionName, value), prepareOptionValue(value));
             }
         }
     }
--- a/hotspot/test/compiler/rtm/cli/RTMLockingAwareTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/RTMLockingAwareTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -131,10 +131,14 @@
         }
         options.add(prepareOptionValue(value));
 
+        String errorString =  String.format("JVM should start with option '%s'"
+                + "'%nWarnings should be shown: %s", optionName,
+                isWarningExpected);
         CommandLineOptionTest.verifySameJVMStartup(
                 (isWarningExpected ? warnings : null),
                 (isWarningExpected ? null : warnings),
-                ExitCode.OK, options.toArray(new String[options.size()]));
+                errorString, errorString, ExitCode.OK,
+                options.toArray(new String[options.size()]));
     }
 
     private void verifyOptionValues(String value, boolean useRTMLocking,
@@ -149,6 +153,9 @@
         options.add(prepareOptionValue(value));
 
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
-                expectedValue, options.toArray(new String[options.size()]));
+                expectedValue, String.format("Option '%s' should have '%s' "
+                        + "value if '%s' flag set",
+                        optionName, expectedValue, prepareOptionValue(value)),
+                options.toArray(new String[options.size()]));
     }
 }
--- a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java	Mon Jan 05 15:00:30 2015 +0100
@@ -47,27 +47,42 @@
     protected void verifyJVMStartup() throws Throwable {
         if (Platform.isServer()) {
             if (!Platform.isDebugBuild()) {
+                String shouldFailMessage = String.format("VM option '%s' is "
+                        + "diagnostic%nJVM startup should fail without "
+                        + "-XX:\\+UnlockDiagnosticVMOptions flag", optionName);
+                String shouldPassMessage = String.format("VM option '%s' is "
+                        + "diagnostic%nJVM startup should pass with "
+                        + "-XX:\\+UnlockDiagnosticVMOptions in debug build",
+                        optionName);
                 String errorMessage = CommandLineOptionTest.
                         getDiagnosticOptionErrorMessage(optionName);
                 // verify that option is actually diagnostic
                 CommandLineOptionTest.verifySameJVMStartup(
-                        new String[] { errorMessage }, null, ExitCode.FAIL,
+                        new String[] { errorMessage }, null, shouldFailMessage,
+                        shouldFailMessage, ExitCode.FAIL,
                         prepareOptionValue("true"));
 
                 CommandLineOptionTest.verifySameJVMStartup(null,
-                        new String[] { errorMessage }, ExitCode.OK,
+                        new String[] { errorMessage }, shouldPassMessage,
+                        shouldPassMessage + "without any warnings", ExitCode.OK,
                         CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
                         prepareOptionValue("true"));
             } else {
-                CommandLineOptionTest.verifySameJVMStartup(
-                        null, null, ExitCode.OK, prepareOptionValue("true"));
+                String shouldPassMessage = String.format("JVM startup should "
+                                + "pass with '%s' option in debug build",
+                                optionName);
+                CommandLineOptionTest.verifySameJVMStartup(null, null,
+                        shouldPassMessage, shouldPassMessage,
+                        ExitCode.OK, prepareOptionValue("true"));
             }
         } else {
             String errorMessage = CommandLineOptionTest.
                     getUnrecognizedOptionErrorMessage(optionName);
-
+            String shouldFailMessage =  String.format("JVM startup should fail"
+                    + " with '%s' option in not debug build", optionName);
             CommandLineOptionTest.verifySameJVMStartup(
-                    new String[]{errorMessage}, null, ExitCode.FAIL,
+                    new String[]{errorMessage}, null, shouldFailMessage,
+                    shouldFailMessage, ExitCode.FAIL,
                     CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
                     prepareOptionValue("true"));
         }
@@ -79,6 +94,9 @@
             // Verify default value
             CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
                     TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE,
+                    String.format("Option '%s' should have '%s' default value",
+                            optionName,
+                       TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE),
                     CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS);
         }
     }
--- a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify PrintPreciseRTMLockingStatistics on CPUs with
  *          rtm support and on VM with rtm locking support,
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -53,18 +53,28 @@
         // verify default value
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
                 TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE,
+                String.format("Option '%s' should have '%s' default value on"
+                        + " supported CPU", optionName,
+                TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE),
                 CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:+UseRTMLocking");
 
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
                 TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE,
+                String.format("Option '%s' should have '%s' default value on"
+                        + " supported CPU when -XX:-UseRTMLocking flag set",
+                        optionName,
+                       TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE),
                 CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:-UseRTMLocking", prepareOptionValue("true"));
 
         // verify that option could be turned on
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true",
+                String.format("Option '%s' should have 'true' value when set "
+                        + "on supported CPU and -XX:+UseRTMLocking flag set",
+                        optionName),
                 CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS,
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:+UseRTMLocking", prepareOptionValue("true"));
--- a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify PrintPreciseRTMLockingStatistics on CPUs without
  *          rtm support and/or unsupported VM.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify RTMAbortRatio option processing on CPU with rtm
  *          support and on VM with rtm locking support.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestRTMAbortRatioOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify RTMAbortRatio option processing on CPU without rtm
  *          support or on VM that does not support rtm locking.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestRTMAbortRatioOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify RTMTotalCountIncrRate option processing on CPU with
  *          rtm support and on VM with rtm locking support.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestRTMTotalCountIncrRateOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java	Mon Jan 05 15:00:30 2015 +0100
@@ -32,7 +32,7 @@
  * @bug 8031320
  * @summary Verify RTMTotalCountIncrRate option processing on CPU without
  *          rtm support and/or on VM without rtm locking support.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify UseRTMDeopt option processing on CPUs with rtm support
  *          when rtm locking is supported by VM.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestUseRTMDeoptOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -51,26 +51,40 @@
 
     @Override
     public void runTestCases() throws Throwable {
+        String shouldPassMessage = " JVM should startup with option '"
+                + "-XX:+UseRTMDeopt' without any warnings";
         // verify that option could be turned on
         CommandLineOptionTest.verifySameJVMStartup(
-                null, null, ExitCode.OK, "-XX:+UseRTMDeopt");
+                null, null, shouldPassMessage, shouldPassMessage, ExitCode.OK,
+                "-XX:+UseRTMDeopt");
+        shouldPassMessage = " JVM should startup with option '"
+                + "-XX:-UseRTMDeopt' without any warnings";
         // verify that option could be turned off
         CommandLineOptionTest.verifySameJVMStartup(
-                null, null, ExitCode.OK, "-XX:-UseRTMDeopt");
-        // verify default value
-        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
-                TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE);
+                null, null, shouldPassMessage, shouldPassMessage, ExitCode.OK,
+                "-XX:-UseRTMDeopt");
+        String defValMessage = String.format("UseRTMDeopt should have '%s'"
+                                    + "default value",
+                        TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE);
         // verify default value
         CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
                 TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE,
+                defValMessage);
+        // verify default value
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
+                TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE,
+                defValMessage,
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:+UseRTMLocking");
         // verify that option is off when UseRTMLocking is off
-        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", "false",
+        CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
+                "false", "UseRTMDeopt should be off when UseRTMLocking is off",
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:-UseRTMLocking", "-XX:+UseRTMDeopt");
         // verify that option could be turned on
         CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", "true",
+                "UseRTMDeopt should be on when UseRTMLocking is on and "
+                        + "'-XX:+UseRTMDeopt' flag set",
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:+UseRTMLocking", "-XX:+UseRTMDeopt");
     }
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify UseRTMDeopt option processing on CPUs without rtm support
  *          or on VMs without rtm locking support.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestUseRTMDeoptOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -50,7 +50,8 @@
         super(new NotPredicate(new AndPredicate(new SupportedCPU(),
                         new SupportedVM())),
                 "UseRTMDeopt", true, false,
-                TestUseRTMDeoptOptionOnUnsupportedConfig.DEFAULT_VALUE, "true");
+                TestUseRTMDeoptOptionOnUnsupportedConfig.DEFAULT_VALUE,
+                "true");
     }
 
     @Override
@@ -58,11 +59,16 @@
         super.verifyJVMStartup();
         // verify default value
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
-                defaultValue);
+                defaultValue, String.format("'%s' should have '%s' "
+                        + "default value on unsupported configs.",
+                        optionName, DEFAULT_VALUE));
         // verify that until RTMLocking is not used, value
         // will be set to default false.
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
-                defaultValue, "-XX:+UseRTMDeopt");
+                defaultValue, String.format("'%s' should be off on unsupported"
+                        + " configs even if '-XX:+%s' flag set", optionName,
+                        optionName),
+                "-XX:+UseRTMDeopt");
     }
 
     public static void main(String args[]) throws Throwable {
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify UseRTMForStackLocks option processing on CPU with
  *          rtm support when VM supports rtm locking.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestUseRTMForStackLocksOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -58,43 +58,67 @@
         String warningMessage
                 = RTMGenericCommandLineOptionTest.RTM_FOR_STACK_LOCKS_WARNING;
 
+        String shouldFailMessage = " VM option 'UseRTMForStackLocks' is "
+                + "experimental%nJVM startup should fail without "
+                + "-XX:+UnlockExperimentalVMOptions flag";
+
         CommandLineOptionTest.verifySameJVMStartup(
-                new String[] { errorMessage }, null, ExitCode.FAIL,
+                new String[] { errorMessage }, null, shouldFailMessage,
+                shouldFailMessage + "%nError message expected", ExitCode.FAIL,
                 "-XX:+UseRTMForStackLocks");
+        String shouldPassMessage = " VM option 'UseRTMForStackLocks'"
+                + " is experimental%nJVM startup should pass with "
+                + "-XX:+UnlockExperimentalVMOptions flag";
         // verify that we get a warning when trying to use rtm for stack
         // lock, but not using rtm locking.
         CommandLineOptionTest.verifySameJVMStartup(
-                new String[] { warningMessage }, null, ExitCode.OK,
+                new String[] { warningMessage }, null, shouldPassMessage,
+                "There should be warning when trying to use rtm for stack "
+                        + "lock, but not using rtm locking", ExitCode.OK,
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:+UseRTMForStackLocks",
                 "-XX:-UseRTMLocking");
         // verify that we don't get a warning when no using rtm for stack
         // lock and not using rtm locking.
         CommandLineOptionTest.verifySameJVMStartup(null,
-                new String[] { warningMessage }, ExitCode.OK,
+                new String[] { warningMessage }, shouldPassMessage,
+                "There should not be any warning when use both "
+                        + "-XX:-UseRTMForStackLocks and -XX:-UseRTMLocking "
+                        + "flags",
+                ExitCode.OK,
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:-UseRTMForStackLocks",
                 "-XX:-UseRTMLocking");
         // verify that we don't get a warning when using rtm for stack
         // lock and using rtm locking.
         CommandLineOptionTest.verifySameJVMStartup(null,
-                new String[] { warningMessage }, ExitCode.OK,
+                new String[] { warningMessage }, shouldPassMessage,
+                "There should not be any warning when use both "
+                        + "-XX:+UseRTMForStackLocks and -XX:+UseRTMLocking"
+                        + " flags",
+                ExitCode.OK,
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:+UseRTMForStackLocks",
                 "-XX:+UseRTMLocking");
         // verify that default value if false
         CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMForStackLocks",
                 TestUseRTMForStackLocksOptionOnSupportedConfig.DEFAULT_VALUE,
+                "Default value of option 'UseRTMForStackLocks' should be false",
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
         // verify that default value is false even with +UseRTMLocking
         CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMForStackLocks",
                 TestUseRTMForStackLocksOptionOnSupportedConfig.DEFAULT_VALUE,
+                "Default value of option 'UseRTMForStackLocks' should be false",
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:+UseRTMLocking");
         // verify that we can turn the option on
         CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMForStackLocks",
-                "true", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
-                "-XX:+UseRTMLocking", "-XX:+UseRTMForStackLocks");
+                        "true", "Value of option 'UseRTMForStackLocks' should "
+                                + "be able to be set as 'true' when both "
+                                + "-XX:+UseRTMForStackLocks and "
+                                + "-XX:+UseRTMLocking flags used",
+                        CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
+                        "-XX:+UseRTMLocking", "-XX:+UseRTMForStackLocks");
     }
 
     public static void main(String args[]) throws Throwable {
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify UseRTMForStackLocks option processing on CPUs without
  *          rtm support and/or on VMs without rtm locking support.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestUseRTMForStackLocksOptionOnUnsupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -57,33 +57,50 @@
 
     @Override
     protected void runX86SupportedVMTestCases() throws Throwable {
+        String shouldFailMessage = String.format("VM option '%s' is "
+                + "experimental%nJVM startup should fail without "
+                + "-XX:+UnlockExperimentalVMOptions flag", optionName);
+
         // verify that option is experimental
         CommandLineOptionTest.verifySameJVMStartup(
-                new String[]{ experimentalOptionError },
-                null, ExitCode.FAIL, prepareOptionValue("true"));
+                new String[] { experimentalOptionError }, null,
+                shouldFailMessage, shouldFailMessage + "%nError message "
+                        + "should be shown", ExitCode.FAIL,
+                prepareOptionValue("true"));
 
         CommandLineOptionTest.verifySameJVMStartup(
-                new String[]{ experimentalOptionError },
-                null, ExitCode.FAIL, prepareOptionValue("false"));
+                new String[]{ experimentalOptionError }, null,
+                shouldFailMessage, shouldFailMessage + "%nError message "
+                        + "should be shown", ExitCode.FAIL,
+                prepareOptionValue("false"));
 
+        String shouldPassMessage = String.format("VM option '%s' is "
+                + " experimental%nJVM startup should pass with "
+                + "-XX:+UnlockExperimentalVMOptions flag", optionName);
         // verify that if we turn it on, then VM output will contain
         // warning saying that this option could be turned on only
         // when we use rtm locking
         CommandLineOptionTest.verifySameJVMStartup(
                 new String[]{
                     RTMGenericCommandLineOptionTest.RTM_FOR_STACK_LOCKS_WARNING
-                },
-                null, ExitCode.OK,
+                }, null, shouldPassMessage, "There should be warning when try "
+                    + "to use rtm for stack lock, but not using rtm locking",
+                ExitCode.OK,
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 prepareOptionValue("true")
         );
         // verify that options is turned off by default
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
                 TestUseRTMForStackLocksOptionOnUnsupportedConfig.DEFAULT_VALUE,
+                String.format("Default value of option '%s' should be '%s'",
+                        optionName, DEFAULT_VALUE),
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
         // verify that it could not be turned on without rtm locking
         CommandLineOptionTest.verifyOptionValueForSameVM(optionName,
                 TestUseRTMForStackLocksOptionOnUnsupportedConfig.DEFAULT_VALUE,
+                String.format("Value of '%s' shouldn't able to be set to "
+                        + "'true' without setting -XX:+UseRTMLocking flag",
+                        optionName),
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 prepareOptionValue("true"));
     }
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify UseRTMLocking option processing on CPU with rtm support and
  *          on VM with rtm-locking support.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestUseRTMLockingOptionOnSupportedConfig
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -54,12 +54,16 @@
         String unrecongnizedOption
                 =  CommandLineOptionTest.getUnrecognizedOptionErrorMessage(
                 "UseRTMLocking");
+        String shouldPassMessage = "VM option 'UseRTMLocking' is experimental"
+                + "%nJVM startup should pass with "
+                + "-XX:+UnlockExperimentalVMOptions flag";
         // verify that there are no warning or error in VM output
         CommandLineOptionTest.verifySameJVMStartup(null,
                 new String[]{
                         RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR,
                         unrecongnizedOption
-                }, ExitCode.OK,
+                }, shouldPassMessage, "There should not be any warning when use"
+                        + "with -XX:+UnlockExperimentalVMOptions", ExitCode.OK,
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:+UseRTMLocking"
         );
@@ -68,21 +72,28 @@
                 new String[]{
                         RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR,
                         unrecongnizedOption
-                }, ExitCode.OK,
+                }, shouldPassMessage, "There should not be any warning when use"
+                        + "with -XX:+UnlockExperimentalVMOptions", ExitCode.OK,
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:-UseRTMLocking"
         );
         // verify that UseRTMLocking is of by default
         CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
                 TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE,
+                String.format("Default value of option 'UseRTMLocking' should "
+                    + "be '%s'", DEFAULT_VALUE),
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
         // verify that we can change UseRTMLocking value
         CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
                 TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE,
+                String.format("Default value of option 'UseRTMLocking' should "
+                    + "be '%s'", DEFAULT_VALUE),
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:-UseRTMLocking");
         CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
-                "true", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
+                "true", "Value of 'UseRTMLocking' should be set "
+                        + "to 'true' if -XX:+UseRTMLocking flag set",
+                CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:+UseRTMLocking");
     }
 
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify UseRTMLocking option processing on CPU without
  *          rtm support.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestUseRTMLockingOptionOnUnsupportedCPU
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -59,33 +59,44 @@
         String errorMessage = RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR;
 
         if (Platform.isX86() || Platform.isX64()) {
+            String shouldFailMessage = "JVM startup should fail with option "
+                    + "-XX:+UseRTMLocking on unsupported CPU";
             // verify that we get an error when use +UseRTMLocking
             // on unsupported CPU
             CommandLineOptionTest.verifySameJVMStartup(
                     new String[] { errorMessage },
-                    new String[] { unrecongnizedOption },
+                    new String[] { unrecongnizedOption }, shouldFailMessage,
+                    shouldFailMessage + ". Error message should be shown",
                     ExitCode.FAIL, "-XX:+UseRTMLocking");
+
+            String shouldPassMessage = "JVM startup should pass with option "
+                    + "-XX:-UseRTMLocking even on unsupported CPU";
             // verify that we can pass -UseRTMLocking without
             // getting any error messages
-            CommandLineOptionTest.verifySameJVMStartup(
-                    null,
-                    new String[]{
-                            errorMessage,
-                            unrecongnizedOption
-                    }, ExitCode.OK, "-XX:-UseRTMLocking");
+            CommandLineOptionTest.verifySameJVMStartup(null, new String[] {
+                    errorMessage, unrecongnizedOption }, shouldPassMessage,
+                    shouldPassMessage + " without any warnings", ExitCode.OK,
+                    "-XX:-UseRTMLocking");
 
             // verify that UseRTMLocking is false by default
             CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
-                    TestUseRTMLockingOptionOnUnsupportedCPU.DEFAULT_VALUE);
+                    TestUseRTMLockingOptionOnUnsupportedCPU.DEFAULT_VALUE,
+                    String.format("Default value of option 'UseRTMLocking' "
+                        +"should be '%s'", DEFAULT_VALUE));
         } else {
+            String shouldFailMessage = "RTMLocking should be unrecognized"
+                    + " on non-x86 CPUs. JVM startup should fail."
+                    + "Error message should be shown";
             // verify that on non-x86 CPUs RTMLocking could not be used
             CommandLineOptionTest.verifySameJVMStartup(
                     new String[] { unrecongnizedOption },
-                    null, ExitCode.FAIL, "-XX:+UseRTMLocking");
+                    null, shouldFailMessage, shouldFailMessage,
+                    ExitCode.FAIL, "-XX:+UseRTMLocking");
 
             CommandLineOptionTest.verifySameJVMStartup(
                     new String[] { unrecongnizedOption },
-                    null, ExitCode.FAIL, "-XX:-UseRTMLocking");
+                    null, shouldFailMessage, shouldFailMessage,
+                    ExitCode.FAIL, "-XX:-UseRTMLocking");
         }
     }
 
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify UseRTMLocking option processing on CPU with rtm support
  *          in case when VM should not support this option.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestUseRTMLockingOptionOnUnsupportedVM
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -54,17 +54,26 @@
     public void runTestCases() throws Throwable {
         String errorMessage
                 = RTMGenericCommandLineOptionTest.RTM_UNSUPPORTED_VM_ERROR;
+        String shouldFailMessage = "JVM startup should fail with option "
+                + "-XX:+UseRTMLocking even on unsupported VM. Error message"
+                + " should be shown";
+        String shouldPassMessage = "JVM startup should pass with option "
+                + "-XX:-UseRTMLocking even on unsupported VM";
         // verify that we can't use +UseRTMLocking
         CommandLineOptionTest.verifySameJVMStartup(
-                new String[] { errorMessage }, null, ExitCode.FAIL,
-                "-XX:+UseRTMLocking");
+                new String[] { errorMessage }, null, shouldFailMessage,
+                shouldFailMessage, ExitCode.FAIL,
+                 "-XX:+UseRTMLocking");
         // verify that we can turn it off
         CommandLineOptionTest.verifySameJVMStartup(null,
-                new String[] { errorMessage }, ExitCode.OK,
+                new String[] { errorMessage }, shouldPassMessage,
+                shouldPassMessage + " without any warnings", ExitCode.OK,
                 "-XX:-UseRTMLocking");
         // verify that it is off by default
         CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
-                TestUseRTMLockingOptionOnUnsupportedVM.DEFAULT_VALUE);
+                TestUseRTMLockingOptionOnUnsupportedVM.DEFAULT_VALUE,
+                String.format("Default value of option 'UseRTMLocking' should"
+                    + " be '%s'", DEFAULT_VALUE));
     }
 
     public static void main(String args[]) throws Throwable {
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify processing of UseRTMLocking and UseBiasedLocking
  *          options combination on CPU and VM with rtm support.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestUseRTMLockingOptionWithBiasedLocking
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -51,25 +51,44 @@
     public void runTestCases() throws Throwable {
         String warningMessage
                 = RTMGenericCommandLineOptionTest.RTM_BIASED_LOCKING_WARNING;
+        String shouldPassMessage = "JVM startup should pass with both "
+                + "-XX:+UseRTMLocking and "
+                + "-XX:-UseBiasedLocking flags set without any warnings";
         // verify that we will not get a warning
         CommandLineOptionTest.verifySameJVMStartup(null,
-                new String[] { warningMessage }, ExitCode.OK,
+                new String[] { warningMessage }, shouldPassMessage,
+                shouldPassMessage, ExitCode.OK,
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:+UseRTMLocking", "-XX:-UseBiasedLocking");
+
         // verify that we will get a warning
         CommandLineOptionTest.verifySameJVMStartup(
-                new String[] { warningMessage }, null, ExitCode.OK,
+                new String[] { warningMessage }, null,
+                "JVM startup should pass when both -XX:+UseRTMLocking and "
+                        + "-XX:+UseBiasedLocking flags set",
+                "Flags -XX:+UseRTMLocking"
+                        + " and -XX:+UseBiasedLocking conflicts. "
+                        + "Warning should be shown.", ExitCode.OK,
                 CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:+UseRTMLocking", "-XX:+UseBiasedLocking");
         // verify that UseBiasedLocking is false when we use rtm locking
         CommandLineOptionTest.verifyOptionValueForSameVM("UseBiasedLocking",
-                "false", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
+                "false",
+                "Value of option 'UseBiasedLocking' should be false if"
+                        + "-XX:+UseRTMLocking flag set.",
+                CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
                 "-XX:+UseRTMLocking");
         // verify that we can't turn on biased locking when
         // using rtm locking
-        CommandLineOptionTest.verifyOptionValueForSameVM("UseBiasedLocking",
-                "false", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
-                "-XX:+UseRTMLocking", "-XX:+UseBiasedLocking");
+        CommandLineOptionTest
+                .verifyOptionValueForSameVM(
+                        "UseBiasedLocking",
+                        "false",
+                        "Value of option 'UseBiasedLocking' should be false if"
+                                + "both -XX:+UseRTMLocking and "
+                                + "-XX:+UseBiasedLocking flags set.",
+                        CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
+                        "-XX:+UseRTMLocking", "-XX:+UseBiasedLocking");
     }
 
     public static void main(String args[]) throws Throwable {
--- a/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify that RTMAbortRatio affects amount of aborts before
  *          deoptimization.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestRTMAbortRatio
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify that RTMAbortThreshold option affects
  *          amount of aborts after which abort ratio is calculated.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestRTMAbortThreshold
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java	Mon Jan 05 15:00:30 2015 +0100
@@ -29,7 +29,7 @@
  *          caused by reason other then rtm_state_change will reset
  *          method's RTM state. And if we don't use RTMDeopt, then
  *          RTM state remain the same after such deoptimization.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestRTMAfterNonRTMDeopt
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify that on high abort ratio method will be recompiled
  *          without rtm locking.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestRTMDeoptOnHighAbortRatio
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @test
  * @bug 8031320
  * @summary Verify that on low abort ratio method will be recompiled.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestRTMDeoptOnLowAbortRatio
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify that RTMLockingCalculationDelay affect when
  *          abort ratio calculation is started.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestRTMLockingCalculationDelay
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify that RTMLockingThreshold affects rtm state transition
  *          ProfileRTM => UseRTM.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestRTMLockingThreshold
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @test
  * @bug 8031320
  * @summary Verify that RTMRetryCount affects actual amount of retries.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestRTMRetryCount
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify that RTMSpinLoopCount affects time spent
  *          between locking attempts.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestRTMSpinLoopCount
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify that RTMTotalCountIncrRate option affects
  *          RTM locking statistics.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestRTMTotalCountIncrRate
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify that rtm locking is used for stack locks before
  *          inflation and after it used for inflated locks.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestUseRTMAfterLockInflation
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify that UseRTMDeopt affects uncommon trap installation in
  *          copmpiled methods with synchronized block.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestUseRTMDeopt
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @test
  * @bug 8031320
  * @summary Verify that rtm locking is used for inflated locks.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestUseRTMForInflatedLocks
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @test
  * @bug 8031320
  * @summary Verify that rtm locking is used for stack locks.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestUseRTMForStackLocks
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify that UseRTMXendForLockBusy option affects
  *          method behaviour if lock is busy.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestUseRTMXendForLockBusy
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8031320
  * @summary Verify that NoRTMLockEliding option could be applied to
  *          specified method and that such method will not use rtm.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestNoRTMLockElidingOption
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java	Mon Jan 05 15:00:30 2015 +0100
@@ -28,7 +28,7 @@
  * @summary Verify that UseRTMLockEliding option could be applied to
  *          specified method and that such method will not be deoptimized
  *          on high abort ratio.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestUseRTMLockElidingOption
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java	Mon Jan 05 15:00:30 2015 +0100
@@ -29,7 +29,7 @@
  *          on overall aborts and locks count and count of aborts of
  *          different types. Test also verify that VM output does not
  *          contain rtm locking statistics when it should not.
- * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary
+ * @library /testlibrary /../../test/lib /compiler/testlibrary
  * @build TestPrintPreciseRTMLockingStatistics
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/runtime/8010927/Test8010927.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/runtime/8010927/Test8010927.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8010927
  * @summary Kitchensink crashed with SIGSEGV, Problematic frame: v ~StubRoutines::checkcast_arraycopy
- * @library /testlibrary/whitebox /testlibrary
+ * @library /../../test/lib /testlibrary
  * @build Test8010927
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/stable/TestStableBoolean.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/stable/TestStableBoolean.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
 /*
  * @test TestStableBoolean
  * @summary tests on stable fields and arrays
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestStableBoolean StableConfiguration sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main ClassFileInstaller
--- a/hotspot/test/compiler/stable/TestStableByte.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/stable/TestStableByte.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
 /*
  * @test TestStableByte
  * @summary tests on stable fields and arrays
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestStableByte StableConfiguration sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main ClassFileInstaller
--- a/hotspot/test/compiler/stable/TestStableChar.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/stable/TestStableChar.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
 /*
  * @test TestStableChar
  * @summary tests on stable fields and arrays
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestStableChar StableConfiguration sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main ClassFileInstaller
--- a/hotspot/test/compiler/stable/TestStableDouble.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/stable/TestStableDouble.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
 /*
  * @test TestStableDouble
  * @summary tests on stable fields and arrays
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestStableDouble StableConfiguration sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main ClassFileInstaller
--- a/hotspot/test/compiler/stable/TestStableFloat.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/stable/TestStableFloat.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
 /*
  * @test TestStableFloat
  * @summary tests on stable fields and arrays
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestStableFloat StableConfiguration sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main ClassFileInstaller
--- a/hotspot/test/compiler/stable/TestStableInt.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/stable/TestStableInt.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
 /*
  * @test TestStableInt
  * @summary tests on stable fields and arrays
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestStableInt StableConfiguration sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main ClassFileInstaller
--- a/hotspot/test/compiler/stable/TestStableLong.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/stable/TestStableLong.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
 /*
  * @test TestStableLong
  * @summary tests on stable fields and arrays
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestStableLong StableConfiguration sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main ClassFileInstaller
--- a/hotspot/test/compiler/stable/TestStableObject.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/stable/TestStableObject.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
 /*
  * @test TestStableObject
  * @summary tests on stable fields and arrays
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestStableObject StableConfiguration sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main ClassFileInstaller
--- a/hotspot/test/compiler/stable/TestStableShort.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/stable/TestStableShort.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
 /*
  * @test TestStableShort
  * @summary tests on stable fields and arrays
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestStableShort StableConfiguration sun.hotspot.WhiteBox
  * @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main ClassFileInstaller
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/tiered/ConstantGettersTransitionsTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.reflect.Executable;
+import java.util.concurrent.Callable;
+
+/**
+ * @test ConstantGettersTransitionsTest
+ * @library /testlibrary /../../test/lib /compiler/whitebox
+ * @build TransitionsTestExecutor ConstantGettersTransitionsTest
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI -XX:+TieredCompilation
+ *                   -XX:CompileCommand=compileonly,ConstantGettersTestCase$TrivialMethods::*
+ *                   TransitionsTestExecutor ConstantGettersTransitionsTest
+ * @summary Test the correctness of compilation level transitions for constant getters methods
+ */
+public class ConstantGettersTransitionsTest extends LevelTransitionTest {
+    public static void main(String[] args) {
+        assert (!CompilerWhiteBoxTest.skipOnTieredCompilation(false));
+
+        // run test cases
+        for (TestCase testCase : ConstantGettersTestCase.values()) {
+            new ConstantGettersTransitionsTest(testCase).runTest();
+        }
+    }
+
+    @Override
+    protected boolean isTrivial() {
+        return true;
+    }
+
+    private ConstantGettersTransitionsTest(TestCase testCase) {
+        super(testCase);
+    }
+}
+
+enum ConstantGettersTestCase implements CompilerWhiteBoxTest.TestCase {
+    ICONST_M1,
+    ICONST_0,
+    ICONST_1,
+    ICONST_2,
+    ICONST_3,
+    ICONST_4,
+    ICONST_5,
+    LCONST_0,
+    LCONST_1,
+    FCONST_0,
+    FCONST_1,
+    FCONST_2,
+    DCONST_0,
+    DCONST_1,
+    DCONST_W,
+    BYTE,
+    SHORT,
+    CHAR;
+
+    private final Executable executable;
+    private final Callable<Integer> callable;
+
+    @Override
+    public Executable getExecutable() {
+        return executable;
+    }
+
+    @Override
+    public Callable<Integer> getCallable() {
+        return callable;
+    }
+
+    @Override
+    public boolean isOsr() {
+        return false;
+    }
+
+    private ConstantGettersTestCase() {
+        String name = "make" + this.name();
+        this.executable = LevelTransitionTest.Helper.getMethod(TrivialMethods.class, name);
+        this.callable = LevelTransitionTest.Helper.getCallable(new TrivialMethods(), name);
+    }
+
+    /**
+     * Contains methods that load constants with certain types of bytecodes
+     * See JVMS 2.11.2. Load and Store Instructions
+     * Note that it doesn't have a method for ldc_w instruction
+     */
+    private static class TrivialMethods {
+        public static int makeICONST_M1() {
+            return -1;
+        }
+
+        public static int makeICONST_0() {
+            return 0;
+        }
+
+        public static int makeICONST_1() {
+            return 1;
+        }
+
+        public static int makeICONST_2() {
+            return 2;
+        }
+
+        public static int makeICONST_3() {
+            return 3;
+        }
+
+        public static int makeICONST_4() {
+            return 4;
+        }
+
+        public static int makeICONST_5() {
+            return 5;
+        }
+
+        public static long makeLCONST_0() {
+            return 0L;
+        }
+
+        public static long makeLCONST_1() {
+            return 1L;
+        }
+
+        public static float makeFCONST_0() {
+            return 0F;
+        }
+
+        public static float makeFCONST_1() {
+            return 1F;
+        }
+
+        public static float makeFCONST_2() {
+            return 2F;
+        }
+
+        public static double makeDCONST_0() {
+            return 0D;
+        }
+
+        public static double makeDCONST_1() {
+            return 1D;
+        }
+
+        public static double makeDCONST_W() {
+            // ldc2_w
+            return Double.MAX_VALUE;
+        }
+
+        public static Object makeOBJECT() {
+            // aconst_null
+            return null;
+        }
+
+        public static byte makeBYTE() {
+            // bipush
+            return (byte) 0x7F;
+        }
+
+        public static short makeSHORT() {
+            // sipush
+            return (short) 0x7FFF;
+        }
+
+        public static char makeCHAR() {
+            // ldc
+            return (char) 0xFFFF;
+        }
+
+        public static boolean makeBOOLEAN() {
+            return true;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/tiered/LevelTransitionTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,247 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.reflect.Executable;
+import java.lang.reflect.Method;
+import java.util.Objects;
+import java.util.concurrent.Callable;
+
+/**
+ * @test LevelTransitionTest
+ * @library /testlibrary /../../test/lib /compiler/whitebox
+ * @build TransitionsTestExecutor LevelTransitionTest
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI -XX:+TieredCompilation
+ *                   -XX:CompileCommand=compileonly,SimpleTestCase$Helper::*
+ *                   -XX:CompileCommand=compileonly,ExtendedTestCase$CompileMethodHolder::*
+ *                   TransitionsTestExecutor LevelTransitionTest
+ * @summary Test the correctness of compilation level transitions for different methods
+ */
+public class LevelTransitionTest extends TieredLevelsTest {
+    /** Shows if method was profiled by being executed on levels 2 or 3 */
+    protected boolean isMethodProfiled;
+    private int transitionCount;
+
+    public static void main(String[] args) throws Throwable {
+        assert (!CompilerWhiteBoxTest.skipOnTieredCompilation(false));
+
+        CompilerWhiteBoxTest.main(LevelTransitionTest::new, args);
+        // run extended test cases
+        for (TestCase testCase : ExtendedTestCase.values()) {
+            new LevelTransitionTest(testCase).runTest();
+        }
+    }
+
+    protected LevelTransitionTest(TestCase testCase) {
+        super(testCase);
+        isMethodProfiled = testCase.isOsr(); // OSR methods were already profiled by warmup
+        transitionCount = 0;
+    }
+
+    @Override
+    protected void test() throws Exception {
+        checkTransitions();
+        deoptimize();
+        printInfo();
+        if (testCase.isOsr()) {
+            // deoptimization makes the following transitions be unstable
+            // methods go to level 3 before 4 because of uncommon_trap and reprofile
+            return;
+        }
+        checkTransitions();
+    }
+
+    /**
+     * Makes and verifies transitions between compilation levels
+     */
+    protected void checkTransitions() {
+        checkNotCompiled();
+        boolean finish = false;
+        while (!finish) {
+            System.out.printf("Level transition #%d%n", ++transitionCount);
+            int newLevel;
+            int current = getCompLevel();
+            int expected = getNextLevel(current);
+            if (current == expected) {
+                // if we are on expected level, just execute it more
+                // to ensure that the level won't change
+                System.out.printf("Method %s is already on expected level %d%n", method, expected);
+                compile();
+                newLevel = getCompLevel();
+                finish = true;
+            } else {
+                newLevel = changeCompLevel();
+                finish = false;
+            }
+            System.out.printf("Method %s is compiled on level %d. Expected level is %d%n", method, newLevel, expected);
+            checkLevel(expected, newLevel);
+            printInfo();
+        };
+    }
+
+    /**
+     * Gets next expected level for the test case on each transition.
+     *
+     * @param currentLevel a level the test case is compiled on
+     * @return expected compilation level
+     */
+    protected int getNextLevel(int currentLevel) {
+        int nextLevel = currentLevel;
+        switch (currentLevel) {
+            case CompilerWhiteBoxTest.COMP_LEVEL_NONE:
+                nextLevel = isMethodProfiled ? CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION
+                        : CompilerWhiteBoxTest.COMP_LEVEL_FULL_PROFILE;
+                break;
+            case CompilerWhiteBoxTest.COMP_LEVEL_LIMITED_PROFILE:
+            case CompilerWhiteBoxTest.COMP_LEVEL_FULL_PROFILE:
+                nextLevel = CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION;
+                isMethodProfiled = true;
+                break;
+        }
+        nextLevel = isTrivial() ? CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE : nextLevel;
+        return Math.min(nextLevel, CompilerWhiteBoxTest.TIERED_STOP_AT_LEVEL);
+    }
+
+    /**
+     * Determines if tested method should be handled as trivial
+     *
+     * @return {@code true} for trivial methods, {@code false} otherwise
+     */
+    protected boolean isTrivial() {
+        return testCase == ExtendedTestCase.ACCESSOR_TEST
+                || testCase == SimpleTestCase.METHOD_TEST
+                || testCase == SimpleTestCase.STATIC_TEST
+                || (testCase == ExtendedTestCase.TRIVIAL_CODE_TEST && isMethodProfiled);
+    }
+
+    /**
+     * Invokes {@linkplain #method} until its compilation level is changed.
+     * Note that if the level won't change, it will be an endless loop
+     *
+     * @return compilation level the {@linkplain #method} was compiled on
+     */
+    protected int changeCompLevel() {
+        int currentLevel = getCompLevel();
+        int newLevel = currentLevel;
+        int result = 0;
+        while (currentLevel == newLevel) {
+            result = compile(1);
+            if (WHITE_BOX.isMethodCompiled(method, testCase.isOsr())) {
+                newLevel = getCompLevel();
+            }
+        }
+        return newLevel;
+    }
+
+    protected static class Helper {
+        /**
+         * Gets method from a specified class using its name
+         *
+         * @param aClass type method belongs to
+         * @param name   the name of the method
+         * @return {@link Method} that represents corresponding class method
+         */
+        public static Method getMethod(Class<?> aClass, String name) {
+            Method method;
+            try {
+                method = aClass.getDeclaredMethod(name);
+            } catch (NoSuchMethodException e) {
+                throw new Error("TESTBUG: Unable to get method " + name, e);
+            }
+            return method;
+        }
+
+        /**
+         * Gets {@link Callable} that invokes given method from the given object
+         *
+         * @param object the object the specified method is invoked from
+         * @param name   the name of the method
+         */
+        public static Callable<Integer> getCallable(Object object, String name) {
+            Method method = getMethod(object.getClass(), name);
+            return () -> {
+                try {
+                    return Objects.hashCode(method.invoke(object));
+                } catch (ReflectiveOperationException e) {
+                    throw new Error("TESTBUG: Invocation failure", e);
+                }
+            };
+        }
+    }
+}
+
+enum ExtendedTestCase implements CompilerWhiteBoxTest.TestCase {
+    ACCESSOR_TEST("accessor"),
+    NONTRIVIAL_METHOD_TEST("nonTrivialMethod"),
+    TRIVIAL_CODE_TEST("trivialCode");
+
+    private final Executable executable;
+    private final Callable<Integer> callable;
+
+    @Override
+    public Executable getExecutable() {
+        return executable;
+    }
+
+    @Override
+    public Callable<Integer> getCallable() {
+        return callable;
+    }
+
+    @Override
+    public boolean isOsr() {
+        return false;
+    }
+
+    private ExtendedTestCase(String methodName) {
+        this.executable = LevelTransitionTest.Helper.getMethod(CompileMethodHolder.class, methodName);
+        this.callable = LevelTransitionTest.Helper.getCallable(new CompileMethodHolder(), methodName);
+    }
+
+    private static class CompileMethodHolder {
+        private final int iter = 10;
+        private int field = 42;
+
+        /** Non-trivial method for threshold policy: contains loops */
+        public int nonTrivialMethod() {
+            int acc = 0;
+            for (int i = 0; i < iter; i++) {
+                acc += i;
+            }
+            return acc;
+        }
+
+        /** Field accessor method */
+        public int accessor() {
+            return field;
+        }
+
+        /** Method considered as trivial by amount of code */
+        public int trivialCode() {
+            int var = 0xBAAD_C0DE;
+            var *= field;
+            return var;
+        }
+    }
+}
--- a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
 
 /**
  * @test NonTieredLevelsTest
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  * @build NonTieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -55,9 +55,7 @@
 
     }
     public static void main(String[] args) throws Exception {
-        if (TIERED_COMPILATION) {
-            System.err.println("Test isn't applicable w/ enabled "
-                    + "TieredCompilation. Skip test.");
+        if (CompilerWhiteBoxTest.skipOnTieredCompilation(true)) {
             return;
         }
         CompilerWhiteBoxTest.main(NonTieredLevelsTest::new, args);
--- a/hotspot/test/compiler/tiered/TieredLevelsTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/tiered/TieredLevelsTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -23,7 +23,7 @@
 
 /**
  * @test TieredLevelsTest
- * @library /testlibrary /testlibrary/whitebox /compiler/whitebox
+ * @library /testlibrary /../../test/lib /compiler/whitebox
  * @build TieredLevelsTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -35,16 +35,14 @@
  * @author igor.ignatyev@oracle.com
  */
 public class TieredLevelsTest extends CompLevelsTest {
-    public static void main(String[] args) throws Exception {
-        if (!TIERED_COMPILATION) {
-            System.err.println("Test isn't applicable w/ disabled "
-                    + "TieredCompilation. Skip test.");
+    public static void main(String[] args) throws Exception, Throwable {
+        if (CompilerWhiteBoxTest.skipOnTieredCompilation(false)) {
             return;
         }
         CompilerWhiteBoxTest.main(TieredLevelsTest::new, args);
     }
 
-    private TieredLevelsTest(TestCase testCase) {
+    protected TieredLevelsTest(TestCase testCase) {
         super(testCase);
         // to prevent inlining of #method
         WHITE_BOX.testSetDontInlineMethod(method, true);
@@ -77,14 +75,18 @@
         }
     }
 
-
     @Override
     protected void checkLevel(int expected, int actual) {
         if (expected == COMP_LEVEL_FULL_PROFILE
                 && actual == COMP_LEVEL_LIMITED_PROFILE) {
             // for simple method full_profile may be replaced by limited_profile
+            if (IS_VERBOSE) {
+                System.out.printf("Level check: full profiling was replaced "
+                        + "by limited profiling. Expected: %d, actual:%d",
+                        expected, actual);
+            }
             return;
         }
         super.checkLevel(expected, actual);
-   }
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/tiered/TransitionsTestExecutor.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.ProcessTools;
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.RuntimeMXBean;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Executes given test in a separate VM with enabled Tiered Compilation for
+ * CompilationPolicyChoice 2 and 3
+ */
+public class TransitionsTestExecutor {
+    public static void main(String[] args) throws Throwable {
+        if (CompilerWhiteBoxTest.skipOnTieredCompilation(false)) {
+            return;
+        }
+        if (args.length != 1) {
+            throw new Error("TESTBUG: Test name should be specified");
+        }
+        executeTestFor(2, args[0]);
+        executeTestFor(3, args[0]);
+    }
+
+    private static void executeTestFor(int compilationPolicy, String testName) throws Throwable {
+        String policy = "-XX:CompilationPolicyChoice=" + compilationPolicy;
+
+        // Get runtime arguments including VM options given to this executor
+        RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
+        List<String> vmArgs = runtime.getInputArguments();
+
+        // Construct execution command with compilation policy choice and test name
+        List<String> args = new ArrayList<>(vmArgs);
+        Collections.addAll(args, policy, testName);
+
+        OutputAnalyzer out = ProcessTools.executeTestJvm(args.toArray(new String[args.size()]));
+        int exitCode = out.getExitValue();
+        if (exitCode != 0) {
+            throw new Error("Test execution failed with exit code " + exitCode);
+        }
+    }
+}
--- a/hotspot/test/compiler/types/correctness/CorrectnessTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/types/correctness/CorrectnessTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test CorrectnessTest
  * @bug 8038418
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @ignore 8066173
  * @compile execution/TypeConflict.java execution/TypeProfile.java
  *          execution/MethodHandleDelegate.java
--- a/hotspot/test/compiler/types/correctness/OffTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/types/correctness/OffTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test CorrectnessTest
  * @bug 8038418
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @ignore 8066173
  * @compile execution/TypeConflict.java execution/TypeProfile.java
  *          execution/MethodHandleDelegate.java
--- a/hotspot/test/compiler/uncommontrap/8009761/Test8009761.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/uncommontrap/8009761/Test8009761.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
 /*
  * @test
  * @bug 8009761
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @summary Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates
  * @build Test8009761
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -34,7 +34,7 @@
 /*
  * @test AllocationCodeBlobTest
  * @bug 8059624 8064669
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build AllocationCodeBlobTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
 /*
  * @test ClearMethodStateTest
  * @bug 8006683 8007288 8022832
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build ClearMethodStateTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -38,19 +38,19 @@
  */
 public abstract class CompilerWhiteBoxTest {
     /** {@code CompLevel::CompLevel_none} -- Interpreter */
-    protected static int COMP_LEVEL_NONE = 0;
+    protected static final int COMP_LEVEL_NONE = 0;
     /** {@code CompLevel::CompLevel_any}, {@code CompLevel::CompLevel_all} */
-    protected static int COMP_LEVEL_ANY = -1;
+    protected static final int COMP_LEVEL_ANY = -1;
     /** {@code CompLevel::CompLevel_simple} -- C1 */
-    protected static int COMP_LEVEL_SIMPLE = 1;
+    protected static final int COMP_LEVEL_SIMPLE = 1;
     /** {@code CompLevel::CompLevel_limited_profile} -- C1, invocation &amp; backedge counters */
-    protected static int COMP_LEVEL_LIMITED_PROFILE = 2;
+    protected static final int COMP_LEVEL_LIMITED_PROFILE = 2;
     /** {@code CompLevel::CompLevel_full_profile} -- C1, invocation &amp; backedge counters + mdo */
-    protected static int COMP_LEVEL_FULL_PROFILE = 3;
+    protected static final int COMP_LEVEL_FULL_PROFILE = 3;
     /** {@code CompLevel::CompLevel_full_optimization} -- C2 or Shark */
-    protected static int COMP_LEVEL_FULL_OPTIMIZATION = 4;
+    protected static final int COMP_LEVEL_FULL_OPTIMIZATION = 4;
     /** Maximal value for CompLevel */
-    protected static int COMP_LEVEL_MAX = COMP_LEVEL_FULL_OPTIMIZATION;
+    protected static final int COMP_LEVEL_MAX = COMP_LEVEL_FULL_OPTIMIZATION;
 
     /** Instance of WhiteBox */
     protected static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
@@ -336,14 +336,22 @@
         System.out.printf("%n%s:%n", method);
         System.out.printf("\tcompilable:\t%b%n",
                 WHITE_BOX.isMethodCompilable(method, COMP_LEVEL_ANY, false));
-        System.out.printf("\tcompiled:\t%b%n",
-                WHITE_BOX.isMethodCompiled(method, false));
+        boolean isCompiled = WHITE_BOX.isMethodCompiled(method, false);
+        System.out.printf("\tcompiled:\t%b%n", isCompiled);
+        if (isCompiled) {
+            System.out.printf("\tcompile_id:\t%d%n",
+                    NMethod.get(method, false).compile_id);
+        }
         System.out.printf("\tcomp_level:\t%d%n",
                 WHITE_BOX.getMethodCompilationLevel(method, false));
         System.out.printf("\tosr_compilable:\t%b%n",
                 WHITE_BOX.isMethodCompilable(method, COMP_LEVEL_ANY, true));
-        System.out.printf("\tosr_compiled:\t%b%n",
-                WHITE_BOX.isMethodCompiled(method, true));
+        isCompiled = WHITE_BOX.isMethodCompiled(method, true);
+        System.out.printf("\tosr_compiled:\t%b%n", isCompiled);
+        if (isCompiled) {
+            System.out.printf("\tosr_compile_id:\t%d%n",
+                    NMethod.get(method, true).compile_id);
+        }
         System.out.printf("\tosr_comp_level:\t%d%n",
                 WHITE_BOX.getMethodCompilationLevel(method, true));
         System.out.printf("\tin_queue:\t%b%n",
@@ -426,6 +434,22 @@
         }
         return result;
     }
+
+    /**
+     * Skip the test for the specified value of Tiered Compilation
+     * @param value of TieredCompilation the test should not run with
+     * @return {@code true} if the test should be skipped,
+     *         {@code false} otherwise
+     */
+    protected static boolean skipOnTieredCompilation(boolean value) {
+        if (value == CompilerWhiteBoxTest.TIERED_COMPILATION) {
+            System.err.println("Test isn't applicable w/ "
+                    + (value ? "enabled" : "disabled")
+                    + "TieredCompilation. Skip test.");
+            return true;
+        }
+        return false;
+    }
 }
 
 enum SimpleTestCase implements CompilerWhiteBoxTest.TestCase {
--- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test DeoptimizeAllTest
  * @bug 8006683 8007288 8022832
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build DeoptimizeAllTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test DeoptimizeFramesTest
+ * @bug 8028595
+ * @library /testlibrary /../../test/lib
+ * @build DeoptimizeFramesTest
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI -Xmixed
+ *                   -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method
+ *                   -XX:-DeoptimizeRandom DeoptimizeFramesTest true
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ *                   -XX:+WhiteBoxAPI -Xmixed
+ *                   -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method
+ *                   -XX:-DeoptimizeRandom DeoptimizeFramesTest false
+ * @summary testing of WB::deoptimizeFrames()
+ */
+import java.lang.reflect.Executable;
+import java.util.concurrent.Callable;
+import java.util.concurrent.Phaser;
+
+import sun.hotspot.code.NMethod;
+import com.oracle.java.testlibrary.Asserts;
+import com.oracle.java.testlibrary.InfiniteLoop;
+
+public class DeoptimizeFramesTest extends CompilerWhiteBoxTest {
+    private final boolean makeNotEntrant;
+    private final Phaser phaser;
+
+    private DeoptimizeFramesTest(boolean makeNotEntrant, Phaser phaser) {
+        super(new TestCaseImpl(phaser));
+        // to prevent inlining of #method
+        WHITE_BOX.testSetDontInlineMethod(method, true);
+        this.makeNotEntrant = makeNotEntrant;
+        this.phaser = phaser;
+        System.out.printf("DeoptimizeFramesTest(makeNotEntrant = %b)%n",
+                makeNotEntrant);
+    }
+
+    public static void main(String[] args) throws Exception {
+        Asserts.assertEQ(args.length, 1,
+                "[TESTBUG] args should contain 1 element");
+        new DeoptimizeFramesTest(Boolean.valueOf(args[0]), new Phaser()).runTest();
+    }
+
+    @Override
+    protected void test() throws Exception {
+        compile();
+        checkCompiled();
+        NMethod nm = NMethod.get(method, testCase.isOsr());
+
+        WHITE_BOX.deoptimizeFrames(makeNotEntrant);
+        // #method should still be compiled, since it didn't have frames on stack
+        checkCompiled();
+        NMethod nm2 = NMethod.get(method, testCase.isOsr());
+        Asserts.assertEQ(nm.compile_id, nm2.compile_id,
+                "should be the same nmethod");
+
+        phaser.register();
+        Thread t = new Thread(() -> compile(1));
+        t.start();
+        // pass 1st phase, #method is on stack
+        int p = phaser.arriveAndAwaitAdvance();
+        WHITE_BOX.deoptimizeFrames(makeNotEntrant);
+        // pass 2nd phase, #method can exit
+        phaser.awaitAdvance(phaser.arriveAndDeregister());
+
+        try {
+            t.join();
+        } catch (InterruptedException e) {
+            throw new Error("method '" + method + "' is still executing", e);
+        }
+
+        // invoke one more time to recompile not entrant if any
+        compile(1);
+
+        nm2 = NMethod.get(method, testCase.isOsr());
+        if (makeNotEntrant) {
+            if (nm2 != null) {
+                Asserts.assertNE(nm.compile_id, nm2.compile_id,
+                        String.format("compilation %d can't be available", nm.compile_id));
+            }
+        } else {
+            Asserts.assertEQ(nm.compile_id, nm2.compile_id, "should be the same nmethod");
+        }
+    }
+
+
+    private static class TestCaseImpl implements TestCase {
+        private static final Executable EXECUTABLE;
+        static {
+            try {
+                EXECUTABLE = TestCaseImpl.class.getDeclaredMethod("method");
+            } catch (NoSuchMethodException e) {
+                throw new Error("[TESTBUG] method not found", e);
+            }
+        }
+
+        private final Phaser phaser;
+
+        public TestCaseImpl(Phaser phaser) {
+            this.phaser = phaser;
+            phaser.register();
+        }
+
+        @Override
+        public String name() {
+            return "2phases";
+        }
+
+        @Override
+        public Executable getExecutable() {
+            return EXECUTABLE;
+        }
+
+        @Override
+        public Callable<Integer> getCallable() {
+            return () -> {
+                return method();
+            };
+        }
+
+        @Override
+        public boolean isOsr() {
+            return false;
+        }
+
+        private int method() {
+            phaser.arriveAndAwaitAdvance();
+            phaser.arriveAndAwaitAdvance();
+            return 0;
+        }
+    }
+}
--- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test DeoptimizeMethodTest
  * @bug 8006683 8007288 8022832
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build DeoptimizeMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -28,7 +28,7 @@
 /*
  * @test DeoptimizeMultipleOSRTest
  * @bug 8061817
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build DeoptimizeMultipleOSRTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test EnqueueMethodForCompilationTest
  * @bug 8006683 8007288 8022832
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build EnqueueMethodForCompilationTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -34,7 +34,7 @@
 /*
  * @test
  * @bug 8059624 8064669
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build ForceNMethodSweepTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/GetCodeHeapEntriesTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/GetCodeHeapEntriesTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -33,7 +33,7 @@
 /*
  * @test GetCodeHeapEntriesTest
  * @bug 8059624
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build GetCodeHeapEntriesTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/GetNMethodTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/GetNMethodTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -29,7 +29,7 @@
 /*
  * @test GetNMethodTest
  * @bug 8038240
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build GetNMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test IsMethodCompilableTest
  * @bug 8007270 8006683 8007288 8022832
- * @library /testlibrary /testlibrary/whitebox /testlibrary/com/oracle/java/testlibrary
+ * @library /testlibrary /../../test/lib /testlibrary/com/oracle/java/testlibrary
  * @build IsMethodCompilableTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/LockCompilationTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/LockCompilationTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test LockCompilationTest
  * @bug 8059624
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build LockCompilationTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test MakeMethodNotCompilableTest
  * @bug 8012322 8006683 8007288 8022832
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build MakeMethodNotCompilableTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test SetDontInlineMethodTest
  * @bug 8006683 8007288 8022832
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build SetDontInlineMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test SetForceInlineMethodTest
  * @bug 8006683 8007288 8022832
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build SetForceInlineMethodTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/arguments/TestCMSHeapSizeFlags.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/arguments/TestCMSHeapSizeFlags.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @key gc
  * @bug 8006088
  * @summary Tests argument processing for initial and maximum heap size for the CMS collector
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestCMSHeapSizeFlags TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/arguments/TestG1HeapSizeFlags.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/arguments/TestG1HeapSizeFlags.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @key gc
  * @bug 8006088
  * @summary Tests argument processing for initial and maximum heap size for the G1 collector
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestG1HeapSizeFlags TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/arguments/TestMinInitialErgonomics.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/arguments/TestMinInitialErgonomics.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @key gc
  * @bug 8006088
  * @summary Test ergonomics decisions related to minimum and initial heap size.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestMinInitialErgonomics TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/arguments/TestParallelHeapSizeFlags.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/arguments/TestParallelHeapSizeFlags.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @bug 8006088
  * @summary Tests argument processing for initial and maximum heap size for the
  * parallel collectors.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestParallelHeapSizeFlags TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/arguments/TestSerialHeapSizeFlags.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/arguments/TestSerialHeapSizeFlags.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @key gc
  * @bug 8006088
  * @summary Tests argument processing for initial and maximum heap size for the Serial collector
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestSerialHeapSizeFlags TestMaxHeapSizeTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/arguments/TestSurvivorAlignmentInBytesOption.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/arguments/TestSurvivorAlignmentInBytesOption.java	Mon Jan 05 15:00:30 2015 +0100
@@ -51,8 +51,13 @@
         // Verify that without -XX:+UnlockExperimentalVMOptions usage of
         // SurvivorAlignmentInBytes option will cause JVM startup failure
         // with the warning message saying that that option is experimental.
+        String shouldFailMessage = String.format("JVM option '%s' is "
+                + "experimental.%nJVM startup should fail without "
+                + "-XX:+UnlockExperimentalVMOptions option", optionName);
         CommandLineOptionTest.verifyJVMStartup(
-                new String[]{optionIsExperimental}, null, ExitCode.FAIL, false,
+                new String[]{optionIsExperimental}, null,
+                shouldFailMessage, shouldFailMessage,
+                ExitCode.FAIL, false,
                 "-XX:-UnlockExperimentalVMOptions",
                 CommandLineOptionTest.prepareBooleanFlag(
                         unlockExperimentalVMOpts, false),
@@ -61,17 +66,28 @@
         // Verify that with -XX:+UnlockExperimentalVMOptions passed to JVM
         // usage of SurvivorAlignmentInBytes option won't cause JVM startup
         // failure.
+        String shouldPassMessage = String.format("JVM option '%s' is "
+                + "experimental.%nJVM startup should pass with "
+                + "-XX:+UnlockExperimentalVMOptions option", optionName);
+        String noWarningMessage = "There should be no warnings when use "
+                + "with -XX:+UnlockExperimentalVMOptions option";
         CommandLineOptionTest.verifyJVMStartup(
-                null, new String[]{optionIsExperimental}, ExitCode.OK, false,
+                null, new String[]{optionIsExperimental},
+                shouldPassMessage, noWarningMessage,
+                ExitCode.OK, false,
                 CommandLineOptionTest.prepareBooleanFlag(
                         unlockExperimentalVMOpts, true),
                 CommandLineOptionTest.prepareNumericFlag(optionName, 64));
 
-        // Verify that if specified SurvivorAlignmentInBytes is lower then
+        // Verify that if specified SurvivorAlignmentInBytes is lower than
         // ObjectAlignmentInBytes, then the JVM startup will fail with
         // appropriate error message.
+        shouldFailMessage = String.format("JVM startup should fail with "
+                + "'%s' option value lower than ObjectAlignmentInBytes", optionName);
         CommandLineOptionTest.verifyJVMStartup(
-                new String[]{valueIsTooSmall}, null, ExitCode.FAIL, false,
+                new String[]{valueIsTooSmall}, null,
+                shouldFailMessage, shouldFailMessage,
+                ExitCode.FAIL, false,
                 CommandLineOptionTest.prepareBooleanFlag(
                         unlockExperimentalVMOpts, true),
                 CommandLineOptionTest.prepareNumericFlag(optionName, 2));
@@ -79,16 +95,25 @@
         // Verify that if specified SurvivorAlignmentInBytes value is not
         // a power of 2 then the JVM startup will fail with appropriate error
         // message.
+        shouldFailMessage = String.format("JVM startup should fail with "
+                + "'%s' option value is not a power of 2", optionName);
         CommandLineOptionTest.verifyJVMStartup(
-                new String[]{mustBePowerOf2}, null, ExitCode.FAIL, false,
+                new String[]{mustBePowerOf2}, null,
+                shouldFailMessage, shouldFailMessage,
+                ExitCode.FAIL, false,
                 CommandLineOptionTest.prepareBooleanFlag(
                         unlockExperimentalVMOpts, true),
                 CommandLineOptionTest.prepareNumericFlag(optionName, 127));
 
         // Verify that if SurvivorAlignmentInBytes has correct value, then
         // the JVM will be started without errors.
+        shouldPassMessage = String.format("JVM startup should pass with "
+                + "correct '%s' option value", optionName);
+        noWarningMessage = String.format("There should be no warnings when use "
+                + "correct '%s' option value", optionName);
         CommandLineOptionTest.verifyJVMStartup(
                 null, new String[]{".*SurvivorAlignmentInBytes.*"},
+                shouldPassMessage, noWarningMessage,
                 ExitCode.OK, false,
                 CommandLineOptionTest.prepareBooleanFlag(
                         unlockExperimentalVMOpts, true),
@@ -96,8 +121,10 @@
 
         // Verify that we can setup different SurvivorAlignmentInBytes values.
         for (int alignment = 32; alignment <= 128; alignment *= 2) {
+            shouldPassMessage = String.format("JVM startup should pass with "
+                    + "'%s' = %d", optionName, alignment);
             CommandLineOptionTest.verifyOptionValue(optionName,
-                    Integer.toString(alignment),
+                    Integer.toString(alignment), shouldPassMessage,
                     CommandLineOptionTest.prepareBooleanFlag(
                             unlockExperimentalVMOpts, true),
                     CommandLineOptionTest.prepareNumericFlag(
--- a/hotspot/test/gc/arguments/TestUseCompressedOopsErgo.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/arguments/TestUseCompressedOopsErgo.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @key gc
  * @bug 8010722
  * @summary Tests ergonomics for UseCompressedOops.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestUseCompressedOopsErgo TestUseCompressedOopsErgoTools
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @key gc
  * @bug 8049831
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestCMSClassUnloadingEnabledHWM
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @key gc
  * @bug 8049831
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestG1ClassUnloadingHWM
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/g1/TestHumongousCodeCacheRoots.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/g1/TestHumongousCodeCacheRoots.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @key regression
  * @key gc
  * @bug 8027756
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestHumongousCodeCacheRoots
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 8038423
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData00
  * @run driver/timeout=720 TestShrinkAuxiliaryData00
  */
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData05
  * @run driver/timeout=720 TestShrinkAuxiliaryData05
  */
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData10
  * @run driver/timeout=720 TestShrinkAuxiliaryData10
  */
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData15
  * @run driver/timeout=720 TestShrinkAuxiliaryData15
  */
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData20
  * @run driver/timeout=720 TestShrinkAuxiliaryData20
  */
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData25
  * @run driver/timeout=720 TestShrinkAuxiliaryData25
  */
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @summary Checks that decommitment occurs for JVM with different
  * G1ConcRSLogCacheSize and ObjectAlignmentInBytes options values
  * @requires vm.gc=="G1" | vm.gc=="null"
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData30
  * @run driver/timeout=720 TestShrinkAuxiliaryData30
  */
--- a/hotspot/test/gc/metaspace/TestCapacityUntilGCWrapAround.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/metaspace/TestCapacityUntilGCWrapAround.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @key gc
  * @bug 8049831
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestCapacityUntilGCWrapAround
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/survivorAlignment/TestAllocationInEden.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/survivorAlignment/TestAllocationInEden.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 8031323
  * @summary Verify that object's alignment in eden space is not affected by
  *          SurvivorAlignmentInBytes option.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestAllocationInEden SurvivorAlignmentTestMain AlignmentHelper
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/survivorAlignment/TestPromotionFromEdenToTenured.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/survivorAlignment/TestPromotionFromEdenToTenured.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 8031323
  * @summary Verify that objects promoted from eden space to tenured space during
  *          full GC are not aligned to SurvivorAlignmentInBytes value.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestPromotionFromEdenToTenured SurvivorAlignmentTestMain
  *        AlignmentHelper
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 8031323
  * @summary Verify that objects promoted from survivor space to tenured space
  *          during full GC are not aligned to SurvivorAlignmentInBytes value.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestPromotionFromSurvivorToTenuredAfterFullGC
  *        SurvivorAlignmentTestMain AlignmentHelper
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java	Mon Jan 05 15:00:30 2015 +0100
@@ -27,7 +27,7 @@
  * @summary Verify that objects promoted from survivor space to tenured space
  *          when their age exceeded tenuring threshold are not aligned to
  *          SurvivorAlignmentInBytes value.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestPromotionFromSurvivorToTenuredAfterMinorGC
  *        SurvivorAlignmentTestMain AlignmentHelper
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/gc/survivorAlignment/TestPromotionToSurvivor.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/survivorAlignment/TestPromotionToSurvivor.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 8031323
  * @summary Verify that objects promoted from eden space to survivor space after
  *          minor GC are aligned to SurvivorAlignmentInBytes.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestPromotionToSurvivor
  *        SurvivorAlignmentTestMain AlignmentHelper
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/gc/whitebox/TestConcMarkCycleWB.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/whitebox/TestConcMarkCycleWB.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test TestConMarkCycleWB
  * @bug 8065579
  * @requires vm.gc=="null" | vm.gc=="G1"
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.WhiteBox TestConcMarkCycleWB
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/whitebox/TestWBGC.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/gc/whitebox/TestWBGC.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test TestWBGC
  * @bug 8055098
  * @summary Test verify that WB methods isObjectInOldGen and youngGC works correctly.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build TestWBGC
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run driver TestWBGC
--- a/hotspot/test/runtime/ClassUnload/KeepAliveClass.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/ClassUnload/KeepAliveClass.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test KeepAliveClass
  * @summary This test case uses a java.lang.Class instance to keep a class alive.
- * @library /testlibrary /testlibrary/whitebox /runtime/testlibrary
+ * @library /testlibrary /../../test/lib /runtime/testlibrary
  * @library classes
  * @build KeepAliveClass test.Empty
  * @build ClassUnloadCommon
--- a/hotspot/test/runtime/ClassUnload/KeepAliveClassLoader.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/ClassUnload/KeepAliveClassLoader.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test KeepAliveClassLoader
  * @summary This test case uses a java.lang.ClassLoader instance to keep a class alive.
- * @library /testlibrary /testlibrary/whitebox /runtime/testlibrary
+ * @library /testlibrary /../../test/lib /runtime/testlibrary
  * @library classes
  * @build KeepAliveClassLoader test.Empty
  * @build ClassUnloadCommon
--- a/hotspot/test/runtime/ClassUnload/KeepAliveObject.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/ClassUnload/KeepAliveObject.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test KeepAliveObject
  * @summary This test case uses a class instance to keep the class alive.
- * @library /testlibrary /testlibrary/whitebox /runtime/testlibrary
+ * @library /testlibrary /../../test/lib /runtime/testlibrary
  * @library classes
  * @build KeepAliveObject test.Empty
  * @build ClassUnloadCommon
--- a/hotspot/test/runtime/ClassUnload/KeepAliveSoftReference.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/ClassUnload/KeepAliveSoftReference.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test KeepAliveSoftReference
  * @summary This test case uses a java.lang.ref.SoftReference referencing a class instance to keep a class alive.
- * @library /testlibrary /testlibrary/whitebox /runtime/testlibrary
+ * @library /testlibrary /../../test/lib /runtime/testlibrary
  * @library classes
  * @build KeepAliveSoftReference test.Empty
  * @build ClassUnloadCommon
--- a/hotspot/test/runtime/ClassUnload/UnloadTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/ClassUnload/UnloadTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -23,7 +23,7 @@
 
 /*
  * @test UnloadTest
- * @library /runtime/testlibrary /testlibrary /testlibrary/whitebox
+ * @library /runtime/testlibrary /testlibrary /../../test/lib
  * @library classes
  * @build ClassUnloadCommon test.Empty
  * @build UnloadTest
--- a/hotspot/test/runtime/NMT/ChangeTrackingLevel.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/ChangeTrackingLevel.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 8059100
  * @summary Test that you can decrease NMT tracking level but not increase it.
  * @key nmt
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build ChangeTrackingLevel
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/NMT/JcmdDetailDiff.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/JcmdDetailDiff.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @summary run NMT baseline, allocate memory and verify output from detail.diff
  * @key nmt jcmd
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @ignore
  * @build JcmdDetailDiff
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/runtime/NMT/JcmdSummaryDiff.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/JcmdSummaryDiff.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @summary run NMT baseline, allocate memory and verify output from summary.diff
  * @key nmt jcmd
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build JcmdSummaryDiff
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=summary JcmdSummaryDiff
--- a/hotspot/test/runtime/NMT/MallocRoundingReportTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/MallocRoundingReportTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @summary Test consistency of NMT by creating allocations of the Test type with various sizes and verifying visibility with jcmd
  * @key nmt jcmd
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build MallocRoundingReportTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocRoundingReportTest
--- a/hotspot/test/runtime/NMT/MallocSiteHashOverflow.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/MallocSiteHashOverflow.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @summary Test corner case that overflows malloc site hashtable bucket
  * @requires sun.arch.data.model == "32"
  * @key nmt jcmd stress
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build MallocSiteHashOverflow
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocSiteHashOverflow
--- a/hotspot/test/runtime/NMT/MallocStressTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/MallocStressTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @summary Stress test for malloc tracking
  * @key nmt jcmd stress
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build MallocStressTest
  * @ignore - This test is disabled since it will stress NMT and timeout during normal testing
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
--- a/hotspot/test/runtime/NMT/MallocTestType.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/MallocTestType.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @summary Test consistency of NMT by leaking a few select allocations of the Test type and then verify visibility with jcmd
  * @key nmt jcmd
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build MallocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/NMT/MallocTrackingVerify.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/MallocTrackingVerify.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 8054836
  * @summary Test to verify correctness of malloc tracking
  * @key nmt jcmd
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build MallocTrackingVerify
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocTrackingVerify
--- a/hotspot/test/runtime/NMT/ReleaseCommittedMemory.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/ReleaseCommittedMemory.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @bug 8013120
  * @summary Release committed memory and make sure NMT handles it correctly
  * @key nmt regression
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build ReleaseCommittedMemory
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/NMT/ReleaseNoCommit.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/ReleaseNoCommit.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @summary Release uncommitted memory and make sure NMT handles it correctly
  * @key nmt regression
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build ReleaseNoCommit
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=summary ReleaseNoCommit
--- a/hotspot/test/runtime/NMT/SummarySanityCheck.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/SummarySanityCheck.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @key nmt jcmd
  * @summary Sanity check the output of NMT
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build SummarySanityCheck
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/NMT/ThreadedMallocTestType.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/ThreadedMallocTestType.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @key nmt jcmd
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build ThreadedMallocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @key nmt jcmd
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build ThreadedVirtualAllocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @summary Test reserve/commit/uncommit/release of virtual memory and that we track it correctly
  * @key nmt jcmd
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build VirtualAllocCommitUncommitRecommit
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail VirtualAllocCommitUncommitRecommit
--- a/hotspot/test/runtime/NMT/VirtualAllocTestType.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/NMT/VirtualAllocTestType.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @summary Test Reserve/Commit/Uncommit/Release of virtual memory and that we track it correctly
  * @key nmt jcmd
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build VirtualAllocTestType
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8047290
  * @summary Ensure that a Monitor::lock_without_safepoint_check fires an assert when it incorrectly acquires a lock which must always have safepoint checks.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build AssertSafepointCheckConsistency1
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8047290
  * @summary Ensure that a Monitor::lock fires an assert when it incorrectly acquires a lock which must never have safepoint checks.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build AssertSafepointCheckConsistency2
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8047290
  * @summary Ensure that Monitor::lock_without_safepoint_check does not assert when it correctly acquires a lock which must never have safepoint checks.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build AssertSafepointCheckConsistency3
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java	Mon Jan 05 15:00:30 2015 +0100
@@ -25,7 +25,7 @@
  * @test
  * @bug 8047290
  * @summary Ensure that Monitor::lock does not assert when it correctly acquires a lock which must always have safepoint checks.
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build AssertSafepointCheckConsistency4
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License
+ * version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ * @test
+ * @bug 8059510
+ * @summary Test jcmd VM.symboltable and VM.stringtable options
+ * @library /testlibrary
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions DumpSymbolAndStringTable
+ */
+
+import com.oracle.java.testlibrary.*;
+
+public class DumpSymbolAndStringTable {
+    public static void main(String[] args) throws Exception {
+        // Grab my own PID
+        String pid = Integer.toString(ProcessTools.getProcessId());
+
+        ProcessBuilder pb = new ProcessBuilder();
+        pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.symboltable", "-verbose"});
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        try {
+            output.shouldContain("24 2: DumpSymbolAndStringTable\n");
+        } catch (RuntimeException e) {
+            output.shouldContain("Unknown diagnostic command");
+        }
+
+        pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.stringtable", "-verbose"});
+        output = new OutputAnalyzer(pb.start());
+        try {
+            output.shouldContain("16: java.lang.String\n");
+        } catch (RuntimeException e) {
+            output.shouldContain("Unknown diagnostic command");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java	Mon Jan 05 15:00:30 2015 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8059510
+ * @summary Test SharedSymbolTableBucketSize option
+ * @library /testlibrary
+ */
+
+import com.oracle.java.testlibrary.*;
+
+public class SharedSymbolTableBucketSize {
+    public static void main(String[] args) throws Exception {
+        int bucket_size = 8;
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+            "-Xshare:dump", "-XX:+PrintSharedSpaces",
+            "-XX:+UnlockDiagnosticVMOptions",
+            "-XX:SharedArchiveFile=./sample.jsa",
+            "-XX:SharedSymbolTableBucketSize=" + Integer.valueOf(bucket_size));
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.shouldContain("Loading classes to share");
+        output.shouldHaveExitValue(0);
+
+        String s = output.firstMatch("Average bucket size     : .*");
+        Float f = Float.parseFloat(s.substring(25));
+        int size = Math.round(f);
+        if (size != bucket_size) {
+          throw new Exception("FAILED: incorrect bucket size " + size +
+                              ", expect " + bucket_size);
+        }
+
+
+        // Invalid SharedSymbolTableBucketSize input
+        String input[] = {"-XX:SharedSymbolTableBucketSize=-1",
+                          "-XX:SharedSymbolTableBucketSize=2.5"};
+        for (int i = 0; i < input.length; i++) {
+          pb = ProcessTools.createJavaProcessBuilder(
+               "-Xshare:dump", "-XX:+PrintSharedSpaces",
+               "-XX:+UnlockDiagnosticVMOptions",
+               "-XX:SharedArchiveFile=./sample.jsa",
+               input[i]);
+          output = new OutputAnalyzer(pb.start());
+          output.shouldContain("Improperly specified VM option");
+      }
+  }
+}
--- a/hotspot/test/runtime/interned/SanityTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/interned/SanityTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test SanityTest
  * @summary Sanity check of String.intern() & GC
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build SanityTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/memory/ReadFromNoaccessArea.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/memory/ReadFromNoaccessArea.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @summary Test that touching noaccess area in class ReservedHeapSpace results in SIGSEGV/ACCESS_VIOLATION
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build ReadFromNoaccessArea
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/memory/ReadVMPageSize.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/memory/ReadVMPageSize.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @summary Using WhiteBox to get VM page size
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build ReadVMPageSize
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm  -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI  ReadVMPageSize
--- a/hotspot/test/runtime/memory/ReserveMemory.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/memory/ReserveMemory.java	Mon Jan 05 15:00:30 2015 +0100
@@ -26,7 +26,7 @@
  * @key regression
  * @bug 8012015
  * @summary Make sure reserved (but uncommitted) memory is not accessible
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build ReserveMemory
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/memory/RunUnitTestsConcurrently.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/memory/RunUnitTestsConcurrently.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @summary Test launches unit tests inside vm concurrently
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build RunUnitTestsConcurrently
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/memory/StressVirtualSpaceResize.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/memory/StressVirtualSpaceResize.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @summary Stress test that expands/shrinks VirtualSpace
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build StressVirtualSpaceResize
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/runtime/whitebox/WBStackSize.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/runtime/whitebox/WBStackSize.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test WBStackSize
  * @summary verify that whitebox functions getThreadFullStackSize() and getThreadRemainingStackSize are working
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build WBStackSize
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/sanity/WBApi.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/sanity/WBApi.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test WBApi
  * @summary verify that whitebox functions can be linked and executed
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build WBApi
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/serviceability/ParserTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/serviceability/ParserTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @summary Test that the diagnostic command arguemnt parser works
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.parser.*
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Utils.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Utils.java	Mon Jan 05 15:00:30 2015 +0100
@@ -32,13 +32,18 @@
 import java.net.InetAddress;
 import java.net.ServerSocket;
 import java.net.UnknownHostException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Random;
+import java.util.concurrent.TimeUnit;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import java.util.stream.Collectors;
 import sun.misc.Unsafe;
 
 /**
@@ -88,6 +93,12 @@
         TIMEOUT_FACTOR = Double.parseDouble(toFactor);
     }
 
+    /**
+    * Returns the value of JTREG default test timeout in milliseconds
+    * converted to {@code long}.
+    */
+    public static final long DEFAULT_TEST_TIMEOUT = TimeUnit.SECONDS.toMillis(120);
+
     private Utils() {
         // Private constructor to prevent class instantiation
     }
@@ -318,28 +329,15 @@
      * or null if not found.
      * @param filename name of the file to read
      * @return String contents of file, or null if file not found.
+     * @throws  IOException
+     *          if an I/O error occurs reading from the file or a malformed or
+     *          unmappable byte sequence is read
      */
-    public static String fileAsString(String filename) {
-        StringBuilder result = new StringBuilder();
-        try {
-            File file = new File(filename);
-            if (file.exists()) {
-                BufferedReader reader = new BufferedReader(new FileReader(file));
-                while (true) {
-                    String line = reader.readLine();
-                    if (line == null) {
-                        break;
-                    }
-                    result.append(line).append("\n");
-                }
-            } else {
-                // Does not exist:
-                return null;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return result.toString();
+    public static String fileAsString(String filename) throws IOException {
+        Path filePath = Paths.get(filename);
+        return Files.exists(filePath)
+            ? Files.lines(filePath).collect(Collectors.joining(NEW_LINE))
+            : null;
     }
 
     /**
@@ -396,4 +394,14 @@
         }
         return RANDOM_GENERATOR;
     }
+
+    /**
+     * Adjusts the provided timeout value for the TIMEOUT_FACTOR
+     * @param tOut the timeout value to be adjusted
+     * @return The timeout value adjusted for the value of "test.timeout.factor"
+     *         system property
+     */
+    public static long adjustTimeout(long tOut) {
+        return Math.round(tOut * Utils.TIMEOUT_FACTOR);
+    }
 }
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/CommandLineOptionTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/CommandLineOptionTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -49,7 +49,7 @@
     private static final String PRINT_FLAGS_FINAL_FORMAT = "%s\\s*:?=\\s*%s";
 
     /**
-     * Verifies that JVM startup behaviour matches our expectations.
+     * Verifies that JVM startup behavior matches our expectations.
      *
      * @param option an option that should be passed to JVM
      * @param expectedMessages an array of patterns that should occur
@@ -58,18 +58,24 @@
      * @param unexpectedMessages an array of patterns that should not
      *                           occur in JVM output. If {@code null} then
      *                           JVM output could be empty.
+     * @param exitErrorMessage message that will be shown if exit code is not
+     *                           as expected.
+     * @param wrongWarningMessage message that will be shown if warning
+     *                           messages are not as expected.
      * @param exitCode expected exit code.
      * @throws Throwable if verification fails or some other issues occur.
      */
     public static void verifyJVMStartup(String option,
             String expectedMessages[], String unexpectedMessages[],
+            String exitErrorMessage, String wrongWarningMessage,
             ExitCode exitCode) throws Throwable {
         CommandLineOptionTest.verifyJVMStartup(expectedMessages,
-                unexpectedMessages, exitCode, false, option);
+                unexpectedMessages, exitErrorMessage,
+                wrongWarningMessage, exitCode, false, option);
     }
 
     /**
-     * Verifies that JVM startup behaviour matches our expectations.
+     * Verifies that JVM startup behavior matches our expectations.
      *
      * @param expectedMessages an array of patterns that should occur
      *                         in JVM output. If {@code null} then
@@ -77,6 +83,10 @@
      * @param unexpectedMessages an array of patterns that should not
      *                           occur in JVM output. If {@code null} then
      *                           JVM output could be empty.
+     * @param exitErrorMessage message that will be shown if exit code is not
+     *                           as expected.
+     * @param wrongWarningMessage message that will be shown if warning
+     *                           messages are not as expected.
      * @param exitCode expected exit code.
      * @param addTestVMOptions if {@code true} then test VM options will be
      *                         passed to VM.
@@ -85,8 +95,10 @@
      * @throws Throwable if verification fails or some other issues occur.
      */
     public static void verifyJVMStartup(String expectedMessages[],
-            String unexpectedMessages[], ExitCode exitCode,
-            boolean addTestVMOptions, String... options) throws Throwable {
+            String unexpectedMessages[], String exitErrorMessage,
+            String wrongWarningMessage, ExitCode exitCode,
+            boolean addTestVMOptions, String... options)
+                    throws Throwable {
         List<String> finalOptions = new ArrayList<>();
         if (addTestVMOptions) {
             Collections.addAll(finalOptions, Utils.getTestJavaOpts());
@@ -99,23 +111,46 @@
                 new String[finalOptions.size()]));
         OutputAnalyzer outputAnalyzer
                 = new OutputAnalyzer(processBuilder.start());
-        outputAnalyzer.shouldHaveExitValue(exitCode.value);
+
+        try {
+                outputAnalyzer.shouldHaveExitValue(exitCode.value);
+        } catch (RuntimeException e) {
+            String errorMessage = String.format(
+                    "JVM process should have exit value '%d'.%n%s",
+                    exitCode.value, exitErrorMessage);
+            throw new AssertionError(errorMessage, e);
+        }
+
 
         if (expectedMessages != null) {
             for (String expectedMessage : expectedMessages) {
-                outputAnalyzer.shouldMatch(expectedMessage);
+                try {
+                    outputAnalyzer.shouldMatch(expectedMessage);
+                } catch (RuntimeException e) {
+                    String errorMessage = String.format(
+                            "Expected message not found: '%s'.%n%s",
+                            expectedMessage, wrongWarningMessage);
+                    throw new AssertionError(errorMessage, e);
+                }
             }
         }
 
         if (unexpectedMessages != null) {
             for (String unexpectedMessage : unexpectedMessages) {
-                outputAnalyzer.shouldNotMatch(unexpectedMessage);
+                try {
+                    outputAnalyzer.shouldNotMatch(unexpectedMessage);
+                } catch (RuntimeException e) {
+                    String errorMessage = String.format(
+                            "Unexpected message found: '%s'.%n%s",
+                            unexpectedMessage, wrongWarningMessage);
+                    throw new AssertionError(errorMessage, e);
+                }
             }
         }
     }
 
     /**
-     * Verifies that JVM startup behaviour matches our expectations when type
+     * Verifies that JVM startup behavior matches our expectations when type
      * of newly started VM is the same as the type of current.
      *
      * @param expectedMessages an array of patterns that should occur
@@ -124,20 +159,26 @@
      * @param unexpectedMessages an array of patterns that should not
      *                           occur in JVM output. If {@code null} then
      *                           JVM output could be empty.
+     * @param exitErrorMessage Message that will be shown if exit value is not
+     *                           as expected.
+     * @param wrongWarningMessage message that will be shown if warning
+     *                           messages are not as expected.
      * @param exitCode expected exit code.
      * @param options options that should be passed to VM in addition to mode
      *                flag.
      * @throws Throwable if verification fails or some other issues occur.
      */
     public static void verifySameJVMStartup(String expectedMessages[],
-            String unexpectedMessages[], ExitCode exitCode, String... options)
-            throws  Throwable {
+            String unexpectedMessages[], String exitErrorMessage,
+            String wrongWarningMessage, ExitCode exitCode, String... options)
+            throws Throwable {
         List<String> finalOptions = new ArrayList<>();
         finalOptions.add(CommandLineOptionTest.getVMTypeOption());
         Collections.addAll(finalOptions, options);
 
         CommandLineOptionTest.verifyJVMStartup(expectedMessages,
-                unexpectedMessages, exitCode, false,
+                unexpectedMessages, exitErrorMessage,
+                wrongWarningMessage, exitCode, false,
                 finalOptions.toArray(new String[finalOptions.size()]));
     }
 
@@ -149,13 +190,17 @@
      *
      * @param optionName a name of tested option.
      * @param expectedValue expected value of tested option.
+     * @param optionErrorString message will be shown if option value is not as
+     *                         expected.
      * @param additionalVMOpts additional options that should be
      *                         passed to JVM.
      * @throws Throwable if verification fails or some other issues occur.
      */
     public static void verifyOptionValue(String optionName,
-            String expectedValue, String... additionalVMOpts) throws Throwable {
-        verifyOptionValue(optionName, expectedValue, true, additionalVMOpts);
+            String expectedValue, String optionErrorString,
+            String... additionalVMOpts) throws Throwable {
+        verifyOptionValue(optionName, expectedValue,  optionErrorString,
+                true, additionalVMOpts);
     }
 
     /**
@@ -168,14 +213,17 @@
      * @param expectedValue expected value of tested option.
      * @param addTestVmOptions if {@code true}, then test VM options
      *                         will be used.
+     * @param optionErrorString message will be shown if option value is not as
+     *                         expected.
      * @param additionalVMOpts additional options that should be
      *                         passed to JVM.
      * @throws Throwable if verification fails or some other issues
      *                          occur.
      */
     public static void verifyOptionValue(String optionName,
-            String expectedValue, boolean addTestVmOptions,
-            String... additionalVMOpts) throws Throwable {
+            String expectedValue, String optionErrorString,
+            boolean addTestVmOptions, String... additionalVMOpts)
+                    throws Throwable {
         List<String> vmOpts = new ArrayList<>();
 
         if (addTestVmOptions) {
@@ -191,10 +239,25 @@
         OutputAnalyzer outputAnalyzer
                 = new OutputAnalyzer(processBuilder.start());
 
-        outputAnalyzer.shouldHaveExitValue(0);
+        try {
+            outputAnalyzer.shouldHaveExitValue(0);
+        } catch (RuntimeException e) {
+            String errorMessage = String.format(
+                    "JVM should start with option '%s' without errors.",
+                    optionName);
+            throw new AssertionError(errorMessage, e);
+        }
+        try {
         outputAnalyzer.shouldMatch(String.format(
                 CommandLineOptionTest.PRINT_FLAGS_FINAL_FORMAT,
                 optionName, expectedValue));
+        } catch (RuntimeException e) {
+            String errorMessage =  String.format(
+                    "Option '%s' is expected to have '%s' value%n%s",
+                    optionName, expectedValue,
+                    optionErrorString);
+            throw new AssertionError(errorMessage, e);
+        }
     }
 
     /**
@@ -207,18 +270,21 @@
      *
      * @param optionName name of tested option.
      * @param expectedValue expected value of tested option.
+     * @param optionErrorString message to show if option has another value
      * @param additionalVMOpts additional options that should be
      *                         passed to JVM.
      * @throws Throwable if verification fails or some other issues occur.
      */
     public static void verifyOptionValueForSameVM(String optionName,
-            String expectedValue, String... additionalVMOpts) throws Throwable {
+            String expectedValue, String optionErrorString,
+            String... additionalVMOpts) throws Throwable {
         List<String> finalOptions = new ArrayList<>();
         finalOptions.add(CommandLineOptionTest.getVMTypeOption());
         Collections.addAll(finalOptions, additionalVMOpts);
 
         CommandLineOptionTest.verifyOptionValue(optionName, expectedValue,
-                false, finalOptions.toArray(new String[finalOptions.size()]));
+                optionErrorString, false,
+                finalOptions.toArray(new String[finalOptions.size()]));
     }
 
     /**
--- a/hotspot/test/testlibrary/ctw/test/ClassesDirTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary/ctw/test/ClassesDirTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8012447
- * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
+ * @library /testlibrary /../../test/lib /testlibrary/ctw/src
  * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary/ctw/test/ClassesListTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary/ctw/test/ClassesListTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8012447
- * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
+ * @library /testlibrary /../../test/lib /testlibrary/ctw/src
  * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary/ctw/test/JarDirTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary/ctw/test/JarDirTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8012447
- * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
+ * @library /testlibrary /../../test/lib /testlibrary/ctw/src
  * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary/ctw/test/JarsTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary/ctw/test/JarsTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8012447
- * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
+ * @library /testlibrary /../../test/lib /testlibrary/ctw/src
  * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary/whitebox/Makefile	Mon Dec 22 17:33:29 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#
-# Copyright (c) 2013, 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
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.	See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-#
-
-ifneq "x$(ALT_BOOTDIR)" "x"
-	BOOTDIR := $(ALT_BOOTDIR)
-endif
-
-ifeq "x$(BOOTDIR)" "x"
-	JDK_HOME := $(shell dirname $(shell which java))/..
-else
-	JDK_HOME := $(BOOTDIR)
-endif
-
-SRC_DIR = ./
-BUILD_DIR = build
-OUTPUT_DIR = $(BUILD_DIR)/classes
-
-JAVAC = $(JDK_HOME)/bin/javac
-JAR = $(JDK_HOME)/bin/jar
-
-SRC_FILES = $(shell find $(SRC_DIR) -name '*.java')
-
-.PHONY: filelist clean cleantmp
-
-all: wb.jar cleantmp
-
-wb.jar: filelist
-	@mkdir -p $(OUTPUT_DIR)
-	$(JAVAC) -sourcepath $(SRC_DIR) -d $(OUTPUT_DIR) -cp $(OUTPUT_DIR) @filelist
-	$(JAR) cf wb.jar -C $(OUTPUT_DIR) .
-	@rm -rf $(OUTPUT_DIR)
-
-filelist: $(SRC_FILES)
-	@rm -f $@
-	@echo $(SRC_FILES) > $@
-
-clean: cleantmp
-	@rm -rf wb.jar
-
-cleantmp:
-	@rm -rf filelist
-	@rm -rf $(BUILD_DIR)
--- a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java	Mon Dec 22 17:33:29 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,253 +0,0 @@
-/*
- * Copyright (c) 2012, 2014, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.hotspot;
-
-import java.lang.reflect.Executable;
-import java.util.Arrays;
-import java.util.List;
-import java.util.function.Function;
-import java.util.stream.Stream;
-import java.security.BasicPermission;
-
-import sun.hotspot.parser.DiagnosticCommand;
-
-public class WhiteBox {
-
-  @SuppressWarnings("serial")
-  public static class WhiteBoxPermission extends BasicPermission {
-    public WhiteBoxPermission(String s) {
-      super(s);
-    }
-  }
-
-  private WhiteBox() {}
-  private static final WhiteBox instance = new WhiteBox();
-  private static native void registerNatives();
-
-  /**
-   * Returns the singleton WhiteBox instance.
-   *
-   * The returned WhiteBox object should be carefully guarded
-   * by the caller, since it can be used to read and write data
-   * at arbitrary memory addresses. It must never be passed to
-   * untrusted code.
-   */
-  public synchronized static WhiteBox getWhiteBox() {
-    SecurityManager sm = System.getSecurityManager();
-    if (sm != null) {
-      sm.checkPermission(new WhiteBoxPermission("getInstance"));
-    }
-    return instance;
-  }
-
-  static {
-    registerNatives();
-  }
-
-  // Get the maximum heap size supporting COOPs
-  public native long getCompressedOopsMaxHeapSize();
-  // Arguments
-  public native void printHeapSizes();
-
-  // Memory
-  public native long getObjectAddress(Object o);
-  public native int  getHeapOopSize();
-  public native int  getVMPageSize();
-  public native boolean isObjectInOldGen(Object o);
-  public native long getObjectSize(Object o);
-
-  // Runtime
-  // Make sure class name is in the correct format
-  public boolean isClassAlive(String name) {
-    return isClassAlive0(name.replace('.', '/'));
-  }
-  private native boolean isClassAlive0(String name);
-
-  // JVMTI
-  public native void addToBootstrapClassLoaderSearch(String segment);
-  public native void addToSystemClassLoaderSearch(String segment);
-
-  // G1
-  public native boolean g1InConcurrentMark();
-  public native boolean g1IsHumongous(Object o);
-  public native long    g1NumFreeRegions();
-  public native int     g1RegionSize();
-  public native Object[]    parseCommandLine(String commandline, char delim, DiagnosticCommand[] args);
-
-  // NMT
-  public native long NMTMalloc(long size);
-  public native void NMTFree(long mem);
-  public native long NMTReserveMemory(long size);
-  public native void NMTCommitMemory(long addr, long size);
-  public native void NMTUncommitMemory(long addr, long size);
-  public native void NMTReleaseMemory(long addr, long size);
-  public native long NMTMallocWithPseudoStack(long size, int index);
-  public native boolean NMTIsDetailSupported();
-  public native boolean NMTChangeTrackingLevel();
-  public native int NMTGetHashSize();
-
-  // Compiler
-  public native void    deoptimizeAll();
-  public        boolean isMethodCompiled(Executable method) {
-    return isMethodCompiled(method, false /*not osr*/);
-  }
-  public native boolean isMethodCompiled(Executable method, boolean isOsr);
-  public        boolean isMethodCompilable(Executable method) {
-    return isMethodCompilable(method, -1 /*any*/);
-  }
-  public        boolean isMethodCompilable(Executable method, int compLevel) {
-    return isMethodCompilable(method, compLevel, false /*not osr*/);
-  }
-  public native boolean isMethodCompilable(Executable method, int compLevel, boolean isOsr);
-  public native boolean isMethodQueuedForCompilation(Executable method);
-  public        int     deoptimizeMethod(Executable method) {
-    return deoptimizeMethod(method, false /*not osr*/);
-  }
-  public native int     deoptimizeMethod(Executable method, boolean isOsr);
-  public        void    makeMethodNotCompilable(Executable method) {
-    makeMethodNotCompilable(method, -1 /*any*/);
-  }
-  public        void    makeMethodNotCompilable(Executable method, int compLevel) {
-    makeMethodNotCompilable(method, compLevel, false /*not osr*/);
-  }
-  public native void    makeMethodNotCompilable(Executable method, int compLevel, boolean isOsr);
-  public        int     getMethodCompilationLevel(Executable method) {
-    return getMethodCompilationLevel(method, false /*not ost*/);
-  }
-  public native int     getMethodCompilationLevel(Executable method, boolean isOsr);
-  public native boolean testSetDontInlineMethod(Executable method, boolean value);
-  public        int     getCompileQueuesSize() {
-    return getCompileQueueSize(-1 /*any*/);
-  }
-  public native int     getCompileQueueSize(int compLevel);
-  public native boolean testSetForceInlineMethod(Executable method, boolean value);
-  public        boolean enqueueMethodForCompilation(Executable method, int compLevel) {
-    return enqueueMethodForCompilation(method, compLevel, -1 /*InvocationEntryBci*/);
-  }
-  public native boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci);
-  public native void    clearMethodState(Executable method);
-  public native void    lockCompilation();
-  public native void    unlockCompilation();
-  public native int     getMethodEntryBci(Executable method);
-  public native Object[] getNMethod(Executable method, boolean isOsr);
-  public native long    allocateCodeBlob(int size, int type);
-  public        long    allocateCodeBlob(long size, int type) {
-      int intSize = (int) size;
-      if ((long) intSize != size || size < 0) {
-          throw new IllegalArgumentException(
-                "size argument has illegal value " + size);
-      }
-      return allocateCodeBlob( intSize, type);
-  }
-  public native void    freeCodeBlob(long addr);
-  public        void    forceNMethodSweep() {
-    try {
-        forceNMethodSweep0().join();
-    } catch (InterruptedException e) {
-        Thread.currentThread().interrupt();
-    }
-  }
-  public native Thread  forceNMethodSweep0();
-  public native Object[] getCodeHeapEntries(int type);
-  public native int     getCompilationActivityMode();
-  public native Object[] getCodeBlob(long addr);
-
-  // Intered strings
-  public native boolean isInStringTable(String str);
-
-  // Memory
-  public native void readReservedMemory();
-  public native long allocateMetaspace(ClassLoader classLoader, long size);
-  public native void freeMetaspace(ClassLoader classLoader, long addr, long size);
-  public native long incMetaspaceCapacityUntilGC(long increment);
-  public native long metaspaceCapacityUntilGC();
-
-  // Force Young GC
-  public native void youngGC();
-
-  // Force Full GC
-  public native void fullGC();
-
-  // Method tries to start concurrent mark cycle.
-  // It returns false if CM Thread is always in concurrent cycle.
-  public native boolean g1StartConcMarkCycle();
-
-  // Tests on ReservedSpace/VirtualSpace classes
-  public native int stressVirtualSpaceResize(long reservedSpaceSize, long magnitude, long iterations);
-  public native void runMemoryUnitTests();
-  public native void readFromNoaccessArea();
-  public native long getThreadStackSize();
-  public native long getThreadRemainingStackSize();
-
-  // CPU features
-  public native String getCPUFeatures();
-
-  // Native extensions
-  public native long getHeapUsageForContext(int context);
-  public native long getHeapRegionCountForContext(int context);
-  public native int getContextForObject(Object obj);
-  public native void printRegionInfo(int context);
-
-  // VM flags
-  public native boolean isConstantVMFlag(String name);
-  public native boolean isLockedVMFlag(String name);
-  public native void    setBooleanVMFlag(String name, boolean value);
-  public native void    setIntxVMFlag(String name, long value);
-  public native void    setUintxVMFlag(String name, long value);
-  public native void    setUint64VMFlag(String name, long value);
-  public native void    setSizeTVMFlag(String name, long value);
-  public native void    setStringVMFlag(String name, String value);
-  public native void    setDoubleVMFlag(String name, double value);
-  public native Boolean getBooleanVMFlag(String name);
-  public native Long    getIntxVMFlag(String name);
-  public native Long    getUintxVMFlag(String name);
-  public native Long    getUint64VMFlag(String name);
-  public native Long    getSizeTVMFlag(String name);
-  public native String  getStringVMFlag(String name);
-  public native Double  getDoubleVMFlag(String name);
-  private final List<Function<String,Object>> flagsGetters = Arrays.asList(
-    this::getBooleanVMFlag, this::getIntxVMFlag, this::getUintxVMFlag,
-    this::getUint64VMFlag, this::getSizeTVMFlag, this::getStringVMFlag,
-    this::getDoubleVMFlag);
-
-  public Object getVMFlag(String name) {
-    return flagsGetters.stream()
-                       .map(f -> f.apply(name))
-                       .filter(x -> x != null)
-                       .findAny()
-                       .orElse(null);
-  }
-  public native int getOffsetForName0(String name);
-  public int getOffsetForName(String name) throws Exception {
-    int offset = getOffsetForName0(name);
-    if (offset == -1) {
-      throw new RuntimeException(name + " not found");
-    }
-    return offset;
-  }
-
-  // Safepoint Checking
-  public native void assertMatchingSafepointCalls(boolean mutexSafepointValue, boolean attemptedNoSafepointValue);
-}
--- a/hotspot/test/testlibrary/whitebox/sun/hotspot/code/BlobType.java	Mon Dec 22 17:33:29 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2014, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.hotspot.code;
-
-import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryPoolMXBean;
-import java.util.EnumSet;
-
-import sun.hotspot.WhiteBox;
-
-public enum BlobType {
-    // Execution level 1 and 4 (non-profiled) nmethods (including native nmethods)
-    MethodNonProfiled(0, "CodeHeap 'non-profiled nmethods'"),
-    // Execution level 2 and 3 (profiled) nmethods
-    MethodProfiled(1, "CodeHeap 'profiled nmethods'"),
-    // Non-nmethods like Buffers, Adapters and Runtime Stubs
-    NonNMethod(2, "CodeHeap 'non-nmethods'") {
-        @Override
-        public boolean allowTypeWhenOverflow(BlobType type) {
-            return super.allowTypeWhenOverflow(type)
-                    || type == BlobType.MethodNonProfiled;
-        }
-    },
-    // All types (No code cache segmentation)
-    All(3, "CodeCache");
-
-    public final int id;
-    private final String beanName;
-
-    private BlobType(int id, String beanName) {
-        this.id = id;
-        this.beanName = beanName;
-    }
-
-    public MemoryPoolMXBean getMemoryPool() {
-        for (MemoryPoolMXBean bean : ManagementFactory.getMemoryPoolMXBeans()) {
-            String name = bean.getName();
-            if (beanName.equals(name)) {
-                return bean;
-            }
-        }
-        return null;
-    }
-
-    public boolean allowTypeWhenOverflow(BlobType type) {
-        return type == this;
-    }
-
-    public static EnumSet<BlobType> getAvailable() {
-        WhiteBox whiteBox = WhiteBox.getWhiteBox();
-        if (!whiteBox.getBooleanVMFlag("SegmentedCodeCache")) {
-            // only All for non segmented world
-            return EnumSet.of(All);
-        }
-        if (System.getProperty("java.vm.info").startsWith("interpreted ")) {
-            // only NonNMethod for -Xint
-            return EnumSet.of(NonNMethod);
-        }
-
-        EnumSet<BlobType> result = EnumSet.complementOf(EnumSet.of(All));
-        if (!whiteBox.getBooleanVMFlag("TieredCompilation")
-                || whiteBox.getIntxVMFlag("TieredStopAtLevel") <= 1) {
-            // there is no MethodProfiled in non tiered world or pure C1
-            result.remove(MethodProfiled);
-        }
-        return result;
-    }
-}
--- a/hotspot/test/testlibrary/whitebox/sun/hotspot/code/CodeBlob.java	Mon Dec 22 17:33:29 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2014, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.hotspot.code;
-
-import sun.hotspot.WhiteBox;
-
-public class CodeBlob {
-  private static final WhiteBox WB = WhiteBox.getWhiteBox();
-  public static CodeBlob[] getCodeBlobs(BlobType type) {
-    Object[] obj = WB.getCodeHeapEntries(type.id);
-    if (obj == null) {
-      return null;
-    }
-    CodeBlob[] result = new CodeBlob[obj.length];
-    for (int i = 0, n = result.length; i < n; ++i) {
-      result[i] = new CodeBlob((Object[]) obj[i]);
-    }
-    return result;
-  }
-  public static CodeBlob getCodeBlob(long addr) {
-    Object[] obj = WB.getCodeBlob(addr);
-    if (obj == null) {
-      return null;
-    }
-    return new CodeBlob(obj);
-  }
-  protected CodeBlob(Object[] obj) {
-    assert obj.length == 3;
-    name = (String) obj[0];
-    size = (Integer) obj[1];
-    code_blob_type = BlobType.values()[(Integer) obj[2]];
-    assert code_blob_type.id == (Integer) obj[2];
-  }
-  public final String name;
-  public final int size;
-  public final BlobType code_blob_type;
-
-  @Override
-  public String toString() {
-    return "CodeBlob{"
-        + "name=" + name
-        + ", size=" + size
-        + ", code_blob_type=" + code_blob_type
-        + '}';
-  }
-}
--- a/hotspot/test/testlibrary/whitebox/sun/hotspot/code/NMethod.java	Mon Dec 22 17:33:29 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2014, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.hotspot.code;
-
-import java.lang.reflect.Executable;
-import sun.hotspot.WhiteBox;
-
-public class NMethod extends CodeBlob {
-  private static final WhiteBox wb = WhiteBox.getWhiteBox();
-  public static NMethod get(Executable method, boolean isOsr) {
-    Object[] obj = wb.getNMethod(method, isOsr);
-    return obj == null ? null : new NMethod(obj);
-  }
-  private NMethod(Object[] obj) {
-    super((Object[])obj[0]);
-    assert obj.length == 4;
-    comp_level = (Integer) obj[1];
-    insts = (byte[]) obj[2];
-    compile_id = (Integer) obj[3];
-  }
-  public final byte[] insts;
-  public final int comp_level;
-  public final int compile_id;
-
-  @Override
-  public String toString() {
-    return "NMethod{"
-        + super.toString()
-        + ", insts=" + insts
-        + ", comp_level=" + comp_level
-        + ", compile_id=" + compile_id
-        + '}';
-  }
-}
--- a/hotspot/test/testlibrary/whitebox/sun/hotspot/cpuinfo/CPUInfo.java	Mon Dec 22 17:33:29 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2014, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.hotspot.cpuinfo;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.regex.Pattern;
-import java.util.regex.Matcher;
-
-import sun.hotspot.WhiteBox;
-
-/**
- * Information about CPU on test box.
- *
- * CPUInfo uses WhiteBox to gather information,
- * so WhiteBox class should be added to bootclasspath
- * and option -XX:+WhiteBoxAPI should expclicetly
- * specified on command line.
- */
-public class CPUInfo {
-
-    private static final List<String> features;
-    private static final String additionalCPUInfo;
-
-    static {
-        WhiteBox wb = WhiteBox.getWhiteBox();
-
-        Pattern additionalCPUInfoRE =
-            Pattern.compile("([^(]*\\([^)]*\\)[^,]*),\\s*");
-
-        String cpuFeaturesString = wb.getCPUFeatures();
-        Matcher matcher = additionalCPUInfoRE.matcher(cpuFeaturesString);
-        if (matcher.find()) {
-            additionalCPUInfo = matcher.group(1);
-        } else {
-            additionalCPUInfo = "";
-        }
-        String splittedFeatures[] = matcher.replaceAll("").split("(, )| ");
-
-        features = Collections.unmodifiableList(Arrays.
-                                                asList(splittedFeatures));
-    }
-
-    /**
-     * Get additional information about CPU.
-     * For example, on X86 in will be family/model/stepping
-     * and number of cores.
-     *
-     * @return additional CPU info
-     */
-    public static String getAdditionalCPUInfo() {
-        return additionalCPUInfo;
-    }
-
-    /**
-     * Get all known features supported by CPU.
-     *
-     * @return unmodifiable list with names of all known features
-     *         supported by CPU.
-     */
-    public static List<String> getFeatures() {
-        return features;
-    }
-
-    /**
-     * Check if some feature is supported by CPU.
-     *
-     * @param feature Name of feature to be tested.
-     * @return <b>true</b> if tested feature is supported by CPU.
-     */
-    public static boolean hasFeature(String feature) {
-        return features.contains(feature.toLowerCase());
-    }
-}
--- a/hotspot/test/testlibrary/whitebox/sun/hotspot/parser/DiagnosticCommand.java	Mon Dec 22 17:33:29 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.hotspot.parser;
-
-public class DiagnosticCommand {
-
-    public enum DiagnosticArgumentType {
-        JLONG, BOOLEAN, STRING, NANOTIME, STRINGARRAY, MEMORYSIZE
-    }
-
-    private String name;
-    private String desc;
-    private DiagnosticArgumentType type;
-    private boolean mandatory;
-    private String defaultValue;
-    private boolean argument;
-
-    public DiagnosticCommand(String name, String desc, DiagnosticArgumentType type,
-            boolean mandatory, String defaultValue) {
-        this(name, desc, type, false, mandatory, defaultValue);
-    }
-
-    public DiagnosticCommand(String name, String desc, DiagnosticArgumentType type,
-            boolean argument, boolean mandatory, String defaultValue) {
-        this.name = name;
-        this.desc = desc;
-        this.type = type;
-        this.mandatory = mandatory;
-        this.defaultValue = defaultValue;
-        this.argument = argument;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public String getDesc() {
-        return desc;
-    }
-
-    public DiagnosticArgumentType getType() {
-        return type;
-    }
-
-    public boolean isMandatory() {
-        return mandatory;
-    }
-
-    public boolean isArgument() {
-        return argument;
-    }
-
-    public String getDefaultValue() {
-        return defaultValue;
-    }
-}
--- a/hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8012447
- * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
+ * @library /testlibrary /../../test/lib /testlibrary/ctw/src
  * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary_tests/ctw/ClassesListTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary_tests/ctw/ClassesListTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8012447
- * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
+ * @library /testlibrary /../../test/lib /testlibrary/ctw/src
  * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary_tests/ctw/JarDirTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary_tests/ctw/JarDirTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8012447
- * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
+ * @library /testlibrary /../../test/lib /testlibrary/ctw/src
  * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary_tests/ctw/JarsTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary_tests/ctw/JarsTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8012447
- * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
+ * @library /testlibrary /../../test/lib /testlibrary/ctw/src
  * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test BooleanTest
  * @bug 8028756
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build BooleanTest ClassFileInstaller sun.hotspot.WhiteBox com.oracle.java.testlibrary.*
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test DoubleTest
  * @bug 8028756
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build DoubleTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/IntxTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/IntxTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test IntxTest
  * @bug 8028756
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build IntxTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/SizeTTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/SizeTTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test SizeTTest
  * @bug 8054823
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build SizeTTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/StringTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/StringTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test StringTest
  * @bug 8028756
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build StringTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/Uint64Test.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/Uint64Test.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test Uint64Test
  * @bug 8028756
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build Uint64Test
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/UintxTest.java	Mon Dec 22 17:33:29 2014 +0100
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/UintxTest.java	Mon Jan 05 15:00:30 2015 +0100
@@ -24,7 +24,7 @@
 /*
  * @test UintxTest
  * @bug 8028756
- * @library /testlibrary /testlibrary/whitebox
+ * @library /testlibrary /../../test/lib
  * @build UintxTest
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  *                              sun.hotspot.WhiteBox$WhiteBoxPermission