changeset 25037:aab9af9818ae

Merge
author prr
date Tue, 27 May 2014 13:57:42 -0700
parents b199d4267ef0 74eb0778e4f2
children cb2bdbbfbb2d
files hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciReceiverTypeData.java hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciVirtualCallData.java hotspot/src/share/vm/libadt/port.cpp hotspot/src/share/vm/libadt/port.hpp hotspot/test/runtime/7110720/Test7110720.sh hotspot/test/runtime/SharedArchiveFile/CdsWriteError.java hotspot/test/testlibrary/com/oracle/java/testlibrary/DynamicVMOptionChecker.java hotspot/test/testlibrary/com/oracle/java/testlibrary/TestDynamicVMOption.java jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Makefile.inc jaxp/src/com/sun/org/apache/xalan/internal/xsltc/javax.xml.transform.TransformerFactory jaxp/src/com/sun/org/apache/xerces/internal/dom/org.apache.xerces.dom.DOMImplementationSourceImpl jaxp/src/com/sun/org/apache/xerces/internal/dom/org.w3c.dom.DOMImplementationSourceList jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/javax.xml.datatype.DatatypeFactory jaxp/src/com/sun/org/apache/xerces/internal/jaxp/javax.xml.parsers.DocumentBuilderFactory jaxp/src/com/sun/org/apache/xerces/internal/jaxp/javax.xml.parsers.SAXParserFactory jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/javax.xml.validation.SchemaFactory jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.DTDConfiguration jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XML11Configuration jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XMLParserConfiguration jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.xml.sax.driver jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLEventFactory jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLInputFactory jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLOutputFactory jaxp/src/org/xml/sax/COPYING jaxp/src/org/xml/sax/COPYING.txt jaxws/src/share/jaxws_classes/com/sun/tools/etc/META-INF/services/com.sun.xml.internal.ws.spi.db.BindingContextFactory jaxws/src/share/jaxws_classes/com/sun/tools/internal/jxc/gen/config/config.rng jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/bindingfile.rng jaxws/src/share/jaxws_classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/binding.rng jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/xmlschema-for-jaxb.rng jaxws/src/share/jaxws_classes/com/sun/xml/internal/rngom/parse/compact/CompactSyntax.jj jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/pacakge-info.java jdk/src/share/classes/com/sun/pept/Delegate.java jdk/src/share/classes/com/sun/pept/encoding/Decoder.java jdk/src/share/classes/com/sun/pept/encoding/Encoder.java jdk/src/share/classes/com/sun/pept/ept/Acceptor.java jdk/src/share/classes/com/sun/pept/ept/ContactInfo.java jdk/src/share/classes/com/sun/pept/ept/ContactInfoList.java jdk/src/share/classes/com/sun/pept/ept/ContactInfoListIterator.java jdk/src/share/classes/com/sun/pept/ept/EPTFactory.java jdk/src/share/classes/com/sun/pept/ept/MessageInfo.java jdk/src/share/classes/com/sun/pept/presentation/MessageStruct.java jdk/src/share/classes/com/sun/pept/presentation/Stub.java jdk/src/share/classes/com/sun/pept/presentation/TargetFinder.java jdk/src/share/classes/com/sun/pept/presentation/Tie.java jdk/src/share/classes/com/sun/pept/protocol/Interceptors.java jdk/src/share/classes/com/sun/pept/protocol/MessageDispatcher.java jdk/src/share/classes/com/sun/pept/transport/Connection.java jdk/src/share/classes/com/sun/tools/hat/MANIFEST.mf jdk/src/share/classes/com/sun/tools/hat/README.txt jdk/src/share/classes/com/sun/tools/hat/build.xml jdk/src/share/classes/sun/awt/image/MultiResolutionBufferedImage.java jdk/src/share/classes/sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine jdk/src/share/classes/sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider jdk/src/share/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine jdk/src/share/classes/sun/misc/ThreadGroupUtils.java jdk/src/solaris/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine jdk/src/solaris/native/sun/awt/awt_Plugin.c jdk/src/solaris/native/sun/awt/awt_Plugin.h langtools/src/share/classes/com/sun/tools/javadoc/JavadocClassReader.java langtools/test/tools/javac/inference/EagerReturnTypeResolution/EagerReturnTypeResolutionTesta.java langtools/test/tools/javac/inference/EagerReturnTypeResolution/EagerReturnTypeResolutionTestb.java langtools/test/tools/javac/inference/EagerReturnTypeResolution/EagerReturnTypeResolutionTestb.out langtools/test/tools/javac/inference/EagerReturnTypeResolution/PrimitiveTypeBoxingTest.java langtools/test/tools/javac/inference/EagerReturnTypeResolution/PrimitiveTypeBoxingTest.out
diffstat 985 files changed, 25636 insertions(+), 14777 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri May 23 11:16:31 2014 -0700
+++ b/.hgtags	Tue May 27 13:57:42 2014 -0700
@@ -256,3 +256,4 @@
 0809c9a4d36e6291f1c4384604c4bbf29e975722 jdk9-b11
 0d1f816217dce5e72187f167cc1816080cbeb453 jdk9-b12
 1a30593dcb9802faec3b6edb24d86ca088594e4e jdk9-b13
+97932f6ad950ae5a73a9da5c96e6e58503ff646b jdk9-b14
--- a/README	Fri May 23 11:16:31 2014 -0700
+++ b/README	Tue May 27 13:57:42 2014 -0700
@@ -1,15 +1,15 @@
 README:
   This file should be located at the top of the OpenJDK Mercurial root
   repository. A full OpenJDK repository set (forest) should also include
-  the following 6 nested repositories:
-    "jdk", "hotspot", "langtools", "corba", "jaxws"  and "jaxp".
+  the following 7 nested repositories:
+    "jdk", "hotspot", "langtools", "nashorn", "corba", "jaxws"  and "jaxp".
 
   The root repository can be obtained with something like:
-    hg clone http://hg.openjdk.java.net/jdk8/jdk8 openjdk8
+    hg clone http://hg.openjdk.java.net/jdk9/jdk9 openjdk9
   
   You can run the get_source.sh script located in the root repository to get
   the other needed repositories:
-    cd openjdk8 && sh ./get_source.sh
+    cd openjdk9 && sh ./get_source.sh
 
   People unfamiliar with Mercurial should read the first few chapters of
   the Mercurial book: http://hgbook.red-bean.com/read/
@@ -19,9 +19,9 @@
 Simple Build Instructions:
   
   0. Get the necessary system software/packages installed on your system, see
-     http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html
+     http://hg.openjdk.java.net/jdk9/jdk9/raw-file/tip/README-builds.html
 
-  1. If you don't have a jdk7u7 or newer jdk, download and install it from
+  1. If you don't have a jdk8 or newer jdk, download and install it from
      http://java.sun.com/javase/downloads/index.jsp
      Add the /bin directory of this installation to your PATH environment
      variable.
@@ -37,4 +37,4 @@
 is 3.81 or newer. Note that on Solaris, GNU make is called "gmake".
 
 Complete details are available in the file:
-     http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html
+     http://hg.openjdk.java.net/jdk9/jdk9/raw-file/tip/README-builds.html
--- a/corba/.hgtags	Fri May 23 11:16:31 2014 -0700
+++ b/corba/.hgtags	Tue May 27 13:57:42 2014 -0700
@@ -256,3 +256,4 @@
 77ea0a2503582a28e4e66be7239a49a0d1dd313f jdk9-b11
 e212cdcc8c11f0ba5acf6f5ddb596c4c545a93f9 jdk9-b12
 088eec4c36f4d7f250fcd19c4969bf698e3d2cdc jdk9-b13
+a2b82f863ba95a596da555a4c1b871c404863e7e jdk9-b14
--- a/hotspot/.hgtags	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/.hgtags	Tue May 27 13:57:42 2014 -0700
@@ -416,3 +416,4 @@
 783309c3a1a629a452673399dcfa83ef7eca94d8 jdk9-b11
 1c383bb39e2849ca62cb763f4e182a29b421d60a jdk9-b12
 456ad9c99133803d4e1433124c85a6fd141b9ac9 jdk9-b13
+bd333491bb6c012d7b606939406d0fa9a5ac7ffd jdk9-b14
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java	Tue May 27 13:57:42 2014 -0700
@@ -64,7 +64,11 @@
   }
 
   public Compile compilerData() {
-    return new Compile(compilerDataField.getValue(this.getAddress()));
+    Address addr = compilerDataField.getValue(this.getAddress());
+    if (addr == null) {
+      return null;
+    }
+    return new Compile(addr);
   }
 
   public ciObjectFactory factory() {
@@ -94,10 +98,7 @@
     Method method = task.method();
     int entryBci = task.osrBci();
     int compLevel = task.compLevel();
-    Klass holder = method.getMethodHolder();
-    out.print("compile " + holder.getName().asString() + " " +
-              OopUtilities.escapeString(method.getName().asString()) + " " +
-              method.getSignature().asString() + " " +
+    out.print("compile " + method.nameAsAscii() + " " +
               entryBci + " " + compLevel);
     Compile compiler = compilerData();
     if (compiler != null) {
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciKlass.java	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciKlass.java	Tue May 27 13:57:42 2014 -0700
@@ -55,4 +55,9 @@
   public ciKlass(Address addr) {
     super(addr);
   }
+
+  public void printValueOn(PrintStream tty) {
+    Klass k = (Klass)getMetadata();
+    k.printValueOn(tty);
+  }
 }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java	Tue May 27 13:57:42 2014 -0700
@@ -90,17 +90,23 @@
   }
 
   public void dumpReplayData(PrintStream out) {
-      Method method = (Method)getMetadata();
-      NMethod nm = method.getNativeMethod();
-      Klass holder = method.getMethodHolder();
-      out.println("ciMethod " +
-                  holder.getName().asString() + " " +
-                  OopUtilities.escapeString(method.getName().asString()) + " " +
-                  method.getSignature().asString() + " " +
-                  method.getInvocationCount() + " " +
-                  method.getBackedgeCount() + " " +
-                  interpreterInvocationCount() + " " +
-                  interpreterThrowoutCount() + " " +
-                  instructionsSize());
+    Method method = (Method)getMetadata();
+    NMethod nm = method.getNativeMethod();
+    out.println("ciMethod " +
+                nameAsAscii() + " " +
+                method.getInvocationCount() + " " +
+                method.getBackedgeCount() + " " +
+                interpreterInvocationCount() + " " +
+                interpreterThrowoutCount() + " " +
+                instructionsSize());
+  }
+
+  public void printValueOn(PrintStream tty) {
+    tty.print("ciMethod " + method().getName().asString() + method().getSignature().asString() + "@" + getAddress());
+  }
+
+  public String nameAsAscii() {
+    Method method = (Method)getMetadata();
+    return method.nameAsAscii();
   }
 }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodData.java	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodData.java	Tue May 27 13:57:42 2014 -0700
@@ -31,7 +31,7 @@
 import sun.jvm.hotspot.oops.*;
 import sun.jvm.hotspot.types.*;
 
