changeset 3662:aca25e0c3da5

Merge from main jdk7u6 OpenJDK repository
author Greg Lewis <glewis@eyesbeyond.com>
date Sun, 12 Aug 2012 15:23:07 -0700
parents 0813fa17749b cffde29ea7cc
children b0a63b9ba3e5
files .hgtags agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java make/Makefile make/linux/makefiles/defs.make make/solaris/makefiles/defs.make make/windows/makefiles/defs.make src/cpu/x86/vm/c1_LIRAssembler_x86.cpp src/cpu/x86/vm/vm_version_x86.cpp src/os/bsd/vm/attachListener_bsd.cpp src/os/bsd/vm/osThread_bsd.cpp src/os/bsd/vm/osThread_bsd.hpp src/os/bsd/vm/os_bsd.cpp src/os/linux/vm/os_linux.cpp src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp src/share/vm/classfile/javaClasses.cpp src/share/vm/prims/jni.cpp src/share/vm/runtime/arguments.cpp src/share/vm/runtime/globals.hpp src/share/vm/runtime/os.hpp src/share/vm/runtime/safepoint.cpp src/share/vm/utilities/globalDefinitions_gcc.hpp src/share/vm/utilities/vmError.cpp
diffstat 150 files changed, 35488 insertions(+), 1030 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Sat Aug 04 10:30:57 2012 -0700
+++ b/.hgtags	Sun Aug 12 15:23:07 2012 -0700
@@ -267,6 +267,7 @@
 931e5f39e365a0d550d79148ff87a7f9e864d2e1 hs23-b16
 efb5f2662c96c472caa3327090268c75a86dd9c0 jdk7u4-b13
 82e719a2e6416838b4421637646cbfd7104c7716 jdk7u4-b14
+e5f7f95411fb9e837800b4152741c962118e5d7a jdk7u5-b01
 1c483d994a78e46c4656b6f3773c7014346d0f19 jdk7u4-b15
 34a4f7687460b1b2bfb1d87191919c5f101aa988 hs23-b17
 c6a96f7a781dd23d2b9fd6353fcd87493616c803 jdk7u4-b16
@@ -282,3 +283,40 @@
 93ec23d55b87d46bada8f32b84eb67b427436858 jdk7u4-b21
 1eb9f79307a83f967359c00c56a63d0cf5f36b12 jdk7u4-b22
 aed9d0f0f050f8676dbc4541f0ecd28920f2bb09 jdk7u4-b31
+dc978aca3cebf9633b2c556532c597865d1bb3d9 jdk7u5-b02
+6024bdfed9bfe372a6758701a501f35af16a281c jdk7u5-b04
+42ee6a26a5438c792ba304613e9c6a2c82ad88a8 jdk7u5-b05
+6434cb74457e50a211f6a9dd2629dcd0d5068a73 jdk7u5-b30
+82e719a2e6416838b4421637646cbfd7104c7716 jdk7u6-b01
+6b71938ee832043c337aa837fc0eb3bef088fd52 jdk7u6-b02
+bca9e76ea25409d97d5b0c8f788e673e9cf49a09 jdk7u6-b03
+b82c43fba5c0d219568ebabfa48a5e62c07467af jdk7u6-b04
+77b43af50556ed9da98efcda9875ee112fcad66b jdk7u6-b05
+be1d97cdee46fd6ba7192eeefd6fa9bfd4988c22 jdk7u6-b06
+144f8a1a43cb9e0656d1265b42a934baf552f454 jdk7u6-b07
+6b668c1049a8910aabc9d23345d357f20fa24714 jdk7u6-b08
+94d7a305da4dcf46049efd81c2afca512d2afa7f jdk7u6-b09
+1fcba869fe4a932616067e051565590ff375a63b hs23.2-b01
+702b62a5e1a546ba5eea17619f9056a86fec03f1 jdk7u6-b10
+b7ae1ee1d2e49bbfbcf35587cb51c04abf2710a2 hs23.2-b02
+5921bdc6ce5cd9e3511a4177f9995becb2c2981d jdk7u6-b11
+e974e15945658e574e6c344c4a7ba225f5708c10 hs23.2-b03
+f08a3a0e60c32cb0e8350e72fdc54849759096a4 jdk7u6-b12
+7a8d3cd6562170f4c262e962270f679ac503f456 hs23.2-b04
+28746e6d615f27816f483485a53b790c7a463f0c jdk7u6-b13
+202880d633e646d4936798d0fba6efc0cab04dc8 hs23.2-b05
+6b0f178141388f5721aa5365cb542715acbf0cc7 jdk7u6-b14
+ced728021cf5402205a0bb25e3d85c2bf2dc55f0 jdk7u6-b15
+7871a1b632cb17784de4f2afb0102702809a66f9 hs23.2-b06
+d1c1573de6ca46d9a386e6a0cc84ac7d716253fc hs23.2-b07
+cefe884c708aa6dfd63aff45f6c698a6bc346791 jdk7u6-b16
+270a40a57b3d05ca64070208dcbb895b5b509d8e hs23.2-b08
+7a37cec9d0d44ae6ea3d26a95407e42d99af6843 jdk7u6-b17
+df0df4ae5af2f40b7f630c53a86e8c3d68ef5b66 jdk7u6-b18
+1257f4373a06f788bd656ae1c7a953a026a285b9 jdk7u6-b19
+a0c2fa4baeb6aad6f33dc87b676b21345794d61e hs23.2-b09
+1e31ae50c2cff8e7945ab8696d4d91f7f83d5d18 jdk7u6-b20
+02a6c89432d724119565f9ba25672829b136fc5f jdk7u6-b21
+a79d86eef6ac995a1fc35554f082f3a61abe9ae0 jdk7u6-b22
+df57f6208cb76b4e8d1a0bd0eea3d2ad577cb79b jdk7u6-b23
+b03c2687fb16514652e79261ad68d2c601dcee62 jdk7u6-b24
--- a/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java	Sun Aug 12 15:23:07 2012 -0700
@@ -573,10 +573,10 @@
 
         if (cpu.equals("x86")) {
             machDesc = new MachineDescriptionIntelX86();
-        } else if (cpu.equals("amd64")) {
+        } else if (cpu.equals("amd64") || cpu.equals("x86_64")) {
             machDesc = new MachineDescriptionAMD64();
         } else {
-            throw new DebuggerException("BSD only supported on x86/amd64");
+            throw new DebuggerException("BSD only supported on x86/x86_64. Current arch: " + cpu);
         }
 
         BsdDebuggerLocal dbg = new BsdDebuggerLocal(machDesc, !isServer);
--- a/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpot.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpot.java	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
@@ -657,7 +657,7 @@
     while (fr != null) {
       trace.add(new StackTraceEntry(fr, getCDebugger()));
       try {
-        fr = fr.sender();
+        fr = fr.sender(t);
       } catch (AddressException e) {
         e.printStackTrace();
         showMessageDialog("Error while walking stack; stack trace will be truncated\n(see console for details)",
--- a/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java	Sun Aug 12 15:23:07 2012 -0700
@@ -763,10 +763,10 @@
 
         if (cpu.equals("x86")) {
             machDesc = new MachineDescriptionIntelX86();
-        } else if (cpu.equals("amd64")) {
+        } else if (cpu.equals("amd64") || (cpu.equals("x86_64"))) {
             machDesc = new MachineDescriptionAMD64();
         } else {
-            throw new DebuggerException("Bsd only supported on x86/amd64");
+            throw new DebuggerException("Bsd only supported on x86/x86_64. Current arch: " + cpu);
         }
 
         // Note we do not use a cache for the local debugger in server
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java	Sun Aug 12 15:23:07 2012 -0700
@@ -90,7 +90,7 @@
        Address pc  = context.getRegisterAsAddress(X86ThreadContext.EIP);
        if (pc == null) return null;
        return new BsdX86CFrame(dbg, ebp, pc);
-    } else if (cpu.equals("amd64")) {
+    } else if (cpu.equals("amd64") || cpu.equals("x86_64")) {
        AMD64ThreadContext context = (AMD64ThreadContext) thread.getContext();
        Address rbp = context.getRegisterAsAddress(AMD64ThreadContext.RBP);
        if (rbp == null) return null;
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java	Sun Aug 12 15:23:07 2012 -0700
@@ -33,7 +33,7 @@
       String cpu = dbg.getCPU();
       if (cpu.equals("x86")) {
          return new BsdX86ThreadContext(dbg);
-      } else if (cpu.equals("amd64")) {
+      } else if (cpu.equals("amd64") || cpu.equals("x86_64")) {
          return new BsdAMD64ThreadContext(dbg);
       } else {
          throw new RuntimeException("cpu " + cpu + " is not yet supported");
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 package sun.jvm.hotspot.debugger.bsd.amd64;
 
 import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.amd64.*;
 import sun.jvm.hotspot.debugger.bsd.*;
 import sun.jvm.hotspot.debugger.cdbg.*;
 import sun.jvm.hotspot.debugger.cdbg.basic.*;
@@ -51,8 +52,11 @@
       return rbp;
    }
 
-   public CFrame sender() {
-      if (rbp == null) {
+   public CFrame sender(ThreadProxy thread) {
+      AMD64ThreadContext context = (AMD64ThreadContext) thread.getContext();
+      Address rsp = context.getRegisterAsAddress(AMD64ThreadContext.RSP);
+
+      if ( (rbp == null) || rbp.lessThan(rsp) ) {
         return null;
       }
 
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -28,6 +28,7 @@
 import sun.jvm.hotspot.debugger.bsd.*;
 import sun.jvm.hotspot.debugger.cdbg.*;
 import sun.jvm.hotspot.debugger.cdbg.basic.*;
+import sun.jvm.hotspot.debugger.x86.*;
 
 final public class BsdX86CFrame extends BasicCFrame {
    // package/class internals only
@@ -52,8 +53,11 @@
       return ebp;
    }
 
-   public CFrame sender() {
-      if (ebp == null) {
+   public CFrame sender(ThreadProxy thread) {
+      X86ThreadContext context = (X86ThreadContext) thread.getContext();
+      Address esp = context.getRegisterAsAddress(X86ThreadContext.ESP);
+
+      if ( (ebp == null) || ebp.lessThan(esp) ) {
         return null;
       }
 
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
@@ -34,7 +34,7 @@
 
 public interface CFrame {
   /** Returns null when no more frames on stack */
-  public CFrame sender();
+  public CFrame sender(ThreadProxy th);
 
   /** Get the program counter of this frame */
   public Address pc();
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/amd64/AMD64CFrame.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/amd64/AMD64CFrame.java	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 package sun.jvm.hotspot.debugger.cdbg.basic.amd64;
 
 import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.amd64.*;
 import sun.jvm.hotspot.debugger.cdbg.*;
 import sun.jvm.hotspot.debugger.cdbg.basic.*;
 
@@ -43,8 +44,11 @@
     this.pc  = pc;
   }
 
-  public CFrame sender() {
-    if (rbp == null) {
+  public CFrame sender(ThreadProxy thread) {
+    AMD64ThreadContext context = (AMD64ThreadContext) thread.getContext();
+    Address rsp = context.getRegisterAsAddress(AMD64ThreadContext.RSP);
+
+    if ( (rbp == null) || rbp.lessThan(rsp) ) {
       return null;
     }
 
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/x86/X86CFrame.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/x86/X86CFrame.java	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 package sun.jvm.hotspot.debugger.cdbg.basic.x86;
 
 import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.x86.*;
 import sun.jvm.hotspot.debugger.cdbg.*;
 import sun.jvm.hotspot.debugger.cdbg.basic.*;
 
@@ -43,8 +44,11 @@
     this.pc  = pc;
   }
 
-  public CFrame sender() {
-    if (ebp == null) {
+  public CFrame sender(ThreadProxy thread) {
+    X86ThreadContext context = (X86ThreadContext) thread.getContext();
+    Address esp = context.getRegisterAsAddress(X86ThreadContext.ESP);
+
+    if ( (ebp == null) || ebp.lessThan(esp) ) {
       return null;
     }
 
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
 package sun.jvm.hotspot.debugger.linux.amd64;
 
 import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.debugger.amd64.*;
 import sun.jvm.hotspot.debugger.linux.*;
 import sun.jvm.hotspot.debugger.cdbg.*;
 import sun.jvm.hotspot.debugger.cdbg.basic.*;
@@ -51,8 +52,11 @@
       return rbp;
    }
 
-   public CFrame sender() {
-      if (rbp == null) {
+   public CFrame sender(ThreadProxy thread) {
+      AMD64ThreadContext context = (AMD64ThreadContext) thread.getContext();
+      Address rsp = context.getRegisterAsAddress(AMD64ThreadContext.RSP);
+
+      if ( (rbp == null) || rbp.lessThan(rsp) ) {
         return null;
       }
 
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2012, 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
@@ -57,7 +57,7 @@
       return sp;
    }
 
-   public CFrame sender() {
+   public CFrame sender(ThreadProxy thread) {
       if (sp == null) {
         return null;
       }
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -28,6 +28,7 @@
 import sun.jvm.hotspot.debugger.linux.*;
 import sun.jvm.hotspot.debugger.cdbg.*;
 import sun.jvm.hotspot.debugger.cdbg.basic.*;
+import sun.jvm.hotspot.debugger.x86.*;
 
 final public class LinuxX86CFrame extends BasicCFrame {
    // package/class internals only
@@ -52,8 +53,11 @@
       return ebp;
    }
 
-   public CFrame sender() {
-      if (ebp == null) {
+   public CFrame sender(ThreadProxy thread) {
+      X86ThreadContext context = (X86ThreadContext) thread.getContext();
+      Address esp = context.getRegisterAsAddress(X86ThreadContext.ESP);
+
+      if ( (ebp == null) || ebp.lessThan(esp) ) {
         return null;
       }
 
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -37,7 +37,7 @@
       return fp;
    }
 
-   public CFrame sender() {
+   public CFrame sender(ThreadProxy t) {
       return sender;
    }
 
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java	Sun Aug 12 15:23:07 2012 -0700
@@ -81,7 +81,7 @@
             pcRegIndex = X86ThreadContext.EIP;
             fpRegIndex = X86ThreadContext.EBP;
             unalignedAccessesOkay = true;
-        } else if (cpu.equals("amd64")) {
+        } else if (cpu.equals("amd64") || cpu.equals("x86_64")) {
             threadFactory = new ProcAMD64ThreadFactory(this);
             pcRegIndex = AMD64ThreadContext.RIP;
             fpRegIndex = AMD64ThreadContext.RBP;
--- a/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java	Sun Aug 12 15:23:07 2012 -0700
@@ -64,7 +64,7 @@
         cachePageSize = 4096;
         cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize);
         unalignedAccessesOkay = true;
-      } else if (cpu.equals("amd64")) {
+      } else if (cpu.equals("amd64") || cpu.equals("x86_64")) {
         threadFactory = new RemoteAMD64ThreadFactory(this);
         cachePageSize = 4096;
         cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize);
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -141,18 +141,19 @@
   public static String stringOopToString(Oop stringOop) {
     if (offsetField == null) {
       InstanceKlass k = (InstanceKlass) stringOop.getKlass();
-      offsetField = (IntField) k.findField("offset", "I");
-      countField  = (IntField) k.findField("count",  "I");
+      offsetField = (IntField) k.findField("offset", "I");   // optional
+      countField  = (IntField) k.findField("count",  "I");   // optional
       valueField  = (OopField) k.findField("value",  "[C");
       if (Assert.ASSERTS_ENABLED) {
-        Assert.that(offsetField != null &&
-                    countField != null &&
-                    valueField != null, "must find all java.lang.String fields");
+         Assert.that(valueField != null, "Field \'value\' of java.lang.String not found");
       }
     }
-    return charArrayToString((TypeArray) valueField.getValue(stringOop),
-                             offsetField.getValue(stringOop),
-                             countField.getValue(stringOop));
+    if (offsetField != null && countField != null) {
+      return charArrayToString((TypeArray) valueField.getValue(stringOop),
+                               offsetField.getValue(stringOop),
+                               countField.getValue(stringOop));
+    }
+    return  charArrayToString((TypeArray) valueField.getValue(stringOop));
   }
 
   public static String stringOopToEscapedString(Oop stringOop) {
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java	Sun Aug 12 15:23:07 2012 -0700
@@ -95,7 +95,7 @@
         } else if (os.equals("bsd")) {
             if (cpu.equals("x86")) {
                 access = new BsdX86JavaThreadPDAccess();
-            } else if (cpu.equals("amd64")) {
+            } else if (cpu.equals("amd64") || cpu.equals("x86_64")) {
                 access = new BsdAMD64JavaThreadPDAccess();
             }
         }
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -158,7 +158,7 @@
                         printUnknown(out);
                      }
                   }
-                  f = f.sender();
+                  f = f.sender(th);
                }
             } catch (Exception exp) {
                exp.printStackTrace();
--- a/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java	Sun Aug 12 15:23:07 2012 -0700
@@ -199,7 +199,7 @@
          cpuHelper = new SPARCHelper();
       } else if (cpu.equals("x86")) {
          cpuHelper = new X86Helper();
-      } else if (cpu.equals("amd64")) {
+      } else if (cpu.equals("amd64") || cpu.equals("x86_64")) {
          cpuHelper = new AMD64Helper();
       } else if (cpu.equals("ia64")) {
          cpuHelper = new IA64Helper();
--- a/agent/src/share/classes/sun/jvm/hotspot/utilities/ObjectReader.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/utilities/ObjectReader.java	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -85,6 +85,21 @@
       this(new ProcImageClassLoader());
    }
 
+   static void debugPrintln(String msg) {
+      if (DEBUG) {
+         System.err.println("DEBUG>" + msg);
+      }
+   }
+
+   static void debugPrintStackTrace(Exception exp) {
+      if (DEBUG) {
+         StackTraceElement[] els = exp.getStackTrace();
+         for (int i = 0; i < els.length; i++) {
+            System.err.println("DEBUG>" + els[i].toString());
+         }
+      }
+   }
+
    public Object readObject(Oop oop) throws ClassNotFoundException {
       if (oop instanceof Instance) {
          return readInstance((Instance) oop);
@@ -120,13 +135,96 @@
    }
 
    protected Symbol javaLangString;
+   protected Symbol javaUtilHashtableEntry;
+   protected Symbol javaUtilHashtable;
+   protected Symbol javaUtilProperties;
+
+   protected Symbol getVMSymbol(String name) {
+      return VM.getVM().getSymbolTable().probe(name);
+   }
+
    protected Symbol javaLangString() {
       if (javaLangString == null) {
-         javaLangString = VM.getVM().getSymbolTable().probe("java/lang/String");
+         javaLangString = getVMSymbol("java/lang/String");
       }
       return javaLangString;
    }
 
+   protected Symbol javaUtilHashtableEntry() {
+      if (javaUtilHashtableEntry == null) {
+         javaUtilHashtableEntry = getVMSymbol("java/util/Hashtable$Entry");
+      }
+      return javaUtilHashtableEntry;
+   }
+
+   protected Symbol javaUtilHashtable() {
+      if (javaUtilHashtable == null) {
+         javaUtilHashtable = getVMSymbol("java/util/Hashtable");
+      }
+      return javaUtilHashtable;
+   }
+
+   protected Symbol javaUtilProperties() {
+      if (javaUtilProperties == null) {
+         javaUtilProperties = getVMSymbol("java/util/Properties");
+      }
+      return javaUtilProperties;
+   }
+
+   private void setHashtableEntry(java.util.Hashtable p, Oop oop) {
+      InstanceKlass ik = (InstanceKlass)oop.getKlass();
+      OopField keyField = (OopField)ik.findField("key", "Ljava/lang/Object;");
+      OopField valueField = (OopField)ik.findField("value", "Ljava/lang/Object;");
+      OopField nextField = (OopField)ik.findField("next", "Ljava/util/Hashtable$Entry;");
+      if (DEBUG) {
+         if (Assert.ASSERTS_ENABLED) {
+            Assert.that(ik.getName().equals(javaUtilHashtableEntry()), "Not a Hashtable$Entry?");
+            Assert.that(keyField != null && valueField != null && nextField != null, "Invalid fields!");
+         }
+      }
+
+      Object key = null;
+      Object value = null;
+      Oop next = null;
+      try {
+         key = readObject(keyField.getValue(oop));
+         value = readObject(valueField.getValue(oop));
+         next =  (Oop)nextField.getValue(oop);
+         // For Properties, should use setProperty(k, v). Since it only runs in SA
+         // using put(k, v) should be OK.
+         p.put(key, value);
+         if (next != null) {
+            setHashtableEntry(p, next);
+         }
+      } catch (ClassNotFoundException ce) {
+         if( DEBUG) {
+            debugPrintln("Class not found " + ce);
+            debugPrintStackTrace(ce);
+         }
+      }
+   }
+
+   protected Object getHashtable(Instance oop, boolean isProperties) {
+      InstanceKlass k = (InstanceKlass)oop.getKlass();
+      OopField tableField = (OopField)k.findField("table", "[Ljava/util/Hashtable$Entry;");
+      if (tableField == null) {
+         debugPrintln("Could not find field of [Ljava/util/Hashtable$Entry;");
+         return null;
+      }
+      java.util.Hashtable table = (isProperties) ? new java.util.Properties()
+                                                 : new java.util.Hashtable();
+      ObjArray kvs = (ObjArray)tableField.getValue(oop);
+      long size = kvs.getLength();
+      debugPrintln("Hashtable$Entry Size = " + size);
+      for (long i=0; i<size; i++) {
+         Oop entry = kvs.getObjAt(i);
+         if (entry != null && entry.isInstance()) {
+            setHashtableEntry(table, entry);
+         }
+      }
+      return table;
+   }
+
    public Object readInstance(Instance oop) throws ClassNotFoundException {
       Object result = getFromObjTable(oop);
       if (result == null) {
@@ -134,11 +232,21 @@
          // Handle java.lang.String instances differently. As part of JSR-133, fields of immutable
          // classes have been made final. The algorithm below will not be able to read Strings from
          // debuggee (can't use reflection to set final fields). But, need to read Strings is very
-         // important. FIXME: need a framework to handle many other special cases.
+         // important.
+         // Same for Hashtable, key and hash are final, could not be set in the algorithm too.
+         // FIXME: need a framework to handle many other special cases.
          if (kls.getName().equals(javaLangString())) {
             return OopUtilities.stringOopToString(oop);
          }
 
+         if (kls.getName().equals(javaUtilHashtable())) {
+            return getHashtable(oop, false);
+         }
+
+         if (kls.getName().equals(javaUtilProperties())) {
+            return getHashtable(oop, true);
+         }
+
          Class clz = readClass(kls);
          try {
             result = clz.newInstance();
@@ -164,8 +272,8 @@
                   break;
                } catch (Exception exp) {
                   if (DEBUG) {
-                     System.err.println("Can't create object using " + c);
-                     exp.printStackTrace();
+                     debugPrintln("Can't create object using " + c);
+                     debugPrintStackTrace(exp);
                   }
                }
             }
@@ -329,8 +437,8 @@
                                      arrayObj[ifd.getIndex()] = readObject(field.getValue(getObj()));
                                   } catch (Exception e) {
                                      if (DEBUG) {
-                                        System.err.println("Array element set failed for " + ifd);
-                                        e.printStackTrace();
+                                        debugPrintln("Array element set failed for " + ifd);
+                                        debugPrintStackTrace(e);
                                      }
                                   }
                                }
@@ -348,8 +456,8 @@
 
       private void printFieldSetError(java.lang.reflect.Field f, Exception ex) {
          if (DEBUG) {
-            if (f != null) System.err.println("Field set failed for " + f);
-            ex.printStackTrace();
+            if (f != null) debugPrintln("Field set failed for " + f);
+            debugPrintStackTrace(ex);
          }
       }
 
@@ -601,7 +709,7 @@
             return Class.forName(className, true, cl);
          } catch (Exception e) {
             if (DEBUG) {
-               System.err.println("Can't load class " + className);
+               debugPrintln("Can't load class " + className);
             }
             throw new RuntimeException(e);
          }
--- a/make/Makefile	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/Makefile	Sun Aug 12 15:23:07 2012 -0700
@@ -136,31 +136,36 @@
 ifeq ($(OSNAME),windows)
 	@$(ECHO) "No docs ($(VM_TARGET)) for windows"
 else
+# We specify 'BUILD_FLAVOR=product' so that the proper
+# ENABLE_FULL_DEBUG_SYMBOLS value is used.
 	$(CD) $(OUTPUTDIR); \
 	    $(MAKE) -f $(ABS_OS_MAKEFILE) \
-		      $(MAKE_ARGS) docs
+		      $(MAKE_ARGS) BUILD_FLAVOR=product docs
 endif
 
 # Build variation of hotspot
 $(C1_VM_TARGETS):
 	$(CD) $(GAMMADIR)/make; \
-	$(MAKE) VM_TARGET=$@ generic_build1 $(ALT_OUT)
+	$(MAKE) BUILD_FLAVOR=$(@:%1=%) VM_TARGET=$@ generic_build1 $(ALT_OUT)
 
 $(C2_VM_TARGETS):
 	$(CD) $(GAMMADIR)/make; \
-	$(MAKE) VM_TARGET=$@ generic_build2 $(ALT_OUT)
+	$(MAKE) BUILD_FLAVOR=$@ VM_TARGET=$@ generic_build2 $(ALT_OUT)
 
 $(KERNEL_VM_TARGETS):
 	$(CD) $(GAMMADIR)/make; \
-	$(MAKE) VM_TARGET=$@ generic_buildkernel $(ALT_OUT)
+	$(MAKE) BUILD_FLAVOR=$(@:%kernel=%) VM_TARGET=$@ \
+	  generic_buildkernel $(ALT_OUT)
 
 $(ZERO_VM_TARGETS):
 	$(CD) $(GAMMADIR)/make; \
-	$(MAKE) VM_TARGET=$@ generic_buildzero $(ALT_OUT)
+	$(MAKE) BUILD_FLAVOR=$(@:%zero=%) VM_TARGET=$@ \
+	  generic_buildzero $(ALT_OUT)
 
 $(SHARK_VM_TARGETS):
 	$(CD) $(GAMMADIR)/make; \
-	$(MAKE) VM_TARGET=$@ generic_buildshark $(ALT_OUT)
+	$(MAKE) BUILD_FLAVOR=$(@:%shark=%) VM_TARGET=$@ \
+	  generic_buildshark $(ALT_OUT)
 
 # Build compiler1 (client) rule, different for platforms
 generic_build1:
@@ -237,25 +242,37 @@
 # Export file rule
 generic_export: $(EXPORT_LIST)
 export_product:
-	$(MAKE) VM_SUBDIR=product                            generic_export
+	$(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \
+          generic_export
 export_fastdebug:
-	$(MAKE) VM_SUBDIR=fastdebug EXPORT_SUBDIR=/fastdebug generic_export
+	$(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \
+	  EXPORT_SUBDIR=/$(@:export_%=%) \
+	  generic_export
 export_debug:
-	$(MAKE) VM_SUBDIR=${VM_DEBUG} EXPORT_SUBDIR=/debug   generic_export
+	$(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=${VM_DEBUG} \
+	  EXPORT_SUBDIR=/$(@:export_%=%) \
+	  generic_export
 export_optimized:
-	$(MAKE) VM_SUBDIR=optimized EXPORT_SUBDIR=/optimized generic_export
+	$(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \
+	  EXPORT_SUBDIR=/$(@:export_%=%) \
+	  generic_export
 export_product_jdk::
-	$(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
-		VM_SUBDIR=product                            generic_export
+	$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) \
+	  VM_SUBDIR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
+	  generic_export
 export_optimized_jdk::
-	$(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
-		VM_SUBDIR=optimized                          generic_export
+	$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) \
+	  VM_SUBDIR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
+	  generic_export
 export_fastdebug_jdk::
-	$(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/fastdebug \
-		VM_SUBDIR=fastdebug                          generic_export
+	$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) \
+	  VM_SUBDIR=$(@:export_%_jdk=%)  \
+	  ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) \
+	  generic_export
 export_debug_jdk::
-	$(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/debug \
-		VM_SUBDIR=${VM_DEBUG}                        generic_export
+	$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) VM_SUBDIR=${VM_DEBUG} \
+	  ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) \
+	  generic_export
 
 # Export file copy rules
 XUSAGE=$(HS_SRC_DIR)/share/vm/Xusage.txt
@@ -298,6 +315,8 @@
 	$(install-file)
 
 # Other libraries (like SA)
+$(EXPORT_JRE_BIN_DIR)/%.diz: $(MISC_DIR)/%.diz
+	$(install-file)
 $(EXPORT_JRE_BIN_DIR)/%.dll: $(MISC_DIR)/%.dll
 	$(install-file)
 $(EXPORT_JRE_BIN_DIR)/%.pdb: $(MISC_DIR)/%.pdb
@@ -306,6 +325,8 @@
 	$(install-file)
 
 # Client files always come from C1 area
+$(EXPORT_CLIENT_DIR)/%.diz:  $(C1_DIR)/%.diz
+	$(install-file)
 $(EXPORT_CLIENT_DIR)/%.dll:  $(C1_DIR)/%.dll
 	$(install-file)
 $(EXPORT_CLIENT_DIR)/%.pdb:  $(C1_DIR)/%.pdb
@@ -314,6 +335,8 @@
 	$(install-file)
 
 # Server files always come from C2 area
+$(EXPORT_SERVER_DIR)/%.diz:  $(C2_DIR)/%.diz
+	$(install-file)
 $(EXPORT_SERVER_DIR)/%.dll:  $(C2_DIR)/%.dll
 	$(install-file)
 $(EXPORT_SERVER_DIR)/%.pdb:  $(C2_DIR)/%.pdb
@@ -322,6 +345,8 @@
 	$(install-file)
 
 # Kernel files always come from kernel area
+$(EXPORT_KERNEL_DIR)/%.diz:  $(KERNEL_DIR)/%.diz
+	$(install-file)
 $(EXPORT_KERNEL_DIR)/%.dll:  $(KERNEL_DIR)/%.dll
 	$(install-file)
 $(EXPORT_KERNEL_DIR)/%.pdb:  $(KERNEL_DIR)/%.pdb
@@ -371,6 +396,20 @@
 	$(install-file)
 $(EXPORT_SERVER_DIR)/64/%.debuginfo:    $(C2_DIR)/%.debuginfo
 	$(install-file)
+
+# ZIP'ed debug info for shared library
+$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C1_DIR)/%.diz
+	$(install-file)
+$(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(C2_DIR)/%.diz
+	$(install-file)
+$(EXPORT_CLIENT_DIR)/%.diz:       $(C1_DIR)/%.diz
+	$(install-file)
+$(EXPORT_CLIENT_DIR)/64/%.diz:    $(C1_DIR)/%.diz
+	$(install-file)
+$(EXPORT_SERVER_DIR)/%.diz:       $(C2_DIR)/%.diz
+	$(install-file)
+$(EXPORT_SERVER_DIR)/64/%.diz:    $(C2_DIR)/%.diz
+	$(install-file)
   endif
 endif
 
--- a/make/hotspot_version	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/hotspot_version	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 # 
-# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2012, 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
@@ -31,11 +31,11 @@
 #
 
 # Don't put quotes (fail windows build).
-HOTSPOT_VM_COPYRIGHT=Copyright 2011
+HOTSPOT_VM_COPYRIGHT=Copyright 2012
 
 HS_MAJOR_VER=23
-HS_MINOR_VER=0
-HS_BUILD_NUMBER=21
+HS_MINOR_VER=2
+HS_BUILD_NUMBER=09
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=7
--- a/make/jprt.properties	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/jprt.properties	Sun Aug 12 15:23:07 2012 -0700
@@ -38,7 +38,7 @@
 
 # This tells jprt what default release we want to build
 
-jprt.hotspot.default.release=jdk7u4
+jprt.hotspot.default.release=jdk7u6
 
 jprt.tools.default.release=${jprt.submit.option.release?${jprt.submit.option.release}:${jprt.hotspot.default.release}}
 
@@ -54,72 +54,77 @@
 # Define the Solaris platforms we want for the various releases
 jprt.my.solaris.sparc.jdk8=solaris_sparc_5.10
 jprt.my.solaris.sparc.jdk7=solaris_sparc_5.10
-jprt.my.solaris.sparc.jdk7u4=${jprt.my.solaris.sparc.jdk7}
+jprt.my.solaris.sparc.jdk7u6=${jprt.my.solaris.sparc.jdk7}
 jprt.my.solaris.sparc=${jprt.my.solaris.sparc.${jprt.tools.default.release}}
 
 jprt.my.solaris.sparcv9.jdk8=solaris_sparcv9_5.10
 jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10
-jprt.my.solaris.sparcv9.jdk7u4=${jprt.my.solaris.sparcv9.jdk7}
+jprt.my.solaris.sparcv9.jdk7u6=${jprt.my.solaris.sparcv9.jdk7}
 jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}}
 
 jprt.my.solaris.i586.jdk8=solaris_i586_5.10
 jprt.my.solaris.i586.jdk7=solaris_i586_5.10
-jprt.my.solaris.i586.jdk7u4=${jprt.my.solaris.i586.jdk7}
+jprt.my.solaris.i586.jdk7u6=${jprt.my.solaris.i586.jdk7}
 jprt.my.solaris.i586=${jprt.my.solaris.i586.${jprt.tools.default.release}}
 
 jprt.my.solaris.x64.jdk8=solaris_x64_5.10
 jprt.my.solaris.x64.jdk7=solaris_x64_5.10
-jprt.my.solaris.x64.jdk7u4=${jprt.my.solaris.x64.jdk7}
+jprt.my.solaris.x64.jdk7u6=${jprt.my.solaris.x64.jdk7}
 jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}}
 
 jprt.my.linux.i586.jdk8=linux_i586_2.6
 jprt.my.linux.i586.jdk7=linux_i586_2.6
-jprt.my.linux.i586.jdk7u4=${jprt.my.linux.i586.jdk7}
+jprt.my.linux.i586.jdk7u6=${jprt.my.linux.i586.jdk7}
 jprt.my.linux.i586=${jprt.my.linux.i586.${jprt.tools.default.release}}
 
 jprt.my.linux.x64.jdk8=linux_x64_2.6
 jprt.my.linux.x64.jdk7=linux_x64_2.6
-jprt.my.linux.x64.jdk7u4=${jprt.my.linux.x64.jdk7}
+jprt.my.linux.x64.jdk7u6=${jprt.my.linux.x64.jdk7}
 jprt.my.linux.x64=${jprt.my.linux.x64.${jprt.tools.default.release}}
 
 jprt.my.linux.ppc.jdk8=linux_ppc_2.6
 jprt.my.linux.ppc.jdk7=linux_ppc_2.6
-jprt.my.linux.ppc.jdk7u4=${jprt.my.linux.ppc.jdk7}
+jprt.my.linux.ppc.jdk7u6=${jprt.my.linux.ppc.jdk7}
 jprt.my.linux.ppc=${jprt.my.linux.ppc.${jprt.tools.default.release}}
 
 jprt.my.linux.ppcv2.jdk8=linux_ppcv2_2.6
 jprt.my.linux.ppcv2.jdk7=linux_ppcv2_2.6
-jprt.my.linux.ppcv2.jdk7u4=${jprt.my.linux.ppcv2.jdk7}
+jprt.my.linux.ppcv2.jdk7u6=${jprt.my.linux.ppcv2.jdk7}
 jprt.my.linux.ppcv2=${jprt.my.linux.ppcv2.${jprt.tools.default.release}}
 
 jprt.my.linux.ppcsflt.jdk8=linux_ppcsflt_2.6
 jprt.my.linux.ppcsflt.jdk7=linux_ppcsflt_2.6
-jprt.my.linux.ppcsflt.jdk7u4=${jprt.my.linux.ppcsflt.jdk7}
+jprt.my.linux.ppcsflt.jdk7u6=${jprt.my.linux.ppcsflt.jdk7}
 jprt.my.linux.ppcsflt=${jprt.my.linux.ppcsflt.${jprt.tools.default.release}}
 
 jprt.my.linux.armvfp.jdk8=linux_armvfp_2.6
 jprt.my.linux.armvfp.jdk7=linux_armvfp_2.6
-jprt.my.linux.armvfp.jdk7u4=${jprt.my.linux.armvfp.jdk7}
+jprt.my.linux.armvfp.jdk7u6=${jprt.my.linux.armvfp.jdk7}
 jprt.my.linux.armvfp=${jprt.my.linux.armvfp.${jprt.tools.default.release}}
 
+jprt.my.linux.armv6.jdk8=linux_armv6_2.6
+jprt.my.linux.armv6.jdk7=linux_armv6_2.6
+jprt.my.linux.armv6.jdk7u6=${jprt.my.linux.armv6.jdk7}
+jprt.my.linux.armv6=${jprt.my.linux.armv6.${jprt.tools.default.release}}
+
 jprt.my.linux.armsflt.jdk8=linux_armsflt_2.6
 jprt.my.linux.armsflt.jdk7=linux_armsflt_2.6
-jprt.my.linux.armsflt.jdk7u4=${jprt.my.linux.armsflt.jdk7}
+jprt.my.linux.armsflt.jdk7u6=${jprt.my.linux.armsflt.jdk7}
 jprt.my.linux.armsflt=${jprt.my.linux.armsflt.${jprt.tools.default.release}}
 
 jprt.my.macosx.x64.jdk8=macosx_x64_10.7
 jprt.my.macosx.x64.jdk7=macosx_x64_10.7
-jprt.my.macosx.x64.jdk7u4=${jprt.my.macosx.x64.jdk7}
+jprt.my.macosx.x64.jdk7u6=${jprt.my.macosx.x64.jdk7}
 jprt.my.macosx.x64=${jprt.my.macosx.x64.${jprt.tools.default.release}}
 
 jprt.my.windows.i586.jdk8=windows_i586_5.1
 jprt.my.windows.i586.jdk7=windows_i586_5.1
-jprt.my.windows.i586.jdk7u4=${jprt.my.windows.i586.jdk7}
+jprt.my.windows.i586.jdk7u6=${jprt.my.windows.i586.jdk7}
 jprt.my.windows.i586=${jprt.my.windows.i586.${jprt.tools.default.release}}
 
 jprt.my.windows.x64.jdk8=windows_x64_5.2
 jprt.my.windows.x64.jdk7=windows_x64_5.2
-jprt.my.windows.x64.jdk7u4=${jprt.my.windows.x64.jdk7}
+jprt.my.windows.x64.jdk7u6=${jprt.my.windows.x64.jdk7}
 jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}}
 
 # Standard list of jprt build targets for this source tree
@@ -133,7 +138,8 @@
     ${jprt.my.linux.x64}-{product|fastdebug}, \
     ${jprt.my.macosx.x64}-{product|fastdebug|debug}, \
     ${jprt.my.windows.i586}-{product|fastdebug|debug}, \
-    ${jprt.my.windows.x64}-{product|fastdebug|debug}
+    ${jprt.my.windows.x64}-{product|fastdebug|debug}, \
+    ${jprt.my.linux.armv6}-{product|fastdebug}
 
 jprt.build.targets.open= \
     ${jprt.my.solaris.i586}-{productOpen}, \
@@ -153,7 +159,7 @@
 
 jprt.build.targets.jdk8=${jprt.build.targets.all}
 jprt.build.targets.jdk7=${jprt.build.targets.all}
-jprt.build.targets.jdk7u4=${jprt.build.targets.all}
+jprt.build.targets.jdk7u6=${jprt.build.targets.all}
 jprt.build.targets.jdk7temp=${jprt.build.targets.all}
 jprt.build.targets.jdk7b107=${jprt.build.targets.all}
 jprt.build.targets.jdk6=${jprt.build.targets.standard}
@@ -355,12 +361,12 @@
     ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \
     ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_CMS, \
     ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_G1, \
-    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParOldGC
-#    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_default, \
-#    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_default_tiered, \
-#    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \
-#    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_G1, \
-#    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_ParOldGC
+    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-GCOld_ParOldGC, \
+    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_default, \
+    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_default_nontiered, \
+    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \
+    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_G1, \
+    ${jprt.my.macosx.x64}-{product|fastdebug}-c2-jbb_ParOldGC
 
 jprt.my.windows.i586.test.targets = \
     ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-jvm98, \
@@ -456,7 +462,7 @@
 
 jprt.test.targets.jdk8=${jprt.test.targets.standard}
 jprt.test.targets.jdk7=${jprt.test.targets.standard}
-jprt.test.targets.jdk7u4=${jprt.test.targets.jdk7}
+jprt.test.targets.jdk7u6=${jprt.test.targets.jdk7}
 jprt.test.targets=${jprt.test.targets.${jprt.tools.default.release}}
 
 # The default test/Makefile targets that should be run
@@ -501,6 +507,9 @@
 
 jprt.make.rule.test.targets.jdk8=${jprt.make.rule.test.targets.standard}
 jprt.make.rule.test.targets.jdk7=${jprt.make.rule.test.targets.standard}
-jprt.make.rule.test.targets.jdk7u4=${jprt.make.rule.test.targets.jdk7}
+jprt.make.rule.test.targets.jdk7u6=${jprt.make.rule.test.targets.jdk7}
 jprt.make.rule.test.targets=${jprt.make.rule.test.targets.${jprt.tools.default.release}}
 
+# 7155453: Work-around to prevent popups on OSX from blocking test completion
+# but the work-around is added to all platforms to be consistent 
+jprt.jbb.options=-Djava.awt.headless=true
--- a/make/linux/Makefile	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/linux/Makefile	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
@@ -210,7 +210,7 @@
 BUILDTREE_MAKE    = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
 BUILDTREE_VARS    = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
 BUILDTREE_VARS   += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
-BUILDTREE_VARS   += OBJCOPY=$(OBJCOPY) STRIP_POLICY=$(STRIP_POLICY)
+BUILDTREE_VARS   += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS) OBJCOPY=$(OBJCOPY) STRIP_POLICY=$(STRIP_POLICY) ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES) ZIPEXE=$(ZIPEXE)
 
 BUILDTREE         = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
 
@@ -337,9 +337,11 @@
 
 # Doc target.  This is the same for all build options.
 #     Hence create a docs directory beside ...$(ARCH)_[...]
+# We specify 'BUILD_FLAVOR=product' so that the proper
+# ENABLE_FULL_DEBUG_SYMBOLS value is used.
 docs: checks
 	$(QUIETLY) mkdir -p $(SUBDIR_DOCS)
-	$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs
+	$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) BUILD_FLAVOR=product jvmtidocs
 
 # Synonyms for win32-like targets.
 compiler2:  jvmg product
--- a/make/linux/makefiles/buildtree.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/linux/makefiles/buildtree.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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
@@ -235,10 +235,16 @@
 	echo "$(call gamma-path,commonsrc,os/posix/vm)"; \
 	[ -n "$(CFLAGS_BROWSE)" ] && \
 	    echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
+	[ -n "$(ENABLE_FULL_DEBUG_SYMBOLS)" ] && \
+	    echo && echo "ENABLE_FULL_DEBUG_SYMBOLS = $(ENABLE_FULL_DEBUG_SYMBOLS)"; \
 	[ -n "$(OBJCOPY)" ] && \
 	    echo && echo "OBJCOPY = $(OBJCOPY)"; \
 	[ -n "$(STRIP_POLICY)" ] && \
 	    echo && echo "STRIP_POLICY = $(STRIP_POLICY)"; \
+	[ -n "$(ZIP_DEBUGINFO_FILES)" ] && \
+	    echo && echo "ZIP_DEBUGINFO_FILES = $(ZIP_DEBUGINFO_FILES)"; \
+	[ -n "$(ZIPEXE)" ] && \
+	    echo && echo "ZIPEXE = $(ZIPEXE)"; \
 	[ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
 	    echo && \
 	    echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
--- a/make/linux/makefiles/defs.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/linux/makefiles/defs.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2012, 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
@@ -129,32 +129,70 @@
 endif
 
 ifeq ($(JDK6_OR_EARLIER),0)
-  # Full Debug Symbols is supported on JDK7 or newer
+  # Full Debug Symbols is supported on JDK7 or newer.
+  # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
+  # builds is enabled with debug info files ZIP'ed to save space. For
+  # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
+  # debug build without debug info isn't very useful.
+  # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
+  #
+  # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
+  # disabled for a BUILD_FLAVOR == product build.
+  #
+  # Note: Use of a different variable name for the FDS override option
+  # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
+  # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
+  # in options via environment variables, use of distinct variables
+  # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
+  # product build, the FULL_DEBUG_SYMBOLS environment variable will be
+  # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
+  # the same variable name is used, then different values can be picked
+  # up by different parts of the build. Just to be clear, we only need
+  # two variable names because the incoming option value can be
+  # overridden in some situations, e.g., a BUILD_FLAVOR != product
+  # build.
 
-  # Default OBJCOPY comes from GNU Binutils on Linux:
-  DEF_OBJCOPY=/usr/bin/objcopy
-  ifdef CROSS_COMPILE_ARCH
-    # don't try to generate .debuginfo files when cross compiling
-    _JUNK_ := $(shell \
-      echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \
-        "skipping .debuginfo generation.")
+  ifeq ($(BUILD_FLAVOR), product)
+    FULL_DEBUG_SYMBOLS ?= 1
+    ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
+  else
+    # debug variants always get Full Debug Symbols (if available)
+    ENABLE_FULL_DEBUG_SYMBOLS = 1
+  endif
+  _JUNK_ := $(shell \
+    echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
+  # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
+
+  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+    # Default OBJCOPY comes from GNU Binutils on Linux:
+    DEF_OBJCOPY=/usr/bin/objcopy
+    ifdef CROSS_COMPILE_ARCH
+      # don't try to generate .debuginfo files when cross compiling
+      _JUNK_ := $(shell \
+        echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \
+          "skipping .debuginfo generation.")
+      OBJCOPY=
+    else
+      OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
+      ifneq ($(ALT_OBJCOPY),)
+        _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
+        OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
+      endif
+    endif
+  else
     OBJCOPY=
-  else
-    OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
-    ifneq ($(ALT_OBJCOPY),)
-      _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
-      # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
-      OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
-    endif
   endif
-  
+
   ifeq ($(OBJCOPY),)
     _JUNK_ := $(shell \
       echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
+    ENABLE_FULL_DEBUG_SYMBOLS=0
+    _JUNK_ := $(shell \
+      echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
   else
     _JUNK_ := $(shell \
       echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
-  
+
     # Library stripping policies for .debuginfo configs:
     #   all_strip - strips everything from the library
     #   min_strip - strips most stuff from the library; leaves minimum symbols
@@ -163,15 +201,17 @@
     # Oracle security policy requires "all_strip". A waiver was granted on
     # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
     #
-    DEF_STRIP_POLICY="min_strip"
-    ifeq ($(ALT_STRIP_POLICY),)
-      STRIP_POLICY=$(DEF_STRIP_POLICY)
-    else
-      STRIP_POLICY=$(ALT_STRIP_POLICY)
-    endif
-  
+    # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
+    #
+    STRIP_POLICY ?= min_strip
+
     _JUNK_ := $(shell \
       echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
+
+    ZIP_DEBUGINFO_FILES ?= 1
+
+    _JUNK_ := $(shell \
+      echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
   endif
 endif
 
@@ -187,8 +227,12 @@
 
 # client and server subdirectories have symbolic links to ../libjsig.so
 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
-ifneq ($(OBJCOPY),)
-  EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz
+  else
+    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
+  endif
 endif
 EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
 EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
@@ -196,8 +240,12 @@
 ifndef BUILD_CLIENT_ONLY
 EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
-  ifneq ($(OBJCOPY),)
-    EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
+  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+    ifeq ($(ZIP_DEBUGINFO_FILES),1)
+      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz
+    else
+      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
+    endif
   endif
 endif
 
@@ -205,8 +253,12 @@
   ifeq ($(ARCH_DATA_MODEL), 32)
     EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
     EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
-    ifneq ($(OBJCOPY),)
-      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
+    ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+      ifeq ($(ZIP_DEBUGINFO_FILES),1)
+        EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz
+      else
+        EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
+      endif
     endif
   endif
 endif
@@ -217,9 +269,14 @@
                         $(EXPORT_LIB_DIR)/sa-jdi.jar 
 ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
                         $(EXPORT_LIB_DIR)/sa-jdi.jar 
-ifneq ($(OBJCOPY),)
-  ADD_SA_BINARIES/x86   += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
-  ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+    ADD_SA_BINARIES/x86   += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
+    ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
+  else
+    ADD_SA_BINARIES/x86   += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
+    ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
+  endif
 endif
 ADD_SA_BINARIES/ppc   = 
 ADD_SA_BINARIES/ia64  = 
--- a/make/linux/makefiles/gcc.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/linux/makefiles/gcc.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
@@ -224,7 +224,7 @@
 DEBUG_CFLAGS += -gstabs
 endif
 
-ifneq ($(OBJCOPY),)
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   FASTDEBUG_CFLAGS/ia64  = -g
   FASTDEBUG_CFLAGS/amd64 = -g
   FASTDEBUG_CFLAGS/arm   = -g
--- a/make/linux/makefiles/jsig.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/linux/makefiles/jsig.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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,12 +32,15 @@
 LIBJSIG_G = lib$(JSIG_G).so
 
 LIBJSIG_DEBUGINFO   = lib$(JSIG).debuginfo
+LIBJSIG_DIZ         = lib$(JSIG).diz
 LIBJSIG_G_DEBUGINFO = lib$(JSIG_G).debuginfo
+LIBJSIG_G_DIZ       = lib$(JSIG_G).diz
 
 JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm
 
 DEST_JSIG           = $(JDK_LIBDIR)/$(LIBJSIG)
 DEST_JSIG_DEBUGINFO = $(JDK_LIBDIR)/$(LIBJSIG_DEBUGINFO)
+DEST_JSIG_DIZ       = $(JDK_LIBDIR)/$(LIBJSIG_DIZ)
 
 LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jsig
 
@@ -58,7 +61,7 @@
 	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
                          $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $< -ldl
 	$(QUIETLY) [ -f $(LIBJSIG_G) ] || { ln -s $@ $(LIBJSIG_G); }
-ifneq ($(OBJCOPY),)
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO)
 	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
   ifeq ($(STRIP_POLICY),all_strip)
@@ -70,12 +73,19 @@
     endif
   endif
 	[ -f $(LIBJSIG_G_DEBUGINFO) ] || { ln -s $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO); }
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+	$(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO)
+	$(RM) $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO)
+	[ -f $(LIBJSIG_G_DIZ) ] || { ln -s $(LIBJSIG_DIZ) $(LIBJSIG_G_DIZ); }
+  endif
 endif
 
 install_jsig: $(LIBJSIG)
 	@echo "Copying $(LIBJSIG) to $(DEST_JSIG)"
 	$(QUIETLY) test -f $(LIBJSIG_DEBUGINFO) && \
 	    cp -f $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO)
+	$(QUIETLY) test -f $(LIBJSIG_DIZ) && \
+	    cp -f $(LIBJSIG_DIZ) $(DEST_JSIG_DIZ)
 	$(QUIETLY) cp -f $(LIBJSIG) $(DEST_JSIG) && echo "Done"
 
 .PHONY: install_jsig
--- a/make/linux/makefiles/ppc.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/linux/makefiles/ppc.make	Sun Aug 12 15:23:07 2012 -0700
@@ -28,3 +28,6 @@
 # Must also specify if CPU is big endian
 CFLAGS += -DVM_BIG_ENDIAN
 
+ifdef E500V2
+ASFLAGS += -Wa,-mspe -Wa,--defsym -Wa,E500V2=1 
+endif
--- a/make/linux/makefiles/saproc.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/linux/makefiles/saproc.make	Sun Aug 12 15:23:07 2012 -0700
@@ -33,7 +33,9 @@
 LIBSAPROC_G = lib$(SAPROC_G).so
 
 LIBSAPROC_DEBUGINFO   = lib$(SAPROC).debuginfo
+LIBSAPROC_DIZ         = lib$(SAPROC).diz
 LIBSAPROC_G_DEBUGINFO = lib$(SAPROC_G).debuginfo
+LIBSAPROC_G_DIZ       = lib$(SAPROC_G).diz
 
 AGENT_DIR = $(GAMMADIR)/agent
 
@@ -50,6 +52,7 @@
 
 DEST_SAPROC           = $(JDK_LIBDIR)/$(LIBSAPROC)
 DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO)
+DEST_SAPROC_DIZ       = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ)
 
 # DEBUG_BINARIES overrides everything, use full -g debug information
 ifeq ($(DEBUG_BINARIES), true)
@@ -87,7 +90,7 @@
 	           -o $@                                                \
 	           -lthread_db
 	$(QUIETLY) [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
-ifneq ($(OBJCOPY),)
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
 	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
   ifeq ($(STRIP_POLICY),all_strip)
@@ -99,6 +102,11 @@
     endif
   endif
 	[ -f $(LIBSAPROC_G_DEBUGINFO) ] || { ln -s $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO); }
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+	$(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO)
+	$(RM) $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO)
+	[ -f $(LIBSAPROC_G_DIZ) ] || { ln -s $(LIBSAPROC_DIZ) $(LIBSAPROC_G_DIZ); }
+  endif
 endif
 
 install_saproc: $(BUILDLIBSAPROC)
@@ -106,6 +114,8 @@
 	  echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)";     \
 	  test -f $(LIBSAPROC_DEBUGINFO) &&                  \
 	    cp -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO); \
+	  test -f $(LIBSAPROC_DIZ) &&                  \
+	    cp -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ); \
 	  cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done";  \
 	fi
 
--- a/make/linux/makefiles/vm.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/linux/makefiles/vm.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
@@ -61,7 +61,7 @@
 INCLUDES += $(PRECOMPILED_HEADER_DIR:%=-I%) $(Src_Dirs_I:%=-I%)
 
 # SYMFLAG is used by {jsig,saproc}.make
-ifneq ($(OBJCOPY),)
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   # always build with debug info when we can create .debuginfo files
   SYMFLAG = -g
 else
@@ -102,9 +102,11 @@
 # a time and date. 
 vm_version.o: CXXFLAGS += ${JRE_VERSION}
 
-ifndef JAVASE_EMBEDDED
+ifndef JAVASE_EMBEDDED 
+ifneq (${ARCH},arm)
 CFLAGS += -DINCLUDE_TRACE
 endif
+endif
 
 # CFLAGS_WARN holds compiler options to suppress/enable warnings.
 CFLAGS += $(CFLAGS_WARN/BYFILE)
@@ -139,7 +141,9 @@
 LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
 
 LIBJVM_DEBUGINFO   = lib$(JVM).debuginfo
+LIBJVM_DIZ         = lib$(JVM).diz
 LIBJVM_G_DEBUGINFO = lib$(JVM)$(G_SUFFIX).debuginfo
+LIBJVM_G_DIZ       = lib$(JVM)$(G_SUFFIX).diz
 
 SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt
 
@@ -151,11 +155,13 @@
 SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm
 SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm
 
-ifndef JAVASE_EMBEDDED
+ifndef JAVASE_EMBEDDED 
+ifneq (${ARCH},arm)
 SOURCE_PATHS+=$(shell if [ -d $(HS_ALT_SRC)/share/vm/jfr ]; then \
   find $(HS_ALT_SRC)/share/vm/jfr -type d; \
   fi)
 endif
+endif
 
 CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path))
 CORE_PATHS+=$(GENERATED)/jvmtifiles
@@ -331,7 +337,7 @@
             fi 								\
 	}
 ifeq ($(CROSS_COMPILE_ARCH),)
-  ifneq ($(OBJCOPY),)
+  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO)
 	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
     ifeq ($(STRIP_POLICY),all_strip)
@@ -343,17 +349,25 @@
       endif
     endif
 	$(QUIETLY) [ -f $(LIBJVM_G_DEBUGINFO) ] || ln -s $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
+    ifeq ($(ZIP_DEBUGINFO_FILES),1)
+	$(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
+	$(RM) $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
+	[ -f $(LIBJVM_G_DIZ) ] || { ln -s $(LIBJVM_DIZ) $(LIBJVM_G_DIZ); }
+    endif
   endif
 endif
 
 DEST_SUBDIR        = $(JDK_LIBDIR)/$(VM_SUBDIR)
 DEST_JVM           = $(DEST_SUBDIR)/$(LIBJVM)
 DEST_JVM_DEBUGINFO = $(DEST_SUBDIR)/$(LIBJVM_DEBUGINFO)
+DEST_JVM_DIZ       = $(DEST_SUBDIR)/$(LIBJVM_DIZ)
 
 install_jvm: $(LIBJVM)
 	@echo "Copying $(LIBJVM) to $(DEST_JVM)"
 	$(QUIETLY) test -f $(LIBJVM_DEBUGINFO) && \
 	    cp -f $(LIBJVM_DEBUGINFO) $(DEST_JVM_DEBUGINFO)
+	$(QUIETLY) test -f $(LIBJVM_DIZ) && \
+	    cp -f $(LIBJVM_DIZ) $(DEST_JVM_DIZ)
 	$(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done"
 
 #----------------------------------------------------------------------
--- a/make/pic.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/pic.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2012, 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
@@ -30,6 +30,13 @@
 
 ifneq ($(OSNAME), windows)
   ifndef LP64
+    PARTIAL_NONPIC=1
+  endif
+  PIC_ARCH = ppc
+  ifneq ("$(filter $(PIC_ARCH),$(BUILDARCH))","")
+    PARTIAL_NONPIC=0
+  endif
+  ifeq ($(PARTIAL_NONPIC),1)
     NONPIC_DIRS  = memory oops gc_implementation gc_interface 
     NONPIC_DIRS  := $(foreach dir,$(NONPIC_DIRS), $(GAMMADIR)/src/share/vm/$(dir))
     # Look for source files under NONPIC_DIRS
--- a/make/solaris/Makefile	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/solaris/Makefile	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2012, 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
@@ -168,7 +168,7 @@
 BUILDTREE_MAKE    = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
 BUILDTREE_VARS    = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
 BUILDTREE_VARS   += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
-BUILDTREE_VARS   += OBJCOPY=$(OBJCOPY) STRIP_POLICY=$(STRIP_POLICY)
+BUILDTREE_VARS   += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS) OBJCOPY=$(OBJCOPY) STRIP_POLICY=$(STRIP_POLICY) ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES) ZIPEXE=$(ZIPEXE)
 
 BUILDTREE         = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
 
@@ -278,9 +278,11 @@
 
 # Doc target.  This is the same for all build options.
 #     Hence create a docs directory beside ...$(ARCH)_[...]
+# We specify 'BUILD_FLAVOR=product' so that the proper
+# ENABLE_FULL_DEBUG_SYMBOLS value is used.
 docs: checks
 	$(QUIETLY) mkdir -p $(SUBDIR_DOCS)
-	$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs
+	$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) BUILD_FLAVOR=product jvmtidocs
 
 # Synonyms for win32-like targets.
 compiler2:  jvmg product
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/solaris/makefiles/add_gnu_debuglink.make	Sun Aug 12 15:23:07 2012 -0700
@@ -0,0 +1,54 @@
+#
+# Copyright (c) 2012, 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.
+#  
+#
+
+# Rules to build add_gnu_debuglink, used by vm.make on Solaris
+
+# Allow $(ADD_GNU_DEBUGLINK) to be called from any directory.
+# We don't set or use the GENERATED macro to avoid affecting
+# other HotSpot Makefiles.
+TOPDIR                    = $(shell echo `pwd`)
+ADD_GNU_DEBUGLINK         = $(TOPDIR)/../generated/add_gnu_debuglink
+
+ADD_GNU_DEBUGLINK_DIR     = $(GAMMADIR)/src/os/solaris/add_gnu_debuglink
+ADD_GNU_DEBUGLINK_SRC     = $(ADD_GNU_DEBUGLINK_DIR)/add_gnu_debuglink.c
+ADD_GNU_DEBUGLINK_FLAGS   = 
+LIBS_ADD_GNU_DEBUGLINK   += -lelf
+
+ifeq ("${Platform_compiler}", "sparcWorks")
+# Enable the following ADD_GNU_DEBUGLINK_FLAGS addition if you need to
+# compare the built ELF objects.
+#
+# The -g option makes static data global and the "-W0,-noglobal"
+# option tells the compiler to not globalize static data using a unique
+# globalization prefix. Instead force the use of a static globalization
+# prefix based on the source filepath so the objects from two identical
+# compilations are the same.
+#
+# Note: The blog says to use "-W0,-xglobalstatic", but that doesn't
+#       seem to work. I got "-W0,-noglobal" from Kelly and that works.
+#ADD_GNU_DEBUGLINK_FLAGS += -W0,-noglobal
+endif # Platform_compiler == sparcWorks
+
+$(ADD_GNU_DEBUGLINK): $(ADD_GNU_DEBUGLINK_SRC)
+	$(CC) -g -o $@ $< $(ADD_GNU_DEBUGLINK_FLAGS) $(LIBS_ADD_GNU_DEBUGLINK)
--- a/make/solaris/makefiles/buildtree.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/solaris/makefiles/buildtree.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2012, 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
@@ -228,10 +228,16 @@
 	echo "$(call gamma-path,commonsrc,os/posix/vm)"; \
 	[ -n "$(CFLAGS_BROWSE)" ] && \
 	    echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
+	[ -n "$(ENABLE_FULL_DEBUG_SYMBOLS)" ] && \
+	    echo && echo "ENABLE_FULL_DEBUG_SYMBOLS = $(ENABLE_FULL_DEBUG_SYMBOLS)"; \
 	[ -n "$(OBJCOPY)" ] && \
 	    echo && echo "OBJCOPY = $(OBJCOPY)"; \
 	[ -n "$(STRIP_POLICY)" ] && \
 	    echo && echo "STRIP_POLICY = $(STRIP_POLICY)"; \
+	[ -n "$(ZIP_DEBUGINFO_FILES)" ] && \
+	    echo && echo "ZIP_DEBUGINFO_FILES = $(ZIP_DEBUGINFO_FILES)"; \
+	[ -n "$(ZIPEXE)" ] && \
+	    echo && echo "ZIPEXE = $(ZIPEXE)"; \
 	[ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
 	    echo && \
 	    echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
--- a/make/solaris/makefiles/defs.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/solaris/makefiles/defs.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2012, 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
@@ -74,45 +74,62 @@
 endif
 
 ifeq ($(JDK6_OR_EARLIER),0)
-  # Full Debug Symbols is supported on JDK7 or newer
+  # Full Debug Symbols is supported on JDK7 or newer.
+  # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
+  # builds is enabled with debug info files ZIP'ed to save space. For
+  # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
+  # debug build without debug info isn't very useful.
+  # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
+  #
+  # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
+  # disabled for a BUILD_FLAVOR == product build.
+  #
+  # Note: Use of a different variable name for the FDS override option
+  # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
+  # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
+  # in options via environment variables, use of distinct variables
+  # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
+  # product build, the FULL_DEBUG_SYMBOLS environment variable will be
+  # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
+  # the same variable name is used, then different values can be picked
+  # up by different parts of the build. Just to be clear, we only need
+  # two variable names because the incoming option value can be
+  # overridden in some situations, e.g., a BUILD_FLAVOR != product
+  # build.
 
-ifdef ENABLE_FULL_DEBUG_SYMBOLS
-  # Only check for Full Debug Symbols support on Solaris if it is
-  # specifically enabled. Hopefully, it can be enabled by default
-  # once the .debuginfo size issues are worked out.
-  
-  # Default OBJCOPY comes from the SUNWbinutils package:
-  DEF_OBJCOPY=/usr/sfw/bin/gobjcopy
-  ifeq ($(VM_PLATFORM),solaris_amd64)
-    # On Solaris AMD64/X64, gobjcopy is not happy and fails:
-    #
-    # usr/sfw/bin/gobjcopy --add-gnu-debuglink=<lib>.debuginfo <lib>.so
-    # BFD: stKPaiop: Not enough room for program headers, try linking with -N
-    # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value
-    # BFD: stKPaiop: Not enough room for program headers, try linking with -N
-    # /usr/sfw/bin/gobjcopy: libsaproc.debuginfo: Bad value
-    # BFD: stKPaiop: Not enough room for program headers, try linking with -N
-    # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value
-    _JUNK_ := $(shell \
-      echo >&2 "INFO: $(DEF_OBJCOPY) is not working on Solaris AMD64/X64")
-    OBJCOPY=
+  ifeq ($(BUILD_FLAVOR), product)
+    FULL_DEBUG_SYMBOLS ?= 1
+    ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
   else
+    # debug variants always get Full Debug Symbols (if available)
+    ENABLE_FULL_DEBUG_SYMBOLS = 1
+  endif
+  _JUNK_ := $(shell \
+    echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
+  # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
+
+  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+    # Default OBJCOPY comes from the SUNWbinutils package:
+    DEF_OBJCOPY=/usr/sfw/bin/gobjcopy
     OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
     ifneq ($(ALT_OBJCOPY),)
       _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
-      # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
       OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
     endif
+  else
+    OBJCOPY=
   endif
-endif
-  
+
   ifeq ($(OBJCOPY),)
     _JUNK_ := $(shell \
       echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
+    ENABLE_FULL_DEBUG_SYMBOLS=0
+    _JUNK_ := $(shell \
+      echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
   else
     _JUNK_ := $(shell \
       echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
-  
+
     # Library stripping policies for .debuginfo configs:
     #   all_strip - strips everything from the library
     #   min_strip - strips most stuff from the library; leaves minimum symbols
@@ -121,14 +138,17 @@
     # Oracle security policy requires "all_strip". A waiver was granted on
     # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
     #
-    DEF_STRIP_POLICY="min_strip"
-    ifeq ($(ALT_STRIP_POLICY),)
-      STRIP_POLICY=$(DEF_STRIP_POLICY)
-    else
-      STRIP_POLICY=$(ALT_STRIP_POLICY)
-    endif
+    # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
+    #
+    STRIP_POLICY ?= min_strip
+
     _JUNK_ := $(shell \
       echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
+
+    ZIP_DEBUGINFO_FILES ?= 1
+
+    _JUNK_ := $(shell \
+      echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
   endif
 endif
 
@@ -144,8 +164,12 @@
 
 # client and server subdirectories have symbolic links to ../libjsig.$(LIBRARY_SUFFIX)
 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
-ifneq ($(OBJCOPY),)
-  EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz
+  else
+    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
+  endif
 endif
 
 EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
@@ -156,10 +180,16 @@
 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.$(LIBRARY_SUFFIX)
 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.$(LIBRARY_SUFFIX)
-  ifneq ($(OBJCOPY),)
-    EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
-    EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.debuginfo
-    EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.debuginfo
+  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+    ifeq ($(ZIP_DEBUGINFO_FILES),1)
+      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz
+      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.diz
+      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.diz
+    else
+      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
+      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.debuginfo
+      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.debuginfo
+    endif
   endif
 endif
 ifeq ($(ARCH_DATA_MODEL), 32)
@@ -169,25 +199,42 @@
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.$(LIBRARY_SUFFIX)
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.$(LIBRARY_SUFFIX)
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.$(LIBRARY_SUFFIX)
-  ifneq ($(OBJCOPY),)
-    EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
-    EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.debuginfo
-    EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.debuginfo
-    EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.debuginfo
-    EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.debuginfo
+  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+    ifeq ($(ZIP_DEBUGINFO_FILES),1)
+      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz
+      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.diz
+      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.diz
+      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.diz
+      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.diz
+    else
+      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
+      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.debuginfo
+      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.debuginfo
+      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.debuginfo
+      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.debuginfo
+    endif
   endif
   ifneq ($(BUILD_CLIENT_ONLY), true)
     EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.$(LIBRARY_SUFFIX)
     EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.$(LIBRARY_SUFFIX)
-    ifneq ($(OBJCOPY),)
-      EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.debuginfo
-      EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.debuginfo
+    ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+      ifeq ($(ZIP_DEBUGINFO_FILES),1)
+        EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.diz
+        EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.diz
+      else
+        EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.debuginfo
+        EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.debuginfo
+      endif
     endif
   endif
 endif
 
 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX)
-ifneq ($(OBJCOPY),)
-  EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
+  else
+    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
+  endif
 endif
 EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar 
--- a/make/solaris/makefiles/dtrace.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/solaris/makefiles/dtrace.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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
@@ -41,15 +41,19 @@
 LIBJVM_DB = libjvm_db.so
 LIBJVM_DB_G = libjvm$(G_SUFFIX)_db.so
 
-LIBJVM_DB_DEBUGINFO = libjvm_db.debuginfo
+LIBJVM_DB_DEBUGINFO   = libjvm_db.debuginfo
+LIBJVM_DB_DIZ         = libjvm_db.diz
 LIBJVM_DB_G_DEBUGINFO = libjvm$(G_SUFFIX)_db.debuginfo
+LIBJVM_DB_G_DIZ       = libjvm$(G_SUFFIX)_db.diz
 
 JVM_DTRACE = jvm_dtrace
 LIBJVM_DTRACE = libjvm_dtrace.so
 LIBJVM_DTRACE_G = libjvm$(G_SUFFIX)_dtrace.so
 
-LIBJVM_DTRACE_DEBUGINFO = libjvm_dtrace.debuginfo
+LIBJVM_DTRACE_DEBUGINFO   = libjvm_dtrace.debuginfo
+LIBJVM_DTRACE_DIZ         = libjvm_dtrace.diz
 LIBJVM_DTRACE_G_DEBUGINFO = libjvm$(G_SUFFIX)_dtrace.debuginfo
+LIBJVM_DTRACE_G_DIZ       = libjvm$(G_SUFFIX)_dtrace.diz
 
 JVMOFFS = JvmOffsets
 JVMOFFS.o = $(JVMOFFS).o
@@ -90,25 +94,41 @@
 # Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so
 ifneq ("${ISA}","${BUILDARCH}")
 
-XLIBJVM_DB = 64/$(LIBJVM_DB)
-XLIBJVM_DB_G = 64/$(LIBJVM_DB_G)
-XLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE)
-XLIBJVM_DTRACE_G = 64/$(LIBJVM_DTRACE_G)
+XLIBJVM_DIR = 64
+XLIBJVM_DB = $(XLIBJVM_DIR)/$(LIBJVM_DB)
+XLIBJVM_DB_G = $(XLIBJVM_DIR)/$(LIBJVM_DB_G)
+XLIBJVM_DTRACE = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE)
+XLIBJVM_DTRACE_G = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_G)
 
-XLIBJVM_DB_DEBUGINFO = 64/$(LIBJVM_DB_DEBUGINFO)
-XLIBJVM_DB_G_DEBUGINFO = 64/$(LIBJVM_DB_G_DEBUGINFO)
-XLIBJVM_DTRACE_DEBUGINFO = 64/$(LIBJVM_DTRACE_DEBUGINFO)
-XLIBJVM_DTRACE_G_DEBUGINFO = 64/$(LIBJVM_DTRACE_G_DEBUGINFO)
+XLIBJVM_DB_DEBUGINFO       = $(XLIBJVM_DIR)/$(LIBJVM_DB_DEBUGINFO)
+XLIBJVM_DB_DIZ             = $(XLIBJVM_DIR)/$(LIBJVM_DB_DIZ)
+XLIBJVM_DB_G_DEBUGINFO     = $(XLIBJVM_DIR)/$(LIBJVM_DB_G_DEBUGINFO)
+XLIBJVM_DB_G_DIZ           = $(XLIBJVM_DIR)/$(LIBJVM_DB_G_DIZ)
+XLIBJVM_DTRACE_DEBUGINFO   = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DEBUGINFO)
+XLIBJVM_DTRACE_DIZ         = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DIZ)
+XLIBJVM_DTRACE_G_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_G_DEBUGINFO)
+XLIBJVM_DTRACE_G_DIZ       = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_G_DIZ)
 
-$(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
+$(XLIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
 	@echo Making $@
-	$(QUIETLY) mkdir -p 64/ ; \
+	$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
 	$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \
 		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
 	[ -f $(XLIBJVM_DB_G) ] || { ln -s $(LIBJVM_DB) $(XLIBJVM_DB_G); }
-ifneq ($(OBJCOPY),)
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
+# Clear the SHF_ALLOC flag (if set) from empty section headers.
+# An empty section header has sh_addr == 0 and sh_size == 0.
+# This problem has only been seen on Solaris X64, but we call this tool
+# on all Solaris builds just in case.
+	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO)
-	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DB_DEBUGINFO) $@
+# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
+# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
+#         $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) ;
+# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
+# in the link name:
+	( cd $(XLIBJVM_DIR) && $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) )
   ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(STRIP) $@
   else
@@ -117,18 +137,31 @@
     # implied else here is no stripping at all
     endif
   endif
-	[ -f $(XLIBJVM_DB_G_DEBUGINFO) ] || { ln -s $(LIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO); }
+	[ -f $(XLIBJVM_DB_G_DEBUGINFO) ] || { cd $(XLIBJVM_DIR) && ln -s $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO); }
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
+# in the archived name:
+	( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO) )
+	$(RM) $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO)
+	[ -f $(XLIBJVM_DB_G_DIZ) ] || { cd $(XLIBJVM_DIR) && ln -s $(LIBJVM_DB_DIZ) $(LIBJVM_DB_G_DIZ); }
+  endif
 endif
 
-$(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
+$(XLIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
 	@echo Making $@
-	$(QUIETLY) mkdir -p 64/ ; \
+	$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
 	$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \
 		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
 	[ -f $(XLIBJVM_DTRACE_G) ] || { ln -s $(LIBJVM_DTRACE) $(XLIBJVM_DTRACE_G); }
-ifneq ($(OBJCOPY),)
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+# Clear the SHF_ALLOC flag (if set) from empty section headers.
+	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO)
-	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DTRACE_DEBUGINFO) $@
+# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
+#         $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) ;
+# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
+# in the link name:
+	( cd $(XLIBJVM_DIR) && $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) )
   ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(STRIP) $@
   else
@@ -137,7 +170,14 @@
     # implied else here is no stripping at all
     endif
   endif
-	[ -f $(XLIBJVM_DTRACE_G_DEBUGINFO) ] || { ln -s $(LIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO); }
+	[ -f $(XLIBJVM_DTRACE_G_DEBUGINFO) ] || { cd $(XLIBJVM_DIR) && ln -s $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO); }
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
+# in the archived name:
+	( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO) )
+	$(RM) $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO)
+	[ -f $(XLIBJVM_DTRACE_G_DIZ) ] || { cd $(XLIBJVM_DIR) && ln -s $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_G_DIZ); }
+  endif
 endif
 
 endif # ifneq ("${ISA}","${BUILDARCH}")
@@ -180,14 +220,18 @@
 $(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp 
 	$(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
 
-$(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
+$(LIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
 	@echo Making $@
 	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
 		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
 	[ -f $(LIBJVM_DB_G) ] || { ln -s $@ $(LIBJVM_DB_G); }
-ifneq ($(OBJCOPY),)
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+# Clear the SHF_ALLOC flag (if set) from empty section headers.
+	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO)
-	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@
+# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
+#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@
+	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $@
   ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(STRIP) $@
   else
@@ -197,16 +241,25 @@
     endif
   endif
 	[ -f $(LIBJVM_DB_G_DEBUGINFO) ] || { ln -s $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO); }
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+	$(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO)
+	$(RM) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO)
+	[ -f $(LIBJVM_DB_G_DIZ) ] || { ln -s $(LIBJVM_DB_DIZ) $(LIBJVM_DB_G_DIZ); }
+  endif
 endif
 
-$(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
+$(LIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
 	@echo Making $@
 	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I.  \
 		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
 	[ -f $(LIBJVM_DTRACE_G) ] || { ln -s $@ $(LIBJVM_DTRACE_G); }
-ifneq ($(OBJCOPY),)
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+# Clear the SHF_ALLOC flag (if set) from empty section headers.
+	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO)
-	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@
+# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
+#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@
+	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $@
   ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(STRIP) $@
   else
@@ -216,6 +269,11 @@
     endif
   endif
 	[ -f $(LIBJVM_DTRACE_G_DEBUGINFO) ] || { ln -s $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO); }
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+	$(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO)
+	$(RM) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO)
+	[ -f $(LIBJVM_DTRACE_G_DIZ) ] || { ln -s $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_G_DIZ); }
+  endif
 endif
 
 $(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/solaris/makefiles/fix_empty_sec_hdr_flags.make	Sun Aug 12 15:23:07 2012 -0700
@@ -0,0 +1,54 @@
+#
+# Copyright (c) 2012, 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.
+#  
+#
+
+# Rules to build fix_empty_sec_hdr_flags, used by vm.make on Solaris
+
+# Allow $(FIX_EMPTY_SEC_HDR_FLAGS) to be called from any directory.
+# We don't set or use the GENERATED macro to avoid affecting
+# other HotSpot Makefiles.
+TOPDIR                          = $(shell echo `pwd`)
+FIX_EMPTY_SEC_HDR_FLAGS         = $(TOPDIR)/../generated/fix_empty_sec_hdr_flags
+
+FIX_EMPTY_SEC_HDR_FLAGS_DIR     = $(GAMMADIR)/src/os/solaris/fix_empty_sec_hdr_flags
+FIX_EMPTY_SEC_HDR_FLAGS_SRC     = $(FIX_EMPTY_SEC_HDR_FLAGS_DIR)/fix_empty_sec_hdr_flags.c
+FIX_EMPTY_SEC_HDR_FLAGS_FLAGS   = 
+LIBS_FIX_EMPTY_SEC_HDR_FLAGS   += -lelf
+
+ifeq ("${Platform_compiler}", "sparcWorks")
+# Enable the following FIX_EMPTY_SEC_HDR_FLAGS_FLAGS addition if you need to
+# compare the built ELF objects.
+#
+# The -g option makes static data global and the "-W0,-noglobal"
+# option tells the compiler to not globalize static data using a unique
+# globalization prefix. Instead force the use of a static globalization
+# prefix based on the source filepath so the objects from two identical
+# compilations are the same.
+#
+# Note: The blog says to use "-W0,-xglobalstatic", but that doesn't
+#       seem to work. I got "-W0,-noglobal" from Kelly and that works.
+#FIX_EMPTY_SEC_HDR_FLAGS_FLAGS += -W0,-noglobal
+endif # Platform_compiler == sparcWorks
+
+$(FIX_EMPTY_SEC_HDR_FLAGS): $(FIX_EMPTY_SEC_HDR_FLAGS_SRC)
+	$(CC) -g -o $@ $< $(FIX_EMPTY_SEC_HDR_FLAGS_FLAGS) $(LIBS_FIX_EMPTY_SEC_HDR_FLAGS)
--- a/make/solaris/makefiles/jsig.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/solaris/makefiles/jsig.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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,12 +32,15 @@
 LIBJSIG_G = lib$(JSIG_G).so
 
 LIBJSIG_DEBUGINFO   = lib$(JSIG).debuginfo
+LIBJSIG_DIZ         = lib$(JSIG).diz
 LIBJSIG_G_DEBUGINFO = lib$(JSIG_G).debuginfo
+LIBJSIG_G_DIZ       = lib$(JSIG_G).diz
 
 JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm
 
 DEST_JSIG           = $(JDK_LIBDIR)/$(LIBJSIG)
 DEST_JSIG_DEBUGINFO = $(JDK_LIBDIR)/$(LIBJSIG_DEBUGINFO)
+DEST_JSIG_DIZ       = $(JDK_LIBDIR)/$(LIBJSIG_DIZ)
 
 LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jsig
 
@@ -49,14 +52,23 @@
 LFLAGS_JSIG += -mt -xnolib
 endif
 
-$(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE)
+$(LIBJSIG): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE)
 	@echo Making signal interposition lib...
 	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
-                         $(LFLAGS_JSIG) -o $@ $< -ldl
+                         $(LFLAGS_JSIG) -o $@ $(JSIGSRCDIR)/jsig.c -ldl
 	[ -f $(LIBJSIG_G) ] || { ln -s $@ $(LIBJSIG_G); }
-ifneq ($(OBJCOPY),)
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
+# Clear the SHF_ALLOC flag (if set) from empty section headers.
+# An empty section header has sh_addr == 0 and sh_size == 0.
+# This problem has only been seen on Solaris X64, but we call this tool
+# on all Solaris builds just in case.
+	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO)
-	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
+# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
+# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
+#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
+	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJSIG_DEBUGINFO) $@
   ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(STRIP) $@
   else
@@ -66,12 +78,19 @@
     endif
   endif
 	[ -f $(LIBJSIG_G_DEBUGINFO) ] || { ln -s $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO); }
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+	$(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO)
+	$(RM) $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO)
+	[ -f $(LIBJSIG_G_DIZ) ] || { ln -s $(LIBJSIG_DIZ) $(LIBJSIG_G_DIZ); }
+  endif
 endif
 
 install_jsig: $(LIBJSIG)
 	@echo "Copying $(LIBJSIG) to $(DEST_JSIG)"
 	$(QUIETLY) test -f $(LIBJSIG_DEBUGINFO) && \
 	    cp -f $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO)
+	$(QUIETLY) test -f $(LIBJSIG_DIZ) && \
+	    cp -f $(LIBJSIG_DIZ) $(DEST_JSIG_DIZ)
 	$(QUIETLY) cp -f $(LIBJSIG) $(DEST_JSIG) && echo "Done"
 
 .PHONY: install_jsig
--- a/make/solaris/makefiles/saproc.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/solaris/makefiles/saproc.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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
@@ -33,7 +33,9 @@
 LIBSAPROC_G = lib$(SAPROC_G).so
 
 LIBSAPROC_DEBUGINFO   = lib$(SAPROC).debuginfo
+LIBSAPROC_DIZ         = lib$(SAPROC).diz
 LIBSAPROC_G_DEBUGINFO = lib$(SAPROC_G).debuginfo
+LIBSAPROC_G_DIZ       = lib$(SAPROC_G).diz
 
 AGENT_DIR = $(GAMMADIR)/agent
 
@@ -45,6 +47,7 @@
 
 DEST_SAPROC           = $(JDK_LIBDIR)/$(LIBSAPROC)
 DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO)
+DEST_SAPROC_DIZ       = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ)
 
 # if $(AGENT_DIR) does not exist, we don't build SA
 
@@ -87,7 +90,7 @@
 # when actually building on Nevada-B158 or earlier:
 #SOLARIS_11_B159_OR_LATER=-DSOLARIS_11_B159_OR_LATER
 
-$(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
+$(LIBSAPROC): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(SASRCFILES) $(SAMAPFILE)
 	$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
 	  echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
 	  exit 1; \
@@ -105,9 +108,18 @@
 	           -o $@                                                \
 	           -ldl -ldemangle -lthread -lc
 	[ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
-ifneq ($(OBJCOPY),)
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
+# Clear the SHF_ALLOC flag (if set) from empty section headers.
+# An empty section header has sh_addr == 0 and sh_size == 0.
+# This problem has only been seen on Solaris X64, but we call this tool
+# on all Solaris builds just in case.
+	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
-	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
+# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
+# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
+#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
+	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBSAPROC_DEBUGINFO) $@
   ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(STRIP) $@
   else
@@ -117,6 +129,11 @@
     endif
   endif
 	[ -f $(LIBSAPROC_G_DEBUGINFO) ] || { ln -s $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO); }
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+	$(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO)
+	$(RM) $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO)
+	[ -f $(LIBSAPROC_G_DIZ) ] || { ln -s $(LIBSAPROC_DIZ) $(LIBSAPROC_G_DIZ); }
+  endif
 endif
 
 install_saproc: $(BULDLIBSAPROC)
@@ -124,6 +141,8 @@
 	  echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)";     \
 	  test -f $(LIBSAPROC_DEBUGINFO) &&             \
 	    cp -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO); \
+	  test -f $(LIBSAPROC_DIZ) &&             \
+	    cp -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ); \
 	  cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done";  \
 	fi
 
--- a/make/solaris/makefiles/sparcWorks.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/solaris/makefiles/sparcWorks.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2012, 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
@@ -484,12 +484,12 @@
 # The -g0 setting allows the C++ frontend to inline, which is a big win.
 # The -xs setting disables 'lazy debug info' which puts everything in
 # the .so instead of requiring the '.o' files.
-ifneq ($(OBJCOPY),)
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   OPT_CFLAGS += -g0 -xs
 endif
 DEBUG_CFLAGS = -g
 FASTDEBUG_CFLAGS = -g0
-ifneq ($(OBJCOPY),)
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   DEBUG_CFLAGS += -xs
   FASTDEBUG_CFLAGS += -xs
 endif
--- a/make/solaris/makefiles/vm.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/solaris/makefiles/vm.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2012, 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
@@ -56,7 +56,7 @@
 INCLUDES += $(Src_Dirs_I:%=-I%)
 
 # SYMFLAG is used by {dtrace,jsig,saproc}.make.
-ifneq ($(OBJCOPY),)
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   # always build with debug info when we can create .debuginfo files
   # and disable 'lazy debug info' so the .so has everything.
   SYMFLAG = -g -xs
@@ -145,6 +145,14 @@
 include $(MAKEFILES_DIR)/dtrace.make
 
 #----------------------------------------------------------------------
+# add_gnu_debuglink tool
+include $(MAKEFILES_DIR)/add_gnu_debuglink.make
+
+#----------------------------------------------------------------------
+# fix_empty_sec_hdr_flags tool
+include $(MAKEFILES_DIR)/fix_empty_sec_hdr_flags.make
+
+#----------------------------------------------------------------------
 # JVM
 
 JVM      = jvm
@@ -152,7 +160,9 @@
 LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
 
 LIBJVM_DEBUGINFO   = lib$(JVM).debuginfo
+LIBJVM_DIZ         = lib$(JVM).diz
 LIBJVM_G_DEBUGINFO = lib$(JVM)$(G_SUFFIX).debuginfo
+LIBJVM_G_DIZ       = lib$(JVM)$(G_SUFFIX).diz
 
 SPECIAL_PATHS:=adlc c1 dist gc_implementation opto shark libadt
 
@@ -274,7 +284,7 @@
 LINK_VM = $(LINK_LIB.CXX)
 endif
 # making the library:
-$(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) 
+$(LIBJVM): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(LIBJVM.o) $(LIBJVM_MAPFILE) 
 ifeq ($(filter -sbfast -xsbfast, $(CFLAGS_BROWSE)),)
 	@echo Linking vm...
 	$(QUIETLY) $(LINK_LIB.CXX/PRE_HOOK)
@@ -283,9 +293,18 @@
 	$(QUIETLY) rm -f $@.1 && ln -s $@ $@.1
 	$(QUIETLY) [ -f $(LIBJVM_G) ] || ln -s $@ $(LIBJVM_G)
 	$(QUIETLY) [ -f $(LIBJVM_G).1 ] || ln -s $@.1 $(LIBJVM_G).1
-ifneq ($(OBJCOPY),)
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
+# Clear the SHF_ALLOC flag (if set) from empty section headers.
+# An empty section header has sh_addr == 0 and sh_size == 0.
+# This problem has only been seen on Solaris X64, but we call this tool
+# on all Solaris builds just in case.
+	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO)
-	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
+# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
+# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
+#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
+	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DEBUGINFO) $@
   ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(STRIP) $@
   else
@@ -295,6 +314,11 @@
     endif
   endif
 	$(QUIETLY) [ -f $(LIBJVM_G_DEBUGINFO) ] || ln -s $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+	$(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
+	$(RM) $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
+	[ -f $(LIBJVM_G_DIZ) ] || { ln -s $(LIBJVM_DIZ) $(LIBJVM_G_DIZ); }
+  endif
 endif
 endif # filter -sbfast -xsbfast
 
@@ -302,11 +326,14 @@
 DEST_SUBDIR        = $(JDK_LIBDIR)/$(VM_SUBDIR)
 DEST_JVM           = $(DEST_SUBDIR)/$(LIBJVM)
 DEST_JVM_DEBUGINFO = $(DEST_SUBDIR)/$(LIBJVM_DEBUGINFO)
+DEST_JVM_DIZ       = $(DEST_SUBDIR)/$(LIBJVM_DIZ)
 
 install_jvm: $(LIBJVM)
 	@echo "Copying $(LIBJVM) to $(DEST_JVM)"
 	$(QUIETLY) test -f $(LIBJVM_DEBUGINFO) && \
 	    cp -f $(LIBJVM_DEBUGINFO) $(DEST_JVM_DEBUGINFO)
+	$(QUIETLY) test -f $(LIBJVM_DIZ) && \
+	    cp -f $(LIBJVM_DIZ) $(DEST_JVM_DIZ)
 	$(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done"
 
 #----------------------------------------------------------------------
--- a/make/windows/build.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/windows/build.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2012, 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
@@ -298,6 +298,10 @@
 	@ echo Platform_arch=$(Platform_arch)        		>> $@
 	@ echo Platform_arch_model=$(Platform_arch_model)	>> $@
 	@ sh $(WorkSpace)/make/windows/get_msc_ver.sh		>> $@
+	@ if "$(ENABLE_FULL_DEBUG_SYMBOLS)" NEQ "" echo ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS) >> $@
+	@ if "$(ZIP_DEBUGINFO_FILES)" NEQ "" echo ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES) >> $@
+	@ if "$(RM)" NEQ "" echo RM=$(RM)                       >> $@
+	@ if "$(ZIPEXE)" NEQ "" echo ZIPEXE=$(ZIPEXE)           >> $@
 
 checks: checkVariant checkWorkSpace checkSA
 
--- a/make/windows/makefiles/compile.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/windows/makefiles/compile.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2012, 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
@@ -52,8 +52,10 @@
 # These are always used in all compiles
 CXX_FLAGS=/nologo /W3 /WX
 
-# Let's add debug information always too.
+# Let's add debug information when Full Debug Symbols is enabled
+!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
 CXX_FLAGS=$(CXX_FLAGS) /Zi
+!endif
 
 # Based on BUILDARCH we add some flags and select the default compiler name
 !if "$(BUILDARCH)" == "ia64"
@@ -229,7 +231,10 @@
 LD_FLAGS= $(LD_FLAGS) kernel32.lib user32.lib gdi32.lib winspool.lib \
  comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
  uuid.lib Wsock32.lib winmm.lib /nologo /machine:$(MACHINE) /opt:REF \
- /opt:ICF,8 /map /debug
+ /opt:ICF,8
+!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+LD_FLAGS= $(LD_FLAGS) /map /debug
+!endif
 
 
 !if $(MSC_VER) >= 1600 
--- a/make/windows/makefiles/debug.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/windows/makefiles/debug.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2012, 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
@@ -61,6 +61,12 @@
 # separately.  Use ";#2" for .dll and ";#1" for .exe:
 	$(MT) /manifest $@.manifest /outputresource:$@;#2
 !endif
+!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+!if "$(ZIP_DEBUGINFO_FILES)" == "1"
+	$(ZIPEXE) -q $*.diz $*.map $*.pdb
+	$(RM) $*.map $*.pdb
+!endif
+!endif
 
 !include $(WorkSpace)/make/windows/makefiles/shared.make
 !include $(WorkSpace)/make/windows/makefiles/sa.make
--- a/make/windows/makefiles/defs.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/windows/makefiles/defs.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2012, 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
@@ -107,6 +107,50 @@
   endif
 endif
 
+# Full Debug Symbols has been enabled on Windows since JDK1.4.1 so
+# there is no need for an "earlier than JDK7 check".
+# The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
+# builds is enabled with debug info files ZIP'ed to save space. For
+# BUILD_FLAVOR != product builds, FDS is always enabled, after all a
+# debug build without debug info isn't very useful.
+# The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
+#
+# If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
+# disabled for a BUILD_FLAVOR == product build.
+#
+# Note: Use of a different variable name for the FDS override option
+# versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
+# versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
+# in options via environment variables, use of distinct variables
+# prevents strange behaviours. For example, in a BUILD_FLAVOR !=
+# product build, the FULL_DEBUG_SYMBOLS environment variable will be
+# 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
+# the same variable name is used, then different values can be picked
+# up by different parts of the build. Just to be clear, we only need
+# two variable names because the incoming option value can be
+# overridden in some situations, e.g., a BUILD_FLAVOR != product
+# build.
+
+ifeq ($(BUILD_FLAVOR), product)
+  FULL_DEBUG_SYMBOLS ?= 1
+  ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
+else
+  # debug variants always get Full Debug Symbols (if available)
+  ENABLE_FULL_DEBUG_SYMBOLS = 1
+endif
+_JUNK_ := $(shell \
+  echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
+MAKE_ARGS += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)
+
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ZIP_DEBUGINFO_FILES ?= 1
+else
+  ZIP_DEBUGINFO_FILES=0
+endif
+MAKE_ARGS += ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)
+MAKE_ARGS += RM="$(RM)"
+MAKE_ARGS += ZIPEXE=$(ZIPEXE)
+
 JDK_INCLUDE_SUBDIR=win32
 
 # Library suffix
@@ -179,25 +223,49 @@
 
 EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
 EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.$(LIBRARY_SUFFIX)
-EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.pdb
-EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.map
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
+    EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.diz
+  else
+    EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.pdb
+    EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.map
+  endif
+endif
 EXPORT_LIST += $(EXPORT_LIB_DIR)/jvm.lib
 ifeq ($(ARCH_DATA_MODEL), 32)
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.$(LIBRARY_SUFFIX)
-  EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.pdb
-  EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.map
+  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+    ifeq ($(ZIP_DEBUGINFO_FILES),1)
+      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.diz
+    else
+      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.pdb
+      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.map
+    endif
+  endif
   # kernel vm
   EXPORT_LIST += $(EXPORT_KERNEL_DIR)/Xusage.txt
   EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.$(LIBRARY_SUFFIX)
-  EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.pdb
-  EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.map
+  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+    ifeq ($(ZIP_DEBUGINFO_FILES),1)
+      EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.diz
+    else
+      EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.pdb
+      EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.map
+    endif
+  endif
 endif
 
 ifeq ($(BUILD_WIN_SA), 1)
   EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.$(LIBRARY_SUFFIX)
-  EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.pdb
-  EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.map
+  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+    ifeq ($(ZIP_DEBUGINFO_FILES),1)
+      EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.diz
+    else
+      EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.pdb
+      EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.map
+    endif
+  endif
   EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
   # Must pass this down to nmake.
   MAKE_ARGS += BUILD_WIN_SA=1
--- a/make/windows/makefiles/fastdebug.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/windows/makefiles/fastdebug.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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
@@ -61,6 +61,12 @@
 # separately.  Use ";#2" for .dll and ";#1" for .exe:
 	$(MT) /manifest $@.manifest /outputresource:$@;#2
 !endif
+!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+!if "$(ZIP_DEBUGINFO_FILES)" == "1"
+	$(ZIPEXE) -q $*.diz $*.map $*.pdb
+	$(RM) $*.map $*.pdb
+!endif
+!endif
 
 !include $(WorkSpace)/make/windows/makefiles/shared.make
 !include $(WorkSpace)/make/windows/makefiles/sa.make
--- a/make/windows/makefiles/product.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/windows/makefiles/product.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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
@@ -72,6 +72,12 @@
 # separately.  Use ";#2" for .dll and ";#1" for .exe:
 	$(MT) /manifest $@.manifest /outputresource:$@;#2
 !endif
+!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+!if "$(ZIP_DEBUGINFO_FILES)" == "1"
+	$(ZIPEXE) -q $*.diz $*.map $*.pdb
+	$(RM) $*.map $*.pdb
+!endif
+!endif
 
 !include $(WorkSpace)/make/windows/makefiles/shared.make
 !include $(WorkSpace)/make/windows/makefiles/sa.make
--- a/make/windows/makefiles/sa.make	Sat Aug 04 10:30:57 2012 -0700
+++ b/make/windows/makefiles/sa.make	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -94,13 +94,19 @@
 SA_LD_FLAGS = bufferoverflowU.lib
 !endif
 !else
-SA_CFLAGS = /nologo $(MS_RUNTIME_OPTION) /W3 /Gm $(GX_OPTION) /ZI /Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+SA_CFLAGS = /nologo $(MS_RUNTIME_OPTION) /W3 /Gm $(GX_OPTION) /Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+SA_CFLAGS = $(SA_CFLAGS) /ZI
+!endif
 !endif
 !if "$(MT)" != ""
 SA_LD_FLAGS = /manifest $(SA_LD_FLAGS)
 !endif
 SASRCFILE = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp
-SA_LFLAGS = $(SA_LD_FLAGS) /nologo /subsystem:console /map /debug /machine:$(MACHINE)
+SA_LFLAGS = $(SA_LD_FLAGS) /nologo /subsystem:console /machine:$(MACHINE)
+!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+SA_LFLAGS = $(SA_LFLAGS) /map /debug
+!endif
 
 # Note that we do not keep sawindbj.obj around as it would then
 # get included in the dumpbin command in build_vm_def.sh
@@ -114,14 +120,20 @@
 	  /I"$(BootStrapDir)/include" /I"$(BootStrapDir)/include/win32" 
 	  /I"$(GENERATED)" $(SA_CFLAGS)
 	  $(SASRCFILE)
-	  /out:sawindbg.obj
+	  /out:$*.obj
 <<
 	set LIB=$(SA_LIB)$(LIB)
-	$(LD) /out:$@ /DLL sawindbg.obj dbgeng.lib $(SA_LFLAGS)
+	$(LD) /out:$@ /DLL $*.obj dbgeng.lib $(SA_LFLAGS)
 !if "$(MT)" != ""
 	$(MT) /manifest $(@F).manifest /outputresource:$(@F);#2
 !endif
-	-@rm -f sawindbg.obj
+!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+!if "$(ZIP_DEBUGINFO_FILES)" == "1"
+	$(ZIPEXE) -q $*.diz $*.map $*.pdb
+	$(RM) $*.map $*.pdb
+!endif
+!endif
+	-@rm -f $*.obj
 
 cleanall :
 	rm -rf $(GENERATED:\=/)/saclasses
--- a/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -238,9 +238,12 @@
 
   Register result = dst->as_register();
   {
-    // Get a pointer to the first character of string0 in tmp0 and get string0.count in str0
-    // Get a pointer to the first character of string1 in tmp1 and get string1.count in str1
-    // Also, get string0.count-string1.count in o7 and get the condition code set
+    // Get a pointer to the first character of string0 in tmp0
+    //   and get string0.length() in str0
+    // Get a pointer to the first character of string1 in tmp1
+    //   and get string1.length() in str1
+    // Also, get string0.length()-string1.length() in
+    //   o7 and get the condition code set
     // Note: some instructions have been hoisted for better instruction scheduling
 
     Register tmp0 = L0;
@@ -248,27 +251,40 @@
     Register tmp2 = L2;
 
     int  value_offset = java_lang_String:: value_offset_in_bytes(); // char array
-    int offset_offset = java_lang_String::offset_offset_in_bytes(); // first character position
-    int  count_offset = java_lang_String:: count_offset_in_bytes();
-
-    __ load_heap_oop(str0, value_offset, tmp0);
-    __ ld(str0, offset_offset, tmp2);
-    __ add(tmp0, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp0);
-    __ ld(str0, count_offset, str0);
-    __ sll(tmp2, exact_log2(sizeof(jchar)), tmp2);
+    if (java_lang_String::has_offset_field()) {
+      int offset_offset = java_lang_String::offset_offset_in_bytes(); // first character position
+      int  count_offset = java_lang_String:: count_offset_in_bytes();
+      __ load_heap_oop(str0, value_offset, tmp0);
+      __ ld(str0, offset_offset, tmp2);
+      __ add(tmp0, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp0);
+      __ ld(str0, count_offset, str0);
+      __ sll(tmp2, exact_log2(sizeof(jchar)), tmp2);
+    } else {
+      __ load_heap_oop(str0, value_offset, tmp1);
+      __ add(tmp1, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp0);
+      __ ld(tmp1, arrayOopDesc::length_offset_in_bytes(), str0);
+    }
 
     // str1 may be null
     add_debug_info_for_null_check_here(info);
 
-    __ load_heap_oop(str1, value_offset, tmp1);
-    __ add(tmp0, tmp2, tmp0);
-
-    __ ld(str1, offset_offset, tmp2);
-    __ add(tmp1, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp1);
-    __ ld(str1, count_offset, str1);
-    __ sll(tmp2, exact_log2(sizeof(jchar)), tmp2);
+    if (java_lang_String::has_offset_field()) {
+      int offset_offset = java_lang_String::offset_offset_in_bytes(); // first character position
+      int  count_offset = java_lang_String:: count_offset_in_bytes();
+      __ load_heap_oop(str1, value_offset, tmp1);
+      __ add(tmp0, tmp2, tmp0);
+
+      __ ld(str1, offset_offset, tmp2);
+      __ add(tmp1, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp1);
+      __ ld(str1, count_offset, str1);
+      __ sll(tmp2, exact_log2(sizeof(jchar)), tmp2);
+      __ add(tmp1, tmp2, tmp1);
+    } else {
+      __ load_heap_oop(str1, value_offset, tmp2);
+      __ add(tmp2, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp1);
+      __ ld(tmp2, arrayOopDesc::length_offset_in_bytes(), str1);
+    }
     __ subcc(str0, str1, O7);
-    __ add(tmp1, tmp2, tmp1);
   }
 
   {
@@ -302,7 +318,7 @@
     // Shift base0 and base1 to the end of the arrays, negate limit
     __ add(base0, limit, base0);
     __ add(base1, limit, base1);
-    __ neg(limit);  // limit = -min{string0.count, strin1.count}
+    __ neg(limit);  // limit = -min{string0.length(), string1.length()}
 
     __ lduh(base0, limit, chr0);
     __ bind(Lloop);
@@ -3231,6 +3247,26 @@
   // no-op on TSO
 }
 
+void LIR_Assembler::membar_loadload() {
+  // no-op
+  //__ membar(Assembler::Membar_mask_bits(Assembler::loadload));
+}
+
+void LIR_Assembler::membar_storestore() {
+  // no-op
+  //__ membar(Assembler::Membar_mask_bits(Assembler::storestore));
+}
+
+void LIR_Assembler::membar_loadstore() {
+  // no-op
+  //__ membar(Assembler::Membar_mask_bits(Assembler::loadstore));
+}
+
+void LIR_Assembler::membar_storeload() {
+  __ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad));
+}
+
+
 // Pack two sequential registers containing 32 bit values
 // into a single 64 bit register.
 // src and src->successor() are packed into dst
--- a/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -977,10 +977,10 @@
   if (!x->klass()->is_loaded() || PatchALot) {
     patching_info = state_for(x, x->state_before());
 
-    // cannot re-use same xhandlers for multiple CodeEmitInfos, so
-    // clone all handlers.  This is handled transparently in other
-    // places by the CodeEmitInfo cloning logic but is handled
-    // specially here because a stub isn't being used.
+    // Cannot re-use same xhandlers for multiple CodeEmitInfos, so
+    // clone all handlers (NOTE: Usually this is handled transparently
+    // by the CodeEmitInfo cloning logic in CodeStub constructors but
+    // is done explicitly here because a stub isn't being used).
     x->set_exception_handlers(new XHandlers(x->exception_handlers()));
   }
   CodeEmitInfo* info = state_for(x, x->state());
--- a/src/cpu/x86/vm/assembler_x86.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/cpu/x86/vm/assembler_x86.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -528,10 +528,12 @@
     if (which == end_pc_operand)  return ip + (is_64bit ? 8 : 4);
     // these asserts are somewhat nonsensical
 #ifndef _LP64
-    assert(which == imm_operand || which == disp32_operand, "");
+    assert(which == imm_operand || which == disp32_operand,
+           err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip));
 #else
     assert((which == call32_operand || which == imm_operand) && is_64bit ||
-           which == narrow_oop_operand && !is_64bit, "");
+           which == narrow_oop_operand && !is_64bit,
+           err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip));
 #endif // _LP64
     return ip;
 
--- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -505,19 +505,28 @@
 
   // Get addresses of first characters from both Strings
   __ load_heap_oop(rsi, Address(rax, java_lang_String::value_offset_in_bytes()));
-  __ movptr       (rcx, Address(rax, java_lang_String::offset_offset_in_bytes()));
-  __ lea          (rsi, Address(rsi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
-
+  if (java_lang_String::has_offset_field()) {
+    __ movptr     (rcx, Address(rax, java_lang_String::offset_offset_in_bytes()));
+    __ movl       (rax, Address(rax, java_lang_String::count_offset_in_bytes()));
+    __ lea        (rsi, Address(rsi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
+  } else {
+    __ movl       (rax, Address(rsi, arrayOopDesc::length_offset_in_bytes()));
+    __ lea        (rsi, Address(rsi, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
+  }
 
   // rbx, may be NULL
   add_debug_info_for_null_check_here(info);
   __ load_heap_oop(rdi, Address(rbx, java_lang_String::value_offset_in_bytes()));
-  __ movptr       (rcx, Address(rbx, java_lang_String::offset_offset_in_bytes()));
-  __ lea          (rdi, Address(rdi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
+  if (java_lang_String::has_offset_field()) {
+    __ movptr     (rcx, Address(rbx, java_lang_String::offset_offset_in_bytes()));
+    __ movl       (rbx, Address(rbx, java_lang_String::count_offset_in_bytes()));
+    __ lea        (rdi, Address(rdi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
+  } else {
+    __ movl       (rbx, Address(rdi, arrayOopDesc::length_offset_in_bytes()));
+    __ lea        (rdi, Address(rdi, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
+  }
 
   // compute minimum length (in rax) and difference of lengths (on top of stack)
-  __ movl  (rbx, Address(rbx, java_lang_String::count_offset_in_bytes()));
-  __ movl  (rax, Address(rax, java_lang_String::count_offset_in_bytes()));
   __ mov   (rcx, rbx);
   __ subptr(rbx, rax); // subtract lengths
   __ push  (rbx);      // result
@@ -1462,7 +1471,11 @@
       break;
 
     case Bytecodes::_l2i:
+#ifdef _LP64
+      __ movl(dest->as_register(), src->as_register_lo());
+#else
       move_regs(src->as_register_lo(), dest->as_register());
+#endif
       break;
 
     case Bytecodes::_i2b:
@@ -2654,7 +2667,7 @@
 #endif // _LP64
         }
       } else {
-        ShouldNotReachHere();
+        fatal(err_msg("unexpected type: %s", basictype_to_str(c->type())));
       }
       // cpu register - address
     } else if (opr2->is_address()) {
@@ -3713,6 +3726,25 @@
   // __ store_fence();
 }
 
+void LIR_Assembler::membar_loadload() {
+  // no-op
+  //__ membar(Assembler::Membar_mask_bits(Assembler::loadload));
+}
+
+void LIR_Assembler::membar_storestore() {
+  // no-op
+  //__ membar(Assembler::Membar_mask_bits(Assembler::storestore));
+}
+
+void LIR_Assembler::membar_loadstore() {
+  // no-op
+  //__ membar(Assembler::Membar_mask_bits(Assembler::loadstore));
+}
+
+void LIR_Assembler::membar_storeload() {
+  __ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad));
+}
+
 void LIR_Assembler::get_thread(LIR_Opr result_reg) {
   assert(result_reg->is_register(), "check");
 #ifdef _LP64
--- a/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1095,10 +1095,10 @@
   if (!x->klass()->is_loaded() || PatchALot) {
     patching_info = state_for(x, x->state_before());
 
-    // cannot re-use same xhandlers for multiple CodeEmitInfos, so
-    // clone all handlers.  This is handled transparently in other
-    // places by the CodeEmitInfo cloning logic but is handled
-    // specially here because a stub isn't being used.
+    // Cannot re-use same xhandlers for multiple CodeEmitInfos, so
+    // clone all handlers (NOTE: Usually this is handled transparently
+    // by the CodeEmitInfo cloning logic in CodeStub constructors but
+    // is done explicitly here because a stub isn't being used).
     x->set_exception_handlers(new XHandlers(x->exception_handlers()));
   }
   CodeEmitInfo* info = state_for(x, x->state());
--- a/src/cpu/x86/vm/vm_version_x86.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/cpu/x86/vm/vm_version_x86.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -65,8 +65,8 @@
 
   address generate_getPsrInfo() {
     // Flags to test CPU type.
-    const uint32_t EFL_AC           = 0x40000;
-    const uint32_t EFL_ID           = 0x200000;
+    const uint32_t HS_EFL_AC           = 0x40000;
+    const uint32_t HS_EFL_ID           = 0x200000;
     // Values for when we don't have a CPUID instruction.
     const int      CPU_FAMILY_SHIFT = 8;
     const uint32_t CPU_FAMILY_386   = (3 << CPU_FAMILY_SHIFT);
@@ -100,7 +100,7 @@
     //
     // if we are unable to change the AC flag, we have a 386
     //
-    __ xorl(rax, EFL_AC);
+    __ xorl(rax, HS_EFL_AC);
     __ push(rax);
     __ popf();
     __ pushf();
@@ -118,7 +118,7 @@
     //
     __ bind(detect_486);
     __ mov(rax, rcx);
-    __ xorl(rax, EFL_ID);
+    __ xorl(rax, HS_EFL_ID);
     __ push(rax);
     __ popf();
     __ pushf();
--- a/src/cpu/x86/vm/x86_32.ad	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/cpu/x86/vm/x86_32.ad	Sun Aug 12 15:23:07 2012 -0700
@@ -5586,8 +5586,9 @@
   ins_pipe( ialu_reg_reg);
 %}
 
-instruct bytes_reverse_unsigned_short(eRegI dst) %{
+instruct bytes_reverse_unsigned_short(eRegI dst, eFlagsReg cr) %{
   match(Set dst (ReverseBytesUS dst));
+  effect(KILL cr);
 
   format %{ "BSWAP  $dst\n\t" 
             "SHR    $dst,16\n\t" %}
@@ -5598,8 +5599,9 @@
   ins_pipe( ialu_reg );
 %}
 
-instruct bytes_reverse_short(eRegI dst) %{
+instruct bytes_reverse_short(eRegI dst, eFlagsReg cr) %{
   match(Set dst (ReverseBytesS dst));
+  effect(KILL cr);
 
   format %{ "BSWAP  $dst\n\t" 
             "SAR    $dst,16\n\t" %}
@@ -5760,9 +5762,10 @@
 
 //---------- Population Count Instructions -------------------------------------
 
-instruct popCountI(eRegI dst, eRegI src) %{
+instruct popCountI(eRegI dst, eRegI src, eFlagsReg cr) %{
   predicate(UsePopCountInstruction);
   match(Set dst (PopCountI src));
+  effect(KILL cr);
 
   format %{ "POPCNT $dst, $src" %}
   ins_encode %{
@@ -5771,9 +5774,10 @@
   ins_pipe(ialu_reg);
 %}
 
-instruct popCountI_mem(eRegI dst, memory mem) %{
+instruct popCountI_mem(eRegI dst, memory mem, eFlagsReg cr) %{
   predicate(UsePopCountInstruction);
   match(Set dst (PopCountI (LoadI mem)));
+  effect(KILL cr);
 
   format %{ "POPCNT $dst, $mem" %}
   ins_encode %{
--- a/src/cpu/x86/vm/x86_64.ad	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/cpu/x86/vm/x86_64.ad	Sun Aug 12 15:23:07 2012 -0700
@@ -3361,15 +3361,6 @@
   interface(CONST_INTER);
 %}
 
-operand immP_poll() %{
-  predicate(n->get_ptr() != 0 && n->get_ptr() == (intptr_t)os::get_polling_page());
-  match(ConP);
-
-  // formats are generated automatically for constants and base registers
-  format %{ %}
-  interface(CONST_INTER);
-%}
-
 // Pointer Immediate
 operand immN() %{
   match(ConN);
@@ -5718,16 +5709,6 @@
   ins_pipe(ialu_reg);
 %}
 
-instruct loadConP_poll(rRegP dst, immP_poll src) %{
-  match(Set dst src);
-  format %{ "movq    $dst, $src\t!ptr" %}
-  ins_encode %{
-    AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_type);
-    __ lea($dst$$Register, polling_page);
-  %}
-  ins_pipe(ialu_reg_fat);
-%}
-
 instruct loadConP31(rRegP dst, immP31 src, rFlagsReg cr)
 %{
   match(Set dst src);
@@ -6428,14 +6409,14 @@
   match(Set dst (ReverseBytesL dst));
 
   format %{ "bswapq  $dst" %}
-
   opcode(0x0F, 0xC8); /* Opcode 0F /C8 */
   ins_encode( REX_reg_wide(dst), OpcP, opc2_reg(dst) );
   ins_pipe( ialu_reg);
 %}
 
-instruct bytes_reverse_unsigned_short(rRegI dst) %{
+instruct bytes_reverse_unsigned_short(rRegI dst, rFlagsReg cr) %{
   match(Set dst (ReverseBytesUS dst));
+  effect(KILL cr);
 
   format %{ "bswapl  $dst\n\t"
             "shrl    $dst,16\n\t" %}
@@ -6446,8 +6427,9 @@
   ins_pipe( ialu_reg );
 %}
 
-instruct bytes_reverse_short(rRegI dst) %{
+instruct bytes_reverse_short(rRegI dst, rFlagsReg cr) %{
   match(Set dst (ReverseBytesS dst));
+  effect(KILL cr);
 
   format %{ "bswapl  $dst\n\t"
             "sar     $dst,16\n\t" %}
@@ -6575,9 +6557,10 @@
 
 //---------- Population Count Instructions -------------------------------------
 
-instruct popCountI(rRegI dst, rRegI src) %{
+instruct popCountI(rRegI dst, rRegI src, rFlagsReg cr) %{
   predicate(UsePopCountInstruction);
   match(Set dst (PopCountI src));
+  effect(KILL cr);
 
   format %{ "popcnt  $dst, $src" %}
   ins_encode %{
@@ -6586,9 +6569,10 @@
   ins_pipe(ialu_reg);
 %}
 
-instruct popCountI_mem(rRegI dst, memory mem) %{
+instruct popCountI_mem(rRegI dst, memory mem, rFlagsReg cr) %{
   predicate(UsePopCountInstruction);
   match(Set dst (PopCountI (LoadI mem)));
+  effect(KILL cr);
 
   format %{ "popcnt  $dst, $mem" %}
   ins_encode %{
@@ -6598,9 +6582,10 @@
 %}
 
 // Note: Long.bitCount(long) returns an int.
-instruct popCountL(rRegI dst, rRegL src) %{
+instruct popCountL(rRegI dst, rRegL src, rFlagsReg cr) %{
   predicate(UsePopCountInstruction);
   match(Set dst (PopCountL src));
+  effect(KILL cr);
 
   format %{ "popcnt  $dst, $src" %}
   ins_encode %{
@@ -6610,9 +6595,10 @@
 %}
 
 // Note: Long.bitCount(long) returns an int.
-instruct popCountL_mem(rRegI dst, memory mem) %{
+instruct popCountL_mem(rRegI dst, memory mem, rFlagsReg cr) %{
   predicate(UsePopCountInstruction);
   match(Set dst (PopCountL (LoadL mem)));
+  effect(KILL cr);
 
   format %{ "popcnt  $dst, $mem" %}
   ins_encode %{
--- a/src/cpu/zero/vm/cppInterpreter_zero.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1026,6 +1026,16 @@
         java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle);
       oop arg = VMSLOTS_OBJECT(arg_slot);
       jvalue arg_value;
+      if (arg == NULL) {
+        // queue a nullpointer exception for the caller
+        stack->set_sp(calculate_unwind_sp(stack, method_handle));
+        CALL_VM_NOCHECK_NOFIX(
+          throw_exception(
+            thread, vmSymbols::java_lang_NullPointerException()));
+        // NB all oops trashed!
+        assert(HAS_PENDING_EXCEPTION, "should do");
+        return;
+      }
       BasicType arg_type = java_lang_boxing_object::get_value(arg, &arg_value);
       if (arg_type == T_LONG || arg_type == T_DOUBLE) {
         intptr_t *unwind_sp = calculate_unwind_sp(stack, method_handle);
@@ -1112,6 +1122,15 @@
       case T_SHORT:
         return;
       }
+      // INT results sometimes need narrowing
+    case T_BOOLEAN:
+    case T_CHAR:
+    case T_BYTE:
+    case T_SHORT:
+      switch (src_rtype) {
+      case T_INT:
+        return;
+      }
     }
 
     tty->print_cr("unhandled conversion:");
--- a/src/os/bsd/vm/attachListener_bsd.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/os/bsd/vm/attachListener_bsd.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
@@ -206,13 +206,18 @@
   // put in listen mode, set permissions, and rename into place
   res = ::listen(listener, 5);
   if (res == 0) {
-      RESTARTABLE(::chmod(initial_path, S_IREAD|S_IWRITE), res);
+    RESTARTABLE(::chmod(initial_path, S_IREAD|S_IWRITE), res);
+    if (res == 0) {
+      // make sure the file is owned by the effective user and effective group
+      // (this is the default on linux, but not on mac os)
+      RESTARTABLE(::chown(initial_path, geteuid(), getegid()), res);
       if (res == 0) {
-          RESTARTABLE(::chown(initial_path, geteuid(), getegid()), res);
-          if (res == 0) {
-              res = ::rename(initial_path, path);
-          }
+        RESTARTABLE(::chown(initial_path, geteuid(), getegid()), res);
+        if (res == 0) {
+          res = ::rename(initial_path, path);
+        }
       }
+    }
   }
   if (res == -1) {
     RESTARTABLE(::close(listener), res);
--- a/src/os/bsd/vm/osThread_bsd.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/os/bsd/vm/osThread_bsd.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -49,7 +49,11 @@
 
 void OSThread::pd_initialize() {
   assert(this != NULL, "check");
+#ifdef __APPLE__
+  _thread_id        = 0;
+#else
   _thread_id        = NULL;
+#endif
   _pthread_id       = NULL;
   _siginfo = NULL;
   _ucontext = NULL;
--- a/src/os/bsd/vm/osThread_bsd.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/os/bsd/vm/osThread_bsd.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -40,10 +40,17 @@
  private:
 
 #ifdef _ALLBSD_SOURCE
-  // _thread_id and _pthread_id are the same on BSD
-  // keep both to minimize code divergence in os_bsd.cpp
+
+#ifdef __APPLE__
+  thread_t  _thread_id;
+#else
   pthread_t _thread_id;
+#endif
+
+  // _pthread_id is the pthread id, which is used by library calls
+  // (e.g. pthread_kill).
   pthread_t _pthread_id;
+
 #else
   // _thread_id is kernel thread id (similar to LWP id on Solaris). Each
   // thread has a unique thread_id (BsdThreads or NPTL). It can be used
@@ -64,9 +71,15 @@
   void    set_caller_sigmask(sigset_t sigmask)  { _caller_sigmask = sigmask; }
 
 #ifdef _ALLBSD_SOURCE
+#ifdef __APPLE__
+  thread_t thread_id() const {
+    return _thread_id;
+  }
+#else
   pthread_t thread_id() const {
     return _thread_id;
   }
+#endif
 #else
   pid_t thread_id() const {
     return _thread_id;
@@ -84,9 +97,15 @@
   }
 #endif // ASSERT
 #ifdef _ALLBSD_SOURCE
+#ifdef __APPLE__
+  void set_thread_id(thread_t id) {
+    _thread_id = id;
+  }
+#else
   void set_thread_id(pthread_t id) {
     _thread_id = id;
   }
+#endif
 #else
   void set_thread_id(pid_t id) {
     _thread_id = id;
--- a/src/os/bsd/vm/os_bsd.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/os/bsd/vm/os_bsd.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -998,8 +998,13 @@
   }
 
 #ifdef _ALLBSD_SOURCE
+#ifdef __APPLE__
+  // thread_id is mach thread on macos
+  osthread->set_thread_id(::mach_thread_self());
+#else
   // thread_id is pthread_id on BSD
   osthread->set_thread_id(::pthread_self());
+#endif
 #else
   // thread_id is kernel thread id (similar to Solaris LWP id)
   osthread->set_thread_id(os::Bsd::gettid());
@@ -1190,7 +1195,11 @@
 
   // Store pthread info into the OSThread
 #ifdef _ALLBSD_SOURCE
+#ifdef __APPLE__
+  osthread->set_thread_id(::mach_thread_self());
+#else
   osthread->set_thread_id(::pthread_self());
+#endif
 #else
   osthread->set_thread_id(os::Bsd::gettid());
 #endif
@@ -1807,7 +1816,13 @@
   return n;
 }
 
-intx os::current_thread_id() { return (intx)pthread_self(); }
+intx os::current_thread_id() {
+#ifdef __APPLE__
+  return (intx)::mach_thread_self();
+#else
+  return (intx)::pthread_self();
+#endif
+}
 int os::current_process_id() {
 
   // Under the old bsd thread library, bsd gives each thread
@@ -2325,93 +2340,21 @@
 #endif
 }
 
+void os::print_os_info_brief(outputStream* st) {
+  st->print("Bsd");
+
+  os::Posix::print_uname_info(st);
+}
 
 void os::print_os_info(outputStream* st) {
   st->print("OS:");
-
-  // Try to identify popular distros.
-  // Most Bsd distributions have /etc/XXX-release file, which contains
-  // the OS version string. Some have more than one /etc/XXX-release file
-  // (e.g. Mandrake has both /etc/mandrake-release and /etc/redhat-release.),
-  // so the order is important.
-  if (!_print_ascii_file("/etc/mandrake-release", st) &&
-      !_print_ascii_file("/etc/sun-release", st) &&
-      !_print_ascii_file("/etc/redhat-release", st) &&
-      !_print_ascii_file("/etc/SuSE-release", st) &&
-      !_print_ascii_file("/etc/turbobsd-release", st) &&
-      !_print_ascii_file("/etc/gentoo-release", st) &&
-      !_print_ascii_file("/etc/debian_version", st) &&
-      !_print_ascii_file("/etc/ltib-release", st) &&
-      !_print_ascii_file("/etc/angstrom-version", st)) {
-      st->print("Bsd");
-  }
-  st->cr();
-
-  // kernel
-  st->print("uname:");
-  struct utsname name;
-  uname(&name);
-  st->print(name.sysname); st->print(" ");
-  st->print(name.release); st->print(" ");
-  st->print(name.version); st->print(" ");
-  st->print(name.machine);
-  st->cr();
-
-#ifndef _ALLBSD_SOURCE
-  // Print warning if unsafe chroot environment detected
-  if (unsafe_chroot_detected) {
-    st->print("WARNING!! ");
-    st->print_cr(unstable_chroot_error);
-  }
-
-  // libc, pthread
-  st->print("libc:");
-  st->print(os::Bsd::glibc_version()); st->print(" ");
-  st->print(os::Bsd::libpthread_version()); st->print(" ");
-  if (os::Bsd::is_BsdThreads()) {
-     st->print("(%s stack)", os::Bsd::is_floating_stack() ? "floating" : "fixed");
-  }
-  st->cr();
-#endif
-
-  // rlimit
-  st->print("rlimit:");
-  struct rlimit rlim;
-
-  st->print(" STACK ");
-  getrlimit(RLIMIT_STACK, &rlim);
-  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%uk", rlim.rlim_cur >> 10);
-
-  st->print(", CORE ");
-  getrlimit(RLIMIT_CORE, &rlim);
-  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%uk", rlim.rlim_cur >> 10);
-
-  st->print(", NPROC ");
-  getrlimit(RLIMIT_NPROC, &rlim);
-  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%d", rlim.rlim_cur);
-
-  st->print(", NOFILE ");
-  getrlimit(RLIMIT_NOFILE, &rlim);
-  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%d", rlim.rlim_cur);
-
-#ifndef _ALLBSD_SOURCE
-  st->print(", AS ");
-  getrlimit(RLIMIT_AS, &rlim);
-  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%uk", rlim.rlim_cur >> 10);
-  st->cr();
-
-  // load average
-  st->print("load average:");
-  double loadavg[3];
-  os::loadavg(loadavg, 3);
-  st->print("%0.02f %0.02f %0.02f", loadavg[0], loadavg[1], loadavg[2]);
-  st->cr();
-#endif
+  st->print("Bsd");
+
+  os::Posix::print_uname_info(st);
+
+  os::Posix::print_rlimit_info(st);
+
+  os::Posix::print_load_average(st);
 }
 
 void os::pd_print_cpu_info(outputStream* st) {
@@ -5176,9 +5119,9 @@
   struct thread_basic_info tinfo;
   mach_msg_type_number_t tcount = THREAD_INFO_MAX;
   kern_return_t kr;
-  mach_port_t mach_thread;
-
-  mach_thread = pthread_mach_thread_np(thread->osthread()->thread_id());
+  thread_t mach_thread;
+
+  mach_thread = thread->osthread()->thread_id();
   kr = thread_info(mach_thread, THREAD_BASIC_INFO, (thread_info_t)&tinfo, &tcount);
   if (kr != KERN_SUCCESS)
     return -1;
--- a/src/os/linux/vm/os_linux.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/os/linux/vm/os_linux.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -2020,15 +2020,43 @@
    }
 }
 
+void os::print_os_info_brief(outputStream* st) {
+  os::Linux::print_distro_info(st);
+
+  os::Posix::print_uname_info(st);
+
+  os::Linux::print_libversion_info(st);
+
+}
 
 void os::print_os_info(outputStream* st) {
   st->print("OS:");
 
-  // Try to identify popular distros.
-  // Most Linux distributions have /etc/XXX-release file, which contains
-  // the OS version string. Some have more than one /etc/XXX-release file
-  // (e.g. Mandrake has both /etc/mandrake-release and /etc/redhat-release.),
-  // so the order is important.
+  os::Linux::print_distro_info(st);
+
+  os::Posix::print_uname_info(st);
+
+  // Print warning if unsafe chroot environment detected
+  if (unsafe_chroot_detected) {
+    st->print("WARNING!! ");
+    st->print_cr(unstable_chroot_error);
+  }
+
+  os::Linux::print_libversion_info(st);
+
+  os::Posix::print_rlimit_info(st);
+
+  os::Posix::print_load_average(st);
+
+  os::Linux::print_full_memory_info(st);
+}
+
+// Try to identify popular distros.
+// Most Linux distributions have /etc/XXX-release file, which contains
+// the OS version string. Some have more than one /etc/XXX-release file
+// (e.g. Mandrake has both /etc/mandrake-release and /etc/redhat-release.),
+// so the order is important.
+void os::Linux::print_distro_info(outputStream* st) {
   if (!_print_ascii_file("/etc/mandrake-release", st) &&
       !_print_ascii_file("/etc/sun-release", st) &&
       !_print_ascii_file("/etc/redhat-release", st) &&
@@ -2041,23 +2069,9 @@
       st->print("Linux");
   }
   st->cr();
-
-  // kernel
-  st->print("uname:");
-  struct utsname name;
-  uname(&name);
-  st->print(name.sysname); st->print(" ");
-  st->print(name.release); st->print(" ");
-  st->print(name.version); st->print(" ");
-  st->print(name.machine);
-  st->cr();
-
-  // Print warning if unsafe chroot environment detected
-  if (unsafe_chroot_detected) {
-    st->print("WARNING!! ");
-    st->print_cr(unstable_chroot_error);
-  }
-
+}
+
+void os::Linux::print_libversion_info(outputStream* st) {
   // libc, pthread
   st->print("libc:");
   st->print(os::Linux::glibc_version()); st->print(" ");
@@ -2066,56 +2080,12 @@
      st->print("(%s stack)", os::Linux::is_floating_stack() ? "floating" : "fixed");
   }
   st->cr();
-
-  // rlimit
-  st->print("rlimit:");
-  struct rlimit rlim;
-
-  st->print(" STACK ");
-  getrlimit(RLIMIT_STACK, &rlim);
-  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%uk", rlim.rlim_cur >> 10);
-
-  st->print(", CORE ");
-  getrlimit(RLIMIT_CORE, &rlim);
-  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%uk", rlim.rlim_cur >> 10);
-
-  st->print(", NPROC ");
-  getrlimit(RLIMIT_NPROC, &rlim);
-  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%d", rlim.rlim_cur);
-
-  st->print(", NOFILE ");
-  getrlimit(RLIMIT_NOFILE, &rlim);
-  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%d", rlim.rlim_cur);
-
-  st->print(", AS ");
-  getrlimit(RLIMIT_AS, &rlim);
-  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%uk", rlim.rlim_cur >> 10);
-  st->cr();
-
-  // load average
-  st->print("load average:");
-  double loadavg[3];
-  os::loadavg(loadavg, 3);
-  st->print("%0.02f %0.02f %0.02f", loadavg[0], loadavg[1], loadavg[2]);
-  st->cr();
-
-  // meminfo
-  st->print("\n/proc/meminfo:\n");
-  _print_ascii_file("/proc/meminfo", st);
-  st->cr();
-}
-
-void os::pd_print_cpu_info(outputStream* st) {
-  st->print("\n/proc/cpuinfo:\n");
-  if (!_print_ascii_file("/proc/cpuinfo", st)) {
-    st->print("  <Not Available>");
-  }
-  st->cr();
+}
+
+void os::Linux::print_full_memory_info(outputStream* st) {
+   st->print("\n/proc/meminfo:\n");
+   _print_ascii_file("/proc/meminfo", st);
+   st->cr();
 }
 
 void os::print_memory_info(outputStream* st) {
@@ -2138,6 +2108,14 @@
   st->cr();
 }
 
+void os::pd_print_cpu_info(outputStream* st) {
+  st->print("\n/proc/cpuinfo:\n");
+  if (!_print_ascii_file("/proc/cpuinfo", st)) {
+    st->print("  <Not Available>");
+  }
+  st->cr();
+}
+
 // Taken from /usr/include/bits/siginfo.h  Supposed to be architecture specific
 // but they're the same for all the linux arch that we support
 // and they're the same for solaris but there's no common place to put this.
--- a/src/os/linux/vm/os_linux.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/os/linux/vm/os_linux.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -89,6 +89,10 @@
 
   static bool hugetlbfs_sanity_check(bool warn, size_t page_size);
 
+  static void print_full_memory_info(outputStream* st);
+  static void print_distro_info(outputStream* st);
+  static void print_libversion_info(outputStream* st);
+
  public:
   static void init_thread_fpu_state();
   static int  get_fpu_control_word();
--- a/src/os/posix/vm/os_posix.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/os/posix/vm/os_posix.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -28,6 +28,8 @@
 
 #include <unistd.h>
 #include <sys/resource.h>
+#include <sys/utsname.h>
+
 
 // Check core dump limit and report possible place where core can be found
 void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize) {
@@ -72,3 +74,59 @@
   // don't do anything on posix platforms
   return;
 }
+
+void os::Posix::print_load_average(outputStream* st) {
+  st->print("load average:");
+  double loadavg[3];
+  os::loadavg(loadavg, 3);
+  st->print("%0.02f %0.02f %0.02f", loadavg[0], loadavg[1], loadavg[2]);
+  st->cr();
+}
+
+void os::Posix::print_rlimit_info(outputStream* st) {
+  st->print("rlimit:");
+  struct rlimit rlim;
+
+  st->print(" STACK ");
+  getrlimit(RLIMIT_STACK, &rlim);
+  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
+  else st->print("%uk", rlim.rlim_cur >> 10);
+
+  st->print(", CORE ");
+  getrlimit(RLIMIT_CORE, &rlim);
+  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
+  else st->print("%uk", rlim.rlim_cur >> 10);
+
+  //Isn't there on solaris
+#ifndef TARGET_OS_FAMILY_solaris
+  st->print(", NPROC ");
+  getrlimit(RLIMIT_NPROC, &rlim);
+  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
+  else st->print("%d", rlim.rlim_cur);
+#endif
+
+  st->print(", NOFILE ");
+  getrlimit(RLIMIT_NOFILE, &rlim);
+  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
+  else st->print("%d", rlim.rlim_cur);
+
+  st->print(", AS ");
+  getrlimit(RLIMIT_AS, &rlim);
+  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
+  else st->print("%uk", rlim.rlim_cur >> 10);
+  st->cr();
+}
+
+void os::Posix::print_uname_info(outputStream* st) {
+  // kernel
+  st->print("uname:");
+  struct utsname name;
+  uname(&name);
+  st->print(name.sysname); st->print(" ");
+  st->print(name.release); st->print(" ");
+  st->print(name.version); st->print(" ");
+  st->print(name.machine);
+  st->cr();
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/os/posix/vm/os_posix.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999, 2010, 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 OS_POSIX_VM_OS_POSIX_HPP
+#define OS_POSIX_VM_OS_POSIX_HPP
+class Posix {
+  friend class os;
+
+protected:
+  static void print_distro_info(outputStream* st);
+  static void print_rlimit_info(outputStream* st);
+  static void print_uname_info(outputStream* st);
+  static void print_libversion_info(outputStream* st);
+  static void print_load_average(outputStream* st);
+
+
+};
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/os/solaris/add_gnu_debuglink/add_gnu_debuglink.c	Sun Aug 12 15:23:07 2012 -0700
@@ -0,0 +1,285 @@
+/*
+ * Copyright (c) 2012, 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.
+ *
+ */
+
+/*
+ * Name:        add_gnu_debuglink.c
+ *
+ * Description: Add a ".gnu_debuglink" section that refers to the specified
+ *     debug_info_path to the specified ELF object.
+ *
+ *     This program is adapted from the example program shown on the
+ *     elf(3elf) man page and from code from the Solaris compiler
+ *     driver.
+ */
+
+/*
+ * needed to define SHF_EXCLUDE
+ */
+#define ELF_TARGET_ALL
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <libelf.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static void failure(void);
+static unsigned int gnu_debuglink_crc32(unsigned int crc, unsigned char *buf,
+                                        size_t len);
+
+void
+main(int argc, char ** argv) {
+                                 /* new ELF section name */
+    static char SEC_NAME[] = ".gnu_debuglink";
+
+    unsigned char buffer[8 * 1024];  /* I/O buffer */
+    int           buffer_len;        /* buffer length */
+    char *        debug_info_path;   /* debug info path */
+    void *        ehdr;              /* ELF header */
+    Elf *         elf;               /* ELF descriptor */
+    char *        elf_ident;         /* ELF identity string */
+    char *        elf_obj;           /* elf_obj file */
+    int           fd;                /* descriptor for files */
+    unsigned int  file_crc = 0;      /* CRC for debug info file */
+    int           is_elfclass64;     /* is an ELFCLASS64 file? */
+    Elf_Data *    link_dat;          /* ELF data for new debug info link */
+    Elf_Data *    name_dat;          /* ELF data for new section name */
+    Elf_Scn *     new_scn;           /* new ELF section descriptor */
+    void *        new_shdr;          /* new ELF section header */
+    Elf_Scn *     scn;               /* ELF section descriptor */
+    void *        shdr;              /* ELF section header */
+
+    if (argc != 3) {
+        (void) fprintf(stderr, "Usage: %s debug_info_path elf_obj\n", argv[0]);
+        exit(2);
+    }
+
+    debug_info_path = argv[1];  /* save for later */
+    if ((fd = open(debug_info_path, O_RDONLY)) == -1) {
+        (void) fprintf(stderr, "%s: cannot open file.\n", debug_info_path);
+        exit(3);
+    }
+
+    (void) printf("Computing CRC for '%s'\n", debug_info_path);
+    (void) fflush(stdout);
+    /* compute CRC for the debug info file */
+    for (;;) {
+        int len = read(fd, buffer, sizeof buffer);
+        if (len <= 0) {
+            break;
+        }
+        file_crc = gnu_debuglink_crc32(file_crc, buffer, len);
+    }
+    (void) close(fd);
+
+    /* open the elf_obj */
+    elf_obj = argv[2];
+    if ((fd = open(elf_obj, O_RDWR)) == -1) {
+        (void) fprintf(stderr, "%s: cannot open file.\n", elf_obj);
+        exit(4);
+    }
+
+    (void) printf("Opening '%s' for update\n", elf_obj);
+    (void) fflush(stdout);
+    (void) elf_version(EV_CURRENT);  /* coordinate ELF versions */
+
+    /* obtain the ELF descriptors from the input file */
+    if ((elf = elf_begin(fd, ELF_C_RDWR, NULL)) == NULL) {
+        failure();
+    }
+
+    /* determine if ELFCLASS64 or not? */
+    elf_ident = elf_getident(elf, NULL);
+    is_elfclass64 = (elf_ident[EI_CLASS] == ELFCLASS64);
+
+    /* get the ELF header */
+    if (is_elfclass64) {
+        ehdr = elf64_getehdr(elf);
+    } else {
+        ehdr = elf32_getehdr(elf);
+    }
+    if (ehdr == NULL) {
+        failure();
+    }
+
+    /* get the ELF section descriptor */
+    if (is_elfclass64) {
+        scn = elf_getscn(elf, ((Elf64_Ehdr *) ehdr)->e_shstrndx);
+    } else {
+        scn = elf_getscn(elf, ((Elf32_Ehdr *) ehdr)->e_shstrndx);
+    }
+    if (scn == NULL) {
+        failure();
+    }
+
+    /* get the section header */
+    if (is_elfclass64) {
+        shdr = elf64_getshdr(scn);
+    } else {
+        shdr = elf32_getshdr(scn);
+    }
+    if (shdr == NULL) {
+        failure();
+    }
+
+    (void) printf("Adding ELF data for new section name\n");
+    (void) fflush(stdout);
+    name_dat = elf_newdata(scn);
+    name_dat->d_buf = (void *) SEC_NAME;
+    if (is_elfclass64) {
+        name_dat->d_off = ((Elf64_Shdr *) shdr)->sh_size + 1;
+    } else {
+        name_dat->d_off = ((Elf32_Shdr *) shdr)->sh_size + 1;
+    }
+    name_dat->d_align = 1;
+    name_dat->d_size = strlen(SEC_NAME) + 1;
+
+    new_scn = elf_newscn(elf);
+
+    if (is_elfclass64) {
+        new_shdr = elf64_getshdr(new_scn);
+        ((Elf64_Shdr *) new_shdr)->sh_flags = SHF_EXCLUDE;
+        ((Elf64_Shdr *) new_shdr)->sh_type = SHT_PROGBITS;
+        ((Elf64_Shdr *) new_shdr)->sh_name = ((Elf64_Shdr *) shdr)->sh_size;
+        ((Elf64_Shdr *) new_shdr)->sh_addralign = 1;
+        ((Elf64_Shdr *) shdr)->sh_size += (strlen(SEC_NAME) + 1);
+    } else {
+        new_shdr = elf32_getshdr(new_scn);
+        ((Elf32_Shdr *) new_shdr)->sh_flags = SHF_EXCLUDE;
+        ((Elf32_Shdr *) new_shdr)->sh_type = SHT_PROGBITS;
+        ((Elf32_Shdr *) new_shdr)->sh_name = ((Elf32_Shdr *) shdr)->sh_size;
+        ((Elf32_Shdr *) new_shdr)->sh_addralign = 1;
+        ((Elf32_Shdr *) shdr)->sh_size += (strlen(SEC_NAME) + 1);
+    }
+
+    (void) printf("Adding ELF data for debug_info_path value\n");
+    (void) fflush(stdout);
+    (void) memset(buffer, 0, sizeof buffer);
+    buffer_len = strlen(debug_info_path) + 1;  /* +1 for NUL */
+    (void) strncpy((char *) buffer, debug_info_path, buffer_len);
+    if (buffer_len % 4 != 0) {
+        /* not on a 4 byte boundary so pad to the next one */
+        buffer_len += (4 - buffer_len % 4);
+    }
+    /* save the CRC */
+    (void) memcpy(&buffer[buffer_len], &file_crc, sizeof file_crc);
+    buffer_len += sizeof file_crc;
+
+    link_dat = elf_newdata(new_scn);
+    link_dat->d_type = ELF_T_BYTE;
+    link_dat->d_size = buffer_len;
+    link_dat->d_buf = buffer;
+    link_dat->d_align = 1;
+
+    (void) printf("Saving updates to '%s'\n", elf_obj);
+    (void) fflush(stdout);
+    (void) elf_update(elf, ELF_C_NULL);   /* recalc ELF memory structures */
+    (void) elf_update(elf, ELF_C_WRITE);  /* write out changes to ELF obj */
+    (void) elf_end(elf);                  /* done with ELF obj */
+    (void) close(fd);
+
+    (void) printf("Done updating '%s'\n", elf_obj);
+    (void) fflush(stdout);
+    exit(0);
+}  /* end main */
+
+
+static void
+failure() {
+    (void) fprintf(stderr, "%s\n", elf_errmsg(elf_errno()));
+    exit(5);
+}
+
+
+/*
+ * The CRC used in gnu_debuglink, retrieved from
+ * http://sourceware.org/gdb/current/onlinedocs/gdb/Separate-Debug-Files.html#Separate-Debug-Files.
+ */
+
+static unsigned int
+gnu_debuglink_crc32(unsigned int crc, unsigned char *buf, size_t len) {
+    static const unsigned int crc32_table[256] = {
+        0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
+        0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,
+        0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,
+        0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
+        0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,
+        0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
+        0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,
+        0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
+        0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,
+        0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,
+        0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,
+        0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+        0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,
+        0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
+        0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,
+        0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
+        0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,
+        0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
+        0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,
+        0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
+        0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,
+        0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
+        0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,
+        0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+        0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,
+        0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,
+        0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,
+        0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
+        0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,
+        0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
+        0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,
+        0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
+        0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,
+        0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,
+        0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,
+        0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+        0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,
+        0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
+        0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,
+        0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
+        0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,
+        0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
+        0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,
+        0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
+        0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,
+        0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
+        0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,
+        0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+        0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,
+        0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,
+        0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,
+        0x2d02ef8d
+    };
+
+    unsigned char *end;
+
+    crc = ~crc & 0xffffffff;
+    for (end = buf + len; buf < end; ++buf) {
+        crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8);
+    }
+    return ~crc & 0xffffffff;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/os/solaris/fix_empty_sec_hdr_flags/fix_empty_sec_hdr_flags.c	Sun Aug 12 15:23:07 2012 -0700
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2012, 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.
+ *
+ */
+
+/*
+ * Name:        fix_empty_sec_hdr_flags.c
+ *
+ * Description: Remove the SHF_ALLOC flag from "empty" section headers.
+ *     An "empty" section header has sh_addr == 0 and sh_size == 0.
+ *
+ *     This program is adapted from the example program shown on the
+ *     elf(3elf) man page and from code from the Solaris compiler
+ *     driver.
+ */
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <libelf.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static void failure(void);
+
+void
+main(int argc, char ** argv) {
+    void *        ehdr;           /* ELF header */
+    unsigned int  i;              /* section counter */
+    int           fd;             /* descriptor for file */
+    Elf *         elf;            /* ELF descriptor */
+    char *        elf_ident;      /* ELF identity string */
+    char *        elf_obj;        /* elf_obj file */
+    int           fix_count;      /* number of flags fixed */
+    int           is_elfclass64;  /* is an ELFCLASS64 file? */
+    Elf_Scn *     scn;            /* ELF section descriptor */
+    void *        shdr;           /* ELF section header */
+    Elf_Data *    shstrtab;       /* ELF section header string table */
+
+    if (argc != 2) {
+        (void) fprintf(stderr, "Usage: %s elf_obj\n", argv[0]);
+        exit(2);
+    }
+
+    /* open the elf_obj */
+    elf_obj = argv[1];
+    if ((fd = open(elf_obj, O_RDWR)) == -1) {
+        (void) fprintf(stderr, "%s: cannot open file.\n", elf_obj);
+        exit(3);
+    }
+
+    (void) printf("Opening '%s' for update\n", elf_obj);
+    (void) fflush(stdout);
+    (void) elf_version(EV_CURRENT);  /* coordinate ELF versions */
+
+    /* obtain the ELF descriptors from the input file */
+    if ((elf = elf_begin(fd, ELF_C_RDWR, NULL)) == NULL) {
+        failure();
+    }
+
+    /* determine if ELFCLASS64 or not? */
+    elf_ident = elf_getident(elf, NULL);
+    is_elfclass64 = (elf_ident[EI_CLASS] == ELFCLASS64);
+
+    /* get the ELF header */
+    if (is_elfclass64) {
+        ehdr = elf64_getehdr(elf);
+    } else {
+        ehdr = elf32_getehdr(elf);
+    }
+    if (ehdr == NULL) {
+        failure();
+    }
+
+    /* get the ELF section descriptor */
+    if (is_elfclass64) {
+        scn = elf_getscn(elf, ((Elf64_Ehdr *) ehdr)->e_shstrndx);
+    } else {
+        scn = elf_getscn(elf, ((Elf32_Ehdr *) ehdr)->e_shstrndx);
+    }
+    if (scn == NULL) {
+        failure();
+    }
+
+    /* get the section header string table */
+    shstrtab = elf_getdata(scn, NULL);
+    if (shstrtab == NULL) {
+        failure();
+    }
+
+    fix_count = 0;
+
+    /* traverse the sections of the input file */
+    for (i = 1, scn = NULL; scn = elf_nextscn(elf, scn); i++) {
+        int    has_flag_set;  /* is SHF_ALLOC flag set? */
+        int    is_empty;      /* is section empty? */
+        char * name;          /* short hand pointer */
+
+        /* get the section header */
+        if (is_elfclass64) {
+            shdr = elf64_getshdr(scn);
+        } else {
+            shdr = elf32_getshdr(scn);
+        }
+        if (shdr == NULL) {
+            failure();
+        }
+
+        if (is_elfclass64) {
+            name = (char *)shstrtab->d_buf + ((Elf64_Shdr *) shdr)->sh_name;
+        } else {
+            name = (char *)shstrtab->d_buf + ((Elf32_Shdr *) shdr)->sh_name;
+        }
+
+        if (is_elfclass64) {
+            has_flag_set = ((Elf64_Shdr *) shdr)->sh_flags & SHF_ALLOC;
+            is_empty = ((Elf64_Shdr *) shdr)->sh_addr == 0 &&
+                ((Elf64_Shdr *) shdr)->sh_size == 0;
+        } else {
+            has_flag_set = ((Elf32_Shdr *) shdr)->sh_flags & SHF_ALLOC;
+            is_empty = ((Elf32_Shdr *) shdr)->sh_addr == 0 &&
+                ((Elf32_Shdr *) shdr)->sh_size == 0;
+        }
+
+        if (is_empty && has_flag_set) {
+            (void) printf("section[%u] '%s' is empty, "
+                "but SHF_ALLOC flag is set.\n", i, name);
+            (void) printf("Clearing the SHF_ALLOC flag.\n");
+
+            if (is_elfclass64) {
+                ((Elf64_Shdr *) shdr)->sh_flags &= ~SHF_ALLOC;
+            } else {
+                ((Elf32_Shdr *) shdr)->sh_flags &= ~SHF_ALLOC;
+            }
+            fix_count++;
+        }
+    }  /* end for each ELF section */
+
+    if (fix_count > 0) {
+        (void) printf("Saving %d updates to '%s'\n", fix_count, elf_obj);
+        (void) fflush(stdout);
+        (void) elf_update(elf, ELF_C_NULL);   /* recalc ELF memory structures */
+        (void) elf_update(elf, ELF_C_WRITE);  /* write out changes to ELF obj */
+    } else {
+        (void) printf("No SHF_ALLOC flags needed to be cleared.\n");
+    }
+
+    (void) elf_end(elf);                  /* done with ELF obj */
+    (void) close(fd);
+
+    (void) printf("Done %s '%s'\n",
+               (fix_count > 0) ? "updating" : "with", elf_obj);
+    (void) fflush(stdout);
+    exit(0);
+}  /* end main */
+
+
+static void
+failure() {
+    (void) fprintf(stderr, "%s\n", elf_errmsg(elf_errno()));
+    exit(6);
+}
--- a/src/os/solaris/vm/os_solaris.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/os/solaris/vm/os_solaris.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -2251,61 +2251,44 @@
   return true;
 }
 
+void os::print_os_info_brief(outputStream* st) {
+  os::Solaris::print_distro_info(st);
+
+  os::Posix::print_uname_info(st);
+
+  os::Solaris::print_libversion_info(st);
+}
+
 void os::print_os_info(outputStream* st) {
   st->print("OS:");
 
+  os::Solaris::print_distro_info(st);
+
+  os::Posix::print_uname_info(st);
+
+  os::Solaris::print_libversion_info(st);
+
+  os::Posix::print_rlimit_info(st);
+
+  os::Posix::print_load_average(st);
+}
+
+void os::Solaris::print_distro_info(outputStream* st) {
   if (!_print_ascii_file("/etc/release", st)) {
-    st->print("Solaris");
+      st->print("Solaris");
+    }
+    st->cr();
+}
+
+void os::Solaris::print_libversion_info(outputStream* st) {
+  if (os::Solaris::T2_libthread()) {
+    st->print("  (T2 libthread)");
+  }
+  else {
+    st->print("  (T1 libthread)");
   }
   st->cr();
-
-  // kernel
-  st->print("uname:");
-  struct utsname name;
-  uname(&name);
-  st->print(name.sysname); st->print(" ");
-  st->print(name.release); st->print(" ");
-  st->print(name.version); st->print(" ");
-  st->print(name.machine);
-
-  // libthread
-  if (os::Solaris::T2_libthread()) st->print("  (T2 libthread)");
-  else st->print("  (T1 libthread)");
-  st->cr();
-
-  // rlimit
-  st->print("rlimit:");
-  struct rlimit rlim;
-
-  st->print(" STACK ");
-  getrlimit(RLIMIT_STACK, &rlim);
-  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%uk", rlim.rlim_cur >> 10);
-
-  st->print(", CORE ");
-  getrlimit(RLIMIT_CORE, &rlim);
-  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%uk", rlim.rlim_cur >> 10);
-
-  st->print(", NOFILE ");
-  getrlimit(RLIMIT_NOFILE, &rlim);
-  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%d", rlim.rlim_cur);
-
-  st->print(", AS ");
-  getrlimit(RLIMIT_AS, &rlim);
-  if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity");
-  else st->print("%uk", rlim.rlim_cur >> 10);
-  st->cr();
-
-  // load average
-  st->print("load average:");
-  double loadavg[3];
-  os::loadavg(loadavg, 3);
-  st->print("%0.02f %0.02f %0.02f", loadavg[0], loadavg[1], loadavg[2]);
-  st->cr();
-}
-
+}
 
 static bool check_addr0(outputStream* st) {
   jboolean status = false;
--- a/src/os/solaris/vm/os_solaris.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/os/solaris/vm/os_solaris.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -180,6 +180,9 @@
   // proc_t structure (note that this is a system struct).
   static address _main_stack_base;
 
+  static void print_distro_info(outputStream* st);
+  static void print_libversion_info(outputStream* st);
+
  public:
   static void libthread_init();
   static void synchronization_init();
--- a/src/os/windows/vm/os_windows.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/os/windows/vm/os_windows.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1572,9 +1572,17 @@
    enumerate_modules(pid, _print_module, (void *)st);
 }
 
+void os::print_os_info_brief(outputStream* st) {
+  os::print_os_info(st);
+}
+
 void os::print_os_info(outputStream* st) {
   st->print("OS:");
 
+  os::win32::print_windows_version(st);
+}
+
+void os::win32::print_windows_version(outputStream* st) {
   OSVERSIONINFOEX osvi;
   ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
   osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
@@ -1593,7 +1601,8 @@
     case 5001: st->print(" Windows XP"); break;
     case 5002:
     case 6000:
-    case 6001: {
+    case 6001:
+    case 6002: {
       // Retrieve SYSTEM_INFO from GetNativeSystemInfo call so that we could
       // find out whether we are running on 64 bit processor or not.
       SYSTEM_INFO si;
@@ -1625,6 +1634,14 @@
         }
         if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
             st->print(" , 64 bit");
+      } else if (os_vers == 6002) {
+        if (osvi.wProductType == VER_NT_WORKSTATION) {
+            st->print(" Windows 8");
+        } else {
+            st->print(" Windows Server 2012");
+        }
+        if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
+            st->print(" , 64 bit");
       } else { // future os
         // Unrecognized windows, print out its major and minor versions
         st->print(" Windows NT %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
--- a/src/os/windows/vm/os_windows.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/os/windows/vm/os_windows.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -27,6 +27,7 @@
 // Win32_OS defines the interface to windows operating systems
 
 class win32 {
+  friend class os;
 
  protected:
   static int    _vm_page_size;
@@ -39,6 +40,8 @@
   static bool   _is_windows_2003;
   static bool   _is_windows_server;
 
+  static void print_windows_version(outputStream* st);
+
  public:
   // Windows-specific interface:
   static void   initialize_system_info();
--- a/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -516,17 +516,23 @@
       }
     }
 
-    if (thread->thread_state() == _thread_in_Java) {
+    // We test if stub is already set (by the stack overflow code
+    // above) so it is not overwritten by the code that follows. This
+    // check is not required on other platforms, because on other
+    // platforms we check for SIGSEGV only or SIGBUS only, where here
+    // we have to check for both SIGSEGV and SIGBUS.
+    if (thread->thread_state() == _thread_in_Java && stub == NULL) {
       // Java thread running in Java code => find exception handler if any
       // a fault inside compiled code, the interpreter, or a stub
 
       if ((sig == SIGSEGV || sig == SIGBUS) && os::is_poll_address((address)info->si_addr)) {
         stub = SharedRuntime::get_poll_stub(pc);
-#if defined(__APPLE__) && !defined(AMD64)
+#if defined(__APPLE__)
       // 32-bit Darwin reports a SIGBUS for nearly all memory access exceptions.
+      // 64-bit Darwin may also use a SIGBUS (seen with compressed oops).
       // Catching SIGBUS here prevents the implicit SIGBUS NULL check below from
       // being called, so only do so if the implicit NULL check is not necessary.
-      } else if (sig == SIGBUS && MacroAssembler::needs_explicit_null_check((int)info->si_addr)) {
+      } else if (sig == SIGBUS && MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
 #else
       } else if (sig == SIGBUS /* && info->si_code == BUS_OBJERR */) {
 #endif
--- a/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -29,12 +29,18 @@
 // constants required by the Serviceability Agent. This file is
 // referenced by vmStructs.cpp.
 
+#ifdef __APPLE__
+#define OS_THREAD_ID_TYPE thread_t
+#else
+#define OS_THREAD_ID_TYPE pthread_t
+#endif
+
 #define VM_STRUCTS_OS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field, last_entry) \
                                                                                                                                      \
   /******************************/                                                                                                   \
   /* Threads (NOTE: incomplete) */                                                                                                   \
   /******************************/                                                                                                   \
-  nonstatic_field(OSThread,                      _thread_id,                                      pthread_t)                             \
+  nonstatic_field(OSThread,                      _thread_id,                                      OS_THREAD_ID_TYPE)                 \
   nonstatic_field(OSThread,                      _pthread_id,                                     pthread_t)                         \
   /* This must be the last entry, and must be present */                                                                             \
   last_entry()
@@ -46,7 +52,7 @@
   /* Posix Thread IDs   */                                                \
   /**********************/                                                \
                                                                           \
-  declare_integer_type(pid_t)                                             \
+  declare_unsigned_integer_type(thread_t)                                 \
   declare_unsigned_integer_type(pthread_t)                                \
                                                                           \
   /* This must be the last entry, and must be present */                  \
--- a/src/share/vm/c1/c1_Canonicalizer.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_Canonicalizer.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -908,3 +908,4 @@
 void Canonicalizer::do_ProfileCall(ProfileCall* x) {}
 void Canonicalizer::do_ProfileInvoke(ProfileInvoke* x) {}
 void Canonicalizer::do_RuntimeCall(RuntimeCall* x) {}
+void Canonicalizer::do_MemBar(MemBar* x) {}
--- a/src/share/vm/c1/c1_Canonicalizer.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_Canonicalizer.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -104,6 +104,7 @@
   virtual void do_ProfileCall    (ProfileCall*     x);
   virtual void do_ProfileInvoke  (ProfileInvoke*   x);
   virtual void do_RuntimeCall    (RuntimeCall*     x);
+  virtual void do_MemBar         (MemBar*          x);
 };
 
 #endif // SHARE_VM_C1_C1_CANONICALIZER_HPP
--- a/src/share/vm/c1/c1_GraphBuilder.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_GraphBuilder.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1418,6 +1418,12 @@
     call_register_finalizer();
   }
 
+  bool need_mem_bar = false;
+  if (method()->name() == ciSymbol::object_initializer_name() &&
+      scope()->wrote_final()) {
+    need_mem_bar = true;
+  }
+
   // Check to see whether we are inlining. If so, Return
   // instructions become Gotos to the continuation point.
   if (continuation() != NULL) {
@@ -1437,6 +1443,10 @@
       monitorexit(state()->lock_at(0), SynchronizationEntryBCI);
     }
 
+    if (need_mem_bar) {
+      append(new MemBar(lir_membar_storestore));
+    }
+
     // State at end of inlined method is the state of the caller
     // without the method parameters on stack, including the
     // return value, if any, of the inlined method on operand stack.
@@ -1456,7 +1466,6 @@
     // the continuation point.
     append_with_bci(goto_callee, scope_data()->continuation()->bci());
     incr_num_returns();
-
     return;
   }
 
@@ -1472,6 +1481,10 @@
     append_split(new MonitorExit(receiver, state()->unlock()));
   }
 
+  if (need_mem_bar) {
+      append(new MemBar(lir_membar_storestore));
+  }
+
   append(new Return(x));
 }
 
@@ -1504,6 +1517,9 @@
     }
   }
 
+  if (field->is_final() && (code == Bytecodes::_putfield)) {
+    scope()->set_wrote_final();
+  }
 
   const int offset = !needs_patching ? field->offset() : -1;
   switch (code) {
--- a/src/share/vm/c1/c1_IR.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_IR.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -141,6 +141,7 @@
   _xhandlers          = new XHandlers(method);
   _number_of_locks    = 0;
   _monitor_pairing_ok = method->has_balanced_monitors();
+  _wrote_final        = false;
   _start              = NULL;
 
   if (osr_bci == -1) {
--- a/src/share/vm/c1/c1_IR.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_IR.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -149,6 +149,7 @@
   XHandlers*    _xhandlers;                      // the exception handlers
   int           _number_of_locks;                // the number of monitor lock slots needed
   bool          _monitor_pairing_ok;             // the monitor pairing info
+  bool          _wrote_final;                    // has written final field
   BlockBegin*   _start;                          // the start block, successsors are method entries
 
   BitMap        _requires_phi_function;          // bit is set if phi functions at loop headers are necessary for a local variable
@@ -181,6 +182,8 @@
   void          set_min_number_of_locks(int n)   { if (n > _number_of_locks) _number_of_locks = n; }
   bool          monitor_pairing_ok() const       { return _monitor_pairing_ok; }
   BlockBegin*   start() const                    { return _start; }
+  void          set_wrote_final()                { _wrote_final = true; }
+  bool          wrote_final    () const          { return _wrote_final; }
 };
 
 
--- a/src/share/vm/c1/c1_Instruction.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_Instruction.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -107,6 +107,7 @@
 class   ProfileCall;
 class   ProfileInvoke;
 class   RuntimeCall;
+class   MemBar;
 
 // A Value is a reference to the instruction creating the value
 typedef Instruction* Value;
@@ -204,6 +205,7 @@
   virtual void do_ProfileCall    (ProfileCall*     x) = 0;
   virtual void do_ProfileInvoke  (ProfileInvoke*   x) = 0;
   virtual void do_RuntimeCall    (RuntimeCall*     x) = 0;
+  virtual void do_MemBar         (MemBar*          x) = 0;
 };
 
 
@@ -2351,6 +2353,23 @@
   virtual void state_values_do(ValueVisitor*);
 };
 
+LEAF(MemBar, Instruction)
+ private:
+  LIR_Code _code;
+
+ public:
+  MemBar(LIR_Code code)
+    : Instruction(voidType)
+    , _code(code)
+  {
+    pin();
+  }
+
+  LIR_Code code()           { return _code; }
+
+  virtual void input_values_do(ValueVisitor*)   {}
+};
+
 class BlockPair: public CompilationResourceObj {
  private:
   BlockBegin* _from;
--- a/src/share/vm/c1/c1_InstructionPrinter.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_InstructionPrinter.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -855,4 +855,20 @@
   output()->put(')');
 }
 
+void InstructionPrinter::do_MemBar(MemBar* x) {
+  if (os::is_MP()) {
+    LIR_Code code = x->code();
+    switch (code) {
+      case lir_membar_acquire   : output()->print("membar_acquire"); break;
+      case lir_membar_release   : output()->print("membar_release"); break;
+      case lir_membar           : output()->print("membar"); break;
+      case lir_membar_loadload  : output()->print("membar_loadload"); break;
+      case lir_membar_storestore: output()->print("membar_storestore"); break;
+      case lir_membar_loadstore : output()->print("membar_loadstore"); break;
+      case lir_membar_storeload : output()->print("membar_storeload"); break;
+      default                   : ShouldNotReachHere(); break;
+    }
+  }
+}
+
 #endif // PRODUCT
--- a/src/share/vm/c1/c1_InstructionPrinter.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_InstructionPrinter.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -132,6 +132,7 @@
   virtual void do_ProfileCall    (ProfileCall*     x);
   virtual void do_ProfileInvoke  (ProfileInvoke*   x);
   virtual void do_RuntimeCall    (RuntimeCall*     x);
+  virtual void do_MemBar         (MemBar*          x);
 };
 #endif // PRODUCT
 
--- a/src/share/vm/c1/c1_LIR.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_LIR.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -464,6 +464,10 @@
     case lir_membar:                   // result and info always invalid
     case lir_membar_acquire:           // result and info always invalid
     case lir_membar_release:           // result and info always invalid
+    case lir_membar_loadload:          // result and info always invalid
+    case lir_membar_storestore:        // result and info always invalid
+    case lir_membar_loadstore:         // result and info always invalid
+    case lir_membar_storeload:         // result and info always invalid
     {
       assert(op->as_Op0() != NULL, "must be");
       assert(op->_info == NULL, "info not used by this instruction");
@@ -1607,6 +1611,10 @@
      case lir_membar:                s = "membar";        break;
      case lir_membar_acquire:        s = "membar_acquire"; break;
      case lir_membar_release:        s = "membar_release"; break;
+     case lir_membar_loadload:       s = "membar_loadload";   break;
+     case lir_membar_storestore:     s = "membar_storestore"; break;
+     case lir_membar_loadstore:      s = "membar_loadstore";  break;
+     case lir_membar_storeload:      s = "membar_storeload";  break;
      case lir_word_align:            s = "word_align";    break;
      case lir_label:                 s = "label";         break;
      case lir_nop:                   s = "nop";           break;
--- a/src/share/vm/c1/c1_LIR.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_LIR.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -866,6 +866,10 @@
       , lir_membar
       , lir_membar_acquire
       , lir_membar_release
+      , lir_membar_loadload
+      , lir_membar_storestore
+      , lir_membar_loadstore
+      , lir_membar_storeload
       , lir_get_thread
   , end_op0
   , begin_op1
@@ -1918,6 +1922,10 @@
   void membar()                                  { append(new LIR_Op0(lir_membar)); }
   void membar_acquire()                          { append(new LIR_Op0(lir_membar_acquire)); }
   void membar_release()                          { append(new LIR_Op0(lir_membar_release)); }
+  void membar_loadload()                         { append(new LIR_Op0(lir_membar_loadload)); }
+  void membar_storestore()                       { append(new LIR_Op0(lir_membar_storestore)); }
+  void membar_loadstore()                        { append(new LIR_Op0(lir_membar_loadstore)); }
+  void membar_storeload()                        { append(new LIR_Op0(lir_membar_storeload)); }
 
   void nop()                                     { append(new LIR_Op0(lir_nop)); }
   void build_frame()                             { append(new LIR_Op0(lir_build_frame)); }
--- a/src/share/vm/c1/c1_LIRAssembler.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_LIRAssembler.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -664,6 +664,22 @@
       membar_release();
       break;
 
+    case lir_membar_loadload:
+      membar_loadload();
+      break;
+
+    case lir_membar_storestore:
+      membar_storestore();
+      break;
+
+    case lir_membar_loadstore:
+      membar_loadstore();
+      break;
+
+    case lir_membar_storeload:
+      membar_storeload();
+      break;
+
     case lir_get_thread:
       get_thread(op->result_opr());
       break;
--- a/src/share/vm/c1/c1_LIRAssembler.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_LIRAssembler.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -241,6 +241,10 @@
   void membar();
   void membar_acquire();
   void membar_release();
+  void membar_loadload();
+  void membar_storestore();
+  void membar_loadstore();
+  void membar_storeload();
   void get_thread(LIR_Opr result);
 
   void verify_oop_map(CodeEmitInfo* info);
--- a/src/share/vm/c1/c1_LIRGenerator.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_LIRGenerator.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -2777,31 +2777,29 @@
       int index = bcs.get_method_index();
       size_t call_site_offset = cpcache->get_f1_offset(index);
 
+      // Load CallSite object from constant pool cache.
+      LIR_Opr call_site = new_register(objectType);
+      __ oop2reg(cpcache->constant_encoding(), call_site);
+      __ move_wide(new LIR_Address(call_site, call_site_offset, T_OBJECT), call_site);
+
       // If this invokedynamic call site hasn't been executed yet in
       // the interpreter, the CallSite object in the constant pool
       // cache is still null and we need to deoptimize.
       if (cpcache->is_f1_null_at(index)) {
-        // Cannot re-use same xhandlers for multiple CodeEmitInfos, so
-        // clone all handlers.  This is handled transparently in other
-        // places by the CodeEmitInfo cloning logic but is handled
-        // specially here because a stub isn't being used.
-        x->set_exception_handlers(new XHandlers(x->exception_handlers()));
-
+        // Only deoptimize if the CallSite object is still null; we don't
+        // recompile methods in C1 after deoptimization so this call site
+        // might be resolved the next time we execute it after OSR.
         DeoptimizeStub* deopt_stub = new DeoptimizeStub(deopt_info);
-        __ jump(deopt_stub);
+        __ cmp(lir_cond_equal, call_site, LIR_OprFact::oopConst(NULL));
+        __ branch(lir_cond_equal, T_OBJECT, deopt_stub);
       }
 
       // Use the receiver register for the synthetic MethodHandle
       // argument.
       receiver = LIR_Assembler::receiverOpr();
-      LIR_Opr tmp = new_register(objectType);
-
-      // Load CallSite object from constant pool cache.
-      __ oop2reg(cpcache->constant_encoding(), tmp);
-      __ move_wide(new LIR_Address(tmp, call_site_offset, T_OBJECT), tmp);
 
       // Load target MethodHandle from CallSite object.
-      __ load(new LIR_Address(tmp, java_lang_invoke_CallSite::target_offset_in_bytes(), T_OBJECT), receiver);
+      __ load(new LIR_Address(call_site, java_lang_invoke_CallSite::target_offset_in_bytes(), T_OBJECT), receiver);
 
       __ call_dynamic(target, receiver, result_register,
                       SharedRuntime::get_resolve_opt_virtual_call_stub(),
@@ -2809,7 +2807,7 @@
       break;
     }
     default:
-      ShouldNotReachHere();
+      fatal(err_msg("unexpected bytecode: %s", Bytecodes::name(x->code())));
       break;
   }
 
@@ -3165,3 +3163,20 @@
   }
   return result;
 }
+
+void LIRGenerator::do_MemBar(MemBar* x) {
+  if (os::is_MP()) {
+    LIR_Code code = x->code();
+    switch(code) {
+      case lir_membar_acquire   : __ membar_acquire(); break;
+      case lir_membar_release   : __ membar_release(); break;
+      case lir_membar           : __ membar(); break;
+      case lir_membar_loadload  : __ membar_loadload(); break;
+      case lir_membar_storestore: __ membar_storestore(); break;
+      case lir_membar_loadstore : __ membar_loadstore(); break;
+      case lir_membar_storeload : __ membar_storeload(); break;
+      default                   : ShouldNotReachHere(); break;
+    }
+  }
+}
+
--- a/src/share/vm/c1/c1_LIRGenerator.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_LIRGenerator.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -525,6 +525,7 @@
   virtual void do_ProfileCall    (ProfileCall*     x);
   virtual void do_ProfileInvoke  (ProfileInvoke*   x);
   virtual void do_RuntimeCall    (RuntimeCall*     x);
+  virtual void do_MemBar         (MemBar*          x);
 };
 
 
--- a/src/share/vm/c1/c1_Optimizer.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_Optimizer.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -509,6 +509,7 @@
   void do_ProfileCall    (ProfileCall*     x);
   void do_ProfileInvoke  (ProfileInvoke*   x);
   void do_RuntimeCall    (RuntimeCall*     x);
+  void do_MemBar         (MemBar*          x);
 };
 
 
@@ -678,6 +679,7 @@
 void NullCheckVisitor::do_ProfileCall    (ProfileCall*     x) { nce()->clear_last_explicit_null_check(); }
 void NullCheckVisitor::do_ProfileInvoke  (ProfileInvoke*   x) {}
 void NullCheckVisitor::do_RuntimeCall    (RuntimeCall*     x) {}
+void NullCheckVisitor::do_MemBar         (MemBar*          x) {}
 
 
 void NullCheckEliminator::visit(Value* p) {
--- a/src/share/vm/c1/c1_ValueMap.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/c1/c1_ValueMap.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -141,8 +141,11 @@
 
   // visitor functions
   void do_StoreField     (StoreField*      x) {
-    if (x->is_init_point()) {
-      // putstatic is an initialization point so treat it as a wide kill
+    if (x->is_init_point() ||  // putstatic is an initialization point so treat it as a wide kill
+        // This is actually too strict and the JMM doesn't require
+        // this in all cases (e.g. load a; volatile store b; load a)
+        // but possible future optimizations might require this.
+        x->field()->is_volatile()) {
       kill_memory();
     } else {
       kill_field(x->field());
@@ -160,8 +163,8 @@
   void do_Local          (Local*           x) { /* nothing to do */ }
   void do_Constant       (Constant*        x) { /* nothing to do */ }
   void do_LoadField      (LoadField*       x) {
-    if (x->is_init_point()) {
-      // getstatic is an initialization point so treat it as a wide kill
+    if (x->is_init_point() ||         // getstatic is an initialization point so treat it as a wide kill
+        x->field()->is_volatile()) {  // the JMM requires this
       kill_memory();
     }
   }
@@ -200,6 +203,7 @@
   void do_ProfileCall    (ProfileCall*     x) { /* nothing to do */ }
   void do_ProfileInvoke  (ProfileInvoke*   x) { /* nothing to do */ };
   void do_RuntimeCall    (RuntimeCall*     x) { /* nothing to do */ };
+  void do_MemBar         (MemBar*          x) { /* nothing to do */ };
 };
 
 
--- a/src/share/vm/ci/ciField.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/ci/ciField.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -67,7 +67,7 @@
 
 // ------------------------------------------------------------------
 // ciField::ciField
-ciField::ciField(ciInstanceKlass* klass, int index): _known_to_link_with(NULL) {
+ciField::ciField(ciInstanceKlass* klass, int index): _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) {
   ASSERT_IN_VM;
   CompilerThread *thread = CompilerThread::current();
 
@@ -143,7 +143,7 @@
   initialize_from(&field_desc);
 }
 
-ciField::ciField(fieldDescriptor *fd): _known_to_link_with(NULL) {
+ciField::ciField(fieldDescriptor *fd): _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) {
   ASSERT_IN_VM;
 
   _cp_index = -1;
@@ -315,6 +315,10 @@
 bool ciField::will_link(ciInstanceKlass* accessing_klass,
                         Bytecodes::Code bc) {
   VM_ENTRY_MARK;
+  assert(bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic ||
+         bc == Bytecodes::_getfield  || bc == Bytecodes::_putfield,
+         "unexpected bytecode");
+
   if (_offset == -1) {
     // at creation we couldn't link to our holder so we need to
     // maintain that stance, otherwise there's no safe way to use this
@@ -322,8 +326,22 @@
     return false;
   }
 
-  if (_known_to_link_with == accessing_klass) {
-    return true;
+  // Check for static/nonstatic mismatch
+  bool is_static = (bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic);
+  if (is_static != this->is_static()) {
+    return false;
+  }
+
+  // Get and put can have different accessibility rules
+  bool is_put    = (bc == Bytecodes::_putfield  || bc == Bytecodes::_putstatic);
+  if (is_put) {
+    if (_known_to_link_with_put == accessing_klass) {
+      return true;
+    }
+  } else {
+    if (_known_to_link_with_get == accessing_klass) {
+      return true;
+    }
   }
 
   FieldAccessInfo result;
@@ -334,8 +352,13 @@
                               true, false, KILL_COMPILE_ON_FATAL_(false));
 
   // update the hit-cache, unless there is a problem with memory scoping:
-  if (accessing_klass->is_shared() || !is_shared())
-    _known_to_link_with = accessing_klass;
+  if (accessing_klass->is_shared() || !is_shared()) {
+    if (is_put) {
+      _known_to_link_with_put = accessing_klass;
+    } else {
+      _known_to_link_with_get = accessing_klass;
+    }
+  }
 
   return true;
 }
--- a/src/share/vm/ci/ciField.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/ci/ciField.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -49,7 +49,8 @@
   ciType*          _type;
   int              _offset;
   bool             _is_constant;
-  ciInstanceKlass* _known_to_link_with;
+  ciInstanceKlass* _known_to_link_with_put;
+  ciInstanceKlass* _known_to_link_with_get;
   ciConstant       _constant_value;
 
   // Used for will_link
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/classfile/altHashing.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -0,0 +1,304 @@
+/*
+ * Copyright (c) 2012, 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/altHashing.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "oops/markOop.hpp"
+#include "runtime/thread.hpp"
+
+// Get the hash code of the classes mirror if it exists, otherwise just
+// return a random number, which is one of the possible hash code used for
+// objects.  We don't want to call the synchronizer hash code to install
+// this value because it may safepoint.
+intptr_t object_hash(klassOop k) {
+  intptr_t hc = k->java_mirror()->mark()->hash();
+  return hc != markOopDesc::no_hash ? hc : os::random();
+}
+
+// Seed value used for each alternative hash calculated.
+jint AltHashing::compute_seed() {
+  jlong nanos = os::javaTimeNanos();
+  jlong now = os::javaTimeMillis();
+  jint SEED_MATERIAL[8] = {
+            (jint) object_hash(SystemDictionary::String_klass()),
+            (jint) object_hash(SystemDictionary::System_klass()),
+            (jint) os::random(),  // current thread isn't a java thread
+            (jint) (((julong)nanos) >> 32),
+            (jint) nanos,
+            (jint) (((julong)now) >> 32),
+            (jint) now,
+            (jint) (os::javaTimeNanos() >> 2)
+  };
+
+  return murmur3_32(SEED_MATERIAL, 8);
+}
+
+
+// Murmur3 hashing for Symbol
+jint AltHashing::murmur3_32(jint seed, const jbyte* data, int len) {
+  jint h1 = seed;
+  int count = len;
+  int offset = 0;
+
+  // body
+  while (count >= 4) {
+    jint k1 = (data[offset] & 0x0FF)
+        | (data[offset + 1] & 0x0FF) << 8
+        | (data[offset + 2] & 0x0FF) << 16
+        | data[offset + 3] << 24;
+
+    count -= 4;
+    offset += 4;
+
+    k1 *= 0xcc9e2d51;
+    k1 = Integer_rotateLeft(k1, 15);
+    k1 *= 0x1b873593;
+
+    h1 ^= k1;
+    h1 = Integer_rotateLeft(h1, 13);
+    h1 = h1 * 5 + 0xe6546b64;
+  }
+
+  // tail
+
+  if (count > 0) {
+    jint k1 = 0;
+
+    switch (count) {
+      case 3:
+        k1 ^= (data[offset + 2] & 0xff) << 16;
+      // fall through
+      case 2:
+        k1 ^= (data[offset + 1] & 0xff) << 8;
+      // fall through
+      case 1:
+        k1 ^= (data[offset] & 0xff);
+      // fall through
+      default:
+        k1 *= 0xcc9e2d51;
+        k1 = Integer_rotateLeft(k1, 15);
+        k1 *= 0x1b873593;
+        h1 ^= k1;
+    }
+  }
+
+  // finalization
+  h1 ^= len;
+
+  // finalization mix force all bits of a hash block to avalanche
+  h1 ^= ((unsigned int)h1) >> 16;
+  h1 *= 0x85ebca6b;
+  h1 ^= ((unsigned int)h1) >> 13;
+  h1 *= 0xc2b2ae35;
+  h1 ^= ((unsigned int)h1) >> 16;
+
+  return h1;
+}
+
+// Murmur3 hashing for Strings
+jint AltHashing::murmur3_32(jint seed, const jchar* data, int len) {
+  jint h1 = seed;
+
+  int off = 0;
+  int count = len;
+
+  // body
+  while (count >= 2) {
+    jchar d1 = data[off++] & 0xFFFF;
+    jchar d2 = data[off++];
+    jint k1 = (d1 | d2 << 16);
+
+    count -= 2;
+
+    k1 *= 0xcc9e2d51;
+    k1 = Integer_rotateLeft(k1, 15);
+    k1 *= 0x1b873593;
+
+    h1 ^= k1;
+    h1 = Integer_rotateLeft(h1, 13);
+    h1 = h1 * 5 + 0xe6546b64;
+  }
+
+  // tail
+
+  if (count > 0) {
+    int k1 = data[off];
+
+    k1 *= 0xcc9e2d51;
+    k1 = Integer_rotateLeft(k1, 15);
+    k1 *= 0x1b873593;
+    h1 ^= k1;
+  }
+
+  // finalization
+  h1 ^= len * 2; // (Character.SIZE / Byte.SIZE);
+
+  // finalization mix force all bits of a hash block to avalanche
+  h1 ^= ((unsigned int)h1) >> 16;
+  h1 *= 0x85ebca6b;
+  h1 ^= ((unsigned int)h1) >> 13;
+  h1 *= 0xc2b2ae35;
+  h1 ^= ((unsigned int)h1) >> 16;
+
+  return h1;
+}
+
+// Hash used for the seed.
+jint AltHashing::murmur3_32(jint seed, const int* data, int len) {
+  jint h1 = seed;
+
+  int off = 0;
+  int end = len;
+
+  // body
+  while (off < end) {
+    jint k1 = data[off++];
+
+    k1 *= 0xcc9e2d51;
+    k1 = Integer_rotateLeft(k1, 15);
+    k1 *= 0x1b873593;
+
+    h1 ^= k1;
+    h1 = Integer_rotateLeft(h1, 13);
+    h1 = h1 * 5 + 0xe6546b64;
+  }
+
+  // tail (always empty, as body is always 32-bit chunks)
+
+  // finalization
+
+  h1 ^= len * 4; // (Integer.SIZE / Byte.SIZE);
+
+  // finalization mix force all bits of a hash block to avalanche
+  h1 ^= ((juint)h1) >> 16;
+  h1 *= 0x85ebca6b;
+  h1 ^= ((juint)h1) >> 13;
+  h1 *= 0xc2b2ae35;
+  h1 ^= ((juint)h1) >> 16;
+
+  return h1;
+}
+
+jint AltHashing::murmur3_32(const int* data, int len) {
+  return murmur3_32(0, data, len);
+}
+
+#ifndef PRODUCT
+// Overloaded versions for internal test.
+jint AltHashing::murmur3_32(const jbyte* data, int len) {
+  return murmur3_32(0, data, len);
+}
+
+jint AltHashing::murmur3_32(const jchar* data, int len) {
+  return murmur3_32(0, data, len);
+}
+
+// Internal test for alternate hashing.  Translated from JDK version
+// test/sun/misc/Hashing.java
+static const jbyte ONE_BYTE[] = { (jbyte) 0x80};
+static const jbyte TWO_BYTE[] = { (jbyte) 0x80, (jbyte) 0x81};
+static const jchar ONE_CHAR[] = { (jchar) 0x8180};
+static const jbyte THREE_BYTE[] = { (jbyte) 0x80, (jbyte) 0x81, (jbyte) 0x82};
+static const jbyte FOUR_BYTE[] = { (jbyte) 0x80, (jbyte) 0x81, (jbyte) 0x82, (jbyte) 0x83};
+static const jchar TWO_CHAR[] = { (jchar) 0x8180, (jchar) 0x8382};
+static const jint ONE_INT[] = { 0x83828180};
+static const jbyte SIX_BYTE[] = { (jbyte) 0x80, (jbyte) 0x81, (jbyte) 0x82, (jbyte) 0x83, (jbyte) 0x84, (jbyte) 0x85};
+static const jchar THREE_CHAR[] = { (jchar) 0x8180, (jchar) 0x8382, (jchar) 0x8584};
+static const jbyte EIGHT_BYTE[] = {
+  (jbyte) 0x80, (jbyte) 0x81, (jbyte) 0x82,
+  (jbyte) 0x83, (jbyte) 0x84, (jbyte) 0x85,
+  (jbyte) 0x86, (jbyte) 0x87};
+static const jchar FOUR_CHAR[] = {
+  (jchar) 0x8180, (jchar) 0x8382,
+  (jchar) 0x8584, (jchar) 0x8786};
+
+static const jint TWO_INT[] = { 0x83828180, 0x87868584};
+
+static const juint MURMUR3_32_X86_CHECK_VALUE = 0xB0F57EE3;
+
+void AltHashing::testMurmur3_32_ByteArray() {
+  // printf("testMurmur3_32_ByteArray\n");
+
+  jbyte* vector = new jbyte[256];
+  jbyte* hashes = new jbyte[4 * 256];
+
+  for (int i = 0; i < 256; i++) {
+    vector[i] = (jbyte) i;
+  }
+
+  // Hash subranges {}, {0}, {0,1}, {0,1,2}, ..., {0,...,255}
+  for (int i = 0; i < 256; i++) {
+    jint hash = murmur3_32(256 - i, vector, i);
+    hashes[i * 4] = (jbyte) hash;
+    hashes[i * 4 + 1] = (jbyte) (((juint)hash) >> 8);
+    hashes[i * 4 + 2] = (jbyte) (((juint)hash) >> 16);
+    hashes[i * 4 + 3] = (jbyte) (((juint)hash) >> 24);
+  }
+
+  // hash to get const result.
+  juint final_hash = murmur3_32(hashes, 4*256);
+
+  assert (MURMUR3_32_X86_CHECK_VALUE == final_hash,
+    err_msg(
+        "Calculated hash result not as expected. Expected %08X got %08X\n",
+        MURMUR3_32_X86_CHECK_VALUE,
+        final_hash));
+}
+
+void AltHashing::testEquivalentHashes() {
+  jint jbytes, jchars, ints;
+
+  // printf("testEquivalentHashes\n");
+
+  jbytes = murmur3_32(TWO_BYTE, 2);
+  jchars = murmur3_32(ONE_CHAR, 1);
+  assert (jbytes == jchars,
+    err_msg("Hashes did not match. b:%08x != c:%08x\n", jbytes, jchars));
+
+  jbytes = murmur3_32(FOUR_BYTE, 4);
+  jchars = murmur3_32(TWO_CHAR, 2);
+  ints = murmur3_32(ONE_INT, 1);
+  assert ((jbytes == jchars) && (jbytes == ints),
+    err_msg("Hashes did not match. b:%08x != c:%08x != i:%08x\n", jbytes, jchars, ints));
+
+  jbytes = murmur3_32(SIX_BYTE, 6);
+  jchars = murmur3_32(THREE_CHAR, 3);
+  assert (jbytes == jchars,
+    err_msg("Hashes did not match. b:%08x != c:%08x\n", jbytes, jchars));
+
+  jbytes = murmur3_32(EIGHT_BYTE, 8);
+  jchars = murmur3_32(FOUR_CHAR, 4);
+  ints = murmur3_32(TWO_INT, 2);
+  assert ((jbytes == jchars) && (jbytes == ints),
+    err_msg("Hashes did not match. b:%08x != c:%08x != i:%08x\n", jbytes, jchars, ints));
+}
+
+// Returns true if the alternate hashcode is correct
+void AltHashing::test_alt_hash() {
+  testMurmur3_32_ByteArray();
+  testEquivalentHashes();
+}
+#endif // PRODUCT
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/classfile/altHashing.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2012, 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_ALTHASHING_HPP
+#define SHARE_VM_CLASSFILE_ALTHASHING_HPP
+
+#include "prims/jni.h"
+#include "classfile/symbolTable.hpp"
+
+/**
+ * Hashing utilities.
+ *
+ * Implementation of Murmur3 hashing.
+ * This code was translated from src/share/classes/sun/misc/Hashing.java
+ * code in the JDK.
+ */
+
+class AltHashing : AllStatic {
+
+  // utility function copied from java/lang/Integer
+  static jint Integer_rotateLeft(jint i, int distance) {
+    return (i << distance) | (((juint)i) >> (32-distance));
+  }
+  static jint murmur3_32(const int* data, int len);
+  static jint murmur3_32(jint seed, const int* data, int len);
+
+#ifndef PRODUCT
+  // Hashing functions used for internal testing
+  static jint murmur3_32(const jbyte* data, int len);
+  static jint murmur3_32(const jchar* data, int len);
+  static void testMurmur3_32_ByteArray();
+  static void testEquivalentHashes();
+#endif // PRODUCT
+
+ public:
+  static jint compute_seed();
+  static jint murmur3_32(jint seed, const jbyte* data, int len);
+  static jint murmur3_32(jint seed, const jchar* data, int len);
+  NOT_PRODUCT(static void test_alt_hash();)
+};
+#endif // SHARE_VM_CLASSFILE_ALTHASHING_HPP
--- a/src/share/vm/classfile/javaClasses.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/classfile/javaClasses.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/altHashing.hpp"
 #include "classfile/javaClasses.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/vmSymbols.hpp"
@@ -143,7 +144,27 @@
 }
 
 
+int java_lang_String::value_offset  = 0;
+int java_lang_String::offset_offset = 0;
+int java_lang_String::count_offset  = 0;
+int java_lang_String::hash_offset   = 0;
+
+bool java_lang_String::initialized  = false;
+
+void java_lang_String::compute_offsets() {
+  assert(!initialized, "offsets should be initialized only once");
+
+  klassOop k = SystemDictionary::String_klass();
+  compute_offset(value_offset,           k, vmSymbols::value_name(),  vmSymbols::char_array_signature());
+  compute_optional_offset(offset_offset, k, vmSymbols::offset_name(), vmSymbols::int_signature());
+  compute_optional_offset(count_offset,  k, vmSymbols::count_name(),  vmSymbols::int_signature());
+  compute_optional_offset(hash_offset,   k, vmSymbols::hash_name(),   vmSymbols::int_signature());
+
+  initialized = true;
+}
+
 Handle java_lang_String::basic_create(int length, bool tenured, TRAPS) {
+  assert(initialized, "Must be initialized");
   // Create the String object first, so there's a chance that the String
   // and the char array it points to end up in the same cache line.
   oop obj;
@@ -327,13 +348,26 @@
   return result;
 }
 
-unsigned int java_lang_String::hash_string(oop java_string) {
+unsigned int java_lang_String::to_hash(oop java_string) {
+  int          length = java_lang_String::length(java_string);
+  // Zero length string will hash to zero with String.toHash() function.
+  if (length == 0) return 0;
+
   typeArrayOop value  = java_lang_String::value(java_string);
   int          offset = java_lang_String::offset(java_string);
+  return java_lang_String::to_hash(value->char_at_addr(offset), length);
+}
+
+unsigned int java_lang_String::hash_string(oop java_string) {
   int          length = java_lang_String::length(java_string);
-
-  if (length == 0) return 0;
-  return hash_string(value->char_at_addr(offset), length);
+  // Zero length string doesn't hash necessarily hash to zero.
+  if (length == 0) {
+    return StringTable::hash_string(NULL, 0);
+  }
+
+  typeArrayOop value  = java_lang_String::value(java_string);
+  int          offset = java_lang_String::offset(java_string);
+  return StringTable::hash_string(value->char_at_addr(offset), length);
 }
 
 Symbol* java_lang_String::as_symbol(Handle java_string, TRAPS) {
@@ -2837,10 +2871,6 @@
 
 
 
-int java_lang_String::value_offset;
-int java_lang_String::offset_offset;
-int java_lang_String::count_offset;
-int java_lang_String::hash_offset;
 int java_lang_Class::_klass_offset;
 int java_lang_Class::_array_klass_offset;
 int java_lang_Class::_resolved_constructor_offset;
@@ -3000,12 +3030,6 @@
   const int x = heapOopSize;
   const int header = instanceOopDesc::base_offset_in_bytes();
 
-  // Do the String Class
-  java_lang_String::value_offset  = java_lang_String::hc_value_offset  * x + header;
-  java_lang_String::offset_offset = java_lang_String::hc_offset_offset * x + header;
-  java_lang_String::count_offset  = java_lang_String::offset_offset + sizeof (jint);
-  java_lang_String::hash_offset   = java_lang_String::count_offset + sizeof (jint);
-
   // Throwable Class
   java_lang_Throwable::backtrace_offset  = java_lang_Throwable::hc_backtrace_offset  * x + header;
   java_lang_Throwable::detailMessage_offset = java_lang_Throwable::hc_detailMessage_offset * x + header;
@@ -3200,9 +3224,13 @@
   // java.lang.String
 
   CHECK_OFFSET("java/lang/String", java_lang_String, value, "[C");
-  CHECK_OFFSET("java/lang/String", java_lang_String, offset, "I");
-  CHECK_OFFSET("java/lang/String", java_lang_String, count, "I");
-  CHECK_OFFSET("java/lang/String", java_lang_String, hash, "I");
+  if (java_lang_String::has_offset_field()) {
+    CHECK_OFFSET("java/lang/String", java_lang_String, offset, "I");
+    CHECK_OFFSET("java/lang/String", java_lang_String, count, "I");
+  }
+  if (java_lang_String::has_hash_field()) {
+    CHECK_OFFSET("java/lang/String", java_lang_String, hash, "I");
+  }
 
   // java.lang.Class
 
--- a/src/share/vm/classfile/javaClasses.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/classfile/javaClasses.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -52,26 +52,36 @@
 
 class java_lang_String : AllStatic {
  private:
-  enum {
-    hc_value_offset  = 0,
-    hc_offset_offset = 1
-    //hc_count_offset = 2  -- not a word-scaled offset
-    //hc_hash_offset  = 3  -- not a word-scaled offset
-  };
-
   static int value_offset;
   static int offset_offset;
   static int count_offset;
   static int hash_offset;
 
+  static bool initialized;
+
   static Handle basic_create(int length, bool tenured, TRAPS);
   static Handle basic_create_from_unicode(jchar* unicode, int length, bool tenured, TRAPS);
 
-  static void set_value( oop string, typeArrayOop buffer) { string->obj_field_put(value_offset,  (oop)buffer); }
-  static void set_offset(oop string, int offset)          { string->int_field_put(offset_offset, offset); }
-  static void set_count( oop string, int count)           { string->int_field_put(count_offset,  count);  }
+  static void set_value( oop string, typeArrayOop buffer) {
+    assert(initialized, "Must be initialized");
+    string->obj_field_put(value_offset,  (oop)buffer);
+  }
+  static void set_offset(oop string, int offset) {
+    assert(initialized, "Must be initialized");
+    if (offset_offset > 0) {
+      string->int_field_put(offset_offset, offset);
+    }
+  }
+  static void set_count( oop string, int count) {
+    assert(initialized, "Must be initialized");
+    if (count_offset > 0) {
+      string->int_field_put(count_offset,  count);
+    }
+  }
 
  public:
+  static void compute_offsets();
+
   // Instance creation
   static Handle create_from_unicode(jchar* unicode, int len, TRAPS);
   static Handle create_tenured_from_unicode(jchar* unicode, int len, TRAPS);
@@ -82,23 +92,61 @@
   static Handle create_from_platform_dependent_str(const char* str, TRAPS);
   static Handle char_converter(Handle java_string, jchar from_char, jchar to_char, TRAPS);
 
-  static int value_offset_in_bytes()  { return value_offset;  }
-  static int count_offset_in_bytes()  { return count_offset;  }
-  static int offset_offset_in_bytes() { return offset_offset; }
-  static int hash_offset_in_bytes()   { return hash_offset;   }
+  static bool has_offset_field()  {
+    assert(initialized, "Must be initialized");
+    return (offset_offset > 0);
+  }
+
+  static bool has_count_field()  {
+    assert(initialized, "Must be initialized");
+    return (count_offset > 0);
+  }
+
+  static bool has_hash_field()  {
+    assert(initialized, "Must be initialized");
+    return (hash_offset > 0);
+  }
+
+  static int value_offset_in_bytes()  {
+    assert(initialized && (value_offset > 0), "Must be initialized");
+    return value_offset;
+  }
+  static int count_offset_in_bytes()  {
+    assert(initialized && (count_offset > 0), "Must be initialized");
+    return count_offset;
+  }
+  static int offset_offset_in_bytes() {
+    assert(initialized && (offset_offset > 0), "Must be initialized");
+    return offset_offset;
+  }
+  static int hash_offset_in_bytes()   {
+    assert(initialized && (hash_offset > 0), "Must be initialized");
+    return hash_offset;
+  }
 
   // Accessors
   static typeArrayOop value(oop java_string) {
+    assert(initialized && (value_offset > 0), "Must be initialized");
     assert(is_instance(java_string), "must be java_string");
     return (typeArrayOop) java_string->obj_field(value_offset);
   }
   static int offset(oop java_string) {
+    assert(initialized, "Must be initialized");
     assert(is_instance(java_string), "must be java_string");
-    return java_string->int_field(offset_offset);
+    if (offset_offset > 0) {
+      return java_string->int_field(offset_offset);
+    } else {
+      return 0;
+    }
   }
   static int length(oop java_string) {
+    assert(initialized, "Must be initialized");
     assert(is_instance(java_string), "must be java_string");
-    return java_string->int_field(count_offset);
+    if (count_offset > 0) {
+      return java_string->int_field(count_offset);
+    } else {
+      return ((typeArrayOop)java_string->obj_field(value_offset))->length();
+    }
   }
   static int utf8_length(oop java_string);
 
@@ -110,20 +158,16 @@
   static jchar* as_unicode_string(oop java_string, int& length);
 
   // Compute the hash value for a java.lang.String object which would
-  // contain the characters passed in. This hash value is used for at
-  // least two purposes.
+  // contain the characters passed in.
   //
-  // (a) As the hash value used by the StringTable for bucket selection
-  //     and comparison (stored in the HashtableEntry structures).  This
-  //     is used in the String.intern() method.
+  // As the hash value used by the String object itself, in
+  // String.hashCode().  This value is normally calculated in Java code
+  // in the String.hashCode method(), but is precomputed for String
+  // objects in the shared archive file.
+  // hash P(31) from Kernighan & Ritchie
   //
-  // (b) As the hash value used by the String object itself, in
-  //     String.hashCode().  This value is normally calculate in Java code
-  //     in the String.hashCode method(), but is precomputed for String
-  //     objects in the shared archive file.
-  //
-  //     For this reason, THIS ALGORITHM MUST MATCH String.hashCode().
-  static unsigned int hash_string(jchar* s, int len) {
+  // For this reason, THIS ALGORITHM MUST MATCH String.toHash().
+  template <typename T> static unsigned int to_hash(T* s, int len) {
     unsigned int h = 0;
     while (len-- > 0) {
       h = 31*h + (unsigned int) *s;
@@ -131,6 +175,10 @@
     }
     return h;
   }
+  static unsigned int to_hash(oop java_string);
+
+  // This is the string hash code used by the StringTable, which may be
+  // the same as String.toHash or an alternate hash code.
   static unsigned int hash_string(oop java_string);
 
   static bool equals(oop java_string, jchar* chars, int len);
--- a/src/share/vm/classfile/symbolTable.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/classfile/symbolTable.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/altHashing.hpp"
 #include "classfile/javaClasses.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
@@ -33,39 +34,21 @@
 #include "oops/oop.inline2.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "utilities/hashtable.inline.hpp"
+#include "utilities/numberSeq.hpp"
 
 // --------------------------------------------------------------------------
 
 SymbolTable* SymbolTable::_the_table = NULL;
+bool SymbolTable::_needs_rehashing = false;
 
 Symbol* SymbolTable::allocate_symbol(const u1* name, int len, TRAPS) {
-  // Don't allow symbols to be created which cannot fit in a Symbol*.
-  if (len > Symbol::max_length()) {
-    THROW_MSG_0(vmSymbols::java_lang_InternalError(),
-                "name is too long to represent");
-  }
+  assert (len <= Symbol::max_length(), "should be checked by caller");
+
   Symbol* sym = new (len) Symbol(name, len);
   assert(sym != NULL, "new should call vm_exit_out_of_memory if C_HEAP is exhausted");
   return sym;
 }
 
-bool SymbolTable::allocate_symbols(int names_count, const u1** names,
-                                   int* lengths, Symbol** syms, TRAPS) {
-  for (int i = 0; i< names_count; i++) {
-    if (lengths[i] > Symbol::max_length()) {
-      THROW_MSG_0(vmSymbols::java_lang_InternalError(),
-                  "name is too long to represent");
-    }
-  }
-
-  for (int i = 0; i< names_count; i++) {
-    int len = lengths[i];
-    syms[i] = new (len) Symbol(names[i], len);
-    assert(syms[i] != NULL, "new should call vm_exit_out_of_memory if "
-                            "C_HEAP is exhausted");
-  }
-  return true;
-}
 
 // Call function for all symbols in the symbol table.
 void SymbolTable::symbols_do(SymbolClosure *cl) {
@@ -90,9 +73,14 @@
   int total = 0;
   size_t memory_total = 0;
   for (int i = 0; i < the_table()->table_size(); ++i) {
-    for (HashtableEntry<Symbol*>** p = the_table()->bucket_addr(i); *p != NULL; ) {
-      HashtableEntry<Symbol*>* entry = *p;
-      if (entry->is_shared()) {
+    HashtableEntry<Symbol*>** p = the_table()->bucket_addr(i);
+    HashtableEntry<Symbol*>* entry = the_table()->bucket(i);
+    while (entry != NULL) {
+      // Shared entries are normally at the end of the bucket and if we run into
+      // a shared entry, then there is nothing more to remove. However, if we
+      // have rehashed the table, then the shared entries are no longer at the
+      // end of the bucket.
+      if (entry->is_shared() && !use_alternate_hashcode()) {
         break;
       }
       Symbol* s = entry->literal();
@@ -101,6 +89,7 @@
       assert(s != NULL, "just checking");
       // If reference count is zero, remove.
       if (s->refcount() == 0) {
+        assert(!entry->is_shared(), "shared entries should be kept live");
         delete s;
         removed++;
         *p = entry->next();
@@ -108,6 +97,8 @@
       } else {
         p = entry->next_addr();
       }
+      // get next entry
+      entry = (HashtableEntry<Symbol*>*)HashtableEntry<Symbol*>::make_ptr(*p);
     }
   }
   symbols_removed += removed;
@@ -120,12 +111,32 @@
   }
 }
 
+// Create a new table and using alternate hash code, populate the new table
+// with the existing strings.   Set flag to use the alternate hash code afterwards.
+void SymbolTable::rehash_table() {
+  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
+  // This should never happen with -Xshare:dump but it might in testing mode.
+  if (DumpSharedSpaces) return;
+  // Create a new symbol table
+  SymbolTable* new_table = new SymbolTable();
+
+  the_table()->move_to(new_table);
+
+  // Delete the table and buckets (entries are reused in new table).
+  delete _the_table;
+  // Don't check if we need rehashing until the table gets unbalanced again.
+  // Then rehash with a new global seed.
+  _needs_rehashing = false;
+  _the_table = new_table;
+}
 
 // Lookup a symbol in a bucket.
 
 Symbol* SymbolTable::lookup(int index, const char* name,
                               int len, unsigned int hash) {
+  int count = 0;
   for (HashtableEntry<Symbol*>* e = bucket(index); e != NULL; e = e->next()) {
+    count++;  // count all entries in this bucket, not just ones with same hash
     if (e->hash() == hash) {
       Symbol* sym = e->literal();
       if (sym->equals(name, len)) {
@@ -135,9 +146,20 @@
       }
     }
   }
+  // If the bucket size is too deep check if this hash code is insufficient.
+  if (count >= BasicHashtable::rehash_count && !needs_rehashing()) {
+    _needs_rehashing = check_rehash_table(count);
+  }
   return NULL;
 }
 
+// Pick hashing algorithm.
+unsigned int SymbolTable::hash_symbol(const char* s, int len) {
+  return use_alternate_hashcode() ?
+           AltHashing::murmur3_32(seed(), (const jbyte*)s, len) :
+           java_lang_String::to_hash(s, len);
+}
+
 
 // We take care not to be blocking while holding the
 // SymbolTable_lock. Otherwise, the system might deadlock, since the
@@ -155,6 +177,9 @@
   // Found
   if (s != NULL) return s;
 
+  // Grab SymbolTable_lock first.
+  MutexLocker ml(SymbolTable_lock, THREAD);
+
   // Otherwise, add to symbol to table
   return the_table()->basic_add(index, (u1*)name, len, hashValue, CHECK_NULL);
 }
@@ -192,6 +217,9 @@
   // We can't include the code in No_Safepoint_Verifier because of the
   // ResourceMark.
 
+  // Allocation must be done before grabbing the SymbolTable_lock lock
+  MutexLocker ml(SymbolTable_lock, THREAD);
+
   return the_table()->basic_add(index, (u1*)buffer, len, hashValue, CHECK_NULL);
 }
 
@@ -259,6 +287,9 @@
 void SymbolTable::add(constantPoolHandle cp, int names_count,
                       const char** names, int* lengths, int* cp_indices,
                       unsigned int* hashValues, TRAPS) {
+  // Grab SymbolTable_lock first.
+  MutexLocker ml(SymbolTable_lock, THREAD);
+
   SymbolTable* table = the_table();
   bool added = table->basic_add(cp, names_count, names, lengths,
                                 cp_indices, hashValues, CHECK);
@@ -273,34 +304,47 @@
   }
 }
 
-Symbol* SymbolTable::basic_add(int index, u1 *name, int len,
-                                 unsigned int hashValue, TRAPS) {
+Symbol* SymbolTable::basic_add(int index_arg, u1 *name, int len,
+                               unsigned int hashValue_arg, TRAPS) {
   assert(!Universe::heap()->is_in_reserved(name) || GC_locker::is_active(),
          "proposed name of symbol must be stable");
 
-  // We assume that lookup() has been called already, that it failed,
-  // and symbol was not found.  We create the symbol here.
-  Symbol* sym = allocate_symbol(name, len, CHECK_NULL);
+  // Don't allow symbols to be created which cannot fit in a Symbol*.
+  if (len > Symbol::max_length()) {
+    THROW_MSG_0(vmSymbols::java_lang_InternalError(),
+                "name is too long to represent");
+  }
 
-  // Allocation must be done before grabbing the SymbolTable_lock lock
-  MutexLocker ml(SymbolTable_lock, THREAD);
+  // Cannot hit a safepoint in this function because the "this" pointer can move.
+  No_Safepoint_Verifier nsv;
 
-  assert(sym->equals((char*)name, len), "symbol must be properly initialized");
+  // Check if the symbol table has been rehashed, if so, need to recalculate
+  // the hash value and index.
+  unsigned int hashValue;
+  int index;
+  if (use_alternate_hashcode()) {
+    hashValue = hash_symbol((const char*)name, len);
+    index = hash_to_index(hashValue);
+  } else {
+    hashValue = hashValue_arg;
+    index = index_arg;
+  }
 
   // Since look-up was done lock-free, we need to check if another
   // thread beat us in the race to insert the symbol.
-
   Symbol* test = lookup(index, (char*)name, len, hashValue);
   if (test != NULL) {
-    // A race occurred and another thread introduced the symbol, this one
-    // will be dropped and collected.
-    delete sym;
+    // A race occurred and another thread introduced the symbol.
     assert(test->refcount() != 0, "lookup should have incremented the count");
     return test;
   }
 
+  // Create a new symbol.
+  Symbol* sym = allocate_symbol(name, len, CHECK_NULL);
+  assert(sym->equals((char*)name, len), "symbol must be properly initialized");
+
   HashtableEntry<Symbol*>* entry = new_entry(hashValue, sym);
-  sym->increment_refcount();
+  sym->increment_refcount();  // increment refcount in external hashtable
   add_entry(index, entry);
   return sym;
 }
@@ -309,31 +353,40 @@
                             const char** names, int* lengths,
                             int* cp_indices, unsigned int* hashValues,
                             TRAPS) {
-  Symbol* syms[symbol_alloc_batch_size];
-  bool allocated = allocate_symbols(names_count, (const u1**)names, lengths,
-                                    syms, CHECK_false);
-  if (!allocated) {
-    return false;
+
+  // Check symbol names are not too long.  If any are too long, don't add any.
+  for (int i = 0; i< names_count; i++) {
+    if (lengths[i] > Symbol::max_length()) {
+      THROW_MSG_0(vmSymbols::java_lang_InternalError(),
+                  "name is too long to represent");
+    }
   }
 
-  // Allocation must be done before grabbing the SymbolTable_lock lock
-  MutexLocker ml(SymbolTable_lock, THREAD);
+  // Cannot hit a safepoint in this function because the "this" pointer can move.
+  No_Safepoint_Verifier nsv;
 
   for (int i=0; i<names_count; i++) {
-    assert(syms[i]->equals(names[i], lengths[i]), "symbol must be properly initialized");
+    // Check if the symbol table has been rehashed, if so, need to recalculate
+    // the hash value.
+    unsigned int hashValue;
+    if (use_alternate_hashcode()) {
+      hashValue = hash_symbol(names[i], lengths[i]);
+    } else {
+      hashValue = hashValues[i];
+    }
     // Since look-up was done lock-free, we need to check if another
     // thread beat us in the race to insert the symbol.
-    int index = hash_to_index(hashValues[i]);
-    Symbol* test = lookup(index, names[i], lengths[i], hashValues[i]);
+    int index = hash_to_index(hashValue);
+    Symbol* test = lookup(index, names[i], lengths[i], hashValue);
     if (test != NULL) {
       // A race occurred and another thread introduced the symbol, this one
       // will be dropped and collected. Use test instead.
       cp->symbol_at_put(cp_indices[i], test);
       assert(test->refcount() != 0, "lookup should have incremented the count");
-      delete syms[i];
     } else {
-      Symbol* sym = syms[i];
-      HashtableEntry<Symbol*>* entry = new_entry(hashValues[i], sym);
+      Symbol* sym = allocate_symbol((const u1*)names[i], lengths[i], CHECK_(false));
+      assert(sym->equals(names[i], lengths[i]), "symbol must be properly initialized");  // why wouldn't it be???
+      HashtableEntry<Symbol*>* entry = new_entry(hashValue, sym);
       sym->increment_refcount();  // increment refcount in external hashtable
       add_entry(index, entry);
       cp->symbol_at_put(cp_indices[i], sym);
@@ -358,6 +411,24 @@
   }
 }
 
+void SymbolTable::dump(outputStream* st) {
+  NumberSeq summary;
+  for (int i = 0; i < the_table()->table_size(); ++i) {
+    int count = 0;
+    for (HashtableEntry<Symbol*>* e = the_table()->bucket(i);
+       e != NULL; e = e->next()) {
+      count++;
+    }
+    summary.add((double)count);
+  }
+  st->print_cr("SymbolTable statistics:");
+  st->print_cr("Number of buckets       : %7d", summary.num());
+  st->print_cr("Average bucket size     : %7.0f", summary.avg());
+  st->print_cr("Variance of bucket size : %7.0f", summary.variance());
+  st->print_cr("Std. dev. of bucket size: %7.0f", summary.sd());
+  st->print_cr("Maximum bucket size     : %7.0f", summary.maximum());
+}
+
 
 //---------------------------------------------------------------------------
 // Non-product code
@@ -454,7 +525,6 @@
     }
   }
 }
-
 #endif // PRODUCT
 
 // --------------------------------------------------------------------------
@@ -500,38 +570,52 @@
 // --------------------------------------------------------------------------
 StringTable* StringTable::_the_table = NULL;
 
+bool StringTable::_needs_rehashing = false;
+
+// Pick hashing algorithm
+unsigned int StringTable::hash_string(const jchar* s, int len) {
+  return use_alternate_hashcode() ? AltHashing::murmur3_32(seed(), s, len) :
+                                    java_lang_String::to_hash(s, len);
+}
+
 oop StringTable::lookup(int index, jchar* name,
                         int len, unsigned int hash) {
+  int count = 0;
   for (HashtableEntry<oop>* l = bucket(index); l != NULL; l = l->next()) {
+    count++;
     if (l->hash() == hash) {
       if (java_lang_String::equals(l->literal(), name, len)) {
         return l->literal();
       }
     }
   }
+  // If the bucket size is too deep check if this hash code is insufficient.
+  if (count >= BasicHashtable::rehash_count && !needs_rehashing()) {
+    _needs_rehashing = check_rehash_table(count);
+  }
   return NULL;
 }
 
 
-oop StringTable::basic_add(int index, Handle string_or_null, jchar* name,
-                           int len, unsigned int hashValue, TRAPS) {
-  debug_only(StableMemoryChecker smc(name, len * sizeof(name[0])));
-  assert(!Universe::heap()->is_in_reserved(name) || GC_locker::is_active(),
-         "proposed name of symbol must be stable");
-
-  Handle string;
-  // try to reuse the string if possible
-  if (!string_or_null.is_null() && (!JavaObjectsInPerm || string_or_null()->is_perm())) {
-    string = string_or_null;
-  } else {
-    string = java_lang_String::create_tenured_from_unicode(name, len, CHECK_NULL);
-  }
-
-  // Allocation must be done before grapping the SymbolTable_lock lock
-  MutexLocker ml(StringTable_lock, THREAD);
+oop StringTable::basic_add(int index_arg, Handle string, jchar* name,
+                           int len, unsigned int hashValue_arg, TRAPS) {
 
   assert(java_lang_String::equals(string(), name, len),
          "string must be properly initialized");
+  // Cannot hit a safepoint in this function because the "this" pointer can move.
+  No_Safepoint_Verifier nsv;
+
+  // Check if the symbol table has been rehashed, if so, need to recalculate
+  // the hash value and index before second lookup.
+  unsigned int hashValue;
+  int index;
+  if (use_alternate_hashcode()) {
+    hashValue = hash_string(name, len);
+    index = hash_to_index(hashValue);
+  } else {
+    hashValue = hashValue_arg;
+    index = index_arg;
+  }
 
   // Since look-up was done lock-free, we need to check if another
   // thread beat us in the race to insert the symbol.
@@ -552,7 +636,7 @@
   ResourceMark rm;
   int length;
   jchar* chars = symbol->as_unicode(length);
-  unsigned int hashValue = java_lang_String::hash_string(chars, length);
+  unsigned int hashValue = hash_string(chars, length);
   int index = the_table()->hash_to_index(hashValue);
   return the_table()->lookup(index, chars, length, hashValue);
 }
@@ -560,15 +644,31 @@
 
 oop StringTable::intern(Handle string_or_null, jchar* name,
                         int len, TRAPS) {
-  unsigned int hashValue = java_lang_String::hash_string(name, len);
+  unsigned int hashValue = hash_string(name, len);
   int index = the_table()->hash_to_index(hashValue);
-  oop string = the_table()->lookup(index, name, len, hashValue);
+  oop found_string = the_table()->lookup(index, name, len, hashValue);
 
   // Found
-  if (string != NULL) return string;
+  if (found_string != NULL) return found_string;
+
+  debug_only(StableMemoryChecker smc(name, len * sizeof(name[0])));
+  assert(!Universe::heap()->is_in_reserved(name) || GC_locker::is_active(),
+         "proposed name of symbol must be stable");
+
+  Handle string;
+  // try to reuse the string if possible
+  if (!string_or_null.is_null() && (!JavaObjectsInPerm || string_or_null()->is_perm())) {
+    string = string_or_null;
+  } else {
+    string = java_lang_String::create_tenured_from_unicode(name, len, CHECK_NULL);
+  }
+
+  // Grab the StringTable_lock before getting the_table() because it could
+  // change at safepoint.
+  MutexLocker ml(StringTable_lock, THREAD);
 
   // Otherwise, add to symbol to table
-  return the_table()->basic_add(index, string_or_null, name, len,
+  return the_table()->basic_add(index, string, name, len,
                                 hashValue, CHECK_NULL);
 }
 
@@ -611,18 +711,24 @@
   // entries at a safepoint.
   assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
   for (int i = 0; i < the_table()->table_size(); ++i) {
-    for (HashtableEntry<oop>** p = the_table()->bucket_addr(i); *p != NULL; ) {
-      HashtableEntry<oop>* entry = *p;
-      if (entry->is_shared()) {
+    HashtableEntry<oop>** p = the_table()->bucket_addr(i);
+    HashtableEntry<oop>* entry = the_table()->bucket(i);
+    while (entry != NULL) {
+      // Shared entries are normally at the end of the bucket and if we run into
+      // a shared entry, then there is nothing more to remove. However, if we
+      // have rehashed the table, then the shared entries are no longer at the
+      // end of the bucket.
+      if (entry->is_shared() && !use_alternate_hashcode()) {
         break;
       }
       assert(entry->literal() != NULL, "just checking");
-      if (is_alive->do_object_b(entry->literal())) {
+      if (entry->is_shared() || is_alive->do_object_b(entry->literal())) {
         p = entry->next_addr();
       } else {
         *p = entry->next();
         the_table()->free_entry(entry);
       }
+      entry = (HashtableEntry<oop>*)HashtableEntry<oop>::make_ptr(*p);
     }
   }
 }
@@ -661,3 +767,41 @@
     }
   }
 }
+
+void StringTable::dump(outputStream* st) {
+  NumberSeq summary;
+  for (int i = 0; i < the_table()->table_size(); ++i) {
+    HashtableEntry<oop>* p = the_table()->bucket(i);
+    int count = 0;
+    for ( ; p != NULL; p = p->next()) {
+      count++;
+    }
+    summary.add((double)count);
+  }
+  st->print_cr("StringTable statistics:");
+  st->print_cr("Number of buckets       : %7d", summary.num());
+  st->print_cr("Average bucket size     : %7.0f", summary.avg());
+  st->print_cr("Variance of bucket size : %7.0f", summary.variance());
+  st->print_cr("Std. dev. of bucket size: %7.0f", summary.sd());
+  st->print_cr("Maximum bucket size     : %7.0f", summary.maximum());
+}
+
+
+// Create a new table and using alternate hash code, populate the new table
+// with the existing strings.   Set flag to use the alternate hash code afterwards.
+void StringTable::rehash_table() {
+  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
+  // This should never happen with -Xshare:dump but it might in testing mode.
+  if (DumpSharedSpaces) return;
+  StringTable* new_table = new StringTable();
+
+  // Rehash the table
+  the_table()->move_to(new_table);
+
+  // Delete the table and buckets (entries are reused in new table).
+  delete _the_table;
+  // Don't check if we need rehashing until the table gets unbalanced again.
+  // Then rehash with a new global seed.
+  _needs_rehashing = false;
+  _the_table = new_table;
+}
--- a/src/share/vm/classfile/symbolTable.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/classfile/symbolTable.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -40,6 +40,7 @@
 //  - symbolTableEntrys are allocated in blocks to reduce the space overhead.
 
 class BoolObjectClosure;
+class outputStream;
 
 
 // Class to hold a newly created or referenced Symbol* temporarily in scope.
@@ -78,12 +79,14 @@
   // The symbol table
   static SymbolTable* _the_table;
 
+  // Set if one bucket is out of balance due to hash algorithm deficiency
+  static bool _needs_rehashing;
+
   // For statistics
   static int symbols_removed;
   static int symbols_counted;
 
   Symbol* allocate_symbol(const u1* name, int len, TRAPS);   // Assumes no characters larger than 0x7F
-  bool allocate_symbols(int names_count, const u1** names, int* lengths, Symbol** syms, TRAPS);
 
   // Adding elements
   Symbol* basic_add(int index, u1* name, int len,
@@ -114,7 +117,6 @@
     : Hashtable<Symbol*>(symbol_table_size, sizeof (HashtableEntry<Symbol*>), t,
                 number_of_entries) {}
 
-
 public:
   enum {
     symbol_alloc_batch_size = 8
@@ -136,6 +138,8 @@
     _the_table = new SymbolTable(t, number_of_entries);
   }
 
+  static unsigned int hash_symbol(const char* s, int len);
+
   static Symbol* lookup(const char* name, int len, TRAPS);
   // lookup only, won't add. Also calculate hash.
   static Symbol* lookup_only(const char* name, int len, unsigned int& hash);
@@ -195,6 +199,7 @@
 
   // Debugging
   static void verify();
+  static void dump(outputStream* st);
 
   // Sharing
   static void copy_buckets(char** top, char*end) {
@@ -206,8 +211,13 @@
   static void reverse(void* boundary = NULL) {
     the_table()->Hashtable<Symbol*>::reverse(boundary);
   }
+
+  // Rehash the symbol table if it gets out of balance
+  static void rehash_table();
+  static bool needs_rehashing()         { return _needs_rehashing; }
 };
 
+
 class StringTable : public Hashtable<oop> {
   friend class VMStructs;
 
@@ -215,6 +225,9 @@
   // The string table
   static StringTable* _the_table;
 
+  // Set if one bucket is out of balance due to hash algorithm deficiency
+  static bool _needs_rehashing;
+
   static oop intern(Handle string_or_null, jchar* chars, int length, TRAPS);
   oop basic_add(int index, Handle string_or_null, jchar* name, int len,
                 unsigned int hashValue, TRAPS);
@@ -227,7 +240,6 @@
   StringTable(HashtableBucket* t, int number_of_entries)
     : Hashtable<oop>((int)StringTableSize, sizeof (HashtableEntry<oop>), t,
                      number_of_entries) {}
-
 public:
   // The string table
   static StringTable* the_table() { return _the_table; }
@@ -252,6 +264,14 @@
   // Invoke "f->do_oop" on the locations of all oops in the table.
   static void oops_do(OopClosure* f);
 
+  // Hashing algorithm, used as the hash value used by the
+  //     StringTable for bucket selection and comparison (stored in the
+  //     HashtableEntry structures).  This is used in the String.intern() method.
+  static unsigned int hash_string(const jchar* s, int len);
+
+  // Internal test.
+  static void test_alt_hash() PRODUCT_RETURN;
+
   // Probing
   static oop lookup(Symbol* symbol);
 
@@ -262,6 +282,7 @@
 
   // Debugging
   static void verify();
+  static void dump(outputStream* st);
 
   // Sharing
   static void copy_buckets(char** top, char*end) {
@@ -273,6 +294,9 @@
   static void reverse() {
     the_table()->Hashtable<oop>::reverse();
   }
+
+  // Rehash the symbol table if it gets out of balance
+  static void rehash_table();
+  static bool needs_rehashing() { return _needs_rehashing; }
 };
-
 #endif // SHARE_VM_CLASSFILE_SYMBOLTABLE_HPP
--- a/src/share/vm/classfile/systemDictionary.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/classfile/systemDictionary.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1971,6 +1971,9 @@
   // first do Object, String, Class
   initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK);
 
+  // Calculate offsets for String and Class classes since they are loaded and
+  // can be used after this point.
+  java_lang_String::compute_offsets();
   java_lang_Class::compute_offsets();
 
   // Fixup mirrors for classes loaded before java.lang.Class.
--- a/src/share/vm/classfile/verifier.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/classfile/verifier.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1738,10 +1738,14 @@
   int target = bci + default_offset;
   stackmap_table->check_jump_target(current_frame, target, CHECK_VERIFY(this));
   for (int i = 0; i < keys; i++) {
+    // Because check_jump_target() may safepoint, the bytecode could have
+    // moved, which means 'aligned_bcp' is no good and needs to be recalculated.
+    aligned_bcp = (address)round_to((intptr_t)(bcs->bcp() + 1), jintSize);
     target = bci + (jint)Bytes::get_Java_u4(aligned_bcp+(3+i*delta)*jintSize);
     stackmap_table->check_jump_target(
       current_frame, target, CHECK_VERIFY(this));
   }
+  NOT_PRODUCT(aligned_bcp = NULL);  // no longer valid at this point
 }
 
 bool ClassVerifier::name_in_supers(
@@ -1880,10 +1884,10 @@
   VerificationType type = current_frame->pop_stack(
     VerificationType::reference_check(), CHECK_VERIFY(this));
   if (type == VerificationType::uninitialized_this_type()) {
-    // The method must be an <init> method of either this class, or one of its
-    // superclasses
+    // The method must be an <init> method of this class or its superclass
+    klassOop superk = current_class()->super();
     if (ref_class_type.name() != current_class()->name() &&
-        !name_in_supers(ref_class_type.name(), current_class())) {
+        ref_class_type.name() != superk->klass_part()->name()) {
       verify_error(bci, "Bad <init> method call");
       return;
     }
--- a/src/share/vm/classfile/vmSymbols.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/classfile/vmSymbols.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -339,6 +339,9 @@
   template(park_event_name,                           "nativeParkEventPointer")                   \
   template(cache_field_name,                          "cache")                                    \
   template(value_name,                                "value")                                    \
+  template(offset_name,                               "offset")                                   \
+  template(count_name,                                "count")                                    \
+  template(hash_name,                                 "hash")                                     \
   template(frontCacheEnabled_name,                    "frontCacheEnabled")                        \
   template(stringCacheEnabled_name,                   "stringCacheEnabled")                       \
   template(numberOfLeadingZeros_name,                 "numberOfLeadingZeros")                     \
--- a/src/share/vm/compiler/compilerOracle.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/compiler/compilerOracle.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -550,14 +550,25 @@
   }
 }
 
+static const char* default_cc_file = ".hotspot_compiler";
+
 static const char* cc_file() {
-  if (CompileCommandFile == NULL)
-    return ".hotspot_compiler";
+#ifdef ASSERT
+  if (CompileCommandFile == NULL) {
+    return default_cc_file;
+  }
+#endif
   return CompileCommandFile;
 }
+
+bool CompilerOracle::has_command_file() {
+  return cc_file() != NULL;
+}
+
 bool CompilerOracle::_quiet = false;
 
 void CompilerOracle::parse_from_file() {
+  assert(has_command_file(), "command file must be specified");
   FILE* stream = fopen(cc_file(), "rt");
   if (stream == NULL) return;
 
@@ -600,6 +611,7 @@
 }
 
 void CompilerOracle::append_comment_to_file(const char* message) {
+  assert(has_command_file(), "command file must be specified");
   fileStream stream(fopen(cc_file(), "at"));
   stream.print("# ");
   for (int index = 0; message[index] != '\0'; index++) {
@@ -610,6 +622,7 @@
 }
 
 void CompilerOracle::append_exclude_to_file(methodHandle method) {
+  assert(has_command_file(), "command file must be specified");
   fileStream stream(fopen(cc_file(), "at"));
   stream.print("exclude ");
   Klass::cast(method->method_holder())->name()->print_symbol_on(&stream);
@@ -624,10 +637,19 @@
 void compilerOracle_init() {
   CompilerOracle::parse_from_string(CompileCommand, CompilerOracle::parse_from_line);
   CompilerOracle::parse_from_string(CompileOnly, CompilerOracle::parse_compile_only);
-  CompilerOracle::parse_from_file();
+  if (CompilerOracle::has_command_file()) {
+    CompilerOracle::parse_from_file();
+  } else {
+    struct stat buf;
+    if (os::stat(default_cc_file, &buf) == 0) {
+      warning("%s file is present but has been ignored.  "
+              "Run with -XX:CompileCommandFile=%s to load the file.",
+              default_cc_file, default_cc_file);
+    }
+  }
   if (lists[PrintCommand] != NULL) {
     if (PrintAssembly) {
-      warning("CompileCommand and/or .hotspot_compiler file contains 'print' commands, but PrintAssembly is also enabled");
+      warning("CompileCommand and/or %s file contains 'print' commands, but PrintAssembly is also enabled", default_cc_file);
     } else if (FLAG_IS_DEFAULT(DebugNonSafepoints)) {
       warning("printing of assembly code is enabled; turning on DebugNonSafepoints to gain additional output");
       DebugNonSafepoints = true;
--- a/src/share/vm/compiler/compilerOracle.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/compiler/compilerOracle.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -36,6 +36,10 @@
   static bool _quiet;
 
  public:
+
+  // True if the command file has been specified or is implicit
+  static bool has_command_file();
+
   // Reads from file and adds to lists
   static void parse_from_file();
 
--- a/src/share/vm/gc_implementation/shared/gcUtil.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/gc_implementation/shared/gcUtil.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -31,9 +31,15 @@
                                                         float average) {
   // We smooth the samples by not using weight() directly until we've
   // had enough data to make it meaningful. We'd like the first weight
-  // used to be 1, the second to be 1/2, etc until we have 100/weight
-  // samples.
-  unsigned count_weight = 100/count();
+  // used to be 1, the second to be 1/2, etc until we have
+  // OLD_THRESHOLD/weight samples.
+  unsigned count_weight = 0;
+
+  // Avoid division by zero if the counter wraps (7158457)
+  if (!is_old()) {
+    count_weight = OLD_THRESHOLD/count();
+  }
+
   unsigned adaptive_weight = (MAX2(weight(), count_weight));
 
   float new_avg = exp_avg(average, new_sample, adaptive_weight);
@@ -43,8 +49,6 @@
 
 void AdaptiveWeightedAverage::sample(float new_sample) {
   increment_count();
-  assert(count() != 0,
-         "Wraparound -- history would be incorrectly discarded");
 
   // Compute the new weighted average
   float new_avg = compute_adaptive_average(new_sample, average());
--- a/src/share/vm/gc_implementation/shared/gcUtil.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/gc_implementation/shared/gcUtil.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -50,11 +50,20 @@
   unsigned         _weight;         // The weight used to smooth the averages
                                     //   A higher weight favors the most
                                     //   recent data.
+  bool             _is_old;         // Has enough historical data
+
+  const static unsigned OLD_THRESHOLD = 100;
 
  protected:
   float            _last_sample;    // The last value sampled.
 
-  void  increment_count()       { _sample_count++;       }
+  void  increment_count() {
+    _sample_count++;
+    if (!_is_old && _sample_count > OLD_THRESHOLD) {
+      _is_old = true;
+    }
+  }
+
   void  set_average(float avg)  { _average = avg;        }
 
   // Helper function, computes an adaptive weighted average
@@ -64,13 +73,15 @@
  public:
   // Input weight must be between 0 and 100
   AdaptiveWeightedAverage(unsigned weight, float avg = 0.0) :
-    _average(avg), _sample_count(0), _weight(weight), _last_sample(0.0) {
+    _average(avg), _sample_count(0), _weight(weight), _last_sample(0.0),
+    _is_old(false) {
   }
 
   void clear() {
     _average = 0;
     _sample_count = 0;
     _last_sample = 0;
+    _is_old = false;
   }
 
   // Useful for modifying static structures after startup.
@@ -84,7 +95,8 @@
   float    average() const       { return _average;       }
   unsigned weight()  const       { return _weight;        }
   unsigned count()   const       { return _sample_count;  }
-  float    last_sample() const   { return _last_sample; }
+  float    last_sample() const   { return _last_sample;   }
+  bool     is_old()  const       { return _is_old;        }
 
   // Update data with a new sample.
   void sample(float new_sample);
--- a/src/share/vm/interpreter/interpreterRuntime.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/interpreter/interpreterRuntime.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -844,6 +844,14 @@
     int bci = method->bci_from(fr.interpreter_frame_bcp());
     nm = method->lookup_osr_nmethod_for(bci, CompLevel_none, false);
   }
+#ifndef PRODUCT
+  if (TraceOnStackReplacement) {
+    if (nm != NULL) {
+      tty->print("OSR entry @ pc: " INTPTR_FORMAT ": ", nm->osr_entry());
+      nm->print();
+    }
+  }
+#endif
   return nm;
 }
 
--- a/src/share/vm/memory/barrierSet.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/memory/barrierSet.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -181,6 +181,8 @@
   // within the heap, this function tells whether they are met.
   virtual bool is_aligned(HeapWord* addr) = 0;
 
+  // Print a description of the memory for the barrier set
+  virtual void print_on(outputStream* st) const = 0;
 };
 
 #endif // SHARE_VM_MEMORY_BARRIERSET_HPP
--- a/src/share/vm/memory/cardTableModRefBS.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/memory/cardTableModRefBS.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -711,6 +711,11 @@
 }
 #endif
 
+void CardTableModRefBS::print_on(outputStream* st) const {
+  st->print_cr("Card table byte_map: [" INTPTR_FORMAT "," INTPTR_FORMAT "] byte_map_base: " INTPTR_FORMAT,
+               _byte_map, _byte_map + _byte_map_size, byte_map_base);
+}
+
 bool CardTableModRefBSForCTRS::card_will_be_scanned(jbyte cv) {
   return
     CardTableModRefBS::card_will_be_scanned(cv) ||
--- a/src/share/vm/memory/cardTableModRefBS.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/memory/cardTableModRefBS.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -469,6 +469,9 @@
     return _byte_map + card_index;
   }
 
+  // Print a description of the memory for the barrier set
+  virtual void print_on(outputStream* st) const;
+
   void verify();
   void verify_guard();
 
--- a/src/share/vm/memory/dump.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/memory/dump.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -62,8 +62,8 @@
 // written later, increasing the likelihood that the shared page contain
 // the hash can be shared.
 //
-// NOTE THAT the algorithm in StringTable::hash_string() MUST MATCH the
-// algorithm in java.lang.String.hashCode().
+// NOTE THAT we have to call java_lang_String::to_hash() to match the
+// algorithm in java.lang.String.toHash().
 
 class StringHashCodeClosure: public OopClosure {
 private:
@@ -78,9 +78,9 @@
   void do_oop(oop* p) {
     if (p != NULL) {
       oop obj = *p;
-      if (obj->klass() == SystemDictionary::String_klass()) {
-
-        int hash = java_lang_String::hash_string(obj);
+      if (obj->klass() == SystemDictionary::String_klass() &&
+          java_lang_String::has_hash_field()) {
+        int hash = java_lang_String::to_hash(obj);
         obj->int_field_put(hash_offset, hash);
       }
     }
--- a/src/share/vm/memory/universe.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/memory/universe.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -273,7 +273,7 @@
   }
 
   static klassOop typeArrayKlassObj(BasicType t) {
-    assert((uint)t < T_VOID+1, "range check");
+    assert((uint)t < T_VOID+1, err_msg("range check for type: %s", type2name(t)));
     assert(_typeArrayKlassObjs[t] != NULL, "domain check");
     return _typeArrayKlassObjs[t];
   }
--- a/src/share/vm/oops/methodOop.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/oops/methodOop.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -70,11 +70,11 @@
   return _adapter->get_c2i_unverified_entry();
 }
 
-char* methodOopDesc::name_and_sig_as_C_string() {
+char* methodOopDesc::name_and_sig_as_C_string() const {
   return name_and_sig_as_C_string(Klass::cast(constants()->pool_holder()), name(), signature());
 }
 
-char* methodOopDesc::name_and_sig_as_C_string(char* buf, int size) {
+char* methodOopDesc::name_and_sig_as_C_string(char* buf, int size) const {
   return name_and_sig_as_C_string(Klass::cast(constants()->pool_holder()), name(), signature(), buf, size);
 }
 
@@ -177,7 +177,8 @@
 
 
 int methodOopDesc::bci_from(address bcp) const {
-  assert(is_native() && bcp == code_base() || contains(bcp) || is_error_reported(), "bcp doesn't belong to this method");
+  assert(is_native() && bcp == code_base() || contains(bcp) || is_error_reported(),
+         err_msg("bcp doesn't belong to this method: bcp: " INTPTR_FORMAT ", method: %s", bcp, name_and_sig_as_C_string()));
   return bcp - code_base();
 }
 
--- a/src/share/vm/oops/methodOop.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/oops/methodOop.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -198,8 +198,8 @@
   // C string, for the purpose of providing more useful NoSuchMethodErrors
   // and fatal error handling. The string is allocated in resource
   // area if a buffer is not provided by the caller.
-  char* name_and_sig_as_C_string();
-  char* name_and_sig_as_C_string(char* buf, int size);
+  char* name_and_sig_as_C_string() const;
+  char* name_and_sig_as_C_string(char* buf, int size) const;
 
   // Static routine in the situations we don't have a methodOop
   static char* name_and_sig_as_C_string(Klass* klass, Symbol* method_name, Symbol* signature);
--- a/src/share/vm/opto/callGenerator.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/opto/callGenerator.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -172,9 +172,11 @@
 
 JVMState* DynamicCallGenerator::generate(JVMState* jvms) {
   GraphKit kit(jvms);
+  Compile* C = kit.C;
+  PhaseGVN& gvn = kit.gvn();
 
-  if (kit.C->log() != NULL) {
-    kit.C->log()->elem("dynamic_call bci='%d'", jvms->bci());
+  if (C->log() != NULL) {
+    C->log()->elem("dynamic_call bci='%d'", jvms->bci());
   }
 
   // Get the constant pool cache from the caller class.
@@ -190,18 +192,21 @@
   size_t call_site_offset = cpcache->get_f1_offset(index);
 
   // Load the CallSite object from the constant pool cache.
-  const TypeOopPtr* cpcache_ptr = TypeOopPtr::make_from_constant(cpcache);
-  Node* cpcache_adr = kit.makecon(cpcache_ptr);
-  Node* call_site_adr = kit.basic_plus_adr(cpcache_adr, cpcache_adr, call_site_offset);
-  Node* call_site = kit.make_load(kit.control(), call_site_adr, TypeInstPtr::BOTTOM, T_OBJECT, Compile::AliasIdxRaw);
+  const TypeOopPtr* cpcache_type   = TypeOopPtr::make_from_constant(cpcache);  // returns TypeAryPtr of type T_OBJECT
+  const TypeOopPtr* call_site_type = TypeOopPtr::make_from_klass(C->env()->CallSite_klass());
+  Node* cpcache_adr   = kit.makecon(cpcache_type);
+  Node* call_site_adr = kit.basic_plus_adr(cpcache_adr, call_site_offset);
+  // The oops in the constant pool cache are not compressed; load then as raw pointers.
+  Node* call_site     = kit.make_load(kit.control(), call_site_adr, call_site_type, T_ADDRESS, Compile::AliasIdxRaw);
 
   // Load the target MethodHandle from the CallSite object.
-  Node* target_mh_adr = kit.basic_plus_adr(call_site, call_site, java_lang_invoke_CallSite::target_offset_in_bytes());
-  Node* target_mh = kit.make_load(kit.control(), target_mh_adr, TypeInstPtr::BOTTOM, T_OBJECT);
+  const TypeOopPtr* target_type = TypeOopPtr::make_from_klass(C->env()->MethodHandle_klass());
+  Node* target_mh_adr = kit.basic_plus_adr(call_site, java_lang_invoke_CallSite::target_offset_in_bytes());
+  Node* target_mh     = kit.make_load(kit.control(), target_mh_adr, target_type, T_OBJECT);
 
   address resolve_stub = SharedRuntime::get_resolve_opt_virtual_call_stub();
 
-  CallStaticJavaNode *call = new (kit.C, tf()->domain()->cnt()) CallStaticJavaNode(tf(), resolve_stub, method(), kit.bci());
+  CallStaticJavaNode* call = new (C, tf()->domain()->cnt()) CallStaticJavaNode(tf(), resolve_stub, method(), kit.bci());
   // invokedynamic is treated as an optimized invokevirtual.
   call->set_optimized_virtual(true);
   // Take extra care (in the presence of argument motion) not to trash the SP:
@@ -785,9 +790,10 @@
 
 JVMState* PredictedDynamicCallGenerator::generate(JVMState* jvms) {
   GraphKit kit(jvms);
+  Compile* C = kit.C;
   PhaseGVN& gvn = kit.gvn();
 
-  CompileLog* log = kit.C->log();
+  CompileLog* log = C->log();
   if (log != NULL) {
     log->elem("predicted_dynamic_call bci='%d'", jvms->bci());
   }
@@ -803,8 +809,8 @@
     Node* receiver = kit.argument(0);
 
     // Check if the MethodHandle is the expected one
-    Node* cmp = gvn.transform(new(kit.C, 3) CmpPNode(receiver, predicted_mh));
-    bol = gvn.transform(new(kit.C, 2) BoolNode(cmp, BoolTest::eq) );
+    Node* cmp = gvn.transform(new (C, 3) CmpPNode(receiver, predicted_mh));
+    bol = gvn.transform(new (C, 2) BoolNode(cmp, BoolTest::eq) );
   } else {
     // Get the constant pool cache from the caller class.
     ciMethod* caller_method = jvms->method();
@@ -818,22 +824,25 @@
     size_t call_site_offset = cpcache->get_f1_offset(index);
 
     // Load the CallSite object from the constant pool cache.
-    const TypeOopPtr* cpcache_ptr = TypeOopPtr::make_from_constant(cpcache);
-    Node* cpcache_adr   = kit.makecon(cpcache_ptr);
-    Node* call_site_adr = kit.basic_plus_adr(cpcache_adr, cpcache_adr, call_site_offset);
-    Node* call_site     = kit.make_load(kit.control(), call_site_adr, TypeInstPtr::BOTTOM, T_OBJECT, Compile::AliasIdxRaw);
+    const TypeOopPtr* cpcache_type   = TypeOopPtr::make_from_constant(cpcache);  // returns TypeAryPtr of type T_OBJECT
+    const TypeOopPtr* call_site_type = TypeOopPtr::make_from_klass(C->env()->CallSite_klass());
+    Node* cpcache_adr   = kit.makecon(cpcache_type);
+    Node* call_site_adr = kit.basic_plus_adr(cpcache_adr, call_site_offset);
+    // The oops in the constant pool cache are not compressed; load then as raw pointers.
+    Node* call_site     = kit.make_load(kit.control(), call_site_adr, call_site_type, T_ADDRESS, Compile::AliasIdxRaw);
 
     // Load the target MethodHandle from the CallSite object.
+    const TypeOopPtr* target_type = TypeOopPtr::make_from_klass(C->env()->MethodHandle_klass());
     Node* target_adr = kit.basic_plus_adr(call_site, call_site, java_lang_invoke_CallSite::target_offset_in_bytes());
-    Node* target_mh  = kit.make_load(kit.control(), target_adr, TypeInstPtr::BOTTOM, T_OBJECT);
+    Node* target_mh  = kit.make_load(kit.control(), target_adr, target_type, T_OBJECT);
 
     // Check if the MethodHandle is still the same.
-    Node* cmp = gvn.transform(new(kit.C, 3) CmpPNode(target_mh, predicted_mh));
-    bol = gvn.transform(new(kit.C, 2) BoolNode(cmp, BoolTest::eq) );
+    Node* cmp = gvn.transform(new (C, 3) CmpPNode(target_mh, predicted_mh));
+    bol = gvn.transform(new (C, 2) BoolNode(cmp, BoolTest::eq) );
   }
   IfNode* iff = kit.create_and_xform_if(kit.control(), bol, _hit_prob, COUNT_UNKNOWN);
-  kit.set_control( gvn.transform(new(kit.C, 1) IfTrueNode (iff)));
-  Node* slow_ctl = gvn.transform(new(kit.C, 1) IfFalseNode(iff));
+  kit.set_control( gvn.transform(new (C, 1) IfTrueNode (iff)));
+  Node* slow_ctl = gvn.transform(new (C, 1) IfFalseNode(iff));
 
   SafePointNode* slow_map = NULL;
   JVMState* slow_jvms;
@@ -882,7 +891,7 @@
 
   // Finish the diamond.
   kit.C->set_has_split_ifs(true); // Has chance for split-if optimization
-  RegionNode* region = new (kit.C, 3) RegionNode(3);
+  RegionNode* region = new (C, 3) RegionNode(3);
   region->init_req(1, kit.control());
   region->init_req(2, slow_map->control());
   kit.set_control(gvn.transform(region));
--- a/src/share/vm/opto/chaitin.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/opto/chaitin.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1483,7 +1483,7 @@
 
   // Check for AddP-related opcodes
   if( !derived->is_Phi() ) {
-    assert( derived->as_Mach()->ideal_Opcode() == Op_AddP, "" );
+    assert(derived->as_Mach()->ideal_Opcode() == Op_AddP, err_msg("but is: %s", derived->Name()));
     Node *base = derived->in(AddPNode::Base);
     derived_base_map[derived->_idx] = base;
     return base;
--- a/src/share/vm/opto/divnode.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/opto/divnode.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -284,9 +284,14 @@
 
   const int N = 64;
 
+  // Dummy node to keep intermediate nodes alive during construction
+  Node* hook = new (phase->C, 4) Node(4);
+
   // u0 = u & 0xFFFFFFFF;  u1 = u >> 32;
   Node* u0 = phase->transform(new (phase->C, 3) AndLNode(dividend, phase->longcon(0xFFFFFFFF)));
   Node* u1 = phase->transform(new (phase->C, 3) RShiftLNode(dividend, phase->intcon(N / 2)));
+  hook->init_req(0, u0);
+  hook->init_req(1, u1);
 
   // v0 = v & 0xFFFFFFFF;  v1 = v >> 32;
   Node* v0 = phase->longcon(magic_const & 0xFFFFFFFF);
@@ -299,19 +304,14 @@
   Node* u1v0 = phase->transform(new (phase->C, 3) MulLNode(u1, v0));
   Node* temp = phase->transform(new (phase->C, 3) URShiftLNode(w0, phase->intcon(N / 2)));
   Node* t    = phase->transform(new (phase->C, 3) AddLNode(u1v0, temp));
+  hook->init_req(2, t);
 
   // w1 = t & 0xFFFFFFFF;
-  Node* w1 = new (phase->C, 3) AndLNode(t, phase->longcon(0xFFFFFFFF));
+  Node* w1 = phase->transform(new (phase->C, 3) AndLNode(t, phase->longcon(0xFFFFFFFF)));
+  hook->init_req(3, w1);
 
   // w2 = t >> 32;
-  Node* w2 = new (phase->C, 3) RShiftLNode(t, phase->intcon(N / 2));
-
-  // 6732154: Construct both w1 and w2 before transforming, so t
-  // doesn't go dead prematurely.
-  // 6837011: We need to transform w2 before w1 because the
-  // transformation of w1 could return t.
-  w2 = phase->transform(w2);
-  w1 = phase->transform(w1);
+  Node* w2 = phase->transform(new (phase->C, 3) RShiftLNode(t, phase->intcon(N / 2)));
 
   // w1 = u0*v1 + w1;
   Node* u0v1 = phase->transform(new (phase->C, 3) MulLNode(u0, v1));
@@ -322,6 +322,16 @@
   Node* temp1 = phase->transform(new (phase->C, 3) AddLNode(u1v1, w2));
   Node* temp2 = phase->transform(new (phase->C, 3) RShiftLNode(w1, phase->intcon(N / 2)));
 
+  // Remove the bogus extra edges used to keep things alive
+  PhaseIterGVN* igvn = phase->is_IterGVN();
+  if (igvn != NULL) {
+    igvn->remove_dead_node(hook);
+  } else {
+    for (int i = 0; i < 4; i++) {
+      hook->set_req(i, NULL);
+    }
+  }
+
   return new (phase->C, 3) AddLNode(temp1, temp2);
 }
 
--- a/src/share/vm/opto/graphKit.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/opto/graphKit.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
@@ -3748,3 +3748,81 @@
   final_sync(ideal);
 }
 #undef __
+
+
+
+Node* GraphKit::load_String_offset(Node* ctrl, Node* str) {
+  if (java_lang_String::has_offset_field()) {
+    int offset_offset = java_lang_String::offset_offset_in_bytes();
+    const TypeInstPtr* string_type = TypeInstPtr::make(TypePtr::NotNull, C->env()->String_klass(),
+                                                       false, NULL, 0);
+    const TypePtr* offset_field_type = string_type->add_offset(offset_offset);
+    int offset_field_idx = C->get_alias_index(offset_field_type);
+    return make_load(ctrl,
+                     basic_plus_adr(str, str, offset_offset),
+                     TypeInt::INT, T_INT, offset_field_idx);
+  } else {
+    return intcon(0);
+  }
+}
+
+Node* GraphKit::load_String_length(Node* ctrl, Node* str) {
+  if (java_lang_String::has_count_field()) {
+    int count_offset = java_lang_String::count_offset_in_bytes();
+    const TypeInstPtr* string_type = TypeInstPtr::make(TypePtr::NotNull, C->env()->String_klass(),
+                                                       false, NULL, 0);
+    const TypePtr* count_field_type = string_type->add_offset(count_offset);
+    int count_field_idx = C->get_alias_index(count_field_type);
+    return make_load(ctrl,
+                     basic_plus_adr(str, str, count_offset),
+                     TypeInt::INT, T_INT, count_field_idx);
+  } else {
+    return load_array_length(load_String_value(ctrl, str));
+  }
+}
+
+Node* GraphKit::load_String_value(Node* ctrl, Node* str) {
+  int value_offset = java_lang_String::value_offset_in_bytes();
+  const TypeInstPtr* string_type = TypeInstPtr::make(TypePtr::NotNull, C->env()->String_klass(),
+                                                     false, NULL, 0);
+  const TypePtr* value_field_type = string_type->add_offset(value_offset);
+  const TypeAryPtr*  value_type = TypeAryPtr::make(TypePtr::NotNull,
+                                                   TypeAry::make(TypeInt::CHAR,TypeInt::POS),
+                                                   ciTypeArrayKlass::make(T_CHAR), true, 0);
+  int value_field_idx = C->get_alias_index(value_field_type);
+  return make_load(ctrl, basic_plus_adr(str, str, value_offset),
+                   value_type, T_OBJECT, value_field_idx);
+}
+
+void GraphKit::store_String_offset(Node* ctrl, Node* str, Node* value) {
+  int offset_offset = java_lang_String::offset_offset_in_bytes();
+  const TypeInstPtr* string_type = TypeInstPtr::make(TypePtr::NotNull, C->env()->String_klass(),
+                                                     false, NULL, 0);
+  const TypePtr* offset_field_type = string_type->add_offset(offset_offset);
+  int offset_field_idx = C->get_alias_index(offset_field_type);
+  store_to_memory(ctrl, basic_plus_adr(str, offset_offset),
+                  value, T_INT, offset_field_idx);
+}
+
+void GraphKit::store_String_value(Node* ctrl, Node* str, Node* value) {
+  int value_offset = java_lang_String::value_offset_in_bytes();
+  const TypeInstPtr* string_type = TypeInstPtr::make(TypePtr::NotNull, C->env()->String_klass(),
+                                                     false, NULL, 0);
+  const TypePtr* value_field_type = string_type->add_offset(value_offset);
+  const TypeAryPtr*  value_type = TypeAryPtr::make(TypePtr::NotNull,
+                                                   TypeAry::make(TypeInt::CHAR,TypeInt::POS),
+                                                   ciTypeArrayKlass::make(T_CHAR), true, 0);
+  int value_field_idx = C->get_alias_index(value_field_type);
+  store_to_memory(ctrl, basic_plus_adr(str, value_offset),
+                  value, T_OBJECT, value_field_idx);
+}
+
+void GraphKit::store_String_length(Node* ctrl, Node* str, Node* value) {
+  int count_offset = java_lang_String::count_offset_in_bytes();
+  const TypeInstPtr* string_type = TypeInstPtr::make(TypePtr::NotNull, C->env()->String_klass(),
+                                                     false, NULL, 0);
+  const TypePtr* count_field_type = string_type->add_offset(count_offset);
+  int count_field_idx = C->get_alias_index(count_field_type);
+  store_to_memory(ctrl, basic_plus_adr(str, count_offset),
+                  value, T_INT, count_field_idx);
+}
--- a/src/share/vm/opto/graphKit.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/opto/graphKit.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
@@ -781,6 +781,14 @@
   Node* new_array(Node* klass_node, Node* count_val, int nargs,
                   Node* *return_size_val = NULL);
 
+  // java.lang.String helpers
+  Node* load_String_offset(Node* ctrl, Node* str);
+  Node* load_String_length(Node* ctrl, Node* str);
+  Node* load_String_value(Node* ctrl, Node* str);
+  void store_String_offset(Node* ctrl, Node* str, Node* value);
+  void store_String_length(Node* ctrl, Node* str, Node* value);
+  void store_String_value(Node* ctrl, Node* str, Node* value);
+
   // Handy for making control flow
   IfNode* create_and_map_if(Node* ctrl, Node* tst, float prob, float cnt) {
     IfNode* iff = new (C, 2) IfNode(ctrl, tst, prob, cnt);// New IfNode's
--- a/src/share/vm/opto/library_call.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/opto/library_call.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -147,7 +147,8 @@
     return generate_method_call(method_id, true, false);
   }
 
-  Node* make_string_method_node(int opcode, Node* str1, Node* cnt1, Node* str2, Node* cnt2);
+  Node* make_string_method_node(int opcode, Node* str1_start, Node* cnt1, Node* str2_start, Node* cnt2);
+  Node* make_string_method_node(int opcode, Node* str1, Node* str2);
   bool inline_string_compareTo();
   bool inline_string_indexOf();
   Node* string_indexOf(Node* string_object, ciTypeArray* target_array, jint offset, jint cache_i, jint md2_i);
@@ -844,48 +845,45 @@
 
 
 //------------------------------make_string_method_node------------------------
-// Helper method for String intrinsic finctions.
-Node* LibraryCallKit::make_string_method_node(int opcode, Node* str1, Node* cnt1, Node* str2, Node* cnt2) {
-  const int value_offset  = java_lang_String::value_offset_in_bytes();
-  const int count_offset  = java_lang_String::count_offset_in_bytes();
-  const int offset_offset = java_lang_String::offset_offset_in_bytes();
-
+// Helper method for String intrinsic functions. This version is called
+// with str1 and str2 pointing to String object nodes.
+//
+Node* LibraryCallKit::make_string_method_node(int opcode, Node* str1, Node* str2) {
   Node* no_ctrl = NULL;
 
-  ciInstanceKlass* klass = env()->String_klass();
-  const TypeOopPtr* string_type = TypeOopPtr::make_from_klass(klass);
-
-  const TypeAryPtr* value_type =
-        TypeAryPtr::make(TypePtr::NotNull,
-                         TypeAry::make(TypeInt::CHAR,TypeInt::POS),
-                         ciTypeArrayKlass::make(T_CHAR), true, 0);
-
-  // Get start addr of string and substring
-  Node* str1_valuea  = basic_plus_adr(str1, str1, value_offset);
-  Node* str1_value   = make_load(no_ctrl, str1_valuea, value_type, T_OBJECT, string_type->add_offset(value_offset));
-  Node* str1_offseta = basic_plus_adr(str1, str1, offset_offset);
-  Node* str1_offset  = make_load(no_ctrl, str1_offseta, TypeInt::INT, T_INT, string_type->add_offset(offset_offset));
+  // Get start addr of string
+  Node* str1_value   = load_String_value(no_ctrl, str1);
+  Node* str1_offset  = load_String_offset(no_ctrl, str1);
   Node* str1_start   = array_element_address(str1_value, str1_offset, T_CHAR);
 
-  Node* str2_valuea  = basic_plus_adr(str2, str2, value_offset);
-  Node* str2_value   = make_load(no_ctrl, str2_valuea, value_type, T_OBJECT, string_type->add_offset(value_offset));
-  Node* str2_offseta = basic_plus_adr(str2, str2, offset_offset);
-  Node* str2_offset  = make_load(no_ctrl, str2_offseta, TypeInt::INT, T_INT, string_type->add_offset(offset_offset));
+  // Get length of string 1
+  Node* str1_len  = load_String_length(no_ctrl, str1);
+
+  Node* str2_value   = load_String_value(no_ctrl, str2);
+  Node* str2_offset  = load_String_offset(no_ctrl, str2);
   Node* str2_start   = array_element_address(str2_value, str2_offset, T_CHAR);
 
+  Node* str2_len = NULL;
   Node* result = NULL;
+
   switch (opcode) {
   case Op_StrIndexOf:
+    // Get length of string 2
+    str2_len = load_String_length(no_ctrl, str2);
+
     result = new (C, 6) StrIndexOfNode(control(), memory(TypeAryPtr::CHARS),
-                                       str1_start, cnt1, str2_start, cnt2);
+                                 str1_start, str1_len, str2_start, str2_len);
     break;
   case Op_StrComp:
+    // Get length of string 2
+    str2_len = load_String_length(no_ctrl, str2);
+
     result = new (C, 6) StrCompNode(control(), memory(TypeAryPtr::CHARS),
-                                    str1_start, cnt1, str2_start, cnt2);
+                                 str1_start, str1_len, str2_start, str2_len);
     break;
   case Op_StrEquals:
     result = new (C, 5) StrEqualsNode(control(), memory(TypeAryPtr::CHARS),
-                                      str1_start, str2_start, cnt1);
+                               str1_start, str2_start, str1_len);
     break;
   default:
     ShouldNotReachHere();
@@ -898,15 +896,42 @@
   return _gvn.transform(result);
 }
 
+// Helper method for String intrinsic functions. This version is called
+// with str1 and str2 pointing to char[] nodes, with cnt1 and cnt2 pointing
+// to Int nodes containing the lenghts of str1 and str2.
+//
+Node* LibraryCallKit::make_string_method_node(int opcode, Node* str1_start, Node* cnt1, Node* str2_start, Node* cnt2) {
+
+  Node* result = NULL;
+  switch (opcode) {
+  case Op_StrIndexOf:
+    result = new (C, 6) StrIndexOfNode(control(), memory(TypeAryPtr::CHARS),
+                                 str1_start, cnt1, str2_start, cnt2);
+    break;
+  case Op_StrComp:
+    result = new (C, 6) StrCompNode(control(), memory(TypeAryPtr::CHARS),
+                                 str1_start, cnt1, str2_start, cnt2);
+    break;
+  case Op_StrEquals:
+    result = new (C, 5) StrEqualsNode(control(), memory(TypeAryPtr::CHARS),
+                                 str1_start, str2_start, cnt1);
+    break;
+  default:
+    ShouldNotReachHere();
+    return NULL;
+  }
+
+  // All these intrinsics have checks.
+  C->set_has_split_ifs(true); // Has chance for split-if optimization
+
+  return _gvn.transform(result);
+}
+
 //------------------------------inline_string_compareTo------------------------
 bool LibraryCallKit::inline_string_compareTo() {
 
   if (!Matcher::has_match_rule(Op_StrComp)) return false;
 
-  const int value_offset = java_lang_String::value_offset_in_bytes();
-  const int count_offset = java_lang_String::count_offset_in_bytes();
-  const int offset_offset = java_lang_String::offset_offset_in_bytes();
-
   _sp += 2;
   Node *argument = pop();  // pop non-receiver first:  it was pushed second
   Node *receiver = pop();
@@ -923,18 +948,7 @@
     return true;
   }
 
-  ciInstanceKlass* klass = env()->String_klass();
-  const TypeOopPtr* string_type = TypeOopPtr::make_from_klass(klass);
-  Node* no_ctrl = NULL;
-
-  // Get counts for string and argument
-  Node* receiver_cnta = basic_plus_adr(receiver, receiver, count_offset);
-  Node* receiver_cnt  = make_load(no_ctrl, receiver_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset));
-
-  Node* argument_cnta = basic_plus_adr(argument, argument, count_offset);
-  Node* argument_cnt  = make_load(no_ctrl, argument_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset));
-
-  Node* compare = make_string_method_node(Op_StrComp, receiver, receiver_cnt, argument, argument_cnt);
+  Node* compare = make_string_method_node(Op_StrComp, receiver, argument);
   push(compare);
   return true;
 }
@@ -944,10 +958,6 @@
 
   if (!Matcher::has_match_rule(Op_StrEquals)) return false;
 
-  const int value_offset = java_lang_String::value_offset_in_bytes();
-  const int count_offset = java_lang_String::count_offset_in_bytes();
-  const int offset_offset = java_lang_String::offset_offset_in_bytes();
-
   int nargs = 2;
   _sp += nargs;
   Node* argument = pop();  // pop non-receiver first:  it was pushed second
@@ -1001,24 +1011,31 @@
     }
   }
 
-  const TypeOopPtr* string_type = TypeOopPtr::make_from_klass(klass);
-
-  Node* no_ctrl = NULL;
-  Node* receiver_cnt;
-  Node* argument_cnt;
-
   if (!stopped()) {
+    const TypeOopPtr* string_type = TypeOopPtr::make_from_klass(klass);
+
     // Properly cast the argument to String
     argument = _gvn.transform(new (C, 2) CheckCastPPNode(control(), argument, string_type));
     // This path is taken only when argument's type is String:NotNull.
     argument = cast_not_null(argument, false);
 
-    // Get counts for string and argument
-    Node* receiver_cnta = basic_plus_adr(receiver, receiver, count_offset);
-    receiver_cnt  = make_load(no_ctrl, receiver_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset));
-
-    Node* argument_cnta = basic_plus_adr(argument, argument, count_offset);
-    argument_cnt  = make_load(no_ctrl, argument_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset));
+    Node* no_ctrl = NULL;
+
+    // Get start addr of receiver
+    Node* receiver_val    = load_String_value(no_ctrl, receiver);
+    Node* receiver_offset = load_String_offset(no_ctrl, receiver);
+    Node* receiver_start = array_element_address(receiver_val, receiver_offset, T_CHAR);
+
+    // Get length of receiver
+    Node* receiver_cnt  = load_String_length(no_ctrl, receiver);
+
+    // Get start addr of argument
+    Node* argument_val   = load_String_value(no_ctrl, argument);
+    Node* argument_offset = load_String_offset(no_ctrl, argument);
+    Node* argument_start = array_element_address(argument_val, argument_offset, T_CHAR);
+
+    // Get length of argument
+    Node* argument_cnt  = load_String_length(no_ctrl, argument);
 
     // Check for receiver count != argument count
     Node* cmp = _gvn.transform( new(C, 3) CmpINode(receiver_cnt, argument_cnt) );
@@ -1028,14 +1045,14 @@
       phi->init_req(4, intcon(0));
       region->init_req(4, if_ne);
     }
-  }
-
-  // Check for count == 0 is done by mach node StrEquals.
-
-  if (!stopped()) {
-    Node* equals = make_string_method_node(Op_StrEquals, receiver, receiver_cnt, argument, argument_cnt);
-    phi->init_req(1, equals);
-    region->init_req(1, control());
+
+    // Check for count == 0 is done by assembler code for StrEquals.
+
+    if (!stopped()) {
+      Node* equals = make_string_method_node(Op_StrEquals, receiver_start, receiver_cnt, argument_start, argument_cnt);
+      phi->init_req(1, equals);
+      region->init_req(1, control());
+    }
   }
 
   // post merge
@@ -1133,20 +1150,9 @@
 
   const int nargs = 2; // number of arguments to push back for uncommon trap in predicate
 
-  const int value_offset  = java_lang_String::value_offset_in_bytes();
-  const int count_offset  = java_lang_String::count_offset_in_bytes();
-  const int offset_offset = java_lang_String::offset_offset_in_bytes();
-
-  ciInstanceKlass* klass = env()->String_klass();
-  const TypeOopPtr* string_type = TypeOopPtr::make_from_klass(klass);
-  const TypeAryPtr*  source_type = TypeAryPtr::make(TypePtr::NotNull, TypeAry::make(TypeInt::CHAR,TypeInt::POS), ciTypeArrayKlass::make(T_CHAR), true, 0);
-
-  Node* sourceOffseta = basic_plus_adr(string_object, string_object, offset_offset);
-  Node* sourceOffset  = make_load(no_ctrl, sourceOffseta, TypeInt::INT, T_INT, string_type->add_offset(offset_offset));
-  Node* sourceCounta  = basic_plus_adr(string_object, string_object, count_offset);
-  Node* sourceCount   = make_load(no_ctrl, sourceCounta, TypeInt::INT, T_INT, string_type->add_offset(count_offset));
-  Node* sourcea       = basic_plus_adr(string_object, string_object, value_offset);
-  Node* source        = make_load(no_ctrl, sourcea, source_type, T_OBJECT, string_type->add_offset(value_offset));
+  Node* source        = load_String_value(no_ctrl, string_object);
+  Node* sourceOffset  = load_String_offset(no_ctrl, string_object);
+  Node* sourceCount   = load_String_length(no_ctrl, string_object);
 
   Node* target = _gvn.transform( makecon(TypeOopPtr::make_from_constant(target_array, true)) );
   jint target_length = target_array->length();
@@ -1214,10 +1220,6 @@
 //------------------------------inline_string_indexOf------------------------
 bool LibraryCallKit::inline_string_indexOf() {
 
-  const int value_offset  = java_lang_String::value_offset_in_bytes();
-  const int count_offset  = java_lang_String::count_offset_in_bytes();
-  const int offset_offset = java_lang_String::offset_offset_in_bytes();
-
   _sp += 2;
   Node *argument = pop();  // pop non-receiver first:  it was pushed second
   Node *receiver = pop();
@@ -1251,12 +1253,21 @@
     Node*       result_phi = new (C, 4) PhiNode(result_rgn, TypeInt::INT);
     Node* no_ctrl  = NULL;
 
-    // Get counts for string and substr
-    Node* source_cnta = basic_plus_adr(receiver, receiver, count_offset);
-    Node* source_cnt  = make_load(no_ctrl, source_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset));
-
-    Node* substr_cnta = basic_plus_adr(argument, argument, count_offset);
-    Node* substr_cnt  = make_load(no_ctrl, substr_cnta, TypeInt::INT, T_INT, string_type->add_offset(count_offset));
+    // Get start addr of source string
+    Node* source = load_String_value(no_ctrl, receiver);
+    Node* source_offset = load_String_offset(no_ctrl, receiver);
+    Node* source_start = array_element_address(source, source_offset, T_CHAR);
+
+    // Get length of source string
+    Node* source_cnt  = load_String_length(no_ctrl, receiver);
+
+    // Get start addr of substring
+    Node* substr = load_String_value(no_ctrl, argument);
+    Node* substr_offset = load_String_offset(no_ctrl, argument);
+    Node* substr_start = array_element_address(substr, substr_offset, T_CHAR);
+
+    // Get length of source string
+    Node* substr_cnt  = load_String_length(no_ctrl, argument);
 
     // Check for substr count > string count
     Node* cmp = _gvn.transform( new(C, 3) CmpINode(substr_cnt, source_cnt) );
@@ -1279,7 +1290,7 @@
     }
 
     if (!stopped()) {
-      result = make_string_method_node(Op_StrIndexOf, receiver, source_cnt, argument, substr_cnt);
+      result = make_string_method_node(Op_StrIndexOf, source_start, source_cnt, substr_start, substr_cnt);
       result_phi->init_req(1, result);
       result_rgn->init_req(1, control());
     }
@@ -1304,11 +1315,19 @@
     ciInstance* str = str_const->as_instance();
     assert(str != NULL, "must be instance");
 
-    ciObject* v = str->field_value_by_offset(value_offset).as_object();
-    int       o = str->field_value_by_offset(offset_offset).as_int();
-    int       c = str->field_value_by_offset(count_offset).as_int();
+    ciObject* v = str->field_value_by_offset(java_lang_String::value_offset_in_bytes()).as_object();
     ciTypeArray* pat = v->as_type_array(); // pattern (argument) character array
 
+    int o;
+    int c;
+    if (java_lang_String::has_offset_field()) {
+      o = str->field_value_by_offset(java_lang_String::offset_offset_in_bytes()).as_int();
+      c = str->field_value_by_offset(java_lang_String::count_offset_in_bytes()).as_int();
+    } else {
+      o = 0;
+      c = pat->length();
+    }
+
     // constant strings have no offset and count == length which
     // simplifies the resulting code somewhat so lets optimize for that.
     if (o != 0 || c != pat->length()) {
@@ -3514,8 +3533,10 @@
     }
 
     // Bail out if length is negative.
-    // ...Not needed, since the new_array will throw the right exception.
-    //generate_negative_guard(length, bailout, &length);
+    // Without this the new_array would throw
+    // NegativeArraySizeException but IllegalArgumentException is what
+    // should be thrown
+    generate_negative_guard(length, bailout, &length);
 
     if (bailout->req() > 1) {
       PreserveJVMState pjvms(this);
@@ -3539,7 +3560,9 @@
       // Extreme case:  Arrays.copyOf((Integer[])x, 10, String[].class).
       // This will fail a store-check if x contains any non-nulls.
       bool disjoint_bases = true;
-      bool length_never_negative = true;
+      // if start > orig_length then the length of the copy may be
+      // negative.
+      bool length_never_negative = !is_copyOfRange;
       generate_arraycopy(TypeAryPtr::OOPS, T_OBJECT,
                          original, start, newcopy, intcon(0), moved,
                          disjoint_bases, length_never_negative);
--- a/src/share/vm/opto/memnode.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/opto/memnode.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -717,6 +717,22 @@
         adr = adr->in(1);
         continue;
 
+      case Op_EncodeP:
+        // EncodeP node's control edge could be set by this method
+        // when EncodeP node depends on CastPP node.
+        //
+        // Use its control edge for memory op because EncodeP may go away
+        // later when it is folded with following or preceding DecodeN node.
+        if (adr->in(0) == NULL) {
+          // Keep looking for cast nodes.
+          adr = adr->in(1);
+          continue;
+        }
+        ccp->hash_delete(n);
+        n->set_req(MemNode::Control, adr->in(0));
+        ccp->hash_insert(n);
+        return n;
+
       case Op_CastPP:
         // If the CastPP is useless, just peek on through it.
         if( ccp->type(adr) == ccp->type(adr->in(1)) ) {
--- a/src/share/vm/opto/runtime.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/opto/runtime.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -896,7 +896,8 @@
       methodOop method = ((nmethod*)n)->method();
       tty->print_cr("# Method where it happened %s.%s ", Klass::cast(method->method_holder())->name()->as_C_string(), method->name()->as_C_string());
       tty->print_cr("#");
-      if (ShowMessageBoxOnError && UpdateHotSpotCompilerFileOnError) {
+      if (ShowMessageBoxOnError && UpdateHotSpotCompilerFileOnError &&
+          CompilerOracle::has_command_file()) {
         const char* title    = "HotSpot Runtime Error";
         const char* question = "Do you want to exclude compilation of this method in future runs?";
         if (os::message_box(title, question)) {
--- a/src/share/vm/opto/stringopts.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/opto/stringopts.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, 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
@@ -112,6 +112,7 @@
     _arguments->ins_req(0, value);
     _mode.insert_before(0, mode);
   }
+
   void push_string(Node* value) {
     push(value, StringMode);
   }
@@ -125,9 +126,56 @@
     push(value, CharMode);
   }
 
+  static bool is_SB_toString(Node* call) {
+    if (call->is_CallStaticJava()) {
+      CallStaticJavaNode* csj = call->as_CallStaticJava();
+      ciMethod* m = csj->method();
+      if (m != NULL &&
+          (m->intrinsic_id() == vmIntrinsics::_StringBuilder_toString ||
+           m->intrinsic_id() == vmIntrinsics::_StringBuffer_toString)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  static Node* skip_string_null_check(Node* value) {
+    // Look for a diamond shaped Null check of toString() result
+    // (could be code from String.valueOf()):
+    // (Proj == NULL) ? "null":"CastPP(Proj)#NotNULL
+    if (value->is_Phi()) {
+      int true_path = value->as_Phi()->is_diamond_phi();
+      if (true_path != 0) {
+        // phi->region->if_proj->ifnode->bool
+        BoolNode* b = value->in(0)->in(1)->in(0)->in(1)->as_Bool();
+        Node* cmp = b->in(1);
+        Node* v1 = cmp->in(1);
+        Node* v2 = cmp->in(2);
+        // Null check of the return of toString which can simply be skipped.
+        if (b->_test._test == BoolTest::ne &&
+            v2->bottom_type() == TypePtr::NULL_PTR &&
+            value->in(true_path)->Opcode() == Op_CastPP &&
+            value->in(true_path)->in(1) == v1 &&
+            v1->is_Proj() && is_SB_toString(v1->in(0))) {
+          return v1;
+        }
+      }
+    }
+    return value;
+  }
+
   Node* argument(int i) {
     return _arguments->in(i);
   }
+  Node* argument_uncast(int i) {
+    Node* arg = argument(i);
+    int amode = mode(i);
+    if (amode == StringConcat::StringMode ||
+        amode == StringConcat::StringNullCheckMode) {
+      arg = skip_string_null_check(arg);
+    }
+    return arg;
+  }
   void set_argument(int i, Node* value) {
     _arguments->set_req(i, value);
   }
@@ -206,9 +254,11 @@
 
 
 void StringConcat::eliminate_unneeded_control() {
-  eliminate_initialize(begin()->initialization());
   for (uint i = 0; i < _control.size(); i++) {
     Node* n = _control.at(i);
+    if (n->is_Allocate()) {
+      eliminate_initialize(n->as_Allocate()->initialization());
+    }
     if (n->is_Call()) {
       if (n != _end) {
         eliminate_call(n->as_Call());
@@ -239,14 +289,15 @@
   assert(result->_control.contains(other->_end), "what?");
   assert(result->_control.contains(_begin), "what?");
   for (int x = 0; x < num_arguments(); x++) {
-    if (argument(x) == arg) {
+    Node* argx = argument_uncast(x);
+    if (argx == arg) {
       // replace the toString result with the all the arguments that
       // made up the other StringConcat
       for (int y = 0; y < other->num_arguments(); y++) {
         result->append(other->argument(y), other->mode(y));
       }
     } else {
-      result->append(argument(x), mode(x));
+      result->append(argx, mode(x));
     }
   }
   result->set_allocation(other->_begin);
@@ -327,14 +378,9 @@
 
   while (worklist.size() > 0) {
     Node* ctrl = worklist.pop();
-    if (ctrl->is_CallStaticJava()) {
+    if (StringConcat::is_SB_toString(ctrl)) {
       CallStaticJavaNode* csj = ctrl->as_CallStaticJava();
-      ciMethod* m = csj->method();
-      if (m != NULL &&
-          (m->intrinsic_id() == vmIntrinsics::_StringBuffer_toString ||
-           m->intrinsic_id() == vmIntrinsics::_StringBuilder_toString)) {
-        string_calls.push(csj);
-      }
+      string_calls.push(csj);
     }
     if (ctrl->in(0) != NULL && !_visited.test_set(ctrl->in(0)->_idx)) {
       worklist.push(ctrl->in(0));
@@ -528,16 +574,6 @@
   }
 
   // Collect the types needed to talk about the various slices of memory
-  const TypeInstPtr* string_type = TypeInstPtr::make(TypePtr::NotNull, C->env()->String_klass(),
-                                                     false, NULL, 0);
-
-  const TypePtr* value_field_type = string_type->add_offset(java_lang_String::value_offset_in_bytes());
-  const TypePtr* offset_field_type = string_type->add_offset(java_lang_String::offset_offset_in_bytes());
-  const TypePtr* count_field_type = string_type->add_offset(java_lang_String::count_offset_in_bytes());
-
-  value_field_idx = C->get_alias_index(value_field_type);
-  count_field_idx = C->get_alias_index(count_field_type);
-  offset_field_idx = C->get_alias_index(offset_field_type);
   char_adr_idx = C->get_alias_index(TypeAryPtr::CHARS);
 
   // For each locally allocated StringBuffer see if the usages can be
@@ -560,44 +596,40 @@
   for (int c = 0; c < concats.length(); c++) {
     StringConcat* sc = concats.at(c);
     for (int i = 0; i < sc->num_arguments(); i++) {
-      Node* arg = sc->argument(i);
-      if (arg->is_Proj() && arg->in(0)->is_CallStaticJava()) {
+      Node* arg = sc->argument_uncast(i);
+      if (arg->is_Proj() && StringConcat::is_SB_toString(arg->in(0))) {
         CallStaticJavaNode* csj = arg->in(0)->as_CallStaticJava();
-        if (csj->method() != NULL &&
-            (csj->method()->intrinsic_id() == vmIntrinsics::_StringBuilder_toString ||
-             csj->method()->intrinsic_id() == vmIntrinsics::_StringBuffer_toString)) {
-          for (int o = 0; o < concats.length(); o++) {
-            if (c == o) continue;
-            StringConcat* other = concats.at(o);
-            if (other->end() == csj) {
+        for (int o = 0; o < concats.length(); o++) {
+          if (c == o) continue;
+          StringConcat* other = concats.at(o);
+          if (other->end() == csj) {
+#ifndef PRODUCT
+            if (PrintOptimizeStringConcat) {
+              tty->print_cr("considering stacked concats");
+            }
+#endif
+
+            StringConcat* merged = sc->merge(other, arg);
+            if (merged->validate_control_flow()) {
 #ifndef PRODUCT
               if (PrintOptimizeStringConcat) {
-                tty->print_cr("considering stacked concats");
+                tty->print_cr("stacking would succeed");
               }
 #endif
-
-              StringConcat* merged = sc->merge(other, arg);
-              if (merged->validate_control_flow()) {
+              if (c < o) {
+                concats.remove_at(o);
+                concats.at_put(c, merged);
+              } else {
+                concats.remove_at(c);
+                concats.at_put(o, merged);
+              }
+              goto restart;
+            } else {
 #ifndef PRODUCT
-                if (PrintOptimizeStringConcat) {
-                  tty->print_cr("stacking would succeed");
-                }
+              if (PrintOptimizeStringConcat) {
+                tty->print_cr("stacking would fail");
+              }
 #endif
-                if (c < o) {
-                  concats.remove_at(o);
-                  concats.at_put(c, merged);
-                } else {
-                  concats.remove_at(c);
-                  concats.at_put(o, merged);
-                }
-                goto restart;
-              } else {
-#ifndef PRODUCT
-                if (PrintOptimizeStringConcat) {
-                  tty->print_cr("stacking would fail");
-                }
-#endif
-              }
             }
           }
         }
@@ -1173,18 +1205,9 @@
 
 Node* PhaseStringOpts::copy_string(GraphKit& kit, Node* str, Node* char_array, Node* start) {
   Node* string = str;
-  Node* offset = kit.make_load(kit.control(),
-                               kit.basic_plus_adr(string, string, java_lang_String::offset_offset_in_bytes()),
-                               TypeInt::INT, T_INT, offset_field_idx);
-  Node* count = kit.make_load(kit.control(),
-                              kit.basic_plus_adr(string, string, java_lang_String::count_offset_in_bytes()),
-                              TypeInt::INT, T_INT, count_field_idx);
-  const TypeAryPtr*  value_type = TypeAryPtr::make(TypePtr::NotNull,
-                                                   TypeAry::make(TypeInt::CHAR,TypeInt::POS),
-                                                   ciTypeArrayKlass::make(T_CHAR), true, 0);
-  Node* value = kit.make_load(kit.control(),
-                              kit.basic_plus_adr(string, string, java_lang_String::value_offset_in_bytes()),
-                              value_type, T_OBJECT, value_field_idx);
+  Node* offset = kit.load_String_offset(kit.control(), string);
+  Node* count  = kit.load_String_length(kit.control(), string);
+  Node* value  = kit.load_String_value (kit.control(), string);
 
   // copy the contents
   if (offset->is_Con() && count->is_Con() && value->is_Con() && count->get_int() < unroll_string_copy_length) {
@@ -1341,10 +1364,9 @@
           arg = phi;
           sc->set_argument(argi, arg);
         }
-        //         Node* offset = kit.make_load(NULL, kit.basic_plus_adr(arg, arg, offset_offset),
-        //                                      TypeInt::INT, T_INT, offset_field_idx);
-        Node* count = kit.make_load(kit.control(), kit.basic_plus_adr(arg, arg, java_lang_String::count_offset_in_bytes()),
-                                    TypeInt::INT, T_INT, count_field_idx);
+
+        Node* count = kit.load_String_length(kit.control(), arg);
+
         length = __ AddI(length, count);
         string_sizes->init_req(argi, NULL);
         break;
@@ -1435,12 +1457,11 @@
   }
 
   // Intialize the string
-  kit.store_to_memory(kit.control(), kit.basic_plus_adr(result, java_lang_String::offset_offset_in_bytes()),
-                      __ intcon(0), T_INT, offset_field_idx);
-  kit.store_to_memory(kit.control(), kit.basic_plus_adr(result, java_lang_String::count_offset_in_bytes()),
-                      length, T_INT, count_field_idx);
-  kit.store_to_memory(kit.control(), kit.basic_plus_adr(result, java_lang_String::value_offset_in_bytes()),
-                      char_array, T_OBJECT, value_field_idx);
+  if (java_lang_String::has_offset_field()) {
+    kit.store_String_offset(kit.control(), result, __ intcon(0));
+    kit.store_String_length(kit.control(), result, length);
+  }
+  kit.store_String_value(kit.control(), result, char_array);
 
   // hook up the outgoing control and result
   kit.replace_call(sc->end(), result);
--- a/src/share/vm/opto/stringopts.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/opto/stringopts.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, 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
@@ -41,9 +41,6 @@
 
   // Memory slices needed for code gen
   int char_adr_idx;
-  int value_field_idx;
-  int count_field_idx;
-  int offset_field_idx;
 
   // Integer.sizeTable - used for int to String conversion
   ciField* size_table_field;
--- a/src/share/vm/opto/type.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/opto/type.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -2472,18 +2472,26 @@
 //------------------------------make_from_constant-----------------------------
 // Make a java pointer from an oop constant
 const TypeOopPtr* TypeOopPtr::make_from_constant(ciObject* o, bool require_constant) {
-  if (o->is_method_data() || o->is_method() || o->is_cpcache()) {
+  if (o->is_method_data() || o->is_method()) {
     // Treat much like a typeArray of bytes, like below, but fake the type...
-    const Type* etype = (Type*)get_const_basic_type(T_BYTE);
+    const BasicType bt = T_BYTE;
+    const Type* etype = get_const_basic_type(bt);
     const TypeAry* arr0 = TypeAry::make(etype, TypeInt::POS);
-    ciKlass *klass = ciTypeArrayKlass::make((BasicType) T_BYTE);
-    assert(o->can_be_constant(), "method data oops should be tenured");
-    const TypeAryPtr* arr = TypeAryPtr::make(TypePtr::Constant, o, arr0, klass, true, 0);
-    return arr;
+    ciKlass* klass = ciArrayKlass::make(ciType::make(bt));
+    assert(o->can_be_constant(), "should be tenured");
+    return TypeAryPtr::make(TypePtr::Constant, o, arr0, klass, true, 0);
+  } else if (o->is_cpcache()) {
+    // Treat much like a objArray, like below, but fake the type...
+    const BasicType bt = T_OBJECT;
+    const Type* etype = get_const_basic_type(bt);
+    const TypeAry* arr0 = TypeAry::make(etype, TypeInt::POS);
+    ciKlass* klass = ciArrayKlass::make(ciType::make(bt));
+    assert(o->can_be_constant(), "should be tenured");
+    return TypeAryPtr::make(TypePtr::Constant, o, arr0, klass, true, 0);
   } else {
     assert(o->is_java_object(), "must be java language object");
     assert(!o->is_null_object(), "null object not yet handled here.");
-    ciKlass *klass = o->klass();
+    ciKlass* klass = o->klass();
     if (klass->is_instance_klass()) {
       // Element is an instance
       if (require_constant) {
@@ -2494,8 +2502,7 @@
       return TypeInstPtr::make(o);
     } else if (klass->is_obj_array_klass()) {
       // Element is an object array. Recursively call ourself.
-      const Type *etype =
-        TypeOopPtr::make_from_klass_raw(klass->as_obj_array_klass()->element_klass());
+      const Type *etype = make_from_klass_raw(klass->as_obj_array_klass()->element_klass());
       const TypeAry* arr0 = TypeAry::make(etype, TypeInt::make(o->as_array()->length()));
       // We used to pass NotNull in here, asserting that the sub-arrays
       // are all not-null.  This is not true in generally, as code can
@@ -2505,12 +2512,10 @@
       } else if (!o->should_be_constant()) {
         return TypeAryPtr::make(TypePtr::NotNull, arr0, klass, true, 0);
       }
-      const TypeAryPtr* arr = TypeAryPtr::make(TypePtr::Constant, o, arr0, klass, true, 0);
-      return arr;
+      return TypeAryPtr::make(TypePtr::Constant, o, arr0, klass, true, 0);
     } else if (klass->is_type_array_klass()) {
       // Element is an typeArray
-      const Type* etype =
-        (Type*)get_const_basic_type(klass->as_type_array_klass()->element_type());
+      const Type* etype = get_const_basic_type(klass->as_type_array_klass()->element_type());
       const TypeAry* arr0 = TypeAry::make(etype, TypeInt::make(o->as_array()->length()));
       // We used to pass NotNull in here, asserting that the array pointer
       // is not-null. That was not true in general.
@@ -2519,12 +2524,11 @@
       } else if (!o->should_be_constant()) {
         return TypeAryPtr::make(TypePtr::NotNull, arr0, klass, true, 0);
       }
-      const TypeAryPtr* arr = TypeAryPtr::make(TypePtr::Constant, o, arr0, klass, true, 0);
-      return arr;
+      return TypeAryPtr::make(TypePtr::Constant, o, arr0, klass, true, 0);
     }
   }
 
-  ShouldNotReachHere();
+  fatal("unhandled object type");
   return NULL;
 }
 
--- a/src/share/vm/prims/jni.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/prims/jni.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/altHashing.hpp"
 #include "classfile/classLoader.hpp"
 #include "classfile/javaClasses.hpp"
 #include "classfile/symbolTable.hpp"
@@ -378,6 +379,7 @@
   jclass cls = NULL;
   DT_RETURN_MARK(DefineClass, jclass, (const jclass&)cls);
 
+  TempNewSymbol class_name = NULL;
   // Since exceptions can be thrown, class initialization can take place
   // if name is NULL no check for class name in .class stream has to be made.
   if (name != NULL) {
@@ -387,9 +389,8 @@
       // into the constant pool.
       THROW_MSG_0(vmSymbols::java_lang_NoClassDefFoundError(), name);
     }
+    class_name = SymbolTable::new_symbol(name, CHECK_NULL);
   }
-  TempNewSymbol class_name = SymbolTable::new_symbol(name, THREAD);
-
   ResourceMark rm(THREAD);
   ClassFileStream st((u1*) buf, bufLen, NULL);
   Handle class_loader (THREAD, JNIHandles::resolve(loaderRef));
@@ -5053,6 +5054,7 @@
     run_unit_test(arrayOopDesc::test_max_array_length());
     run_unit_test(CollectedHeap::test_is_in());
     run_unit_test(QuickSort::test_quick_sort());
+    run_unit_test(AltHashing::test_alt_hash());
     tty->print_cr("All internal VM tests passed");
   }
 }
--- a/src/share/vm/runtime/arguments.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/runtime/arguments.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -2955,7 +2955,10 @@
   const char* tail;
 
   // If flag "-XX:Flags=flags-file" is used it will be the first option to be processed.
+  const char* hotspotrc = ".hotspotrc";
   bool settings_file_specified = false;
+  bool needs_hotspotrc_warning = false;
+
   const char* flags_file;
   int index;
   for (index = 0; index < args->nOptions; index++) {
@@ -2999,13 +3002,18 @@
     if (!process_settings_file(flags_file, true, args->ignoreUnrecognized)) {
       return JNI_EINVAL;
     }
-  }
-
-  // Parse default .hotspotrc settings file
-  if (!settings_file_specified) {
+  } else {
+#ifdef ASSERT
+    // Parse default .hotspotrc settings file
     if (!process_settings_file(".hotspotrc", false, args->ignoreUnrecognized)) {
       return JNI_EINVAL;
     }
+#else
+    struct stat buf;
+    if (os::stat(hotspotrc, &buf) == 0) {
+      needs_hotspotrc_warning = true;
+    }
+#endif
   }
 
   if (PrintVMOptions) {
@@ -3023,7 +3031,15 @@
     return result;
   }
 
-#ifdef JAVASE_EMBEDDED
+  // Delay warning until here so that we've had a chance to process
+  // the -XX:-PrintWarnings flag
+  if (needs_hotspotrc_warning) {
+    warning("%s file is present but has been ignored.  "
+            "Run with -XX:Flags=%s to load the file.",
+            hotspotrc, hotspotrc);
+  }
+
+#if (defined JAVASE_EMBEDDED || defined ARM)
   UNSUPPORTED_OPTION(UseG1GC, "G1 GC");
 #endif
 
--- a/src/share/vm/runtime/globals.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/runtime/globals.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -2662,6 +2662,9 @@
   product(bool, UseHeavyMonitors, false,                                    \
           "use heavyweight instead of lightweight Java monitors")           \
                                                                             \
+  product(bool, PrintStringTableStatistics, false,                          \
+          "print statistics about the StringTable and SymbolTable")         \
+                                                                            \
   notproduct(bool, PrintSymbolTableSizeHistogram, false,                    \
           "print histogram of the symbol table")                            \
                                                                             \
--- a/src/share/vm/runtime/init.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/runtime/init.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
 #include "code/icBuffer.hpp"
 #include "gc_interface/collectedHeap.hpp"
 #include "interpreter/bytecodes.hpp"
@@ -157,6 +158,10 @@
       // Print the collected safepoint statistics.
       SafepointSynchronize::print_stat_on_exit();
     }
+    if (PrintStringTableStatistics) {
+      SymbolTable::dump(tty);
+      StringTable::dump(tty);
+    }
     ostream_exit();
   }
 }
--- a/src/share/vm/runtime/os.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/runtime/os.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -493,6 +493,7 @@
   // Print out system information; they are called by fatal error handler.
   // Output format may be different on different platforms.
   static void print_os_info(outputStream* st);
+  static void print_os_info_brief(outputStream* st);
   static void print_cpu_info(outputStream* st);
   static void pd_print_cpu_info(outputStream* st);
   static void print_memory_info(outputStream* st);
@@ -686,14 +687,17 @@
   // Platform dependent stuff
 #ifdef TARGET_OS_FAMILY_linux
 # include "os_linux.hpp"
+# include "os_posix.hpp"
 #endif
 #ifdef TARGET_OS_FAMILY_solaris
 # include "os_solaris.hpp"
+# include "os_posix.hpp"
 #endif
 #ifdef TARGET_OS_FAMILY_windows
 # include "os_windows.hpp"
 #endif
 #ifdef TARGET_OS_FAMILY_bsd
+# include "os_posix.hpp"
 # include "os_bsd.hpp"
 #endif
 #ifdef TARGET_OS_ARCH_linux_x86
--- a/src/share/vm/runtime/safepoint.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/runtime/safepoint.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "code/codeCache.hpp"
 #include "code/icBuffer.hpp"
@@ -526,8 +527,20 @@
     CompilationPolicy::policy()->do_safepoint_work();
   }
 
-  TraceTime t4("sweeping nmethods", TraceSafepointCleanupTime);
-  NMethodSweeper::scan_stacks();
+  {
+    TraceTime t4("sweeping nmethods", TraceSafepointCleanupTime);
+    NMethodSweeper::scan_stacks();
+  }
+
+  if (SymbolTable::needs_rehashing()) {
+    TraceTime t5("rehashing symbol table", TraceSafepointCleanupTime);
+    SymbolTable::rehash_table();
+  }
+
+  if (StringTable::needs_rehashing()) {
+    TraceTime t6("rehashing string table", TraceSafepointCleanupTime);
+    StringTable::rehash_table();
+  }
 
   // rotate log files?
   if (UseGCLogFileRotation) {
--- a/src/share/vm/utilities/globalDefinitions_gcc.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/utilities/globalDefinitions_gcc.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -87,14 +87,7 @@
 #endif
 #ifdef __APPLE__
   #include <AvailabilityMacros.h>
-  #if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4)
-    // Mac OS X 10.4 defines EFL_AC and EFL_ID,
-    // which conflict with hotspot variable names.
-    //
-    // This has been fixed in Mac OS X 10.5.
-    #undef EFL_AC
-    #undef EFL_ID
-  #endif
+  #include <mach/mach.h>
 #endif
 #include <sys/time.h>
 #endif // LINUX || _ALLBSD_SOURCE
--- a/src/share/vm/utilities/globalDefinitions_visCPP.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/utilities/globalDefinitions_visCPP.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -220,9 +220,15 @@
 #define PRIu64       "I64u"
 #define PRIx64       "I64x"
 
+#ifdef _LP64
+#define PRIdPTR       "I64d"
+#define PRIuPTR       "I64u"
+#define PRIxPTR       "I64x"
+#else
 #define PRIdPTR       "d"
 #define PRIuPTR       "u"
 #define PRIxPTR       "x"
+#endif
 
 #define offset_of(klass,field) offsetof(klass,field)
 
--- a/src/share/vm/utilities/hashtable.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/utilities/hashtable.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -23,7 +23,10 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/altHashing.hpp"
+#include "classfile/javaClasses.hpp"
 #include "memory/allocation.inline.hpp"
+#include "memory/filemap.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/safepoint.hpp"
@@ -86,6 +89,97 @@
 }
 
 
+// Check to see if the hashtable is unbalanced.  The caller set a flag to
+// rehash at the next safepoint.  If this bucket is 60 times greater than the
+// expected average bucket length, it's an unbalanced hashtable.
+// This is somewhat an arbitrary heuristic but if one bucket gets to
+// rehash_count which is currently 100, there's probably something wrong.
+
+bool BasicHashtable::check_rehash_table(int count) {
+  assert(table_size() != 0, "underflow");
+  if (count > (((double)number_of_entries()/(double)table_size())*rehash_multiple)) {
+    // Set a flag for the next safepoint, which should be at some guaranteed
+    // safepoint interval.
+    return true;
+  }
+  return false;
+}
+
+template <class T> jint Hashtable<T>::_seed = 0;
+
+template <class T> unsigned int Hashtable<T>::new_hash(Symbol* sym) {
+  ResourceMark rm;
+  // Use alternate hashing algorithm on this symbol.
+  return AltHashing::murmur3_32(seed(), (const jbyte*)sym->as_C_string(), sym->utf8_length());
+}
+
+template <class T> unsigned int Hashtable<T>::new_hash(oop string) {
+  ResourceMark rm;
+  int length;
+  jchar* chars = java_lang_String::as_unicode_string(string, length);
+  // Use alternate hashing algorithm on the string
+  return AltHashing::murmur3_32(seed(), chars, length);
+}
+
+// Create a new table and using alternate hash code, populate the new table
+// with the existing elements.   This can be used to change the hash code
+// and could in the future change the size of the table.
+
+template <class T> void Hashtable<T>::move_to(Hashtable<T>* new_table) {
+
+  // Initialize the global seed for hashing.
+  _seed = AltHashing::compute_seed();
+  assert(seed() != 0, "shouldn't be zero");
+
+  int saved_entry_count = this->number_of_entries();
+
+  // Iterate through the table and create a new entry for the new table
+  for (int i = 0; i < new_table->table_size(); ++i) {
+    for (HashtableEntry<T>* p = bucket(i); p != NULL; ) {
+      HashtableEntry<T>* next = p->next();
+      T string = p->literal();
+      // Use alternate hashing algorithm on the symbol in the first table
+      unsigned int hashValue = new_hash(string);
+      // Get a new index relative to the new table (can also change size)
+      int index = new_table->hash_to_index(hashValue);
+      p->set_hash(hashValue);
+      // Keep the shared bit in the Hashtable entry to indicate that this entry
+      // can't be deleted.   The shared bit is the LSB in the _next field so
+      // walking the hashtable past these entries requires
+      // BasicHashtableEntry::make_ptr() call.
+      bool keep_shared = p->is_shared();
+      unlink_entry(p);
+      new_table->add_entry(index, p);
+      if (keep_shared) {
+        p->set_shared();
+      }
+      p = next;
+    }
+  }
+  // give the new table the free list as well
+  new_table->copy_freelist(this);
+  assert(new_table->number_of_entries() == saved_entry_count, "lost entry on dictionary copy?");
+
+  // Destroy memory used by the buckets in the hashtable.  The memory
+  // for the elements has been used in a new table and is not
+  // destroyed.  The memory reuse will benefit resizing the SystemDictionary
+  // to avoid a memory allocation spike at safepoint.
+  free_buckets();
+}
+
+void BasicHashtable::free_buckets() {
+  if (NULL != _buckets) {
+    // Don't delete the buckets in the shared space.  They aren't
+    // allocated by os::malloc
+    if (!UseSharedSpaces ||
+        !FileMapInfo::current_info()->is_in_shared_space(_buckets)) {
+       FREE_C_HEAP_ARRAY(HashtableBucket, _buckets);
+    }
+    _buckets = NULL;
+  }
+}
+
+
 // Reverse the order of elements in the hash buckets.
 
 void BasicHashtable::reverse() {
--- a/src/share/vm/utilities/hashtable.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/utilities/hashtable.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -159,8 +159,6 @@
   // Reverse the order of elements in each of the buckets.
   void reverse();
 
-  static unsigned int hash_symbol(const char* s, int len);
-
 private:
   // Instance variables
   int               _table_size;
@@ -179,6 +177,11 @@
   void verify_lookup_length(double load);
 #endif
 
+  enum {
+    rehash_count = 100,
+    rehash_multiple = 60
+  };
+
   void initialize(int table_size, int entry_size, int number_of_entries);
 
   // Accessor
@@ -193,6 +196,29 @@
   // Table entry management
   BasicHashtableEntry* new_entry(unsigned int hashValue);
 
+  // Check that the table is unbalanced
+  bool check_rehash_table(int count);
+
+  // Used when moving the entry to another table
+  // Clean up links, but do not add to free_list
+  void unlink_entry(BasicHashtableEntry* entry) {
+    entry->set_next(NULL);
+    --_number_of_entries;
+  }
+
+  // Move over freelist and free block for allocation
+  void copy_freelist(BasicHashtable* src) {
+    _free_list = src->_free_list;
+    src->_free_list = NULL;
+    _first_free_entry = src->_first_free_entry;
+    src->_first_free_entry = NULL;
+    _end_block = src->_end_block;
+    src->_end_block = NULL;
+  }
+
+  // Free the buckets in this hashtable
+  void free_buckets();
+
 public:
   int table_size() { return _table_size; }
   void set_entry(int index, BasicHashtableEntry* entry);
@@ -249,6 +275,17 @@
   HashtableEntry<T>** bucket_addr(int i) {
     return (HashtableEntry<T>**)BasicHashtable::bucket_addr(i);
   }
+
+  // Function to move these elements into the new table.
+  void move_to(Hashtable<T>* new_table);
+  static bool use_alternate_hashcode()  { return _seed != 0; }
+  static jint seed()                    { return _seed; }
+
+ private:
+  static jint _seed;
+
+  unsigned int new_hash(Symbol* s);
+  unsigned int new_hash(oop string);
 };
 
 
--- a/src/share/vm/utilities/hashtable.inline.hpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/utilities/hashtable.inline.hpp	Sun Aug 12 15:23:07 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -30,27 +30,6 @@
 
 // Inline function definitions for hashtable.hpp.
 
-
-// --------------------------------------------------------------------------
-// Hash function
-
-// We originally used hashpjw, but hash P(31) gives just as good results
-// and is slighly faster. We would like a hash function that looks at every
-// character, since package names have large common prefixes, and also because
-// hash_or_fail does error checking while iterating.
-
-// hash P(31) from Kernighan & Ritchie
-
-inline unsigned int BasicHashtable::hash_symbol(const char* s, int len) {
-  unsigned int h = 0;
-  while (len-- > 0) {
-    h = 31*h + (unsigned) *s;
-    s++;
-  }
-  return h;
-}
-
-
 // --------------------------------------------------------------------------
 
 // Initialize a table.
--- a/src/share/vm/utilities/vmError.cpp	Sat Aug 04 10:30:57 2012 -0700
+++ b/src/share/vm/utilities/vmError.cpp	Sun Aug 12 15:23:07 2012 -0700
@@ -684,6 +684,12 @@
        // extended (i.e., more detailed) version.
        Universe::print_on(st, true /* extended */);
        st->cr();
+
+       Universe::heap()->barrier_set()->print_on(st);
+       st->cr();
+
+       st->print_cr("Polling page: " INTPTR_FORMAT, os::get_polling_page());
+       st->cr();
      }
 
   STEP(195, "(printing code cache information)" )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/compiler/6732154/Test6732154.java	Sun Aug 12 15:23:07 2012 -0700
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2012, 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 6732154
+ * @summary REG: Printing an Image using image/gif doc flavor crashes the VM, Solsparc
+ *
+ * @run main/othervm -Xcomp -XX:CompileOnly="Test6732154::ascii85Encode" Test6732154
+ */
+public class Test6732154 {
+
+    // Exact copy of sun.print.PSPrinterJob.ascii85Encode([b)[b
+    private byte[] ascii85Encode(byte[] inArr) {
+        byte[]  outArr = new byte[((inArr.length+4) * 5 / 4) + 2];
+        long p1 = 85;
+        long p2 = p1*p1;
+        long p3 = p1*p2;
+        long p4 = p1*p3;
+        byte pling = '!';
+
+        int i = 0;
+        int olen = 0;
+        long val, rem;
+
+        while (i+3 < inArr.length) {
+            val = ((long)((inArr[i++]&0xff))<<24) +
+                  ((long)((inArr[i++]&0xff))<<16) +
+                  ((long)((inArr[i++]&0xff))<< 8) +
+                  ((long)(inArr[i++]&0xff));
+            if (val == 0) {
+                outArr[olen++] = 'z';
+            } else {
+                rem = val;
+                outArr[olen++] = (byte)(rem / p4 + pling); rem = rem % p4;
+                outArr[olen++] = (byte)(rem / p3 + pling); rem = rem % p3;
+                outArr[olen++] = (byte)(rem / p2 + pling); rem = rem % p2;
+                outArr[olen++] = (byte)(rem / p1 + pling); rem = rem % p1;
+                outArr[olen++] = (byte)(rem + pling);
+            }
+        }
+        // input not a multiple of 4 bytes, write partial output.
+        if (i < inArr.length) {
+            int n = inArr.length - i; // n bytes remain to be written
+
+            val = 0;
+            while (i < inArr.length) {
+                val = (val << 8) + (inArr[i++]&0xff);
+            }
+
+            int append = 4 - n;
+            while (append-- > 0) {
+                val = val << 8;
+            }
+            byte []c = new byte[5];
+            rem = val;
+            c[0] = (byte)(rem / p4 + pling); rem = rem % p4;
+            c[1] = (byte)(rem / p3 + pling); rem = rem % p3;
+            c[2] = (byte)(rem / p2 + pling); rem = rem % p2;
+            c[3] = (byte)(rem / p1 + pling); rem = rem % p1;
+            c[4] = (byte)(rem + pling);
+
+            for (int b = 0; b < n+1 ; b++) {
+                outArr[olen++] = c[b];
+            }
+        }
+
+        // write EOD marker.
+        outArr[olen++]='~'; outArr[olen++]='>';
+
+        /* The original intention was to insert a newline after every 78 bytes.
+         * This was mainly intended for legibility but I decided against this
+         * partially because of the (small) amount of extra space, and
+         * partially because for line breaks either would have to hardwire
+         * ascii 10 (newline) or calculate space in bytes to allocate for
+         * the platform's newline byte sequence. Also need to be careful
+         * about where its inserted:
+         * Ascii 85 decoder ignores white space except for one special case:
+         * you must ensure you do not split the EOD marker across lines.
+         */
+        byte[] retArr = new byte[olen];
+        System.arraycopy(outArr, 0, retArr, 0, olen);
+        return retArr;
+    }
+
+    public static void main(String[] args) {
+        new Test6732154().ascii85Encode(new byte[0]);
+        System.out.println("Test passed.");
+    }
+}
--- a/test/compiler/7070134/Stemmer.java	Sat Aug 04 10:30:57 2012 -0700
+++ b/test/compiler/7070134/Stemmer.java	Sun Aug 12 15:23:07 2012 -0700
@@ -13,7 +13,18 @@
        Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14,
        no. 3, pp 130-137,
 
-   See also http://www.tartarus.org/~martin/PorterStemmer
+   http://www.tartarus.org/~martin/PorterStemmer
+
+   The software is completely free for any purpose, unless notes at the head
+   of the program text indicates otherwise (which is rare). In any case,
+   the notes about licensing are never more restrictive than the BSD License.
+
+   In every case where the software is not written by me (Martin Porter),
+   this licensing arrangement has been endorsed by the contributor, and it is
+   therefore unnecessary to ask the contributor again to confirm it.
+
+   I have not asked any contributors (or their employers, if they have them)
+   for proofs that they have the right to distribute their software in this way.
 
    History:
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/compiler/7169782/Test7169782.java	Sun Aug 12 15:23:07 2012 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2012, 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 7169782
+ * @summary C2: SIGSEGV in LShiftLNode::Ideal(PhaseGVN*, bool)
+ *
+ * @run main/othervm -Xcomp -XX:CompileOnly="Test7169782::<clinit>" Test7169782
+ */
+
+public class Test7169782 {
+    static long var_8;
+
+    static {
+        var_8 /= (long)(1E100 + ("".startsWith("a", 0) ? 1 : 2));
+    }
+
+    public static void main(String[] args) {
+        System.out.println("Test passed.");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/compiler/7174363/Test7174363.java	Sun Aug 12 15:23:07 2012 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2012, 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 7174363
+ * @summary crash with Arrays.copyOfRange(original, from, to) when from > original.length
+ *
+ * @run main/othervm -XX:-BackgroundCompilation Test7174363
+ */
+
+import java.util.*;
+
+public class Test7174363 {
+
+  static Object[] m(Object[] original, int from, int to) {
+    return Arrays.copyOfRange(original, from, to, Object[].class);
+  }
+
+  static public void main(String[] args) {
+    Object[] orig = new Object[10];
+    for (int i = 0; i < 20000; i++) {
+      try {
+        m(orig, 15, 20);
+      } catch(ArrayIndexOutOfBoundsException excp) {}
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/compiler/7179138/Test7179138_1.java	Sun Aug 12 15:23:07 2012 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2012 Skip Balk.  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 7179138
+ * @summary Incorrect result with String concatenation optimization
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation Test7179138_1
+ *
+ * @author Skip Balk
+ */
+
+public class Test7179138_1 {
+    public static void main(String[] args) throws Exception {
+        System.out.println("Java Version: " + System.getProperty("java.vm.version"));
+        long[] durations = new long[60];
+        for (int i = 0; i < 100000; i++) {
+            // this empty for-loop is required to reproduce this bug
+            for (long duration : durations) {
+                // do nothing
+            }
+            {
+                String s = "test";
+                int len = s.length();
+
+                s = new StringBuilder(String.valueOf(s)).append(s).toString();
+                len = len + len;
+
+                s = new StringBuilder(String.valueOf(s)).append(s).toString();
+                len = len + len;
+
+                s = new StringBuilder(String.valueOf(s)).append(s).toString();
+                len = len + len;
+
+                if (s.length() != len) {
+                    System.out.println("Failed at iteration: " + i);
+                    System.out.println("Length mismatch: " + s.length() + " <> " + len);
+                    System.out.println("Expected: \"" + "test" + "test" + "test" + "test" + "test" + "test" + "test" + "test" + "\"");
+                    System.out.println("Actual:   \"" + s + "\"");
+                    System.exit(97);
+                }
+            }
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/compiler/7179138/Test7179138_2.java	Sun Aug 12 15:23:07 2012 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2012 Skip Balk.  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 7179138
+ * @summary Incorrect result with String concatenation optimization
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation Test7179138_2
+ *
+ * @author Skip Balk
+ */
+
+public class Test7179138_2 {
+    public static void main(String[] args) throws Exception {
+        System.out.println("Java Version: " + System.getProperty("java.vm.version"));
+        long[] durations = new long[60];
+        for (int i = 0; i < 100000; i++) {
+            // this empty for-loop is required to reproduce this bug
+            for (long duration : durations) {
+                // do nothing
+            }
+            {
+                String s = "test";
+                int len = s.length();
+
+                s = s + s;
+                len = len + len;
+
+                s = s + s;
+                len = len + len;
+
+                s = s + s;
+                len = len + len;
+
+                if (s.length() != len) {
+                    System.out.println("Failed at iteration: " + i);
+                    System.out.println("Length mismatch: " + s.length() + " <> " + len);
+                    System.out.println("Expected: \"" + "test" + "test" + "test" + "test" + "test" + "test" + "test" + "test" + "\"");
+                    System.out.println("Actual:   \"" + s + "\"");
+                    System.exit(0);
+                }
+            }
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/runtime/7110720/Test7110720.sh	Sun Aug 12 15:23:07 2012 -0700
@@ -0,0 +1,122 @@
+#
+#  Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+
+
+#
+# @test Test7110720.sh
+# @bug 7110720
+# @summary improve VM configuration file loading
+# @run shell Test7110720.sh
+#
+
+if [ "${TESTSRC}" = "" ]
+  then TESTSRC=.
+fi
+
+if [ "${TESTJAVA}" = "" ]
+then
+  PARENT=`dirname \`which java\``
+  TESTJAVA=`dirname ${PARENT}`
+  echo "TESTJAVA not set, selecting " ${TESTJAVA}
+  echo "If this is incorrect, try setting the variable manually."
+fi
+
+if [ "${TESTCLASSES}" = "" ]
+then
+  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
+  exit 1
+fi
+
+# Jtreg sets TESTVMOPTS which may include -d64 which is
+# required to test a 64-bit JVM on some platforms.
+# If another test harness still creates HOME/JDK64BIT,
+# we can recognise that.
+
+# set platform-dependent variables
+OS=`uname -s`
+case "$OS" in
+  SunOS | Linux )
+    FS="/"
+    RM=/bin/rm
+    CP=/bin/cp
+    MV=/bin/mv
+    ## for solaris, linux it's HOME
+    FILE_LOCATION=$HOME
+    if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" ]
+    then
+        TESTVMOPTS=`cat ${FILE_LOCATION}${FS}JDK64BIT`
+    fi
+    ;;
+  Windows_* )
+    FS="\\"
+    RM=rm
+    CP=cp
+    MV=mv
+    ;;
+  * )
+    echo "Unrecognized system!"
+    exit 1;
+    ;;
+esac
+
+
+JAVA=${TESTJAVA}${FS}bin${FS}java
+
+# Don't test debug builds, they do read the config files:
+${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "debug" >/dev/null
+if [ "$?" = "0" ]; then
+  echo Skipping test for debug build.
+  exit 0
+fi
+
+ok=yes
+
+$RM -f .hotspot_compiler .hotspotrc
+
+${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage in" >/dev/null
+if [ "$?" = "0" ]; then
+  echo "FAILED: base case failure"
+  exit 1
+fi
+
+
+echo "garbage in, garbage out" > .hotspot_compiler
+${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage in" >/dev/null
+if [ "$?" = "0" ]; then
+  echo "FAILED: .hotspot_compiler was read"
+  ok=no
+fi
+
+$MV .hotspot_compiler hs_comp.txt
+${JAVA} ${TESTVMOPTS} -XX:CompileCommandFile=hs_comp.txt -version 2>&1 | grep "garbage in" >/dev/null
+if [ "$?" = "1" ]; then
+  echo "FAILED: explicit compiler command file not read"
+  ok=no
+fi
+
+$RM -f .hotspot_compiler hs_comp.txt
+
+echo "garbage" > .hotspotrc
+${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage" >/dev/null
+if [ "$?" = "0" ]; then
+  echo "FAILED: .hotspotrc was read"
+  ok=no
+fi
+
+$MV .hotspotrc hs_flags.txt
+${JAVA} ${TESTVMOPTS} -XX:Flags=hs_flags.txt -version 2>&1 | grep "garbage" >/dev/null
+if [ "$?" = "1" ]; then
+  echo "FAILED: explicit flags file not read"
+  ok=no
+fi
+
+if [ "${ok}" = "no" ]; then 
+  echo "Some tests failed."
+  exit 1
+else 
+  echo "Passed"
+  exit 0
+fi
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/runtime/7158800/BadUtf8.java	Sun Aug 12 15:23:07 2012 -0700
@@ -0,0 +1,1254 @@
+/*
+ * Copyright (c) 2012, 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 7158800
+ * @summary Test that 1200 symbols that hash to the same value triggers
+ * the symbol table alternate hashing mechanism.  There isn't actually a
+ * way to verify this.
+ */
+//
+// Generate large number of strings that hash to the same value
+// to slow down symbol table lookup.
+
+import java.io.BufferedOutputStream;
+import java.io.FileOutputStream;
+
+public class BadUtf8 {
+static String[] strings = {
+    "EOcLKvbddZyPxYpb",
+    "DncLKvbdPxmAGrqj",
+    "DoCjjvbdpxoIHQdY",
+    "EPCkKvbdqYoHfqEY",
+    "DnbkKvbdezvYdiUX",
+    "DnbjjvbdeEoRbXCj",
+    "EObkKvbdbsCkUEKB",
+    "EOcLKvbdnUtyjiqf",
+    "DncLKvbdRWnDcMHc",
+    "DoCkKvbdrSUkOLAm",
+    "DncLKvbdfNFwGmJk",
+    "EPDLKvbdvAdYroFI",
+    "DoDLKvbdiGibyViu",
+    "DncLKvbdYqNEhmFR",
+    "DoCkKvbdEARhlzXX",
+    "DncLKvbdSZjHsCvA",
+    "DncKjvbdqTsgRqkU",
+    "DnbjjvbdqAiFAXHd",
+    "EPDKjvbdGcjvJaij",
+    "DnbkKvbdwtldpxkn",
+    "DoDKjvbdYkrETnMN",
+    "EPCjjvbdbBWEfQQX",
+    "EPCjjvbduMXwAtBX",
+    "DncLKvbdbsCkTcia",
+    "DoCjjvbdczYpYZRC",
+    "EOcKjvbdFeiqmhsq",
+    "DoCkKvbdKCicQibx",
+    "EOcKjvbdZLrEUOLm",
+    "DoCjjvbdaNKbStmH",
+    "DoDKjvbdJbjDQjDY",
+    "EPCkKvbdemFwGmKL",
+    "EPDKjvbdZQleImEq",
+    "DncKjvbdZjShPfbG",
+    "DnbjjvbdqYnhHREY",
+    "DoCkKvbdaRfDIUGL",
+    "DoDKjvbdLrWlyuQz",
+    "DnbjjvbdZisHofaf",
+    "EObjjvbdhtydvrUb",
+    "DnbjjvbdRotHKGEX",
+    "EObjjvbdNeEThhkE",
+    "EPCjjvbdZtJJZESn",
+    "DoDKjvbdnPyxvLYb",
+    "EPDKjvbdeEoRbWbj",
+    "EOcLKvbdFxttaEXb",
+    "EObjjvbddwystRez",
+    "EPCjjvbdJpzEnenF",
+    "DnbkKvbdTppntuIN",
+    "EPCkKvbdTukpKUBR",
+    "DnbkKvbdhlFEOUcZ",
+    "EObkKvbdlhdUQuRa",
+    "DnbjjvbdkClKqHUg",
+    "EOcKjvbdqTtGqqkU",
+    "DncKjvbdtkwvaUBX",
+    "DoDKjvbdsQWOjCuf",
+    "DncLKvbdEKIJuwjA",
+    "DncKjvbdGLErcIMu",
+    "EOcLKvbdNPwpumfs",
+    "EObkKvbdnVUzLJrG",
+    "DoCkKvbdcTDKsdKB",
+    "DncKjvbdKRZdoFme",
+    "EOcLKvbdemFvgNKL",
+    "EPCkKvbdznopdblY",
+    "EPDLKvbdOYPVzdOU",
+    "DnbjjvbdsZlPsAhO",
+    "DoDLKvbdKCjDRKDY",
+    "DoCkKvbdhuZeXSVC",
+    "EPDKjvbdOStVgEtp",
+    "DncLKvbdvwMAvBWV",
+    "EPDKjvbdBcoaWJlf",
+    "EOcKjvbdZxdKODMS",
+    "DoCjjvbdbsCkTcjB",
+    "EOcLKvbdwWlAuaWV",
+    "DnbjjvbdFejRnJUR",
+    "DnbjjvbdmIdTqVSB",
+    "DnbkKvbdqBIeAWhE",
+    "DncKjvbdrMzJyMIJ",
+    "DoCkKvbdZGvdAOsJ",
+    "DncLKvbdjggLfFnL",
+    "DoCjjvbdYqNFJMdq",
+    "DoCkKvbdqZPHfqDx",
+    "DncLKvbdOEdThiLE",
+    "DoCkKvbdZirgpGaf",
+    "EPDLKvbdziuQPdSt",
+    "EObkKvbdKQyeOenF",
+    "DoDLKvbduaDySndh",
+    "DoCjjvbdVUNUGLvK",
+    "DncKjvbdAMhYrvzY",
+    "DnbkKvbdnQZxvKxb",
+    "EPCjjvbdBhjakJFj",
+    "DncLKvbdmfeYNNfy",
+    "DoDLKvbdjlbLydfo",
+    "DoDLKvbdpyPIGpcx",
+    "EOcLKvbdnVUzLJqf",
+    "DoCjjvbdmJETqVSB",
+    "DoDLKvbdJTZAsMxM",
+    "DoCkKvbdnQZxvLZC",
+    "DoDKjvbdACqwizJQ",
+    "DncKjvbdvBEZSoFI",
+    "DncKjvbdGckVjCJj",
+    "DncLKvbdiMFENtcZ",
+    "Dnbjjvbdjuvmcaww",
+    "DnbkKvbdZyEKNblS",
+    "DoCjjvbduMYXBUBX",
+    "DnbjjvbdFWYopNJe",
+    "DoDKjvbdelfXGljL",
+    "DnbjjvbdakLenmcA",
+    "EPDKjvbdfILWRmpg",
+    "EObjjvbdSLYeuHLT",
+    "DoCjjvbdMfbolotk",
+    "EPDLKvbdrRuKnKaN",
+    "EOcKjvbdyzdnRhIh",
+    "DoDLKvbdGAoRZJzm",
+    "DoCjjvbdhlFDnUcZ",
+    "EPDLKvbdmpZyVkYb",
+    "DncKjvbdTpqPUuIN",
+    "DncLKvbdHDjvJaij",
+    "EPDLKvbdYlRcsmkm",
+    "EPDLKvbdvlvAMdFN",
+    "DncKjvbdIsZArmYM",
+    "EOcLKvbdegjuqnQg",
+    "EOcLKvbdZQmFJNFR",
+    "DoCjjvbdZxdJmcMS",
+    "EPCkKvbdlZTSTYgU",
+    "DoDKjvbdqceJPnWB",
+    "DncLKvbdVgwuxGxz",
+    "DncKjvbdDnbkLXDE",
+    "EPDLKvbdatbHYKsh",
+    "DncKjvbdEzsqFLbi",
+    "EPDLKvbdnVVZkKRf",
+    "EOcKjvbdKeegbBQu",
+    "EPCkKvbdKfGHaaRV",
+    "EPDKjvbdmIctRVRa",
+    "EPCjjvbdRMxBxnUz",
+    "DnbjjvbdJYTbILpp",
+    "EPCkKvbdTAEiHbPE",
+    "EOcLKvbdfelZnGgA",
+    "DoCjjvbdOStWGeUp",
+    "EOcLKvbdemGXHNJk",
+    "DoDKjvbdYTMAmUOx",
+    "EPCkKvbdpyOhGpcx",
+    "EPCkKvbdAMgxsWzY",
+    "DnbjjvbdYkrETnMN",
+    "EPDLKvbdUQqPUtgm",
+    "DncKjvbdehKurNqH",
+    "DoCjjvbdZMSETnLm",
+    "DoDKjvbdIHGyyXwg",
+    "EObjjvbdXGYzUAPT",
+    "DoCjjvbdhbPCeWqR",
+    "DoCkKvbdKNADzGuB",
+    "DnbjjvbdFeirOJTq",
+    "DncLKvbdaRecHtFk",
+    "DnbkKvbdzoPpeClY",
+    "EObkKvbdZRMeJMeR",
+    "DnbjjvbdYfvdAPSi",
+    "DncLKvbdJcKCqJcY",
+    "EOcLKvbdqvokbhyR",
+    "DoDLKvbdrRuLNjaN",
+    "DoCjjvbdTlWPBWOi",
+    "DoCkKvbdjvWnEBxX",
+    "DoDLKvbdTkunaVoJ",
+    "DoCkKvbdQZNAHTSK",
+    "EObjjvbdqwPkbhyR",
+    "EOcLKvbdNHDPlpUk",
+    "DncLKvbdIHHZxxYH",
+    "DncLKvbdtkxXAtAw",
+    "DncLKvbdSCEFMJZL",
+    "DnbjjvbdZQmEhldq",
+    "DoCjjvbdNGbolotk",
+    "DnbjjvbdnCKWwnmu",
+    "DncLKvbdzHZMANEw",
+    "DoDKjvbdmttykJrG",
+    "DnbkKvbdlrZUzSci",
+    "EPDKjvbdSKyGVHKs",
+    "DoCjjvbdKVuGEFGi",
+    "EPCjjvbdCIkBkIej",
+    "DncLKvbdzHZMAMeX",
+    "DnbkKvbdaSFbgsek",
+    "DncLKvbdHDjujBij",
+    "DoDKjvbdGZVUaDwb",
+    "DnbjjvbdZnnJFEzK",
+    "DoCkKvbdtcDUwWOo",
+    "DoCkKvbdlBMoNALA",
+    "EOcKjvbdNsUWHFUp",
+    "DoDLKvbdVUNUFlVj",
+    "DnbkKvbdhkdcnUcZ",
+    "DncLKvbdLiBkqYAS",
+    "EOcKjvbdzoPpdcLx",
+    "EPDKjvbdijGIJmXr",
+    "EOcKjvbdZisHofaf",
+    "DoDLKvbdeOdrkUUS",
+    "DoDLKvbdnPyxvKxb",
+    "EPDKjvbdIxUBhMRQ",
+    "DncLKvbdlhctRUqa",
+    "DoDLKvbdmgFXlnGy",
+    "DncKjvbdCJKbKiGK",
+    "EOcLKvbddndrjtUS",
+    "DnbjjvbdkDLjqGuH",
+    "DncKjvbdmIcsptqa",
+    "DoCkKvbdvvlAvBWV",
+    "EObjjvbdjblLQftg",
+    "DnbjjvbdCEQBWKMf",
+    "DnbjjvbdBdPaVilf",
+    "DoCkKvbdZxcjODLr",
+    "DoCkKvbdEObjjwCd",
+    "EPDKjvbdyTNhlqbH",
+    "EPCkKvbdUMVoAvPJ",
+    "DncKjvbdUxhUZjoO",
+    "DncKjvbdqqtjmkAm",
+    "DncKjvbdKfGICBRV",
+    "EPCjjvbdVrOXaeLc",
+    "EPDLKvbdwXLaWBWV",
+    "EPCkKvbdjblKqHUg",
+    "DnbjjvbduDCuWuoP",
+    "EPDKjvbdNGbpMouL",
+    "EObjjvbdBcoaVjNG",
+    "DncLKvbdrWpMDIxq",
+    "DncLKvbdhaoCdwRR",
+    "DnbkKvbdFxtuBDwb",
+    "DncKjvbdIjEAKPgE",
+    "EOcLKvbduCbuXVoP",
+    "DoDKjvbdZtIiZDsO",
+    "DnbjjvbdEztRElCi",
+    "DncLKvbdxmsHwsJD",
+    "DnbjjvbdRbEElIxk",
+    "DoDKjvbdWHwvXgYz",
+    "EOcKjvbdQlwbYnUz",
+    "EOcLKvbdVTltFkuj",
+    "DncKjvbdliETptqa",
+    "DnbkKvbddoErjtTr",
+    "DoCkKvbdgPazvdXh",
+    "DncKjvbdySmhlqag",
+    "DoCjjvbdbPgHDkzd",
+    "DoCkKvbdFWZPomKF",
+    "EObjjvbdssSSxydc",
+    "EObjjvbdzQnliJwA",
+    "EObkKvbdKCjCpibx",
+    "EPCjjvbdpyOhHREY",
+    "DncLKvbddjJqutzn",
+    "EObkKvbdBdQAujMf",
+    "EPCkKvbdLAjflbXq",
+    "DncLKvbdLBLGlaxR",
+    "DoDLKvbdrpWPJbuf",
+    "DoCjjvbdEKHiuxKA",
+    "DoCjjvbdXsMAlsnx",
+    "EObkKvbdptTgSSLU",
+    "DoDKjvbdnHFXmNfy",
+    "DncKjvbdCJKbKhej",
+    "EPCjjvbdhlEdOUby",
+    "EOcKjvbdKWUfEFGi",
+    "DoDKjvbdZQmFJMdq",
+    "EPCjjvbdiGjDZWKV",
+    "EObkKvbdVAbQrprZ",
+    "DoDKjvbdfekzNgHA",
+    "DoDLKvbdnHEwlmgZ",
+    "DncKjvbdwzHeexEr",
+    "DoCjjvbdmpZxujyC",
+    "EPDKjvbdwMvAMcdm",
+    "DoCjjvbdfHkVrNqH",
+    "EPCkKvbdYzbfRiuy",
+    "EPCkKvbdZtIiZDrn",
+    "DnbjjvbdjvWnDbYX",
+    "DoCjjvbdOStVgEtp",
+    "EPDLKvbdZMSETmlN",
+    "EPDKjvbdBhjajhej",
+    "EPCjjvbddoFTLUUS",
+    "DnbkKvbdsQVoJcWG",
+    "EPCjjvbdrEFJQNvB",
+    "DoCjjvbdMpYRWOGs",
+    "EOcLKvbdZirgpHBf",
+    "EPDLKvbdyOTIXsJD",
+    "DoCkKvbdKRZdnfNe",
+    "DnbjjvbdbBWFFoow",
+    "EPCjjvbdgFlZnHHA",
+    "DnbkKvbdGGJrOIsq",
+    "DoDLKvbduDCtwWPP",
+    "EObjjvbdNddUIhjd",
+    "DnbjjvbdxsNiMqag",
+    "EObjjvbddeOrCWbj",
+    "EObjjvbdPxmAGsRj",
+    "EOcLKvbddeOrCXDK",
+    "DoDLKvbddeOrBwCj",
+    "DoCjjvbdVqnYCElD",
+    "DnbkKvbdUyIUZjoO",
+    "EObjjvbdeFOrCXDK",
+    "EObkKvbdVrNxCFLc",
+    "EObjjvbdTfzmkwWF",
+    "EOcKjvbdIHGzZYYH",
+    "EPDKjvbdtbbuXWPP",
+    "DoCjjvbdZisIQHBf",
+    "EObjjvbdbsCkUDjB",
+    "EPCkKvbdVwJXudFH",
+    "EPDKjvbdrouoKDVf",
+    "EPCkKvbdFyVVBEYC",
+    "DncLKvbdZnnIeEzK",
+    "EPDLKvbdxVNFQxkn",
+    "DoDKjvbdpxnggRDx",
+    "DoDLKvbdqZOgfpcx",
+    "DncKjvbdCIjakJGK",
+    "EPCkKvbdCJLBjhej",
+    "DoDLKvbdnPzYvKxb",
+    "EOcKjvbdqTsgSRkU",
+    "EOcLKvbdLBLGlaxR",
+    "DoDLKvbdcbTMrAUN",
+    "DncLKvbdzitoodSt",
+    "DoDKjvbdJvUfDdfi",
+    "EOcLKvbdHDjvKCJj",
+    "EPCkKvbdeOeTKssr",
+    "DnbkKvbdlYrqsYft",
+    "DncLKvbdiiehKMxS",
+    "DncKjvbdURQoVUhN",
+    "DnbkKvbduMYXBUAw",
+    "DoDLKvbdSPtHJfEX",
+    "EObkKvbdqBJFAWgd",
+    "EOcKjvbdFpATWgFy",
+    "DoDLKvbdBsBDTfXS",
+    "DncKjvbdjhHLfFmk",
+    "DoCjjvbdCJKakIfK",
+    "DnbkKvbddoFSjtTr",
+    "EObkKvbdANIYsWzY",
+    "EObjjvbdCTAbtFvr",
+    "EObjjvbdrRtkOLAm",
+    "DnbkKvbdkxsSTYgU",
+    "DoCjjvbdnBiwXnmu",
+    "EObjjvbdwtmEqYlO",
+    "EPDKjvbdrylQTAhO",
+    "DoDLKvbdtbbtvvOo",
+    "EPCjjvbdZLrETmlN",
+    "EPDLKvbdWXJYWDdg",
+    "DoCkKvbdKQzFOfOF",
+    "EPCjjvbdwzIFfXeS",
+    "DncKjvbdRjyFuHLT",
+    "EPDLKvbdULunaWPJ",
+    "DncKjvbdUxhTykOn",
+    "DnbkKvbdJcKCqKDY",
+    "EPDLKvbdcbSmSATm",
+    "DnbkKvbdegjurNqH",
+    "EPDKjvbdZjTIQGbG",
+    "EPCjjvbdiLddNuCy",
+    "DoCjjvbdZQldiNEq",
+    "EOcLKvbdakMGPODA",
+    "EObjjvbdnHEwlmgZ",
+    "EOcLKvbdBsAcUGXS",
+    "EPCkKvbdiVZdwSUb",
+    "EOcLKvbddCTNSAUN",
+    "DnbkKvbdEXxMUUUM",
+    "DncKjvbdYpldiMeR",
+    "DoDKjvbdNddTiIjd",
+    "DoDLKvbdZLqdUNlN",
+    "EPCkKvbdiBncFWpq",
+    "DncLKvbdiCPDEvqR",
+    "EOcKjvbdUyHszKoO",
+    "DncKjvbdhtydvqtb",
+    "EPCjjvbdpxoHgQcx",
+    "EObkKvbdkWWnDaxX",
+    "DnbjjvbdBhkBkJFj",
+    "DoCkKvbdRacdkhyL",
+    "EOcLKvbdZjTHpHCG",
+    "EPCkKvbdMowqWOGs",
+    "DncLKvbdegjurNpg",
+    "EObjjvbdfMfWfmKL",
+    "EPDLKvbdZirgpGaf",
+    "DoDLKvbdiZuFlQnG",
+    "DncLKvbdFxuVAcxC",
+    "EObkKvbdZisHofaf",
+    "EOcKjvbdJSyBSmYM",
+    "EPDLKvbdVYgtZkPO",
+    "EOcKjvbdRbEFMJYk",
+    "DncLKvbdrEFIonWB",
+    "DncKjvbdKDJbqJcY",
+    "EOcLKvbdhfjCxuiu",
+    "EObjjvbdLLAhWAKZ",
+    "DoCkKvbdRXNcblID",
+    "DoDLKvbdcbSmSATm",
+    "EOcLKvbdwWlAvAuu",
+    "EObkKvbdiBnbdvpq",
+    "DoCkKvbdNQXpumgT",
+    "DncLKvbdkVwOECYX",
+    "DnbkKvbdfoazwDxI",
+    "DoDLKvbdbBWFFpPw",
+    "DoDLKvbdvBDxsPEh",
+    "EPDKjvbdJqZdoFme",
+    "DoDLKvbdIryArmXl",
+    "EPCjjvbdANIZSwZx",
+    "EPCkKvbdVhYVxGxz",
+    "DncKjvbdLAjgNCYR",
+    "DncKjvbdxxIjCQZk",
+    "DncKjvbdbiNKKewY",
+    "EPCjjvbdlrZVZsEJ",
+    "EPDKjvbdIryAsMwl",
+    "DoCkKvbdtAHRIAAr",
+    "EPDKjvbdJmAEZfuB",
+    "EPCkKvbdZjSgogBf",
+    "DoDLKvbdOXnuzcnU",
+    "DnbkKvbdehKvRnQg",
+    "EObjjvbdZyDimbkr",
+    "DoDKjvbdmajWwoOV",
+    "EOcKjvbdkMalZeHP",
+    "EOcKjvbdIjEAJpHE",
+    "EPCkKvbdDihKVxKA",
+    "DncKjvbdNddUIiKd",
+    "EObjjvbdqdFIpOWB",
+    "DoCkKvbdxnShXsJD",
+    "DoDLKvbdjmBkzEfo",
+    "EOcLKvbdatagYLTh",
+    "DoCjjvbdVhYVxHYz",
+    "DnbjjvbdJbjDRKDY",
+    "EPCjjvbdLBLHNCYR",
+    "DnbjjvbdnGeYNOGy",
+    "EOcLKvbdUsmTekvK",
+    "EPCjjvbdtkxXBTaX",
+    "EPCjjvbdzoPqFCkx",
+    "DncKjvbdCIjbKhej",
+    "DncKjvbdZLqdTmkm",
+    "DoDKjvbdsPunicVf",
+    "EOcKjvbdmgFXmNgZ",
+    "EObkKvbdiMFENuCy",
+    "DoDKjvbdhanbeXRR",
+    "EObkKvbdACqwiyhp",
+    "DncKjvbdZisIQHBf",
+    "EPCjjvbdgQBzwDwh",
+    "DnbjjvbdyYJJaoyk",
+    "DoDKjvbdxUldqZMO",
+    "EObkKvbdkClLQgVH",
+    "EPCjjvbdZQldiMeR",
+    "EPDLKvbdZyEKOClS",
+    "EPDLKvbdcIlikFvx",
+    "DoDKjvbdrzMQTBHn",
+    "DnbjjvbdVYgtZkPO",
+    "DoDLKvbdHEKuiajK",
+    "EPCkKvbdczZQXxqC",
+    "DoDKjvbdrDdiQNua",
+    "DncLKvbdcImKLGWx",
+    "DoCjjvbdVYgtZkPO",
+    "EPDLKvbdZnnIeFZj",
+    "EPDKjvbdMIakqYAS",
+    "DoCkKvbdSLYfUgLT",
+    "EPDLKvbdiCObdvpq",
+    "DnbjjvbdRpUHKFcw",
+    "DoDLKvbdIHHZyYXg",
+    "EPCjjvbdypoMhiwA",
+    "DnbkKvbdCEPaVjMf",
+    "DnbkKvbderAvzlDP",
+    "DnbkKvbdZQleImFR",
+    "EOcKjvbdKRZdneme",
+    "DoDLKvbdiBnbeXQq",
+    "DncLKvbdEPDKjvcE",
+    "EOcLKvbdauCGwkTh",
+    "DncLKvbdEvZQPmJe",
+    "EPCkKvbdURQnuVIN",
+    "DncLKvbdegjvSOQg",
+    "EPCjjvbdKaKgMawq",
+    "DnbkKvbdRzKISbvA",
+    "DncLKvbdiLdcnUcZ",
+    "EPDLKvbdkDMKpfuH",
+    "DoDLKvbdRbDdkhyL",
+    "DnbjjvbdDwxMUUTl",
+    "DnbkKvbdrpWPKCuf",
+    "DnbkKvbdNVSqjmAX",
+    "DoDKjvbdRbDeMIxk",
+    "EOcLKvbdcyxpXyRC",
+    "DncLKvbdRMwbYnUz",
+    "EObjjvbdqlzJxlHi",
+    "DoCkKvbdJYUCIMQp",
+    "DncLKvbdLZQjSzuG",
+    "EOcKjvbdxVNEqYkn",
+    "DnbkKvbdZoOIeFZj",
+    "DoCjjvbdBraCtFwS",
+    "EOcLKvbdliDsqVSB",
+    "EPCkKvbdeATqNXif",
+    "DncLKvbdkMbLydgP",
+    "EObjjvbdZxdJmbkr",
+    "DoCjjvbdraellHLZ",
+    "EObkKvbduDCuWvPP",
+    "DoCkKvbdpstGrSLU",
+    "DoCjjvbdLGFgbBQu",
+    "DnbkKvbdhtzFWquC",
+    "EObjjvbdoAKztHdO",
+    "EPDLKvbdatafxKtI",
+    "EPDKjvbdkWXNcaww",
+    "DoCkKvbdwkXEHzzG",
+    "EObkKvbdmgEwmNgZ",
+    "DncKjvbdBiLCLJFj",
+    "DoCjjvbdeOdsKssr",
+    "EOcLKvbdfILWSORH",
+    "EObkKvbdCDpAujMf",
+    "EPDKjvbdKDKDQibx",
+    "DoDKjvbdVUMtGLuj",
+    "EObkKvbdrXQMCiYq",
+    "DncKjvbdePEsLTtS",
+    "DncLKvbdDxYLtUTl",
+    "EPCkKvbdGYuVBEYC",
+    "DncLKvbdNeEUIiKd",
+    "EPCkKvbdpxoIHRDx",
+    "EObjjvbdFkEsDHlu",
+    "EObjjvbdssSSxzFD",
+    "DoCkKvbdUtNTfMVj",
+    "DnbjjvbdJcKDRKDY",
+    "DncKjvbdqiAKEmOe",
+    "DoDKjvbdtlXwAtBX",
+    "DnbkKvbdxmsIYTIc",
+    "EObkKvbdLrXMzUpz",
+    "DoCjjvbdkxsSSxft",
+    "DncKjvbdQlwaxnUz",
+    "EObkKvbdjhGlFfNk",
+    "EPCkKvbdxsNhmRag",
+    "DoDLKvbdMfcPmQUk",
+    "DoDKjvbdQvnEDLhD",
+    "EObjjvbdVgxVxHYz",
+    "DoDLKvbdlrYtyrdJ",
+    "DoCjjvbdezvYeIsw",
+    "DncLKvbdNddTiIjd",
+    "EPDLKvbdGGJrNiUR",
+    "EPDLKvbdRzJhTDWA",
+    "EPCjjvbdvvkaWBVu",
+    "EOcKjvbdRXNdCkgc",
+    "EOcKjvbdQZNAHTSK",
+    "EPCkKvbdsCGNLfkZ",
+    "EOcLKvbdDwwktTsl",
+    "EOcLKvbdqlzJyLgi",
+    "EOcLKvbdxsNiMqag",
+    "EOcLKvbdhzVFlROG",
+    "EOcKjvbdEztRFMCi",
+    "DnbkKvbdqiAJdmPF",
+    "EPDLKvbdjcMKqGtg",
+    "EObkKvbdTlWOaWOi",
+    "EPDLKvbdURRPUuHm",
+    "DoDKjvbdelfWgNKL",
+    "EOcLKvbdGAnqZJzm",
+    "EObjjvbdGZUuAdXb",
+    "DoDLKvbduLwwAtAw",
+    "DoCjjvbdZjTIQGbG",
+    "EPCjjvbdRNXbYnUz",
+    "EPDLKvbdiLeENtby",
+    "EObjjvbdMowpunGs",
+    "EOcKjvbdbiNJjevx",
+    "DoDKjvbdEYYLstTl",
+    "DoDLKvbdqUTfrRjt",
+    "DoDKjvbdbsCkUEJa",
+    "DoDKjvbdXsMBNUPY",
+    "EPCjjvbdRNXaxnUz",
+    "DoDLKvbdNGcQNQUk",
+    "DnbjjvbdEARiMywX",
+    "EPDKjvbdSKxfUfkT",
+    "DncKjvbdhtyeXRtb",
+    "DncKjvbdZLqcsnLm",
+    "EObkKvbdZnmheEzK",
+    "EObjjvbdtbcUvuno",
+    "DnbjjvbdrzMQTBHn",
+    "DnbjjvbdDwwktTsl",
+    "EPDKjvbdkxsSTYgU",
+    "DoDKjvbdIryArlxM",
+    "DoDKjvbdnBivxOnV",
+    "DoDKjvbdeATplwif",
+    "EOcLKvbdKeegbApu",
+    "EPCjjvbdMgDQMotk",
+    "DoCjjvbduCbtwWOo",
+    "DnbkKvbdyNsHwrhc",
+    "DnbkKvbdtvNxJpsA",
+    "EOcLKvbdqAheAWgd",
+    "DoCkKvbdURQoUtgm",
+    "EOcKjvbdqceIpOWB",
+    "DoCkKvbdVwIwudFH",
+    "DnbkKvbdbLMFnmcA",
+    "EOcLKvbdZjTHpHBf",
+    "EOcKjvbdRXNdCkhD",
+    "EPDLKvbdiHJcZViu",
+    "DoCjjvbdxxIjCPzL",
+    "DnbkKvbdBcpBWJmG",
+    "EPCkKvbdZyEKOCkr",
+    "EPDKjvbdOTUWHFVQ",
+    "DoCjjvbdIGgZxwwg",
+    "EPDLKvbdFjeSbhMu",
+    "EPDLKvbdhgKCxvJu",
+    "EOcLKvbdNsUWGdtp",
+    "EPDKjvbduVnXipsA",
+    "DncLKvbdGYuVBEXb",
+    "EPDLKvbdZtIhyESn",
+    "DoDKjvbdZxdJmcLr",
+    "DoCjjvbdUsltGLuj",
+    "DoDKjvbdDoDLKvbd",
+    "DncLKvbdrDdhpNvB",
+    "EPDLKvbdKCjDRJbx",
+    "DoDLKvbdxLWdHzyf",
+    "EObkKvbdrzMQTAhO",
+    "EOcLKvbdOFDtJJKd",
+    "EPCkKvbdrSVKmjaN",
+    "EOcKjvbdWWiYVdEg",
+    "EOcKjvbdWWhwvDdg",
+    "DncKjvbdpstHRqjt",
+    "EPCkKvbdKWVFceGi",
+    "DoCkKvbdZjShPfbG",
+    "DoCkKvbdSxKlNzkY",
+    "EPDLKvbdIwtCHkqQ",
+    "EOcKjvbdsCGNLgLZ",
+    "DncKjvbdzaAOfgCM",
+    "DoDLKvbdxmrhYSiD",
+    "DncLKvbdfMfWgMjL",
+    "EPDKjvbdqFdEsuaI",
+    "EOcLKvbdiLeDnUcZ",
+    "DoCjjvbdKVuFceHJ",
+    "DoCjjvbdfekzNgHA",
+    "EOcKjvbdOFEThiLE",
+    "EPDLKvbdqceJPnWB",
+    "DoDLKvbduCbtwWOo",
+    "DncKjvbdTqROtuIN",
+    "DncKjvbdpedFUWBI",
+    "DoDLKvbdrEFJQNua",
+    "DoDLKvbdyXhjCPyk",
+    "EPCkKvbdJYUBhLqQ",
+    "EPCkKvbdtcCuXVno",
+    "DoDLKvbdZLrEUOLm",
+    "EPCkKvbdpstGrRjt",
+    "DncLKvbddePSCXCj",
+    "EObkKvbdauCHXjsh",
+    "DoDLKvbdkHfkefNk",
+    "EObjjvbdMRwMzUpz",
+    "EObjjvbdaMkCTVNH",
+    "DoCkKvbdGGJrNhtR",
+    "EPDLKvbdvBDxrneI",
+    "EPDLKvbdIHHZxwxH",
+    "EOcLKvbdrJAJdmPF",
+    "EOcKjvbdGZUuAdXb",
+    "EOcLKvbdbUbHYLUI",
+    "DnbjjvbdJzofYEAN",
+    "EPDKjvbdFxtuBDxC",
+    "DnbkKvbdQvnDbkgc",
+    "EPDKjvbdJmADzGta",
+    "DoDKjvbdZRMdhleR",
+    "DnbkKvbdsrqsZZeD",
+    "EObkKvbdrovPJbuf",
+    "EPCjjvbddeOqbXCj",
+    "EObjjvbdtcDVXVoP",
+    "DncKjvbdMfbpNQVL",
+    "DoCkKvbdhbPCeXQq",
+    "DoCkKvbdNHComQVL",
+    "EObjjvbdvBDxroFI",
+    "EPCjjvbdnBivwoNu",
+    "EObjjvbdbhljKewY",
+    "EPDKjvbdZyDimcMS",
+    "EObkKvbdWSOXbElD",
+    "EOcKjvbdTfznMXVe",
+    "EPCjjvbdZtJJYcsO",
+    "DoCjjvbdRjxfVHLT",
+    "DoCkKvbdVTltGMVj",
+    "DncKjvbdYfwEAOri",
+    "DncKjvbdYkrEUOMN",
+    "EObkKvbdqGEEsuaI",
+    "DncLKvbdjJfHimXr",
+    "EPDLKvbddndsLUTr",
+    "DnbkKvbdqBJFAWhE",
+    "EPDLKvbdEOcKjwDE",
+    "EPCkKvbdtvOYJqTA",
+    "DncLKvbdkyTRsZHU",
+    "DoCjjvbdTppnuVIN",
+    "DncLKvbdwyhFeweS",
+    "DncKjvbdsBelkgKy",
+    "DoCjjvbdKDKCqJcY",
+    "DoCjjvbdkClKqHVH",
+    "DoCjjvbdcTCjtDia",
+    "EPDLKvbdUVkpJtAq",
+    "EPDLKvbdRyjITCvA",
+    "DnbjjvbdJuuFcdgJ",
+    "DoDKjvbdrJAJdmOe",
+    "DncKjvbdJcJbqKCx",
+    "DoDLKvbdJcJbqJcY",
+    "DoDKjvbdeEoSCXDK",
+    "DoDLKvbdSwjlNzkY",
+    "EObjjvbdzitopDrt",
+    "DoCkKvbdKWVGEEgJ",
+    "DncKjvbdpssfqrKt",
+    "EOcLKvbdUMWPBVoJ",
+    "DncKjvbdyzdmrIIh",
+    "EPCjjvbdxUldqZLn",
+    "DoDLKvbdySnImRbH",
+    "DoCjjvbdGdKvJaij",
+    "DoCkKvbdxZgeewdr",
+    "EObkKvbdiLddNuDZ",
+    "DnbjjvbdSCDdkiZL",
+    "DncKjvbdznpREcMY",
+    "EOcLKvbdaRebhTfL",
+    "DnbjjvbdZQldiMdq",
+    "EPCjjvbdbrbjtEKB",
+    "EOcKjvbdEARiMzXX",
+    "DoDLKvbdXrkaNTnx",
+    "EPCkKvbdQZNAHTRj",
+    "DoDLKvbdEzspeLcJ",
+    "EPCjjvbduVnYKRTA",
+    "EObjjvbdJXtBhMQp",
+    "EPDKjvbdeOdrjssr",
+    "EPCjjvbdLqwMytpz",
+    "EPDKjvbdUMVoBVoJ",
+    "DncKjvbdRpUGifDw",
+    "EPDLKvbdZyDinDLr",
+    "DnbkKvbdNrsufeVQ",
+    "EPCkKvbdZMSDtNlN",
+    "EPCkKvbdySnJNSCH",
+    "EPCjjvbdfMevfljL",
+    "DncLKvbdXsMBNTnx",
+    "DnbkKvbdpxoHfqDx",
+    "DncLKvbdUQpntthN",
+    "DncKjvbdIsZArlwl",
+    "DoDLKvbdZGwEAOsJ",
+    "EOcKjvbdVvhwvDdg",
+    "EOcLKvbduWNxJqTA",
+    "EPCjjvbdHEKvJaij",
+    "DoDKjvbdrpWOjCuf",
+    "DncLKvbdrpWOjDVf",
+    "DoCjjvbdIHGzYwwg",
+    "DoDLKvbdpxoIGqEY",
+    "DoDLKvbdJcJbqKDY",
+    "DoCjjvbdRWmdClHc",
+    "EPCjjvbdFWYopNJe",
+    "DncKjvbdmfdwlmfy",
+    "DoCkKvbdxUleQxlO",
+    "EObjjvbdnGdxMnGy",
+    "EPCjjvbdvvlAvBVu",
+    "DncLKvbddndsKssr",
+    "EObjjvbdZMRcsnLm",
+    "EOcKjvbdFxttaEXb",
+    "DncKjvbdVUNTfMVj",
+    "EOcLKvbdNrtWHFUp",
+    "DoDKjvbdwuMdqYlO",
+    "EPDLKvbdrXPkbhxq",
+    "EObjjvbdrEFIpNua",
+    "EObjjvbdziuQQDrt",
+    "EOcLKvbdqYoIGpcx",
+    "DnbjjvbdsQVoJcVf",
+    "EObkKvbdkDMKpgUg",
+    "EObjjvbdvBDyTPFI",
+    "DncKjvbduCbuWvOo",
+    "EPCjjvbdkVvnECYX",
+    "DncLKvbdZGvdAOri",
+    "DoCkKvbdrXPlDJZR",
+    "EOcLKvbduCcVWvOo",
+    "DoDKjvbdCEPaWJlf",
+    "EPDKjvbddoErjssr",
+    "DncKjvbdACqxKZiQ",
+    "EPCjjvbdUVlPitAq",
+    "EPDKjvbdjJfHjMxS",
+    "EObkKvbdAMhYsWzY",
+    "DoDKjvbdnBivxOmu",
+    "EOcLKvbdbiNKKfXY",
+    "EPDKjvbdYqMeIleR",
+    "EObkKvbdJmADygUa",
+    "EObjjvbdEPDLLWcE",
+    "EPCjjvbdrXPkcIxq",
+    "EOcLKvbdliDtQtqa",
+    "DoCjjvbdmoyxujyC",
+    "EPDLKvbddoFTLTsr",
+    "EOcLKvbdCWzdJEpW",
+    "DnbjjvbdrEEhpOWB",
+    "DoDKjvbdZLrDtNkm",
+    "EOcLKvbdLFfHbAqV",
+    "EOcKjvbdmttzLKSG",
+    "EOcLKvbdmbJvwoOV",
+    "EOcKjvbdUaCQrqSZ",
+    "DnbjjvbdmgExMnGy",
+    "EPDKjvbddndrkUUS",
+    "EObkKvbdDwwkstTl",
+    "DoCkKvbdcJMjLFwY",
+    "DnbjjvbdaNLBruMg",
+    "DoDLKvbdQYmAHTRj",
+    "DnbkKvbdsQWOicWG",
+    "EObkKvbdMRwMzUpz",
+    "DoDLKvbdZshiZDrn",
+    "EPDLKvbdnPzYujxb",
+    "EOcKjvbdCEQAujMf",
+    "EPDLKvbdKefHbApu",
+    "DoDLKvbdYpldiNFR",
+    "DoCkKvbdFWZQQNJe",
+    "DncLKvbdznpQeCkx",
+    "EOcKjvbdnQZxvKxb",
+    "DoCkKvbdVBBprpqy",
+    "DnbkKvbdZirhPfaf",
+    "DnbkKvbdegjvSNqH",
+    "EOcLKvbdqdEiPnWB",
+    "EObjjvbdBhkCKiGK",
+    "EObjjvbdxZgfGYFS",
+    "DnbjjvbdNQYQumgT",
+    "EPCjjvbdxsNhlrBg",
+    "DoCkKvbdQdDApRDr",
+    "DoCkKvbdxxIiaoyk",
+    "EPDKjvbdFeirNhtR",
+    "DoCjjvbdegjvSOQg",
+    "EObkKvbdqcdiQNvB",
+    "DncLKvbdiMEdNtcZ",
+    "DncLKvbdTqRPUthN",
+    "EPCkKvbdwygeexFS",
+    "DoDKjvbdyTOJMrBg",
+    "DncLKvbdeEoRavbj",
+    "EPCjjvbdtbcUvvOo",
+    "EObjjvbdKCicRJcY",
+    "EObjjvbdZyEKODMS",
+    "DnbjjvbdmJDtQtrB",
+    "DncLKvbdEARhlyvw",
+    "DnbjjvbdIxTbILqQ",
+    "EOcLKvbdwygefYFS",
+    "DoCjjvbdznoqFCkx",
+    "DoCjjvbdRpUGjGDw",
+    "DncKjvbdhzVGMQnG",
+    "EPCjjvbdhkeDnVCy",
+    "EObkKvbdOEdUIiKd",
+    "DncKjvbdrDeIomua",
+    "DncLKvbdiHJbxuiu",
+    "EPDKjvbddxZstRez",
+    "EPDLKvbdmSYuZrdJ",
+    "EObkKvbdVUNUFkvK",
+    "EPDLKvbdNeEUJIjd",
+    "DoCkKvbdiMEdNuCy",
+    "DoDLKvbdRDcApQcr",
+    "EPCjjvbdTlVoBVoJ",
+    "EObjjvbdLBKgNBwq",
+    "EPCkKvbdsCFllHKy",
+    "EObjjvbdnVUzLJqf",
+    "DoDKjvbdqrVLNkBN",
+    "DoCkKvbdqFcdtWBI",
+    "DncLKvbdbVCGxLTh",
+    "EOcLKvbdeFPSCXCj",
+    "EOcLKvbdRpTgKFdX",
+    "EObjjvbdznpQeDLx",
+    "EOcKjvbdjvXNcaxX",
+    "DnbjjvbdHDkWJbJj",
+    "DncKjvbdhkeENuDZ",
+    "DnbkKvbdnUtyjjSG",
+    "DoDKjvbdSQUHJfDw",
+    "DncKjvbdbUbHYLUI",
+    "EOcLKvbdNsTvGduQ",
+    "EPDLKvbdSZigsCvA",
+    "DncKjvbdMfcPlpUk",
+    "DoDLKvbdxrnIlrBg",
+    "DncKjvbdiLdcnVCy",
+    "EPCjjvbdmfeYNOHZ",
+    "DoCkKvbdjvWmcaxX",
+    "DoDKjvbdbUbHXkUI",
+    "DncKjvbdBhkBjiFj",
+    "DoDLKvbdNHColpVL",
+    "EOcKjvbdrykosAhO",
+    "DncLKvbdqGDeUVaI",
+    "DnbkKvbdhgJcZViu",
+    "DnbjjvbduLxXAtBX",
+    "EPCjjvbdYpleJNFR",
+    "EPDLKvbdQvmdClHc",
+    "DnbjjvbdJYTbIMRQ",
+    "DncLKvbdznpRFDMY",
+    "EOcLKvbdZnmiFEyj",
+    "DnbkKvbdrRuLOLAm",
+    "EObkKvbdhkeEOUby",
+    "DncLKvbdYlSEUOLm",
+    "DoCjjvbdhkdcmtby",
+    "DncLKvbdddnrCXDK",
+    "DoDLKvbdKaLHNCYR",
+    "EOcKjvbdcyxpYZQb",
+    "EPDLKvbdACqwjZhp",
+    "DoCkKvbdBsBDTevr",
+    "EObkKvbdeKJqvUzn",
+    "EObkKvbdcImJkGWx",
+    "DncLKvbdYSlAltOx",
+    "DncLKvbdlrYtyrdJ",
+    "EObkKvbdKxqJrztf",
+    "EOcKjvbdsQWPJcVf",
+    "DoDKjvbdkySqrxgU",
+    "EObjjvbdeEoRbXCj",
+    "EOcKjvbdHDkVjBij",
+    "DoDLKvbdCTBCsfXS",
+    "DoCjjvbdKCjDQibx",
+    "DoCjjvbdlhdTqUrB",
+    "DoDKjvbdTulQKTaR",
+    "DoCkKvbdRjxetfkT",
+    "EPCjjvbdEuyQQNKF",
+    "EPCjjvbdDoDKkXDE",
+    "DoCjjvbdsQWPJbuf",
+    "DoDKjvbdhuZdvqtb",
+    "EPDLKvbdiHKCyWJu",
+    "EPDLKvbdLFegaaQu",
+    "DoCjjvbdqZPHgRDx",
+    "DncKjvbdUWMPjUAq",
+    "DoDLKvbdTYKkmzjx",
+    "DoDKjvbdegjvSOQg",
+    "DnbkKvbdUtNTekvK",
+    "EObkKvbdNsTvGeVQ",
+    "DoDLKvbdfNFvgMjL",
+    "EOcLKvbdZQmEiNEq",
+    "EPDKjvbdBraDTfWr",
+    "EPDKjvbdNGcQNQVL",
+    "EPDLKvbdZyEKODMS",
+    "EOcKjvbdBvzdIdpW",
+    "EPCjjvbdACqwiyiQ",
+    "DoCjjvbddePRawCj",
+    "EPDKjvbdWWiXucdg",
+    "DoDKjvbdWexzUAPT",
+    "DnbjjvbdwXMBWBWV",
+    "EOcLKvbdUyHszLOn",
+    "EPCkKvbdOYOuzcnU",
+    "EPCkKvbdhancEwQq",
+    "DnbkKvbdjggLefOL",
+    "EPCkKvbdFjdsDIMu",
+    "DoDKjvbdrSUjmkBN",
+    "DoDLKvbdZjTIQGaf",
+    "DoDKjvbdMgDPmPtk",
+    "EPDLKvbdWRmwbFMD",
+    "DoCkKvbdzROmJKXA",
+    "DnbkKvbdrDdiQNvB",
+    "DnbjjvbduDCtwVoP",
+    "EOcLKvbdCIjbLJFj",
+    "EPDKjvbdXrkaMsnx",
+    "EPDKjvbdVhXvXfxz",
+    "DncKjvbdhbPDEwRR",
+    "DoCkKvbdpxoHgQcx",
+    "DoCkKvbduMXwBUBX",
+    "EObjjvbdNeEThhjd",
+    "DoCjjvbdirzhrkJz",
+    "DoDLKvbdaMkCTUlg",
+    "DncLKvbdWRnYBeLc",
+    "DnbjjvbdGBPRZJzm",
+    "EOcLKvbdeOeSjstS",
+    "DoDLKvbdmIctRVSB",
+    "DoCjjvbdZxdJnDMS",
+    "DoCkKvbdRpTgKFcw",
+    "DncLKvbdTukojTaR",
+    "DnbjjvbdKRZdoFme",
+    "DnbkKvbdURQoVUhN",
+    "DoDLKvbdyYJKBozL",
+    "EObkKvbdfNFwHMjL",
+    "DoDLKvbdZisIQHBf",
+    "EObkKvbdqFcdsuaI",
+    "DncLKvbdzoPqFDLx",
+    "DoDKjvbdSKxeuHLT",
+    "EPDKjvbdsBemLfjy",
+    "DoCjjvbdJbjCqJcY",
+    "DoCjjvbdNPxRVnGs",
+    "DncLKvbdGcjvJbKK",
+    "EOcKjvbdrWpMDIxq",
+    "EOcLKvbdQdDApQcr",
+    "DoDKjvbdZMRdTnLm",
+    "EOcLKvbddxZssrFz",
+    "EObjjvbdUtNTfLuj",
+    "EPCjjvbdLLBIWAKZ",
+    "DoCkKvbdgFlZmfgA",
+    "EPCjjvbdUVkoitAq",
+    "DoDKjvbdDncKjvcE",
+    "DoDLKvbdRpUHJfEX",
+    "EPDKjvbdLqvlzVQz",
+    "EPDKjvbdZMRdUOLm",
+    "EOcLKvbdCJLBkIfK",
+    "DncKjvbdaSFbhUFk",
+    "EPDLKvbdZoNheEzK",
+    "DncKjvbdUVlPjUAq",
+    "DnbkKvbdKNADyfuB",
+    "EObkKvbdZdwfzghb",
+    "EPDLKvbdZtIhxcrn",
+    "EObkKvbdGckViajK",
+    "DncLKvbdFfJqmiUR",
+    "DncKjvbdKWUfDdgJ",
+    "DoDKjvbdMtrqjmAX",
+    "EOcLKvbdsQWPKDVf",
+    "DoCjjvbdwtleRZMO",
+    "EObjjvbduaDxsPEh",
+    "EPDLKvbdKxqJrzuG",
+    "EOcKjvbdVAaprprZ",
+    "EObjjvbdEuxopMjF",
+    "DnbjjvbdyOTHwriD",
+    "EPDLKvbdrpVnibvG",
+    "EPDKjvbdkWWnDaww",
+    "DncLKvbdrXPkbiYq",
+    "DoDLKvbddxZssqez",
+    "EOcLKvbdHDkWJbJj",
+    "DncLKvbdEPCkLWcE",
+    "DnbkKvbdEXwkstTl",
+    "EObjjvbdqiAKEmOe",
+    "DncLKvbdjAQGaQGj",
+    "EPCjjvbdNeDtJJKd",
+    "EPCjjvbdvwMBWBVu",
+    "EPDKjvbdFejSOItR",
+    "EOcLKvbdNPwqWOHT",
+    "EPDKjvbdbsCjscia",
+    "EObkKvbdyYIiaoyk",
+    "DoDKjvbdLZQirzuG",
+    "EObjjvbdSLZGVGjs",
+    "DoCjjvbdAMgxsWzY",
+    "DoDLKvbdEObjjwCd",
+    "DnbkKvbdsPvOicWG",
+    "EPCkKvbdrJAKElne",
+    "EPCkKvbdauCGwjsh",
+    "DncLKvbdegkWRnQg",
+    "EPCkKvbdYpmEiNFR",
+    "DoDKjvbduaDxsPFI",
+    "DoCjjvbdcyxoxYqC",
+    "DoCkKvbdkMakzFHP",
+    "DnbjjvbdJbibqJbx",
+    "DnbkKvbdWWhxWDeH",
+    "DoCjjvbdssRsYzFD",
+    "DoDKjvbdpyPIHRDx",
+    "DncLKvbdwNWANDeN",
+    "DoDKjvbdJYUBglRQ",
+    "EObkKvbdXnRAYVVt",
+    "DoCjjvbdUWLpKTaR",
+    "DoDKjvbdTqROttgm",
+    "EPCkKvbdVqnXaeMD",
+    "EObjjvbdADRwiyiQ",
+    "DoDKjvbdlrZUyrci",
+    "EPDKjvbdvAdZSndh",
+    "DoCkKvbdzoQQeDLx",
+    "DnbkKvbdSQUGjFdX",
+    "EOcLKvbdqBJFAXIE",
+    "EObkKvbdSCEFLiZL",
+    "DnbjjvbdzoQQdcMY",
+    "DnbkKvbdpxngfqEY",
+    "DncLKvbdbsDLUEKB",
+    "DoCjjvbdXrlBMtOx",
+    "EObjjvbdKCjDQicY",
+    "DncLKvbdLrWlzUpz",
+    "EObjjvbdaaWEfQQX",
+    "EObjjvbdtlYWaTaX",
+    "DnbkKvbdMowpunGs",
+    "EObkKvbdSLYeuHKs",
+    "EObkKvbdTAEhhCOd",
+    "EPCkKvbdmSYtyrci",
+    "DncLKvbdYkqcsnLm",
+    "DoDLKvbdrylQTAgn",
+    "DncLKvbdJXtCIMRQ",
+    "EObkKvbdSBdElIyL",
+    "DoDLKvbdwygefYFS",
+    "DncKjvbdyXhibPzL",
+    "EPCjjvbduaDxsPFI",
+    "EObjjvbdZoNiFEzK",
+    "EPCjjvbdkNBkyeHP",
+    "EPCkKvbdWRnXadlD",
+    "DncLKvbdRWmdDLhD",
+    "DnbkKvbdmSYtzTDi",
+    "EOcKjvbdkVwODbXw",
+    "DncLKvbdQlxCZOUz",
+    "EObjjvbdbhlijfXY",
+    "EOcLKvbdXmqAXtut",
+    "EOcLKvbdmbKXXnnV",
+    "DoDKjvbdkHgMFfOL",
+    "EPCkKvbdfekymgHA",
+    "DoCjjvbdeKKRvUzn",
+    "DoDKjvbdkHfkefNk",
+    "DoCjjvbdyqPMiKXA",
+    "DnbjjvbdUQqOtuIN",
+    "EOcKjvbdEPCkKwDE",
+    "DoDLKvbdZRNFIleR",
+    "DnbjjvbdRacdlJZL",
+    "EOcLKvbdTukoitAq",
+    "EOcLKvbdZLrDtOMN",
+    "EOcLKvbdgKfzcGAE",
+    "EObjjvbdzjVQQESt",
+    "EOcLKvbdcIlijevx",
+    "EOcKjvbdGKdsDHmV",
+    "DncLKvbdKkBHvAJy",
+    "EOcKjvbdZMRctOLm",
+    "EPCkKvbdADRxKZiQ",
+    "EObjjvbdDwxLsssl",
+    "EPDLKvbdUxgszLPO",
+    "EPCkKvbdSQTfiedX",
+    "EPCjjvbdNeEUJIkE",
+    "DoDLKvbdpyPHfqDx",
+    "DnbkKvbdyOShXsJD",
+    "DncLKvbdLiBkpxAS",
+    "DoDKjvbdaaWEepQX",
+    "DoCjjvbdWSOYBeLc",
+    "EOcKjvbdLFegbAqV",
+    "EPDKjvbdffLzOGgA",
+    "EObkKvbdFkErbglu",
+    "DncLKvbdiZuFlROG",
+    "DncKjvbdegkWRnQg",
+    "DoDLKvbdQdDApRDr",
+    "EOcLKvbdeYZtURez",
+    "EObjjvbdrXQLcIxq",
+    "DoDLKvbdxZhGGXeS",
+    "DoDLKvbdGGKSOItR",
+    "EObjjvbdjhHLfFnL",
+    "EOcLKvbdUQpoUuHm",
+    "DoCkKvbdXrlBNUPY",
+    "DoDKjvbdJXtCIMRQ",
+    "DnbkKvbdZMSDsnLm",
+    "DncKjvbdCTBDUGWr",
+    "DncKjvbdbhlikGXY",
+    "DoDKjvbdXmqAYVWU",
+    "DnbjjvbdliDsqVRa",
+    "DnbkKvbdmajXYOnV",
+    "EObjjvbdJpyePGNe",
+    "DnbkKvbdCTAcUGXS",
+    "DoDLKvbdCDpBVjNG",
+    "EOcLKvbdxwhiaoyk",
+    "DoDKjvbdxVNFQyMO",
+    "EPCkKvbdVvhwvEEg",
+    "DnbkKvbdFWYoomJe",
+    "EOcKjvbdlrZUysEJ",
+    "EPDKjvbdqquKnKaN",
+    "DoCkKvbdTkunaVoJ",
+    "EOcLKvbdfHkVrOQg",
+    "EPDLKvbdiUzFWrUb",
+    "DoDLKvbdtAGqIABS",
+    "DoCkKvbdZRMdhmEq",
+    "DnbkKvbdNsUVfeVQ",
+    "EPDLKvbdqwPkbiZR",
+    "DoCkKvbdNUsSLNAX",
+    "DncKjvbdmpZxvKyC",
+    "EPCkKvbdLYqKSztf",
+    "EPDKjvbdZyEKODMS",
+    "EPDKjvbdNGbomPuL",
+    "DncKjvbdZMSDtNlN",
+    "EPCjjvbdTXjkmzjx",
+    "EObkKvbdBdQAvKMf",
+    "EOcLKvbdkySrTYgU",
+    "DnbkKvbdZoOIddzK",
+    "DoCkKvbdZMSDsmkm",
+    "EPCkKvbdCWzdIdpW",
+    "DncLKvbdBvzdIdov",
+    "DoCjjvbdaRfDHtFk",
+    "DnbkKvbdWeyZtAOs",
+    "DoDLKvbdnCJwYPOV",
+    "DoCjjvbdEYYLstUM",
+    "EOcLKvbdwtldqZMO",
+    "EPCjjvbdFVxoomKF",
+    "EObkKvbdyqPMhiwA",
+    "DoDLKvbdkxrrSxgU",
+    "DoCjjvbdeATqNYKG",
+    "DncLKvbdJKEAJpHE",
+    "DoCkKvbddndsLUTr",
+    "DnbjjvbdqFceUWBI",
+    "DoDLKvbdhkddOUby",
+    "DncKjvbdGKdrcIMu",
+    "EPCkKvbdelevflik",
+    "DoDKjvbdhaoDFWqR",
+    "DoCjjvbdYlSDsmlN",
+    "EPCjjvbdiZuGLpmf",
+    "EObkKvbdnCJvxPNu",
+    "DnbkKvbdhzUelRNf",
+    "DnbkKvbdZeYGzgiC",
+    "DoCkKvbdDnbkLWbd",
+    "DnbkKvbdnHFYMmfy",
+    "DoCjjvbdePEsKtTr",
+    "DnbjjvbdZQmEhleR",
+    "DnbkKvbdTkunaVoJ",
+    "DnbkKvbdFWZPpMjF",
+    "DoDKjvbdSwkMNzkY",
+    "EOcLKvbdwtldpyMO",
+    "EOcKjvbdhkdcmtby",
+    "DoCjjvbdNQXqWNfs",
+    "EP