-public class ciMethodData extends ciMetadata {
+public class ciMethodData extends ciMetadata implements MethodDataInterface<ciKlass,ciMethod> {
   static {
     VM.registerVMInitializedObserver(new Observer() {
         public void update(Observable o, Object data) {
@@ -54,7 +54,9 @@
     extraDataSizeField = new CIntField(type.getCIntegerField("_extra_data_size"), 0);
     dataSizeField = new CIntField(type.getCIntegerField("_data_size"), 0);
     stateField = new CIntField(type.getCIntegerField("_state"), 0);
-    sizeofMethodDataOopDesc = (int)db.lookupType("MethodData").getSize();;
+    Type typeMethodData = db.lookupType("MethodData");
+    sizeofMethodDataOopDesc = (int)typeMethodData.getSize();
+    parametersTypeDataDi = new CIntField(typeMethodData.getCIntegerField("_parameters_type_data_di"), 0);
   }
 
   private static AddressField origField;
@@ -69,11 +71,28 @@
   private static CIntField dataSizeField;
   private static CIntField stateField;
   private static int sizeofMethodDataOopDesc;
+  private static CIntField parametersTypeDataDi;
 
   public ciMethodData(Address addr) {
     super(addr);
   }
 
+  public ciKlass getKlassAtAddress(Address addr) {
+    return (ciKlass)ciObjectFactory.getMetadata(addr);
+  }
+
+  public ciMethod getMethodAtAddress(Address addr) {
+    return (ciMethod)ciObjectFactory.getMetadata(addr);
+  }
+
+  public void printKlassValueOn(ciKlass klass, PrintStream st) {
+    klass.printValueOn(st);
+  }
+
+  public void printMethodValueOn(ciMethod method, PrintStream st) {
+    method.printValueOn(st);
+  }
+
   private byte[] fetchDataAt(Address base, long size) {
     byte[] result = new byte[(int)size];
     for (int i = 0; i < size; i++) {
@@ -110,6 +129,10 @@
     return (int)dataSizeField.getValue(getAddress());
   }
 
+  int extraDataSize() {
+    return (int)extraDataSizeField.getValue(getAddress());
+  }
+
   int state() {
     return (int)stateField.getValue(getAddress());
   }
@@ -122,6 +145,16 @@
     return dataIndex >= dataSize();
   }
 
+  ParametersTypeData<ciKlass,ciMethod> parametersTypeData() {
+    Address base = getAddress().addOffsetTo(origField.getOffset());
+    int di = (int)parametersTypeDataDi.getValue(base);
+    if (di == -1) {
+      return null;
+    }
+    DataLayout dataLayout = new DataLayout(dataField.getValue(getAddress()), di);
+    return new ParametersTypeData<ciKlass,ciMethod>(this, dataLayout);
+  }
+
   ProfileData dataAt(int dataIndex) {
     if (outOfBounds(dataIndex)) {
       return null;
@@ -139,15 +172,21 @@
     case DataLayout.jumpDataTag:
       return new JumpData(dataLayout);
     case DataLayout.receiverTypeDataTag:
-      return new ciReceiverTypeData(dataLayout);
+      return new ReceiverTypeData<ciKlass,ciMethod>(this, dataLayout);
     case DataLayout.virtualCallDataTag:
-      return new ciVirtualCallData(dataLayout);
+      return new VirtualCallData<ciKlass,ciMethod>(this, dataLayout);
     case DataLayout.retDataTag:
       return new RetData(dataLayout);
     case DataLayout.branchDataTag:
       return new BranchData(dataLayout);
     case DataLayout.multiBranchDataTag:
       return new MultiBranchData(dataLayout);
+    case DataLayout.callTypeDataTag:
+      return new CallTypeData<ciKlass,ciMethod>(this, dataLayout);
+    case DataLayout.virtualCallTypeDataTag:
+      return new VirtualCallTypeData<ciKlass,ciMethod>(this, dataLayout);
+    case DataLayout.parametersTypeDataTag:
+      return new ParametersTypeData<ciKlass,ciMethod>(this, dataLayout);
     }
   }
 
@@ -164,7 +203,23 @@
   }
   boolean isValid(ProfileData current) { return current != null; }
 
+  DataLayout limitDataPosition() {
+    return new DataLayout(dataField.getValue(getAddress()), dataSize());
+  }
+  DataLayout extraDataBase() {
+    return limitDataPosition();
+  }
+  DataLayout extraDataLimit() {
+    return new DataLayout(dataField.getValue(getAddress()), dataSize() + extraDataSize());
+  }
+  DataLayout nextExtra(DataLayout dataLayout) {
+    return new DataLayout(dataField.getValue(getAddress()), dataLayout.dp() + DataLayout.computeSizeInBytes(MethodData.extraNbCells(dataLayout)));
+  }
+
   public void printDataOn(PrintStream st) {
+    if (parametersTypeData() != null) {
+      parametersTypeData().printDataOn(st);
+    }
     ProfileData data = firstData();
     for ( ; isValid(data); data = nextData(data)) {
       st.print(dpToDi(data.dp()));
@@ -172,16 +227,96 @@
       // st->fillTo(6);
       data.printDataOn(st);
     }
+    st.println("--- Extra data:");
+    DataLayout dp    = extraDataBase();
+    DataLayout end   = extraDataLimit();
+    for (;; dp = nextExtra(dp)) {
+      switch(dp.tag()) {
+      case DataLayout.noTag:
+        continue;
+      case DataLayout.bitDataTag:
+        data = new BitData(dp);
+        break;
+      case DataLayout.speculativeTrapDataTag:
+        data = new SpeculativeTrapData<ciKlass,ciMethod>(this, dp);
+        break;
+      case DataLayout.argInfoDataTag:
+        data = new ArgInfoData(dp);
+        dp = end; // ArgInfoData is at the end of extra data section.
+        break;
+      default:
+        throw new InternalError("unexpected tag " +  dp.tag());
+      }
+      st.print(dpToDi(data.dp()));
+      st.print(" ");
+      data.printDataOn(st);
+      if (dp == end) return;
+    }
+  }
+
+  int dumpReplayDataTypeHelper(PrintStream out, int round, int count, int index, ProfileData pdata, ciKlass k) {
+    if (k != null) {
+      if (round == 0) count++;
+      else out.print(" " + ((pdata.dp() + pdata.cellOffset(index)) / MethodData.cellSize) + " " + k.name());
+    }
+    return count;
+  }
+
+  int dumpReplayDataReceiverTypeHelper(PrintStream out, int round, int count, ReceiverTypeData<ciKlass,ciMethod> vdata) {
+    for (int i = 0; i < vdata.rowLimit(); i++) {
+      ciKlass k = vdata.receiver(i);
+      count = dumpReplayDataTypeHelper(out, round, count, vdata.receiverCellIndex(i), vdata, k);
+    }
+    return count;
+  }
+
+  int dumpReplayDataCallTypeHelper(PrintStream out, int round, int count, CallTypeDataInterface<ciKlass> callTypeData) {
+    if (callTypeData.hasArguments()) {
+      for (int i = 0; i < callTypeData.numberOfArguments(); i++) {
+        count = dumpReplayDataTypeHelper(out, round, count, callTypeData.argumentTypeIndex(i), (ProfileData)callTypeData, callTypeData.argumentType(i));
+      }
+    }
+    if (callTypeData.hasReturn()) {
+      count = dumpReplayDataTypeHelper(out, round, count, callTypeData.returnTypeIndex(), (ProfileData)callTypeData, callTypeData.returnType());
+    }
+    return count;
+  }
+
+  int dumpReplayDataExtraDataHelper(PrintStream out, int round, int count) {
+    DataLayout dp    = extraDataBase();
+    DataLayout end   = extraDataLimit();
+
+    for (;dp != end; dp = nextExtra(dp)) {
+      switch(dp.tag()) {
+      case DataLayout.noTag:
+      case DataLayout.argInfoDataTag:
+        return count;
+      case DataLayout.bitDataTag:
+        break;
+      case DataLayout.speculativeTrapDataTag: {
+        SpeculativeTrapData<ciKlass,ciMethod> data = new SpeculativeTrapData<ciKlass,ciMethod>(this, dp);
+        ciMethod m = data.method();
+        if (m != null) {
+          if (round == 0) {
+            count++;
+          } else {
+            out.print(" " +  (dpToDi(data.dp() + data.cellOffset(SpeculativeTrapData.methodIndex())) / MethodData.cellSize) + " " +  m.nameAsAscii());
+          }
+        }
+        break;
+      }
+      default:
+        throw new InternalError("bad tag "  + dp.tag());
+      }
+    }
+    return count;
   }
 
   public void dumpReplayData(PrintStream out) {
     MethodData mdo = (MethodData)getMetadata();
     Method method = mdo.getMethod();
-    Klass holder = method.getMethodHolder();
     out.print("ciMethodData " +
-              holder.getName().asString() + " " +
-              OopUtilities.escapeString(method.getName().asString()) + " " +
-              method.getSignature().asString() + " " +
+              method.nameAsAscii() + " " +
               state() + " " + currentMileage());
     byte[] orig = orig();
     out.print(" orig " + orig.length);
@@ -195,30 +330,28 @@
       out.print(" 0x" + Long.toHexString(data[i]));
     }
     int count = 0;
+    ParametersTypeData<ciKlass,ciMethod> parameters = parametersTypeData();
     for (int round = 0; round < 2; round++) {
       if (round == 1) out.print(" oops " + count);
       ProfileData pdata = firstData();
       for ( ; isValid(pdata); pdata = nextData(pdata)) {
-        if (pdata instanceof ciReceiverTypeData) {
-          ciReceiverTypeData vdata = (ciReceiverTypeData)pdata;
-          for (int i = 0; i < vdata.rowLimit(); i++) {
-            ciKlass k = vdata.receiverAt(i);
-            if (k != null) {
-              if (round == 0) count++;
-              else out.print(" " + ((vdata.dp() + vdata.cellOffset(vdata.receiverCellIndex(i))) / MethodData.cellSize) + " " + k.name());
-            }
-          }
-        } else if (pdata instanceof ciVirtualCallData) {
-          ciVirtualCallData vdata = (ciVirtualCallData)pdata;
-          for (int i = 0; i < vdata.rowLimit(); i++) {
-            ciKlass k = vdata.receiverAt(i);
-            if (k != null) {
-              if (round == 0) count++;
-              else out.print(" " + ((vdata.dp() + vdata.cellOffset(vdata.receiverCellIndex(i))) / MethodData.cellSize + " " + k.name()));
-            }
-          }
+        if (pdata instanceof ReceiverTypeData) {
+          count = dumpReplayDataReceiverTypeHelper(out, round, count, (ReceiverTypeData<ciKlass,ciMethod>)pdata);
+        }
+        if (pdata instanceof CallTypeDataInterface) {
+          count = dumpReplayDataCallTypeHelper(out, round, count, (CallTypeDataInterface<ciKlass>)pdata);
         }
       }
+      if (parameters != null) {
+        for (int i = 0; i < parameters.numberOfParameters(); i++) {
+          count = dumpReplayDataTypeHelper(out, round, count, ParametersTypeData.typeIndex(i), parameters, parameters.type(i));
+        }
+      }
+    }
+    count = 0;
+    for (int round = 0; round < 2; round++) {
+      if (round == 1) out.print(" methods " + count);
+      count = dumpReplayDataExtraDataHelper(out, round, count);
     }
     out.println();
   }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciReceiverTypeData.java	Fri May 23 11:16:31 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2011, 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.
- *
- */
-
-package sun.jvm.hotspot.ci;
-
-import java.io.*;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.oops.*;
-import sun.jvm.hotspot.types.*;
-
-public class ciReceiverTypeData extends ReceiverTypeData {
-  public ciReceiverTypeData(DataLayout data) {
-    super(data);
-  }
-
-  public Klass receiver(int row) {
-      throw new InternalError("should not call");
-  }
-
-  public ciKlass receiverAt(int row) {
-    //assert((uint)row < rowLimit(), "oob");
-    ciMetadata recv = ciObjectFactory.getMetadata(addressAt(receiverCellIndex(row)));
-    if (recv != null && !(recv instanceof ciKlass)) {
-      System.err.println(recv);
-    }
-    //assert(recv == NULL || recv->isKlass(), "wrong type");
-    return (ciKlass)recv;
-  }
-
-}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciVirtualCallData.java	Fri May 23 11:16:31 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2011, 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.
- *
- */
-
-package sun.jvm.hotspot.ci;
-
-import java.io.*;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.oops.*;
-import sun.jvm.hotspot.types.*;
-
-public class ciVirtualCallData extends VirtualCallData {
-  public ciVirtualCallData(DataLayout data) {
-    super(data);
-  }
-
-  public Klass receiver(int row) {
-      throw new InternalError("should not call");
-  }
-
-  public ciKlass receiverAt(int row) {
-    //assert((uint)row < rowLimit(), "oob");
-    ciMetadata recv = ciObjectFactory.getMetadata(addressAt(receiverCellIndex(row)));
-    if (recv != null && !(recv instanceof ciKlass)) {
-      System.err.println(recv);
-    }
-    //assert(recv == NULL || recv->isKlass(), "wrong type");
-    return (ciKlass)recv;
-  }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArgInfoData.java	Tue May 27 13:57:42 2014 -0700
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
+
+public class ArgInfoData extends ArrayData {
+
+  public ArgInfoData(DataLayout layout) {
+    super(layout);
+  }
+
+  int numberOfArgs() {
+    return arrayLen();
+  }
+
+  int argModified(int arg) {
+    return arrayUintAt(arg);
+  }
+
+  public void printDataOn(PrintStream st) {
+    printShared(st, "ArgInfoData");
+    int nargs = numberOfArgs();
+    for (int i = 0; i < nargs; i++) {
+      st.print("  0x" + Integer.toHexString(argModified(i)));
+    }
+    st.println();
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CallTypeData.java	Tue May 27 13:57:42 2014 -0700
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
+
+// CallTypeData
+//
+// A CallTypeData is used to access profiling information about a non
+// virtual call for which we collect type information about arguments
+// and return value.
+public class CallTypeData<K,M> extends CounterData implements CallTypeDataInterface<K> {
+  final TypeStackSlotEntries<K,M> args;
+  final ReturnTypeEntry<K,M> ret;
+
+  int cellCountGlobalOffset() {
+    return CounterData.staticCellCount() + TypeEntriesAtCall.cellCountLocalOffset();
+  }
+
+  int cellCountNoHeader() {
+    return uintAt(cellCountGlobalOffset());
+  }
+
+  public CallTypeData(MethodDataInterface<K,M> methodData, DataLayout layout) {
+    super(layout);
+    args = new TypeStackSlotEntries<K,M>(methodData, this, CounterData.staticCellCount()+TypeEntriesAtCall.headerCellCount(), numberOfArguments());
+    ret = new ReturnTypeEntry<K,M>(methodData, this, cellCount() - ReturnTypeEntry.staticCellCount());
+  }
+
+  static int staticCellCount() {
+    return -1;
+  }
+
+  public int cellCount() {
+    return CounterData.staticCellCount() +
+      TypeEntriesAtCall.headerCellCount() +
+      intAt(cellCountGlobalOffset());
+  }
+
+  public int numberOfArguments() {
+    return cellCountNoHeader() / TypeStackSlotEntries.perArgCount();
+  }
+
+  public boolean hasArguments() {
+    return cellCountNoHeader() >= TypeStackSlotEntries.perArgCount();
+  }
+
+  public K argumentType(int i) {
+    return args.type(i);
+  }
+
+  public boolean hasReturn() {
+    return (cellCountNoHeader() % TypeStackSlotEntries.perArgCount()) != 0;
+  }
+
+  public K returnType() {
+    return ret.type();
+  }
+
+  public int argumentTypeIndex(int i) {
+    return args.typeIndex(i);
+  }
+
+  public int returnTypeIndex() {
+    return ret.typeIndex();
+  }
+
+  public void printDataOn(PrintStream st) {
+    super.printDataOn(st);
+    if (hasArguments()) {
+      tab(st);
+      st.print("argument types");
+      args.printDataOn(st);
+    }
+    if (hasReturn()) {
+      tab(st);
+      st.print("return type");
+      ret.printDataOn(st);
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CallTypeDataInterface.java	Tue May 27 13:57:42 2014 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+public interface CallTypeDataInterface<K> {
+  int numberOfArguments();
+  boolean hasArguments();
+  K argumentType(int i);
+  boolean hasReturn();
+  K returnType();
+  int argumentTypeIndex(int i);
+  int returnTypeIndex();
+}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DataLayout.java	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DataLayout.java	Tue May 27 13:57:42 2014 -0700
@@ -41,6 +41,11 @@
   public static final int retDataTag = 6;
   public static final int branchDataTag = 7;
   public static final int multiBranchDataTag = 8;
+  public static final int argInfoDataTag = 9;
+  public static final int callTypeDataTag = 10;
+  public static final int virtualCallTypeDataTag = 11;
+  public static final int parametersTypeDataTag = 12;
+  public static final int speculativeTrapDataTag = 13;
 
   // The _struct._flags word is formatted as [trapState:4 | flags:4].
   // The trap state breaks down further as [recompile:1 | reason:3].
@@ -61,8 +66,6 @@
 
   private int offset;
 
-  private boolean handlized;
-
   public DataLayout(MethodData d, int o) {
     data = d.getAddress();
     offset = o;
@@ -71,7 +74,6 @@
   public DataLayout(Address d, int o) {
     data = d;
     offset = o;
-    handlized = true;
   }
 
   public int dp() { return offset; }
@@ -90,12 +92,7 @@
   }
 
   public Address addressAt(int index) {
-    OopHandle handle;
-    if (handlized) {
-      return data.getAddressAt(offset + cellOffset(index));
-    } else {
-      return data.getOopHandleAt(offset + cellOffset(index));
-    }
+    return data.getAddressAt(offset + cellOffset(index));
   }
 
   // Every data layout begins with a header.  This header
@@ -128,7 +125,7 @@
     return 1;
   }
 
-  static int computeSizeInBytes(int cellCount) {
+  static public int computeSizeInBytes(int cellCount) {
     return headerSizeInBytes() + cellCount * MethodData.cellSize;
   }
 
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java	Tue May 27 13:57:42 2014 -0700
@@ -354,9 +354,7 @@
       }
       Klass holder = getMethodHolder();
       out.println("ciMethod " +
-                  holder.getName().asString() + " " +
-                  OopUtilities.escapeString(getName().asString()) + " " +
-                  getSignature().asString() + " " +
+                  nameAsAscii() + " " +
                   getInvocationCount() + " " +
                   getBackedgeCount() + " " +
                   interpreterInvocationCount() + " " +
@@ -371,4 +369,10 @@
   public int interpreterInvocationCount() {
     return getMethodCounters().interpreterInvocationCount();
   }
+
+  public String nameAsAscii() {
+    return getMethodHolder().getName().asString() + " " +
+      OopUtilities.escapeString(getName().asString()) + " " +
+      getSignature().asString();
+  }
 }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java	Tue May 27 13:57:42 2014 -0700
@@ -33,7 +33,7 @@
 
 // A MethodData provides interpreter profiling information
 
-public class MethodData extends Metadata {
+public class MethodData extends Metadata implements MethodDataInterface<Klass,Method> {
   static int TypeProfileWidth = 2;
   static int BciProfileWidth = 2;
   static int CompileThreshold;
@@ -152,6 +152,8 @@
     dataSize     = new CIntField(type.getCIntegerField("_data_size"), 0);
     data         = type.getAddressField("_data[0]");
 
+    parametersTypeDataDi = new CIntField(type.getCIntegerField("_parameters_type_data_di"), 0);
+
     sizeofMethodDataOopDesc = (int)type.getSize();;
 
     Reason_many            = db.lookupIntConstant("Deoptimization::Reason_many").intValue();
@@ -191,6 +193,22 @@
     super(addr);
   }
 
+  public Klass getKlassAtAddress(Address addr) {
+    return (Klass)Metadata.instantiateWrapperFor(addr);
+  }
+
+  public Method getMethodAtAddress(Address addr) {
+    return (Method)Metadata.instantiateWrapperFor(addr);
+  }
+
+  public void printKlassValueOn(Klass klass, PrintStream st) {
+    klass.printValueOn(st);
+  }
+
+  public void printMethodValueOn(Method method, PrintStream st) {
+    method.printValueOn(st);
+  }
+
   public boolean isMethodData()        { return true; }
 
   private static long baseOffset;
@@ -198,7 +216,7 @@
   private static MetadataField  method;
   private static CIntField dataSize;
   private static AddressField data;
-
+  private static CIntField parametersTypeDataDi;
   public static int sizeofMethodDataOopDesc;
   public static int cellSize;
 
@@ -225,6 +243,27 @@
     }
   }
 
+  int sizeInBytes() {
+    if (size == null) {
+      return 0;
+    } else {
+      return (int)size.getValue(getAddress());
+    }
+  }
+
+  int size() {
+    return (int)Oop.alignObjectSize(VM.getVM().alignUp(sizeInBytes(), VM.getVM().getBytesPerWord())/VM.getVM().getBytesPerWord());
+  }
+
+  ParametersTypeData<Klass,Method> parametersTypeData() {
+    int di = (int)parametersTypeDataDi.getValue(getAddress());
+    if (di == -1) {
+      return null;
+    }
+    DataLayout dataLayout = new DataLayout(this, di + (int)data.getOffset());
+    return new ParametersTypeData<Klass,Method>(this, dataLayout);
+  }
+
   boolean outOfBounds(int dataIndex) {
     return dataIndex >= dataSize();
   }
@@ -246,15 +285,21 @@
     case DataLayout.jumpDataTag:
       return new JumpData(dataLayout);
     case DataLayout.receiverTypeDataTag:
-      return new ReceiverTypeData(dataLayout);
+      return new ReceiverTypeData<Klass,Method>(this, dataLayout);
     case DataLayout.virtualCallDataTag:
-      return new VirtualCallData(dataLayout);
+      return new VirtualCallData<Klass,Method>(this, dataLayout);
     case DataLayout.retDataTag:
       return new RetData(dataLayout);
     case DataLayout.branchDataTag:
       return new BranchData(dataLayout);
     case DataLayout.multiBranchDataTag:
       return new MultiBranchData(dataLayout);
+    case DataLayout.callTypeDataTag:
+      return new CallTypeData<Klass,Method>(this, dataLayout);
+    case DataLayout.virtualCallTypeDataTag:
+      return new VirtualCallTypeData<Klass,Method>(this, dataLayout);
+    case DataLayout.parametersTypeDataTag:
+      return new ParametersTypeData<Klass,Method>(this, dataLayout);
     }
   }
 
@@ -272,7 +317,42 @@
   }
   boolean isValid(ProfileData current) { return current != null; }
 
+  DataLayout limitDataPosition() {
+    return new DataLayout(this, dataSize() + (int)data.getOffset());
+  }
+
+  DataLayout extraDataBase() {
+    return limitDataPosition();
+  }
+
+  DataLayout extraDataLimit() {
+    return new DataLayout(this, sizeInBytes());
+  }
+
+  static public int extraNbCells(DataLayout dataLayout) {
+    int nbCells = 0;
+    switch(dataLayout.tag()) {
+    case DataLayout.bitDataTag:
+    case DataLayout.noTag:
+      nbCells = BitData.staticCellCount();
+      break;
+    case DataLayout.speculativeTrapDataTag:
+      nbCells = SpeculativeTrapData.staticCellCount();
+      break;
+    default:
+      throw new InternalError("unexpected tag " +  dataLayout.tag());
+    }
+    return nbCells;
+  }
+
+  DataLayout nextExtra(DataLayout dataLayout) {
+    return new DataLayout(this, dataLayout.dp() + DataLayout.computeSizeInBytes(extraNbCells(dataLayout)));
+  }
+
   public void printDataOn(PrintStream st) {
+    if (parametersTypeData() != null) {
+      parametersTypeData().printDataOn(st);
+    }
     ProfileData data = firstData();
     for ( ; isValid(data); data = nextData(data)) {
       st.print(dpToDi(data.dp()));
@@ -280,6 +360,31 @@
       // st->fillTo(6);
       data.printDataOn(st);
     }
+    st.println("--- Extra data:");
+    DataLayout dp    = extraDataBase();
+    DataLayout end   = extraDataLimit();
+    for (;; dp = nextExtra(dp)) {
+      switch(dp.tag()) {
+      case DataLayout.noTag:
+        continue;
+      case DataLayout.bitDataTag:
+        data = new BitData(dp);
+        break;
+      case DataLayout.speculativeTrapDataTag:
+        data = new SpeculativeTrapData<Klass,Method>(this, dp);
+        break;
+      case DataLayout.argInfoDataTag:
+        data = new ArgInfoData(dp);
+        dp = end; // ArgInfoData is at the end of extra data section.
+        break;
+      default:
+        throw new InternalError("unexpected tag " +  dp.tag());
+      }
+      st.print(dpToDi(data.dp()));
+      st.print(" ");
+      data.printDataOn(st);
+      if (dp == end) return;
+    }
   }
 
   private byte[] fetchDataAt(Address base, long offset, long size) {
@@ -332,14 +437,71 @@
     return 20000;
   }
 
+  int dumpReplayDataTypeHelper(PrintStream out, int round, int count, int index, ProfileData pdata, Klass k) {
+    if (k != null) {
+      if (round == 0) count++;
+      else out.print(" " +
+                     (dpToDi(pdata.dp() +
+                             pdata.cellOffset(index)) / cellSize) + " " +
+                     k.getName().asString());
+    }
+    return count;
+  }
+
+  int dumpReplayDataReceiverTypeHelper(PrintStream out, int round, int count, ReceiverTypeData<Klass,Method> vdata) {
+    for (int i = 0; i < vdata.rowLimit(); i++) {
+      Klass k = vdata.receiver(i);
+      count = dumpReplayDataTypeHelper(out, round, count, vdata.receiverCellIndex(i), vdata, k);
+    }
+    return count;
+  }
+
+  int dumpReplayDataCallTypeHelper(PrintStream out, int round, int count, CallTypeDataInterface<Klass> callTypeData) {
+    if (callTypeData.hasArguments()) {
+      for (int i = 0; i < callTypeData.numberOfArguments(); i++) {
+        count = dumpReplayDataTypeHelper(out, round, count, callTypeData.argumentTypeIndex(i), (ProfileData)callTypeData, callTypeData.argumentType(i));
+      }
+    }
+    if (callTypeData.hasReturn()) {
+      count = dumpReplayDataTypeHelper(out, round, count, callTypeData.returnTypeIndex(), (ProfileData)callTypeData, callTypeData.returnType());
+    }
+    return count;
+  }
+
+  int dumpReplayDataExtraDataHelper(PrintStream out, int round, int count) {
+    DataLayout dp    = extraDataBase();
+    DataLayout end   = extraDataLimit();
+
+    for (;dp != end; dp = nextExtra(dp)) {
+      switch(dp.tag()) {
+      case DataLayout.noTag:
+      case DataLayout.argInfoDataTag:
+        return count;
+      case DataLayout.bitDataTag:
+        break;
+      case DataLayout.speculativeTrapDataTag: {
+        SpeculativeTrapData<Klass,Method> data = new SpeculativeTrapData<Klass,Method>(this, dp);
+        Method m = data.method();
+        if (m != null) {
+          if (round == 0) {
+            count++;
+          } else {
+            out.print(" " +  (dpToDi(data.dp() + data.cellOffset(SpeculativeTrapData.methodIndex())) / cellSize) + " " +  m.nameAsAscii());
+          }
+        }
+        break;
+      }
+      default:
+        throw new InternalError("bad tag "  + dp.tag());
+      }
+    }
+    return count;
+  }
+
   public void dumpReplayData(PrintStream out) {
     Method method = getMethod();
-    Klass holder = method.getMethodHolder();
-    out.print("ciMethodData " +
-              holder.getName().asString() + " " +
-              OopUtilities.escapeString(method.getName().asString()) + " " +
-              method.getSignature().asString() + " " +
-              "2" + " " +
+    out.print("ciMethodData " + method.nameAsAscii()
+              + " " + "2" + " " +
               currentMileage());
     byte[] orig = orig();
     out.print(" orig " + orig.length);
@@ -353,36 +515,28 @@
       out.print(" 0x" + Long.toHexString(data[i]));
     }
     int count = 0;
+    ParametersTypeData<Klass,Method> parameters = parametersTypeData();
     for (int round = 0; round < 2; round++) {
       if (round == 1) out.print(" oops " + count);
       ProfileData pdata = firstData();
       for ( ; isValid(pdata); pdata = nextData(pdata)) {
         if (pdata instanceof ReceiverTypeData) {
-          ReceiverTypeData vdata = (ReceiverTypeData)pdata;
-          for (int i = 0; i < vdata.rowLimit(); i++) {
-            Klass k = vdata.receiver(i);
-            if (k != null) {
-              if (round == 0) count++;
-              else out.print(" " +
-                             (dpToDi(vdata.dp() +
-                              vdata.cellOffset(vdata.receiverCellIndex(i))) / cellSize) + " " +
-                             k.getName().asString());
-            }
-          }
-        } else if (pdata instanceof VirtualCallData) {
-          VirtualCallData vdata = (VirtualCallData)pdata;
-          for (int i = 0; i < vdata.rowLimit(); i++) {
-            Klass k = vdata.receiver(i);
-            if (k != null) {
-              if (round == 0) count++;
-              else out.print(" " +
-                             (dpToDi(vdata.dp() +
-                              vdata.cellOffset(vdata.receiverCellIndex(i))) / cellSize) + " " +
-                             k.getName().asString());
-            }
-          }
+          count = dumpReplayDataReceiverTypeHelper(out, round, count, (ReceiverTypeData<Klass,Method>)pdata);
+        }
+        if (pdata instanceof CallTypeDataInterface) {
+          count = dumpReplayDataCallTypeHelper(out, round, count, (CallTypeDataInterface<Klass>)pdata);
         }
       }
+      if (parameters != null) {
+        for (int i = 0; i < parameters.numberOfParameters(); i++) {
+          count = dumpReplayDataTypeHelper(out, round, count, ParametersTypeData.typeIndex(i), parameters, parameters.type(i));
+        }
+      }
+    }
+    count = 0;
+    for (int round = 0; round < 2; round++) {
+      if (round == 1) out.print(" methods " + count);
+      count = dumpReplayDataExtraDataHelper(out, round, count);
     }
     out.println();
   }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodDataInterface.java	Tue May 27 13:57:42 2014 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
+
+public interface MethodDataInterface<K, M> {
+  K getKlassAtAddress(Address addr);
+  M getMethodAtAddress(Address addr);
+  void printKlassValueOn(K klass, PrintStream st);
+  void printMethodValueOn(M klass, PrintStream st);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ParametersTypeData.java	Tue May 27 13:57:42 2014 -0700
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
+
+// ParametersTypeData
+//
+// A ParametersTypeData is used to access profiling information about
+// types of parameters to a method
+public class ParametersTypeData<K,M> extends ArrayData {
+  final TypeStackSlotEntries<K,M> parameters;
+
+  static int stackSlotLocalOffset(int i) {
+    return arrayStartOffSet + TypeStackSlotEntries.stackSlotLocalOffset(i);
+  }
+
+  static int typeLocalOffset(int i) {
+    return arrayStartOffSet + TypeStackSlotEntries.typeLocalOffset(i);
+  }
+
+  public ParametersTypeData(MethodDataInterface<K,M> methodData, DataLayout layout) {
+    super(layout);
+    parameters = new TypeStackSlotEntries<K,M>(methodData, this, 1, numberOfParameters());
+  }
+
+  public int numberOfParameters() {
+    return arrayLen() / TypeStackSlotEntries.perArgCount();
+  }
+
+  int stackSlot(int i) {
+    return parameters.stackSlot(i);
+  }
+
+  public K type(int i) {
+    return parameters.type(i);
+  }
+
+  static public int typeIndex(int i) {
+    return typeLocalOffset(i);
+  }
+
+  public void printDataOn(PrintStream st) {
+    st.print("parameter types");
+    parameters.printDataOn(st);
+  }
+}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java	Tue May 27 13:57:42 2014 -0700
@@ -37,13 +37,15 @@
 // dynamic type check.  It consists of a counter which counts the total times
 // that the check is reached, and a series of (Klass, count) pairs
 // which are used to store a type profile for the receiver of the check.
-public class ReceiverTypeData extends CounterData {
+public class ReceiverTypeData<K,M> extends CounterData {
   static final int   receiver0Offset = counterCellCount;
   static final int     count0Offset = receiver0Offset + 1;
   static final int     receiverTypeRowCellCount = (count0Offset + 1) - receiver0Offset;
+  final MethodDataInterface<K,M> methodData;
 
-  public ReceiverTypeData(DataLayout layout) {
+  public ReceiverTypeData(MethodDataInterface<K,M> methodData, DataLayout layout) {
     super(layout);
+    this.methodData = methodData;
     //assert(layout.tag() == DataLayout.receiverTypeDataTag ||
     //       layout.tag() == DataLayout.virtualCallDataTag, "wrong type");
   }
@@ -73,14 +75,14 @@
   // gc; it does not assert the receiver is a klass.  During compaction of the
   // perm gen, the klass may already have moved, so the isKlass() predicate
   // would fail.  The 'normal' version should be used whenever possible.
-  Klass receiverUnchecked(int row) {
+  K receiverUnchecked(int row) {
     //assert(row < rowLimit(), "oob");
     Address recv = addressAt(receiverCellIndex(row));
-    return (Klass)Metadata.instantiateWrapperFor(recv);
+    return methodData.getKlassAtAddress(recv);
   }
 
-  public Klass receiver(int row) {
-    Klass recv = receiverUnchecked(row);
+  public K receiver(int row) {
+    K recv = receiverUnchecked(row);
     //assert(recv == NULL || ((oop)recv).isKlass(), "wrong type");
     return recv;
   }
@@ -111,7 +113,7 @@
     for (row = 0; row < rowLimit(); row++) {
       if (receiver(row) != null) {
         tab(st);
-        receiver(row).printValueOn(st);
+        methodData.printKlassValueOn(receiver(row), st);
         st.println("(" + receiverCount(row) + ")");
       }
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ReturnTypeEntry.java	Tue May 27 13:57:42 2014 -0700
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
+
+// Type entry used for return from a call. A single cell to record the
+// type.
+public class ReturnTypeEntry<K,M> extends TypeEntries<K,M> {
+  static final int cellCount = 1;
+
+  ReturnTypeEntry(MethodDataInterface<K,M> methodData, ProfileData pd, int baseOff) {
+    super(methodData, pd, baseOff);
+  }
+
+  K type() {
+    return validKlass(baseOff);
+  }
+
+  static int staticCellCount() {
+    return cellCount;
+  }
+
+  int typeIndex() {
+    return baseOff;
+  }
+
+  void printDataOn(PrintStream st) {
+    pd.tab(st);
+    printKlass(st, baseOff);
+    st.println();
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/SpeculativeTrapData.java	Tue May 27 13:57:42 2014 -0700
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
+
+// SpeculativeTrapData
+//
+// A SpeculativeTrapData is used to record traps due to type
+// speculation. It records the root of the compilation.
+public class SpeculativeTrapData<K, M> extends ProfileData {
+  static final int speculativeTrapMethod = 0;
+  static final int speculativeTrapCellCount = 1;
+  final MethodDataInterface<K, M> methodData;
+
+  public SpeculativeTrapData(MethodDataInterface<K,M> methodData, DataLayout layout) {
+    super(layout);
+    this.methodData = methodData;
+  }
+
+  static int staticCellCount() {
+    return speculativeTrapCellCount;
+  }
+
+  public int cellCount() {
+    return staticCellCount();
+  }
+
+  public M method() {
+    return methodData.getMethodAtAddress(addressAt(speculativeTrapMethod));
+  }
+
+  static public int methodIndex() {
+    return speculativeTrapMethod;
+  }
+
+  public void printDataOn(PrintStream st) {
+    printShared(st, "SpeculativeTrapData");
+    tab(st);
+    methodData.printMethodValueOn(method(), st);
+    st.println();
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeEntries.java	Tue May 27 13:57:42 2014 -0700
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
+
+// Entries in a ProfileData object to record types: it can either be
+// none (no profile), unknown (conflicting profile data) or a klass if
+// a single one is seen. Whether a null reference was seen is also
+// recorded. No counter is associated with the type and a single type
+// is tracked (unlike VirtualCallData).
+public abstract class TypeEntries<K,M> {
+  static final int nullSeen = 1;
+  static final int typeMask = ~nullSeen;
+  static final int typeUnknown = 2;
+  static final int statusBits = nullSeen | typeUnknown;
+  static final int typeKlassMask = ~statusBits;
+
+  final ProfileData pd;
+  final int baseOff;
+  final MethodDataInterface<K,M> methodData;
+
+  boolean wasNullSeen(int index) {
+    int v = pd.intptrAt(index);
+    return (v & nullSeen) != 0;
+  }
+
+  boolean isTypeUnknown(int index) {
+    int v = pd.intptrAt(index);
+    return (v & typeUnknown) != 0;
+  }
+
+  boolean isTypeNone(int index) {
+    int v = pd.intptrAt(index);
+    return (v & typeMask) == 0;
+  }
+
+  K validKlass(int index) {
+    if (!isTypeNone(index) &&
+        !isTypeUnknown(index)) {
+      return methodData.getKlassAtAddress(pd.addressAt(index).andWithMask(typeKlassMask));
+    } else {
+      return null;
+    }
+  }
+
+  void printKlass(PrintStream st, int index) {
+    if (isTypeNone(index)) {
+      st.print("none");
+    } else if (isTypeUnknown(index)) {
+      st.print("unknown");
+    } else {
+      methodData.printKlassValueOn(validKlass(index), st);
+    }
+    if (wasNullSeen(index)) {
+      st.print(" (null seen)");
+    }
+  }
+
+  TypeEntries(MethodDataInterface<K,M> methodData, ProfileData pd, int baseOff) {
+    this.pd = pd;
+    this.baseOff = baseOff;
+    this.methodData = methodData;
+  }
+
+  long intptrAt(int index) {
+    return pd.intptrAt(index);
+  }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeEntriesAtCall.java	Tue May 27 13:57:42 2014 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
+
+// Entries to collect type information at a call: contains arguments
+// (TypeStackSlotEntries), a return type (ReturnTypeEntry) and a
+// number of cells.
+public abstract class TypeEntriesAtCall {
+
+  static int stackSlotLocalOffset(int i) {
+    return headerCellCount() + TypeStackSlotEntries.stackSlotLocalOffset(i);
+  }
+
+  static int argumentTypeLocalOffset(int i) {
+    return headerCellCount() + TypeStackSlotEntries.typeLocalOffset(i);
+  }
+
+  static int headerCellCount() {
+    return 1;
+  }
+
+  static int cellCountLocalOffset() {
+    return 0;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeStackSlotEntries.java	Tue May 27 13:57:42 2014 -0700
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
+
+// Type entries used for arguments passed at a call and parameters on
+// method entry. 2 cells per entry: one for the type encoded as in
+// TypeEntries and one initialized with the stack slot where the
+// profiled object is to be found so that the interpreter can locate
+// it quickly.
+public class TypeStackSlotEntries<K,M> extends TypeEntries<K,M> {
+  static final int stackSlotEntry = 0;
+  static final int typeEntry = 1;
+  static final int perArgCellCount = 2;
+
+  int stackSlotOffset(int i) {
+    return baseOff + stackSlotLocalOffset(i);
+  }
+
+  final int numberOfEntries;
+
+  int typeOffsetInCells(int i) {
+    return baseOff + typeLocalOffset(i);
+  }
+
+  TypeStackSlotEntries(MethodDataInterface<K,M> methodData, ProfileData pd, int baseOff, int nbEntries) {
+    super(methodData, pd, baseOff);
+    numberOfEntries = nbEntries;
+  }
+
+  static int stackSlotLocalOffset(int i) {
+    return i * perArgCellCount + stackSlotEntry;
+  }
+
+  static int typeLocalOffset(int i) {
+    return i * perArgCellCount + typeEntry;
+  }
+
+  int stackSlot(int i) {
+    return pd.uintAt(stackSlotOffset(i));
+  }
+
+  K type(int i) {
+    return validKlass(typeOffsetInCells(i));
+  }
+
+  static int perArgCount() {
+    return perArgCellCount;
+  }
+
+  int typeIndex(int i) {
+    return typeOffsetInCells(i);
+  }
+
+  void printDataOn(PrintStream st) {
+    for (int i = 0; i < numberOfEntries; i++) {
+      pd.tab(st);
+      st.print(i + ": stack(" + stackSlot(i)+ ") ");
+      printKlass(st, typeOffsetInCells(i));
+      st.println();
+    }
+  }
+}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java	Tue May 27 13:57:42 2014 -0700
@@ -35,9 +35,9 @@
 //
 // A VirtualCallData is used to access profiling information about a
 // call.  For now, it has nothing more than a ReceiverTypeData.
-public class VirtualCallData extends ReceiverTypeData {
-  public VirtualCallData(DataLayout layout) {
-    super(layout);
+public class VirtualCallData<K,M> extends ReceiverTypeData<K,M> {
+  public VirtualCallData(MethodDataInterface<K,M> methodData, DataLayout layout) {
+    super(methodData, layout);
     //assert(layout.tag() == DataLayout.virtualCallDataTag, "wrong type");
   }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallTypeData.java	Tue May 27 13:57:42 2014 -0700
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.jvm.hotspot.oops;
+
+import java.io.*;
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
+
+// VirtualCallTypeData
+//
+// A VirtualCallTypeData is used to access profiling information about
+// a virtual call for which we collect type information about
+// arguments and return value.
+public class VirtualCallTypeData<K,M> extends VirtualCallData implements CallTypeDataInterface<K> {
+  final TypeStackSlotEntries<K,M> args;
+  final ReturnTypeEntry<K,M> ret;
+
+  int cellCountGlobalOffset() {
+    return VirtualCallData.staticCellCount() + TypeEntriesAtCall.cellCountLocalOffset();
+  }
+
+  int cellCountNoHeader() {
+    return uintAt(cellCountGlobalOffset());
+  }
+
+  public VirtualCallTypeData(MethodDataInterface<K,M> methodData, DataLayout layout) {
+    super(methodData, layout);
+    args = new TypeStackSlotEntries<K,M>(methodData, this, VirtualCallData.staticCellCount()+TypeEntriesAtCall.headerCellCount(), numberOfArguments());
+    ret = new ReturnTypeEntry<K,M>(methodData, this, cellCount() - ReturnTypeEntry.staticCellCount());
+  }
+
+  static int staticCellCount() {
+    return -1;
+  }
+
+  public int cellCount() {
+    return VirtualCallData.staticCellCount() +
+      TypeEntriesAtCall.headerCellCount() +
+      intAt(cellCountGlobalOffset());
+  }
+
+  public int numberOfArguments() {
+    return cellCountNoHeader() / TypeStackSlotEntries.perArgCount();
+  }
+
+  public boolean hasArguments() {
+    return cellCountNoHeader() >= TypeStackSlotEntries.perArgCount();
+  }
+
+  public K argumentType(int i) {
+    return args.type(i);
+  }
+
+  public boolean hasReturn() {
+    return (cellCountNoHeader() % TypeStackSlotEntries.perArgCount()) != 0;
+  }
+
+  public K returnType() {
+    return ret.type();
+  }
+
+  public int argumentTypeIndex(int i) {
+    return args.typeIndex(i);
+  }
+
+  public int returnTypeIndex() {
+    return ret.typeIndex();
+  }
+
+  public void printDataOn(PrintStream st) {
+    super.printDataOn(st);
+    if (hasArguments()) {
+      tab(st);
+      st.print("argument types");
+      args.printDataOn(st);
+    }
+    if (hasReturn()) {
+      tab(st);
+      st.print("return type");
+      ret.printDataOn(st);
+    }
+  }
+};
--- a/hotspot/make/aix/makefiles/vm.make	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/make/aix/makefiles/vm.make	Tue May 27 13:57:42 2014 -0700
@@ -136,8 +136,6 @@
 JVM      = jvm
 LIBJVM   = lib$(JVM).so
 
-CFLAGS += -DALLOW_OPERATOR_NEW_USAGE
-
 LIBJVM_DEBUGINFO   = lib$(JVM).debuginfo
 LIBJVM_DIZ         = lib$(JVM).diz
 
--- a/hotspot/make/bsd/makefiles/vm.make	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/make/bsd/makefiles/vm.make	Tue May 27 13:57:42 2014 -0700
@@ -146,9 +146,6 @@
 ifeq ($(OS_VENDOR), Darwin)
   LIBJVM   = lib$(JVM).dylib
   CFLAGS  += -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE
-  ifeq (${VERSION}, $(filter ${VERSION}, debug fastdebug))
-    CFLAGS += -DALLOW_OPERATOR_NEW_USAGE
-  endif
 
   LIBJVM_DEBUGINFO   = lib$(JVM).dylib.dSYM
   LIBJVM_DIZ         = lib$(JVM).diz
--- a/hotspot/make/excludeSrc.make	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/make/excludeSrc.make	Tue May 27 13:57:42 2014 -0700
@@ -77,30 +77,40 @@
       CXXFLAGS += -DINCLUDE_ALL_GCS=0
       CFLAGS += -DINCLUDE_ALL_GCS=0
 
-      Src_Files_EXCLUDE += \
-	cmsAdaptiveSizePolicy.cpp cmsCollectorPolicy.cpp \
-	cmsGCAdaptivePolicyCounters.cpp cmsLockVerifier.cpp compactibleFreeListSpace.cpp \
-	concurrentMarkSweepGeneration.cpp concurrentMarkSweepThread.cpp \
-	freeChunk.cpp adaptiveFreeList.cpp promotionInfo.cpp vmCMSOperations.cpp \
-	collectionSetChooser.cpp concurrentG1Refine.cpp concurrentG1RefineThread.cpp \
-	concurrentMark.cpp concurrentMarkThread.cpp dirtyCardQueue.cpp g1AllocRegion.cpp \
-	g1BlockOffsetTable.cpp g1CardCounts.cpp g1CollectedHeap.cpp g1CollectorPolicy.cpp \
-	g1ErgoVerbose.cpp g1GCPhaseTimes.cpp g1HRPrinter.cpp g1HotCardCache.cpp g1Log.cpp \
-	g1MMUTracker.cpp g1MarkSweep.cpp g1MemoryPool.cpp g1MonitoringSupport.cpp g1OopClosures.cpp \
-	g1RemSet.cpp g1RemSetSummary.cpp g1SATBCardTableModRefBS.cpp g1StringDedup.cpp g1StringDedupStat.cpp \
-	g1StringDedupTable.cpp g1StringDedupThread.cpp g1StringDedupQueue.cpp g1_globals.cpp heapRegion.cpp \
-	g1BiasedArray.cpp heapRegionRemSet.cpp heapRegionSeq.cpp heapRegionSet.cpp heapRegionSets.cpp \
-	ptrQueue.cpp satbQueue.cpp sparsePRT.cpp survRateGroup.cpp vm_operations_g1.cpp g1CodeCacheRemSet.cpp \
-	adjoiningGenerations.cpp adjoiningVirtualSpaces.cpp asPSOldGen.cpp asPSYoungGen.cpp \
-	cardTableExtension.cpp gcTaskManager.cpp gcTaskThread.cpp objectStartArray.cpp \
-	parallelScavengeHeap.cpp parMarkBitMap.cpp pcTasks.cpp psAdaptiveSizePolicy.cpp \
-	psCompactionManager.cpp psGCAdaptivePolicyCounters.cpp psGenerationCounters.cpp \
-	psMarkSweep.cpp psMarkSweepDecorator.cpp psMemoryPool.cpp psOldGen.cpp \
-	psParallelCompact.cpp psPromotionLAB.cpp psPromotionManager.cpp psScavenge.cpp \
-	psTasks.cpp psVirtualspace.cpp psYoungGen.cpp vmPSOperations.cpp asParNewGeneration.cpp \
-	parCardTableModRefBS.cpp parGCAllocBuffer.cpp parNewGeneration.cpp mutableSpace.cpp \
-	gSpaceCounters.cpp allocationStats.cpp spaceCounters.cpp gcAdaptivePolicyCounters.cpp \
-	mutableNUMASpace.cpp immutableSpace.cpp yieldingWorkGroup.cpp hSpaceCounters.cpp
+      gc_impl := $(GAMMADIR)/src/share/vm/gc_implementation
+      gc_exclude :=							\
+	$(notdir $(wildcard $(gc_impl)/concurrentMarkSweep/*.cpp))	\
+	$(notdir $(wildcard $(gc_impl)/g1/*.cpp))			\
+	$(notdir $(wildcard $(gc_impl)/parallelScavenge/*.cpp))		\
+	$(notdir $(wildcard $(gc_impl)/parNew/*.cpp))
+      Src_Files_EXCLUDE += $(gc_exclude)
+
+      # Exclude everything in $(gc_impl)/shared except the files listed
+      # in $(gc_shared_keep).
+      gc_shared_all := $(notdir $(wildcard $(gc_impl)/shared/*.cpp))
+      gc_shared_keep :=							\
+	adaptiveSizePolicy.cpp						\
+	ageTable.cpp							\
+	collectorCounters.cpp						\
+	cSpaceCounters.cpp						\
+	gcPolicyCounters.cpp						\
+	gcStats.cpp							\
+	gcTimer.cpp							\
+	gcTrace.cpp							\
+	gcTraceSend.cpp							\
+	gcTraceTime.cpp							\
+	gcUtil.cpp							\
+	generationCounters.cpp						\
+	markSweep.cpp							\
+	objectCountEventSender.cpp					\
+	spaceDecorator.cpp						\
+	vmGCOperations.cpp
+      Src_Files_EXCLUDE += $(filter-out $(gc_shared_keep),$(gc_shared_all))
+
+      # src/share/vm/services
+      Src_Files_EXCLUDE +=						\
+	g1MemoryPool.cpp						\
+	psMemoryPool.cpp
 endif
 
 ifeq ($(INCLUDE_NMT), false)
--- a/hotspot/make/windows/projectfiles/common/Makefile	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/make/windows/projectfiles/common/Makefile	Tue May 27 13:57:42 2014 -0700
@@ -93,7 +93,7 @@
 !if "$(HOTSPOT_RELEASE_VERSION)" != ""
 HOTSPOT_RELEASE_VERSION="\\\"$(HOTSPOT_RELEASE_VERSION)\\\""
 !else
-HOTSPOT_RELEASE_VERSION="\\\"$(JRE_RELEASE_VERSION)\\\""
+HOTSPOT_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
 !endif
 # Define HOTSPOT_VM_DISTRO if HOTSPOT_VM_DISTRO is set,
 # and if it is not see if we have the src/closed directory
@@ -105,9 +105,18 @@
 !else
 HOTSPOT_VM_DISTRO="\\\"OpenJDK\\\""
 !endif
+!if "$(JDK_BUILD_NUMBER)" != ""
+JDK_BUILD_NUMBER="\\\"$(JDK_BUILD_NUMBER)\\\""
+!else
+JDK_BUILD_NUMBER="\\\"00\\\""
+!endif
 !endif
 
-ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -define JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) -define HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO)
+JDK_MAJOR_VERSION="\\\"$(JDK_MAJOR_VER)\\\""
+JDK_MINOR_VERSION="\\\"$(JDK_MINOR_VER)\\\""
+JDK_MICRO_VERSION="\\\"$(JDK_MICRO_VER)\\\""
+
+ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -define JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) -define HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO) -define JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) -define JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) -define JDK_MICRO_VERSION=$(JDK_MICRO_VERSION) -define JDK_BUILD_NUMBER=$(JDK_BUILD_NUMBER)
 ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) $(ReleaseOptions)
 
 $(HOTSPOTBUILDSPACE)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
--- a/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp	Tue May 27 13:57:42 2014 -0700
@@ -41,7 +41,6 @@
 define_pd_global(bool, ProfileInterpreter,           true);
 define_pd_global(bool, TieredCompilation,            false);
 define_pd_global(intx, CompileThreshold,             10000);
-define_pd_global(intx, BackEdgeThreshold,            140000);
 
 define_pd_global(intx, OnStackReplacePercentage,     140);
 define_pd_global(intx, ConditionalMoveLimit,         3);
--- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012, 2014 SAP AG. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -149,7 +149,7 @@
 }
 
 void VM_Version::print_features() {
-  tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), get_cache_line_size());
+  tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), (int) get_cache_line_size());
 }
 
 #ifdef COMPILER2
--- a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp	Tue May 27 13:57:42 2014 -0700
@@ -414,6 +414,7 @@
 
 void DeoptimizeStub::emit_code(LIR_Assembler* ce) {
   __ bind(_entry);
+  __ set(_trap_request, G4);
   __ call(Runtime1::entry_for(Runtime1::deoptimize_id), relocInfo::runtime_call_type);
   __ delayed()->nop();
   ce->add_call_info_here(_info);
--- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp	Tue May 27 13:57:42 2014 -0700
@@ -781,7 +781,7 @@
       {
         __ set_info("deoptimize", dont_gc_arguments);
         OopMap* oop_map = save_live_registers(sasm);
-        int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, deoptimize));
+        int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, deoptimize), G4);
         oop_maps = new OopMapSet();
         oop_maps->add_gc_map(call_offset, oop_map);
         restore_live_registers(sasm);
--- a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp	Tue May 27 13:57:42 2014 -0700
@@ -40,7 +40,6 @@
 define_pd_global(bool, UseOnStackReplacement,        true );
 define_pd_global(bool, TieredCompilation,            false);
 define_pd_global(intx, CompileThreshold,             1000 ); // Design center runs on 1.3.1
-define_pd_global(intx, BackEdgeThreshold,            100000);
 
 define_pd_global(intx, OnStackReplacePercentage,     1400 );
 define_pd_global(bool, UseTLAB,                      true );
--- a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp	Tue May 27 13:57:42 2014 -0700
@@ -44,7 +44,6 @@
 #endif // CC_INTERP
 define_pd_global(bool, TieredCompilation,            trueInTiered);
 define_pd_global(intx, CompileThreshold,             10000);
-define_pd_global(intx, BackEdgeThreshold,            140000);
 
 define_pd_global(intx, OnStackReplacePercentage,     140);
 define_pd_global(intx, ConditionalMoveLimit,         4);
--- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp	Tue May 27 13:57:42 2014 -0700
@@ -3653,9 +3653,9 @@
     const Register len_reg = I4; // cipher length
     const Register keylen = I5;  // reg for storing expanded key array length
 
-    // save cipher len before save_frame, to return in the end
-    __ mov(O4, L0);
     __ save_frame(0);
+    // save cipher len to return in the end
+    __ mov(len_reg, L0);
 
     // read expanded key length
     __ ldsw(Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT)), keylen, 0);
@@ -3778,9 +3778,9 @@
     // re-init intial vector for next block, 8-byte alignment is guaranteed
     __ stf(FloatRegisterImpl::D, F60, rvec, 0);
     __ stf(FloatRegisterImpl::D, F62, rvec, 8);
-    __ restore();
-    __ retl();
-    __ delayed()->mov(L0, O0);
+    __ mov(L0, I0);
+    __ ret();
+    __ delayed()->restore();
 
     __ align(OptoLoopAlignment);
     __ BIND(L_cbcenc192);
@@ -3869,9 +3869,9 @@
     // re-init intial vector for next block, 8-byte alignment is guaranteed
     __ stf(FloatRegisterImpl::D, F60, rvec, 0);
     __ stf(FloatRegisterImpl::D, F62, rvec, 8);
-    __ restore();
-    __ retl();
-    __ delayed()->mov(L0, O0);
+    __ mov(L0, I0);
+    __ ret();
+    __ delayed()->restore();
 
     __ align(OptoLoopAlignment);
     __ BIND(L_cbcenc256);
@@ -3962,9 +3962,9 @@
     // re-init intial vector for next block, 8-byte alignment is guaranteed
     __ stf(FloatRegisterImpl::D, F60, rvec, 0);
     __ stf(FloatRegisterImpl::D, F62, rvec, 8);
-    __ restore();
-    __ retl();
-    __ delayed()->mov(L0, O0);
+    __ mov(L0, I0);
+    __ ret();
+    __ delayed()->restore();
 
     return start;
   }
@@ -3992,9 +3992,9 @@
     const Register original_key = I5;  // original key array only required during decryption
     const Register keylen = L6;  // reg for storing expanded key array length
 
-    // save cipher len before save_frame, to return in the end
-    __ mov(O4, L0);
     __ save_frame(0); //args are read from I* registers since we save the frame in the beginning
+    // save cipher len to return in the end
+    __ mov(len_reg, L7);
 
     // load original key from SunJCE expanded decryption key
     // Since we load original key buffer starting first element, 8-byte alignment is guaranteed
@@ -4568,10 +4568,9 @@
     // re-init intial vector for next block, 8-byte alignment is guaranteed
     __ stx(L0, rvec, 0);
     __ stx(L1, rvec, 8);
-    __ restore();
-    __ mov(L0, O0);
-    __ retl();
-    __ delayed()->nop();
+    __ mov(L7, I0);
+    __ ret();
+    __ delayed()->restore();
 
     return start;
   }
--- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp	Tue May 27 13:57:42 2014 -0700
@@ -318,22 +318,22 @@
           tty->print("BIS");
       }
       if (AllocatePrefetchLines > 1) {
-        tty->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize);
+        tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
       } else {
-        tty->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize);
+        tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
       }
     }
     if (PrefetchCopyIntervalInBytes > 0) {
-      tty->print_cr("PrefetchCopyIntervalInBytes %d", PrefetchCopyIntervalInBytes);
+      tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes);
     }
     if (PrefetchScanIntervalInBytes > 0) {
-      tty->print_cr("PrefetchScanIntervalInBytes %d", PrefetchScanIntervalInBytes);
+      tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes);
     }
     if (PrefetchFieldsAhead > 0) {
-      tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead);
+      tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead);
     }
     if (ContendedPaddingWidth > 0) {
-      tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth);
+      tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth);
     }
   }
 #endif // PRODUCT
--- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -522,11 +522,11 @@
     // these asserts are somewhat nonsensical
 #ifndef _LP64
     assert(which == imm_operand || which == disp32_operand,
-           err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip));
+           err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)));
 #else
     assert((which == call32_operand || which == imm_operand) && is_64bit ||
            which == narrow_oop_operand && !is_64bit,
-           err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip));
+           err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)));
 #endif // _LP64
     return ip;
 
--- a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp	Tue May 27 13:57:42 2014 -0700
@@ -430,6 +430,7 @@
 
 void DeoptimizeStub::emit_code(LIR_Assembler* ce) {
   __ bind(_entry);
+  ce->store_parameter(_trap_request, 0);
   __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::deoptimize_id)));
   ce->add_call_info_here(_info);
   DEBUG_ONLY(__ should_not_reach_here());
--- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -95,7 +95,7 @@
 
 #ifndef PRODUCT
         if (TraceFPURegisterUsage) {
-          tty->print("FPU regs for block %d, LIR instr %d): ", b->block_id(), id); regs.print_on(tty); tty->print_cr("");
+          tty->print("FPU regs for block %d, LIR instr %d): ", b->block_id(), id); regs.print_on(tty); tty->cr();
         }
 #endif
       }
--- a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1468,9 +1468,10 @@
     case deoptimize_id:
       {
         StubFrame f(sasm, "deoptimize", dont_gc_arguments);
-        const int num_rt_args = 1;  // thread
+        const int num_rt_args = 2;  // thread, trap_request
         OopMap* oop_map = save_live_registers(sasm, num_rt_args);
-        int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, deoptimize));
+        f.load_argument(0, rax);
+        int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, deoptimize), rax);
         oop_maps = new OopMapSet();
         oop_maps->add_gc_map(call_offset, oop_map);
         restore_live_registers(sasm);
--- a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp	Tue May 27 13:57:42 2014 -0700
@@ -41,7 +41,6 @@
 define_pd_global(bool, UseOnStackReplacement,        true );
 define_pd_global(bool, TieredCompilation,            false);
 define_pd_global(intx, CompileThreshold,             1500 );
-define_pd_global(intx, BackEdgeThreshold,            100000);
 
 define_pd_global(intx, OnStackReplacePercentage,     933  );
 define_pd_global(intx, FreqInlineSize,               325  );
--- a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp	Tue May 27 13:57:42 2014 -0700
@@ -45,7 +45,6 @@
 #endif // CC_INTERP
 define_pd_global(bool, TieredCompilation,            trueInTiered);
 define_pd_global(intx, CompileThreshold,             10000);
-define_pd_global(intx, BackEdgeThreshold,            100000);
 
 define_pd_global(intx, OnStackReplacePercentage,     140);
 define_pd_global(intx, ConditionalMoveLimit,         3);
--- a/hotspot/src/cpu/x86/vm/compiledIC_x86.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/compiledIC_x86.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -122,7 +122,7 @@
   if (TraceICs) {
     ResourceMark rm;
     tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
-                  instruction_address(),
+                  p2i(instruction_address()),
                   callee->name_and_sig_as_C_string());
   }
 
--- a/hotspot/src/cpu/x86/vm/frame_x86.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,7 @@
 }
 #endif
 
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
 // Profiling/safepoint support
 
--- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,6 +51,7 @@
 
 #define __ _masm->
 
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
 #ifdef _WIN64
 address AbstractInterpreterGenerator::generate_slow_signature_handler() {
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,6 +55,7 @@
 
 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
 
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
 #ifdef ASSERT
 bool AbstractAssembler::pd_check_instruction_mark() { return true; }
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,8 @@
 #include "memory/allocation.inline.hpp"
 #include "prims/methodHandles.hpp"
 
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
 #define __ _masm->
 
 #ifdef PRODUCT
--- a/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
 #include "c1/c1_Runtime1.hpp"
 #endif
 
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
 void NativeInstruction::wrote(int offset) {
   ICache::invalidate_word(addr_at(offset));
 }
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -925,16 +925,16 @@
   if (PrintMiscellaneous && Verbose) {
     tty->print_cr("Logical CPUs per core: %u",
                   logical_processors_per_package());
-    tty->print("UseSSE=%d",UseSSE);
+    tty->print("UseSSE=%d", (int) UseSSE);
     if (UseAVX > 0) {
-      tty->print("  UseAVX=%d",UseAVX);
+      tty->print("  UseAVX=%d", (int) UseAVX);
     }
     if (UseAES) {
       tty->print("  UseAES=1");
     }
 #ifdef COMPILER2
     if (MaxVectorSize > 0) {
-      tty->print("  MaxVectorSize=%d", MaxVectorSize);
+      tty->print("  MaxVectorSize=%d", (int) MaxVectorSize);
     }
 #endif
     tty->cr();
@@ -957,23 +957,23 @@
         }
       }
       if (AllocatePrefetchLines > 1) {
-        tty->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize);
+        tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
       } else {
-        tty->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize);
+        tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
       }
     }
 
     if (PrefetchCopyIntervalInBytes > 0) {
-      tty->print_cr("PrefetchCopyIntervalInBytes %d", PrefetchCopyIntervalInBytes);
+      tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes);
     }
     if (PrefetchScanIntervalInBytes > 0) {
-      tty->print_cr("PrefetchScanIntervalInBytes %d", PrefetchScanIntervalInBytes);
+      tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes);
     }
     if (PrefetchFieldsAhead > 0) {
-      tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead);
+      tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead);
     }
     if (ContendedPaddingWidth > 0) {
-      tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth);
+      tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth);
     }
   }
 #endif // !PRODUCT
--- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -118,7 +118,7 @@
 
   if (PrintMiscellaneous && (WizardMode || Verbose)) {
     tty->print_cr("vtable #%d at "PTR_FORMAT"[%d] left over: %d",
-                  vtable_index, s->entry_point(),
+                  vtable_index, p2i(s->entry_point()),
                   (int)(s->code_end() - s->entry_point()),
                   (int)(s->code_end() - __ pc()));
   }
@@ -199,7 +199,7 @@
 
   if (PrintMiscellaneous && (WizardMode || Verbose)) {
     tty->print_cr("itable #%d at "PTR_FORMAT"[%d] left over: %d",
-                  itable_index, s->entry_point(),
+                  itable_index, p2i(s->entry_point()),
                   (int)(s->code_end() - s->entry_point()),
                   (int)(s->code_end() - __ pc()));
   }
--- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,8 @@
 #include "opto/runtime.hpp"
 #endif
 
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
 // machine-dependent part of VtableStubs: create VtableStub of correct size and
 // initialize its code
 
--- a/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/cpu/zero/vm/shark_globals_zero.hpp	Tue May 27 13:57:42 2014 -0700
@@ -43,7 +43,6 @@
 define_pd_global(intx,     Tier3CompileThreshold,        2500);
 define_pd_global(intx,     Tier4CompileThreshold,        4500);
 
-define_pd_global(intx,     BackEdgeThreshold,            100000);
 define_pd_global(intx,     Tier2BackEdgeThreshold,       100000);
 define_pd_global(intx,     Tier3BackEdgeThreshold,       100000);
 define_pd_global(intx,     Tier4BackEdgeThreshold,       100000);
--- a/hotspot/src/os/aix/vm/os_aix.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os/aix/vm/os_aix.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1871,7 +1871,7 @@
 // properties.
 
 // ShmBkBlock: base class for all blocks in the shared memory bookkeeping
-class ShmBkBlock {
+class ShmBkBlock : public CHeapObj<mtInternal> {
 
   ShmBkBlock* _next;
 
--- a/hotspot/src/os/aix/vm/porting_aix.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os/aix/vm/porting_aix.cpp	Tue May 27 13:57:42 2014 -0700
@@ -23,6 +23,7 @@
  */
 
 #include "asm/assembler.hpp"
+#include "memory/allocation.hpp"
 #include "loadlib_aix.hpp"
 #include "porting_aix.hpp"
 #include "utilities/debug.hpp"
@@ -67,7 +68,7 @@
 // a primitive string map. Should this turn out to be a performance
 // problem, a better hashmap has to be used.
 class fixed_strings {
-  struct node {
+  struct node : public CHeapObj<mtInternal> {
     char* v;
     node* next;
   };
--- a/hotspot/src/os/aix/vm/thread_aix.inline.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os/aix/vm/thread_aix.inline.hpp	Tue May 27 13:57:42 2014 -0700
@@ -26,12 +26,9 @@
 #ifndef OS_AIX_VM_THREAD_AIX_INLINE_HPP
 #define OS_AIX_VM_THREAD_AIX_INLINE_HPP
 
-#include "runtime/prefetch.hpp"
 #include "runtime/thread.hpp"
 #include "runtime/threadLocalStorage.hpp"
 
-#include "prefetch_aix_ppc.inline.hpp"
-
 // Contains inlined functions for class Thread and ThreadLocalStorage
 
 inline void ThreadLocalStorage::pd_invalidate_all() {} // nothing to do
--- a/hotspot/src/os/bsd/vm/decoder_machO.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os/bsd/vm/decoder_machO.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@
   struct symtab_command * symt = (struct symtab_command *)
     mach_find_command((struct mach_header_64 *)mach_base, LC_SYMTAB);
   if (symt == NULL) {
-    DEBUG_ONLY(tty->print_cr("no symtab in mach file at 0x%lx", mach_base));
+    DEBUG_ONLY(tty->print_cr("no symtab in mach file at 0x%lx", p2i(mach_base)));
     return false;
   }
   uint32_t off = symt->symoff;          /* symbol table offset (within this mach file) */
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Tue May 27 13:57:42 2014 -0700
@@ -124,6 +124,9 @@
 #define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF)
 
 #define LARGEPAGES_BIT (1 << 6)
+
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
 ////////////////////////////////////////////////////////////////////////////////
 // global variables
 julong os::Bsd::_physical_memory = 0;
@@ -2394,7 +2397,6 @@
                         (!FLAG_IS_DEFAULT(UseLargePages) ||
                          !FLAG_IS_DEFAULT(LargePageSizeInBytes)
                         );
-  char msg[128];
 
   // Create a large shared memory region to attach to based on size.
   // Currently, size is the total size of the heap
@@ -2415,8 +2417,7 @@
      //            coalesce into large pages. Try to reserve large pages when
      //            the system is still "fresh".
      if (warn_on_failure) {
-       jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno);
-       warning(msg);
+       warning("Failed to reserve shared memory (errno = %d).", errno);
      }
      return NULL;
   }
@@ -2433,8 +2434,7 @@
 
   if ((intptr_t)addr == -1) {
      if (warn_on_failure) {
-       jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err);
-       warning(msg);
+       warning("Failed to attach shared memory (errno = %d).", err);
      }
      return NULL;
   }
@@ -3810,6 +3810,7 @@
   return true;
 }
 
+ATTRIBUTE_PRINTF(3, 0)
 int local_vsnprintf(char* buf, size_t count, const char* format, va_list args) {
   return ::vsnprintf(buf, count, format, args);
 }
--- a/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -925,7 +925,7 @@
 
   if (PerfTraceMemOps) {
     tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at "
-               INTPTR_FORMAT "\n", size, vmid, (void*)mapAddress);
+               INTPTR_FORMAT "\n", size, vmid, p2i((void*)mapAddress));
   }
 }
 
--- a/hotspot/src/os/bsd/vm/thread_bsd.inline.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os/bsd/vm/thread_bsd.inline.hpp	Tue May 27 13:57:42 2014 -0700
@@ -31,12 +31,6 @@
 
 #include "runtime/thread.hpp"
 #include "runtime/threadLocalStorage.hpp"
-#ifdef TARGET_OS_ARCH_bsd_x86
-# include "prefetch_bsd_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_bsd_zero
-# include "prefetch_bsd_zero.inline.hpp"
-#endif
 
 // Contains inlined functions for class Thread and ThreadLocalStorage
 
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Tue May 27 13:57:42 2014 -0700
@@ -102,6 +102,8 @@
 # include <inttypes.h>
 # include <sys/ioctl.h>
 
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
 // if RUSAGE_THREAD for getrusage() has not been defined, do it here. The code calling
 // getrusage() is prepared to handle the associated failure.
 #ifndef RUSAGE_THREAD
@@ -2138,7 +2140,7 @@
   // Print warning if unsafe chroot environment detected
   if (unsafe_chroot_detected) {
     st->print("WARNING!! ");
-    st->print_cr(unstable_chroot_error);
+    st->print_cr("%s", unstable_chroot_error);
   }
 
   os::Linux::print_libversion_info(st);
@@ -2199,8 +2201,8 @@
 void os::Linux::print_libversion_info(outputStream* st) {
   // libc, pthread
   st->print("libc:");
-  st->print(os::Linux::glibc_version()); st->print(" ");
-  st->print(os::Linux::libpthread_version()); st->print(" ");
+  st->print("%s ", os::Linux::glibc_version());
+  st->print("%s ", os::Linux::libpthread_version());
   if (os::Linux::is_LinuxThreads()) {
      st->print("(%s stack)", os::Linux::is_floating_stack() ? "floating" : "fixed");
   }
@@ -3417,7 +3419,7 @@
      //            the system is still "fresh".
      if (warn_on_failure) {
        jio_snprintf(msg, sizeof(msg), "Failed to reserve shared memory (errno = %d).", errno);
-       warning(msg);
+       warning("%s", msg);
      }
      return NULL;
   }
@@ -3435,7 +3437,7 @@
   if ((intptr_t)addr == -1) {
      if (warn_on_failure) {
        jio_snprintf(msg, sizeof(msg), "Failed to attach shared memory (errno = %d).", err);
-       warning(msg);
+       warning("%s", msg);
      }
      return NULL;
   }
@@ -3455,7 +3457,7 @@
     char msg[128];
     jio_snprintf(msg, sizeof(msg), "Failed to reserve large pages memory req_addr: "
         PTR_FORMAT " bytes: " SIZE_FORMAT " (errno = %d).", req_addr, bytes, error);
-    warning(msg);
+    warning("%s", msg);
   }
 }
 
--- a/hotspot/src/os/linux/vm/perfMemory_linux.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os/linux/vm/perfMemory_linux.cpp	Tue May 27 13:57:42 2014 -0700
@@ -931,7 +931,7 @@
 
   if (PerfTraceMemOps) {
     tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at "
-               INTPTR_FORMAT "\n", size, vmid, (void*)mapAddress);
+               INTPTR_FORMAT "\n", size, vmid, p2i((void*)mapAddress));
   }
 }
 
--- a/hotspot/src/os/linux/vm/thread_linux.inline.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os/linux/vm/thread_linux.inline.hpp	Tue May 27 13:57:42 2014 -0700
@@ -29,24 +29,8 @@
 #error "This file should only be included from thread.inline.hpp"
 #endif
 
-#include "runtime/prefetch.hpp"
 #include "runtime/thread.hpp"
 #include "runtime/threadLocalStorage.hpp"
-#ifdef TARGET_OS_ARCH_linux_x86
-# include "prefetch_linux_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_sparc
-# include "prefetch_linux_sparc.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_zero
-# include "prefetch_linux_zero.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_arm
-# include "prefetch_linux_arm.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_linux_ppc
-# include "prefetch_linux_ppc.inline.hpp"
-#endif
 
 // Contains inlined functions for class Thread and ThreadLocalStorage
 
--- a/hotspot/src/os/posix/vm/os_posix.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os/posix/vm/os_posix.cpp	Tue May 27 13:57:42 2014 -0700
@@ -36,6 +36,8 @@
 #include <pthread.h>
 #include <signal.h>
 
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
 // Todo: provide a os::get_max_process_id() or similar. Number of processes
 // may have been configured, can be read more accurately from proc fs etc.
 #ifndef MAX_PID
@@ -192,10 +194,10 @@
   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->print("%s ", name.sysname);
+  st->print("%s ", name.release);
+  st->print("%s ", name.version);
+  st->print("%s", name.machine);
   st->cr();
 }
 
@@ -682,7 +684,7 @@
 void os::Posix::print_signal_set_short(outputStream* st, const sigset_t* set) {
   char buf[NUM_IMPORTANT_SIGS + 1];
   os::Posix::describe_signal_set_short(set, buf, sizeof(buf));
-  st->print(buf);
+  st->print("%s", buf);
 }
 
 // Writes one-line description of a combination of sigaction.sa_flags into a user
@@ -742,7 +744,7 @@
 void os::Posix::print_sa_flags(outputStream* st, int flags) {
   char buffer[0x100];
   os::Posix::describe_sa_flags(flags, buffer, sizeof(buffer));
-  st->print(buffer);
+  st->print("%s", buffer);
 }
 
 // Helper function for os::Posix::print_siginfo_...():
--- a/hotspot/src/os/solaris/vm/thread_solaris.inline.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os/solaris/vm/thread_solaris.inline.hpp	Tue May 27 13:57:42 2014 -0700
@@ -30,15 +30,8 @@
 #endif
 
 #include "runtime/atomic.inline.hpp"
-#include "runtime/prefetch.hpp"
 #include "runtime/thread.hpp"
 #include "runtime/threadLocalStorage.hpp"
-#ifdef TARGET_OS_ARCH_solaris_x86
-# include "prefetch_solaris_x86.inline.hpp"
-#endif
-#ifdef TARGET_OS_ARCH_solaris_sparc
-# include "prefetch_solaris_sparc.inline.hpp"
-#endif
 
 // Thread::current is "hot" it's called > 128K times in the 1st 500 msecs of
 // startup.
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Tue May 27 13:57:42 2014 -0700
@@ -5005,7 +5005,11 @@
     // wrong; at these points, eax contains the address of the offending block (I think).
     // To get to the exlicit error message(s) below, just continue twice.
     HANDLE heap = GetProcessHeap();
-    { HeapLock(heap);
+
+    // If we fail to lock the heap, then gflags.exe has been used
+    // or some other special heap flag has been set that prevents
+    // locking. We don't try to walk a heap we can't lock.
+    if (HeapLock(heap) != 0) {
       PROCESS_HEAP_ENTRY phe;
       phe.lpData = NULL;
       while (HeapWalk(heap, &phe) != 0) {
--- a/hotspot/src/os/windows/vm/thread_windows.inline.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os/windows/vm/thread_windows.inline.hpp	Tue May 27 13:57:42 2014 -0700
@@ -29,12 +29,8 @@
 #error "This file should only be included from thread.inline.hpp"
 #endif
 
-#include "runtime/prefetch.hpp"
 #include "runtime/thread.hpp"
 #include "runtime/threadLocalStorage.hpp"
-#ifdef TARGET_OS_ARCH_windows_x86
-# include "prefetch_windows_x86.inline.hpp"
-#endif
 
 // Contains inlined functions for class Thread and ThreadLocalStorage
 
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -276,6 +276,8 @@
 # endif
 #endif
 
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
 address os::current_stack_pointer() {
 #if defined(__clang__) || defined(__llvm__)
   register void *esp;
--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -89,6 +89,8 @@
 #define SPELL_REG_FP "ebp"
 #endif // AMD64
 
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
 address os::current_stack_pointer() {
 #ifdef SPARC_WORKS
   register void *esp;
--- a/hotspot/src/share/vm/adlc/adlc.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/adlc/adlc.hpp	Tue May 27 13:57:42 2014 -0700
@@ -30,12 +30,13 @@
 //
 
 // standard library constants
-#include "stdio.h"
-#include "stdlib.h"
 #include <iostream>
-#include "string.h"
-#include "ctype.h"
-#include "stdarg.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdarg.h>
 #include <sys/types.h>
 
 /* Make sure that we have the intptr_t and uintptr_t definitions */
--- a/hotspot/src/share/vm/adlc/adlparse.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/adlc/adlparse.hpp	Tue May 27 13:57:42 2014 -0700
@@ -64,8 +64,6 @@
 class PeepConstraint;
 class PeepReplace;
 
-// class ostream; // ostream is a typedef in some systems
-
 extern char *toUpper(const char *str);
 
 //---------------------------ADLParser-----------------------------------------
--- a/hotspot/src/share/vm/adlc/filebuff.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/adlc/filebuff.cpp	Tue May 27 13:57:42 2014 -0700
@@ -25,8 +25,6 @@
 // FILEBUFF.CPP - Routines for handling a parser file buffer
 #include "adlc.hpp"
 
-using namespace std;
-
 //------------------------------FileBuff---------------------------------------
 // Create a new parsing buffer
 FileBuff::FileBuff( BufferedFile *fptr, ArchDesc& archDesc) : _fp(fptr), _AD(archDesc) {
--- a/hotspot/src/share/vm/adlc/filebuff.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/adlc/filebuff.hpp	Tue May 27 13:57:42 2014 -0700
@@ -26,9 +26,6 @@
 #define SHARE_VM_ADLC_FILEBUFF_HPP
 
 // FILEBUFF.HPP - Definitions for parser file buffering routines
-#include <iostream>
-
-using namespace std;
 
 // STRUCTURE FOR HANDLING INPUT AND OUTPUT FILES
 
--- a/hotspot/src/share/vm/adlc/formssel.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/adlc/formssel.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1322,7 +1322,7 @@
     OperandForm* oper = form->is_operand();
     if (oper != NULL && oper->is_bound_register()) {
       const RegDef* first = oper->get_RegClass()->find_first_elem();
-      fprintf(fp, "    st->print(\"%s\");\n", first->_regname);
+      fprintf(fp, "    st->print_raw(\"%s\");\n", first->_regname);
     } else {
       globalAD->syntax_err(_linenum, "In %s can't find format for %s %s", _ident, opc->_ident, rep_var);
     }
@@ -2530,7 +2530,7 @@
   case Form::idealP: fprintf(fp,"  if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break;
   case Form::idealNKlass:
   case Form::idealN: fprintf(fp,"  if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break;
-  case Form::idealL: fprintf(fp,"  st->print(\"#%%lld\", _c%d);\n", const_index); break;
+  case Form::idealL: fprintf(fp,"  st->print(\"#\" INT64_FORMAT, (int64_t)_c%d);\n", const_index); break;
   case Form::idealF: fprintf(fp,"  st->print(\"#%%f\", _c%d);\n", const_index); break;
   case Form::idealD: fprintf(fp,"  st->print(\"#%%f\", _c%d);\n", const_index); break;
   default:
--- a/hotspot/src/share/vm/adlc/output_h.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/adlc/output_h.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -211,7 +211,7 @@
     const char *type = oper->ideal_type(globals);
     if (!strcmp(type, "ConI")) {
       if (i > 0) fprintf(fp,", ");
-      fprintf(fp,"  int32          _c%d;\n", i);
+      fprintf(fp,"  int32_t        _c%d;\n", i);
     }
     else if (!strcmp(type, "ConP")) {
       if (i > 0) fprintf(fp,", ");
@@ -307,7 +307,7 @@
     assert(num_consts == 1, "Bad component list detected.\n");
     switch( constant_type ) {
     case Form::idealI : {
-      fprintf(fp,is_ideal_bool ? "BoolTest::mask c%d" : "int32 c%d", i);
+      fprintf(fp,is_ideal_bool ? "BoolTest::mask c%d" : "int32_t c%d", i);
       break;
     }
     case Form::idealN :      { fprintf(fp,"const TypeNarrowOop *c%d", i); break; }
@@ -326,7 +326,7 @@
     while((comp = lst.iter()) != NULL) {
       if (!strcmp(comp->base_type(globals), "ConI")) {
         if (i > 0) fprintf(fp,", ");
-        fprintf(fp,"int32 c%d", i);
+        fprintf(fp,"int32_t c%d", i);
         i++;
       }
       else if (!strcmp(comp->base_type(globals), "ConP")) {
@@ -386,14 +386,14 @@
 static void defineCCodeDump(OperandForm* oper, FILE *fp, int i) {
   assert(oper != NULL, "what");
   CondInterface* cond = oper->_interface->is_CondInterface();
-  fprintf(fp, "       if( _c%d == BoolTest::eq ) st->print(\"%s\");\n",i,cond->_equal_format);
-  fprintf(fp, "  else if( _c%d == BoolTest::ne ) st->print(\"%s\");\n",i,cond->_not_equal_format);
-  fprintf(fp, "  else if( _c%d == BoolTest::le ) st->print(\"%s\");\n",i,cond->_less_equal_format);
-  fprintf(fp, "  else if( _c%d == BoolTest::ge ) st->print(\"%s\");\n",i,cond->_greater_equal_format);
-  fprintf(fp, "  else if( _c%d == BoolTest::lt ) st->print(\"%s\");\n",i,cond->_less_format);
-  fprintf(fp, "  else if( _c%d == BoolTest::gt ) st->print(\"%s\");\n",i,cond->_greater_format);
-  fprintf(fp, "  else if( _c%d == BoolTest::overflow ) st->print(\"%s\");\n",i,cond->_overflow_format);
-  fprintf(fp, "  else if( _c%d == BoolTest::no_overflow ) st->print(\"%s\");\n",i,cond->_no_overflow_format);
+  fprintf(fp, "       if( _c%d == BoolTest::eq ) st->print_raw(\"%s\");\n",i,cond->_equal_format);
+  fprintf(fp, "  else if( _c%d == BoolTest::ne ) st->print_raw(\"%s\");\n",i,cond->_not_equal_format);
+  fprintf(fp, "  else if( _c%d == BoolTest::le ) st->print_raw(\"%s\");\n",i,cond->_less_equal_format);
+  fprintf(fp, "  else if( _c%d == BoolTest::ge ) st->print_raw(\"%s\");\n",i,cond->_greater_equal_format);
+  fprintf(fp, "  else if( _c%d == BoolTest::lt ) st->print_raw(\"%s\");\n",i,cond->_less_format);
+  fprintf(fp, "  else if( _c%d == BoolTest::gt ) st->print_raw(\"%s\");\n",i,cond->_greater_format);
+  fprintf(fp, "  else if( _c%d == BoolTest::overflow ) st->print_raw(\"%s\");\n",i,cond->_overflow_format);
+  fprintf(fp, "  else if( _c%d == BoolTest::no_overflow ) st->print_raw(\"%s\");\n",i,cond->_no_overflow_format);
 }
 
 // Output code that dumps constant values, increment "i" if type is constant
@@ -416,8 +416,8 @@
     ++i;
   }
   else if (!strcmp(ideal_type, "ConL")) {
-    fprintf(fp,"    st->print(\"#\" INT64_FORMAT, _c%d);\n", i);
-    fprintf(fp,"    st->print(\"/\" PTR64_FORMAT, _c%d);\n", i);
+    fprintf(fp,"    st->print(\"#\" INT64_FORMAT, (int64_t)_c%d);\n", i);
+    fprintf(fp,"    st->print(\"/\" PTR64_FORMAT, (uint64_t)_c%d);\n", i);
     ++i;
   }
   else if (!strcmp(ideal_type, "ConF")) {
@@ -429,7 +429,7 @@
   else if (!strcmp(ideal_type, "ConD")) {
     fprintf(fp,"    st->print(\"#%%f\", _c%d);\n", i);
     fprintf(fp,"    jlong _c%dl = JavaValue(_c%d).get_jlong();\n", i, i);
-    fprintf(fp,"    st->print(\"/\" PTR64_FORMAT, _c%dl);\n", i);
+    fprintf(fp,"    st->print(\"/\" PTR64_FORMAT, (uint64_t)_c%dl);\n", i);
     ++i;
   }
   else if (!strcmp(ideal_type, "Bool")) {
@@ -471,7 +471,7 @@
         if ( string != NameList::_signal ) {
           // Normal string
           // Pass through to st->print
-          fprintf(fp,"  st->print(\"%s\");\n", string);
+          fprintf(fp,"  st->print_raw(\"%s\");\n", string);
         } else {
           // Replacement variable
           const char *rep_var = oper._format->_rep_vars.iter();
@@ -542,7 +542,7 @@
         if ( string != NameList::_signal ) {
           // Normal string
           // Pass through to st->print
-          fprintf(fp,"  st->print(\"%s\");\n", string);
+          fprintf(fp,"  st->print_raw(\"%s\");\n", string);
         } else {
           // Replacement variable
           const char *rep_var = oper._format->_rep_vars.iter();
@@ -669,7 +669,7 @@
       } else if( string == NameList::_signal2 ) // Raw program text
         fputs(inst._format->_strings.iter(), fp);
       else
-        fprintf(fp,"st->print(\"%s\");\n", string);
+        fprintf(fp,"st->print_raw(\"%s\");\n", string);
     } // Done with all format strings
   } // Done generating the user-defined portion of the format
 
@@ -696,13 +696,13 @@
     default:
       assert(0,"ShouldNotReachHere");
     }
-    fprintf(fp,  "  st->print_cr(\"\");\n" );
+    fprintf(fp,  "  st->cr();\n" );
     fprintf(fp,  "  if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\"        No JVM State Info\");\n" );
     fprintf(fp,  "  st->print(\"        # \");\n" );
     fprintf(fp,  "  if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
   }
   else if(inst.is_ideal_safepoint()) {
-    fprintf(fp,  "  st->print(\"\");\n" );
+    fprintf(fp,  "  st->print_raw(\"\");\n" );
     fprintf(fp,  "  if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\"        No JVM State Info\");\n" );
     fprintf(fp,  "  st->print(\"        # \");\n" );
     fprintf(fp,  "  if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
--- a/hotspot/src/share/vm/asm/assembler.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/asm/assembler.cpp	Tue May 27 13:57:42 2014 -0700
@@ -119,7 +119,7 @@
   L.patch_instructions((MacroAssembler*)this);
 }
 
-void AbstractAssembler::generate_stack_overflow_check( int frame_size_in_bytes) {
+void AbstractAssembler::generate_stack_overflow_check(int frame_size_in_bytes) {
   if (UseStackBanging) {
     // Each code entry causes one stack bang n pages down the stack where n
     // is configurable by StackShadowPages.  The setting depends on the maximum
@@ -134,7 +134,7 @@
     // is greater than a page.
 
     const int page_size = os::vm_page_size();
-    int bang_end = StackShadowPages*page_size;
+    int bang_end = StackShadowPages * page_size;
 
     // This is how far the previous frame's stack banging extended.
     const int bang_end_safe = bang_end;
--- a/hotspot/src/share/vm/asm/codeBuffer.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/asm/codeBuffer.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -988,7 +988,7 @@
   for (csize_t step; ptr < end(); ptr += step) {
     step = end() - ptr;
     if (step > jintSize * 4)  step = jintSize * 4;
-    tty->print(PTR_FORMAT ": ", ptr);
+    tty->print(INTPTR_FORMAT ": ", p2i(ptr));
     while (step > 0) {
       tty->print(" " PTR32_FORMAT, *(jint*)ptr);
       ptr += jintSize;
@@ -1098,7 +1098,7 @@
     while (c && c->offset() == offset) {
       stream->bol();
       stream->print("  ;; ");
-      stream->print_cr(c->string());
+      stream->print_cr("%s", c->string());
       c = c->next_comment();
     }
   }
@@ -1154,10 +1154,10 @@
 void CodeSection::print(const char* name) {
   csize_t locs_size = locs_end() - locs_start();
   tty->print_cr(" %7s.code = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d)%s",
-                name, start(), end(), limit(), size(), capacity(),
+                name, p2i(start()), p2i(end()), p2i(limit()), size(), capacity(),
                 is_frozen()? " [frozen]": "");
   tty->print_cr(" %7s.locs = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d) point=%d",
-                name, locs_start(), locs_end(), locs_limit(), locs_size, locs_capacity(), locs_point_off());
+                name, p2i(locs_start()), p2i(locs_end()), p2i(locs_limit()), locs_size, locs_capacity(), locs_point_off());
   if (PrintRelocations) {
     RelocIterator iter(this);
     iter.print();
--- a/hotspot/src/share/vm/asm/codeBuffer.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/asm/codeBuffer.hpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -173,7 +173,7 @@
   bool allocates(address pc) const  { return pc >= _start && pc <  _limit; }
   bool allocates2(address pc) const { return pc >= _start && pc <= _limit; }
 
-  void    set_end(address pc)       { assert(allocates2(pc), err_msg("not in CodeBuffer memory: " PTR_FORMAT " <= " PTR_FORMAT " <= " PTR_FORMAT, _start, pc, _limit)); _end = pc; }
+  void    set_end(address pc)       { assert(allocates2(pc), err_msg("not in CodeBuffer memory: " INTPTR_FORMAT " <= " INTPTR_FORMAT " <= " INTPTR_FORMAT, p2i(_start), p2i(pc), p2i(_limit))); _end = pc; }
   void    set_mark(address pc)      { assert(contains2(pc), "not in codeBuffer");
                                       _mark = pc; }
   void    set_mark_off(int offset)  { assert(contains2(offset+_start),"not in codeBuffer");
--- a/hotspot/src/share/vm/asm/register.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/asm/register.hpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -118,8 +118,8 @@
 ) {
   assert(
     a != b,
-    err_msg_res("registers must be different: a=%d, b=%d",
-                a, b)
+    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT "",
+                p2i(a), p2i(b))
   );
 }
 
@@ -132,8 +132,9 @@
   assert(
     a != b && a != c
            && b != c,
-    err_msg_res("registers must be different: a=%d, b=%d, c=%d",
-                a, b, c)
+    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+                ", c=" INTPTR_FORMAT "",
+                p2i(a), p2i(b), p2i(c))
   );
 }
 
@@ -148,8 +149,9 @@
     a != b && a != c && a != d
            && b != c && b != d
                      && c != d,
-    err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d",
-                a, b, c, d)
+    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT "",
+                p2i(a), p2i(b), p2i(c), p2i(d))
   );
 }
 
@@ -166,8 +168,9 @@
            && b != c && b != d && b != e
                      && c != d && c != e
                                && d != e,
-    err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d",
-                a, b, c, d, e)
+    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT "",
+                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e))
   );
 }
 
@@ -186,8 +189,10 @@
                      && c != d && c != e && c != f
                                && d != e && d != f
                                          && e != f,
-    err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d",
-                a, b, c, d, e, f)
+    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+                ", f=" INTPTR_FORMAT "",
+                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f))
   );
 }
 
@@ -208,8 +213,10 @@
                                && d != e && d != f && d != g
                                          && e != f && e != g
                                                    && f != g,
-    err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d",
-                a, b, c, d, e, f, g)
+    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+                ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT "",
+                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g))
   );
 }
 
@@ -232,8 +239,10 @@
                                          && e != f && e != g && e != h
                                                    && f != g && f != h
                                                              && g != h,
-    err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d",
-                a, b, c, d, e, f, g, h)
+    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+                ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT "",
+                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h))
   );
 }
 
@@ -258,8 +267,11 @@
                                                    && f != g && f != h && f != i
                                                              && g != h && g != i
                                                                        && h != i,
-    err_msg_res("registers must be different: a=%d, b=%d, c=%d, d=%d, e=%d, f=%d, g=%d, h=%d, i=%d",
-                a, b, c, d, e, f, g, h, i)
+    err_msg_res("registers must be different: a=" INTPTR_FORMAT ", b=" INTPTR_FORMAT
+                ", c=" INTPTR_FORMAT ", d=" INTPTR_FORMAT ", e=" INTPTR_FORMAT
+                ", f=" INTPTR_FORMAT ", g=" INTPTR_FORMAT ", h=" INTPTR_FORMAT
+                ", i=" INTPTR_FORMAT "",
+                p2i(a), p2i(b), p2i(c), p2i(d), p2i(e), p2i(f), p2i(g), p2i(h), p2i(i))
   );
 }
 
--- a/hotspot/src/share/vm/c1/c1_CFGPrinter.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_CFGPrinter.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
 
   void inc_indent();
   void dec_indent();
-  void print(const char* format, ...);
+  void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
   void print_begin(const char* tag);
   void print_end(const char* tag);
 
@@ -161,7 +161,7 @@
 
   print("name \"%s\"", method_name(_compilation->method(), true));
   print("method \"%s\"", method_name(_compilation->method()));
-  print("date "INT64_FORMAT, os::javaTimeMillis());
+  print("date "INT64_FORMAT, (int64_t) os::javaTimeMillis());
 
   print_end("compilation");
 }
--- a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp	Tue May 27 13:57:42 2014 -0700
@@ -450,9 +450,11 @@
 class DeoptimizeStub : public CodeStub {
 private:
   CodeEmitInfo* _info;
+  jint _trap_request;
 
 public:
-  DeoptimizeStub(CodeEmitInfo* info) : _info(new CodeEmitInfo(info)) {}
+  DeoptimizeStub(CodeEmitInfo* info, Deoptimization::DeoptReason reason, Deoptimization::DeoptAction action) :
+    _info(new CodeEmitInfo(info)), _trap_request(Deoptimization::make_trap_request(reason, action)) {}
 
   virtual void emit_code(LIR_Assembler* e);
   virtual CodeEmitInfo* info() const           { return _info; }
--- a/hotspot/src/share/vm/c1/c1_Compilation.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_Compilation.hpp	Tue May 27 13:57:42 2014 -0700
@@ -251,6 +251,10 @@
     return env()->comp_level() == CompLevel_full_profile &&
       C1UpdateMethodData && MethodData::profile_return();
   }
+  bool age_code() const {
+    return _method->profile_aging();
+  }
+
   // will compilation make optimistic assumptions that might lead to
   // deoptimization and that the runtime will account for?
   bool is_optimistic() const                             {
--- a/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_InstructionPrinter.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -134,23 +134,23 @@
     if (value->is_null_object()) {
       output()->print("null");
     } else if (!value->is_loaded()) {
-      output()->print("<unloaded object " PTR_FORMAT ">", value);
+      output()->print("<unloaded object " INTPTR_FORMAT ">", p2i(value));
     } else {
-      output()->print("<object " PTR_FORMAT " klass=", value->constant_encoding());
+      output()->print("<object " INTPTR_FORMAT " klass=", p2i(value->constant_encoding()));
       print_klass(value->klass());
       output()->print(">");
     }
   } else if (type->as_InstanceConstant() != NULL) {
     ciInstance* value = type->as_InstanceConstant()->value();
     if (value->is_loaded()) {
-      output()->print("<instance " PTR_FORMAT " klass=", value->constant_encoding());
+      output()->print("<instance " INTPTR_FORMAT " klass=", p2i(value->constant_encoding()));
       print_klass(value->klass());
       output()->print(">");
     } else {
-      output()->print("<unloaded instance " PTR_FORMAT ">", value);
+      output()->print("<unloaded instance " INTPTR_FORMAT ">", p2i(value));
     }
   } else if (type->as_ArrayConstant() != NULL) {
-    output()->print("<array " PTR_FORMAT ">", type->as_ArrayConstant()->value()->constant_encoding());
+    output()->print("<array " INTPTR_FORMAT ">", p2i(type->as_ArrayConstant()->value()->constant_encoding()));
   } else if (type->as_ClassConstant() != NULL) {
     ciInstanceKlass* klass = type->as_ClassConstant()->value();
     if (!klass->is_loaded()) {
@@ -268,7 +268,7 @@
 
 
 void InstructionPrinter::print_unsafe_op(UnsafeOp* op, const char* name) {
-  output()->print(name);
+  output()->print("%s", name);
   output()->print(".(");
 }
 
@@ -479,7 +479,7 @@
   if (x->declared_type()->is_klass())
     print_klass(x->declared_type()->as_klass());
   else
-    output()->print(type2name(x->declared_type()->basic_type()));
+    output()->print("%s", type2name(x->declared_type()->basic_type()));
 }
 
 
--- a/hotspot/src/share/vm/c1/c1_LIR.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIR.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1563,15 +1563,15 @@
   } else if (is_virtual()) {
     out->print("R%d", vreg_number());
   } else if (is_single_cpu()) {
-    out->print(as_register()->name());
+    out->print("%s", as_register()->name());
   } else if (is_double_cpu()) {
-    out->print(as_register_hi()->name());
-    out->print(as_register_lo()->name());
+    out->print("%s", as_register_hi()->name());
+    out->print("%s", as_register_lo()->name());
 #if defined(X86)
   } else if (is_single_xmm()) {
-    out->print(as_xmm_float_reg()->name());
+    out->print("%s", as_xmm_float_reg()->name());
   } else if (is_double_xmm()) {
-    out->print(as_xmm_double_reg()->name());
+    out->print("%s", as_xmm_double_reg()->name());
   } else if (is_single_fpu()) {
     out->print("fpu%d", fpu_regnr());
   } else if (is_double_fpu()) {
@@ -1583,9 +1583,9 @@
     out->print("d%d", fpu_regnrLo() >> 1);
 #else
   } else if (is_single_fpu()) {
-    out->print(as_float_reg()->name());
+    out->print("%s", as_float_reg()->name());
   } else if (is_double_fpu()) {
-    out->print(as_double_reg()->name());
+    out->print("%s", as_double_reg()->name());
 #endif
 
   } else if (is_illegal()) {
@@ -1611,9 +1611,9 @@
     case T_LONG:   out->print("lng:" JLONG_FORMAT, as_jlong()); break;
     case T_FLOAT:  out->print("flt:%f",   as_jfloat());         break;
     case T_DOUBLE: out->print("dbl:%f",   as_jdouble());        break;
-    case T_OBJECT: out->print("obj:0x%x", as_jobject());        break;
-    case T_METADATA: out->print("metadata:0x%x", as_metadata());break;
-    default:       out->print("%3d:0x%x",type(), as_jdouble()); break;
+    case T_OBJECT: out->print("obj:" INTPTR_FORMAT, p2i(as_jobject()));        break;
+    case T_METADATA: out->print("metadata:" INTPTR_FORMAT, p2i(as_metadata()));break;
+    default:       out->print("%3d:0x" UINT64_FORMAT_X, type(), (uint64_t)as_jlong()); break;
   }
 }
 
@@ -1629,7 +1629,7 @@
     case times_8: out->print(" * 8"); break;
     }
   }
-  out->print(" Disp: %d", _disp);
+  out->print(" Disp: " INTX_FORMAT, _disp);
 }
 
 // debug output of block header without InstructionPrinter
@@ -1703,7 +1703,7 @@
   } else {
     out->print("     ");
   }
-  out->print(name()); out->print(" ");
+  out->print("%s ", name());
   print_instr(out);
   if (info() != NULL) out->print(" [bci:%d]", info()->stack()->bci());
 #ifdef ASSERT
@@ -1833,7 +1833,7 @@
 // LIR_OpJavaCall
 void LIR_OpJavaCall::print_instr(outputStream* out) const {
   out->print("call: ");
-  out->print("[addr: 0x%x]", address());
+  out->print("[addr: " INTPTR_FORMAT "]", p2i(address()));
   if (receiver()->is_valid()) {
     out->print(" [recv: ");   receiver()->print(out);   out->print("]");
   }
@@ -1844,7 +1844,7 @@
 
 // LIR_OpLabel
 void LIR_OpLabel::print_instr(outputStream* out) const {
-  out->print("[label:0x%x]", _label);
+  out->print("[label:" INTPTR_FORMAT "]", p2i(_label));
 }
 
 // LIR_OpArrayCopy
@@ -1911,7 +1911,7 @@
 // LIR_Op1
 void LIR_OpRTCall::print_instr(outputStream* out) const {
   intx a = (intx)addr();
-  out->print(Runtime1::name_for_address(addr()));
+  out->print("%s", Runtime1::name_for_address(addr()));
   out->print(" ");
   tmp()->print(out);
 }
@@ -1934,10 +1934,10 @@
   } else if (stub() != NULL) {
     out->print("[");
     stub()->print_name(out);
-    out->print(": 0x%x]", stub());
+    out->print(": " INTPTR_FORMAT "]", p2i(stub()));
     if (stub()->info() != NULL) out->print(" [bci:%d]", stub()->info()->stack()->bci());
   } else {
-    out->print("[label:0x%x] ", label());
+    out->print("[label:" INTPTR_FORMAT "] ", p2i(label()));
   }
   if (ublock() != NULL) {
     out->print("unordered: [B%d] ", ublock()->block_id());
@@ -2004,7 +2004,7 @@
   tmp4()->print(out);                       out->print(" ");
   out->print("[hdr:%d]", header_size()); out->print(" ");
   out->print("[obj:%d]", object_size()); out->print(" ");
-  out->print("[lbl:0x%x]", stub()->entry());
+  out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry()));
 }
 
 void LIR_OpRoundFP::print_instr(outputStream* out) const {
@@ -2037,7 +2037,7 @@
   tmp3()->print(out);                    out->print(" ");
   tmp4()->print(out);                    out->print(" ");
   out->print("[type:0x%x]", type());     out->print(" ");
-  out->print("[label:0x%x]", stub()->entry());
+  out->print("[label:" INTPTR_FORMAT "]", p2i(stub()->entry()));
 }
 
 
@@ -2074,7 +2074,7 @@
   if (_scratch->is_valid()) {
     _scratch->print(out);  out->print(" ");
   }
-  out->print("[lbl:0x%x]", stub()->entry());
+  out->print("[lbl:" INTPTR_FORMAT "]", p2i(stub()->entry()));
 }
 
 #ifdef ASSERT
@@ -2082,7 +2082,7 @@
   print_condition(out, condition()); out->print(" ");
   in_opr1()->print(out);             out->print(" ");
   in_opr2()->print(out);             out->print(", \"");
-  out->print(msg());                 out->print("\"");
+  out->print("%s", msg());          out->print("\"");
 }
 #endif
 
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Tue May 27 13:57:42 2014 -0700
@@ -2782,7 +2782,10 @@
       __ lock_object(syncTempOpr(), obj, lock, new_register(T_OBJECT), slow_path, NULL);
     }
   }
-
+  if (compilation()->age_code()) {
+    CodeEmitInfo* info = new CodeEmitInfo(scope()->start()->state()->copy(ValueStack::StateBefore, 0), NULL, false);
+    decrement_age(info);
+  }
   // increment invocation counters if needed
   if (!method()->is_accessor()) { // Accessors do not have MDOs, so no counting.
     profile_parameters(x);
@@ -3328,6 +3331,27 @@
   increment_event_counter_impl(info, info->scope()->method(), (1 << freq_log) - 1, bci, backedge, true);
 }
 
+void LIRGenerator::decrement_age(CodeEmitInfo* info) {
+  ciMethod* method = info->scope()->method();
+  MethodCounters* mc_adr = method->ensure_method_counters();
+  if (mc_adr != NULL) {
+    LIR_Opr mc = new_pointer_register();
+    __ move(LIR_OprFact::intptrConst(mc_adr), mc);
+    int offset = in_bytes(MethodCounters::nmethod_age_offset());
+    LIR_Address* counter = new LIR_Address(mc, offset, T_INT);
+    LIR_Opr result = new_register(T_INT);
+    __ load(counter, result);
+    __ sub(result, LIR_OprFact::intConst(1), result);
+    __ store(result, counter);
+    // DeoptimizeStub will reexecute from the current state in code info.
+    CodeStub* deopt = new DeoptimizeStub(info, Deoptimization::Reason_tenured,
+                                         Deoptimization::Action_make_not_entrant);
+    __ cmp(lir_cond_lessEqual, result, LIR_OprFact::intConst(0));
+    __ branch(lir_cond_lessEqual, T_INT, deopt);
+  }
+}
+
+
 void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info,
                                                 ciMethod *method, int frequency,
                                                 int bci, bool backedge, bool notify) {
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp	Tue May 27 13:57:42 2014 -0700
@@ -372,7 +372,7 @@
       increment_event_counter(info, bci, true);
     }
   }
-
+  void decrement_age(CodeEmitInfo* info);
   CodeEmitInfo* state_for(Instruction* x, ValueStack* state, bool ignore_xhandler = false);
   CodeEmitInfo* state_for(Instruction* x);
 
--- a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,10 +62,10 @@
   _optimistic = ir->compilation()->is_optimistic();
 
   TRACE_RANGE_CHECK_ELIMINATION(
-    tty->print_cr("");
+    tty->cr();
     tty->print_cr("Range check elimination");
     ir->method()->print_name(tty);
-    tty->print_cr("");
+    tty->cr();
   );
 
   TRACE_RANGE_CHECK_ELIMINATION(
@@ -1024,7 +1024,7 @@
                                                          tty->print("i%d", phi->id());
                                                          tty->print(": ");
                                                          bound->print();
-                                                         tty->print_cr("");
+                                                         tty->cr();
                            );
                          }
                      });
@@ -1039,7 +1039,7 @@
                                             tty->print("i%d", instr->id());
                                             tty->print(": ");
                                             bound->print();
-                                            tty->print_cr("");
+                                            tty->cr();
               );
           }
         }
@@ -1400,7 +1400,7 @@
 
 // print
 void RangeCheckEliminator::Bound::print() {
-  tty->print("");
+  tty->print("%s", "");
   if (this->_lower_instr || this->_lower != min_jint) {
     if (this->_lower_instr) {
       tty->print("i%d", this->_lower_instr->id());
--- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -532,8 +532,8 @@
     if (TraceExceptions) {
       ttyLocker ttyl;
       ResourceMark rm;
-      tty->print_cr("Exception <%s> (0x%x) thrown in compiled method <%s> at PC " PTR_FORMAT " for thread 0x%x",
-                    exception->print_value_string(), (address)exception(), nm->method()->print_value_string(), pc, thread);
+      tty->print_cr("Exception <%s> (" INTPTR_FORMAT ") thrown in compiled method <%s> at PC " INTPTR_FORMAT " for thread " INTPTR_FORMAT "",
+                    exception->print_value_string(), p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread));
     }
     // for AbortVMOnException flag
     NOT_PRODUCT(Exceptions::debug_check_abort(exception));
@@ -563,7 +563,7 @@
     ttyLocker ttyl;
     ResourceMark rm;
     tty->print_cr("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT " for exception thrown at PC " PTR_FORMAT,
-                  thread, continuation, pc);
+                  p2i(thread), p2i(continuation), p2i(pc));
   }
 
   return continuation;
@@ -685,19 +685,32 @@
 JRT_END
 
 // Cf. OptoRuntime::deoptimize_caller_frame
-JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread))
+JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread, jint trap_request))
   // Called from within the owner thread, so no need for safepoint
   RegisterMap reg_map(thread, false);
   frame stub_frame = thread->last_frame();
-  assert(stub_frame.is_runtime_frame(), "sanity check");
+  assert(stub_frame.is_runtime_frame(), "Sanity check");
   frame caller_frame = stub_frame.sender(&reg_map);
+  nmethod* nm = caller_frame.cb()->as_nmethod_or_null();
+  assert(nm != NULL, "Sanity check");
+  methodHandle method(thread, nm->method());
+  assert(nm == CodeCache::find_nmethod(caller_frame.pc()), "Should be the same");
+  Deoptimization::DeoptAction action = Deoptimization::trap_request_action(trap_request);
+  Deoptimization::DeoptReason reason = Deoptimization::trap_request_reason(trap_request);
 
-  // We are coming from a compiled method; check this is true.
-  assert(CodeCache::find_nmethod(caller_frame.pc()) != NULL, "sanity");
+  if (action == Deoptimization::Action_make_not_entrant) {
+    if (nm->make_not_entrant()) {
+      if (reason == Deoptimization::Reason_tenured) {
+        MethodData* trap_mdo = Deoptimization::get_method_data(thread, method, true /*create_if_missing*/);
+        if (trap_mdo != NULL) {
+          trap_mdo->inc_tenure_traps();
+        }
+      }
+    }
+  }
 
   // Deoptimize the caller frame.
   Deoptimization::deoptimize_frame(thread, caller_frame.id());
-
   // Return to the now deoptimized frame.
 JRT_END
 
@@ -988,8 +1001,8 @@
         address copy_buff = stub_location - *byte_skip - *byte_count;
         address being_initialized_entry = stub_location - *being_initialized_entry_offset;
         if (TracePatching) {
-          tty->print_cr(" Patching %s at bci %d at address 0x%x  (%s)", Bytecodes::name(code), bci,
-                        instr_pc, (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass");
+          tty->print_cr(" Patching %s at bci %d at address " INTPTR_FORMAT "  (%s)", Bytecodes::name(code), bci,
+                        p2i(instr_pc), (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass");
           nmethod* caller_code = CodeCache::find_nmethod(caller_frame.pc());
           assert(caller_code != NULL, "nmethod not found");
 
@@ -1448,7 +1461,7 @@
     methodHandle inlinee = methodHandle(vfst.method());
     inlinee->print_short_name(&ss1);
     m->print_short_name(&ss2);
-    tty->print_cr("Predicate failed trap in method %s at bci %d inlined in %s at pc %x", ss1.as_string(), vfst.bci(), ss2.as_string(), caller_frame.pc());
+    tty->print_cr("Predicate failed trap in method %s at bci %d inlined in %s at pc " INTPTR_FORMAT, ss1.as_string(), vfst.bci(), ss2.as_string(), p2i(caller_frame.pc()));
   }
 
 
--- a/hotspot/src/share/vm/c1/c1_Runtime1.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.hpp	Tue May 27 13:57:42 2014 -0700
@@ -156,7 +156,7 @@
   static void monitorenter(JavaThread* thread, oopDesc* obj, BasicObjectLock* lock);
   static void monitorexit (JavaThread* thread, BasicObjectLock* lock);
 
-  static void deoptimize(JavaThread* thread);
+  static void deoptimize(JavaThread* thread, jint trap_request);
 
   static int access_field_patching(JavaThread* thread);
   static int move_klass_patching(JavaThread* thread);
--- a/hotspot/src/share/vm/c1/c1_ValueType.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_ValueType.hpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -175,7 +175,7 @@
   ValueType* join(ValueType* y) const;
 
   // debugging
-  void print(outputStream* s = tty)              { s->print(name()); }
+  void print(outputStream* s = tty)              { s->print("%s", name()); }
 };
 
 
--- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -158,6 +158,9 @@
 
 void BCEscapeAnalyzer::set_method_escape(ArgumentMap vars) {
   clear_bits(vars, _arg_local);
+  if (vars.contains_allocated()) {
+    _allocated_escapes = true;
+  }
 }
 
 void BCEscapeAnalyzer::set_global_escape(ArgumentMap vars, bool merge) {
@@ -1287,10 +1290,10 @@
         tty->print_cr("class of method is not initialized.");
       else if (_level > MaxBCEAEstimateLevel)
         tty->print_cr("level (%d) exceeds MaxBCEAEstimateLevel (%d).",
-                      _level, MaxBCEAEstimateLevel);
+                      _level, (int) MaxBCEAEstimateLevel);
       else if (method()->code_size() > MaxBCEAEstimateSize)
-        tty->print_cr("code size (%d) exceeds MaxBCEAEstimateSize.",
-                      method()->code_size(), MaxBCEAEstimateSize);
+        tty->print_cr("code size (%d) exceeds MaxBCEAEstimateSize (%d).",
+                      method()->code_size(), (int) MaxBCEAEstimateSize);
       else
         ShouldNotReachHere();
     }
--- a/hotspot/src/share/vm/ci/ciConstant.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciConstant.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@
     tty->print("%d", _value._int);
     break;
   case T_LONG:
-    tty->print(INT64_FORMAT, _value._long);
+    tty->print(INT64_FORMAT, (int64_t)(_value._long));
     break;
   case T_FLOAT:
     tty->print("%f", _value._float);
--- a/hotspot/src/share/vm/ci/ciEnv.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciEnv.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1250,8 +1250,7 @@
       if (replay_data_file != NULL) {
         fileStream replay_data_stream(replay_data_file, /*need_close=*/true);
         dump_replay_data(&replay_data_stream);
-        tty->print("# Compiler replay data is saved as: ");
-        tty->print_cr(buffer);
+        tty->print_cr("# Compiler replay data is saved as: %s", buffer);
       } else {
         tty->print_cr("# Can't open file to dump replay data.");
       }
@@ -1274,7 +1273,7 @@
         )
         replay_data_stream.flush();
         tty->print("# Compiler inline data is saved as: ");
-        tty->print_cr(buffer);
+        tty->print_cr("%s", buffer);
       } else {
         tty->print_cr("# Can't open file to dump inline data.");
       }
--- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -292,7 +292,7 @@
 // Implementation of the print method.
 void ciInstanceKlass::print_impl(outputStream* st) {
   ciKlass::print_impl(st);
-  GUARDED_VM_ENTRY(st->print(" loader=0x%x", (address)loader());)
+  GUARDED_VM_ENTRY(st->print(" loader=" INTPTR_FORMAT, p2i((address)loader()));)
   if (is_loaded()) {
     st->print(" loaded=true initialized=%s finalized=%s subklass=%s size=%d flags=",
               bool_to_str(is_initialized()),
@@ -618,7 +618,7 @@
         case T_SHORT:   _out->print_cr("%d", mirror->short_field(fd->offset()));  break;
         case T_CHAR:    _out->print_cr("%d", mirror->char_field(fd->offset()));   break;
         case T_INT:     _out->print_cr("%d", mirror->int_field(fd->offset()));    break;
-        case T_LONG:    _out->print_cr(INT64_FORMAT, mirror->long_field(fd->offset()));   break;
+        case T_LONG:    _out->print_cr(INT64_FORMAT, (int64_t)(mirror->long_field(fd->offset())));   break;
         case T_FLOAT: {
           float f = mirror->float_field(fd->offset());
           _out->print_cr("%d", *(int*)&f);
@@ -626,7 +626,7 @@
         }
         case T_DOUBLE: {
           double d = mirror->double_field(fd->offset());
-          _out->print_cr(INT64_FORMAT, *(jlong*)&d);
+          _out->print_cr(INT64_FORMAT, *(int64_t*)&d);
           break;
         }
         case T_ARRAY: {
@@ -656,7 +656,7 @@
               _out->print_cr("\"");
             } else {
               const char* klass_name  = value->klass()->name()->as_quoted_ascii();
-              _out->print_cr(klass_name);
+              _out->print_cr("%s", klass_name);
             }
           } else {
             ShouldNotReachHere();
--- a/hotspot/src/share/vm/ci/ciMetadata.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciMetadata.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
 void ciMetadata::print(outputStream* st) {
   st->print("<%s", type_string());
   GUARDED_VM_ENTRY(print_impl(st);)
-  st->print(" ident=%d address=0x%x>", ident(), (address)this);
+  st->print(" ident=%d address=" INTPTR_FORMAT ">", ident(), p2i((address)this));
 }
 
 
--- a/hotspot/src/share/vm/ci/ciMethod.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciMethod.cpp	Tue May 27 13:57:42 2014 -0700
@@ -129,6 +129,7 @@
   constantPoolHandle cpool = h_m()->constants();
   _signature = new (env->arena()) ciSignature(_holder, cpool, sig_symbol);
   _method_data = NULL;
+  _nmethod_age = h_m()->nmethod_age();
   // Take a snapshot of these values, so they will be commensurate with the MDO.
   if (ProfileInterpreter || TieredCompilation) {
     int invcnt = h_m()->interpreter_invocation_count();
@@ -1276,6 +1277,14 @@
 }
 
 // ------------------------------------------------------------------
+// ciMethod::profile_aging
+//
+// Should the method be compiled with an age counter?
+bool ciMethod::profile_aging() const {
+  return UseCodeAging && (!MethodCounters::is_nmethod_hot(nmethod_age()) &&
+                          !MethodCounters::is_nmethod_age_unset(nmethod_age()));
+}
+// ------------------------------------------------------------------
 // ciMethod::print_codes
 //
 // Print the bytecodes for this method.
--- a/hotspot/src/share/vm/ci/ciMethod.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciMethod.hpp	Tue May 27 13:57:42 2014 -0700
@@ -68,6 +68,7 @@
   int _max_locals;
   vmIntrinsics::ID _intrinsic_id;
   int _handler_count;
+  int _nmethod_age;
   int _interpreter_invocation_count;
   int _interpreter_throwout_count;
   int _instructions_size;
@@ -168,6 +169,10 @@
   int interpreter_invocation_count() const       { check_is_loaded(); return _interpreter_invocation_count; }
   int interpreter_throwout_count() const         { check_is_loaded(); return _interpreter_throwout_count; }
   int size_of_parameters() const                 { check_is_loaded(); return _size_of_parameters; }
+  int nmethod_age() const                        { check_is_loaded(); return _nmethod_age; }
+
+  // Should the method be compiled with an age counter?
+  bool profile_aging() const;
 
   // Code size for inlining decisions.
   int code_size_for_inlining();
--- a/hotspot/src/share/vm/ci/ciMethodData.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciMethodData.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -177,7 +177,7 @@
 
 
 void ciTypeStackSlotEntries::translate_type_data_from(const TypeStackSlotEntries* entries) {
-  for (int i = 0; i < _number_of_entries; i++) {
+  for (int i = 0; i < number_of_entries(); i++) {
     intptr_t k = entries->type(i);
     TypeStackSlotEntries::set_type(i, translate_klass(k));
   }
@@ -242,7 +242,6 @@
 }
 
 ciProfileData* ciMethodData::bci_to_extra_data(int bci, ciMethod* m, bool& two_free_slots) {
-  // bci_to_extra_data(bci) ...
   DataLayout* dp  = data_layout_at(data_size());
   DataLayout* end = data_layout_at(data_size() + extra_data_size());
   two_free_slots = false;
@@ -506,6 +505,63 @@
   ciMetadata::print_impl(st);
 }
 
+void ciMethodData::dump_replay_data_type_helper(outputStream* out, int round, int& count, ProfileData* pdata, ByteSize offset, ciKlass* k) {
+  if (k != NULL) {
+    if (round == 0) {
+      count++;
+    } else {
+      out->print(" %d %s", (int)(dp_to_di(pdata->dp() + in_bytes(offset)) / sizeof(intptr_t)), k->name()->as_quoted_ascii());
+    }
+  }
+}
+
+template<class T> void ciMethodData::dump_replay_data_receiver_type_helper(outputStream* out, int round, int& count, T* vdata) {
+  for (uint i = 0; i < vdata->row_limit(); i++) {
+    dump_replay_data_type_helper(out, round, count, vdata, vdata->receiver_offset(i), vdata->receiver(i));
+  }
+}
+
+template<class T> void ciMethodData::dump_replay_data_call_type_helper(outputStream* out, int round, int& count, T* call_type_data) {
+  if (call_type_data->has_arguments()) {
+    for (int i = 0; i < call_type_data->number_of_arguments(); i++) {
+      dump_replay_data_type_helper(out, round, count, call_type_data, call_type_data->argument_type_offset(i), call_type_data->valid_argument_type(i));
+    }
+  }
+  if (call_type_data->has_return()) {
+    dump_replay_data_type_helper(out, round, count, call_type_data, call_type_data->return_type_offset(), call_type_data->valid_return_type());
+  }
+}
+
+void ciMethodData::dump_replay_data_extra_data_helper(outputStream* out, int round, int& count) {
+  DataLayout* dp  = data_layout_at(data_size());
+  DataLayout* end = data_layout_at(data_size() + extra_data_size());
+
+  for (;dp < end; dp = MethodData::next_extra(dp)) {
+    switch(dp->tag()) {
+    case DataLayout::no_tag:
+    case DataLayout::arg_info_data_tag:
+      return;
+    case DataLayout::bit_data_tag:
+      break;
+    case DataLayout::speculative_trap_data_tag: {
+      ciSpeculativeTrapData* data = new ciSpeculativeTrapData(dp);
+      ciMethod* m = data->method();
+      if (m != NULL) {
+        if (round == 0) {
+          count++;
+        } else {
+          out->print(" %d ", (int)(dp_to_di(((address)dp) + in_bytes(ciSpeculativeTrapData::method_offset())) / sizeof(intptr_t)));
+          m->dump_name_as_ascii(out);
+        }
+      }
+      break;
+    }
+    default:
+      fatal(err_msg("bad tag = %d", dp->tag()));
+    }
+  }
+}
+
 void ciMethodData::dump_replay_data(outputStream* out) {
   ResourceMark rm;
   MethodData* mdo = get_MethodData();
@@ -527,7 +583,7 @@
   }
 
   // dump the MDO data as raw data
-  int elements = data_size() / sizeof(intptr_t);
+  int elements = (data_size() + extra_data_size()) / sizeof(intptr_t);
   out->print(" data %d", elements);
   for (int i = 0; i < elements; i++) {
     // We could use INTPTR_FORMAT here but that's a zero justified
@@ -544,37 +600,35 @@
   // and emit pairs of offset and klass name so that they can be
   // reconstructed at runtime.  The first round counts the number of
   // oop references and the second actually emits them.
-  int count = 0;
-  for (int round = 0; round < 2; round++) {
+  ciParametersTypeData* parameters = parameters_type_data();
+  for (int count = 0, round = 0; round < 2; round++) {
     if (round == 1) out->print(" oops %d", count);
     ProfileData* pdata = first_data();
     for ( ; is_valid(pdata); pdata = next_data(pdata)) {
-      if (pdata->is_ReceiverTypeData()) {
+      if (pdata->is_VirtualCallData()) {
+        ciVirtualCallData* vdata = (ciVirtualCallData*)pdata;
+        dump_replay_data_receiver_type_helper<ciVirtualCallData>(out, round, count, vdata);
+        if (pdata->is_VirtualCallTypeData()) {
+          ciVirtualCallTypeData* call_type_data = (ciVirtualCallTypeData*)pdata;
+          dump_replay_data_call_type_helper<ciVirtualCallTypeData>(out, round, count, call_type_data);
+        }
+      } else if (pdata->is_ReceiverTypeData()) {
         ciReceiverTypeData* vdata = (ciReceiverTypeData*)pdata;
-        for (uint i = 0; i < vdata->row_limit(); i++) {
-          ciKlass* k = vdata->receiver(i);
-          if (k != NULL) {
-            if (round == 0) {
-              count++;
-            } else {
-              out->print(" %d %s", dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t), k->name()->as_quoted_ascii());
-            }
-          }
-        }
-      } else if (pdata->is_VirtualCallData()) {
-        ciVirtualCallData* vdata = (ciVirtualCallData*)pdata;
-        for (uint i = 0; i < vdata->row_limit(); i++) {
-          ciKlass* k = vdata->receiver(i);
-          if (k != NULL) {
-            if (round == 0) {
-              count++;
-            } else {
-              out->print(" %d %s", dp_to_di(vdata->dp() + in_bytes(vdata->receiver_offset(i))) / sizeof(intptr_t), k->name()->as_quoted_ascii());
-            }
-          }
-        }
+        dump_replay_data_receiver_type_helper<ciReceiverTypeData>(out, round, count, vdata);
+      } else if (pdata->is_CallTypeData()) {
+          ciCallTypeData* call_type_data = (ciCallTypeData*)pdata;
+          dump_replay_data_call_type_helper<ciCallTypeData>(out, round, count, call_type_data);
       }
     }
+    if (parameters != NULL) {
+      for (int i = 0; i < parameters->number_of_parameters(); i++) {
+        dump_replay_data_type_helper(out, round, count, parameters, ParametersTypeData::type_offset(i), parameters->valid_parameter_type(i));
+      }
+    }
+  }
+  for (int count = 0, round = 0; round < 2; round++) {
+    if (round == 1) out->print(" methods %d", count);
+    dump_replay_data_extra_data_helper(out, round, count);
   }
   out->cr();
 }
@@ -586,6 +640,10 @@
 
 void ciMethodData::print_data_on(outputStream* st) {
   ResourceMark rm;
+  ciParametersTypeData* parameters = parameters_type_data();
+  if (parameters != NULL) {
+    parameters->print_data_on(st);
+  }
   ciProfileData* data;
   for (data = first_data(); is_valid(data); data = next_data(data)) {
     st->print("%d", dp_to_di(data->dp()));
@@ -607,6 +665,9 @@
       data = new ciArgInfoData(dp);
       dp = end; // ArgInfoData is at the end of extra data section.
       break;
+    case DataLayout::speculative_trap_data_tag:
+      data = new ciSpeculativeTrapData(dp);
+      break;
     default:
       fatal(err_msg("unexpected tag %d", dp->tag()));
     }
@@ -631,7 +692,7 @@
 }
 
 void ciTypeStackSlotEntries::print_data_on(outputStream* st) const {
-  for (int i = 0; i < _number_of_entries; i++) {
+  for (int i = 0; i < number_of_entries(); i++) {
     _pd->tab(st);
     st->print("%d: stack (%u) ", i, stack_slot(i));
     print_ciklass(st, type(i));
@@ -650,12 +711,12 @@
   print_shared(st, "ciCallTypeData", extra);
   if (has_arguments()) {
     tab(st, true);
-    st->print("argument types");
+    st->print_cr("argument types");
     args()->print_data_on(st);
   }
   if (has_return()) {
     tab(st, true);
-    st->print("return type");
+    st->print_cr("return type");
     ret()->print_data_on(st);
   }
 }
--- a/hotspot/src/share/vm/ci/ciMethodData.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciMethodData.hpp	Tue May 27 13:57:42 2014 -0700
@@ -45,7 +45,7 @@
 class ciCallTypeData;
 class ciVirtualCallTypeData;
 class ciParametersTypeData;
-class ciSpeculativeTrapData;;
+class ciSpeculativeTrapData;
 
 typedef ProfileData ciProfileData;
 
@@ -175,7 +175,7 @@
   }
 
 #ifndef PRODUCT
-  void print_data_on(outputStream* st, const char* extra) const;
+  void print_data_on(outputStream* st, const char* extra = NULL) const;
 #endif
 };
 
@@ -202,7 +202,7 @@
   }
   void translate_receiver_data_from(const ProfileData* data);
 #ifndef PRODUCT
-  void print_data_on(outputStream* st, const char* extra) const;
+  void print_data_on(outputStream* st, const char* extra = NULL) const;
   void print_receiver_data_on(outputStream* st) const;
 #endif
 };
@@ -227,7 +227,7 @@
     rtd_super()->translate_receiver_data_from(data);
   }
 #ifndef PRODUCT
-  void print_data_on(outputStream* st, const char* extra) const;
+  void print_data_on(outputStream* st, const char* extra = NULL) const;
 #endif
 };
 
@@ -289,7 +289,7 @@
   }
 
 #ifndef PRODUCT
-  void print_data_on(outputStream* st, const char* extra) const;
+  void print_data_on(outputStream* st, const char* extra = NULL) const;
 #endif
 };
 
@@ -338,7 +338,7 @@
   }
 
 #ifndef PRODUCT
-  void print_data_on(outputStream* st, const char* extra) const;
+  void print_data_on(outputStream* st, const char* extra = NULL) const;
 #endif
 };
 
@@ -349,15 +349,15 @@
   virtual void translate_from(const ProfileData* data);
 
   ciMethod* method() const {
-    return (ciMethod*)intptr_at(method_offset);
+    return (ciMethod*)intptr_at(speculative_trap_method);
   }
 
   void set_method(ciMethod* m) {
-    set_intptr_at(method_offset, (intptr_t)m);
+    set_intptr_at(speculative_trap_method, (intptr_t)m);
   }
 
 #ifndef PRODUCT
-  void print_data_on(outputStream* st, const char* extra) const;
+  void print_data_on(outputStream* st, const char* extra = NULL) const;
 #endif
 };
 
@@ -406,8 +406,8 @@
   // Coherent snapshot of original header.
   MethodData _orig;
 
-  // Dedicated area dedicated to parameters. Null if no parameter
-  // profiling for this method.
+  // Area dedicated to parameters. NULL if no parameter profiling for
+  // this method.
   DataLayout* _parameters;
 
   ciMethodData(MethodData* md);
@@ -467,6 +467,11 @@
   void load_extra_data();
   ciProfileData* bci_to_extra_data(int bci, ciMethod* m, bool& two_free_slots);
 
+  void dump_replay_data_type_helper(outputStream* out, int round, int& count, ProfileData* pdata, ByteSize offset, ciKlass* k);
+  template<class T> void dump_replay_data_call_type_helper(outputStream* out, int round, int& count, T* call_type_data);
+  template<class T> void dump_replay_data_receiver_type_helper(outputStream* out, int round, int& count, T* call_type_data);
+  void dump_replay_data_extra_data_helper(outputStream* out, int round, int& count);
+
 public:
   bool is_method_data() const { return true; }
 
--- a/hotspot/src/share/vm/ci/ciObject.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciObject.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -213,9 +213,9 @@
 void ciObject::print(outputStream* st) {
   st->print("<%s", type_string());
   GUARDED_VM_ENTRY(print_impl(st);)
-  st->print(" ident=%d %s address=0x%x>", ident(),
+  st->print(" ident=%d %s address=" INTPTR_FORMAT ">", ident(),
         is_scavengable() ? "SCAVENGABLE" : "",
-        (address)this);
+        p2i((address)this));
 }
 
 // ------------------------------------------------------------------
--- a/hotspot/src/share/vm/ci/ciReplay.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciReplay.cpp	Tue May 27 13:57:42 2014 -0700
@@ -48,11 +48,14 @@
 
   intptr_t* _data;
   char*     _orig_data;
-  jobject*  _oops_handles;
-  int*      _oops_offsets;
+  Klass**   _classes;
+  Method**  _methods;
+  int*      _classes_offsets;
+  int*      _methods_offsets;
   int       _data_length;
   int       _orig_data_length;
-  int       _oops_length;
+  int       _classes_length;
+  int       _methods_length;
 } ciMethodDataRecord;
 
 typedef struct _ciMethodRecord {
@@ -565,7 +568,7 @@
     rec->_instructions_size = parse_int("instructions_size");
   }
 
-  // ciMethodData <klass> <name> <signature> <state> <current mileage> orig <length> # # ... data <length> # # ... oops <length>
+  // ciMethodData <klass> <name> <signature> <state> <current mileage> orig <length> # # ... data <length> # # ... oops <length> # ... methods <length>
   void process_ciMethodData(TRAPS) {
     Method* method = parse_method(CHECK);
     if (had_error()) return;
@@ -602,21 +605,34 @@
     if (rec->_data == NULL) {
       return;
     }
-    if (!parse_tag_and_count("oops", rec->_oops_length)) {
+    if (!parse_tag_and_count("oops", rec->_classes_length)) {
       return;
     }
-    rec->_oops_handles = NEW_RESOURCE_ARRAY(jobject, rec->_oops_length);
-    rec->_oops_offsets = NEW_RESOURCE_ARRAY(int, rec->_oops_length);
-    for (int i = 0; i < rec->_oops_length; i++) {
+    rec->_classes = NEW_RESOURCE_ARRAY(Klass*, rec->_classes_length);
+    rec->_classes_offsets = NEW_RESOURCE_ARRAY(int, rec->_classes_length);
+    for (int i = 0; i < rec->_classes_length; i++) {
       int offset = parse_int("offset");
       if (had_error()) {
         return;
       }
       Klass* k = parse_klass(CHECK);
-      rec->_oops_offsets[i] = offset;
-      KlassHandle *kh = NEW_C_HEAP_OBJ(KlassHandle, mtCompiler);
-      ::new ((void*)kh) KlassHandle(THREAD, k);
-      rec->_oops_handles[i] = (jobject)kh;
+      rec->_classes_offsets[i] = offset;
+      rec->_classes[i] = k;
+    }
+
+    if (!parse_tag_and_count("methods", rec->_methods_length)) {
+      return;
+    }
+    rec->_methods = NEW_RESOURCE_ARRAY(Method*, rec->_methods_length);
+    rec->_methods_offsets = NEW_RESOURCE_ARRAY(int, rec->_methods_length);
+    for (int i = 0; i < rec->_methods_length; i++) {
+      int offset = parse_int("offset");
+      if (had_error()) {
+        return;
+      }
+      Method* m = parse_method(CHECK);
+      rec->_methods_offsets[i] = offset;
+      rec->_methods[i] = m;
     }
   }
 
@@ -1105,14 +1121,22 @@
     m->_state = rec->_state;
     m->_current_mileage = rec->_current_mileage;
     if (rec->_data_length != 0) {
-      assert(m->_data_size == rec->_data_length * (int)sizeof(rec->_data[0]), "must agree");
+      assert(m->_data_size + m->_extra_data_size == rec->_data_length * (int)sizeof(rec->_data[0]) ||
+             m->_data_size == rec->_data_length * (int)sizeof(rec->_data[0]), "must agree");
 
       // Write the correct ciObjects back into the profile data
       ciEnv* env = ciEnv::current();
-      for (int i = 0; i < rec->_oops_length; i++) {
-        KlassHandle *h = (KlassHandle *)rec->_oops_handles[i];
-        *(ciMetadata**)(rec->_data + rec->_oops_offsets[i]) =
-          env->get_metadata((*h)());
+      for (int i = 0; i < rec->_classes_length; i++) {
+        Klass *k = rec->_classes[i];
+        // In case this class pointer is is tagged, preserve the tag
+        // bits
+        rec->_data[rec->_classes_offsets[i]] =
+          ciTypeEntries::with_status(env->get_metadata(k)->as_klass(), rec->_data[rec->_classes_offsets[i]]);
+      }
+      for (int i = 0; i < rec->_methods_length; i++) {
+        Method *m = rec->_methods[i];
+        *(ciMetadata**)(rec->_data + rec->_methods_offsets[i]) =
+          env->get_metadata(m);
       }
       // Copy the updated profile data into place as intptr_ts
 #ifdef _LP64
--- a/hotspot/src/share/vm/ci/ciSignature.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciSignature.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -148,5 +148,5 @@
   print_signature();
  tty->print(" accessing_klass=");
   _accessing_klass->print();
-  tty->print(" address=0x%x>", (address)this);
+  tty->print(" address=" INTPTR_FORMAT ">", p2i((address)this));
 }
--- a/hotspot/src/share/vm/ci/ciType.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciType.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -87,7 +87,7 @@
 // Print the name of this type
 void ciType::print_name_on(outputStream* st) {
   ResourceMark rm;
-  st->print(name());
+  st->print("%s", name());
 }
 
 
--- a/hotspot/src/share/vm/classfile/classFileError.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/classFileError.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,9 @@
 
 // Keep these in a separate file to prevent inlining
 
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED
+
 void ClassFileParser::classfile_parse_error(const char* msg, TRAPS) {
     ResourceMark rm(THREAD);
     Exceptions::fthrow(THREAD_AND_LOCATION, vmSymbols::java_lang_ClassFormatError(),
@@ -53,6 +56,8 @@
                        msg, index, name, _class_name->as_C_string());
 }
 
+PRAGMA_DIAG_POP
+
 void StackMapStream::stackmap_format_error(const char* msg, TRAPS) {
   ResourceMark rm(THREAD);
   Exceptions::fthrow(
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Tue May 27 13:57:42 2014 -0700
@@ -875,6 +875,7 @@
   int runtime_visible_type_annotations_length = 0;
   u1* runtime_invisible_type_annotations = NULL;
   int runtime_invisible_type_annotations_length = 0;
+  bool runtime_invisible_annotations_exists = false;
   bool runtime_invisible_type_annotations_exists = false;
   while (attributes_count--) {
     cfs->guarantee_more(6, CHECK);  // attribute_name_index, attribute_length
@@ -920,6 +921,10 @@
         }
         generic_signature_index = cfs->get_u2(CHECK);
       } else if (attribute_name == vmSymbols::tag_runtime_visible_annotations()) {
+        if (runtime_visible_annotations != NULL) {
+          classfile_parse_error(
+            "Multiple RuntimeVisibleAnnotations attributes for field in class file %s", CHECK);
+        }
         runtime_visible_annotations_length = attribute_length;
         runtime_visible_annotations = cfs->get_u1_buffer();
         assert(runtime_visible_annotations != NULL, "null visible annotations");
@@ -928,11 +933,18 @@
                           parsed_annotations,
                           CHECK);
         cfs->skip_u1(runtime_visible_annotations_length, CHECK);
-      } else if (PreserveAllAnnotations && attribute_name == vmSymbols::tag_runtime_invisible_annotations()) {
-        runtime_invisible_annotations_length = attribute_length;
-        runtime_invisible_annotations = cfs->get_u1_buffer();
-        assert(runtime_invisible_annotations != NULL, "null invisible annotations");
-        cfs->skip_u1(runtime_invisible_annotations_length, CHECK);
+      } else if (attribute_name == vmSymbols::tag_runtime_invisible_annotations()) {
+        if (runtime_invisible_annotations_exists) {
+          classfile_parse_error(
+            "Multiple RuntimeInvisibleAnnotations attributes for field in class file %s", CHECK);
+        }
+        runtime_invisible_annotations_exists = true;
+        if (PreserveAllAnnotations) {
+          runtime_invisible_annotations_length = attribute_length;
+          runtime_invisible_annotations = cfs->get_u1_buffer();
+          assert(runtime_invisible_annotations != NULL, "null invisible annotations");
+        }
+        cfs->skip_u1(attribute_length, CHECK);
       } else if (attribute_name == vmSymbols::tag_runtime_visible_type_annotations()) {
         if (runtime_visible_type_annotations != NULL) {
           classfile_parse_error(
@@ -2066,7 +2078,9 @@
   int runtime_visible_type_annotations_length = 0;
   u1* runtime_invisible_type_annotations = NULL;
   int runtime_invisible_type_annotations_length = 0;
+  bool runtime_invisible_annotations_exists = false;
   bool runtime_invisible_type_annotations_exists = false;
+  bool runtime_invisible_parameter_annotations_exists = false;
   u1* annotation_default = NULL;
   int annotation_default_length = 0;
 
@@ -2295,6 +2309,10 @@
         cfs->guarantee_more(2, CHECK_(nullHandle));  // generic_signature_index
         generic_signature_index = cfs->get_u2_fast();
       } else if (method_attribute_name == vmSymbols::tag_runtime_visible_annotations()) {
+        if (runtime_visible_annotations != NULL) {
+          classfile_parse_error(
+            "Multiple RuntimeVisibleAnnotations attributes for method in class file %s", CHECK_(nullHandle));
+        }
         runtime_visible_annotations_length = method_attribute_length;
         runtime_visible_annotations = cfs->get_u1_buffer();
         assert(runtime_visible_annotations != NULL, "null visible annotations");
@@ -2302,22 +2320,45 @@
             runtime_visible_annotations_length, &parsed_annotations,
             CHECK_(nullHandle));
         cfs->skip_u1(runtime_visible_annotations_length, CHECK_(nullHandle));
-      } else if (PreserveAllAnnotations && method_attribute_name == vmSymbols::tag_runtime_invisible_annotations()) {
-        runtime_invisible_annotations_length = method_attribute_length;
-        runtime_invisible_annotations = cfs->get_u1_buffer();
-        assert(runtime_invisible_annotations != NULL, "null invisible annotations");
-        cfs->skip_u1(runtime_invisible_annotations_length, CHECK_(nullHandle));
+      } else if (method_attribute_name == vmSymbols::tag_runtime_invisible_annotations()) {
+        if (runtime_invisible_annotations_exists) {
+          classfile_parse_error(
+            "Multiple RuntimeInvisibleAnnotations attributes for method in class file %s", CHECK_(nullHandle));
+        }
+        runtime_invisible_annotations_exists = true;
+        if (PreserveAllAnnotations) {
+          runtime_invisible_annotations_length = method_attribute_length;
+          runtime_invisible_annotations = cfs->get_u1_buffer();
+          assert(runtime_invisible_annotations != NULL, "null invisible annotations");
+        }
+        cfs->skip_u1(method_attribute_length, CHECK_(nullHandle));
       } else if (method_attribute_name == vmSymbols::tag_runtime_visible_parameter_annotations()) {
+        if (runtime_visible_parameter_annotations != NULL) {
+          classfile_parse_error(
+            "Multiple RuntimeVisibleParameterAnnotations attributes for method in class file %s", CHECK_(nullHandle));
+        }
         runtime_visible_parameter_annotations_length = method_attribute_length;
         runtime_visible_parameter_annotations = cfs->get_u1_buffer();
         assert(runtime_visible_parameter_annotations != NULL, "null visible parameter annotations");
         cfs->skip_u1(runtime_visible_parameter_annotations_length, CHECK_(nullHandle));
-      } else if (PreserveAllAnnotations && method_attribute_name == vmSymbols::tag_runtime_invisible_parameter_annotations()) {
-        runtime_invisible_parameter_annotations_length = method_attribute_length;
-        runtime_invisible_parameter_annotations = cfs->get_u1_buffer();
-        assert(runtime_invisible_parameter_annotations != NULL, "null invisible parameter annotations");
-        cfs->skip_u1(runtime_invisible_parameter_annotations_length, CHECK_(nullHandle));
+      } else if (method_attribute_name == vmSymbols::tag_runtime_invisible_parameter_annotations()) {
+        if (runtime_invisible_parameter_annotations_exists) {
+          classfile_parse_error(
+            "Multiple RuntimeInvisibleParameterAnnotations attributes for method in class file %s", CHECK_(nullHandle));
+        }
+        runtime_invisible_parameter_annotations_exists = true;
+        if (PreserveAllAnnotations) {
+          runtime_invisible_parameter_annotations_length = method_attribute_length;
+          runtime_invisible_parameter_annotations = cfs->get_u1_buffer();
+          assert(runtime_invisible_parameter_annotations != NULL, "null invisible parameter annotations");
+        }
+        cfs->skip_u1(method_attribute_length, CHECK_(nullHandle));
       } else if (method_attribute_name == vmSymbols::tag_annotation_default()) {
+        if (annotation_default != NULL) {
+          classfile_parse_error(
+            "Multiple AnnotationDefault attributes for method in class file %s",
+            CHECK_(nullHandle));
+        }
         annotation_default_length = method_attribute_length;
         annotation_default = cfs->get_u1_buffer();
         assert(annotation_default != NULL, "null annotation default");
@@ -2764,7 +2805,7 @@
                      "Short length on BootstrapMethods in class file %s",
                      CHECK);
 
-  guarantee_property(attribute_byte_length > sizeof(u2),
+  guarantee_property(attribute_byte_length >= sizeof(u2),
                      "Invalid BootstrapMethods attribute length %u in class file %s",
                      attribute_byte_length,
                      CHECK);
@@ -2846,6 +2887,8 @@
   u1* runtime_invisible_type_annotations = NULL;
   int runtime_invisible_type_annotations_length = 0;
   bool runtime_invisible_type_annotations_exists = false;
+  bool runtime_invisible_annotations_exists = false;
+  bool parsed_source_debug_ext_annotations_exist = false;
   u1* inner_classes_attribute_start = NULL;
   u4  inner_classes_attribute_length = 0;
   u2  enclosing_method_class_index = 0;
@@ -2873,6 +2916,11 @@
       parse_classfile_sourcefile_attribute(CHECK);
     } else if (tag == vmSymbols::tag_source_debug_extension()) {
       // Check for SourceDebugExtension tag
+      if (parsed_source_debug_ext_annotations_exist) {
+          classfile_parse_error(
+            "Multiple SourceDebugExtension attributes in class file %s", CHECK);
+      }
+      parsed_source_debug_ext_annotations_exist = true;
       parse_classfile_source_debug_extension_attribute((int)attribute_length, CHECK);
     } else if (tag == vmSymbols::tag_inner_classes()) {
       // Check for InnerClasses tag
@@ -2909,6 +2957,10 @@
         }
         parse_classfile_signature_attribute(CHECK);
       } else if (tag == vmSymbols::tag_runtime_visible_annotations()) {
+        if (runtime_visible_annotations != NULL) {
+          classfile_parse_error(
+            "Multiple RuntimeVisibleAnnotations attributes in class file %s", CHECK);
+        }
         runtime_visible_annotations_length = attribute_length;
         runtime_visible_annotations = cfs->get_u1_buffer();
         assert(runtime_visible_annotations != NULL, "null visible annotations");
@@ -2917,11 +2969,18 @@
                           parsed_annotations,
                           CHECK);
         cfs->skip_u1(runtime_visible_annotations_length, CHECK);
-      } else if (PreserveAllAnnotations && tag == vmSymbols::tag_runtime_invisible_annotations()) {
-        runtime_invisible_annotations_length = attribute_length;
-        runtime_invisible_annotations = cfs->get_u1_buffer();
-        assert(runtime_invisible_annotations != NULL, "null invisible annotations");
-        cfs->skip_u1(runtime_invisible_annotations_length, CHECK);
+      } else if (tag == vmSymbols::tag_runtime_invisible_annotations()) {
+        if (runtime_invisible_annotations_exists) {
+          classfile_parse_error(
+            "Multiple RuntimeInvisibleAnnotations attributes in class file %s", CHECK);
+        }
+        runtime_invisible_annotations_exists = true;
+        if (PreserveAllAnnotations) {
+          runtime_invisible_annotations_length = attribute_length;
+          runtime_invisible_annotations = cfs->get_u1_buffer();
+          assert(runtime_invisible_annotations != NULL, "null invisible annotations");
+        }
+        cfs->skip_u1(attribute_length, CHECK);
       } else if (tag == vmSymbols::tag_enclosing_method()) {
         if (parsed_enclosingmethod_attribute) {
           classfile_parse_error("Multiple EnclosingMethod attributes in class file %s", CHECK);
--- a/hotspot/src/share/vm/classfile/classFileParser.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/classFileParser.hpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -312,7 +312,9 @@
     if (!b) { classfile_parse_error(msg, CHECK); }
   }
 
-  inline void assert_property(bool b, const char* msg, TRAPS) {
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED
+inline void assert_property(bool b, const char* msg, TRAPS) {
 #ifdef ASSERT
     if (!b) {
       ResourceMark rm(THREAD);
@@ -329,6 +331,7 @@
     }
 #endif
   }
+PRAGMA_DIAG_POP
 
   inline void check_property(bool property, const char* msg, int index, TRAPS) {
     if (_need_verify) {
--- a/hotspot/src/share/vm/classfile/classLoader.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -343,7 +343,7 @@
   tty->print("[Meta index for %s=", entry->name());
   for (int i = 0; i < meta_packages.length(); i++) {
     if (i > 0) tty->print(" ");
-    tty->print(meta_packages.at(i));
+    tty->print("%s", meta_packages.at(i));
   }
   tty->print_cr("]");
 }
@@ -1299,7 +1299,7 @@
     e = e->next();
   }
   jlong end = os::javaTimeMillis();
-  tty->print_cr("CompileTheWorld : Done (%d classes, %d methods, %d ms)",
+  tty->print_cr("CompileTheWorld : Done (%d classes, %d methods, " JLONG_FORMAT " ms)",
                 _compile_the_world_class_counter, _compile_the_world_method_counter, (end - start));
   {
     // Print statistics as if before normal exit:
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp	Tue May 27 13:57:42 2014 -0700
@@ -281,10 +281,10 @@
     ResourceMark rm;
     tty->print_cr("[TraceClassLoaderData] Adding k: " PTR_FORMAT " %s to CLD: "
                   PTR_FORMAT " loader: " PTR_FORMAT " %s",
-                  k,
+                  p2i(k),
                   k->external_name(),
-                  k->class_loader_data(),
-                  (void *)k->class_loader(),
+                  p2i(k->class_loader_data()),
+                  p2i((void *)k->class_loader()),
                   loader_name());
   }
 }
@@ -319,11 +319,11 @@
 
   if (TraceClassLoaderData) {
     ResourceMark rm;
-    tty->print("[ClassLoaderData: unload loader data "PTR_FORMAT, this);
-    tty->print(" for instance "PTR_FORMAT" of %s", (void *)class_loader(),
+    tty->print("[ClassLoaderData: unload loader data " INTPTR_FORMAT, p2i(this));
+    tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)class_loader()),
                loader_name());
     if (is_anonymous()) {
-      tty->print(" for anonymous class  "PTR_FORMAT " ", _klasses);
+      tty->print(" for anonymous class  " INTPTR_FORMAT " ", p2i(_klasses));
     }
     tty->print_cr("]");
   }
@@ -485,14 +485,14 @@
 void ClassLoaderData::dump(outputStream * const out) {
   ResourceMark rm;
   out->print("ClassLoaderData CLD: "PTR_FORMAT", loader: "PTR_FORMAT", loader_klass: "PTR_FORMAT" %s {",
-      this, (void *)class_loader(),
-      class_loader() != NULL ? class_loader()->klass() : NULL, loader_name());
+      p2i(this), p2i((void *)class_loader()),
+      p2i(class_loader() != NULL ? class_loader()->klass() : NULL), loader_name());
   if (claimed()) out->print(" claimed ");
   if (is_unloading()) out->print(" unloading ");
-  out->print(" handles " INTPTR_FORMAT, handles());
+  out->print(" handles " INTPTR_FORMAT, p2i(handles()));
   out->cr();
   if (metaspace_or_null() != NULL) {
-    out->print_cr("metaspace: " PTR_FORMAT, metaspace_or_null());
+    out->print_cr("metaspace: " INTPTR_FORMAT, p2i(metaspace_or_null()));
     metaspace_or_null()->dump(out);
   } else {
     out->print_cr("metaspace: NULL");
@@ -549,6 +549,8 @@
 ClassLoaderData* ClassLoaderDataGraph::_unloading = NULL;
 ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL;
 
+bool ClassLoaderDataGraph::_should_purge = false;
+
 // Add a new class loader data node to the list.  Assign the newly created
 // ClassLoaderData into the java/lang/ClassLoader object as a hidden field
 ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRAPS) {
@@ -586,8 +588,8 @@
       if (TraceClassLoaderData) {
         ResourceMark rm;
         tty->print("[ClassLoaderData: ");
-        tty->print("create class loader data "PTR_FORMAT, cld);
-        tty->print(" for instance "PTR_FORMAT" of %s", (void *)cld->class_loader(),
+        tty->print("create class loader data " INTPTR_FORMAT, p2i(cld));
+        tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)cld->class_loader()),
                    cld->loader_name());
         tty->print_cr("]");
       }
@@ -675,32 +677,6 @@
   return array;
 }
 
-// For profiling and hsfind() only.  Otherwise, this is unsafe (and slow).  This
-// is done lock free to avoid lock inversion problems.  It is safe because
-// new ClassLoaderData are added to the end of the CLDG, and only removed at
-// safepoint.  The _unloading list can be deallocated concurrently with CMS so
-// this doesn't look in metaspace for classes that have been unloaded.
-bool ClassLoaderDataGraph::contains(const void* x) {
-  if (DumpSharedSpaces) {
-    // There are only two metaspaces to worry about.
-    ClassLoaderData* ncld = ClassLoaderData::the_null_class_loader_data();
-    return (ncld->ro_metaspace()->contains(x) || ncld->rw_metaspace()->contains(x));
-  }
-
-  if (UseSharedSpaces && MetaspaceShared::is_in_shared_space(x)) {
-    return true;
-  }
-
-  for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
-    if (cld->metaspace_or_null() != NULL && cld->metaspace_or_null()->contains(x)) {
-      return true;
-    }
-  }
-
-  // Do not check unloading list because deallocation can be concurrent.
-  return false;
-}
-
 #ifndef PRODUCT
 bool ClassLoaderDataGraph::contains_loader_data(ClassLoaderData* loader_data) {
   for (ClassLoaderData* data = _head; data != NULL; data = data->next()) {
@@ -759,6 +735,7 @@
 }
 
 void ClassLoaderDataGraph::purge() {
+  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
   ClassLoaderData* list = _unloading;
   _unloading = NULL;
   ClassLoaderData* next = list;
@@ -847,7 +824,7 @@
   if (class_loader() == NULL) {
     out->print("NULL class_loader");
   } else {
-    out->print("class loader "PTR_FORMAT, this);
+    out->print("class loader " INTPTR_FORMAT, p2i(this));
     class_loader()->print_value_on(out);
   }
 }
--- a/hotspot/src/share/vm/classfile/classLoaderData.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp	Tue May 27 13:57:42 2014 -0700
@@ -66,6 +66,7 @@
   static ClassLoaderData* _unloading;
   // CMS support.
   static ClassLoaderData* _saved_head;
+  static bool _should_purge;
 
   static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS);
   static void post_class_unload_events(void);
@@ -87,12 +88,20 @@
   static void remember_new_clds(bool remember) { _saved_head = (remember ? _head : NULL); }
   static GrowableArray<ClassLoaderData*>* new_clds();
 
+  static void set_should_purge(bool b) { _should_purge = b; }
+  static void purge_if_needed() {
+    // Only purge the CLDG for CMS if concurrent sweep is complete.
+    if (_should_purge) {
+      purge();
+      // reset for next time.
+      set_should_purge(false);
+    }
+  }
+
   static void dump_on(outputStream * const out) PRODUCT_RETURN;
   static void dump() { dump_on(tty); }
   static void verify();
 
-  // expensive test for pointer in metaspace for debugging
-  static bool contains(const void* x);
 #ifndef PRODUCT
   static bool contains_loader_data(ClassLoaderData* loader_data);
 #endif
--- a/hotspot/src/share/vm/classfile/defaultMethods.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp	Tue May 27 13:57:42 2014 -0700
@@ -436,7 +436,7 @@
       _exception_name = vmSymbols::java_lang_IncompatibleClassChangeError();
       if (TraceDefaultMethods) {
         _exception_message->print_value_on(tty);
-        tty->print_cr("");
+        tty->cr();
       }
     }
   }
@@ -463,7 +463,7 @@
       if (_members.at(i).second == DISQUALIFIED) {
         str->print(" (disqualified)");
       }
-      str->print_cr("");
+      str->cr();
     }
 
     if (_selected_target != NULL) {
@@ -480,7 +480,7 @@
     if (!method_holder->is_interface()) {
       tty->print(" : in superclass");
     }
-    str->print_cr("");
+    str->cr();
   }
 
   void print_exception(outputStream* str, int indent) {
@@ -688,7 +688,7 @@
     for (int i = 0; i < slots->length(); ++i) {
       tty->indent();
       slots->at(i)->print_on(tty);
-      tty->print_cr("");
+      tty->cr();
     }
   }
 #endif // ndef PRODUCT
@@ -828,7 +828,7 @@
       streamIndentor si(tty, 2);
       tty->indent().print("Looking for default methods for slot ");
       slot->print_on(tty);
-      tty->print_cr("");
+      tty->cr();
     }
 #endif // ndef PRODUCT
 
@@ -946,7 +946,7 @@
       if (TraceDefaultMethods) {
         tty->print("for slot: ");
         slot->print_on(tty);
-        tty->print_cr("");
+        tty->cr();
         if (method->has_target()) {
           method->print_selected(tty, 1);
         } else if (method->throws_exception()) {
--- a/hotspot/src/share/vm/classfile/dictionary.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/dictionary.cpp	Tue May 27 13:57:42 2014 -0700
@@ -31,6 +31,7 @@
 #include "runtime/orderAccess.inline.hpp"
 #include "utilities/hashtable.inline.hpp"
 
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
 DictionaryEntry*  Dictionary::_current_class_entry = NULL;
 int               Dictionary::_current_class_index =    0;
--- a/hotspot/src/share/vm/classfile/dictionary.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/dictionary.hpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -379,7 +379,7 @@
     }
     if (method_type() != NULL) {
       if (printed)  st->print(" and ");
-      st->print(INTPTR_FORMAT, (void *)method_type());
+      st->print(INTPTR_FORMAT, p2i((void *)method_type()));
       printed = true;
     }
     st->print_cr(printed ? "" : "(empty)");
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Tue May 27 13:57:42 2014 -0700
@@ -25,7 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/altHashing.hpp"
 #include "classfile/javaClasses.hpp"
-#include "classfile/symbolTable.hpp"
+#include "classfile/stringTable.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "code/debugInfo.hpp"
 #include "code/pcDesc.hpp"
@@ -51,6 +51,8 @@
 #include "runtime/vframe.hpp"
 #include "utilities/preserveException.hpp"
 
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
 #define INJECTED_FIELD_COMPUTE_OFFSET(klass, name, signature, may_be_java)    \
   klass::_##name##_offset = JavaClasses::compute_injected_offset(JavaClasses::klass##_##name##_enum);
 
@@ -1490,7 +1492,7 @@
   while (h_throwable.not_null()) {
     objArrayHandle result (THREAD, objArrayOop(backtrace(h_throwable())));
     if (result.is_null()) {
-      st->print_cr(no_stack_trace_message());
+      st->print_cr("%s", no_stack_trace_message());
       return;
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/stringTable.cpp	Tue May 27 13:57:42 2014 -0700
@@ -0,0 +1,533 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "classfile/altHashing.hpp"
+#include "classfile/javaClasses.hpp"
+#include "classfile/stringTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "gc_interface/collectedHeap.inline.hpp"
+#include "memory/allocation.inline.hpp"
+#include "memory/filemap.hpp"
+#include "memory/gcLocker.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.inline2.hpp"
+#include "runtime/mutexLocker.hpp"
+#include "utilities/hashtable.inline.hpp"
+#if INCLUDE_ALL_GCS
+#include "gc_implementation/g1/g1StringDedup.hpp"
+#endif
+
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+
+// the number of buckets a thread claims
+const int ClaimChunkSize = 32;
+
+#ifdef ASSERT
+class StableMemoryChecker : public StackObj {
+  enum { _bufsize = wordSize*4 };
+
+  address _region;
+  jint    _size;
+  u1      _save_buf[_bufsize];
+
+  int sample(u1* save_buf) {
+    if (_size <= _bufsize) {
+      memcpy(save_buf, _region, _size);
+      return _size;
+    } else {
+      // copy head and tail
+      memcpy(&save_buf[0],          _region,                      _bufsize/2);
+      memcpy(&save_buf[_bufsize/2], _region + _size - _bufsize/2, _bufsize/2);
+      return (_bufsize/2)*2;
+    }
+  }
+
+ public:
+  StableMemoryChecker(const void* region, jint size) {
+    _region = (address) region;
+    _size   = size;
+    sample(_save_buf);
+  }
+
+  bool verify() {
+    u1 check_buf[sizeof(_save_buf)];
+    int check_size = sample(check_buf);
+    return (0 == memcmp(_save_buf, check_buf, check_size));
+  }
+
+  void set_region(const void* region) { _region = (address) region; }
+};
+#endif
+
+
+// --------------------------------------------------------------------------
+StringTable* StringTable::_the_table = NULL;
+
+bool StringTable::_needs_rehashing = false;
+
+volatile int StringTable::_parallel_claimed_idx = 0;
+
+// 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::hash_code(s, len);
+}
+
+oop StringTable::lookup(int index, jchar* name,
+                        int len, unsigned int hash) {
+  int count = 0;
+  for (HashtableEntry<oop, mtSymbol>* 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<mtSymbol>::rehash_count && !needs_rehashing()) {
+    _needs_rehashing = check_rehash_table(count);
+  }
+  return NULL;
+}
+
+
+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.
+
+  oop test = lookup(index, name, len, hashValue); // calls lookup(u1*, int)
+  if (test != NULL) {
+    // Entry already added
+    return test;
+  }
+
+  HashtableEntry<oop, mtSymbol>* entry = new_entry(hashValue, string());
+  add_entry(index, entry);
+  return string();
+}
+
+
+oop StringTable::lookup(Symbol* symbol) {
+  ResourceMark rm;
+  int length;
+  jchar* chars = symbol->as_unicode(length);
+  return lookup(chars, length);
+}
+
+
+oop StringTable::lookup(jchar* name, int len) {
+  unsigned int hash = hash_string(name, len);
+  int index = the_table()->hash_to_index(hash);
+  return the_table()->lookup(index, name, len, hash);
+}
+
+
+oop StringTable::intern(Handle string_or_null, jchar* name,
+                        int len, TRAPS) {
+  unsigned int hashValue = hash_string(name, len);
+  int index = the_table()->hash_to_index(hashValue);
+  oop found_string = the_table()->lookup(index, name, len, hashValue);
+
+  // Found
+  if (found_string != NULL) return found_string;
+
+  debug_only(StableMemoryChecker smc(name, len * sizeof(name[0])));
+  assert(!Universe::heap()->is_in_reserved(name),
+         "proposed name of symbol must be stable");
+
+  Handle string;
+  // try to reuse the string if possible
+  if (!string_or_null.is_null()) {
+    string = string_or_null;
+  } else {
+    string = java_lang_String::create_from_unicode(name, len, CHECK_NULL);
+  }
+
+#if INCLUDE_ALL_GCS
+  if (G1StringDedup::is_enabled()) {
+    // Deduplicate the string before it is interned. Note that we should never
+    // deduplicate a string after it has been interned. Doing so will counteract
+    // compiler optimizations done on e.g. interned string literals.
+    G1StringDedup::deduplicate(string());
+  }
+#endif
+
+  // 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, name, len,
+                                hashValue, CHECK_NULL);
+}
+
+oop StringTable::intern(Symbol* symbol, TRAPS) {
+  if (symbol == NULL) return NULL;
+  ResourceMark rm(THREAD);
+  int length;
+  jchar* chars = symbol->as_unicode(length);
+  Handle string;
+  oop result = intern(string, chars, length, CHECK_NULL);
+  return result;
+}
+
+
+oop StringTable::intern(oop string, TRAPS)
+{
+  if (string == NULL) return NULL;
+  ResourceMark rm(THREAD);
+  int length;
+  Handle h_string (THREAD, string);
+  jchar* chars = java_lang_String::as_unicode_string(string, length, CHECK_NULL);
+  oop result = intern(h_string, chars, length, CHECK_NULL);
+  return result;
+}
+
+
+oop StringTable::intern(const char* utf8_string, TRAPS) {
+  if (utf8_string == NULL) return NULL;
+  ResourceMark rm(THREAD);
+  int length = UTF8::unicode_length(utf8_string);
+  jchar* chars = NEW_RESOURCE_ARRAY(jchar, length);
+  UTF8::convert_to_unicode(utf8_string, chars, length);
+  Handle string;
+  oop result = intern(string, chars, length, CHECK_NULL);
+  return result;
+}
+
+void StringTable::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) {
+  buckets_unlink_or_oops_do(is_alive, f, 0, the_table()->table_size(), processed, removed);
+}
+
+void StringTable::possibly_parallel_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) {
+  // Readers of the table are unlocked, so we should only be removing
+  // entries at a safepoint.
+  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
+  const int limit = the_table()->table_size();
+
+  for (;;) {
+    // Grab next set of buckets to scan
+    int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize;
+    if (start_idx >= limit) {
+      // End of table
+      break;
+    }
+
+    int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
+    buckets_unlink_or_oops_do(is_alive, f, start_idx, end_idx, processed, removed);
+  }
+}
+
+void StringTable::buckets_oops_do(OopClosure* f, int start_idx, int end_idx) {
+  const int limit = the_table()->table_size();
+
+  assert(0 <= start_idx && start_idx <= limit,
+         err_msg("start_idx (%d) is out of bounds", start_idx));
+  assert(0 <= end_idx && end_idx <= limit,
+         err_msg("end_idx (%d) is out of bounds", end_idx));
+  assert(start_idx <= end_idx,
+         err_msg("Index ordering: start_idx=%d, end_idx=%d",
+                 start_idx, end_idx));
+
+  for (int i = start_idx; i < end_idx; i += 1) {
+    HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
+    while (entry != NULL) {
+      assert(!entry->is_shared(), "CDS not used for the StringTable");
+
+      f->do_oop((oop*)entry->literal_addr());
+
+      entry = entry->next();
+    }
+  }
+}
+
+void StringTable::buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed) {
+  const int limit = the_table()->table_size();
+
+  assert(0 <= start_idx && start_idx <= limit,
+         err_msg("start_idx (%d) is out of bounds", start_idx));
+  assert(0 <= end_idx && end_idx <= limit,
+         err_msg("end_idx (%d) is out of bounds", end_idx));
+  assert(start_idx <= end_idx,
+         err_msg("Index ordering: start_idx=%d, end_idx=%d",
+                 start_idx, end_idx));
+
+  for (int i = start_idx; i < end_idx; ++i) {
+    HashtableEntry<oop, mtSymbol>** p = the_table()->bucket_addr(i);
+    HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
+    while (entry != NULL) {
+      assert(!entry->is_shared(), "CDS not used for the StringTable");
+
+      if (is_alive->do_object_b(entry->literal())) {
+        if (f != NULL) {
+          f->do_oop((oop*)entry->literal_addr());
+        }
+        p = entry->next_addr();
+      } else {
+        *p = entry->next();
+        the_table()->free_entry(entry);
+        (*removed)++;
+      }
+      (*processed)++;
+      entry = *p;
+    }
+  }
+}
+
+void StringTable::oops_do(OopClosure* f) {
+  buckets_oops_do(f, 0, the_table()->table_size());
+}
+
+void StringTable::possibly_parallel_oops_do(OopClosure* f) {
+  const int limit = the_table()->table_size();
+
+  for (;;) {
+    // Grab next set of buckets to scan
+    int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize;
+    if (start_idx >= limit) {
+      // End of table
+      break;
+    }
+
+    int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
+    buckets_oops_do(f, start_idx, end_idx);
+  }
+}
+
+// This verification is part of Universe::verify() and needs to be quick.
+// See StringTable::verify_and_compare() below for exhaustive verification.
+void StringTable::verify() {
+  for (int i = 0; i < the_table()->table_size(); ++i) {
+    HashtableEntry<oop, mtSymbol>* p = the_table()->bucket(i);
+    for ( ; p != NULL; p = p->next()) {
+      oop s = p->literal();
+      guarantee(s != NULL, "interned string is NULL");
+      unsigned int h = java_lang_String::hash_string(s);
+      guarantee(p->hash() == h, "broken hash in string table entry");
+      guarantee(the_table()->hash_to_index(h) == i,
+                "wrong index in string table");
+    }
+  }
+}
+
+void StringTable::dump(outputStream* st) {
+  the_table()->dump_table(st, "StringTable");
+}
+
+StringTable::VerifyRetTypes StringTable::compare_entries(
+                                      int bkt1, int e_cnt1,
+                                      HashtableEntry<oop, mtSymbol>* e_ptr1,
+                                      int bkt2, int e_cnt2,
+                                      HashtableEntry<oop, mtSymbol>* e_ptr2) {
+  // These entries are sanity checked by verify_and_compare_entries()
+  // before this function is called.
+  oop str1 = e_ptr1->literal();
+  oop str2 = e_ptr2->literal();
+
+  if (str1 == str2) {
+    tty->print_cr("ERROR: identical oop values (0x" PTR_FORMAT ") "
+                  "in entry @ bucket[%d][%d] and entry @ bucket[%d][%d]",
+                  (void *)str1, bkt1, e_cnt1, bkt2, e_cnt2);
+    return _verify_fail_continue;
+  }
+
+  if (java_lang_String::equals(str1, str2)) {
+    tty->print_cr("ERROR: identical String values in entry @ "
+                  "bucket[%d][%d] and entry @ bucket[%d][%d]",
+                  bkt1, e_cnt1, bkt2, e_cnt2);
+    return _verify_fail_continue;
+  }
+
+  return _verify_pass;
+}
+
+StringTable::VerifyRetTypes StringTable::verify_entry(int bkt, int e_cnt,
+                                      HashtableEntry<oop, mtSymbol>* e_ptr,
+                                      StringTable::VerifyMesgModes mesg_mode) {
+
+  VerifyRetTypes ret = _verify_pass;  // be optimistic
+
+  oop str = e_ptr->literal();
+  if (str == NULL) {
+    if (mesg_mode == _verify_with_mesgs) {
+      tty->print_cr("ERROR: NULL oop value in entry @ bucket[%d][%d]", bkt,
+                    e_cnt);
+    }
+    // NULL oop means no more verifications are possible
+    return _verify_fail_done;
+  }
+
+  if (str->klass() != SystemDictionary::String_klass()) {
+    if (mesg_mode == _verify_with_mesgs) {
+      tty->print_cr("ERROR: oop is not a String in entry @ bucket[%d][%d]",
+                    bkt, e_cnt);
+    }
+    // not a String means no more verifications are possible
+    return _verify_fail_done;
+  }
+
+  unsigned int h = java_lang_String::hash_string(str);
+  if (e_ptr->hash() != h) {
+    if (mesg_mode == _verify_with_mesgs) {
+      tty->print_cr("ERROR: broken hash value in entry @ bucket[%d][%d], "
+                    "bkt_hash=%d, str_hash=%d", bkt, e_cnt, e_ptr->hash(), h);
+    }
+    ret = _verify_fail_continue;
+  }
+
+  if (the_table()->hash_to_index(h) != bkt) {
+    if (mesg_mode == _verify_with_mesgs) {
+      tty->print_cr("ERROR: wrong index value for entry @ bucket[%d][%d], "
+                    "str_hash=%d, hash_to_index=%d", bkt, e_cnt, h,
+                    the_table()->hash_to_index(h));
+    }
+    ret = _verify_fail_continue;
+  }
+
+  return ret;
+}
+
+// See StringTable::verify() above for the quick verification that is
+// part of Universe::verify(). This verification is exhaustive and
+// reports on every issue that is found. StringTable::verify() only
+// reports on the first issue that is found.
+//
+// StringTable::verify_entry() checks:
+// - oop value != NULL (same as verify())
+// - oop value is a String
+// - hash(String) == hash in entry (same as verify())
+// - index for hash == index of entry (same as verify())
+//
+// StringTable::compare_entries() checks:
+// - oops are unique across all entries
+// - String values are unique across all entries
+//
+int StringTable::verify_and_compare_entries() {
+  assert(StringTable_lock->is_locked(), "sanity check");
+
+  int  fail_cnt = 0;
+
+  // first, verify all the entries individually:
+  for (int bkt = 0; bkt < the_table()->table_size(); bkt++) {
+    HashtableEntry<oop, mtSymbol>* e_ptr = the_table()->bucket(bkt);
+    for (int e_cnt = 0; e_ptr != NULL; e_ptr = e_ptr->next(), e_cnt++) {
+      VerifyRetTypes ret = verify_entry(bkt, e_cnt, e_ptr, _verify_with_mesgs);
+      if (ret != _verify_pass) {
+        fail_cnt++;
+      }
+    }
+  }
+
+  // Optimization: if the above check did not find any failures, then
+  // the comparison loop below does not need to call verify_entry()
+  // before calling compare_entries(). If there were failures, then we
+  // have to call verify_entry() to see if the entry can be passed to
+  // compare_entries() safely. When we call verify_entry() in the loop
+  // below, we do so quietly to void duplicate messages and we don't
+  // increment fail_cnt because the failures have already been counted.
+  bool need_entry_verify = (fail_cnt != 0);
+
+  // second, verify all entries relative to each other:
+  for (int bkt1 = 0; bkt1 < the_table()->table_size(); bkt1++) {
+    HashtableEntry<oop, mtSymbol>* e_ptr1 = the_table()->bucket(bkt1);
+    for (int e_cnt1 = 0; e_ptr1 != NULL; e_ptr1 = e_ptr1->next(), e_cnt1++) {
+      if (need_entry_verify) {
+        VerifyRetTypes ret = verify_entry(bkt1, e_cnt1, e_ptr1,
+                                          _verify_quietly);
+        if (ret == _verify_fail_done) {
+          // cannot use the current entry to compare against other entries
+          continue;
+        }
+      }
+
+      for (int bkt2 = bkt1; bkt2 < the_table()->table_size(); bkt2++) {
+        HashtableEntry<oop, mtSymbol>* e_ptr2 = the_table()->bucket(bkt2);
+        int e_cnt2;
+        for (e_cnt2 = 0; e_ptr2 != NULL; e_ptr2 = e_ptr2->next(), e_cnt2++) {
+          if (bkt1 == bkt2 && e_cnt2 <= e_cnt1) {
+            // skip the entries up to and including the one that
+            // we're comparing against
+            continue;
+          }
+
+          if (need_entry_verify) {
+            VerifyRetTypes ret = verify_entry(bkt2, e_cnt2, e_ptr2,
+                                              _verify_quietly);
+            if (ret == _verify_fail_done) {
+              // cannot compare against this entry
+              continue;
+            }
+          }
+
+          // compare two entries, report and count any failures:
+          if (compare_entries(bkt1, e_cnt1, e_ptr1, bkt2, e_cnt2, e_ptr2)
+              != _verify_pass) {
+            fail_cnt++;
+          }
+        }
+      }
+    }
+  }
+  return fail_cnt;
+}
+
+// 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;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/stringTable.hpp	Tue May 27 13:57:42 2014 -0700
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_CLASSFILE_STRINGTABLE_HPP
+#define SHARE_VM_CLASSFILE_STRINGTABLE_HPP
+
+#include "memory/allocation.inline.hpp"
+#include "utilities/hashtable.hpp"
+
+class StringTable : public Hashtable<oop, mtSymbol> {
+  friend class VMStructs;
+  friend class Symbol;
+
+private:
+  // The string table
+  static StringTable* _the_table;
+
+  // Set if one bucket is out of balance due to hash algorithm deficiency
+  static bool _needs_rehashing;
+
+  // Claimed high water mark for parallel chunked scanning
+  static volatile int _parallel_claimed_idx;
+
+  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);
+
+  oop lookup(int index, jchar* chars, int length, unsigned int hashValue);
+
+  // Apply the give oop closure to the entries to the buckets
+  // in the range [start_idx, end_idx).
+  static void buckets_oops_do(OopClosure* f, int start_idx, int end_idx);
+  // Unlink or apply the give oop closure to the entries to the buckets
+  // in the range [start_idx, end_idx).
+  static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed);
+
+  StringTable() : Hashtable<oop, mtSymbol>((int)StringTableSize,
+                              sizeof (HashtableEntry<oop, mtSymbol>)) {}
+
+  StringTable(HashtableBucket<mtSymbol>* t, int number_of_entries)
+    : Hashtable<oop, mtSymbol>((int)StringTableSize, sizeof (HashtableEntry<oop, mtSymbol>), t,
+                     number_of_entries) {}
+public:
+  // The string table
+  static StringTable* the_table() { return _the_table; }
+
+  // Size of one bucket in the string table.  Used when checking for rollover.
+  static uint bucket_size() { return sizeof(HashtableBucket<mtSymbol>); }
+
+  static void create_table() {
+    assert(_the_table == NULL, "One string table allowed.");
+    _the_table = new StringTable();
+  }
+
+  // GC support
+  //   Delete pointers to otherwise-unreachable objects.
+  static void unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f) {
+    int processed = 0;
+    int removed = 0;
+    unlink_or_oops_do(cl, f, &processed, &removed);
+  }
+  static void unlink(BoolObjectClosure* cl) {
+    int processed = 0;
+    int removed = 0;
+    unlink_or_oops_do(cl, NULL, &processed, &removed);
+  }
+  static void unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f, int* processed, int* removed);
+  static void unlink(BoolObjectClosure* cl, int* processed, int* removed) {
+    unlink_or_oops_do(cl, NULL, processed, removed);
+  }
+  // Serially invoke "f->do_oop" on the locations of all oops in the table.
+  static void oops_do(OopClosure* f);
+
+  // Possibly parallel versions of the above
+  static void possibly_parallel_unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f, int* processed, int* removed);
+  static void possibly_parallel_unlink(BoolObjectClosure* cl, int* processed, int* removed) {
+    possibly_parallel_unlink_or_oops_do(cl, NULL, processed, removed);
+  }
+  static void possibly_parallel_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);
+  static oop lookup(jchar* chars, int length);
+
+  // Interning
+  static oop intern(Symbol* symbol, TRAPS);
+  static oop intern(oop string, TRAPS);
+  static oop intern(const char *utf8_string, TRAPS);
+
+  // Debugging
+  static void verify();
+  static void dump(outputStream* st);
+
+  enum VerifyMesgModes {
+    _verify_quietly    = 0,
+    _verify_with_mesgs = 1
+  };
+
+  enum VerifyRetTypes {
+    _verify_pass          = 0,
+    _verify_fail_continue = 1,
+    _verify_fail_done     = 2
+  };
+
+  static VerifyRetTypes compare_entries(int bkt1, int e_cnt1,
+                                        HashtableEntry<oop, mtSymbol>* e_ptr1,
+                                        int bkt2, int e_cnt2,
+                                        HashtableEntry<oop, mtSymbol>* e_ptr2);
+  static VerifyRetTypes verify_entry(int bkt, int e_cnt,
+                                     HashtableEntry<oop, mtSymbol>* e_ptr,
+                                     VerifyMesgModes mesg_mode);
+  static int verify_and_compare_entries();
+
+  // Sharing
+  static void copy_buckets(char** top, char*end) {
+    the_table()->Hashtable<oop, mtSymbol>::copy_buckets(top, end);
+  }
+  static void copy_table(char** top, char*end) {
+    the_table()->Hashtable<oop, mtSymbol>::copy_table(top, end);
+  }
+  static void reverse() {
+    the_table()->Hashtable<oop, mtSymbol>::reverse();
+  }
+
+  // Rehash the symbol table if it gets out of balance
+  static void rehash_table();
+  static bool needs_rehashing() { return _needs_rehashing; }
+
+  // Parallel chunked scanning
+  static void clear_parallel_claimed_index() { _parallel_claimed_idx = 0; }
+  static int parallel_claimed_index() { return _parallel_claimed_idx; }
+};
+#endif // SHARE_VM_CLASSFILE_STRINGTABLE_HPP
--- a/hotspot/src/share/vm/classfile/symbolTable.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/symbolTable.cpp	Tue May 27 13:57:42 2014 -0700
@@ -35,12 +35,10 @@
 #include "oops/oop.inline2.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "utilities/hashtable.inline.hpp"
-#if INCLUDE_ALL_GCS
-#include "gc_implementation/g1/g1StringDedup.hpp"
-#endif
+
+PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
 // --------------------------------------------------------------------------
-
 // the number of buckets a thread claims
 const int ClaimChunkSize = 32;
 
@@ -587,493 +585,3 @@
   }
 }
 #endif // PRODUCT
-
-// --------------------------------------------------------------------------
-
-#ifdef ASSERT
-class StableMemoryChecker : public StackObj {
-  enum { _bufsize = wordSize*4 };
-
-  address _region;
-  jint    _size;
-  u1      _save_buf[_bufsize];
-
-  int sample(u1* save_buf) {
-    if (_size <= _bufsize) {
-      memcpy(save_buf, _region, _size);
-      return _size;
-    } else {
-      // copy head and tail
-      memcpy(&save_buf[0],          _region,                      _bufsize/2);
-      memcpy(&save_buf[_bufsize/2], _region + _size - _bufsize/2, _bufsize/2);
-      return (_bufsize/2)*2;
-    }
-  }
-
- public:
-  StableMemoryChecker(const void* region, jint size) {
-    _region = (address) region;
-    _size   = size;
-    sample(_save_buf);
-  }
-
-  bool verify() {
-    u1 check_buf[sizeof(_save_buf)];
-    int check_size = sample(check_buf);
-    return (0 == memcmp(_save_buf, check_buf, check_size));
-  }
-
-  void set_region(const void* region) { _region = (address) region; }
-};
-#endif
-
-
-// --------------------------------------------------------------------------
-StringTable* StringTable::_the_table = NULL;
-
-bool StringTable::_needs_rehashing = false;
-
-volatile int StringTable::_parallel_claimed_idx = 0;
-
-// 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::hash_code(s, len);
-}
-
-oop StringTable::lookup(int index, jchar* name,
-                        int len, unsigned int hash) {
-  int count = 0;
-  for (HashtableEntry<oop, mtSymbol>* 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<mtSymbol>::rehash_count && !needs_rehashing()) {
-    _needs_rehashing = check_rehash_table(count);
-  }
-  return NULL;
-}
-
-
-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.
-
-  oop test = lookup(index, name, len, hashValue); // calls lookup(u1*, int)
-  if (test != NULL) {
-    // Entry already added
-    return test;
-  }
-
-  HashtableEntry<oop, mtSymbol>* entry = new_entry(hashValue, string());
-  add_entry(index, entry);
-  return string();
-}
-
-
-oop StringTable::lookup(Symbol* symbol) {
-  ResourceMark rm;
-  int length;
-  jchar* chars = symbol->as_unicode(length);
-  return lookup(chars, length);
-}
-
-
-oop StringTable::lookup(jchar* name, int len) {
-  unsigned int hash = hash_string(name, len);
-  int index = the_table()->hash_to_index(hash);
-  return the_table()->lookup(index, name, len, hash);
-}
-
-
-oop StringTable::intern(Handle string_or_null, jchar* name,
-                        int len, TRAPS) {
-  unsigned int hashValue = hash_string(name, len);
-  int index = the_table()->hash_to_index(hashValue);
-  oop found_string = the_table()->lookup(index, name, len, hashValue);
-
-  // Found
-  if (found_string != NULL) return found_string;
-
-  debug_only(StableMemoryChecker smc(name, len * sizeof(name[0])));
-  assert(!Universe::heap()->is_in_reserved(name),
-         "proposed name of symbol must be stable");
-
-  Handle string;
-  // try to reuse the string if possible
-  if (!string_or_null.is_null()) {
-    string = string_or_null;
-  } else {
-    string = java_lang_String::create_from_unicode(name, len, CHECK_NULL);
-  }
-
-#if INCLUDE_ALL_GCS
-  if (G1StringDedup::is_enabled()) {
-    // Deduplicate the string before it is interned. Note that we should never
-    // deduplicate a string after it has been interned. Doing so will counteract
-    // compiler optimizations done on e.g. interned string literals.
-    G1StringDedup::deduplicate(string());
-  }
-#endif
-
-  // 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, name, len,
-                                hashValue, CHECK_NULL);
-}
-
-oop StringTable::intern(Symbol* symbol, TRAPS) {
-  if (symbol == NULL) return NULL;
-  ResourceMark rm(THREAD);
-  int length;
-  jchar* chars = symbol->as_unicode(length);
-  Handle string;
-  oop result = intern(string, chars, length, CHECK_NULL);
-  return result;
-}
-
-
-oop StringTable::intern(oop string, TRAPS)
-{
-  if (string == NULL) return NULL;
-  ResourceMark rm(THREAD);
-  int length;
-  Handle h_string (THREAD, string);
-  jchar* chars = java_lang_String::as_unicode_string(string, length, CHECK_NULL);
-  oop result = intern(h_string, chars, length, CHECK_NULL);
-  return result;
-}
-
-
-oop StringTable::intern(const char* utf8_string, TRAPS) {
-  if (utf8_string == NULL) return NULL;
-  ResourceMark rm(THREAD);
-  int length = UTF8::unicode_length(utf8_string);
-  jchar* chars = NEW_RESOURCE_ARRAY(jchar, length);
-  UTF8::convert_to_unicode(utf8_string, chars, length);
-  Handle string;
-  oop result = intern(string, chars, length, CHECK_NULL);
-  return result;
-}
-
-void StringTable::unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) {
-  buckets_unlink_or_oops_do(is_alive, f, 0, the_table()->table_size(), processed, removed);
-}
-
-void StringTable::possibly_parallel_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int* processed, int* removed) {
-  // Readers of the table are unlocked, so we should only be removing
-  // entries at a safepoint.
-  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
-  const int limit = the_table()->table_size();
-
-  for (;;) {
-    // Grab next set of buckets to scan
-    int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize;
-    if (start_idx >= limit) {
-      // End of table
-      break;
-    }
-
-    int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
-    buckets_unlink_or_oops_do(is_alive, f, start_idx, end_idx, processed, removed);
-  }
-}
-
-void StringTable::buckets_oops_do(OopClosure* f, int start_idx, int end_idx) {
-  const int limit = the_table()->table_size();
-
-  assert(0 <= start_idx && start_idx <= limit,
-         err_msg("start_idx (%d) is out of bounds", start_idx));
-  assert(0 <= end_idx && end_idx <= limit,
-         err_msg("end_idx (%d) is out of bounds", end_idx));
-  assert(start_idx <= end_idx,
-         err_msg("Index ordering: start_idx=%d, end_idx=%d",
-                 start_idx, end_idx));
-
-  for (int i = start_idx; i < end_idx; i += 1) {
-    HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
-    while (entry != NULL) {
-      assert(!entry->is_shared(), "CDS not used for the StringTable");
-
-      f->do_oop((oop*)entry->literal_addr());
-
-      entry = entry->next();
-    }
-  }
-}
-
-void StringTable::buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed) {
-  const int limit = the_table()->table_size();
-
-  assert(0 <= start_idx && start_idx <= limit,
-         err_msg("start_idx (%d) is out of bounds", start_idx));
-  assert(0 <= end_idx && end_idx <= limit,
-         err_msg("end_idx (%d) is out of bounds", end_idx));
-  assert(start_idx <= end_idx,
-         err_msg("Index ordering: start_idx=%d, end_idx=%d",
-                 start_idx, end_idx));
-
-  for (int i = start_idx; i < end_idx; ++i) {
-    HashtableEntry<oop, mtSymbol>** p = the_table()->bucket_addr(i);
-    HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
-    while (entry != NULL) {
-      assert(!entry->is_shared(), "CDS not used for the StringTable");
-
-      if (is_alive->do_object_b(entry->literal())) {
-        if (f != NULL) {
-          f->do_oop((oop*)entry->literal_addr());
-        }
-        p = entry->next_addr();
-      } else {
-        *p = entry->next();
-        the_table()->free_entry(entry);
-        (*removed)++;
-      }
-      (*processed)++;
-      entry = *p;
-    }
-  }
-}
-
-void StringTable::oops_do(OopClosure* f) {
-  buckets_oops_do(f, 0, the_table()->table_size());
-}
-
-void StringTable::possibly_parallel_oops_do(OopClosure* f) {
-  const int limit = the_table()->table_size();
-
-  for (;;) {
-    // Grab next set of buckets to scan
-    int start_idx = Atomic::add(ClaimChunkSize, &_parallel_claimed_idx) - ClaimChunkSize;
-    if (start_idx >= limit) {
-      // End of table
-      break;
-    }
-
-    int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
-    buckets_oops_do(f, start_idx, end_idx);
-  }
-}
-
-// This verification is part of Universe::verify() and needs to be quick.
-// See StringTable::verify_and_compare() below for exhaustive verification.
-void StringTable::verify() {
-  for (int i = 0; i < the_table()->table_size(); ++i) {
-    HashtableEntry<oop, mtSymbol>* p = the_table()->bucket(i);
-    for ( ; p != NULL; p = p->next()) {
-      oop s = p->literal();
-      guarantee(s != NULL, "interned string is NULL");
-      unsigned int h = java_lang_String::hash_string(s);
-      guarantee(p->hash() == h, "broken hash in string table entry");
-      guarantee(the_table()->hash_to_index(h) == i,
-                "wrong index in string table");
-    }
-  }
-}
-
-void StringTable::dump(outputStream* st) {
-  the_table()->dump_table(st, "StringTable");
-}
-
-StringTable::VerifyRetTypes StringTable::compare_entries(
-                                      int bkt1, int e_cnt1,
-                                      HashtableEntry<oop, mtSymbol>* e_ptr1,
-                                      int bkt2, int e_cnt2,
-                                      HashtableEntry<oop, mtSymbol>* e_ptr2) {
-  // These entries are sanity checked by verify_and_compare_entries()
-  // before this function is called.
-  oop str1 = e_ptr1->literal();
-  oop str2 = e_ptr2->literal();
-
-  if (str1 == str2) {
-    tty->print_cr("ERROR: identical oop values (0x" PTR_FORMAT ") "
-                  "in entry @ bucket[%d][%d] and entry @ bucket[%d][%d]",
-                  (void *)str1, bkt1, e_cnt1, bkt2, e_cnt2);
-    return _verify_fail_continue;
-  }
-
-  if (java_lang_String::equals(str1, str2)) {
-    tty->print_cr("ERROR: identical String values in entry @ "
-                  "bucket[%d][%d] and entry @ bucket[%d][%d]",
-                  bkt1, e_cnt1, bkt2, e_cnt2);
-    return _verify_fail_continue;
-  }
-
-  return _verify_pass;
-}
-
-StringTable::VerifyRetTypes StringTable::verify_entry(int bkt, int e_cnt,
-                                      HashtableEntry<oop, mtSymbol>* e_ptr,
-                                      StringTable::VerifyMesgModes mesg_mode) {
-
-  VerifyRetTypes ret = _verify_pass;  // be optimistic
-
-  oop str = e_ptr->literal();
-  if (str == NULL) {
-    if (mesg_mode == _verify_with_mesgs) {
-      tty->print_cr("ERROR: NULL oop value in entry @ bucket[%d][%d]", bkt,
-                    e_cnt);
-    }
-    // NULL oop means no more verifications are possible
-    return _verify_fail_done;
-  }
-
-  if (str->klass() != SystemDictionary::String_klass()) {
-    if (mesg_mode == _verify_with_mesgs) {
-      tty->print_cr("ERROR: oop is not a String in entry @ bucket[%d][%d]",
-                    bkt, e_cnt);
-    }
-    // not a String means no more verifications are possible
-    return _verify_fail_done;
-  }
-
-  unsigned int h = java_lang_String::hash_string(str);
-  if (e_ptr->hash() != h) {
-    if (mesg_mode == _verify_with_mesgs) {
-      tty->print_cr("ERROR: broken hash value in entry @ bucket[%d][%d], "
-                    "bkt_hash=%d, str_hash=%d", bkt, e_cnt, e_ptr->hash(), h);
-    }
-    ret = _verify_fail_continue;
-  }
-
-  if (the_table()->hash_to_index(h) != bkt) {
-    if (mesg_mode == _verify_with_mesgs) {
-      tty->print_cr("ERROR: wrong index value for entry @ bucket[%d][%d], "
-                    "str_hash=%d, hash_to_index=%d", bkt, e_cnt, h,
-                    the_table()->hash_to_index(h));
-    }
-    ret = _verify_fail_continue;
-  }
-
-  return ret;
-}
-
-// See StringTable::verify() above for the quick verification that is
-// part of Universe::verify(). This verification is exhaustive and
-// reports on every issue that is found. StringTable::verify() only
-// reports on the first issue that is found.
-//
-// StringTable::verify_entry() checks:
-// - oop value != NULL (same as verify())
-// - oop value is a String
-// - hash(String) == hash in entry (same as verify())
-// - index for hash == index of entry (same as verify())
-//
-// StringTable::compare_entries() checks:
-// - oops are unique across all entries
-// - String values are unique across all entries
-//
-int StringTable::verify_and_compare_entries() {
-  assert(StringTable_lock->is_locked(), "sanity check");
-
-  int  fail_cnt = 0;
-
-  // first, verify all the entries individually:
-  for (int bkt = 0; bkt < the_table()->table_size(); bkt++) {
-    HashtableEntry<oop, mtSymbol>* e_ptr = the_table()->bucket(bkt);
-    for (int e_cnt = 0; e_ptr != NULL; e_ptr = e_ptr->next(), e_cnt++) {
-      VerifyRetTypes ret = verify_entry(bkt, e_cnt, e_ptr, _verify_with_mesgs);
-      if (ret != _verify_pass) {
-        fail_cnt++;
-      }
-    }
-  }
-
-  // Optimization: if the above check did not find any failures, then
-  // the comparison loop below does not need to call verify_entry()
-  // before calling compare_entries(). If there were failures, then we
-  // have to call verify_entry() to see if the entry can be passed to
-  // compare_entries() safely. When we call verify_entry() in the loop
-  // below, we do so quietly to void duplicate messages and we don't
-  // increment fail_cnt because the failures have already been counted.
-  bool need_entry_verify = (fail_cnt != 0);
-
-  // second, verify all entries relative to each other:
-  for (int bkt1 = 0; bkt1 < the_table()->table_size(); bkt1++) {
-    HashtableEntry<oop, mtSymbol>* e_ptr1 = the_table()->bucket(bkt1);
-    for (int e_cnt1 = 0; e_ptr1 != NULL; e_ptr1 = e_ptr1->next(), e_cnt1++) {
-      if (need_entry_verify) {
-        VerifyRetTypes ret = verify_entry(bkt1, e_cnt1, e_ptr1,
-                                          _verify_quietly);
-        if (ret == _verify_fail_done) {
-          // cannot use the current entry to compare against other entries
-          continue;
-        }
-      }
-
-      for (int bkt2 = bkt1; bkt2 < the_table()->table_size(); bkt2++) {
-        HashtableEntry<oop, mtSymbol>* e_ptr2 = the_table()->bucket(bkt2);
-        int e_cnt2;
-        for (e_cnt2 = 0; e_ptr2 != NULL; e_ptr2 = e_ptr2->next(), e_cnt2++) {
-          if (bkt1 == bkt2 && e_cnt2 <= e_cnt1) {
-            // skip the entries up to and including the one that
-            // we're comparing against
-            continue;
-          }
-
-          if (need_entry_verify) {
-            VerifyRetTypes ret = verify_entry(bkt2, e_cnt2, e_ptr2,
-                                              _verify_quietly);
-            if (ret == _verify_fail_done) {
-              // cannot compare against this entry
-              continue;
-            }
-          }
-
-          // compare two entries, report and count any failures:
-          if (compare_entries(bkt1, e_cnt1, e_ptr1, bkt2, e_cnt2, e_ptr2)
-              != _verify_pass) {
-            fail_cnt++;
-          }
-        }
-      }
-    }
-  }
-  return fail_cnt;
-}
-
-// 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/hotspot/src/share/vm/classfile/symbolTable.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/symbolTable.hpp	Tue May 27 13:57:42 2014 -0700
@@ -42,7 +42,6 @@
 class BoolObjectClosure;
 class outputStream;
 
-
 // Class to hold a newly created or referenced Symbol* temporarily in scope.
 // new_symbol() and lookup() will create a Symbol* if not already in the
 // symbol table and add to the symbol's reference count.
@@ -252,134 +251,4 @@
   static int parallel_claimed_index()        { return _parallel_claimed_idx; }
 };
 
-class StringTable : public Hashtable<oop, mtSymbol> {
-  friend class VMStructs;
-
-private:
-  // The string table
-  static StringTable* _the_table;
-
-  // Set if one bucket is out of balance due to hash algorithm deficiency
-  static bool _needs_rehashing;
-
-  // Claimed high water mark for parallel chunked scanning
-  static volatile int _parallel_claimed_idx;
-
-  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);
-
-  oop lookup(int index, jchar* chars, int length, unsigned int hashValue);
-
-  // Apply the give oop closure to the entries to the buckets
-  // in the range [start_idx, end_idx).
-  static void buckets_oops_do(OopClosure* f, int start_idx, int end_idx);
-  // Unlink or apply the give oop closure to the entries to the buckets
-  // in the range [start_idx, end_idx).
-  static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed);
-
-  StringTable() : Hashtable<oop, mtSymbol>((int)StringTableSize,
-                              sizeof (HashtableEntry<oop, mtSymbol>)) {}
-
-  StringTable(HashtableBucket<mtSymbol>* t, int number_of_entries)
-    : Hashtable<oop, mtSymbol>((int)StringTableSize, sizeof (HashtableEntry<oop, mtSymbol>), t,
-                     number_of_entries) {}
-public:
-  // The string table
-  static StringTable* the_table() { return _the_table; }
-
-  // Size of one bucket in the string table.  Used when checking for rollover.
-  static uint bucket_size() { return sizeof(HashtableBucket<mtSymbol>); }
-
-  static void create_table() {
-    assert(_the_table == NULL, "One string table allowed.");
-    _the_table = new StringTable();
-  }
-
-  // GC support
-  //   Delete pointers to otherwise-unreachable objects.
-  static void unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f) {
-    int processed = 0;
-    int removed = 0;
-    unlink_or_oops_do(cl, f, &processed, &removed);
-  }
-  static void unlink(BoolObjectClosure* cl) {
-    int processed = 0;
-    int removed = 0;
-    unlink_or_oops_do(cl, NULL, &processed, &removed);
-  }
-  static void unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f, int* processed, int* removed);
-  static void unlink(BoolObjectClosure* cl, int* processed, int* removed) {
-    unlink_or_oops_do(cl, NULL, processed, removed);
-  }
-  // Serially invoke "f->do_oop" on the locations of all oops in the table.
-  static void oops_do(OopClosure* f);
-
-  // Possibly parallel versions of the above
-  static void possibly_parallel_unlink_or_oops_do(BoolObjectClosure* cl, OopClosure* f, int* processed, int* removed);
-  static void possibly_parallel_unlink(BoolObjectClosure* cl, int* processed, int* removed) {
-    possibly_parallel_unlink_or_oops_do(cl, NULL, processed, removed);
-  }
-  static void possibly_parallel_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);
-  static oop lookup(jchar* chars, int length);
-
-  // Interning
-  static oop intern(Symbol* symbol, TRAPS);
-  static oop intern(oop string, TRAPS);
-  static oop intern(const char *utf8_string, TRAPS);
-
-  // Debugging
-  static void verify();
-  static void dump(outputStream* st);
-
-  enum VerifyMesgModes {
-    _verify_quietly    = 0,
-    _verify_with_mesgs = 1
-  };
-
-  enum VerifyRetTypes {
-    _verify_pass          = 0,
-    _verify_fail_continue = 1,
-    _verify_fail_done     = 2
-  };
-
-  static VerifyRetTypes compare_entries(int bkt1, int e_cnt1,
-                                        HashtableEntry<oop, mtSymbol>* e_ptr1,
-                                        int bkt2, int e_cnt2,
-                                        HashtableEntry<oop, mtSymbol>* e_ptr2);
-  static VerifyRetTypes verify_entry(int bkt, int e_cnt,
-                                     HashtableEntry<oop, mtSymbol>* e_ptr,
-                                     VerifyMesgModes mesg_mode);
-  static int verify_and_compare_entries();
-
-  // Sharing
-  static void copy_buckets(char** top, char*end) {
-    the_table()->Hashtable<oop, mtSymbol>::copy_buckets(top, end);
-  }
-  static void copy_table(char** top, char*end) {
-    the_table()->Hashtable<oop, mtSymbol>::copy_table(top, end);
-  }
-  static void reverse() {
-    the_table()->Hashtable<oop, mtSymbol>::reverse();
-  }
-
-  // Rehash the symbol table if it gets out of balance
-  static void rehash_table();
-  static bool needs_rehashing() { return _needs_rehashing; }
-
-  // Parallel chunked scanning
-  static void clear_parallel_claimed_index() { _parallel_claimed_idx = 0; }
-  static int parallel_claimed_index() { return _parallel_claimed_idx; }
-};
 #endif // SHARE_VM_CLASSFILE_SYMBOLTABLE_HPP
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp	Tue May 27 13:57:42 2014 -0700
@@ -29,6 +29,7 @@
 #include "classfile/loaderConstraints.hpp"
 #include "classfile/placeholders.hpp"
 #include "classfile/resolutionErrors.hpp"
+#include "classfile/stringTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "compiler/compileBroker.hpp"
@@ -603,7 +604,6 @@
 
   Ticks class_load_start_time = Ticks::now();
 
-  // UseNewReflection
   // Fix for 4474172; see evaluation for more details
   class_loader = Handle(THREAD, java_lang_ClassLoader::non_reflection_class_loader(class_loader()));
   ClassLoaderData *loader_data = register_loader(class_loader, CHECK_NULL);
@@ -897,7 +897,6 @@
                               Handle protection_domain,
                               TRAPS) {
 
-  // UseNewReflection
   // The result of this call should be consistent with the result
   // of the call to resolve_instance_class_or_null().
   // See evaluation 6790209 and 4474172 for more details.
@@ -2269,7 +2268,7 @@
       oop appendix = appendix_box->obj_at(0);
       if (TraceMethodHandles) {
     #ifndef PRODUCT
-        tty->print("Linked method="INTPTR_FORMAT": ", m);
+        tty->print("Linked method=" INTPTR_FORMAT ": ", p2i(m));
         m->print();
         if (appendix != NULL) { tty->print("appendix = "); appendix->print(); }
         tty->cr();
--- a/hotspot/src/share/vm/classfile/systemDictionary.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp	Tue May 27 13:57:42 2014 -0700
@@ -390,7 +390,7 @@
     return k;
   }
   static Klass* check_klass_Opt_Only_JDK14NewRef(Klass* k) {
-    assert(JDK_Version::is_gte_jdk14x_version() && UseNewReflection, "JDK 1.4 only");
+    assert(JDK_Version::is_gte_jdk14x_version(), "JDK 1.4 only");
     // despite the optional loading, if you use this it must be present:
     return check_klass(k);
   }
--- a/hotspot/src/share/vm/classfile/verifier.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Tue May 27 13:57:42 2014 -0700
@@ -211,9 +211,9 @@
     // reflection implementation, not just those associated with
     // sun/reflect/SerializationConstructorAccessor.
     // NOTE: this is called too early in the bootstrapping process to be
-    // guarded by Universe::is_gte_jdk14x_version()/UseNewReflection.
+    // guarded by Universe::is_gte_jdk14x_version().
     // Also for lambda generated code, gte jdk8
-    (!is_reflect || VerifyReflectionBytecodes));
+    (!is_reflect));
 }
 
 Symbol* Verifier::inference_verify(
@@ -364,7 +364,7 @@
 
 void ErrorContext::details(outputStream* ss, const Method* method) const {
   if (is_valid()) {
-    ss->print_cr("");
+    ss->cr();
     ss->print_cr("Exception Details:");
     location_details(ss, method);
     reason_details(ss);
@@ -379,7 +379,7 @@
   streamIndentor si(ss);
   ss->indent().print_cr("Reason:");
   streamIndentor si2(ss);
-  ss->indent().print("");
+  ss->indent().print("%s", "");
   switch (_fault) {
     case INVALID_BYTECODE:
       ss->print("Error exists in the bytecode");
@@ -432,7 +432,7 @@
       ShouldNotReachHere();
       ss->print_cr("Unknown");
   }
-  ss->print_cr("");
+  ss->cr();
 }
 
 void ErrorContext::location_details(outputStream* ss, const Method* method) const {
@@ -507,7 +507,7 @@
     for (u2 i = 0; i < sm_table->number_of_entries(); ++i) {
       ss->indent();
       sm_frame->print_on(ss, current_offset);
-      ss->print_cr("");
+      ss->cr();
       current_offset += sm_frame->offset_delta();
       sm_frame = sm_frame->next();
     }
@@ -579,7 +579,8 @@
     tty->print_cr("Verifying method %s", m->name_and_sig_as_C_string());
   }
 
-  const char* bad_type_msg = "Bad type on operand stack in %s";
+// For clang, the only good constant format string is a literal constant format string.
+#define bad_type_msg "Bad type on operand stack in %s"
 
   int32_t max_stack = m->verifier_max_stack();
   int32_t max_locals = m->max_locals();
@@ -1676,6 +1677,8 @@
   }
 }
 
+#undef bad_type_message
+
 char* ClassVerifier::generate_code_data(methodHandle m, u4 code_length, TRAPS) {
   char* code_data = NEW_RESOURCE_ARRAY(char, code_length);
   memset(code_data, 0, sizeof(char) * code_length);
@@ -2363,8 +2366,8 @@
   if (opcode == Bytecodes::_invokedynamic) {
     if (_klass->major_version() < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
       class_format_error(
-        "invokedynamic instructions not supported by this class file version",
-        _klass->external_name());
+        "invokedynamic instructions not supported by this class file version (%d), class %s",
+        _klass->major_version(), _klass->external_name());
       return;
     }
   } else {
--- a/hotspot/src/share/vm/classfile/verifier.hpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/verifier.hpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -375,15 +375,15 @@
   bool has_error() const { return result() != NULL; }
   char* exception_message() {
     stringStream ss;
-    ss.print(_message);
+    ss.print("%s", _message);
     _error_context.details(&ss, _method());
     return ss.as_string();
   }
 
   // Called when verify or class format errors are encountered.
   // May throw an exception based upon the mode.
-  void verify_error(ErrorContext ctx, const char* fmt, ...);
-  void class_format_error(const char* fmt, ...);
+  void verify_error(ErrorContext ctx, const char* fmt, ...) ATTRIBUTE_PRINTF(3, 4);
+  void class_format_error(const char* fmt, ...) ATTRIBUTE_PRINTF(2, 3);
 
   Klass* load_class(Symbol* name, TRAPS);
 
--- a/hotspot/src/share/vm/classfile/vmSymbols.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -533,7 +533,7 @@
     xtty->begin_elem("intrinsic_misdeclared actual='%s' declared='%s'",
                      actual_name, declared_name);
     xtty->method(mh);
-    xtty->end_elem("");
+    xtty->end_elem("%s", "");
   }
   if (PrintMiscellaneous && (WizardMode || Verbose)) {
     tty->print_cr("*** misidentified method; %s(%d) should be %s(%d):",
--- a/hotspot/src/share/vm/code/codeBlob.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/code/codeBlob.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -530,7 +530,7 @@
 }
 
 void CodeBlob::print_on(outputStream* st) const {
-  st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", this);
+  st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", p2i(this));
   st->print_cr("Framesize: %d", _frame_size);
 }
 
@@ -548,7 +548,7 @@
 }
 
 void BufferBlob::print_value_on(outputStream* st) const {
-  st->print_cr("BufferBlob (" INTPTR_FORMAT  ") used for %s", this, name());
+  st->print_cr("BufferBlob (" INTPTR_FORMAT  ") used for %s", p2i(this), name());
 }
 
 void RuntimeStub::verify() {
@@ -558,13 +558,13 @@
 void RuntimeStub::print_on(outputStream* st) const {
   ttyLocker ttyl;
   CodeBlob::print_on(st);
-  st->print("Runtime Stub (" INTPTR_FORMAT "): ", this);
-  st->print_cr(name());
+  st->print("Runtime Stub (" INTPTR_FORMAT "): ", p2i(this));
+  st->print_cr("%s", name());
   Disassembler::decode((CodeBlob*)this, st);
 }
 
 void RuntimeStub::print_value_on(outputStream* st) const {
-  st->print("RuntimeStub (" INTPTR_FORMAT "): ", this); st->print(name());
+  st->print("RuntimeStub (" INTPTR_FORMAT "): ", p2i(this)); st->print("%s", name());
 }
 
 void SingletonBlob::verify() {
@@ -574,12 +574,12 @@
 void SingletonBlob::print_on(outputStream* st) const {
   ttyLocker ttyl;
   CodeBlob::print_on(st);
-  st->print_cr(name());
+  st->print_cr("%s", name());
   Disassembler::decode((CodeBlob*)this, st);
 }
 
 void SingletonBlob::print_value_on(outputStream* st) const {
-  st->print_cr(name());
+  st->print_cr("%s", name());
 }
 
 void DeoptimizationBlob::print_value_on(outputStream* st) const {
--- a/hotspot/src/share/vm/code/codeCache.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/code/codeCache.cpp	Tue May 27 13:57:42 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -81,10 +81,10 @@
   bool is_empty()                                { return count == 0; }
 
   void print(const char* title) {
-    tty->print_cr(" #%d %s = %dK (hdr %d%%,  loc %d%%, code %d%%, stub %d%%, [oops %d%%, data %d%%, pcs %d%%])",
+    tty->print_cr(" #%d %s = %dK (hdr %d%%,  loc %d%%, code %d%%, stub %d%%, [oops %d%%, metadata %d%%, data %d%%, pcs %d%%])",
                   count,
                   title,
-                  total() / K,
+                  (int)(total() / K),
                   header_size             * 100 / total_size,
                   relocation_size         * 100 / total_size,
                   code_size               * 100 / total_size,
@@ -178,10 +178,12 @@
   // cache will contain a garbage CodeBlob until the caller can
   // run the constructor for the CodeBlob subclass he is busy
   // instantiating.
-  guarantee(size >= 0, "allocation request must be reasonable");
   assert_locked_or_safepoint(CodeCache_lock);
+  assert(size > 0, "allocation request must be reasonable");
+  if (size <= 0) {
+    return NULL;
+  }
   CodeBlob* cb = NULL;
-  _number_of_blobs++;
   while (true) {
     cb = (CodeBlob*)_heap->allocate(size, is_critical);
     if (cb != NULL) break;
@@ -191,7 +193,7 @@
     }
     if (PrintCodeCacheExtension) {
       ResourceMark rm;
-      tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (%d bytes)",
+      tty->print_cr("code cache extended to [" INTPTR_FORMAT ", " INTPTR_FORMAT "] (" SSIZE_FORMAT " bytes)",
                     (intptr_t)_heap->low_boundary(), (intptr_t)_heap->high(),
                     (address)_heap->high() - (address)_heap->low_boundary());
     }
@@ -199,6 +201,7 @@
   maxCodeCacheUsed = MAX2(maxCodeCacheUsed, ((address)_heap->high_boundary() -
                           (address)_heap->low_boundary()) - unallocated_capacity());
   print_trace("allocation", cb, size);
+  _number_of_blobs++;
   return cb;
 }
 
@@ -487,7 +490,7 @@
           if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc())) {
             CompiledIC *ic = CompiledIC_at(iter.reloc());
             if (TraceCompiledIC) {
-              tty->print("noticed icholder " INTPTR_FORMAT " ", ic->cached_icholder());
+              tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder()));
               ic->print();
             }
             assert(ic->cached_icholder() != NULL, "must be non-NULL");
@@ -741,10 +744,10 @@
   }
   // Print bytes that are allocated in the freelist
   ttyLocker ttl;
-  tty->print_cr("Number of elements in freelist: %d",    freelist_length());
-  tty->print_cr("Allocated in freelist:          %dkB",  bytes_allocated_in_freelist()/K);
-  tty->print_cr("Unused bytes in CodeBlobs:      %dkB",  (int)(wasted_bytes/K));
-  tty->print_cr("Segment map size:               %dkB",  allocated_segments()/K); // 1 byte per segment
+  tty->print_cr("Number of elements in freelist: " SSIZE_FORMAT,    freelist_length());
+  tty->print_cr("Allocated in freelist:          " SSIZE_FORMAT "kB",  bytes_allocated_in_freelist()/K);
+  tty->print_cr("Unused bytes in CodeBlobs:      " SSIZE_FORMAT "kB",  (wasted_bytes/K));
+  tty->print_cr("Segment map size:               " SSIZE_FORMAT "kB",  allocated_segments()/K); // 1 byte per segment
 }
 
 //------------------------------------------------------------------------------------------------
@@ -756,7 +759,7 @@
   if (PrintCodeCache2) {  // Need to add a new flag
     ResourceMark rm;
     if (size == 0)  size = cb->size();
-    tty->print_cr("CodeCache %s:  addr: " INTPTR_FORMAT ", size: 0x%x", event, cb, size);
+    tty->print_cr("CodeCache %s:  addr: " INTPTR_FORMAT ", size: 0x%x", event, p2i(cb), size);
   }
 }
 
@@ -926,9 +929,9 @@
 
   if (detailed) {
     st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]",
-                 _heap->low_boundary(),
-                 _heap->high(),
-                 _heap->high_boundary());
+                 p2i(_heap->low_boundary()),
+                 p2i(_heap->high()),
+                 p2i(_heap->high_boundary()));
     st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT
                  " adapters=" UINT32_FORMAT,
                  nof_blobs(), nof_nmethods(), nof_adapters());
--- a/hotspot/src/share/vm/code/compiledIC.cpp	Fri May 23 11:16:31 2014 -0700
+++ b/hotspot/src/share/vm/code/compiledIC.cpp	Tue M