changeset 32087:dcbcf15229a9

Merge
author roland
date Tue, 04 Aug 2015 13:41:09 +0200
parents 7590882ae33a a9f423dbab9e
children 63ed7daed8a3
files hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1Allocator.java hotspot/src/share/vm/opto/c2_globals.hpp hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp hotspot/src/share/vm/runtime/globals.hpp jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/ClassPath.java jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/Hashtree2Node.java jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/GB18030.java nashorn/samples/time_color.fx
diffstat 452 files changed, 61426 insertions(+), 45127 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Aug 03 05:05:40 2015 -0400
+++ b/.hgtags	Tue Aug 04 13:41:09 2015 +0200
@@ -317,3 +317,4 @@
 61d2d0629b6dbf4c091dc86151ade1b3ef34fffe jdk9-b72
 9b3a9d72f07b40c648de79961679f42283af1bb5 jdk9-b73
 7c577fda1855d03c04546694d514678f596508c9 jdk9-b74
+f55df5cfe11c97e4b58998b76f5bd00a73cde12d jdk9-b75
--- a/.hgtags-top-repo	Mon Aug 03 05:05:40 2015 -0400
+++ b/.hgtags-top-repo	Tue Aug 04 13:41:09 2015 +0200
@@ -317,3 +317,4 @@
 8582c35016fb6211b373810b6b172feccf9c483b jdk9-b72
 4c2cbaae528bce970dabbb5676005d379357f4b6 jdk9-b73
 57f3134853ecdd4a3ee2d4d26f22ba981d653d79 jdk9-b74
+8fd6eeb878606e39c908f12535f34ebbfd225a4a jdk9-b75
--- a/corba/.hgtags	Mon Aug 03 05:05:40 2015 -0400
+++ b/corba/.hgtags	Tue Aug 04 13:41:09 2015 +0200
@@ -317,3 +317,4 @@
 f9f3706bd24c42c07cb260fe05730a749b8e52f4 jdk9-b72
 29096b78d93b01a2f8882509cd40755e3d6b8cd9 jdk9-b73
 622fe934e351e89107edf3c667d6b57f543f58f1 jdk9-b74
+960b56805abd8460598897481820bd6a75f979e7 jdk9-b75
--- a/hotspot/.hgtags	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/.hgtags	Tue Aug 04 13:41:09 2015 +0200
@@ -477,3 +477,4 @@
 c1b2825ef47e75cb34dd18450d1c4280b7c5853c jdk9-b72
 e37d432868be0aa7cb5e0f3d7caff1e825d8ead3 jdk9-b73
 fff6b54e9770ac4c12c2fb4cab5aa7672affa4bd jdk9-b74
+2f354281e9915275693c4e519a959b8a6f22d3a3 jdk9-b75
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java	Tue Aug 04 13:41:09 2015 +0200
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class SAGetopt {
+
+    private String[] _argv;
+
+    private int _optind;    // index in arguments array
+    private int _optopt;    // index within an argument
+    private String _optarg; // last option argument
+    private boolean _optreset; // special handling of first call
+
+    public SAGetopt(String[] args) {
+        _argv  = args;
+        _optind   = 0;
+        _optopt   = 1;
+        _optarg   = null;
+        _optreset = true;
+    }
+
+    public String getOptarg() {
+        return _optarg;
+    }
+
+    public int getOptind() {
+        return _optind;
+    }
+
+    private void extractOptarg(String opt) {
+        // Argument expected
+        if (_optind > _argv.length) {
+            throw new RuntimeException("Not enough arguments for '" + opt + "'");
+        }
+
+        if (! _argv[_optind].isEmpty() && _argv[_optind].charAt(0) == '-') {
+            throw new RuntimeException("Argument is expected for '" + opt + "'");
+        }
+
+        _optarg = _argv[_optind];
+        _optind += 1;
+    }
+
+    private String processLongOptions(String carg, String[] longOptStr) {
+        List<String> los = Arrays.asList(longOptStr);
+        String[] ca = carg.split("=", 2);
+
+        if (los.contains(ca[0])) {
+            if (ca.length > 1) {
+                throw new RuntimeException("Argument is not expected for '" + ca[0] + "'");
+            }
+            return carg;
+        }
+
+        if (los.contains(ca[0] + "=")) {
+            if (ca.length > 1) {
+                // GNU style options --file=name
+                _optarg = ca[1];
+            }
+            else {
+                // Mixed style options --file name
+                extractOptarg(ca[0]);
+            }
+
+            return ca[0];
+        }
+
+        throw new RuntimeException("Invalid option '" + ca[0] + "'");
+    }
+
+    public String next(String optStr, String[] longOptStr) {
+
+        if (_optind >= _argv.length || _argv[_optind] == null) {
+            // All arguments processed
+            return null;
+        }
+
+        String carg = _argv[_optind];
+        _optarg = null;
+
+        if (_optreset) {
+            // End of option batch like '-abc' reached, expect option to start from '-'
+
+            if (carg.isEmpty() || carg.charAt(0) != '-' || carg.equals("--")) {
+                // Stop processing on -- or first non-option argument;
+                return null;
+            }
+
+            if (carg.startsWith("--")) {
+                // Handle long options, it can't be combined so it's simple
+                if (longOptStr == null || longOptStr.length == 0) {
+                    // No long options expected, stop options processing
+                    return null;
+                }
+                ++ _optind;
+
+                // at this point carg contains at least one character besides --
+                carg = carg.substring(2);
+                return processLongOptions(carg, longOptStr);
+            }
+
+            if (optStr == null || optStr.length() == 0) {
+                // No short options
+                return null;
+            }
+
+            // At this point carg[0] contains '-'
+            _optreset = false;
+            _optopt = 1;
+        }
+
+        char ch = carg.charAt(_optopt);
+
+        // adjust pointer to next character
+        _optopt += 1;
+
+        // Okay, ready to process options like
+        // -abc -d bla -ef
+
+        int chIndex = optStr.indexOf(ch);
+        if (chIndex == -1) {
+            throw new RuntimeException("Invalid option '" + ch + "'");
+        }
+
+        if (_optopt >= carg.length()) {
+            _optind += 1;
+            _optreset = true;
+        }
+
+        if (chIndex < optStr.length()-1 && optStr.charAt(chIndex+1) == ':') {
+            // Argument expected
+            extractOptarg(String.valueOf(ch));
+        }
+
+        return String.valueOf(ch);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncher.java	Tue Aug 04 13:41:09 2015 +0200
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import sun.jvm.hotspot.tools.JStack;
+import sun.jvm.hotspot.tools.JMap;
+import sun.jvm.hotspot.tools.JInfo;
+
+public class SALauncher {
+
+    private static boolean launcherHelp() {
+        System.out.println("    clhsdb       \tcommand line debugger");
+        System.out.println("    hsdb         \tui debugger");
+        System.out.println("    jstack --help\tto get more information");
+        System.out.println("    jmap   --help\tto get more information");
+        System.out.println("    jinfo  --help\tto get more information");
+        return false;
+    }
+
+    private static boolean commonHelp() {
+        // --pid <pid>
+        // --exe <exe>
+        // --core <core>
+        System.out.println("    --exe\texecutable image name");
+        System.out.println("    --core\tpath to coredump");
+        System.out.println("    --pid\tpid of process to attach");
+        return false;
+    }
+
+    private static boolean jinfoHelp() {
+        // --flags -> -flags
+        // --sysprops -> -sysprops
+        System.out.println("    --flags\tto print VM flags");
+        System.out.println("    --sysprops\tto print Java System properties");
+        System.out.println("    <no option>\tto print both of the above");
+        return commonHelp();
+    }
+
+    private static boolean jmapHelp() {
+        // --heap -> -heap
+        // --binaryheap -> -heap:format=b
+        // --histo -> -histo
+        // --clstats -> -clstats
+        // --finalizerinfo -> -finalizerinfo
+
+        System.out.println("    <no option>\tto print same info as Solaris pmap");
+        System.out.println("    --heap\tto print java heap summary");
+        System.out.println("    --binaryheap\tto dump java heap in hprof binary format");
+        System.out.println("    --histo\tto print histogram of java object heap");
+        System.out.println("    --clstats\tto print class loader statistics");
+        System.out.println("    --finalizerinfo\tto print information on objects awaiting finalization");
+        return commonHelp();
+    }
+
+    private static boolean jstackHelp() {
+        // --locks -> -l
+        // --mixed -> -m
+        System.out.println("    --locks\tto print java.util.concurrent locks");
+        System.out.println("    --mixed\tto print both java and native frames (mixed mode)");
+        return commonHelp();
+    }
+
+    private static boolean toolHelp(String toolName) {
+        if (toolName.equals("jstack")) {
+            return jstackHelp();
+        }
+        if (toolName.equals("jinfo")) {
+            return jinfoHelp();
+        }
+        if (toolName.equals("jmap")) {
+            return jmapHelp();
+        }
+        if (toolName.equals("hsdb") || toolName.equals("clhsdb")) {
+            return commonHelp();
+        }
+        return launcherHelp();
+    }
+
+    private static void runCLHSDB(String[] oldArgs) {
+        SAGetopt sg = new SAGetopt(oldArgs);
+        String[] longOpts = {"exe=", "core=", "pid="};
+
+        ArrayList<String> newArgs = new ArrayList();
+        String exeORpid = null;
+        String core = null;
+        String s = null;
+
+        while((s = sg.next(null, longOpts)) != null) {
+            if (s.equals("exe")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("core")) {
+                core = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("pid")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+        }
+
+        if (exeORpid != null) {
+            newArgs.add(exeORpid);
+            if (core != null) {
+                newArgs.add(core);
+            }
+        }
+        CLHSDB.main(newArgs.toArray(new String[newArgs.size()]));
+    }
+
+    private static void runHSDB(String[] oldArgs) {
+        SAGetopt sg = new SAGetopt(oldArgs);
+        String[] longOpts = {"exe=", "core=", "pid="};
+
+        ArrayList<String> newArgs = new ArrayList();
+        String exeORpid = null;
+        String core = null;
+        String s = null;
+
+        while((s = sg.next(null, longOpts)) != null) {
+            if (s.equals("exe")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("core")) {
+                core = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("pid")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+        }
+
+        if (exeORpid != null) {
+            newArgs.add(exeORpid);
+            if (core != null) {
+                newArgs.add(core);
+            }
+        }
+        HSDB.main(newArgs.toArray(new String[newArgs.size()]));
+    }
+
+    private static void runJSTACK(String[] oldArgs) {
+        SAGetopt sg = new SAGetopt(oldArgs);
+        String[] longOpts = {"exe=", "core=", "pid=",
+                                 "mixed", "locks"};
+
+        ArrayList<String> newArgs = new ArrayList();
+        String exeORpid = null;
+        String core = null;
+        String s = null;
+
+        while((s = sg.next(null, longOpts)) != null) {
+            if (s.equals("exe")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("core")) {
+                core = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("pid")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("mixed")) {
+                newArgs.add("-m");
+                continue;
+            }
+            if (s.equals("locks")) {
+                newArgs.add("-l");
+                continue;
+            }
+        }
+
+        if (exeORpid != null) {
+            newArgs.add(exeORpid);
+            if (core != null) {
+                newArgs.add(core);
+            }
+        }
+
+        JStack.main(newArgs.toArray(new String[newArgs.size()]));
+    }
+
+    private static void runJMAP(String[] oldArgs) {
+        SAGetopt sg = new SAGetopt(oldArgs);
+        String[] longOpts = {"exe=", "core=", "pid=",
+              "heap", "binaryheap", "histo", "clstats", "finalizerinfo"};
+
+        ArrayList<String> newArgs = new ArrayList();
+        String exeORpid = null;
+        String core = null;
+        String s = null;
+
+        while((s = sg.next(null, longOpts)) != null) {
+            if (s.equals("exe")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("core")) {
+                core = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("pid")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("heap")) {
+                newArgs.add("-heap");
+                continue;
+            }
+            if (s.equals("binaryheap")) {
+                newArgs.add("-heap:format=b");
+                continue;
+            }
+            if (s.equals("histo")) {
+                newArgs.add("-histo");
+                continue;
+            }
+            if (s.equals("clstats")) {
+                newArgs.add("-clstats");
+                continue;
+            }
+            if (s.equals("finalizerinfo")) {
+                newArgs.add("-finalizerinfo");
+                continue;
+            }
+        }
+
+        if (exeORpid != null) {
+            newArgs.add(exeORpid);
+            if (core != null) {
+                newArgs.add(core);
+            }
+        }
+
+        JMap.main(newArgs.toArray(new String[newArgs.size()]));
+    }
+
+    private static void runJINFO(String[] oldArgs) {
+        SAGetopt sg = new SAGetopt(oldArgs);
+        String[] longOpts = {"exe=", "core=", "pid=",
+                                     "flags", "sysprops"};
+
+        ArrayList<String> newArgs = new ArrayList();
+        String exeORpid = null;
+        String core = null;
+        String s = null;
+
+        while((s = sg.next(null, longOpts)) != null) {
+            if (s.equals("exe")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("core")) {
+                core = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("pid")) {
+                exeORpid = sg.getOptarg();
+                continue;
+            }
+            if (s.equals("flags")) {
+                newArgs.add("-flags");
+                continue;
+            }
+            if (s.equals("sysprops")) {
+                newArgs.add("-sysprops");
+                continue;
+            }
+        }
+
+        if (exeORpid != null) {
+            newArgs.add(exeORpid);
+            if (core != null) {
+                newArgs.add(core);
+            }
+        }
+
+        JInfo.main(newArgs.toArray(new String[newArgs.size()]));
+    }
+
+    public static void main(String[] args) {
+        // Provide a help
+        if (args.length == 0) {
+            launcherHelp();
+            return;
+        }
+        // No arguments imply help for jstack, jmap, jinfo but launch clhsdb and hsdb
+        if (args.length == 1 && !args[0].equals("clhsdb") && !args[0].equals("hsdb")) {
+            toolHelp(args[0]);
+            return;
+        }
+
+        for (String arg : args) {
+            if (arg.equals("-h") || arg.equals("-help") || arg.equals("--help")) {
+                toolHelp(args[0]);
+                return;
+            }
+        }
+
+        String[] oldArgs = Arrays.copyOfRange(args, 1, args.length);
+
+        // Run SA interactive mode
+        if (args[0].equals("clhsdb")) {
+            runCLHSDB(oldArgs);
+            return;
+        }
+
+        if (args[0].equals("hsdb")) {
+            runHSDB(oldArgs);
+            return;
+        }
+
+        // Run SA tmtools mode
+        if (args[0].equals("jstack")) {
+            runJSTACK(oldArgs);
+            return;
+        }
+
+        if (args[0].equals("jmap")) {
+            runJMAP(oldArgs);
+            return;
+        }
+
+        if (args[0].equals("jinfo")) {
+            runJINFO(oldArgs);
+            return;
+        }
+    }
+}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext.java	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext.java	Tue Aug 04 13:41:09 2015 +0200
@@ -37,6 +37,21 @@
 public abstract class AARCH64ThreadContext implements ThreadContext {
     // Taken from /usr/include/asm/sigcontext.h on Linux/AARCH64.
 
+    //  /*
+    //   * Signal context structure - contains all info to do with the state
+    //   * before the signal handler was invoked.
+    //   */
+    // struct sigcontext {
+    //         __u64 fault_address;
+    //         /* AArch64 registers */
+    //          __u64 regs[31];
+    //          __u64 sp;
+    //          __u64 pc;
+    //          __u64 pstate;
+    //          /* 4K reserved for FP/SIMD state and future expansion */
+    //          __u8 __reserved[4096] __attribute__((__aligned__(16)));
+    //  };
+
     // NOTE: the indices for the various registers must be maintained as
     // listed across various operating systems. However, only a small
     // subset of the registers' values are guaranteed to be present (and
@@ -78,8 +93,9 @@
     public static final int LR = 30;
     public static final int SP = 31;
     public static final int PC = 32;
+    public static final int PSTATE = 33;
 
-    public static final int NPRGREG = 33;
+    public static final int NPRGREG = 34;
 
     private long[] data;
 
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1Allocator.java	Mon Aug 03 05:05:40 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-package sun.jvm.hotspot.gc.g1;
-
-import java.util.Observable;
-import java.util.Observer;
-
-import sun.jvm.hotspot.debugger.Address;
-import sun.jvm.hotspot.runtime.VM;
-import sun.jvm.hotspot.runtime.VMObject;
-import sun.jvm.hotspot.types.CIntegerField;
-import sun.jvm.hotspot.types.Type;
-import sun.jvm.hotspot.types.TypeDataBase;
-
-public class G1Allocator extends VMObject {
-
-  //size_t _summary_bytes_used;
-  static private CIntegerField summaryBytesUsedField;
-
-  static {
-    VM.registerVMInitializedObserver(new Observer() {
-      public void update(Observable o, Object data) {
-        initialize(VM.getVM().getTypeDataBase());
-      }
-    });
-  }
-
-  static private synchronized void initialize(TypeDataBase db) {
-    Type type = db.lookupType("G1Allocator");
-
-    summaryBytesUsedField = type.getCIntegerField("_summary_bytes_used");
-  }
-
-  public long getSummaryBytes() {
-    return summaryBytesUsedField.getValue(addr);
-  }
-
-  public G1Allocator(Address addr) {
-    super(addr);
-
-  }
-}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java	Tue Aug 04 13:41:09 2015 +0200
@@ -36,6 +36,7 @@
 import sun.jvm.hotspot.runtime.VM;
 import sun.jvm.hotspot.runtime.VMObjectFactory;
 import sun.jvm.hotspot.types.AddressField;
+import sun.jvm.hotspot.types.CIntegerField;
 import sun.jvm.hotspot.types.Type;
 import sun.jvm.hotspot.types.TypeDataBase;
 
@@ -46,8 +47,8 @@
     static private long hrmFieldOffset;
     // MemRegion _g1_reserved;
     static private long g1ReservedFieldOffset;
-    // G1Allocator* _allocator
-    static private AddressField g1Allocator;
+    // size_t _summary_bytes_used;
+    static private CIntegerField summaryBytesUsedField;
     // G1MonitoringSupport* _g1mm;
     static private AddressField g1mmField;
     // HeapRegionSet _old_set;
@@ -67,7 +68,7 @@
         Type type = db.lookupType("G1CollectedHeap");
 
         hrmFieldOffset = type.getField("_hrm").getOffset();
-        g1Allocator = type.getAddressField("_allocator");
+        summaryBytesUsedField = type.getCIntegerField("_summary_bytes_used");
         g1mmField = type.getAddressField("_g1mm");
         oldSetFieldOffset = type.getField("_old_set").getOffset();
         humongousSetFieldOffset = type.getField("_humongous_set").getOffset();
@@ -78,7 +79,7 @@
     }
 
     public long used() {
-        return allocator().getSummaryBytes();
+        return summaryBytesUsedField.getValue(addr);
     }
 
     public long n_regions() {
@@ -96,11 +97,6 @@
         return (G1MonitoringSupport) VMObjectFactory.newObject(G1MonitoringSupport.class, g1mmAddr);
     }
 
-    public G1Allocator allocator() {
-        Address g1AllocatorAddr = g1Allocator.getValue(addr);
-        return (G1Allocator) VMObjectFactory.newObject(G1Allocator.class, g1AllocatorAddr);
-    }
-
     public HeapRegionSetBase oldSet() {
         Address oldSetAddr = addr.addOffsetTo(oldSetFieldOffset);
         return (HeapRegionSetBase) VMObjectFactory.newObject(HeapRegionSetBase.class,
--- a/hotspot/src/os/aix/vm/os_aix.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/os/aix/vm/os_aix.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -1550,6 +1550,13 @@
   LoadedLibraries::print(st);
 }
 
+void os::get_summary_os_info(char* buf, size_t buflen) {
+  // There might be something more readable than uname results for AIX.
+  struct utsname name;
+  uname(&name);
+  snprintf(buf, buflen, "%s %s", name.release, name.version);
+}
+
 void os::print_os_info(outputStream* st) {
   st->print("OS:");
 
@@ -1654,6 +1661,17 @@
   }
 }
 
+// Get a string for the cpuinfo that is a summary of the cpu type
+void os::get_summary_cpu_info(char* buf, size_t buflen) {
+  // This looks good
+  os::Aix::cpuinfo_t ci;
+  if (os::Aix::get_cpuinfo(&ci)) {
+    strncpy(buf, ci.version, buflen);
+  } else {
+    strncpy(buf, "AIX", buflen);
+  }
+}
+
 void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) {
 }
 
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -1600,24 +1600,6 @@
   return dlsym(handle, name);
 }
 
-
-static bool _print_ascii_file(const char* filename, outputStream* st) {
-  int fd = ::open(filename, O_RDONLY);
-  if (fd == -1) {
-    return false;
-  }
-
-  char buf[32];
-  int bytes;
-  while ((bytes = ::read(fd, buf, sizeof(buf))) > 0) {
-    st->print_raw(buf, bytes);
-  }
-
-  ::close(fd);
-
-  return true;
-}
-
 int _print_dll_info_cb(const char * name, address base_address, address top_address, void * param) {
   outputStream * out = (outputStream *) param;
   out->print_cr(PTR_FORMAT " \t%s", base_address, name);
@@ -1678,15 +1660,38 @@
 #endif
 }
 
+void os::get_summary_os_info(char* buf, size_t buflen) {
+  // These buffers are small because we want this to be brief
+  // and not use a lot of stack while generating the hs_err file.
+  char os[100];
+  size_t size = sizeof(os);
+  int mib_kern[] = { CTL_KERN, KERN_OSTYPE };
+  if (sysctl(mib_kern, 2, os, &size, NULL, 0) < 0) {
+#ifdef __APPLE__
+      strncpy(os, "Darwin", sizeof(os));
+#elif __OpenBSD__
+      strncpy(os, "OpenBSD", sizeof(os));
+#else
+      strncpy(os, "BSD", sizeof(os));
+#endif
+  }
+
+  char release[100];
+  size = sizeof(release);
+  int mib_release[] = { CTL_KERN, KERN_OSRELEASE };
+  if (sysctl(mib_release, 2, release, &size, NULL, 0) < 0) {
+      // if error, leave blank
+      strncpy(release, "", sizeof(release));
+  }
+  snprintf(buf, buflen, "%s %s", os, release);
+}
+
 void os::print_os_info_brief(outputStream* st) {
-  st->print("Bsd");
-
   os::Posix::print_uname_info(st);
 }
 
 void os::print_os_info(outputStream* st) {
   st->print("OS:");
-  st->print("Bsd");
 
   os::Posix::print_uname_info(st);
 
@@ -1699,6 +1704,33 @@
   // Nothing to do for now.
 }
 
+void os::get_summary_cpu_info(char* buf, size_t buflen) {
+  unsigned int mhz;
+  size_t size = sizeof(mhz);
+  int mib[] = { CTL_HW, HW_CPU_FREQ };
+  if (sysctl(mib, 2, &mhz, &size, NULL, 0) < 0) {
+    mhz = 1;  // looks like an error but can be divided by
+  } else {
+    mhz /= 1000000;  // reported in millions
+  }
+
+  char model[100];
+  size = sizeof(model);
+  int mib_model[] = { CTL_HW, HW_MODEL };
+  if (sysctl(mib_model, 2, model, &size, NULL, 0) < 0) {
+    strncpy(model, cpu_arch, sizeof(model));
+  }
+
+  char machine[100];
+  size = sizeof(machine);
+  int mib_machine[] = { CTL_HW, HW_MACHINE };
+  if (sysctl(mib_machine, 2, machine, &size, NULL, 0) < 0) {
+      strncpy(machine, "", sizeof(machine));
+  }
+
+  snprintf(buf, buflen, "%s %s %d MHz", model, machine, mhz);
+}
+
 void os::print_memory_info(outputStream* st) {
 
   st->print("Memory:");
@@ -1709,11 +1741,6 @@
   st->print("(" UINT64_FORMAT "k free)",
             os::available_memory() >> 10);
   st->cr();
-
-  // meminfo
-  st->print("\n/proc/meminfo:\n");
-  _print_ascii_file("/proc/meminfo", st);
-  st->cr();
 }
 
 void os::print_siginfo(outputStream* st, void* siginfo) {
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -2043,29 +2043,94 @@
 // Searching for the debian_version file is the last resort.  It contains
 // an informative string like "6.0.6" or "wheezy/sid". Because of this
 // "Debian " is printed before the contents of the debian_version file.
+
+const char* distro_files[] = {
+  "/etc/oracle-release",
+  "/etc/mandriva-release",
+  "/etc/mandrake-release",
+  "/etc/sun-release",
+  "/etc/redhat-release",
+  "/etc/lsb-release",
+  "/etc/SuSE-release",
+  "/etc/turbolinux-release",
+  "/etc/gentoo-release",
+  "/etc/ltib-release",
+  "/etc/angstrom-version",
+  "/etc/system-release",
+  "/etc/os-release",
+  NULL };
+
 void os::Linux::print_distro_info(outputStream* st) {
-  if (!_print_ascii_file("/etc/oracle-release", st) &&
-      !_print_ascii_file("/etc/mandriva-release", st) &&
-      !_print_ascii_file("/etc/mandrake-release", st) &&
-      !_print_ascii_file("/etc/sun-release", st) &&
-      !_print_ascii_file("/etc/redhat-release", st) &&
-      !_print_ascii_file("/etc/lsb-release", st) &&
-      !_print_ascii_file("/etc/SuSE-release", st) &&
-      !_print_ascii_file("/etc/turbolinux-release", st) &&
-      !_print_ascii_file("/etc/gentoo-release", st) &&
-      !_print_ascii_file("/etc/ltib-release", st) &&
-      !_print_ascii_file("/etc/angstrom-version", st) &&
-      !_print_ascii_file("/etc/system-release", st) &&
-      !_print_ascii_file("/etc/os-release", st)) {
-
-    if (file_exists("/etc/debian_version")) {
-      st->print("Debian ");
-      _print_ascii_file("/etc/debian_version", st);
+  for (int i = 0;; i++) {
+    const char* file = distro_files[i];
+    if (file == NULL) {
+      break;  // done
+    }
+    // If file prints, we found it.
+    if (_print_ascii_file(file, st)) {
+      return;
+    }
+  }
+
+  if (file_exists("/etc/debian_version")) {
+    st->print("Debian ");
+    _print_ascii_file("/etc/debian_version", st);
+  } else {
+    st->print("Linux");
+  }
+  st->cr();
+}
+
+static void parse_os_info(char* distro, size_t length, const char* file) {
+  FILE* fp = fopen(file, "r");
+  if (fp != NULL) {
+    char buf[256];
+    // get last line of the file.
+    while (fgets(buf, sizeof(buf), fp)) { }
+    // Edit out extra stuff in expected ubuntu format
+    if (strstr(buf, "DISTRIB_DESCRIPTION=") != NULL) {
+      char* ptr = strstr(buf, "\"");  // the name is in quotes
+      if (ptr != NULL) {
+        ptr++; // go beyond first quote
+        char* nl = strchr(ptr, '\"');
+        if (nl != NULL) *nl = '\0';
+        strncpy(distro, ptr, length);
+      } else {
+        ptr = strstr(buf, "=");
+        ptr++; // go beyond equals then
+        char* nl = strchr(ptr, '\n');
+        if (nl != NULL) *nl = '\0';
+        strncpy(distro, ptr, length);
+      }
     } else {
-      st->print("Linux");
+      // if not in expected Ubuntu format, print out whole line minus \n
+      char* nl = strchr(buf, '\n');
+      if (nl != NULL) *nl = '\0';
+      strncpy(distro, buf, length);
     }
-  }
-  st->cr();
+    // close distro file
+    fclose(fp);
+  }
+}
+
+void os::get_summary_os_info(char* buf, size_t buflen) {
+  for (int i = 0;; i++) {
+    const char* file = distro_files[i];
+    if (file == NULL) {
+      break; // ran out of distro_files
+    }
+    if (file_exists(file)) {
+      parse_os_info(buf, buflen, file);
+      return;
+    }
+  }
+  // special case for debian
+  if (file_exists("/etc/debian_version")) {
+    strncpy(buf, "Debian ", buflen);
+    parse_os_info(&buf[7], buflen-7, "/etc/debian_version");
+  } else {
+    strncpy(buf, "Linux", buflen);
+  }
 }
 
 void os::Linux::print_libversion_info(outputStream* st) {
@@ -2150,6 +2215,48 @@
   }
 }
 
+const char* search_string = IA32_ONLY("model name") AMD64_ONLY("model name")
+                            IA64_ONLY("") SPARC_ONLY("cpu")
+                            ARM32_ONLY("Processor") PPC_ONLY("Processor") AARCH64_ONLY("Processor");
+
+// Parses the cpuinfo file for string representing the model name.
+void os::get_summary_cpu_info(char* cpuinfo, size_t length) {
+  FILE* fp = fopen("/proc/cpuinfo", "r");
+  if (fp != NULL) {
+    while (!feof(fp)) {
+      char buf[256];
+      if (fgets(buf, sizeof(buf), fp)) {
+        char* start = strstr(buf, search_string);
+        if (start != NULL) {
+          char *ptr = start + strlen(search_string);
+          char *end = buf + strlen(buf);
+          while (ptr != end) {
+             // skip whitespace and colon for the rest of the name.
+             if (*ptr != ' ' && *ptr != '\t' && *ptr != ':') {
+               break;
+             }
+             ptr++;
+          }
+          if (ptr != end) {
+            // reasonable string, get rid of newline and keep the rest
+            char* nl = strchr(buf, '\n');
+            if (nl != NULL) *nl = '\0';
+            strncpy(cpuinfo, ptr, length);
+            fclose(fp);
+            return;
+          }
+        }
+      }
+    }
+    fclose(fp);
+  }
+  // cpuinfo not found or parsing failed, just print generic string.  The entire
+  // /proc/cpuinfo file will be printed later in the file (or enough of it for x86)
+  strncpy(cpuinfo, IA32_ONLY("x86_32") AMD64_ONLY("x86_32")
+                   IA64_ONLY("IA64") SPARC_ONLY("sparcv9")
+                   ARM32_ONLY("ARM") PPC_ONLY("PPC64") AARCH64_ONLY("AArch64"), length);
+}
+
 void os::print_siginfo(outputStream* st, void* siginfo) {
   const siginfo_t* si = (const siginfo_t*)siginfo;
 
--- a/hotspot/src/os/posix/vm/os_posix.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/os/posix/vm/os_posix.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -236,6 +236,15 @@
   st->cr();
 }
 
+#ifndef PRODUCT
+bool os::get_host_name(char* buf, size_t buflen) {
+  struct utsname name;
+  uname(&name);
+  jio_snprintf(buf, buflen, "%s", name.nodename);
+  return true;
+}
+#endif // PRODUCT
+
 bool os::has_allocatable_memory_limit(julong* limit) {
   struct rlimit rlim;
   int getrlimit_res = getrlimit(RLIMIT_AS, &rlim);
@@ -1070,7 +1079,7 @@
   return ret == 0;
 }
 
-bool PosixSemaphore::timedwait(const struct timespec ts) {
+bool PosixSemaphore::timedwait(struct timespec ts) {
   while (true) {
     int result = sem_timedwait(&_semaphore, &ts);
     if (result == 0) {
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -1971,6 +1971,26 @@
   st->cr();
 }
 
+void os::get_summary_os_info(char* buf, size_t buflen) {
+  strncpy(buf, "Solaris", buflen);  // default to plain solaris
+  FILE* fp = fopen("/etc/release", "r");
+  if (fp != NULL) {
+    char tmp[256];
+    // Only get the first line and chop out everything but the os name.
+    if (fgets(tmp, sizeof(tmp), fp)) {
+      char* ptr = tmp;
+      // skip past whitespace characters
+      while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t' || *ptr == '\n')) ptr++;
+      if (*ptr != '\0') {
+        char* nl = strchr(ptr, '\n');
+        if (nl != NULL) *nl = '\0';
+        strncpy(buf, ptr, buflen);
+      }
+    }
+    fclose(fp);
+  }
+}
+
 void os::Solaris::print_libversion_info(outputStream* st) {
   st->print("  (T2 libthread)");
   st->cr();
@@ -1998,6 +2018,22 @@
   return status;
 }
 
+void os::get_summary_cpu_info(char* buf, size_t buflen) {
+  // Get MHz with system call. We don't seem to already have this.
+  processor_info_t stats;
+  processorid_t id = getcpuid();
+  int clock = 0;
+  if (processor_info(id, &stats) != -1) {
+    clock = stats.pi_clock;  // pi_processor_type isn't more informative than below
+  }
+#ifdef AMD64
+  snprintf(buf, buflen, "x86 64 bit %d MHz", clock);
+#else
+  // must be sparc
+  snprintf(buf, buflen, "Sparcv9 64 bit %d MHz", clock);
+#endif
+}
+
 void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) {
   // Nothing to do for now.
 }
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -1593,6 +1593,21 @@
   return result;
 }
 
+#ifndef PRODUCT
+bool os::get_host_name(char* buf, size_t buflen) {
+  DWORD size = (DWORD)buflen;
+  return (GetComputerNameEx(ComputerNameDnsHostname, buf, &size) == TRUE);
+}
+#endif // PRODUCT
+
+void os::get_summary_os_info(char* buf, size_t buflen) {
+  stringStream sst(buf, buflen);
+  os::win32::print_windows_version(&sst);
+  // chop off newline character
+  char* nl = strchr(buf, '\n');
+  if (nl != NULL) *nl = '\0';
+}
+
 void os::print_os_info_brief(outputStream* st) {
   os::print_os_info(st);
 }
@@ -1600,15 +1615,14 @@
 void os::print_os_info(outputStream* st) {
 #ifdef ASSERT
   char buffer[1024];
-  DWORD size = sizeof(buffer);
-  st->print(" HostName: ");
-  if (GetComputerNameEx(ComputerNameDnsHostname, buffer, &size)) {
-    st->print("%s", buffer);
+  st->print("HostName: ");
+  if (get_host_name(buffer, sizeof(buffer))) {
+    st->print("%s ", buffer);
   } else {
-    st->print("N/A");
+    st->print("N/A ");
   }
 #endif
-  st->print(" OS:");
+  st->print("OS:");
   os::win32::print_windows_version(st);
 }
 
@@ -1738,6 +1752,23 @@
   // Nothing to do for now.
 }
 
+void os::get_summary_cpu_info(char* buf, size_t buflen) {
+  HKEY key;
+  DWORD status = RegOpenKey(HKEY_LOCAL_MACHINE,
+               "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", &key);
+  if (status == ERROR_SUCCESS) {
+    DWORD size = (DWORD)buflen;
+    status = RegQueryValueEx(key, "ProcessorNameString", NULL, NULL, (byte*)buf, &size);
+    if (status != ERROR_SUCCESS) {
+        strncpy(buf, "## __CPU__", buflen);
+    }
+    RegCloseKey(key);
+  } else {
+    // Put generic cpu info to return
+    strncpy(buf, "## __CPU__", buflen);
+  }
+}
+
 void os::print_memory_info(outputStream* st) {
   st->print("Memory:");
   st->print(" %dk page", os::vm_page_size()>>10);
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -809,6 +809,22 @@
   return name;
 }
 
+// Returns the Java name for this Java mirror (Resource allocated)
+// See Klass::external_name().
+// For primitive type Java mirrors, its type name is returned.
+const char* java_lang_Class::as_external_name(oop java_class) {
+  assert(java_lang_Class::is_instance(java_class), "must be a Class object");
+  const char* name = NULL;
+  if (is_primitive(java_class)) {
+    name = type2name(primitive_type(java_class));
+  } else {
+    name = as_Klass(java_class)->external_name();
+  }
+  if (name == NULL) {
+    name = "<null>";
+  }
+  return name;
+}
 
 Klass* java_lang_Class::array_klass(oop java_class) {
   Klass* k = ((Klass*)java_class->metadata_field(_array_klass_offset));
@@ -1468,6 +1484,19 @@
 
 };
 
+Symbol* get_source_file_name(InstanceKlass* holder, int version) {
+  // Find the specific ik version that contains this source_file_name_index
+  // via the previous versions list, but use the current version's
+  // constant pool to look it up.  The previous version's index has been
+  // merged for the current constant pool.
+  InstanceKlass* ik = holder->get_klass_version(version);
+  // This version has been cleaned up.
+  if (ik == NULL) return NULL;
+  int source_file_name_index = ik->source_file_name_index();
+  return (source_file_name_index == 0) ?
+      (Symbol*)NULL : holder->constants()->symbol_at(source_file_name_index);
+}
+
 // Print stack trace element to resource allocated buffer
 char* java_lang_Throwable::print_stack_element_to_buffer(Handle mirror,
                                   int method_id, int version, int bci, int cpref) {
@@ -1484,17 +1513,11 @@
   char* method_name = sym->as_C_string();
   buf_len += (int)strlen(method_name);
 
-  // Use specific ik version as a holder since the mirror might
-  // refer to version that is now obsolete and no longer accessible
-  // via the previous versions list.
-  holder = holder->get_klass_version(version);
   char* source_file_name = NULL;
-  if (holder != NULL) {
-    Symbol* source = holder->source_file_name();
-    if (source != NULL) {
-      source_file_name = source->as_C_string();
-      buf_len += (int)strlen(source_file_name);
-    }
+  Symbol* source = get_source_file_name(holder, version);
+  if (source != NULL) {
+    source_file_name = source->as_C_string();
+    buf_len += (int)strlen(source_file_name);
   }
 
   // Allocate temporary buffer with extra space for formatting and line number
@@ -1909,12 +1932,7 @@
     java_lang_StackTraceElement::set_lineNumber(element(), -1);
   } else {
     // Fill in source file name and line number.
-    // Use specific ik version as a holder since the mirror might
-    // refer to version that is now obsolete and no longer accessible
-    // via the previous versions list.
-    holder = holder->get_klass_version(version);
-    assert(holder != NULL, "sanity check");
-    Symbol* source = holder->source_file_name();
+    Symbol* source = get_source_file_name(holder, version);
     if (ShowHiddenFrames && source == NULL)
       source = vmSymbols::unknown_class_name();
     oop filename = StringTable::intern(source, CHECK_0);
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -276,6 +276,7 @@
   }
   static Symbol* as_signature(oop java_class, bool intern_if_not_found, TRAPS);
   static void print_signature(oop java_class, outputStream *st);
+  static const char* as_external_name(oop java_class);
   // Testing
   static bool is_instance(oop obj);
 
--- a/hotspot/src/share/vm/classfile/verificationType.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/classfile/verificationType.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -86,7 +86,7 @@
     VerificationType comp_this = get_component(context, CHECK_false);
     VerificationType comp_from = from.get_component(context, CHECK_false);
     if (!comp_this.is_bogus() && !comp_from.is_bogus()) {
-      return comp_this.is_assignable_from(comp_from, context,
+      return comp_this.is_component_assignable_from(comp_from, context,
                                           from_field_is_protected, CHECK_false);
     }
   }
--- a/hotspot/src/share/vm/classfile/verificationType.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/classfile/verificationType.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -297,6 +297,26 @@
     }
   }
 
+  // Check to see if one array component type is assignable to another.
+  // Same as is_assignable_from() except int primitives must be identical.
+  bool is_component_assignable_from(
+      const VerificationType& from, ClassVerifier* context,
+      bool from_field_is_protected, TRAPS) const {
+    if (equals(from) || is_bogus()) {
+      return true;
+    } else {
+      switch(_u._data) {
+        case Boolean:
+        case Byte:
+        case Char:
+        case Short:
+          return false;
+        default:
+          return is_assignable_from(from, context, from_field_is_protected, CHECK_false);
+      }
+    }
+  }
+
   VerificationType get_component(ClassVerifier* context, TRAPS) const;
 
   int dimensions() const {
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -345,6 +345,14 @@
   }
 }
 
+// RedefineClasses support
+void CompileTask::metadata_do(void f(Metadata*)) {
+  f(method());
+  if (hot_method() != NULL && hot_method() != method()) {
+    f(hot_method());
+  }
+}
+
 // ------------------------------------------------------------------
 // CompileTask::print_line_on_error
 //
@@ -660,6 +668,11 @@
  * Get the next CompileTask from a CompileQueue
  */
 CompileTask* CompileQueue::get() {
+  // save methods from RedefineClasses across safepoint
+  // across MethodCompileQueue_lock below.
+  methodHandle save_method;
+  methodHandle save_hot_method;
+
   MutexLocker locker(MethodCompileQueue_lock);
   // If _first is NULL we have no more compile jobs. There are two reasons for
   // having no compile jobs: First, we compiled everything we wanted. Second,
@@ -693,6 +706,12 @@
     No_Safepoint_Verifier nsv;
     task = CompilationPolicy::policy()->select_task(this);
   }
+
+  // Save method pointers across unlock safepoint.  The task is removed from
+  // the compilation queue, which is walked during RedefineClasses.
+  save_method = methodHandle(task->method());
+  save_hot_method = methodHandle(task->hot_method());
+
   remove(task);
   purge_stale_tasks(); // may temporarily release MCQ lock
   return task;
--- a/hotspot/src/share/vm/compiler/compileBroker.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/compiler/compileBroker.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -80,6 +80,7 @@
 
   int          compile_id() const                { return _compile_id; }
   Method*      method() const                    { return _method; }
+  Method*      hot_method() const                { return _hot_method; }
   int          osr_bci() const                   { return _osr_bci; }
   bool         is_complete() const               { return _is_complete; }
   bool         is_blocking() const               { return _is_blocking; }
@@ -108,6 +109,9 @@
   bool         is_free() const                   { return _is_free; }
   void         set_is_free(bool val)             { _is_free = val; }
 
+  // RedefineClasses support
+  void         metadata_do(void f(Metadata*));
+
 private:
   static void  print_compilation_impl(outputStream* st, Method* method, int compile_id, int comp_level,
                                       bool is_osr_method = false, int osr_bci = -1, bool is_blocking = false,
--- a/hotspot/src/share/vm/gc/cms/parCardTableModRefBS.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/cms/parCardTableModRefBS.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -36,10 +36,11 @@
 #include "runtime/orderAccess.inline.hpp"
 #include "runtime/vmThread.hpp"
 
-void CardTableModRefBS::non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr,
-                                                             OopsInGenClosure* cl,
-                                                             CardTableRS* ct,
-                                                             uint n_threads) {
+void CardTableModRefBSForCTRS::
+non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr,
+                                     OopsInGenClosure* cl,
+                                     CardTableRS* ct,
+                                     uint n_threads) {
   assert(n_threads > 0, "expected n_threads > 0");
   assert(n_threads <= ParallelGCThreads,
          err_msg("n_threads: %u > ParallelGCThreads: %u", n_threads, ParallelGCThreads));
@@ -81,7 +82,7 @@
 }
 
 void
-CardTableModRefBS::
+CardTableModRefBSForCTRS::
 process_stride(Space* sp,
                MemRegion used,
                jint stride, int n_strides,
@@ -170,7 +171,7 @@
 #endif
 
 void
-CardTableModRefBS::
+CardTableModRefBSForCTRS::
 process_chunk_boundaries(Space* sp,
                          DirtyCardToOopClosure* dcto_cl,
                          MemRegion chunk_mr,
@@ -426,7 +427,7 @@
 #undef NOISY
 
 void
-CardTableModRefBS::
+CardTableModRefBSForCTRS::
 get_LNC_array_for_space(Space* sp,
                         jbyte**& lowest_non_clean,
                         uintptr_t& lowest_non_clean_base_chunk_index,
--- a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -403,14 +403,6 @@
   _saved_index = -1;
 }
 
-void CMMarkStack::oops_do(OopClosure* f) {
-  assert(_saved_index == _index,
-         err_msg("saved index: %d index: %d", _saved_index, _index));
-  for (int i = 0; i < _index; i += 1) {
-    f->do_oop(&_base[i]);
-  }
-}
-
 CMRootRegions::CMRootRegions() :
   _young_list(NULL), _cm(NULL), _scan_in_progress(false),
   _should_abort(false),  _next_survivor(NULL) { }
@@ -2717,53 +2709,26 @@
 }
 
 #ifndef PRODUCT
-enum VerifyNoCSetOopsPhase {
-  VerifyNoCSetOopsStack,
-  VerifyNoCSetOopsQueues
-};
-
-class VerifyNoCSetOopsClosure : public OopClosure, public ObjectClosure  {
+class VerifyNoCSetOops VALUE_OBJ_CLASS_SPEC {
 private:
   G1CollectedHeap* _g1h;
-  VerifyNoCSetOopsPhase _phase;
+  const char* _phase;
   int _info;
 
-  const char* phase_str() {
-    switch (_phase) {
-    case VerifyNoCSetOopsStack:         return "Stack";
-    case VerifyNoCSetOopsQueues:        return "Queue";
-    default:                            ShouldNotReachHere();
-    }
-    return NULL;
-  }
-
-  void do_object_work(oop obj) {
+public:
+  VerifyNoCSetOops(const char* phase, int info = -1) :
+    _g1h(G1CollectedHeap::heap()),
+    _phase(phase),
+    _info(info)
+  { }
+
+  void operator()(oop obj) const {
+    guarantee(obj->is_oop(),
+              err_msg("Non-oop " PTR_FORMAT ", phase: %s, info: %d",
+                      p2i(obj), _phase, _info));
     guarantee(!_g1h->obj_in_cs(obj),
               err_msg("obj: " PTR_FORMAT " in CSet, phase: %s, info: %d",
-                      p2i((void*) obj), phase_str(), _info));
-  }
-
-public:
-  VerifyNoCSetOopsClosure() : _g1h(G1CollectedHeap::heap()) { }
-
-  void set_phase(VerifyNoCSetOopsPhase phase, int info = -1) {
-    _phase = phase;
-    _info = info;
-  }
-
-  virtual void do_oop(oop* p) {
-    oop obj = oopDesc::load_decode_heap_oop(p);
-    do_object_work(obj);
-  }
-
-  virtual void do_oop(narrowOop* p) {
-    // We should not come across narrow oops while scanning marking
-    // stacks
-    ShouldNotReachHere();
-  }
-
-  virtual void do_object(oop obj) {
-    do_object_work(obj);
+                      p2i(obj), _phase, _info));
   }
 };
 
@@ -2773,17 +2738,13 @@
     return;
   }
 
-  VerifyNoCSetOopsClosure cl;
-
   // Verify entries on the global mark stack
-  cl.set_phase(VerifyNoCSetOopsStack);
-  _markStack.oops_do(&cl);
+  _markStack.iterate(VerifyNoCSetOops("Stack"));
 
   // Verify entries on the task queues
-  for (uint i = 0; i < _max_worker_id; i += 1) {
-    cl.set_phase(VerifyNoCSetOopsQueues, i);
+  for (uint i = 0; i < _max_worker_id; ++i) {
     CMTaskQueue* queue = _task_queues->queue(i);
-    queue->oops_do(&cl);
+    queue->iterate(VerifyNoCSetOops("Queue", i));
   }
 
   // Verify the global finger
@@ -2806,7 +2767,7 @@
 
   // Verify the task fingers
   assert(parallel_marking_threads() <= _max_worker_id, "sanity");
-  for (int i = 0; i < (int) parallel_marking_threads(); i += 1) {
+  for (uint i = 0; i < parallel_marking_threads(); ++i) {
     CMTask* task = _tasks[i];
     HeapWord* task_finger = task->finger();
     if (task_finger != NULL && task_finger < _heap_end) {
--- a/hotspot/src/share/vm/gc/g1/concurrentMark.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/g1/concurrentMark.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -246,9 +246,10 @@
   // Make sure that we have not added any entries to the stack during GC.
   void note_end_of_gc();
 
-  // iterate over the oops in the mark stack, up to the bound recorded via
-  // the call above.
-  void oops_do(OopClosure* f);
+  // Apply fn to each oop in the mark stack, up to the bound recorded
+  // via one of the above "note" functions.  The mark stack must not
+  // be modified while iterating.
+  template<typename Fn> void iterate(Fn fn);
 };
 
 class ForceOverflowSettings VALUE_OBJ_CLASS_SPEC {
--- a/hotspot/src/share/vm/gc/g1/concurrentMark.inline.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/g1/concurrentMark.inline.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -223,6 +223,15 @@
 
 #undef check_mark
 
+template<typename Fn>
+inline void CMMarkStack::iterate(Fn fn) {
+  assert(_saved_index == _index,
+         err_msg("saved index: %d index: %d", _saved_index, _index));
+  for (int i = 0; i < _index; ++i) {
+    fn(_base[i]);
+  }
+}
+
 inline void CMTask::push(oop obj) {
   HeapWord* objAddr = (HeapWord*) obj;
   assert(_g1h->is_in_g1_reserved(objAddr), "invariant");
--- a/hotspot/src/share/vm/gc/g1/g1Allocator.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/g1/g1Allocator.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -39,13 +39,8 @@
 protected:
   G1CollectedHeap* _g1h;
 
-  // Outside of GC pauses, the number of bytes used in all regions other
-  // than the current allocation region.
-  size_t _summary_bytes_used;
-
 public:
-  G1Allocator(G1CollectedHeap* heap) :
-    _g1h(heap), _summary_bytes_used(0) { }
+  G1Allocator(G1CollectedHeap* heap) : _g1h(heap) { }
 
   static G1Allocator* create_allocator(G1CollectedHeap* g1h);
 
@@ -59,32 +54,13 @@
   virtual MutatorAllocRegion*    mutator_alloc_region(AllocationContext_t context) = 0;
   virtual SurvivorGCAllocRegion* survivor_gc_alloc_region(AllocationContext_t context) = 0;
   virtual OldGCAllocRegion*      old_gc_alloc_region(AllocationContext_t context) = 0;
-  virtual size_t                 used() = 0;
+  virtual size_t                 used_in_alloc_regions() = 0;
   virtual bool                   is_retained_old_region(HeapRegion* hr) = 0;
 
   void                           reuse_retained_old_region(EvacuationInfo& evacuation_info,
                                                            OldGCAllocRegion* old,
                                                            HeapRegion** retained);
 
-  size_t used_unlocked() const {
-    return _summary_bytes_used;
-  }
-
-  void increase_used(size_t bytes) {
-    _summary_bytes_used += bytes;
-  }
-
-  void decrease_used(size_t bytes) {
-    assert(_summary_bytes_used >= bytes,
-           err_msg("invariant: _summary_bytes_used: " SIZE_FORMAT " should be >= bytes: " SIZE_FORMAT,
-               _summary_bytes_used, bytes));
-    _summary_bytes_used -= bytes;
-  }
-
-  void set_used(size_t bytes) {
-    _summary_bytes_used = bytes;
-  }
-
   virtual HeapRegion* new_heap_region(uint hrs_index,
                                       G1BlockOffsetSharedArray* sharedOffsetArray,
                                       MemRegion mr) {
@@ -133,10 +109,10 @@
     return &_old_gc_alloc_region;
   }
 
-  virtual size_t used() {
+  virtual size_t used_in_alloc_regions() {
     assert(Heap_lock->owner() != NULL,
            "Should be owned on this thread's behalf.");
-    size_t result = _summary_bytes_used;
+    size_t result = 0;
 
     // Read only once in case it is set to NULL concurrently
     HeapRegion* hr = mutator_alloc_region(AllocationContext::current())->get();
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -632,7 +632,7 @@
   check_bitmaps("Humongous Region Allocation", first_hr);
 
   assert(first_hr->used() == word_size * HeapWordSize, "invariant");
-  _allocator->increase_used(first_hr->used());
+  increase_used(first_hr->used());
   _humongous_set.add(first_hr);
 
   return new_obj;
@@ -998,7 +998,7 @@
     if ((prev_last_region != NULL) && (start_region == prev_last_region)) {
       start_address = start_region->end();
       if (start_address > last_address) {
-        _allocator->increase_used(word_size * HeapWordSize);
+        increase_used(word_size * HeapWordSize);
         start_region->set_top(last_address + 1);
         continue;
       }
@@ -1012,7 +1012,7 @@
     if (!_hrm.allocate_containing_regions(curr_range, &commits)) {
       return false;
     }
-    _allocator->increase_used(word_size * HeapWordSize);
+    increase_used(word_size * HeapWordSize);
     if (commits != 0) {
       ergo_verbose1(ErgoHeapSizing,
                     "attempt heap expansion",
@@ -1104,7 +1104,7 @@
     if (start_address != bottom_address) {
       size_t fill_size = pointer_delta(start_address, bottom_address);
       G1CollectedHeap::fill_with_objects(bottom_address, fill_size);
-      _allocator->increase_used(fill_size * HeapWordSize);
+      increase_used(fill_size * HeapWordSize);
     }
   }
 }
@@ -1917,7 +1917,6 @@
   _ref_processor_cm(NULL),
   _ref_processor_stw(NULL),
   _bot_shared(NULL),
-  _evac_failure_scan_stack(NULL),
   _cg1r(NULL),
   _g1mm(NULL),
   _refine_cte_cl(NULL),
@@ -1930,6 +1929,7 @@
   _free_regions_coming(false),
   _young_list(new YoungList(this)),
   _gc_time_stamp(0),
+  _summary_bytes_used(0),
   _survivor_plab_stats(YoungPLABSize, PLABWeight),
   _old_plab_stats(OldPLABSize, PLABWeight),
   _expand_heap_after_alloc_failure(true),
@@ -2204,6 +2204,11 @@
 
   G1StringDedup::initialize();
 
+  _preserved_objs = NEW_C_HEAP_ARRAY(OopAndMarkOopStack, ParallelGCThreads, mtGC);
+  for (uint i = 0; i < ParallelGCThreads; i++) {
+    new (&_preserved_objs[i]) OopAndMarkOopStack();
+  }
+
   return JNI_OK;
 }
 
@@ -2371,7 +2376,7 @@
 
 // Computes the sum of the storage used by the various regions.
 size_t G1CollectedHeap::used() const {
-  size_t result = _allocator->used();
+  size_t result = _summary_bytes_used + _allocator->used_in_alloc_regions();
   if (_archive_allocator != NULL) {
     result += _archive_allocator->used();
   }
@@ -2379,7 +2384,7 @@
 }
 
 size_t G1CollectedHeap::used_unlocked() const {
-  return _allocator->used_unlocked();
+  return _summary_bytes_used;
 }
 
 class SumUsedClosure: public HeapRegionClosure {
@@ -3376,7 +3381,7 @@
 
   // Print the per-region information.
   st->cr();
-  st->print_cr("Heap Regions: (Y=young(eden), SU=young(survivor), "
+  st->print_cr("Heap Regions: (E=young(eden), S=young(survivor), O=old, "
                "HS=humongous(starts), HC=humongous(continues), "
                "CS=collection set, F=free, A=archive, TS=gc time stamp, "
                "PTAMS=previous top-at-mark-start, "
@@ -4102,7 +4107,7 @@
         _young_list->reset_auxilary_lists();
 
         if (evacuation_failed()) {
-          _allocator->set_used(recalculate_used());
+          set_used(recalculate_used());
           if (_archive_allocator != NULL) {
             _archive_allocator->clear_used();
           }
@@ -4114,7 +4119,7 @@
         } else {
           // The "used" of the the collection set have already been subtracted
           // when they were freed.  Add in the bytes evacuated.
-          _allocator->increase_used(g1_policy()->bytes_copied_during_gc());
+          increase_used(g1_policy()->bytes_copied_during_gc());
         }
 
         if (collector_state()->during_initial_mark_pause()) {
@@ -4255,21 +4260,6 @@
   return true;
 }
 
-void G1CollectedHeap::init_for_evac_failure(OopsInHeapRegionClosure* cl) {
-  _drain_in_progress = false;
-  set_evac_failure_closure(cl);
-  _evac_failure_scan_stack = new (ResourceObj::C_HEAP, mtGC) GrowableArray<oop>(40, true);
-}
-
-void G1CollectedHeap::finalize_for_evac_failure() {
-  assert(_evac_failure_scan_stack != NULL &&
-         _evac_failure_scan_stack->length() == 0,
-         "Postcondition");
-  assert(!_drain_in_progress, "Postcondition");
-  delete _evac_failure_scan_stack;
-  _evac_failure_scan_stack = NULL;
-}
-
 void G1CollectedHeap::remove_self_forwarding_pointers() {
   double remove_self_forwards_start = os::elapsedTime();
 
@@ -4277,104 +4267,30 @@
   workers()->run_task(&rsfp_task);
 
   // Now restore saved marks, if any.
-  assert(_objs_with_preserved_marks.size() ==
-            _preserved_marks_of_objs.size(), "Both or none.");
-  while (!_objs_with_preserved_marks.is_empty()) {
-    oop obj = _objs_with_preserved_marks.pop();
-    markOop m = _preserved_marks_of_objs.pop();
-    obj->set_mark(m);
-  }
-  _objs_with_preserved_marks.clear(true);
-  _preserved_marks_of_objs.clear(true);
+  for (uint i = 0; i < ParallelGCThreads; i++) {
+    OopAndMarkOopStack& cur = _preserved_objs[i];
+    while (!cur.is_empty()) {
+      OopAndMarkOop elem = cur.pop();
+      elem.set_mark();
+    }
+    cur.clear(true);
+  }
 
   g1_policy()->phase_times()->record_evac_fail_remove_self_forwards((os::elapsedTime() - remove_self_forwards_start) * 1000.0);
 }
 
-void G1CollectedHeap::push_on_evac_failure_scan_stack(oop obj) {
-  _evac_failure_scan_stack->push(obj);
-}
-
-void G1CollectedHeap::drain_evac_failure_scan_stack() {
-  assert(_evac_failure_scan_stack != NULL, "precondition");
-
-  while (_evac_failure_scan_stack->length() > 0) {
-     oop obj = _evac_failure_scan_stack->pop();
-     _evac_failure_closure->set_region(heap_region_containing(obj));
-     obj->oop_iterate_backwards(_evac_failure_closure);
-  }
-}
-
-oop
-G1CollectedHeap::handle_evacuation_failure_par(G1ParScanThreadState* _par_scan_state,
-                                               oop old) {
-  assert(obj_in_cs(old),
-         err_msg("obj: " PTR_FORMAT " should still be in the CSet",
-                 p2i(old)));
-  markOop m = old->mark();
-  oop forward_ptr = old->forward_to_atomic(old);
-  if (forward_ptr == NULL) {
-    // Forward-to-self succeeded.
-    assert(_par_scan_state != NULL, "par scan state");
-    OopsInHeapRegionClosure* cl = _par_scan_state->evac_failure_closure();
-    uint queue_num = _par_scan_state->queue_num();
-
+void G1CollectedHeap::preserve_mark_during_evac_failure(uint queue_num, oop obj, markOop m) {
+  if (!_evacuation_failed) {
     _evacuation_failed = true;
-    _evacuation_failed_info_array[queue_num].register_copy_failure(old->size());
-    if (_evac_failure_closure != cl) {
-      MutexLockerEx x(EvacFailureStack_lock, Mutex::_no_safepoint_check_flag);
-      assert(!_drain_in_progress,
-             "Should only be true while someone holds the lock.");
-      // Set the global evac-failure closure to the current thread's.
-      assert(_evac_failure_closure == NULL, "Or locking has failed.");
-      set_evac_failure_closure(cl);
-      // Now do the common part.
-      handle_evacuation_failure_common(old, m);
-      // Reset to NULL.
-      set_evac_failure_closure(NULL);
-    } else {
-      // The lock is already held, and this is recursive.
-      assert(_drain_in_progress, "This should only be the recursive case.");
-      handle_evacuation_failure_common(old, m);
-    }
-    return old;
-  } else {
-    // Forward-to-self failed. Either someone else managed to allocate
-    // space for this object (old != forward_ptr) or they beat us in
-    // self-forwarding it (old == forward_ptr).
-    assert(old == forward_ptr || !obj_in_cs(forward_ptr),
-           err_msg("obj: " PTR_FORMAT " forwarded to: " PTR_FORMAT " "
-                   "should not be in the CSet",
-                   p2i(old), p2i(forward_ptr)));
-    return forward_ptr;
-  }
-}
-
-void G1CollectedHeap::handle_evacuation_failure_common(oop old, markOop m) {
-  preserve_mark_if_necessary(old, m);
-
-  HeapRegion* r = heap_region_containing(old);
-  if (!r->evacuation_failed()) {
-    r->set_evacuation_failed(true);
-    _hr_printer.evac_failure(r);
-  }
-
-  push_on_evac_failure_scan_stack(old);
-
-  if (!_drain_in_progress) {
-    // prevent recursion in copy_to_survivor_space()
-    _drain_in_progress = true;
-    drain_evac_failure_scan_stack();
-    _drain_in_progress = false;
-  }
-}
-
-void G1CollectedHeap::preserve_mark_if_necessary(oop obj, markOop m) {
-  assert(evacuation_failed(), "Oversaving!");
+  }
+
+  _evacuation_failed_info_array[queue_num].register_copy_failure(obj->size());
+
   // We want to call the "for_promotion_failure" version only in the
   // case of a promotion failure.
   if (m->must_be_preserved_for_promotion_failure(obj)) {
-    _objs_with_preserved_marks.push(obj);
-    _preserved_marks_of_objs.push(m);
+    OopAndMarkOop elem(obj, m);
+    _preserved_objs[queue_num].push(elem);
   }
 }
 
@@ -4450,14 +4366,7 @@
       mark_object(obj);
     }
   }
-
-  if (barrier == G1BarrierEvac) {
-    _par_scan_state->update_rs(_from, p, _worker_id);
-  }
-}
-
-template void G1ParCopyClosure<G1BarrierEvac, G1MarkNone>::do_oop_work(oop* p);
-template void G1ParCopyClosure<G1BarrierEvac, G1MarkNone>::do_oop_work(narrowOop* p);
+}
 
 class G1ParEvacuateFollowersClosure : public VoidClosure {
 protected:
@@ -4597,9 +4506,6 @@
       ReferenceProcessor*             rp = _g1h->ref_processor_stw();
 
       G1ParScanThreadState            pss(_g1h, worker_id, rp);
-      G1ParScanHeapEvacFailureClosure evac_failure_cl(_g1h, &pss, rp);
-
-      pss.set_evac_failure_closure(&evac_failure_cl);
 
       bool only_young = _g1h->collector_state()->gcs_are_young();
 
@@ -5269,9 +5175,6 @@
     G1STWIsAliveClosure is_alive(_g1h);
 
     G1ParScanThreadState            pss(_g1h, worker_id, NULL);
-    G1ParScanHeapEvacFailureClosure evac_failure_cl(_g1h, &pss, NULL);
-
-    pss.set_evac_failure_closure(&evac_failure_cl);
 
     G1ParScanExtRootClosure        only_copy_non_heap_cl(_g1h, &pss, NULL);
 
@@ -5368,10 +5271,6 @@
     HandleMark   hm;
 
     G1ParScanThreadState            pss(_g1h, worker_id, NULL);
-    G1ParScanHeapEvacFailureClosure evac_failure_cl(_g1h, &pss, NULL);
-
-    pss.set_evac_failure_closure(&evac_failure_cl);
-
     assert(pss.queue_is_empty(), "both queue and overflow should be empty");
 
     G1ParScanExtRootClosure        only_copy_non_heap_cl(_g1h, &pss, NULL);
@@ -5476,15 +5375,11 @@
 
   // Use only a single queue for this PSS.
   G1ParScanThreadState            pss(this, 0, NULL);
+  assert(pss.queue_is_empty(), "pre-condition");
 
   // We do not embed a reference processor in the copying/scanning
   // closures while we're actually processing the discovered
   // reference objects.
-  G1ParScanHeapEvacFailureClosure evac_failure_cl(this, &pss, NULL);
-
-  pss.set_evac_failure_closure(&evac_failure_cl);
-
-  assert(pss.queue_is_empty(), "pre-condition");
 
   G1ParScanExtRootClosure        only_copy_non_heap_cl(this, &pss, NULL);
 
@@ -5590,8 +5485,6 @@
 
   const uint n_workers = workers()->active_workers();
 
-  init_for_evac_failure(NULL);
-
   assert(dirty_card_queue_set().completed_buffers_num() == 0, "Should be empty");
   double start_par_time_sec = os::elapsedTime();
   double end_par_time_sec;
@@ -5655,8 +5548,6 @@
 
   purge_code_root_memory();
 
-  finalize_for_evac_failure();
-
   if (evacuation_failed()) {
     remove_self_forwarding_pointers();
 
@@ -5745,7 +5636,7 @@
 }
 
 void G1CollectedHeap::decrement_summary_bytes(size_t bytes) {
-  _allocator->decrease_used(bytes);
+  decrease_used(bytes);
 }
 
 class G1ParCleanupCTTask : public AbstractGangTask {
@@ -6395,6 +6286,21 @@
   _hrm.remove_all_free_regions();
 }
 
+void G1CollectedHeap::increase_used(size_t bytes) {
+  _summary_bytes_used += bytes;
+}
+
+void G1CollectedHeap::decrease_used(size_t bytes) {
+  assert(_summary_bytes_used >= bytes,
+         err_msg("invariant: _summary_bytes_used: " SIZE_FORMAT " should be >= bytes: " SIZE_FORMAT,
+                 _summary_bytes_used, bytes));
+  _summary_bytes_used -= bytes;
+}
+
+void G1CollectedHeap::set_used(size_t bytes) {
+  _summary_bytes_used = bytes;
+}
+
 class RebuildRegionSetsClosure : public HeapRegionClosure {
 private:
   bool            _free_list_only;
@@ -6463,15 +6369,15 @@
   heap_region_iterate(&cl);
 
   if (!free_list_only) {
-    _allocator->set_used(cl.total_used());
+    set_used(cl.total_used());
     if (_archive_allocator != NULL) {
       _archive_allocator->clear_used();
     }
   }
-  assert(_allocator->used_unlocked() == recalculate_used(),
-         err_msg("inconsistent _allocator->used_unlocked(), "
+  assert(used_unlocked() == recalculate_used(),
+         err_msg("inconsistent used_unlocked(), "
                  "value: " SIZE_FORMAT " recalculated: " SIZE_FORMAT,
-                 _allocator->used_unlocked(), recalculate_used()));
+                 used_unlocked(), recalculate_used()));
 }
 
 void G1CollectedHeap::set_refine_cte_cl_concurrency(bool concurrent) {
@@ -6511,7 +6417,7 @@
   assert(alloc_region->is_eden(), "all mutator alloc regions should be eden");
 
   g1_policy()->add_region_to_incremental_cset_lhs(alloc_region);
-  _allocator->increase_used(allocated_bytes);
+  increase_used(allocated_bytes);
   _hr_printer.retire(alloc_region);
   // We update the eden sizes here, when the region is retired,
   // instead of when it's allocated, since this is the point that its
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -251,6 +251,15 @@
   // Class that handles the different kinds of allocations.
   G1Allocator* _allocator;
 
+  // Outside of GC pauses, the number of bytes used in all regions other
+  // than the current allocation region(s).
+  size_t _summary_bytes_used;
+
+  void increase_used(size_t bytes);
+  void decrease_used(size_t bytes);
+
+  void set_used(size_t bytes);
+
   // Class that handles archive allocation ranges.
   G1ArchiveAllocator* _archive_allocator;
 
@@ -858,44 +867,27 @@
   // forwarding pointers to themselves.  Reset them.
   void remove_self_forwarding_pointers();
 
-  // Together, these store an object with a preserved mark, and its mark value.
-  Stack<oop, mtGC>     _objs_with_preserved_marks;
-  Stack<markOop, mtGC> _preserved_marks_of_objs;
+  struct OopAndMarkOop {
+   private:
+    oop _o;
+    markOop _m;
+   public:
+    OopAndMarkOop(oop obj, markOop m) : _o(obj), _m(m) {
+    }
+
+    void set_mark() {
+      _o->set_mark(_m);
+    }
+  };
+
+  typedef Stack<OopAndMarkOop,mtGC> OopAndMarkOopStack;
+  // Stores marks with the corresponding oop that we need to preserve during evacuation
+  // failure.
+  OopAndMarkOopStack*  _preserved_objs;
 
   // Preserve the mark of "obj", if necessary, in preparation for its mark
   // word being overwritten with a self-forwarding-pointer.
-  void preserve_mark_if_necessary(oop obj, markOop m);
-
-  // The stack of evac-failure objects left to be scanned.
-  GrowableArray<oop>*    _evac_failure_scan_stack;
-  // The closure to apply to evac-failure objects.
-
-  OopsInHeapRegionClosure* _evac_failure_closure;
-  // Set the field above.
-  void
-  set_evac_failure_closure(OopsInHeapRegionClosure* evac_failure_closure) {
-    _evac_failure_closure = evac_failure_closure;
-  }
-
-  // Push "obj" on the scan stack.
-  void push_on_evac_failure_scan_stack(oop obj);
-  // Process scan stack entries until the stack is empty.
-  void drain_evac_failure_scan_stack();
-  // True iff an invocation of "drain_scan_stack" is in progress; to
-  // prevent unnecessary recursion.
-  bool _drain_in_progress;
-
-  // Do any necessary initialization for evacuation-failure handling.
-  // "cl" is the closure that will be used to process evac-failure
-  // objects.
-  void init_for_evac_failure(OopsInHeapRegionClosure* cl);
-  // Do any necessary cleanup for evacuation-failure handling data
-  // structures.
-  void finalize_for_evac_failure();
-
-  // An attempt to evacuate "obj" has failed; take necessary steps.
-  oop handle_evacuation_failure_par(G1ParScanThreadState* _par_scan_state, oop obj);
-  void handle_evacuation_failure_common(oop obj, markOop m);
+  void preserve_mark_during_evac_failure(uint queue, oop obj, markOop m);
 
 #ifndef PRODUCT
   // Support for forcing evacuation failures. Analogous to
--- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -111,7 +111,6 @@
 
 enum G1Barrier {
   G1BarrierNone,
-  G1BarrierEvac,
   G1BarrierKlass
 };
 
@@ -148,8 +147,6 @@
 // We use a separate closure to handle references during evacuation
 // failure processing.
 
-typedef G1ParCopyClosure<G1BarrierEvac, G1MarkNone> G1ParScanHeapEvacFailureClosure;
-
 class FilterIntoCSClosure: public ExtendedOopClosure {
   G1CollectedHeap* _g1;
   OopClosure* _oc;
--- a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -144,8 +144,6 @@
 #endif // ASSERT
 
 void G1ParScanThreadState::trim_queue() {
-  assert(_evac_failure_cl != NULL, "not set");
-
   StarTask ref;
   do {
     // Drain the overflow stack first, so other threads can steal.
@@ -222,7 +220,7 @@
       if (obj_ptr == NULL) {
         // This will either forward-to-self, or detect that someone else has
         // installed a forwarding pointer.
-        return _g1h->handle_evacuation_failure_par(this, old);
+        return handle_evacuation_failure_par(old, old_mark);
       }
     }
   }
@@ -236,7 +234,7 @@
     // Doing this after all the allocation attempts also tests the
     // undo_allocation() method too.
     _g1_par_allocator->undo_allocation(dest_state, obj_ptr, word_sz, context);
-    return _g1h->handle_evacuation_failure_par(this, old);
+    return handle_evacuation_failure_par(old, old_mark);
   }
 #endif // !PRODUCT
 
@@ -301,3 +299,36 @@
     return forward_ptr;
   }
 }
+
+oop G1ParScanThreadState::handle_evacuation_failure_par(oop old, markOop m) {
+  assert(_g1h->obj_in_cs(old),
+         err_msg("Object " PTR_FORMAT " should be in the CSet", p2i(old)));
+
+  oop forward_ptr = old->forward_to_atomic(old);
+  if (forward_ptr == NULL) {
+    // Forward-to-self succeeded. We are the "owner" of the object.
+    HeapRegion* r = _g1h->heap_region_containing(old);
+
+    if (!r->evacuation_failed()) {
+      r->set_evacuation_failed(true);
+     _g1h->hr_printer()->evac_failure(r);
+    }
+
+    _g1h->preserve_mark_during_evac_failure(_queue_num, old, m);
+
+    _scanner.set_region(r);
+    old->oop_iterate_backwards(&_scanner);
+
+    return old;
+  } else {
+    // Forward-to-self failed. Either someone else managed to allocate
+    // space for this object (old != forward_ptr) or they beat us in
+    // self-forwarding it (old == forward_ptr).
+    assert(old == forward_ptr || !_g1h->obj_in_cs(forward_ptr),
+           err_msg("Object " PTR_FORMAT " forwarded to: " PTR_FORMAT " "
+                   "should not be in the CSet",
+                   p2i(old), p2i(forward_ptr)));
+    return forward_ptr;
+  }
+}
+
--- a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -54,8 +54,6 @@
   uint              _tenuring_threshold;
   G1ParScanClosure  _scanner;
 
-  OopsInHeapRegionClosure*      _evac_failure_cl;
-
   int  _hash_seed;
   uint _queue_num;
 
@@ -114,12 +112,6 @@
     }
   }
 
-  void set_evac_failure_closure(OopsInHeapRegionClosure* evac_failure_cl) {
-    _evac_failure_cl = evac_failure_cl;
-  }
-
-  OopsInHeapRegionClosure* evac_failure_closure() { return _evac_failure_cl; }
-
   int* hash_seed() { return &_hash_seed; }
   uint queue_num() { return _queue_num; }
 
@@ -211,6 +203,9 @@
   void trim_queue();
 
   inline void steal_and_trim_queue(RefToScanQueueSet *task_queues);
+
+  // An attempt to evacuate "obj" has failed; take necessary steps.
+  oop handle_evacuation_failure_par(oop obj, markOop m);
 };
 
 #endif // SHARE_VM_GC_G1_G1PARSCANTHREADSTATE_HPP
--- a/hotspot/src/share/vm/gc/g1/g1_globals.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/g1/g1_globals.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -252,12 +252,12 @@
           "Percentage (0-100) of the heap size to use as default "          \
           " maximum young gen size.")                                       \
           range(0, 100)                                                     \
-          constraint(G1MaxNewSizePercentConstraintFunc)                     \
+          constraint(G1MaxNewSizePercentConstraintFunc,AfterErgo)           \
                                                                             \
   experimental(uintx, G1NewSizePercent, 5,                                  \
           "Percentage (0-100) of the heap size to use as default "          \
           "minimum young gen size.")                                        \
-          constraint(G1NewSizePercentConstraintFunc)                        \
+          constraint(G1NewSizePercentConstraintFunc,AfterErgo)              \
                                                                             \
   experimental(uintx, G1MixedGCLiveThresholdPercent, 85,                    \
           "Threshold for regions to be considered for inclusion in the "    \
--- a/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -45,13 +45,11 @@
   nonstatic_field(HeapRegionManager, _regions,          G1HeapRegionTable)    \
   nonstatic_field(HeapRegionManager, _num_committed,    uint)                 \
                                                                               \
-  nonstatic_field(G1Allocator,     _summary_bytes_used, size_t)               \
-                                                                              \
+  nonstatic_field(G1CollectedHeap, _summary_bytes_used, size_t)               \
   nonstatic_field(G1CollectedHeap, _hrm,                HeapRegionManager)    \
   nonstatic_field(G1CollectedHeap, _g1mm,               G1MonitoringSupport*) \
   nonstatic_field(G1CollectedHeap, _old_set,            HeapRegionSetBase)    \
   nonstatic_field(G1CollectedHeap, _humongous_set,      HeapRegionSetBase)    \
-  nonstatic_field(G1CollectedHeap, _allocator,          G1Allocator*)         \
                                                                               \
   nonstatic_field(G1MonitoringSupport, _eden_committed,     size_t)           \
   nonstatic_field(G1MonitoringSupport, _eden_used,          size_t)           \
@@ -78,12 +76,10 @@
   declare_toplevel_type(HeapRegionSetBase)                                    \
   declare_toplevel_type(HeapRegionSetCount)                                   \
   declare_toplevel_type(G1MonitoringSupport)                                  \
-  declare_toplevel_type(G1Allocator)                                          \
                                                                               \
   declare_toplevel_type(G1CollectedHeap*)                                     \
   declare_toplevel_type(HeapRegion*)                                          \
   declare_toplevel_type(G1MonitoringSupport*)                                 \
-  declare_toplevel_type(G1Allocator*)                                         \
 
 
 #endif // SHARE_VM_GC_G1_VMSTRUCTS_G1_HPP
--- a/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -40,7 +40,6 @@
   PSYoungGen*         _young_gen;
   CardTableExtension* _card_table;
   HeapWord*           _unmarked_addr;
-  jbyte*              _unmarked_card;
 
  protected:
   template <class T> void do_oop_work(T* p) {
@@ -50,7 +49,6 @@
       // Don't overwrite the first missing card mark
       if (_unmarked_addr == NULL) {
         _unmarked_addr = (HeapWord*)p;
-        _unmarked_card = _card_table->byte_for(p);
       }
     }
   }
--- a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -623,7 +623,7 @@
   {
     // DefNew needs to run with n_threads == 0, to make sure the serial
     // version of the card table scanning code is used.
-    // See: CardTableModRefBS::non_clean_card_iterate_possibly_parallel.
+    // See: CardTableModRefBSForCTRS::non_clean_card_iterate_possibly_parallel.
     StrongRootsScope srs(0);
 
     gch->gen_process_roots(&srs,
--- a/hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -24,22 +24,12 @@
 
 #include "precompiled.hpp"
 #include "gc/shared/cardTableModRefBS.inline.hpp"
-#include "gc/shared/cardTableRS.hpp"
 #include "gc/shared/collectedHeap.hpp"
 #include "gc/shared/genCollectedHeap.hpp"
-#include "gc/shared/space.hpp"
 #include "gc/shared/space.inline.hpp"
-#include "memory/allocation.inline.hpp"
-#include "memory/universe.hpp"
 #include "memory/virtualspace.hpp"
-#include "runtime/java.hpp"
-#include "runtime/mutexLocker.hpp"
 #include "services/memTracker.hpp"
 #include "utilities/macros.hpp"
-#ifdef COMPILER1
-#include "c1/c1_LIR.hpp"
-#include "c1/c1_LIRGenerator.hpp"
-#endif
 
 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
 // enumerate ref fields that have been modified (since the last
@@ -68,12 +58,7 @@
   _committed(NULL),
   _cur_covered_regions(0),
   _byte_map(NULL),
-  byte_map_base(NULL),
-  // LNC functionality
-  _lowest_non_clean(NULL),
-  _lowest_non_clean_chunk_size(NULL),
-  _lowest_non_clean_base_chunk_index(NULL),
-  _last_LNC_resizing_collection(NULL)
+  byte_map_base(NULL)
 {
   assert((uintptr_t(_whole_heap.start())  & (card_size - 1))  == 0, "heap must start at card boundary");
   assert((uintptr_t(_whole_heap.end()) & (card_size - 1))  == 0, "heap must end at card boundary");
@@ -130,25 +115,6 @@
                             !ExecMem, "card table last card");
   *guard_card = last_card;
 
-  _lowest_non_clean =
-    NEW_C_HEAP_ARRAY(CardArr, _max_covered_regions, mtGC);
-  _lowest_non_clean_chunk_size =
-    NEW_C_HEAP_ARRAY(size_t, _max_covered_regions, mtGC);
-  _lowest_non_clean_base_chunk_index =
-    NEW_C_HEAP_ARRAY(uintptr_t, _max_covered_regions, mtGC);
-  _last_LNC_resizing_collection =
-    NEW_C_HEAP_ARRAY(int, _max_covered_regions, mtGC);
-  if (_lowest_non_clean == NULL
-      || _lowest_non_clean_chunk_size == NULL
-      || _lowest_non_clean_base_chunk_index == NULL
-      || _last_LNC_resizing_collection == NULL)
-    vm_exit_during_initialization("couldn't allocate an LNC array.");
-  for (int i = 0; i < _max_covered_regions; i++) {
-    _lowest_non_clean[i] = NULL;
-    _lowest_non_clean_chunk_size[i] = 0;
-    _last_LNC_resizing_collection[i] = -1;
-  }
-
   if (TraceCardTableModRefBS) {
     gclog_or_tty->print_cr("CardTableModRefBS::CardTableModRefBS: ");
     gclog_or_tty->print_cr("  "
@@ -171,22 +137,6 @@
     delete[] _committed;
     _committed = NULL;
   }
-  if (_lowest_non_clean) {
-    FREE_C_HEAP_ARRAY(CardArr, _lowest_non_clean);
-    _lowest_non_clean = NULL;
-  }
-  if (_lowest_non_clean_chunk_size) {
-    FREE_C_HEAP_ARRAY(size_t, _lowest_non_clean_chunk_size);
-    _lowest_non_clean_chunk_size = NULL;
-  }
-  if (_lowest_non_clean_base_chunk_index) {
-    FREE_C_HEAP_ARRAY(uintptr_t, _lowest_non_clean_base_chunk_index);
-    _lowest_non_clean_base_chunk_index = NULL;
-  }
-  if (_last_LNC_resizing_collection) {
-    FREE_C_HEAP_ARRAY(int, _last_LNC_resizing_collection);
-    _last_LNC_resizing_collection = NULL;
-  }
 }
 
 int CardTableModRefBS::find_covering_region_by_base(HeapWord* base) {
@@ -437,32 +387,6 @@
 }
 
 
-void CardTableModRefBS::non_clean_card_iterate_possibly_parallel(Space* sp,
-                                                                 MemRegion mr,
-                                                                 OopsInGenClosure* cl,
-                                                                 CardTableRS* ct,
-                                                                 uint n_threads) {
-  if (!mr.is_empty()) {
-    if (n_threads > 0) {
-#if INCLUDE_ALL_GCS
-      non_clean_card_iterate_parallel_work(sp, mr, cl, ct, n_threads);
-#else  // INCLUDE_ALL_GCS
-      fatal("Parallel gc not supported here.");
-#endif // INCLUDE_ALL_GCS
-    } else {
-      // clear_cl finds contiguous dirty ranges of cards to process and clear.
-
-      // This is the single-threaded version used by DefNew.
-      const bool parallel = false;
-
-      DirtyCardToOopClosure* dcto_cl = sp->new_dcto_cl(cl, precision(), cl->gen_boundary(), parallel);
-      ClearNoncleanCardWrapper clear_cl(dcto_cl, ct, parallel);
-
-      clear_cl.do_MemRegion(mr);
-    }
-  }
-}
-
 void CardTableModRefBS::dirty_MemRegion(MemRegion mr) {
   assert((HeapWord*)align_size_down((uintptr_t)mr.start(), HeapWordSize) == mr.start(), "Unaligned start");
   assert((HeapWord*)align_size_up  ((uintptr_t)mr.end(),   HeapWordSize) == mr.end(),   "Unaligned end"  );
@@ -623,15 +547,3 @@
                p2i(_byte_map), p2i(_byte_map + _byte_map_size), p2i(byte_map_base));
 }
 
-bool CardTableModRefBSForCTRS::card_will_be_scanned(jbyte cv) {
-  return
-    CardTableModRefBS::card_will_be_scanned(cv) ||
-    _rs->is_prev_nonclean_card_val(cv);
-};
-
-bool CardTableModRefBSForCTRS::card_may_have_been_dirty(jbyte cv) {
-  return
-    cv != clean_card &&
-    (CardTableModRefBS::card_may_have_been_dirty(cv) ||
-     CardTableRS::youngergen_may_have_been_dirty(cv));
-};
--- a/hotspot/src/share/vm/gc/shared/cardTableModRefBS.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/shared/cardTableModRefBS.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -40,23 +40,9 @@
 // Closures used to scan dirty cards should take these
 // considerations into account.
 
-class Generation;
-class OopsInGenClosure;
-class DirtyCardToOopClosure;
-class ClearNoncleanCardWrapper;
-class CardTableRS;
-
 class CardTableModRefBS: public ModRefBarrierSet {
   // Some classes get to look at some private stuff.
-  friend class BytecodeInterpreter;
   friend class VMStructs;
-  friend class CardTableRS;
-  friend class CheckForUnmarkedOops; // Needs access to raw card bytes.
-  friend class SharkBuilder;
-#ifndef PRODUCT
-  // For debugging.
-  friend class GuaranteeNotModClosure;
-#endif
  protected:
 
   enum CardValues {
@@ -75,24 +61,6 @@
   // a word's worth (row) of clean card values
   static const intptr_t clean_card_row = (intptr_t)(-1);
 
-  // dirty and precleaned are equivalent wrt younger_refs_iter.
-  static bool card_is_dirty_wrt_gen_iter(jbyte cv) {
-    return cv == dirty_card || cv == precleaned_card;
-  }
-
-  // Returns "true" iff the value "cv" will cause the card containing it
-  // to be scanned in the current traversal.  May be overridden by
-  // subtypes.
-  virtual bool card_will_be_scanned(jbyte cv) {
-    return CardTableModRefBS::card_is_dirty_wrt_gen_iter(cv);
-  }
-
-  // Returns "true" iff the value "cv" may have represented a dirty card at
-  // some point.
-  virtual bool card_may_have_been_dirty(jbyte cv) {
-    return card_is_dirty_wrt_gen_iter(cv);
-  }
-
   // The declaration order of these const fields is important; see the
   // constructor before changing.
   const MemRegion _whole_heap;       // the region covered by the card table
@@ -174,20 +142,6 @@
     return byte_for(p) + 1;
   }
 
-  // Iterate over the portion of the card-table which covers the given
-  // region mr in the given space and apply cl to any dirty sub-regions
-  // of mr. Clears the dirty cards as they are processed.
-  void non_clean_card_iterate_possibly_parallel(Space* sp, MemRegion mr,
-                                                OopsInGenClosure* cl, CardTableRS* ct,
-                                                uint n_threads);
-
- private:
-  // Work method used to implement non_clean_card_iterate_possibly_parallel()
-  // above in the parallel case.
-  void non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr,
-                                            OopsInGenClosure* cl, CardTableRS* ct,
-                                            uint n_threads);
-
  protected:
   // Dirty the bytes corresponding to "mr" (not all of which must be
   // covered.)
@@ -197,65 +151,6 @@
   // all of which must be covered.)
   void clear_MemRegion(MemRegion mr);
 
-  // *** Support for parallel card scanning.
-
-  // This is an array, one element per covered region of the card table.
-  // Each entry is itself an array, with one element per chunk in the
-  // covered region.  Each entry of these arrays is the lowest non-clean
-  // card of the corresponding chunk containing part of an object from the
-  // previous chunk, or else NULL.
-  typedef jbyte*  CardPtr;
-  typedef CardPtr* CardArr;
-  CardArr* _lowest_non_clean;
-  size_t*  _lowest_non_clean_chunk_size;
-  uintptr_t* _lowest_non_clean_base_chunk_index;
-  int* _last_LNC_resizing_collection;
-
-  // Initializes "lowest_non_clean" to point to the array for the region
-  // covering "sp", and "lowest_non_clean_base_chunk_index" to the chunk
-  // index of the corresponding to the first element of that array.
-  // Ensures that these arrays are of sufficient size, allocating if necessary.
-  // May be called by several threads concurrently.
-  void get_LNC_array_for_space(Space* sp,
-                               jbyte**& lowest_non_clean,
-                               uintptr_t& lowest_non_clean_base_chunk_index,
-                               size_t& lowest_non_clean_chunk_size);
-
-  // Returns the number of chunks necessary to cover "mr".
-  size_t chunks_to_cover(MemRegion mr) {
-    return (size_t)(addr_to_chunk_index(mr.last()) -
-                    addr_to_chunk_index(mr.start()) + 1);
-  }
-
-  // Returns the index of the chunk in a stride which
-  // covers the given address.
-  uintptr_t addr_to_chunk_index(const void* addr) {
-    uintptr_t card = (uintptr_t) byte_for(addr);
-    return card / ParGCCardsPerStrideChunk;
-  }
-
-  // Apply cl, which must either itself apply dcto_cl or be dcto_cl,
-  // to the cards in the stride (of n_strides) within the given space.
-  void process_stride(Space* sp,
-                      MemRegion used,
-                      jint stride, int n_strides,
-                      OopsInGenClosure* cl,
-                      CardTableRS* ct,
-                      jbyte** lowest_non_clean,
-                      uintptr_t lowest_non_clean_base_chunk_index,
-                      size_t lowest_non_clean_chunk_size);
-
-  // Makes sure that chunk boundaries are handled appropriately, by
-  // adjusting the min_done of dcto_cl, and by using a special card-table
-  // value to indicate how min_done should be set.
-  void process_chunk_boundaries(Space* sp,
-                                DirtyCardToOopClosure* dcto_cl,
-                                MemRegion chunk_mr,
-                                MemRegion used,
-                                jbyte** lowest_non_clean,
-                                uintptr_t lowest_non_clean_base_chunk_index,
-                                size_t    lowest_non_clean_chunk_size);
-
 public:
   // Constants
   enum SomePublicConstants {
@@ -436,34 +331,5 @@
   static const BarrierSet::Name value = BarrierSet::CardTableModRef;
 };
 
-class CardTableRS;
-
-// A specialization for the CardTableRS gen rem set.
-class CardTableModRefBSForCTRS: public CardTableModRefBS {
-  CardTableRS* _rs;
-protected:
-  bool card_will_be_scanned(jbyte cv);
-  bool card_may_have_been_dirty(jbyte cv);
-public:
-  CardTableModRefBSForCTRS(MemRegion whole_heap) :
-    CardTableModRefBS(
-      whole_heap,
-      // Concrete tag should be BarrierSet::CardTableForRS.
-      // That will presently break things in a bunch of places though.
-      // The concrete tag is used as a dispatch key in many places, and
-      // CardTableForRS does not correctly dispatch in some of those
-      // uses. This will be addressed as part of a reorganization of the
-      // BarrierSet hierarchy.
-      BarrierSet::FakeRtti(BarrierSet::CardTableModRef, 0).add_tag(BarrierSet::CardTableForRS))
-    {}
-
-  void set_CTRS(CardTableRS* rs) { _rs = rs; }
-};
-
-template<>
-struct BarrierSet::GetName<CardTableModRefBSForCTRS> {
-  static const BarrierSet::Name value = BarrierSet::CardTableForRS;
-};
-
 
 #endif // SHARE_VM_GC_SHARED_CARDTABLEMODREFBS_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc/shared/cardTableModRefBSForCTRS.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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 "gc/shared/cardTableModRefBS.inline.hpp"
+#include "gc/shared/cardTableRS.hpp"
+#include "memory/allocation.inline.hpp"
+#include "gc/shared/space.inline.hpp"
+
+CardTableModRefBSForCTRS::CardTableModRefBSForCTRS(MemRegion whole_heap) :
+  CardTableModRefBS(
+    whole_heap,
+    // Concrete tag should be BarrierSet::CardTableForRS.
+    // That will presently break things in a bunch of places though.
+    // The concrete tag is used as a dispatch key in many places, and
+    // CardTableForRS does not correctly dispatch in some of those
+    // uses. This will be addressed as part of a reorganization of the
+    // BarrierSet hierarchy.
+    BarrierSet::FakeRtti(BarrierSet::CardTableModRef, 0).add_tag(BarrierSet::CardTableForRS)),
+  // LNC functionality
+  _lowest_non_clean(NULL),
+  _lowest_non_clean_chunk_size(NULL),
+  _lowest_non_clean_base_chunk_index(NULL),
+  _last_LNC_resizing_collection(NULL)
+{ }
+
+void CardTableModRefBSForCTRS::initialize() {
+  CardTableModRefBS::initialize();
+  _lowest_non_clean =
+    NEW_C_HEAP_ARRAY(CardArr, _max_covered_regions, mtGC);
+  _lowest_non_clean_chunk_size =
+    NEW_C_HEAP_ARRAY(size_t, _max_covered_regions, mtGC);
+  _lowest_non_clean_base_chunk_index =
+    NEW_C_HEAP_ARRAY(uintptr_t, _max_covered_regions, mtGC);
+  _last_LNC_resizing_collection =
+    NEW_C_HEAP_ARRAY(int, _max_covered_regions, mtGC);
+  if (_lowest_non_clean == NULL
+      || _lowest_non_clean_chunk_size == NULL
+      || _lowest_non_clean_base_chunk_index == NULL
+      || _last_LNC_resizing_collection == NULL)
+    vm_exit_during_initialization("couldn't allocate an LNC array.");
+  for (int i = 0; i < _max_covered_regions; i++) {
+    _lowest_non_clean[i] = NULL;
+    _lowest_non_clean_chunk_size[i] = 0;
+    _last_LNC_resizing_collection[i] = -1;
+  }
+}
+
+CardTableModRefBSForCTRS::~CardTableModRefBSForCTRS() {
+  if (_lowest_non_clean) {
+    FREE_C_HEAP_ARRAY(CardArr, _lowest_non_clean);
+    _lowest_non_clean = NULL;
+  }
+  if (_lowest_non_clean_chunk_size) {
+    FREE_C_HEAP_ARRAY(size_t, _lowest_non_clean_chunk_size);
+    _lowest_non_clean_chunk_size = NULL;
+  }
+  if (_lowest_non_clean_base_chunk_index) {
+    FREE_C_HEAP_ARRAY(uintptr_t, _lowest_non_clean_base_chunk_index);
+    _lowest_non_clean_base_chunk_index = NULL;
+  }
+  if (_last_LNC_resizing_collection) {
+    FREE_C_HEAP_ARRAY(int, _last_LNC_resizing_collection);
+    _last_LNC_resizing_collection = NULL;
+  }
+}
+
+bool CardTableModRefBSForCTRS::card_will_be_scanned(jbyte cv) {
+  return
+    card_is_dirty_wrt_gen_iter(cv) ||
+    _rs->is_prev_nonclean_card_val(cv);
+}
+
+bool CardTableModRefBSForCTRS::card_may_have_been_dirty(jbyte cv) {
+  return
+    cv != clean_card &&
+    (card_is_dirty_wrt_gen_iter(cv) ||
+     CardTableRS::youngergen_may_have_been_dirty(cv));
+}
+
+void CardTableModRefBSForCTRS::non_clean_card_iterate_possibly_parallel(
+  Space* sp,
+  MemRegion mr,
+  OopsInGenClosure* cl,
+  CardTableRS* ct,
+  uint n_threads)
+{
+  if (!mr.is_empty()) {
+    if (n_threads > 0) {
+#if INCLUDE_ALL_GCS
+      non_clean_card_iterate_parallel_work(sp, mr, cl, ct, n_threads);
+#else  // INCLUDE_ALL_GCS
+      fatal("Parallel gc not supported here.");
+#endif // INCLUDE_ALL_GCS
+    } else {
+      // clear_cl finds contiguous dirty ranges of cards to process and clear.
+
+      // This is the single-threaded version used by DefNew.
+      const bool parallel = false;
+
+      DirtyCardToOopClosure* dcto_cl = sp->new_dcto_cl(cl, precision(), cl->gen_boundary(), parallel);
+      ClearNoncleanCardWrapper clear_cl(dcto_cl, ct, parallel);
+
+      clear_cl.do_MemRegion(mr);
+    }
+  }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc/shared/cardTableModRefBSForCTRS.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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_GC_SHARED_CARDTABLEMODREFBSFORCTRS_HPP
+#define SHARE_VM_GC_SHARED_CARDTABLEMODREFBSFORCTRS_HPP
+
+#include "gc/shared/cardTableModRefBS.hpp"
+
+class CardTableRS;
+class DirtyCardToOopClosure;
+class OopsInGenClosure;
+
+// A specialization for the CardTableRS gen rem set.
+class CardTableModRefBSForCTRS: public CardTableModRefBS {
+  friend class CardTableRS;
+
+public:
+  CardTableModRefBSForCTRS(MemRegion whole_heap);
+  ~CardTableModRefBSForCTRS();
+
+  virtual void initialize();
+
+  void set_CTRS(CardTableRS* rs) { _rs = rs; }
+
+private:
+  CardTableRS* _rs;
+
+  // *** Support for parallel card scanning.
+
+  // dirty and precleaned are equivalent wrt younger_refs_iter.
+  static bool card_is_dirty_wrt_gen_iter(jbyte cv) {
+    return cv == dirty_card || cv == precleaned_card;
+  }
+
+  // Returns "true" iff the value "cv" will cause the card containing it
+  // to be scanned in the current traversal.  May be overridden by
+  // subtypes.
+  bool card_will_be_scanned(jbyte cv);
+
+  // Returns "true" iff the value "cv" may have represented a dirty card at
+  // some point.
+  bool card_may_have_been_dirty(jbyte cv);
+
+  // Iterate over the portion of the card-table which covers the given
+  // region mr in the given space and apply cl to any dirty sub-regions
+  // of mr. Clears the dirty cards as they are processed.
+  void non_clean_card_iterate_possibly_parallel(Space* sp, MemRegion mr,
+                                                OopsInGenClosure* cl, CardTableRS* ct,
+                                                uint n_threads);
+
+  // Work method used to implement non_clean_card_iterate_possibly_parallel()
+  // above in the parallel case.
+  void non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr,
+                                            OopsInGenClosure* cl, CardTableRS* ct,
+                                            uint n_threads);
+
+  // This is an array, one element per covered region of the card table.
+  // Each entry is itself an array, with one element per chunk in the
+  // covered region.  Each entry of these arrays is the lowest non-clean
+  // card of the corresponding chunk containing part of an object from the
+  // previous chunk, or else NULL.
+  typedef jbyte*  CardPtr;
+  typedef CardPtr* CardArr;
+  CardArr* _lowest_non_clean;
+  size_t*  _lowest_non_clean_chunk_size;
+  uintptr_t* _lowest_non_clean_base_chunk_index;
+  int* _last_LNC_resizing_collection;
+
+  // Initializes "lowest_non_clean" to point to the array for the region
+  // covering "sp", and "lowest_non_clean_base_chunk_index" to the chunk
+  // index of the corresponding to the first element of that array.
+  // Ensures that these arrays are of sufficient size, allocating if necessary.
+  // May be called by several threads concurrently.
+  void get_LNC_array_for_space(Space* sp,
+                               jbyte**& lowest_non_clean,
+                               uintptr_t& lowest_non_clean_base_chunk_index,
+                               size_t& lowest_non_clean_chunk_size);
+
+  // Returns the number of chunks necessary to cover "mr".
+  size_t chunks_to_cover(MemRegion mr) {
+    return (size_t)(addr_to_chunk_index(mr.last()) -
+                    addr_to_chunk_index(mr.start()) + 1);
+  }
+
+  // Returns the index of the chunk in a stride which
+  // covers the given address.
+  uintptr_t addr_to_chunk_index(const void* addr) {
+    uintptr_t card = (uintptr_t) byte_for(addr);
+    return card / ParGCCardsPerStrideChunk;
+  }
+
+  // Apply cl, which must either itself apply dcto_cl or be dcto_cl,
+  // to the cards in the stride (of n_strides) within the given space.
+  void process_stride(Space* sp,
+                      MemRegion used,
+                      jint stride, int n_strides,
+                      OopsInGenClosure* cl,
+                      CardTableRS* ct,
+                      jbyte** lowest_non_clean,
+                      uintptr_t lowest_non_clean_base_chunk_index,
+                      size_t lowest_non_clean_chunk_size);
+
+  // Makes sure that chunk boundaries are handled appropriately, by
+  // adjusting the min_done of dcto_cl, and by using a special card-table
+  // value to indicate how min_done should be set.
+  void process_chunk_boundaries(Space* sp,
+                                DirtyCardToOopClosure* dcto_cl,
+                                MemRegion chunk_mr,
+                                MemRegion used,
+                                jbyte** lowest_non_clean,
+                                uintptr_t lowest_non_clean_base_chunk_index,
+                                size_t    lowest_non_clean_chunk_size);
+
+};
+
+template<>
+struct BarrierSet::GetName<CardTableModRefBSForCTRS> {
+  static const BarrierSet::Name value = BarrierSet::CardTableForRS;
+};
+
+#endif // include guard
+
--- a/hotspot/src/share/vm/gc/shared/cardTableRS.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/shared/cardTableRS.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -240,7 +240,7 @@
 // cur-younger-gen                ==> cur_younger_gen
 // cur_youngergen_and_prev_nonclean_card ==> no change.
 void CardTableRS::write_ref_field_gc_par(void* field, oop new_val) {
-  jbyte* entry = ct_bs()->byte_for(field);
+  jbyte* entry = _ct_bs->byte_for(field);
   do {
     jbyte entry_val = *entry;
     // We put this first because it's probably the most common case.
@@ -398,10 +398,10 @@
   jbyte* cur_entry = byte_for(used.start());
   jbyte* limit = byte_after(used.last());
   while (cur_entry < limit) {
-    if (*cur_entry == CardTableModRefBS::clean_card) {
+    if (*cur_entry == clean_card_val()) {
       jbyte* first_dirty = cur_entry+1;
       while (first_dirty < limit &&
-             *first_dirty == CardTableModRefBS::clean_card) {
+             *first_dirty == clean_card_val()) {
         first_dirty++;
       }
       // If the first object is a regular object, and it has a
@@ -418,7 +418,7 @@
               !boundary_obj->is_typeArray()) {
             guarantee(cur_entry > byte_for(used.start()),
                       "else boundary would be boundary_block");
-            if (*byte_for(boundary_block) != CardTableModRefBS::clean_card) {
+            if (*byte_for(boundary_block) != clean_card_val()) {
               begin = boundary_block + s->block_size(boundary_block);
               start_block = begin;
             }
--- a/hotspot/src/share/vm/gc/shared/cardTableRS.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/shared/cardTableRS.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -25,7 +25,7 @@
 #ifndef SHARE_VM_GC_SHARED_CARDTABLERS_HPP
 #define SHARE_VM_GC_SHARED_CARDTABLERS_HPP
 
-#include "gc/shared/cardTableModRefBS.hpp"
+#include "gc/shared/cardTableModRefBSForCTRS.hpp"
 #include "gc/shared/genRemSet.hpp"
 #include "memory/memRegion.hpp"
 
@@ -42,16 +42,16 @@
   friend class ClearNoncleanCardWrapper;
 
   static jbyte clean_card_val() {
-    return CardTableModRefBS::clean_card;
+    return CardTableModRefBSForCTRS::clean_card;
   }
 
   static intptr_t clean_card_row() {
-    return CardTableModRefBS::clean_card_row;
+    return CardTableModRefBSForCTRS::clean_card_row;
   }
 
   static bool
   card_is_dirty_wrt_gen_iter(jbyte cv) {
-    return CardTableModRefBS::card_is_dirty_wrt_gen_iter(cv);
+    return CardTableModRefBSForCTRS::card_is_dirty_wrt_gen_iter(cv);
   }
 
   CardTableModRefBSForCTRS* _ct_bs;
@@ -61,17 +61,17 @@
   void verify_space(Space* s, HeapWord* gen_start);
 
   enum ExtendedCardValue {
-    youngergen_card   = CardTableModRefBS::CT_MR_BS_last_reserved + 1,
+    youngergen_card   = CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 1,
     // These are for parallel collection.
     // There are three P (parallel) youngergen card values.  In general, this
     // needs to be more than the number of generations (including the perm
     // gen) that might have younger_refs_do invoked on them separately.  So
     // if we add more gens, we have to add more values.
-    youngergenP1_card  = CardTableModRefBS::CT_MR_BS_last_reserved + 2,
-    youngergenP2_card  = CardTableModRefBS::CT_MR_BS_last_reserved + 3,
-    youngergenP3_card  = CardTableModRefBS::CT_MR_BS_last_reserved + 4,
+    youngergenP1_card  = CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 2,
+    youngergenP2_card  = CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 3,
+    youngergenP3_card  = CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 4,
     cur_youngergen_and_prev_nonclean_card =
-      CardTableModRefBS::CT_MR_BS_last_reserved + 5
+      CardTableModRefBSForCTRS::CT_MR_BS_last_reserved + 5
   };
 
   // An array that contains, for each generation, the card table value last
@@ -107,7 +107,7 @@
   // *** GenRemSet functions.
   CardTableRS* as_CardTableRS() { return this; }
 
-  CardTableModRefBS* ct_bs() { return _ct_bs; }
+  CardTableModRefBSForCTRS* ct_bs() { return _ct_bs; }
 
   // Override.
   void prepare_for_younger_refs_iterate(bool parallel);
@@ -147,7 +147,7 @@
   void invalidate_or_clear(Generation* old_gen);
 
   static uintx ct_max_alignment_constraint() {
-    return CardTableModRefBS::ct_max_alignment_constraint();
+    return CardTableModRefBSForCTRS::ct_max_alignment_constraint();
   }
 
   jbyte* byte_for(void* p)     { return _ct_bs->byte_for(p); }
--- a/hotspot/src/share/vm/gc/shared/taskqueue.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/shared/taskqueue.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -295,8 +295,9 @@
   // Delete any resource associated with the queue.
   ~GenericTaskQueue();
 
-  // apply the closure to all elements in the task queue
-  void oops_do(OopClosure* f);
+  // Apply fn to each element in the task queue.  The queue must not
+  // be modified while iterating.
+  template<typename Fn> void iterate(Fn fn);
 
 private:
   // Element array.
--- a/hotspot/src/share/vm/gc/shared/taskqueue.inline.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/gc/shared/taskqueue.inline.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -259,20 +259,14 @@
 }
 
 template<class E, MEMFLAGS F, unsigned int N>
-inline void GenericTaskQueue<E, F, N>::oops_do(OopClosure* f) {
-  // tty->print_cr("START OopTaskQueue::oops_do");
+template<class Fn>
+inline void GenericTaskQueue<E, F, N>::iterate(Fn fn) {
   uint iters = size();
   uint index = _bottom;
   for (uint i = 0; i < iters; ++i) {
     index = decrement_index(index);
-    // tty->print_cr("  doing entry %d," INTPTR_T " -> " INTPTR_T,
-    //            index, &_elems[index], _elems[index]);
-    E* t = (E*)&_elems[index];      // cast away volatility
-    oop* p = (oop*)t;
-    assert((*t)->is_oop_or_null(), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(*t)));
-    f->do_oop(p);
+    fn(const_cast<E&>(_elems[index])); // cast away volatility
   }
-  // tty->print_cr("END OopTaskQueue::oops_do");
 }
 
 
--- a/hotspot/src/share/vm/memory/universe.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/memory/universe.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -56,6 +56,7 @@
 #include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/atomic.inline.hpp"
+#include "runtime/commandLineFlagConstraintList.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/handles.inline.hpp"
@@ -656,6 +657,11 @@
 
   Metaspace::global_initialize();
 
+  // Checks 'AfterMemoryInit' constraints.
+  if (!CommandLineFlagConstraintList::check_constraints(CommandLineFlagConstraint::AfterMemoryInit)) {
+    return JNI_EINVAL;
+  }
+
   // Create memory for metadata.  Must be after initializing heap for
   // DumpSharedSpaces.
   ClassLoaderData::init_null_class_loader_data();
--- a/hotspot/src/share/vm/oops/oop.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/oops/oop.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -200,7 +200,6 @@
 
   // Access to fields in a instanceOop through these methods.
   oop obj_field(int offset) const;
-  volatile oop obj_field_volatile(int offset) const;
   void obj_field_put(int offset, oop value);
   void obj_field_put_raw(int offset, oop value);
   void obj_field_put_volatile(int offset, oop value);
--- a/hotspot/src/share/vm/oops/oop.inline.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -284,11 +284,7 @@
     load_decode_heap_oop(obj_field_addr<narrowOop>(offset)) :
     load_decode_heap_oop(obj_field_addr<oop>(offset));
 }
-inline volatile oop oopDesc::obj_field_volatile(int offset) const {
-  volatile oop value = obj_field(offset);
-  OrderAccess::acquire();
-  return value;
-}
+
 inline void oopDesc::obj_field_put(int offset, oop value) {
   UseCompressedOops ? oop_store(obj_field_addr<narrowOop>(offset), value) :
                       oop_store(obj_field_addr<oop>(offset),       value);
--- a/hotspot/src/share/vm/opto/c2_globals.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/opto/c2_globals.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -656,7 +656,7 @@
           "0 for no aliasing, 1 for oop/field/static/array split, "         \
           "2 for class split, 3 for unique instances")                      \
           range(0, 3)                                                       \
-          constraint(AliasLevelConstraintFunc)                              \
+          constraint(AliasLevelConstraintFunc,AfterErgo)                    \
                                                                             \
   develop(bool, VerifyAliases, false,                                       \
           "perform extra checks on the results of alias analysis")          \
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -2824,7 +2824,7 @@
   if (klass->oop_is_instance()) {
     InstanceKlass* ik = InstanceKlass::cast(klass);
 
-    // ignore the class if it's has been initialized yet
+    // Ignore the class if it hasn't been initialized yet
     if (!ik->is_linked()) {
       return true;
     }
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -788,9 +788,11 @@
   st->print_cr("VM Arguments:");
   if (num_jvm_flags() > 0) {
     st->print("jvm_flags: "); print_jvm_flags_on(st);
+    st->cr();
   }
   if (num_jvm_args() > 0) {
     st->print("jvm_args: "); print_jvm_args_on(st);
+    st->cr();
   }
   st->print_cr("java_command: %s", java_command() ? java_command() : "<unknown>");
   if (_java_class_path != NULL) {
@@ -800,12 +802,32 @@
   st->print_cr("Launcher Type: %s", _sun_java_launcher);
 }
 
+void Arguments::print_summary_on(outputStream* st) {
+  // Print the command line.  Environment variables that are helpful for
+  // reproducing the problem are written later in the hs_err file.
+  // flags are from setting file
+  if (num_jvm_flags() > 0) {
+    st->print_raw("Settings File: ");
+    print_jvm_flags_on(st);
+    st->cr();
+  }
+  // args are the command line and environment variable arguments.
+  st->print_raw("Command Line: ");
+  if (num_jvm_args() > 0) {
+    print_jvm_args_on(st);
+  }
+  // this is the classfile and any arguments to the java program
+  if (java_command() != NULL) {
+    st->print("%s", java_command());
+  }
+  st->cr();
+}
+
 void Arguments::print_jvm_flags_on(outputStream* st) {
   if (_num_jvm_flags > 0) {
     for (int i=0; i < _num_jvm_flags; i++) {
       st->print("%s ", _jvm_flags_array[i]);
     }
-    st->cr();
   }
 }
 
@@ -814,7 +836,6 @@
     for (int i=0; i < _num_jvm_args; i++) {
       st->print("%s ", _jvm_args_array[i]);
     }
-    st->cr();
   }
 }
 
@@ -3959,10 +3980,10 @@
   return JNI_OK;
 }
 
-// Any custom code post the final range and constraint check
+// Any custom code post the 'CommandLineFlagConstraint::AfterErgo' constraint check
 // can be done here. We pass a flag that specifies whether
 // the check passed successfully
-void Arguments::post_final_range_and_constraint_check(bool check_passed) {
+void Arguments::post_after_ergo_constraint_check(bool check_passed) {
   // This does not set the flag itself, but stores the value in a safe place for later usage.
   _min_heap_free_ratio = MinHeapFreeRatio;
   _max_heap_free_ratio = MaxHeapFreeRatio;
--- a/hotspot/src/share/vm/runtime/arguments.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/arguments.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -463,8 +463,8 @@
   static jint apply_ergo();
   // Adjusts the arguments after the OS have adjusted the arguments
   static jint adjust_after_os();
-  // Set any arguments that need to be set after the final range and constraint check
-  static void post_final_range_and_constraint_check(bool check_passed);
+  // Set any arguments that need to be set after the 'CommandLineFlagConstraint::AfterErgo' constraint check
+  static void post_after_ergo_constraint_check(bool check_passed);
 
   static void set_gc_specific_flags();
   static inline bool gc_selected(); // whether a gc has been selected
@@ -492,6 +492,7 @@
 
   // print jvm_flags, jvm_args and java_command
   static void print_on(outputStream* st);
+  static void print_summary_on(outputStream* st);
 
   // convenient methods to obtain / print jvm_flags and jvm_args
   static const char* jvm_flags()           { return build_resource_string(_jvm_flags_array, _num_jvm_flags); }
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintList.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintList.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -39,7 +39,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_bool(const char* name, CommandLineFlagConstraintFunc_bool func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_bool(const char* name,
+                                 CommandLineFlagConstraintFunc_bool func,
+                                 ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -53,7 +55,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_int(const char* name, CommandLineFlagConstraintFunc_int func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_int(const char* name,
+                                CommandLineFlagConstraintFunc_int func,
+                                ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -67,7 +71,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_intx(const char* name, CommandLineFlagConstraintFunc_intx func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_intx(const char* name,
+                                 CommandLineFlagConstraintFunc_intx func,
+                                 ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -81,7 +87,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_uint(const char* name, CommandLineFlagConstraintFunc_uint func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_uint(const char* name,
+                                 CommandLineFlagConstraintFunc_uint func,
+                                 ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -95,7 +103,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_uintx(const char* name, CommandLineFlagConstraintFunc_uintx func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_uintx(const char* name,
+                                  CommandLineFlagConstraintFunc_uintx func,
+                                  ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -109,7 +119,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_uint64_t(const char* name, CommandLineFlagConstraintFunc_uint64_t func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_uint64_t(const char* name,
+                                     CommandLineFlagConstraintFunc_uint64_t func,
+                                     ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -123,7 +135,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_size_t(const char* name, CommandLineFlagConstraintFunc_size_t func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_size_t(const char* name,
+                                   CommandLineFlagConstraintFunc_size_t func,
+                                   ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -137,7 +151,9 @@
 
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint_double(const char* name, CommandLineFlagConstraintFunc_double func) : CommandLineFlagConstraint(name) {
+  CommandLineFlagConstraint_double(const char* name,
+                                   CommandLineFlagConstraintFunc_double func,
+                                   ConstraintType type) : CommandLineFlagConstraint(name, type) {
     _constraint=func;
   }
 
@@ -162,29 +178,29 @@
 void emit_constraint_double(const char* /*name*/)     { /* NOP */ }
 
 // CommandLineFlagConstraint emitting code functions if function argument is provided
-void emit_constraint_bool(const char* name, CommandLineFlagConstraintFunc_bool func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_bool(name, func));
+void emit_constraint_bool(const char* name, CommandLineFlagConstraintFunc_bool func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_bool(name, func, type));
 }
-void emit_constraint_int(const char* name, CommandLineFlagConstraintFunc_int func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_int(name, func));
+void emit_constraint_int(const char* name, CommandLineFlagConstraintFunc_int func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_int(name, func, type));
 }
-void emit_constraint_intx(const char* name, CommandLineFlagConstraintFunc_intx func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_intx(name, func));
+void emit_constraint_intx(const char* name, CommandLineFlagConstraintFunc_intx func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_intx(name, func, type));
 }
-void emit_constraint_uint(const char* name, CommandLineFlagConstraintFunc_uint func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uint(name, func));
+void emit_constraint_uint(const char* name, CommandLineFlagConstraintFunc_uint func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uint(name, func, type));
 }
-void emit_constraint_uintx(const char* name, CommandLineFlagConstraintFunc_uintx func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uintx(name, func));
+void emit_constraint_uintx(const char* name, CommandLineFlagConstraintFunc_uintx func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uintx(name, func, type));
 }
-void emit_constraint_uint64_t(const char* name, CommandLineFlagConstraintFunc_uint64_t func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uint64_t(name, func));
+void emit_constraint_uint64_t(const char* name, CommandLineFlagConstraintFunc_uint64_t func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_uint64_t(name, func, type));
 }
-void emit_constraint_size_t(const char* name, CommandLineFlagConstraintFunc_size_t func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_size_t(name, func));
+void emit_constraint_size_t(const char* name, CommandLineFlagConstraintFunc_size_t func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_size_t(name, func, type));
 }
-void emit_constraint_double(const char* name, CommandLineFlagConstraintFunc_double func) {
-  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_double(name, func));
+void emit_constraint_double(const char* name, CommandLineFlagConstraintFunc_double func, CommandLineFlagConstraint::ConstraintType type) {
+  CommandLineFlagConstraintList::add(new CommandLineFlagConstraint_double(name, func, type));
 }
 
 // Generate code to call emit_constraint_xxx function
@@ -201,16 +217,17 @@
 #define EMIT_CONSTRAINT_LP64_PRODUCT_FLAG(type, name, value, doc) ); emit_constraint_##type(#name
 
 // Generate func argument to pass into emit_constraint_xxx functions
-#define EMIT_CONSTRAINT_CHECK(func)                               , func
+#define EMIT_CONSTRAINT_CHECK(func, type)                               , func, CommandLineFlagConstraint::type
 
 // the "name" argument must be a string literal
-#define INITIAL_CONTRAINTS_SIZE 16
+#define INITIAL_CONSTRAINTS_SIZE 16
 GrowableArray<CommandLineFlagConstraint*>* CommandLineFlagConstraintList::_constraints = NULL;
+CommandLineFlagConstraint::ConstraintType CommandLineFlagConstraintList::_validating_type = CommandLineFlagConstraint::AtParse;
 
 // Check the ranges of all flags that have them or print them out and exit if requested
 void CommandLineFlagConstraintList::init(void) {
 
-  _constraints = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<CommandLineFlagConstraint*>(INITIAL_CONTRAINTS_SIZE, true);
+  _constraints = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<CommandLineFlagConstraint*>(INITIAL_CONSTRAINTS_SIZE, true);
 
   emit_constraint_no(NULL RUNTIME_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG,
                                         EMIT_CONSTRAINT_PD_DEVELOPER_FLAG,
@@ -273,14 +290,89 @@
 #endif // INCLUDE_ALL_GCS
 }
 
-CommandLineFlagConstraint* CommandLineFlagConstraintList::find(const char* name) {
+// Find constraints by name and return only if found constraint's type is equal or lower than current validating type.
+CommandLineFlagConstraint* CommandLineFlagConstraintList::find_if_needs_check(const char* name) {
   CommandLineFlagConstraint* found = NULL;
   for (int i=0; i<length(); i++) {
     CommandLineFlagConstraint* constraint = at(i);
-    if (strcmp(constraint->name(), name) == 0) {
+    if ((strcmp(constraint->name(), name) == 0) &&
+        (constraint->type() <= _validating_type)) {
       found = constraint;
       break;
     }
   }
   return found;
 }
+
+// Check constraints for specific constraint type.
+bool CommandLineFlagConstraintList::check_constraints(CommandLineFlagConstraint::ConstraintType type) {
+//#define PRINT_CONSTRAINTS_SIZES
+#ifdef PRINT_CONSTRAINTS_SIZES
+  {
+    size_t size_constraints = sizeof(CommandLineFlagConstraintList);
+    for (int i=0; i<length(); i++) {
+      size_constraints += sizeof(CommandLineFlagConstraint);
+      CommandLineFlagConstraint* constraint = at(i);
+      const char* name = constraint->name();
+      Flag* flag = Flag::find_flag(name, strlen(name), true, true);
+      if (flag->is_bool()) {
+        size_constraints += sizeof(CommandLineFlagConstraintFunc_bool);
+        size_constraints += sizeof(CommandLineFlagConstraint*);
+      } else if (flag->is_intx()) {
+        size_constraints += sizeof(CommandLineFlagConstraintFunc_intx);
+        size_constraints += sizeof(CommandLineFlagConstraint*);
+      } else if (flag->is_uintx()) {
+        size_constraints += sizeof(CommandLineFlagConstraintFunc_uintx);
+        size_constraints += sizeof(CommandLineFlagConstraint*);
+      } else if (flag->is_uint64_t()) {
+        size_constraints += sizeof(CommandLineFlagConstraintFunc_uint64_t);
+        size_constraints += sizeof(CommandLineFlagConstraint*);
+      } else if (flag->is_size_t()) {
+        size_constraints += sizeof(CommandLineFlagConstraintFunc_size_t);
+        size_constraints += sizeof(CommandLineFlagConstraint*);
+      } else if (flag->is_double()) {
+        size_constraints += sizeof(CommandLineFlagConstraintFunc_double);
+        size_constraints += sizeof(CommandLineFlagConstraint*);
+      }
+    }
+    fprintf(stderr, "Size of %d constraints: " SIZE_FORMAT " bytes\n",
+            length(), size_constraints);
+  }
+#endif // PRINT_CONSTRAINTS_SIZES
+
+  // Skip if we already checked.
+  if (type < _validating_type) {
+    return true;
+  }
+  _validating_type = type;
+
+  bool status = true;
+  for (int i=0; i<length(); i++) {
+    CommandLineFlagConstraint* constraint = at(i);
+    if (type != constraint->type()) continue;
+    const char*name = constraint->name();
+    Flag* flag = Flag::find_flag(name, strlen(name), true, true);
+    if (flag != NULL) {
+      if (flag->is_bool()) {
+        bool value = flag->get_bool();
+        if (constraint->apply_bool(&value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_intx()) {
+        intx value = flag->get_intx();
+        if (constraint->apply_intx(&value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_uintx()) {
+        uintx value = flag->get_uintx();
+        if (constraint->apply_uintx(&value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_uint64_t()) {
+        uint64_t value = flag->get_uint64_t();
+        if (constraint->apply_uint64_t(&value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_size_t()) {
+        size_t value = flag->get_size_t();
+        if (constraint->apply_size_t(&value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_double()) {
+        double value = flag->get_double();
+        if (constraint->apply_double(&value, true) != Flag::SUCCESS) status = false;
+      }
+    }
+  }
+  return status;
+}
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintList.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintList.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -49,13 +49,27 @@
 typedef Flag::Error (*CommandLineFlagConstraintFunc_double)(bool verbose, double* value);
 
 class CommandLineFlagConstraint : public CHeapObj<mtInternal> {
+public:
+  // During VM initialization, constraint validation will be done order of ConstraintType.
+  enum ConstraintType {
+    // Will be validated during argument processing (Arguments::parse_argument).
+    AtParse         = 0,
+    // Will be validated by CommandLineFlags::check_constraints_of_after_ergo().
+    AfterErgo      = 1,
+    // Will be validated by CommandLineFlags::check_constraints_of_after_memory_init().
+    AfterMemoryInit = 2
+  };
+
 private:
   const char* _name;
+  ConstraintType _validate_type;
+
 public:
   // the "name" argument must be a string literal
-  CommandLineFlagConstraint(const char* name) { _name=name; };
+  CommandLineFlagConstraint(const char* name, ConstraintType type) { _name=name; _validate_type=type; };
   ~CommandLineFlagConstraint() {};
-  const char* name() { return _name; }
+  const char* name() const { return _name; }
+  ConstraintType type() const { return _validate_type; }
   virtual Flag::Error apply_bool(bool* value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
   virtual Flag::Error apply_int(int* value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
   virtual Flag::Error apply_intx(intx* value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
@@ -69,12 +83,17 @@
 class CommandLineFlagConstraintList : public AllStatic {
 private:
   static GrowableArray<CommandLineFlagConstraint*>* _constraints;
+  // Latest constraint validation type.
+  static CommandLineFlagConstraint::ConstraintType _validating_type;
 public:
   static void init();
   static int length() { return (_constraints != NULL) ? _constraints->length() : 0; }
   static CommandLineFlagConstraint* at(int i) { return (_constraints != NULL) ? _constraints->at(i) : NULL; }
-  static CommandLineFlagConstraint* find(const char* name);
+  static CommandLineFlagConstraint* find_if_needs_check(const char* name);
   static void add(CommandLineFlagConstraint* constraint) { _constraints->append(constraint); }
+  // True if 'AfterErgo' or later constraint functions are validated.
+  static bool validated_after_ergo() { return _validating_type >= CommandLineFlagConstraint::AfterErgo; };
+  static bool check_constraints(CommandLineFlagConstraint::ConstraintType type);
 };
 
 #endif /* SHARE_VM_RUNTIME_COMMANDLINEFLAGCONSTRAINTLIST_HPP */
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -29,18 +29,17 @@
 #include "utilities/defaultStream.hpp"
 
 Flag::Error AliasLevelConstraintFunc(bool verbose, intx* value) {
-  if (CommandLineFlags::finishedInitializing() == true) {
-    if ((*value <= 1) && (Arguments::mode() == Arguments::_comp)) {
-      if (verbose == true) {
-        jio_fprintf(defaultStream::error_stream(),
-                  "AliasLevel (" INTX_FORMAT ") is not compatible "
-                  "with -Xcomp \n",
-                  *value);
-      }
-      return Flag::VIOLATES_CONSTRAINT;
+  if ((*value <= 1) && (Arguments::mode() == Arguments::_comp)) {
+    if (verbose == true) {
+      jio_fprintf(defaultStream::error_stream(),
+                "AliasLevel (" INTX_FORMAT ") is not compatible "
+                "with -Xcomp \n",
+                *value);
     }
+    return Flag::VIOLATES_CONSTRAINT;
+  } else {
+    return Flag::SUCCESS;
   }
-  return Flag::SUCCESS;
 }
 
 /**
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsGC.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsGC.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -30,6 +30,9 @@
 
 #if INCLUDE_ALL_GCS
 #include "gc/g1/g1_globals.hpp"
+#include "gc/g1/heapRegionBounds.inline.hpp"
+#include "gc/parallel/parallelScavengeHeap.hpp"
+#include "gc/shared/plab.hpp"
 #endif // INCLUDE_ALL_GCS
 #ifdef COMPILER1
 #include "c1/c1_globals.hpp"
@@ -38,8 +41,49 @@
 #include "opto/c2_globals.hpp"
 #endif // COMPILER2
 
+static Flag::Error MinPLABSizeBounds(const char* name, bool verbose, size_t* value) {
+#if INCLUDE_ALL_GCS
+  if ((UseConcMarkSweepGC || UseG1GC) && (*value < PLAB::min_size())) {
+    if (verbose == true) {
+      jio_fprintf(defaultStream::error_stream(),
+                  "%s (" SIZE_FORMAT ") must be greater than "
+                  "ergonomic PLAB minimum size (" SIZE_FORMAT ")\n",
+                  name, *value, PLAB::min_size());
+    }
+    return Flag::VIOLATES_CONSTRAINT;
+  }
+#endif // INCLUDE_ALL_GCS
+  return Flag::SUCCESS;
+}
+
+static Flag::Error MaxPLABSizeBounds(const char* name, bool verbose, size_t* value) {
+#if INCLUDE_ALL_GCS
+  if ((UseConcMarkSweepGC || UseG1GC) && (*value > PLAB::max_size())) {
+    if (verbose == true) {
+      jio_fprintf(defaultStream::error_stream(),
+                  "%s (" SIZE_FORMAT ") must be less than "
+                  "ergonomic PLAB maximum size (" SIZE_FORMAT ")\n",
+                  name, *value, PLAB::max_size());
+    }
+    return Flag::VIOLATES_CONSTRAINT;
+  }
+#endif // INCLUDE_ALL_GCS
+  return Flag::SUCCESS;
+}
+
+static Flag::Error MinMaxPLABSizeBounds(const char* name, bool verbose, size_t* value) {
+  if (MinPLABSizeBounds(name, verbose, value) == Flag::SUCCESS) {
+    return MaxPLABSizeBounds(name, verbose, value);
+  }
+  return Flag::VIOLATES_CONSTRAINT;
+}
+
+Flag::Error YoungPLABSizeConstraintFunc(bool verbose, size_t* value) {
+  return MinMaxPLABSizeBounds("YoungPLABSize", verbose, value);
+}
+
 Flag::Error MinHeapFreeRatioConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value > MaxHeapFreeRatio)) {
+  if (*value > MaxHeapFreeRatio) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or "
@@ -53,7 +97,7 @@
 }
 
 Flag::Error MaxHeapFreeRatioConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value < MinHeapFreeRatio)) {
+  if (*value < MinHeapFreeRatio) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "MaxHeapFreeRatio (" UINTX_FORMAT ") must be greater than or "
@@ -67,7 +111,7 @@
 }
 
 Flag::Error MinMetaspaceFreeRatioConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value > MaxMetaspaceFreeRatio)) {
+  if (*value > MaxMetaspaceFreeRatio) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "MinMetaspaceFreeRatio (" UINTX_FORMAT ") must be less than or "
@@ -81,7 +125,7 @@
 }
 
 Flag::Error MaxMetaspaceFreeRatioConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value < MinMetaspaceFreeRatio)) {
+  if (*value < MinMetaspaceFreeRatio) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "MaxMetaspaceFreeRatio (" UINTX_FORMAT ") must be greater than or "
@@ -106,7 +150,7 @@
 Flag::Error InitialTenuringThresholdConstraintFunc(bool verbose, uintx* value) {
   UseConcMarkSweepGCWorkaroundIfNeeded(*value, MaxTenuringThreshold);
 
-  if ((CommandLineFlags::finishedInitializing()) && (*value > MaxTenuringThreshold)) {
+  if (*value > MaxTenuringThreshold) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "InitialTenuringThreshold (" UINTX_FORMAT ") must be less than or "
@@ -122,7 +166,7 @@
 Flag::Error MaxTenuringThresholdConstraintFunc(bool verbose, uintx* value) {
   UseConcMarkSweepGCWorkaroundIfNeeded(InitialTenuringThreshold, *value);
 
-  if ((CommandLineFlags::finishedInitializing()) && (*value < InitialTenuringThreshold)) {
+  if (*value < InitialTenuringThreshold) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "MaxTenuringThreshold (" UINTX_FORMAT ") must be greater than or "
@@ -136,9 +180,8 @@
 }
 
 #if INCLUDE_ALL_GCS
-
 Flag::Error G1NewSizePercentConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value > G1MaxNewSizePercent)) {
+  if (*value > G1MaxNewSizePercent) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "G1NewSizePercent (" UINTX_FORMAT ") must be less than or "
@@ -152,7 +195,7 @@
 }
 
 Flag::Error G1MaxNewSizePercentConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value < G1NewSizePercent)) {
+  if (*value < G1NewSizePercent) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "G1MaxNewSizePercent (" UINTX_FORMAT ") must be greater than or "
@@ -168,7 +211,7 @@
 #endif // INCLUDE_ALL_GCS
 
 Flag::Error CMSOldPLABMinConstraintFunc(bool verbose, size_t* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value > CMSOldPLABMax)) {
+  if (*value > CMSOldPLABMax) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "CMSOldPLABMin (" SIZE_FORMAT ") must be less than or "
@@ -182,7 +225,7 @@
 }
 
 Flag::Error CMSPrecleanDenominatorConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value <= CMSPrecleanNumerator)) {
+  if (*value <= CMSPrecleanNumerator) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "CMSPrecleanDenominator (" UINTX_FORMAT ") must be strickly greater than "
@@ -196,7 +239,7 @@
 }
 
 Flag::Error CMSPrecleanNumeratorConstraintFunc(bool verbose, uintx* value) {
-  if ((CommandLineFlags::finishedInitializing()) && (*value > (CMSPrecleanDenominator - 1))) {
+  if (*value > (CMSPrecleanDenominator - 1)) {
     if (verbose == true) {
       jio_fprintf(defaultStream::error_stream(),
                   "CMSPrecleanNumerator (" UINTX_FORMAT ") must be less than or "
@@ -210,25 +253,23 @@
 }
 
 Flag::Error SurvivorAlignmentInBytesConstraintFunc(bool verbose, intx* value) {
-  if (CommandLineFlags::finishedInitializing()) {
-    if (*value != 0) {
-      if (!is_power_of_2(*value)) {
-        if (verbose == true) {
-          jio_fprintf(defaultStream::error_stream(),
-                    "SurvivorAlignmentInBytes (" INTX_FORMAT ") must be power of 2\n",
-                    *value);
-        }
-        return Flag::VIOLATES_CONSTRAINT;
+  if (*value != 0) {
+    if (!is_power_of_2(*value)) {
+      if (verbose == true) {
+        jio_fprintf(defaultStream::error_stream(),
+                  "SurvivorAlignmentInBytes (" INTX_FORMAT ") must be power of 2\n",
+                  *value);
       }
-      if (*value < ObjectAlignmentInBytes) {
-        if (verbose == true) {
-          jio_fprintf(defaultStream::error_stream(),
-                    "SurvivorAlignmentInBytes (" INTX_FORMAT ") must be greater than or "
-                    "equal to ObjectAlignmentInBytes (" INTX_FORMAT ") \n",
-                    *value, ObjectAlignmentInBytes);
-        }
-        return Flag::VIOLATES_CONSTRAINT;
+      return Flag::VIOLATES_CONSTRAINT;
+    }
+    if (*value < ObjectAlignmentInBytes) {
+      if (verbose == true) {
+        jio_fprintf(defaultStream::error_stream(),
+                  "SurvivorAlignmentInBytes (" INTX_FORMAT ") must be greater than or "
+                  "equal to ObjectAlignmentInBytes (" INTX_FORMAT ")\n",
+                  *value, ObjectAlignmentInBytes);
       }
+      return Flag::VIOLATES_CONSTRAINT;
     }
   }
   return Flag::SUCCESS;
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsGC.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsGC.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -34,6 +34,8 @@
  * an appropriate error value.
  */
 
+Flag::Error YoungPLABSizeConstraintFunc(bool verbose, size_t* value);
+
 Flag::Error MinHeapFreeRatioConstraintFunc(bool verbose, uintx* value);
 Flag::Error MaxHeapFreeRatioConstraintFunc(bool verbose, uintx* value);
 
--- a/hotspot/src/share/vm/runtime/commandLineFlagRangeList.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/commandLineFlagRangeList.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -365,3 +365,63 @@
     st->print("[                           ...                           ]");
   }
 }
+
+bool CommandLineFlagRangeList::check_ranges() {
+//#define PRINT_RANGES_SIZES
+#ifdef PRINT_RANGES_SIZES
+  {
+    size_t size_ranges = sizeof(CommandLineFlagRangeList);
+    for (int i=0; i<length(); i++) {
+      size_ranges += sizeof(CommandLineFlagRange);
+      CommandLineFlagRange* range = at(i);
+      const char* name = range->name();
+      Flag* flag = Flag::find_flag(name, strlen(name), true, true);
+      if (flag->is_intx()) {
+        size_ranges += 2*sizeof(intx);
+        size_ranges += sizeof(CommandLineFlagRange*);
+      } else if (flag->is_uintx()) {
+        size_ranges += 2*sizeof(uintx);
+        size_ranges += sizeof(CommandLineFlagRange*);
+      } else if (flag->is_uint64_t()) {
+        size_ranges += 2*sizeof(uint64_t);
+        size_ranges += sizeof(CommandLineFlagRange*);
+      } else if (flag->is_size_t()) {
+        size_ranges += 2*sizeof(size_t);
+        size_ranges += sizeof(CommandLineFlagRange*);
+      } else if (flag->is_double()) {
+        size_ranges += 2*sizeof(double);
+        size_ranges += sizeof(CommandLineFlagRange*);
+      }
+    }
+    fprintf(stderr, "Size of %d ranges: " SIZE_FORMAT " bytes\n",
+            length(), size_ranges);
+  }
+#endif // PRINT_RANGES_SIZES
+
+  // Check ranges.
+  bool status = true;
+  for (int i=0; i<length(); i++) {
+    CommandLineFlagRange* range = at(i);
+    const char* name = range->name();
+    Flag* flag = Flag::find_flag(name, strlen(name), true, true);
+    if (flag != NULL) {
+      if (flag->is_intx()) {
+        intx value = flag->get_intx();
+        if (range->check_intx(value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_uintx()) {
+        uintx value = flag->get_uintx();
+        if (range->check_uintx(value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_uint64_t()) {
+        uint64_t value = flag->get_uint64_t();
+        if (range->check_uint64_t(value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_size_t()) {
+        size_t value = flag->get_size_t();
+        if (range->check_size_t(value, true) != Flag::SUCCESS) status = false;
+      } else if (flag->is_double()) {
+        double value = flag->get_double();
+        if (range->check_double(value, true) != Flag::SUCCESS) status = false;
+      }
+    }
+  }
+  return status;
+}
--- a/hotspot/src/share/vm/runtime/commandLineFlagRangeList.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/commandLineFlagRangeList.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -66,6 +66,8 @@
   static CommandLineFlagRange* find(const char* name);
   static void add(CommandLineFlagRange* range) { _ranges->append(range); }
   static void print(const char* name, outputStream* st, bool unspecified = false);
+  // Check the final values of all flags for ranges.
+  static bool check_ranges();
 };
 
 #endif // SHARE_VM_RUNTIME_COMMANDLINEFLAGRANGELIST_HPP
--- a/hotspot/src/share/vm/runtime/globals.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/globals.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -770,7 +770,7 @@
 
 static Flag::Error apply_constraint_and_check_range_bool(const char* name, bool* new_value, bool verbose = true) {
   Flag::Error status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     status = constraint->apply_bool(new_value, verbose);
   }
@@ -789,7 +789,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_bool()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_bool(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_bool(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   bool old_value = result->get_bool();
   trace_flag_changed<EventBooleanFlagChanged, bool>(name, old_value, *value, origin);
@@ -817,7 +817,7 @@
     range_status = range->check_int(*new_value, verbose);
   }
   Flag::Error constraint_status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     constraint_status = constraint->apply_int(new_value, verbose);
   }
@@ -836,7 +836,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_int()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_int(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_int(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   int old_value = result->get_int();
   trace_flag_changed<EventIntFlagChanged, s4>(name, old_value, *value, origin);
@@ -862,7 +862,7 @@
     range_status = range->check_uint(*new_value, verbose);
   }
   Flag::Error constraint_status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     constraint_status = constraint->apply_uint(new_value, verbose);
   }
@@ -881,7 +881,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_uint()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_uint(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_uint(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   uint old_value = result->get_uint();
   trace_flag_changed<EventUnsignedIntFlagChanged, u4>(name, old_value, *value, origin);
@@ -915,7 +915,7 @@
     range_status = range->check_intx(*new_value, verbose);
   }
   Flag::Error constraint_status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     constraint_status = constraint->apply_intx(new_value, verbose);
   }
@@ -926,7 +926,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_intx()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_intx(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_intx(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   intx old_value = result->get_intx();
   trace_flag_changed<EventLongFlagChanged, intx>(name, old_value, *value, origin);
@@ -962,7 +962,7 @@
     range_status = range->check_uintx(*new_value, verbose);
   }
   Flag::Error constraint_status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     constraint_status = constraint->apply_uintx(new_value, verbose);
   }
@@ -973,7 +973,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_uintx()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_uintx(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_uintx(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   uintx old_value = result->get_uintx();
   trace_flag_changed<EventUnsignedLongFlagChanged, u8>(name, old_value, *value, origin);
@@ -1009,7 +1009,7 @@
     range_status = range->check_uint64_t(*new_value, verbose);
   }
   Flag::Error constraint_status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     constraint_status = constraint->apply_uint64_t(new_value, verbose);
   }
@@ -1020,7 +1020,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_uint64_t()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_uint64_t(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_uint64_t(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   uint64_t old_value = result->get_uint64_t();
   trace_flag_changed<EventUnsignedLongFlagChanged, u8>(name, old_value, *value, origin);
@@ -1056,7 +1056,7 @@
     range_status = range->check_size_t(*new_value, verbose);
   }
   Flag::Error constraint_status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     constraint_status = constraint->apply_size_t(new_value, verbose);
   }
@@ -1067,7 +1067,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_size_t()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_size_t(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_size_t(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   size_t old_value = result->get_size_t();
   trace_flag_changed<EventUnsignedLongFlagChanged, u8>(name, old_value, *value, origin);
@@ -1103,7 +1103,7 @@
     range_status = range->check_double(*new_value, verbose);
   }
   Flag::Error constraint_status = Flag::SUCCESS;
-  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
+  CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find_if_needs_check(name);
   if (constraint != NULL) {
     constraint_status = constraint->apply_double(new_value, verbose);
   }
@@ -1114,7 +1114,7 @@
   Flag* result = Flag::find_flag(name, len);
   if (result == NULL) return Flag::INVALID_FLAG;
   if (!result->is_double()) return Flag::WRONG_FORMAT;
-  Flag::Error check = apply_constraint_and_check_range_double(name, value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_double(name, value, !CommandLineFlagConstraintList::validated_after_ergo());
   if (check != Flag::SUCCESS) return check;
   double old_value = result->get_double();
   trace_flag_changed<EventDoubleFlagChanged, double>(name, old_value, *value, origin);
@@ -1127,7 +1127,7 @@
 Flag::Error CommandLineFlagsEx::doubleAtPut(CommandLineFlagWithType flag, double value, Flag::Flags origin) {
   Flag* faddr = address_of_flag(flag);
   guarantee(faddr != NULL && faddr->is_double(), "wrong flag type");
-  Flag::Error check = apply_constraint_and_check_range_double(faddr->_name, &value, !CommandLineFlags::finishedInitializing());
+  Flag::Error check = apply_constraint_and_check_range_double(faddr->_name, &value);
   if (check != Flag::SUCCESS) return check;
   trace_flag_changed<EventDoubleFlagChanged, double>(faddr->_name, faddr->get_double(), value, origin);
   faddr->set_double(value);
@@ -1210,129 +1210,6 @@
   FREE_C_HEAP_ARRAY(Flag*, array);
 }
 
-bool CommandLineFlags::_finished_initializing = false;
-
-bool CommandLineFlags::check_all_ranges_and_constraints() {
-
-//#define PRINT_RANGES_AND_CONSTRAINTS_SIZES
-#ifdef PRINT_RANGES_AND_CONSTRAINTS_SIZES
-  {
-    size_t size_ranges = sizeof(CommandLineFlagRangeList);
-    for (int i=0; i<CommandLineFlagRangeList::length(); i++) {
-      size_ranges += sizeof(CommandLineFlagRange);
-      CommandLineFlagRange* range = CommandLineFlagRangeList::at(i);
-      const char* name = range->name();
-      Flag* flag = Flag::find_flag(name, strlen(name), true, true);
-      if (flag->is_intx()) {
-        size_ranges += 2*sizeof(intx);
-        size_ranges += sizeof(CommandLineFlagRange*);
-      } else if (flag->is_uintx()) {
-        size_ranges += 2*sizeof(uintx);
-        size_ranges += sizeof(CommandLineFlagRange*);
-      } else if (flag->is_uint64_t()) {
-        size_ranges += 2*sizeof(uint64_t);
-        size_ranges += sizeof(CommandLineFlagRange*);
-      } else if (flag->is_size_t()) {
-        size_ranges += 2*sizeof(size_t);
-        size_ranges += sizeof(CommandLineFlagRange*);
-      } else if (flag->is_double()) {
-        size_ranges += 2*sizeof(double);
-        size_ranges += sizeof(CommandLineFlagRange*);
-      }
-    }
-    fprintf(stderr, "Size of %d ranges: " SIZE_FORMAT " bytes\n",
-            CommandLineFlagRangeList::length(), size_ranges);
-  }
-  {
-    size_t size_constraints = sizeof(CommandLineFlagConstraintList);
-    for (int i=0; i<CommandLineFlagConstraintList::length(); i++) {
-      size_constraints += sizeof(CommandLineFlagConstraint);
-      CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::at(i);
-      const char* name = constraint->name();
-      Flag* flag = Flag::find_flag(name, strlen(name), true, true);
-      if (flag->is_bool()) {
-        size_constraints += sizeof(CommandLineFlagConstraintFunc_bool);
-        size_constraints += sizeof(CommandLineFlagConstraint*);
-      } else if (flag->is_intx()) {
-        size_constraints += sizeof(CommandLineFlagConstraintFunc_intx);
-        size_constraints += sizeof(CommandLineFlagConstraint*);
-      } else if (flag->is_uintx()) {
-        size_constraints += sizeof(CommandLineFlagConstraintFunc_uintx);
-        size_constraints += sizeof(CommandLineFlagConstraint*);
-      } else if (flag->is_uint64_t()) {
-        size_constraints += sizeof(CommandLineFlagConstraintFunc_uint64_t);
-        size_constraints += sizeof(CommandLineFlagConstraint*);
-      } else if (flag->is_size_t()) {
-        size_constraints += sizeof(CommandLineFlagConstraintFunc_size_t);
-        size_constraints += sizeof(CommandLineFlagConstraint*);
-      } else if (flag->is_double()) {
-        size_constraints += sizeof(CommandLineFlagConstraintFunc_double);
-        size_constraints += sizeof(CommandLineFlagConstraint*);
-      }
-    }
-    fprintf(stderr, "Size of %d constraints: " SIZE_FORMAT " bytes\n",
-            CommandLineFlagConstraintList::length(), size_constraints);
-  }
-#endif // PRINT_RANGES_AND_CONSTRAINTS_SIZES
-
-  _finished_initializing = true;
-
-  bool status = true;
-  for (int i=0; i<CommandLineFlagRangeList::length(); i++) {
-    CommandLineFlagRange* range = CommandLineFlagRangeList::at(i);
-    const char* name = range->name();
-    Flag* flag = Flag::find_flag(name, strlen(name), true, true);
-    if (flag != NULL) {
-      if (flag->is_intx()) {
-        intx value = flag->get_intx();
-        if (range->check_intx(value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_uintx()) {
-        uintx value = flag->get_uintx();
-        if (range->check_uintx(value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_uint64_t()) {
-        uint64_t value = flag->get_uint64_t();
-        if (range->check_uint64_t(value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_size_t()) {
-        size_t value = flag->get_size_t();
-        if (range->check_size_t(value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_double()) {
-        double value = flag->get_double();
-        if (range->check_double(value, true) != Flag::SUCCESS) status = false;
-      }
-    }
-  }
-  for (int i=0; i<CommandLineFlagConstraintList::length(); i++) {
-    CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::at(i);
-    const char*name = constraint->name();
-    Flag* flag = Flag::find_flag(name, strlen(name), true, true);
-    if (flag != NULL) {
-      if (flag->is_bool()) {
-        bool value = flag->get_bool();
-        if (constraint->apply_bool(&value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_intx()) {
-        intx value = flag->get_intx();
-        if (constraint->apply_intx(&value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_uintx()) {
-        uintx value = flag->get_uintx();
-        if (constraint->apply_uintx(&value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_uint64_t()) {
-        uint64_t value = flag->get_uint64_t();
-        if (constraint->apply_uint64_t(&value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_size_t()) {
-        size_t value = flag->get_size_t();
-        if (constraint->apply_size_t(&value, true) != Flag::SUCCESS) status = false;
-      } else if (flag->is_double()) {
-        double value = flag->get_double();
-        if (constraint->apply_double(&value, true) != Flag::SUCCESS) status = false;
-      }
-    }
-  }
-
-  Arguments::post_final_range_and_constraint_check(status);
-
-  return status;
-}
-
 #ifndef PRODUCT
 
 void CommandLineFlags::verify() {
--- a/hotspot/src/share/vm/runtime/globals.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -450,7 +450,6 @@
 
 
 class CommandLineFlags {
-  static bool _finished_initializing;
 public:
   static Flag::Error boolAt(const char* name, size_t len, bool* value, bool allow_locked = false, bool return_flag = false);
   static Flag::Error boolAt(const char* name, bool* value, bool allow_locked = false, bool return_flag = false)      { return boolAt(name, strlen(name), value, allow_locked, return_flag); }
@@ -506,12 +505,6 @@
   // printRanges will print out flags type, name and range values as expected by -XX:+PrintFlagsRanges
   static void printFlags(outputStream* out, bool withComments, bool printRanges = false);
 
-  // Returns true if all flags have their final values set (ready for ranges and constraint check)
-  static bool finishedInitializing() { return _finished_initializing; }
-
-  // Check the final values of all flags for ranges and constraints
-  static bool check_all_ranges_and_constraints();
-
   static void verify() PRODUCT_RETURN;
 };
 
@@ -640,7 +633,7 @@
   lp64_product(intx, ObjectAlignmentInBytes, 8,                             \
           "Default object alignment in bytes, 8 is minimum")                \
           range(8, 256)                                                     \
-          constraint(ObjectAlignmentInBytesConstraintFunc)                  \
+          constraint(ObjectAlignmentInBytesConstraintFunc,AtParse)          \
                                                                             \
   product(bool, AssumeMP, false,                                            \
           "Instruct the VM to assume multiple processors are available")    \
@@ -1289,7 +1282,7 @@
                                                                             \
   experimental(intx, SyncVerbose, 0, "(Unstable)")                          \
                                                                             \
-  product(bool, InlineNotify, true, "intrinsify subset of notify" )         \
+  diagnostic(bool, InlineNotify, true, "intrinsify subset of notify")       \
                                                                             \
   experimental(intx, ClearFPUAtPark, 0, "(Unsafe, Unstable)")               \
                                                                             \
@@ -1399,7 +1392,7 @@
   product(intx, ContendedPaddingWidth, 128,                                 \
           "How many bytes to pad the fields/classes marked @Contended with")\
           range(0, 8192)                                                    \
-          constraint(ContendedPaddingWidthConstraintFunc)                   \
+          constraint(ContendedPaddingWidthConstraintFunc,AtParse)           \
                                                                             \
   product(bool, EnableContended, true,                                      \
           "Enable @Contended annotation support")                           \
@@ -1600,6 +1593,7 @@
                                                                             \
   product(size_t, YoungPLABSize, 4096,                                      \
           "Size of young gen promotion LAB's (in HeapWords)")               \
+          constraint(YoungPLABSizeConstraintFunc,AfterMemoryInit)           \
                                                                             \
   product(size_t, OldPLABSize, 1024,                                        \
           "Size of old gen promotion LAB's (in HeapWords), or Number        \
@@ -1738,7 +1732,7 @@
           "Minimum size of CMS gen promotion LAB caches per worker "        \
           "per block size")                                                 \
           range(1, max_uintx)                                               \
-          constraint(CMSOldPLABMinConstraintFunc)                           \
+          constraint(CMSOldPLABMinConstraintFunc,AfterErgo)                 \
                                                                             \
   product(uintx, CMSOldPLABNumRefills, 4,                                   \
           "Nominal number of refills of CMS gen promotion LAB cache "       \
@@ -1934,13 +1928,13 @@
           "CMSPrecleanNumerator:CMSPrecleanDenominator yields convergence " \
           "ratio")                                                          \
           range(1, max_uintx)                                               \
-          constraint(CMSPrecleanDenominatorConstraintFunc)                  \
+          constraint(CMSPrecleanDenominatorConstraintFunc,AfterErgo)        \
                                                                             \
   product(uintx, CMSPrecleanNumerator, 2,                                   \
           "CMSPrecleanNumerator:CMSPrecleanDenominator yields convergence " \
           "ratio")                                                          \
           range(0, max_uintx-1)                                             \
-          constraint(CMSPrecleanNumeratorConstraintFunc)                    \
+          constraint(CMSPrecleanNumeratorConstraintFunc,AfterErgo)          \
                                                                             \
   product(bool, CMSPrecleanRefLists1, true,                                 \
           "Preclean ref lists during (initial) preclean phase")             \
@@ -2653,7 +2647,7 @@
   product(intx, CICompilerCount, CI_COMPILER_COUNT,                         \
           "Number of compiler threads to run")                              \
           range(0, max_jint)                                                \
-          constraint(CICompilerCountConstraintFunc)                         \
+          constraint(CICompilerCountConstraintFunc, AtParse)                \
                                                                             \
   product(intx, CompilationPolicyChoice, 0,                                 \
           "which compilation policy (0-3)")                                 \
@@ -3364,14 +3358,14 @@
           " For most GCs this applies to the old generation. In G1 and"     \
           " ParallelGC it applies to the whole heap.")                      \
           range(0, 100)                                                     \
-          constraint(MinHeapFreeRatioConstraintFunc)                        \
+          constraint(MinHeapFreeRatioConstraintFunc,AfterErgo)              \
                                                                             \
   manageable(uintx, MaxHeapFreeRatio, 70,                                   \
           "The maximum percentage of heap free after GC to avoid shrinking."\
           " For most GCs this applies to the old generation. In G1 and"     \
           " ParallelGC it applies to the whole heap.")                      \
           range(0, 100)                                                     \
-          constraint(MaxHeapFreeRatioConstraintFunc)                        \
+          constraint(MaxHeapFreeRatioConstraintFunc,AfterErgo)              \
                                                                             \
   product(intx, SoftRefLRUPolicyMSPerMB, 1000,                              \
           "Number of milliseconds per MB of free space in the heap")        \
@@ -3386,13 +3380,13 @@
           "The maximum percentage of Metaspace free after GC to avoid "     \
           "shrinking")                                                      \
           range(0, 100)                                                     \
-          constraint(MaxMetaspaceFreeRatioConstraintFunc)                   \
+          constraint(MaxMetaspaceFreeRatioConstraintFunc,AfterErgo)         \
                                                                             \
   product(uintx, MinMetaspaceFreeRatio,    40,                              \
           "The minimum percentage of Metaspace free after GC to avoid "     \
           "expansion")                                                      \
           range(0, 99)                                                      \
-          constraint(MinMetaspaceFreeRatioConstraintFunc)                   \
+          constraint(MinMetaspaceFreeRatioConstraintFunc,AfterErgo)         \
                                                                             \
   product(size_t, MaxMetaspaceExpansion, ScaleForWordSize(4*M),             \
           "The maximum expansion of Metaspace without full GC (in bytes)")  \
@@ -3410,12 +3404,12 @@
   product(uintx, MaxTenuringThreshold,    15,                               \
           "Maximum value for tenuring threshold")                           \
           range(0, markOopDesc::max_age + 1)                                \
-          constraint(MaxTenuringThresholdConstraintFunc)                    \
+          constraint(MaxTenuringThresholdConstraintFunc,AfterErgo)          \
                                                                             \
   product(uintx, InitialTenuringThreshold,    7,                            \
           "Initial value for tenuring threshold")                           \
           range(0, markOopDesc::max_age + 1)                                \
-          constraint(InitialTenuringThresholdConstraintFunc)                \
+          constraint(InitialTenuringThresholdConstraintFunc,AfterErgo)      \
                                                                             \
   product(uintx, TargetSurvivorRatio,    50,                                \
           "Desired percentage of survivor space used after scavenge")       \
@@ -4093,7 +4087,7 @@
                                                                             \
   experimental(intx, SurvivorAlignmentInBytes, 0,                           \
            "Default survivor space alignment in bytes")                     \
-           constraint(SurvivorAlignmentInBytesConstraintFunc)               \
+           constraint(SurvivorAlignmentInBytesConstraintFunc,AfterErgo)     \
                                                                             \
   product(bool , AllowNonVirtualCalls, false,                               \
           "Obey the ACC_SUPER flag and allow invokenonvirtual calls")       \
@@ -4197,7 +4191,7 @@
 // Only materialize src code for range checking when required, ignore otherwise
 #define IGNORE_RANGE(a, b)
 // Only materialize src code for contraint checking when required, ignore otherwise
-#define IGNORE_CONSTRAINT(func)
+#define IGNORE_CONSTRAINT(func,type)
 
 RUNTIME_FLAGS(DECLARE_DEVELOPER_FLAG, \
               DECLARE_PD_DEVELOPER_FLAG, \
--- a/hotspot/src/share/vm/runtime/mutexLocker.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -83,7 +83,6 @@
 Monitor* DirtyCardQ_CBL_mon           = NULL;
 Mutex*   Shared_DirtyCardQ_lock       = NULL;
 Mutex*   ParGCRareEvent_lock          = NULL;
-Mutex*   EvacFailureStack_lock        = NULL;
 Mutex*   DerivedPointerTableGC_lock   = NULL;
 Mutex*   Compile_lock                 = NULL;
 Monitor* MethodCompileQueue_lock      = NULL;
@@ -201,7 +200,6 @@
     def(OldSets_lock               , Mutex  , leaf     ,   true,  Monitor::_safepoint_check_never);
     def(RootRegionScan_lock        , Monitor, leaf     ,   true,  Monitor::_safepoint_check_never);
     def(MMUTracker_lock            , Mutex  , leaf     ,   true,  Monitor::_safepoint_check_never);
-    def(EvacFailureStack_lock      , Mutex  , nonleaf  ,   true,  Monitor::_safepoint_check_never);
 
     def(StringDedupQueue_lock      , Monitor, leaf,        true,  Monitor::_safepoint_check_never);
     def(StringDedupTable_lock      , Mutex  , leaf,        true,  Monitor::_safepoint_check_never);
--- a/hotspot/src/share/vm/runtime/mutexLocker.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/mutexLocker.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -87,7 +87,6 @@
                                                  // non-Java threads.
                                                  // (see option ExplicitGCInvokesConcurrent)
 extern Mutex*   ParGCRareEvent_lock;             // Synchronizes various (rare) parallel GC ops.
-extern Mutex*   EvacFailureStack_lock;           // guards the evac failure scan stack
 extern Mutex*   Compile_lock;                    // a lock held when Compilation is updating code (used to block CodeCache traversal, CHA updates, etc)
 extern Monitor* MethodCompileQueue_lock;         // a lock held when method compilations are enqueued, dequeued
 extern Monitor* CompileThread_lock;              // a lock held by compile threads during compilation system initialization
--- a/hotspot/src/share/vm/runtime/os.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/os.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -843,6 +843,28 @@
   pd_print_cpu_info(st, buf, buflen);
 }
 
+// Print a one line string summarizing the cpu, number of cores, memory, and operating system version
+void os::print_summary_info(outputStream* st, char* buf, size_t buflen) {
+  st->print("Host: ");
+#ifndef PRODUCT
+  if (get_host_name(buf, buflen)) {
+    st->print("%s, ", buf);
+  }
+#endif // PRODUCT
+  get_summary_cpu_info(buf, buflen);
+  st->print("%s, ", buf);
+  size_t mem = physical_memory()/G;
+  if (mem == 0) {  // for low memory systems
+    mem = physical_memory()/M;
+    st->print("%d cores, %dM, ", processor_count(), mem);
+  } else {
+    st->print("%d cores, %dG, ", processor_count(), mem);
+  }
+  get_summary_os_info(buf, buflen);
+  st->print_raw(buf);
+  st->cr();
+}
+
 void os::print_date_and_time(outputStream *st, char* buf, size_t buflen) {
   const int secs_per_day  = 86400;
   const int secs_per_hour = 3600;
@@ -850,12 +872,19 @@
 
   time_t tloc;
   (void)time(&tloc);
-  st->print("time: %s", ctime(&tloc));  // ctime adds newline.
+  char* timestring = ctime(&tloc);  // ctime adds newline.
+  // edit out the newline
+  char* nl = strchr(timestring, '\n');
+  if (nl != NULL) {
+    *nl = '\0';
+  }
 
   struct tm tz;
   if (localtime_pd(&tloc, &tz) != NULL) {
     ::strftime(buf, buflen, "%Z", &tz);
-    st->print_cr("timezone: %s", buf);
+    st->print("Time: %s %s", timestring, buf);
+  } else {
+    st->print("Time: %s", timestring);
   }
 
   double t = os::elapsedTime();
@@ -872,7 +901,7 @@
   int elmins = (eltime - day_secs - hour_secs) / secs_per_min;
   int minute_secs = elmins * secs_per_min;
   int elsecs = (eltime - day_secs - hour_secs - minute_secs);
-  st->print_cr("elapsed time: %d seconds (%dd %dh %dm %ds)", eltime, eldays, elhours, elmins, elsecs);
+  st->print_cr(" elapsed time: %d seconds (%dd %dh %dm %ds)", eltime, eldays, elhours, elmins, elsecs);
 }
 
 // moved from debug.cpp (used to be find()) but still called from there
--- a/hotspot/src/share/vm/runtime/os.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/os.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -150,6 +150,11 @@
 
   static size_t page_size_for_region(size_t region_size, size_t min_pages, bool must_be_aligned);
 
+  // Get summary strings for system information in buffer provided
+  static bool  get_host_name(char* buf, size_t buflen) PRODUCT_RETURN_(return false;);  // true if available
+  static void  get_summary_cpu_info(char* buf, size_t buflen);
+  static void  get_summary_os_info(char* buf, size_t buflen);
+
  public:
   static void init(void);                      // Called before command line parsing
   static void init_before_ergo(void);          // Called after command line parsing
@@ -590,6 +595,7 @@
   static void print_os_info_brief(outputStream* st);
   static void print_cpu_info(outputStream* st, char* buf, size_t buflen);
   static void pd_print_cpu_info(outputStream* st, char* buf, size_t buflen);
+  static void print_summary_info(outputStream* st, char* buf, size_t buflen);
   static void print_memory_info(outputStream* st);
   static void print_dll_info(outputStream* st);
   static void print_environment_variables(outputStream* st, const char** env_list);
--- a/hotspot/src/share/vm/runtime/thread.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -52,6 +52,8 @@
 #include "runtime/arguments.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/biasedLocking.hpp"
+#include "runtime/commandLineFlagConstraintList.hpp"
+#include "runtime/commandLineFlagRangeList.hpp"
 #include "runtime/deoptimization.hpp"
 #include "runtime/fprofiler.hpp"
 #include "runtime/frame.inline.hpp"
@@ -2739,6 +2741,9 @@
     if (ct->env() != NULL) {
       ct->env()->metadata_do(f);
     }
+    if (ct->task() != NULL) {
+      ct->task()->metadata_do(f);
+    }
   }
 }
 
@@ -3319,8 +3324,15 @@
   jint ergo_result = Arguments::apply_ergo();
   if (ergo_result != JNI_OK) return ergo_result;
 
-  // Final check of all arguments after ergonomics which may change values.
-  if (!CommandLineFlags::check_all_ranges_and_constraints()) {
+  // Final check of all ranges after ergonomics which may change values.
+  if (!CommandLineFlagRangeList::check_ranges()) {
+    return JNI_EINVAL;
+  }
+
+  // Final check of all 'AfterErgo' constraints after ergonomics which may change values.
+  bool constraint_result = CommandLineFlagConstraintList::check_constraints(CommandLineFlagConstraint::AfterErgo);
+  Arguments::post_after_ergo_constraint_check(constraint_result);
+  if (!constraint_result) {
     return JNI_EINVAL;
   }
 
--- a/hotspot/src/share/vm/runtime/vframe.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/runtime/vframe.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -148,8 +148,7 @@
   if (obj.not_null()) {
     st->print("\t- %s <" INTPTR_FORMAT "> ", lock_state, (address)obj());
     if (obj->klass() == SystemDictionary::Class_klass()) {
-      Klass* target_klass = java_lang_Class::as_Klass(obj());
-      st->print_cr("(a java.lang.Class for %s)", InstanceKlass::cast(target_klass)->external_name());
+      st->print_cr("(a java.lang.Class for %s)", java_lang_Class::as_external_name(obj()));
     } else {
       Klass* k = obj->klass();
       st->print_cr("(a %s)", k->external_name());
--- a/hotspot/src/share/vm/services/heapDumper.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/services/heapDumper.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -899,6 +899,11 @@
   assert(klass->oop_is_instance(), "not an InstanceKlass");
   InstanceKlass* ik = (InstanceKlass*)klass;
 
+  // Ignore the class if it hasn't been initialized yet
+  if (!ik->is_linked()) {
+    return;
+  }
+
   writer->write_u1(HPROF_GC_CLASS_DUMP);
 
   // class ID
--- a/hotspot/src/share/vm/shark/sharkBuilder.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/shark/sharkBuilder.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -25,6 +25,8 @@
 
 #include "precompiled.hpp"
 #include "ci/ciMethod.hpp"
+#include "gc/shared/barrierSet.hpp"
+#include "gc/shared/cardTableModRefBS.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/method.hpp"
 #include "runtime/os.hpp"
@@ -442,7 +444,7 @@
     Unimplemented();
 
   CreateStore(
-    LLVMValue::jbyte_constant(CardTableModRefBS::dirty_card),
+    LLVMValue::jbyte_constant(CardTableModRefBS::dirty_card_val()),
     CreateIntToPtr(
       CreateAdd(
         LLVMValue::intptr_constant(
--- a/hotspot/src/share/vm/shark/sharkBuilder.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/shark/sharkBuilder.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -27,8 +27,6 @@
 #define SHARE_VM_SHARK_SHARKBUILDER_HPP
 
 #include "ci/ciType.hpp"
-#include "gc/shared/barrierSet.hpp"
-#include "gc/shared/cardTableModRefBS.hpp"
 #include "shark/llvmHeaders.hpp"
 #include "shark/llvmValue.hpp"
 #include "shark/sharkCodeBuffer.hpp"
@@ -38,6 +36,8 @@
 #include "utilities/debug.hpp"
 #include "utilities/sizes.hpp"
 
+class BarrierSet;
+
 class SharkBuilder : public llvm::IRBuilder<> {
   friend class SharkCompileInvariants;
 
--- a/hotspot/src/share/vm/utilities/vmError.cpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/utilities/vmError.cpp	Tue Aug 04 13:41:09 2015 +0200
@@ -306,6 +306,30 @@
 #endif // ZERO
 }
 
+void VMError::print_oom_reasons(outputStream* st) {
+  st->print_cr("# Possible reasons:");
+  st->print_cr("#   The system is out of physical RAM or swap space");
+  st->print_cr("#   In 32 bit mode, the process size limit was hit");
+  st->print_cr("# Possible solutions:");
+  st->print_cr("#   Reduce memory load on the system");
+  st->print_cr("#   Increase physical memory or swap space");
+  st->print_cr("#   Check if swap backing store is full");
+  st->print_cr("#   Use 64 bit Java on a 64 bit OS");
+  st->print_cr("#   Decrease Java heap size (-Xmx/-Xms)");
+  st->print_cr("#   Decrease number of Java threads");
+  st->print_cr("#   Decrease Java thread stack sizes (-Xss)");
+  st->print_cr("#   Set larger code cache with -XX:ReservedCodeCacheSize=");
+  st->print_cr("# This output file may be truncated or incomplete.");
+}
+
+const char* VMError::gc_mode() {
+  if (UseG1GC)            return "g1 gc";
+  if (UseParallelGC)      return "parallel gc";
+  if (UseConcMarkSweepGC) return "concurrent mark sweep gc";
+  if (UseSerialGC)        return "serial gc";
+  return "ERROR in GC mode";
+}
+
 // This is the main function to report a fatal error. Only one thread can
 // call this function, so we don't need to worry about MT-safety. But it's
 // possible that the error handler itself may crash or die on an internal
@@ -358,21 +382,21 @@
 
   // test secondary error handling. Test it twice, to test that resetting
   // error handler after a secondary crash works.
-  STEP(11, "(test secondary crash 1)")
+  STEP(20, "(test secondary crash 1)")
     if (_verbose && TestCrashInErrorHandler != 0) {
       st->print_cr("Will crash now (TestCrashInErrorHandler=%d)...",
         TestCrashInErrorHandler);
       controlled_crash(TestCrashInErrorHandler);
     }
 
-  STEP(12, "(test secondary crash 2)")
+  STEP(30, "(test secondary crash 2)")
     if (_verbose && TestCrashInErrorHandler != 0) {
       st->print_cr("Will crash now (TestCrashInErrorHandler=%d)...",
         TestCrashInErrorHandler);
       controlled_crash(TestCrashInErrorHandler);
     }
 
-  STEP(13, "(test safefetch in error handler)")
+  STEP(40, "(test safefetch in error handler)")
     // test whether it is safe to use SafeFetch32 in Crash Handler. Test twice
     // to test that resetting the signal handler works correctly.
     if (_verbose && TestSafeFetchInErrorHandler) {
@@ -393,7 +417,7 @@
     }
 #endif // PRODUCT
 
-  STEP(15, "(printing type of error)")
+  STEP(50, "(printing type of error)")
 
      switch(_id) {
        case OOM_MALLOC_ERROR:
@@ -418,19 +442,7 @@
          }
          // In error file give some solutions
          if (_verbose) {
-           st->print_cr("# Possible reasons:");
-           st->print_cr("#   The system is out of physical RAM or swap space");
-           st->print_cr("#   In 32 bit mode, the process size limit was hit");
-           st->print_cr("# Possible solutions:");
-           st->print_cr("#   Reduce memory load on the system");
-           st->print_cr("#   Increase physical memory or swap space");
-           st->print_cr("#   Check if swap backing store is full");
-           st->print_cr("#   Use 64 bit Java on a 64 bit OS");
-           st->print_cr("#   Decrease Java heap size (-Xmx/-Xms)");
-           st->print_cr("#   Decrease number of Java threads");
-           st->print_cr("#   Decrease Java thread stack sizes (-Xss)");
-           st->print_cr("#   Set larger code cache with -XX:ReservedCodeCacheSize=");
-           st->print_cr("# This output file may be truncated or incomplete.");
+           print_oom_reasons(st);
          } else {
            return;  // that's enough for the screen
          }
@@ -440,7 +452,7 @@
          break;
      }
 
-  STEP(20, "(printing exception/signal name)")
+  STEP(60, "(printing exception/signal name)")
 
      st->print_cr("#");
      st->print("#  ");
@@ -470,14 +482,14 @@
        }
      }
 
-  STEP(30, "(printing current thread and pid)")
+  STEP(70, "(printing current thread and pid)")
 
      // process id, thread id
      st->print(", pid=%d", os::current_process_id());
      st->print(", tid=" INTPTR_FORMAT, os::current_thread_id());
      st->cr();
 
-  STEP(40, "(printing error message)")
+  STEP(80, "(printing error message)")
 
      if (should_report_bug(_id)) {  // already printed the message.
        // error message
@@ -488,7 +500,7 @@
        }
     }
 
-  STEP(50, "(printing Java version string)")
+  STEP(90, "(printing Java version string)")
 
      // VM version
      st->print_cr("#");
@@ -498,15 +510,18 @@
      const char* runtime_version = JDK_Version::runtime_version() != NULL ?
                                   JDK_Version::runtime_version() : "";
      st->print_cr("# JRE version: %s (%s) (build %s)", runtime_name, buf, runtime_version);
-     st->print_cr("# Java VM: %s (%s %s %s %s)",
+     // This is the long version with some default settings added
+     st->print_cr("# Java VM: %s (%s, %s%s%s, %s, %s)",
                    Abstract_VM_Version::vm_name(),
                    Abstract_VM_Version::vm_release(),
                    Abstract_VM_Version::vm_info_string(),
-                   Abstract_VM_Version::vm_platform_string(),
-                   UseCompressedOops ? "compressed oops" : ""
+                   TieredCompilation ? ", tiered" : "",
+                   UseCompressedOops ? ", compressed oops" : "",
+                   gc_mode(),
+                   Abstract_VM_Version::vm_platform_string()
                  );
 
-  STEP(60, "(printing problematic frame)")
+  STEP(100, "(printing problematic frame)")
 
      // Print current frame if we have a context (i.e. it's a crash)
      if (_context) {
@@ -517,7 +532,8 @@
        st->cr();
        st->print_cr("#");
      }
-  STEP(63, "(printing core file information)")
+
+  STEP(110, "(printing core file information)")
     st->print("# ");
     if (CreateCoredumpOnCrash) {
       if (coredump_status) {
@@ -531,13 +547,42 @@
     st->cr();
     st->print_cr("#");
 
-  STEP(65, "(printing bug submit message)")
+  STEP(120, "(printing bug submit message)")
 
      if (should_report_bug(_id) && _verbose) {
        print_bug_submit_message(st, _thread);
      }
 
-  STEP(70, "(printing thread)" )
+  STEP(130, "(printing summary)" )
+
+     if (_verbose) {
+       st->cr();
+       st->print_cr("---------------  S U M M A R Y ------------");
+       st->cr();
+     }
+
+  STEP(140, "(printing VM option summary)" )
+
+     if (_verbose) {
+       // VM options
+       Arguments::print_summary_on(st);
+       st->cr();
+     }
+
+  STEP(150, "(printing summary machine and OS info)")
+
+     if (_verbose) {
+       os::print_summary_info(st, buf, sizeof(buf));
+     }
+
+
+  STEP(160, "(printing date and time)" )
+
+     if (_verbose) {
+       os::print_date_and_time(st, buf, sizeof(buf));
+     }
+
+  STEP(170, "(printing thread)" )
 
      if (_verbose) {
        st->cr();
@@ -545,7 +590,7 @@
        st->cr();
      }
 
-  STEP(80, "(printing current thread)" )
+  STEP(180, "(printing current thread)" )
 
      // current thread
      if (_verbose) {
@@ -559,31 +604,20 @@
        st->cr();
      }
 
-  STEP(90, "(printing siginfo)" )
+  STEP(190, "(printing current compile task)" )
 
-     // signal no, signal code, address that caused the fault
-     if (_verbose && _siginfo) {
-       os::print_siginfo(st, _siginfo);
-       st->cr();
+     if (_verbose && _thread && _thread->is_Compiler_thread()) {
+        CompilerThread* t = (CompilerThread*)_thread;
+        if (t->task()) {
+           st->cr();
+           st->print_cr("Current CompileTask:");
+           t->task()->print_line_on_error(st, buf, sizeof(buf));
+           st->cr();
+        }
      }
 
-  STEP(100, "(printing registers, top of stack, instructions near pc)")
 
-     // registers, top of stack, instructions near pc
-     if (_verbose && _context) {
-       os::print_context(st, _context);
-       st->cr();
-     }
-
-  STEP(105, "(printing register info)")
-
-     // decode register contents if possible
-     if (_verbose && _context && Universe::is_fully_initialized()) {
-       os::print_register_info(st, _context);
-       st->cr();
-     }
-
-  STEP(110, "(printing stack bounds)" )
+  STEP(200, "(printing stack bounds)" )
 
      if (_verbose) {
        st->print("Stack: ");
@@ -614,7 +648,7 @@
        st->cr();
      }
 
-  STEP(120, "(printing native stack)" )
+  STEP(210, "(printing native stack)" )
 
    if (_verbose) {
      if (os::platform_print_native_stack(st, _context, buf, sizeof(buf))) {
@@ -628,13 +662,13 @@
      }
    }
 
-  STEP(130, "(printing Java stack)" )
+  STEP(220, "(printing Java stack)" )
 
      if (_verbose && _thread && _thread->is_Java_thread()) {
        print_stack_trace(st, (JavaThread*)_thread, buf, sizeof(buf));
      }
 
-  STEP(135, "(printing target Java thread stack)" )
+  STEP(230, "(printing target Java thread stack)" )
 
      // printing Java thread stack trace if it is involved in GC crash
      if (_verbose && _thread && (_thread->is_Named_thread())) {
@@ -645,7 +679,32 @@
        }
      }
 
-  STEP(140, "(printing VM operation)" )
+  STEP(240, "(printing siginfo)" )
+
+     // signal no, signal code, address that caused the fault
+     if (_verbose && _siginfo) {
+       st->cr();
+       os::print_siginfo(st, _siginfo);
+       st->cr();
+     }
+
+  STEP(250, "(printing register info)")
+
+     // decode register contents if possible
+     if (_verbose && _context && Universe::is_fully_initialized()) {
+       os::print_register_info(st, _context);
+       st->cr();
+     }
+
+  STEP(260, "(printing registers, top of stack, instructions near pc)")
+
+     // registers, top of stack, instructions near pc
+     if (_verbose && _context) {
+       os::print_context(st, _context);
+       st->cr();
+     }
+
+  STEP(270, "(printing VM operation)" )
 
      if (_verbose && _thread && _thread->is_VM_thread()) {
         VMThread* t = (VMThread*)_thread;
@@ -657,19 +716,7 @@
         }
      }
 
-  STEP(150, "(printing current compile task)" )
-
-     if (_verbose && _thread && _thread->is_Compiler_thread()) {
-        CompilerThread* t = (CompilerThread*)_thread;
-        if (t->task()) {
-           st->cr();
-           st->print_cr("Current CompileTask:");
-           t->task()->print_line_on_error(st, buf, sizeof(buf));
-           st->cr();
-        }
-     }
-
-  STEP(160, "(printing process)" )
+  STEP(280, "(printing process)" )
 
      if (_verbose) {
        st->cr();
@@ -677,7 +724,7 @@
        st->cr();
      }
 
-  STEP(170, "(printing all threads)" )
+  STEP(290, "(printing all threads)" )
 
      // all threads
      if (_verbose && _thread) {
@@ -685,7 +732,7 @@
        st->cr();
      }
 
-  STEP(175, "(printing VM state)" )
+  STEP(300, "(printing VM state)" )
 
      if (_verbose) {
        // Safepoint state
@@ -707,7 +754,7 @@
        st->cr();
      }
 
-  STEP(180, "(printing owned locks on error)" )
+  STEP(310, "(printing owned locks on error)" )
 
      // mutexes/monitors that currently have an owner
      if (_verbose) {
@@ -715,7 +762,7 @@
        st->cr();
      }
 
-  STEP(182, "(printing number of OutOfMemoryError and StackOverflow exceptions)")
+  STEP(320, "(printing number of OutOfMemoryError and StackOverflow exceptions)")
 
      if (_verbose && Exceptions::has_exception_counts()) {
        st->print_cr("OutOfMemory and StackOverflow Exception counts:");
@@ -723,7 +770,7 @@
        st->cr();
      }
 
-  STEP(185, "(printing compressed oops mode")
+  STEP(330, "(printing compressed oops mode")
 
      if (_verbose && UseCompressedOops) {
        Universe::print_compressed_oops_mode(st);
@@ -733,7 +780,7 @@
        st->cr();
      }
 
-  STEP(190, "(printing heap information)" )
+  STEP(340, "(printing heap information)" )
 
      if (_verbose && Universe::is_fully_initialized()) {
        Universe::heap()->print_on_error(st);
@@ -743,7 +790,7 @@
        st->cr();
      }
 
-  STEP(195, "(printing code cache information)" )
+  STEP(350, "(printing code cache information)" )
 
      if (_verbose && Universe::is_fully_initialized()) {
        // print code cache information before vm abort
@@ -751,14 +798,14 @@
        st->cr();
      }
 
-  STEP(200, "(printing ring buffers)" )
+  STEP(360, "(printing ring buffers)" )
 
      if (_verbose) {
        Events::print_all(st);
        st->cr();
      }
 
-  STEP(205, "(printing dynamic libraries)" )
+  STEP(370, "(printing dynamic libraries)" )
 
      if (_verbose) {
        // dynamic libraries, or memory map
@@ -766,7 +813,7 @@
        st->cr();
      }
 
-  STEP(210, "(printing VM options)" )
+  STEP(380, "(printing VM options)" )
 
      if (_verbose) {
        // VM options
@@ -774,33 +821,33 @@
        st->cr();
      }
 
-  STEP(215, "(printing warning if internal testing API used)" )
+  STEP(390, "(printing warning if internal testing API used)" )
 
      if (WhiteBox::used()) {
        st->print_cr("Unsupported internal testing APIs have been used.");
        st->cr();
      }
 
-  STEP(220, "(printing environment variables)" )
+  STEP(400, "(printing all environment variables)" )
 
      if (_verbose) {
        os::print_environment_variables(st, env_list);
        st->cr();
      }
 
-  STEP(225, "(printing signal handlers)" )
+  STEP(410, "(printing signal handlers)" )
 
      if (_verbose) {
        os::print_signal_handlers(st, buf, sizeof(buf));
        st->cr();
      }
 
-  STEP(228, "(Native Memory Tracking)" )
+  STEP(420, "(Native Memory Tracking)" )
      if (_verbose) {
        MemTracker::error_report(st);
      }
 
-  STEP(230, "" )
+  STEP(430, "(printing system)" )
 
      if (_verbose) {
        st->cr();
@@ -808,48 +855,39 @@
        st->cr();
      }
 
-  STEP(240, "(printing OS information)" )
+  STEP(440, "(printing OS information)" )
 
      if (_verbose) {
        os::print_os_info(st);
        st->cr();
      }
 
-  STEP(250, "(printing CPU info)" )
+  STEP(450, "(printing CPU info)" )
      if (_verbose) {
        os::print_cpu_info(st, buf, sizeof(buf));
        st->cr();
      }
 
-  STEP(260, "(printing memory info)" )
+  STEP(460, "(printing memory info)" )
 
      if (_verbose) {
        os::print_memory_info(st);
        st->cr();
      }
 
-  STEP(270, "(printing internal vm info)" )
+  STEP(470, "(printing internal vm info)" )
 
      if (_verbose) {
        st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string());
        st->cr();
      }
 
-  STEP(280, "(printing date and time)" )
-
-     if (_verbose) {
-       os::print_date_and_time(st, buf, sizeof(buf));
-       st->cr();
-     }
-
-#ifndef PRODUCT
   // print a defined marker to show that error handling finished correctly.
-  STEP(290, "(printing end marker)" )
+  STEP(480, "(printing end marker)" )
 
      if (_verbose) {
        st->print_cr("END.");
      }
-#endif
 
   END
 
--- a/hotspot/src/share/vm/utilities/vmError.hpp	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/src/share/vm/utilities/vmError.hpp	Tue Aug 04 13:41:09 2015 +0200
@@ -89,6 +89,9 @@
   static void print_stack_trace(outputStream* st, JavaThread* jt,
                                 char* buf, int buflen, bool verbose = false);
 
+  static const char* gc_mode();
+  static void print_oom_reasons(outputStream* st);
+
   // accessor
   const char* message() const    { return _message; }
   const char* detail_msg() const { return _detail_msg; }
--- a/hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java	Tue Aug 04 13:41:09 2015 +0200
@@ -94,29 +94,47 @@
         output.shouldHaveExitValue(0);
     }
 
+    private static long gcd(long x, long y) {
+        while (x > 0) {
+            long t = x;
+            x = y % x;
+            y = t;
+        }
+        return y;
+    }
+
+    private static long lcm(long x, long y) {
+        return x * (y / gcd(x, y));
+    }
+
     public static void main(String[] args) throws Exception {
         if (!Platform.isDebugBuild()) {
             System.out.println("Skip tests on non-debug builds because the required option TracePageSizes is a debug-only option.");
             return;
         }
 
+        // Size that a single card covers.
+        final int cardSize = 512;
         WhiteBox wb = WhiteBox.getWhiteBox();
         smallPageSize = wb.getVMPageSize();
         largePageSize = wb.getVMLargePageSize();
         allocGranularity = wb.getVMAllocationGranularity();
+        final long heapAlignment = lcm(cardSize * smallPageSize, largePageSize);
 
         if (largePageSize == 0) {
             System.out.println("Skip tests because large page support does not seem to be available on this platform.");
             return;
         }
+        if (largePageSize == smallPageSize) {
+            System.out.println("Skip tests because large page support does not seem to be available on this platform." +
+                               "Small and large page size are the same.");
+            return;
+        }
 
         // To get large pages for the card table etc. we need at least a 1G heap (with 4k page size).
         // 32 bit systems will have problems reserving such an amount of contiguous space, so skip the
         // test there.
         if (!Platform.is32bit()) {
-            // Size that a single card covers.
-            final int cardSize = 512;
-
             final long heapSizeForCardTableUsingLargePages = largePageSize * cardSize;
             final long heapSizeDiffForCardTable = Math.max(Math.max(allocGranularity * cardSize, HEAP_REGION_SIZE), largePageSize);
 
@@ -131,7 +149,8 @@
         // everywhere.
         final int bitmapTranslationFactor = 8 * 8; // ObjectAlignmentInBytes * BitsPerByte
         final long heapSizeForBitmapUsingLargePages = largePageSize * bitmapTranslationFactor;
-        final long heapSizeDiffForBitmap = Math.max(Math.max(allocGranularity * bitmapTranslationFactor, HEAP_REGION_SIZE), largePageSize);
+        final long heapSizeDiffForBitmap = Math.max(Math.max(allocGranularity * bitmapTranslationFactor, HEAP_REGION_SIZE),
+                                                    Math.max(largePageSize, heapAlignment));
 
         Asserts.assertGT(heapSizeForBitmapUsingLargePages, heapSizeDiffForBitmap,
                          "To test we would require to use an invalid heap size");
--- a/hotspot/test/runtime/CompressedOops/ObjectAlignment.java	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/test/runtime/CompressedOops/ObjectAlignment.java	Tue Aug 04 13:41:09 2015 +0200
@@ -48,7 +48,6 @@
                 .shouldHaveExitValue(1);
 
             testObjectAlignment(-1)
-                .shouldContain("must be power of 2")
                 .shouldContain("outside the allowed range")
                 .shouldHaveExitValue(1);
 
@@ -75,4 +74,4 @@
                                                                   "-version");
         return new OutputAnalyzer(pb.start());
     }
-}
\ No newline at end of file
+}
--- a/hotspot/test/runtime/ErrorHandling/CreateCoredumpOnCrash.java	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/test/runtime/ErrorHandling/CreateCoredumpOnCrash.java	Tue Aug 04 13:41:09 2015 +0200
@@ -38,7 +38,7 @@
 public class CreateCoredumpOnCrash {
     private static class Crasher {
         public static void main(String[] args) {
-            Utils.getUnsafe().getInt(0);
+            Utils.getUnsafe().putInt(0L, 0);
         }
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/RedefineTests/RedefineRunningMethodsWithBacktrace.java	Tue Aug 04 13:41:09 2015 +0200
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8087315
+ * @summary Get old method's stack trace elements after GC
+ * @library /testlibrary
+ * @modules java.compiler
+ *          java.instrument
+ *          jdk.jartool/sun.tools.jar
+ * @build RedefineClassHelper
+ * @run main RedefineClassHelper
+ * @run main/othervm -javaagent:redefineagent.jar RedefineRunningMethodsWithBacktrace
+ */
+
+import static jdk.test.lib.Asserts.*;
+
+public class RedefineRunningMethodsWithBacktrace {
+
+    public static String newB =
+                "class RedefineRunningMethodsWithBacktrace$B {" +
+                "   static int count1 = 0;" +
+                "   static int count2 = 0;" +
+                "   public static volatile boolean stop = false;" +
+                "  static void localSleep() { " +
+                "    try{ " +
+                "      Thread.currentThread().sleep(10);" +
+                "    } catch(InterruptedException ie) { " +
+                "    } " +
+                " } " +
+                "   public static void infinite() { " +
+                "       System.out.println(\"infinite called\");" +
+                "   }" +
+                "   public static void throwable() { " +
+                "       throw new RuntimeException(\"throwable called\");" +
+                "   }" +
+                "}";
+
+    public static String evenNewerB =
+                "class RedefineRunningMethodsWithBacktrace$B {" +
+                "   static int count1 = 0;" +
+                "   static int count2 = 0;" +
+                "   public static volatile boolean stop = false;" +
+                "  static void localSleep() { " +
+                "    try{ " +
+                "      Thread.currentThread().sleep(1);" +
+                "    } catch(InterruptedException ie) { " +
+                "    } " +
+                " } " +
+                "   public static void infinite() { }" +
+                "   public static void throwable() { " +
+                "       throw new RuntimeException(\"throwable called\");" +
+                "   }" +
+                "}";
+
+    static class B {
+        static int count1 = 0;
+        static int count2 = 0;
+        public static volatile boolean stop = false;
+        static void localSleep() {
+            try {
+                Thread.currentThread().sleep(10);//sleep for 10 ms
+            } catch(InterruptedException ie) {
+            }
+        }
+
+        public static void infinite() {
+            while (!stop) { count1++; localSleep(); }
+        }
+        public static void throwable() {
+            // add some stuff to the original constant pool
+            String s1 = new String ("string1");
+            String s2 = new String ("string2");
+            String s3 = new String ("string3");
+            String s4 = new String ("string4");
+            String s5 = new String ("string5");
+            String s6 = new String ("string6");
+            String s7 = new String ("string7");
+            String s8 = new String ("string8");
+            String s9 = new String ("string9");
+            String s10 = new String ("string10");
+            String s11 = new String ("string11");
+            String s12 = new String ("string12");
+            String s13 = new String ("string13");
+            String s14 = new String ("string14");
+            String s15 = new String ("string15");
+            String s16 = new String ("string16");
+            String s17 = new String ("string17");
+            String s18 = new String ("string18");
+            String s19 = new String ("string19");
+            throw new RuntimeException("throwable called");
+        }
+    }
+
+    private static void touchRedefinedMethodInBacktrace(Throwable throwable) {
+        System.out.println("touchRedefinedMethodInBacktrace: ");
+        throwable.printStackTrace();  // this actually crashes with the bug in
+                                      // java_lang_StackTraceElement::create()
+
+        // Make sure that we can convert the backtrace, which is referring to
+        // the redefined method, to a  StrackTraceElement[] without crashing.
+        StackTraceElement[] stackTrace = throwable.getStackTrace();
+        for (int i = 0; i < stackTrace.length; i++) {
+            StackTraceElement frame = stackTrace[i];
+            assertNotNull(frame.getClassName(),
+              "\nTest failed: trace[" + i + "].getClassName() returned null");
+            assertNotNull(frame.getMethodName(),
+              "\nTest failed: trace[" + i + "].getMethodName() returned null");
+        }
+    }
+
+    private static Throwable getThrowableInB() {
+        Throwable t = null;
+        try {
+            B.throwable();
+        } catch (Exception e) {
+            t = e;
+            // Don't print here because Throwable will cache the constructed stacktrace
+            // e.printStackTrace();
+        }
+        return t;
+    }
+
+
+    public static void main(String[] args) throws Exception {
+
+        new Thread() {
+            public void run() {
+                B.infinite();
+            }
+        }.start();
+
+        Throwable t1 = getThrowableInB();
+
+        RedefineClassHelper.redefineClass(B.class, newB);
+
+        System.gc();
+
+        Throwable t2 = getThrowableInB();
+
+        B.infinite();
+
+        for (int i = 0; i < 20 ; i++) {
+            String s = new String("some garbage");
+            System.gc();
+        }
+
+        RedefineClassHelper.redefineClass(B.class, evenNewerB);
+        System.gc();
+
+        Throwable t3 = getThrowableInB();
+
+        for (int i = 0; i < 20 ; i++) {
+            B.infinite();
+            String s = new String("some garbage");
+            System.gc();
+        }
+
+        touchRedefinedMethodInBacktrace(t1);
+        touchRedefinedMethodInBacktrace(t2);
+        touchRedefinedMethodInBacktrace(t3);
+
+        // purge should clean everything up.
+        B.stop = true;
+
+        for (int i = 0; i < 20 ; i++) {
+            B.infinite();
+            String s = new String("some garbage");
+            System.gc();
+        }
+    }
+}
--- a/hotspot/test/runtime/contended/Options.java	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/test/runtime/contended/Options.java	Tue Aug 04 13:41:09 2015 +0200
@@ -55,7 +55,6 @@
         output = new OutputAnalyzer(pb.start());
         output.shouldContain("ContendedPaddingWidth");
         output.shouldContain("outside the allowed range");
-        output.shouldContain("must be a multiple of 8");
         output.shouldHaveExitValue(1);
 
         pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=0", "-version");
@@ -90,7 +89,6 @@
         output = new OutputAnalyzer(pb.start());
         output.shouldContain("ContendedPaddingWidth");
         output.shouldContain("outside the allowed range");
-        output.shouldContain("must be a multiple of 8");
         output.shouldHaveExitValue(1);
 
         pb = ProcessTools.createJavaProcessBuilder("-XX:ContendedPaddingWidth=8200", "-version"); // 8192+8 = 8200
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/verifier/PrimIntArray.java	Tue Aug 04 13:41:09 2015 +0200
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/*
+ * @test
+ * @bug 8129895
+ * @summary Throw VerifyError when checking assignability of primitive arrays
+ * that are not identical.  For example, [I is not assignable to [B.
+ * @compile primArray.jasm
+ * @compile primArray49.jasm
+ * @run main/othervm -Xverify:all PrimIntArray
+ */
+
+// Test that an int[] is not assignable to byte[].
+public class PrimIntArray {
+
+    public static void main(String args[]) throws Throwable {
+        System.out.println("Regression test for bug 8129895");
+
+        try {
+            Class newClass = Class.forName("primArray");
+            throw new RuntimeException("Expected VerifyError exception not thrown with new verifier");
+        } catch (java.lang.VerifyError e) {
+            System.out.println("Test PrimIntArray passed with new verifier");
+        }
+
+        try {
+            Class newClass = Class.forName("primArray49");
+            throw new RuntimeException("Expected VerifyError exception not thrown by old verifier");
+        } catch (java.lang.VerifyError e) {
+            System.out.println("Test PrimIntArray passed with old verifier");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/verifier/primArray.jasm	Tue Aug 04 13:41:09 2015 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ *
+ */
+
+// Method castToByteArray() tries to return an array of ints when an array
+// of bytes is expected.
+super class primArray
+version 52:0
+{
+
+    public Method "<init>":"()V"
+    stack 1 locals 1
+    {
+        aload_0;
+        invokespecial Method java/lang/Object."<init>":"()V";
+        return;
+    }
+
+    public static Method castToByteArray:"([I)[B"
+        stack 1 locals 1
+    {
+        aload_0;
+        areturn;
+    }
+
+} // end Class primArray
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/runtime/verifier/primArray49.jasm	Tue Aug 04 13:41:09 2015 +0200
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ *
+ */
+
+// Method castToByteArray() tries to return an array of ints when an array
+// of bytes is expected.
+super class primArray49
+version 49:0
+{
+
+    public Method "<init>":"()V"
+    stack 1 locals 1
+    {
+        aload_0;
+        invokespecial Method java/lang/Object."<init>":"()V";
+        return;
+    }
+
+    public static Method castToByteArray:"([I)[B"
+        stack 1 locals 1
+    {
+        aload_0;
+        areturn;
+    }
+
+} // end Class primArray49
--- a/hotspot/test/serviceability/sa/TestStackTrace.java	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/test/serviceability/sa/TestStackTrace.java	Tue Aug 04 13:41:09 2015 +0200
@@ -34,7 +34,6 @@
  * @test
  * @library /../../test/lib/share/classes
  * @library /testlibrary
- * @ignore 8129971
  * @build jdk.test.lib.*
  * @build jdk.test.lib.apps.*
  * @run main TestStackTrace
--- a/hotspot/test/testlibrary/jdk/test/lib/InMemoryJavaCompiler.java	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/test/testlibrary/jdk/test/lib/InMemoryJavaCompiler.java	Tue Aug 04 13:41:09 2015 +0200
@@ -31,11 +31,9 @@
 import java.util.Arrays;
 
 import javax.tools.ForwardingJavaFileManager;
-import javax.tools.ForwardingJavaFileManager;
 import javax.tools.FileObject;
 import javax.tools.JavaCompiler;
 import javax.tools.JavaCompiler.CompilationTask;
-import javax.tools.JavaFileManager;
 import javax.tools.JavaFileObject;
 import javax.tools.JavaFileObject.Kind;
 import javax.tools.SimpleJavaFileObject;
--- a/hotspot/test/testlibrary/jdk/test/lib/Platform.java	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/test/testlibrary/jdk/test/lib/Platform.java	Tue Aug 04 13:41:09 2015 +0200
@@ -24,7 +24,6 @@
 package jdk.test.lib;
 
 import java.util.regex.Pattern;
-import jdk.test.lib.Utils;
 
 public class Platform {
     private static final String osName      = System.getProperty("os.name");
--- a/hotspot/test/testlibrary/jdk/test/lib/ProcessTools.java	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/test/testlibrary/jdk/test/lib/ProcessTools.java	Tue Aug 04 13:41:09 2015 +0200
@@ -27,8 +27,6 @@
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
 import java.lang.management.RuntimeMXBean;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
--- a/hotspot/test/testlibrary/jdk/test/lib/Utils.java	Mon Aug 03 05:05:40 2015 -0400
+++ b/hotspot/test/testlibrary/jdk/test/lib/Utils.java	Tue Aug 04 13:41:09 2015 +0200
@@ -24,9 +24,6 @@
 package jdk.test.lib;
 
 import static jdk.test.lib.Asserts.assertTrue;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
 import java.io.IOException;
 import java.lang.reflect.Field;
 import java.net.InetAddress;
@@ -58,12 +55,12 @@
     public static final String NEW_LINE = System.getProperty("line.separator");
 
     /**
-     * Returns the value of 'test.vm.opts'system property.
+     * Returns the value of 'test.vm.opts' system property.
      */
     public static final String VM_OPTIONS = System.getProperty("test.vm.opts", "").trim();
 
     /**
-     * Returns the value of 'test.java.opts'system property.
+     * Returns the value of 'test.java.opts' system property.
      */
     public static final String JAVA_OPTIONS = System.getProperty("test.java.opts", "").trim();
 
@@ -129,7 +126,7 @@
     /**
      * Returns the default JTReg arguments for a jvm running a test.
      * This is the combination of JTReg arguments test.vm.opts and test.java.opts.
-     * @return An array of options, or an empty array if no opptions.
+     * @return An array of options, or an empty array if no options.
      */
     public static String[] getTestJavaOpts() {
         List<String> opts = new ArrayList<String>();
@@ -276,7 +273,7 @@
      * 12254 /tmp/jdk8/tl/jdk/JTwork/classes/com/sun/tools/attach/Application.jar
      *
      * @param key A regular expression to search for.
-     * @return The found pid, or -1 if Enot found.
+     * @return The found pid, or -1 if not found.
      * @throws Exception If multiple matching jvms are found.
      */
     public static int tryFindJvmPid(String key) throws Throwable {
@@ -392,7 +389,7 @@
      * @param condition, a condition to wait for
      * @param timeout a time in milliseconds to wait for condition to be true
      * specifying -1 will wait forever
-     * @return condition value, to determine if wait was successfull
+     * @return condition value, to determine if wait was successful
      */
     public static final boolean waitForCondition(BooleanSupplier condition,
             long timeout) {
@@ -406,7 +403,7 @@
      * @param timeout a time in milliseconds to wait for condition to be true,
      * specifying -1 will wait forever
      * @param sleepTime a time to sleep value in milliseconds
-     * @return condition value, to determine if wait was successfull
+     * @return condition value, to determine if wait was successful
      */
     public static final boolean waitForCondition(BooleanSupplier condition,
             long timeout, long sleepTime) {
--- a/jaxp/.hgtags	Mon Aug 03 05:05:40 2015 -0400
+++ b/jaxp/.hgtags	Tue Aug 04 13:41:09 2015 +0200
@@ -317,3 +317,4 @@
 81e85f3b6174314155991048767452a9931e12e2 jdk9-b72
 be5efc34a43bdd982d1cbe11cb2f6d6a060dde60 jdk9-b73
 eadcb2b55cd1daf77625813aad0f6f3967b1528a jdk9-b74
+16b5e696f948cd8aa9b3afdb686ddffd48bd17a8 jdk9-b75
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/Repository.java	Mon Aug 03 05:05:40 2015 -0400
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/Repository.java	Tue Aug 04 13:41:09 2015 +0200
@@ -117,14 +117,6 @@
     } catch(ClassNotFoundException ex) { return null; }
   }
 
-  /** @return class file object for given Java class.
-   */
-  public static ClassPath.ClassFile lookupClassFile(String class_name) {
-    try {
-      return ClassPath.SYSTEM_CLASS_PATH.getClassFile(class_name);
-    } catch(IOException e) { return null; }
-  }
-
   /** Clear the repository.
    */
   public static void clearCache() {
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/ClassPath.java	Mon Aug 03 05:05:40 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,365 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-package com.sun.org.apache.bcel.internal.util;
-
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" and
- *    "Apache BCEL" must not be used to endorse or promote products
- *    derived from this software without prior written permission. For
- *    written permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    "Apache BCEL", nor may "Apache" appear in their name, without
- *    prior written permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-
-import java.util.*;
-import java.util.zip.*;
-import java.io.*;
-
-/**
- * Responsible for loading (class) files from the CLASSPATH. Inspired by
- * sun.tools.ClassPath.
- *
- * @author  <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
- */
-public class ClassPath implements Serializable {
-  public static final ClassPath SYSTEM_CLASS_PATH = new ClassPath();
-
-  private PathEntry[] paths;
-  private String      class_path;
-
-  /**
-   * Search for classes in given path.
-   */
-  public ClassPath(String class_path) {
-    this.class_path = class_path;
-
-    ArrayList vec = new ArrayList();
-
-    for(StringTokenizer tok=new StringTokenizer(class_path,
-                            SecuritySupport.getSystemProperty("path.separator"));
-        tok.hasMoreTokens();)
-    {
-      String path = tok.nextToken();
-
-      if(!path.equals("")) {
-        File file = new File(path);
-
-        try {
-          if(SecuritySupport.getFileExists(file)) {
-            if(file.isDirectory())
-              vec.add(new Dir(path));
-            else
-              vec.add(new Zip(new ZipFile(file)));
-          }
-        } catch(IOException e) {
-          System.err.println("CLASSPATH component " + file + ": " + e);
-        }
-      }
-    }
-
-    paths = new PathEntry[vec.size()];
-    vec.toArray(paths);
-  }
-
-  /**
-   * Search for classes in CLASSPATH.
-   * @deprecated Use SYSTEM_CLASS_PATH constant
-   */
-  public ClassPath() {
-    // this(getClassPath());
-    this("");
-  }
-
-  /** @return used class path string
-   */
-  public String toString() {
-    return class_path;
-  }
-
-  public int hashCode() {
-    return class_path.hashCode();
-  }
-
-  public boolean equals(Object o) {
-    if(o instanceof ClassPath) {
-      return class_path.equals(((ClassPath)o).class_path);
-    }
-
-    return false;
-  }
-
-  private static final void getPathComponents(String path, ArrayList list) {
-    if(path != null) {
-      StringTokenizer tok = new StringTokenizer(path, File.pathSeparator);
-
-      while(tok.hasMoreTokens()) {
-        String name = tok.nextToken();
-        File   file = new File(name);
-
-        if(SecuritySupport.getFileExists(file)) {
-          list.add(name);
-        }
-      }
-    }
-  }
-
-  /** Checks for class path components in the following properties:
-   * "java.class.path", "sun.boot.class.path"
-   *
-   * @return class path as used by default by BCEL
-   */
-  public static final String getClassPath() {
-
-    String class_path, boot_path;
-
-    try {
-      class_path = SecuritySupport.getSystemProperty("java.class.path");
-      boot_path  = SecuritySupport.getSystemProperty("sun.boot.class.path");
-    }
-    catch (SecurityException e) {
-        return "";
-    }
-
-    ArrayList list = new ArrayList();
-
-    getPathComponents(class_path, list);
-    getPathComponents(boot_path, list);
-
-    StringBuffer buf = new StringBuffer();
-
-    for(Iterator e = list.iterator(); e.hasNext(); ) {
-      buf.append((String)e.next());
-
-      if(e.hasNext())
-        buf.append(File.pathSeparatorChar);
-    }
-
-    return buf.toString().intern();
-  }
-
-  /**
-   * @param name fully qualified class name, e.g. java.lang.String
-   * @return input stream for class
-   */
-  public InputStream getInputStream(String name) throws IOException {
-    return getInputStream(name, ".class");
-  }
-
-  /**
-   * Return stream for class or resource on CLASSPATH.
-   *
-   * @param name fully qualified file name, e.g. java/lang/String
-   * @param suffix file name ends with suff, e.g. .java
-   * @return input stream for file on class path
-   */
-  public InputStream getInputStream(String name, String suffix) throws IOException {
-    InputStream is = null;
-
-    try {
-      is = getClass().getClassLoader().getResourceAsStream(name + suffix);
-    } catch(Exception e) { }
-
-    if(is != null)
-      return is;
-
-    return getClassFile(name, suffix).getInputStream();
-  }
-
-  /**
-   * @param name fully qualified file name, e.g. java/lang/String
-   * @param suffix file name ends with suff, e.g. .java
-   * @return class file for the java class
-   */
-  public ClassFile getClassFile(String name, String suffix) throws IOException {
-    for(int i=0; i < paths.length; i++) {
-      ClassFile cf;
-
-      if((cf = paths[i].getClassFile(name, suffix)) != null)
-        return cf;
-    }
-
-    throw new IOException("Couldn't find: " + name + suffix);
-  }
-
-  /**
-   * @param name fully qualified class name, e.g. java.lang.String
-   * @return input stream for class
-   */
-  public ClassFile getClassFile(String name) throws IOException {
-    return getClassFile(name, ".class");
-  }
-
-  /**
-   * @param name fully qualified file name, e.g. java/lang/String
-   * @param suffix file name ends with suffix, e.g. .java
-   * @return byte array for file on class path
-   */
-  public byte[] getBytes(String name, String suffix) throws IOException {
-    InputStream is = getInputStream(name, suffix);
-
-    if(is == null)
-      throw new IOException("Couldn't find: " + name + suffix);
-
-    DataInputStream dis   = new DataInputStream(is);
-    byte[]          bytes = new byte[is.available()];
-    dis.readFully(bytes);
-    dis.close(); is.close();
-
-    return bytes;
-  }
-
-  /**
-   * @return byte array for class
-   */
-  public byte[] getBytes(String name) throws IOException {
-    return getBytes(name, ".class");
-  }
-
-  /**
-   * @param name name of file to search for, e.g. java/lang/String.java
-   * @return full (canonical) path for file
-   */
-  public String getPath(String name) throws IOException {
-    int    index  = name.lastIndexOf('.');
-    String suffix = "";
-
-    if(index > 0) {
-      suffix = name.substring(index);
-      name   = name.substring(0, index);
-    }
-
-    return getPath(name, suffix);
-  }
-
-  /**
-   * @param name name of file to search for, e.g. java/lang/String
-   * @param suffix file name suffix, e.g. .java
-   * @return full (canonical) path for file, if it exists
-   */
-  public String getPath(String name, String suffix) throws IOException {
-    return getClassFile(name, suffix).getPath();
-  }
-
-  private static abstract class PathEntry implements Serializable {
-    abstract ClassFile getClassFile(String name, String suffix) throws IOException;
-  }
-
-  /** Contains information about file/ZIP entry of the Java class.
-   */
-  public interface ClassFile {
-    /** @return input stream for class file.
-     */
-    public abstract InputStream getInputStream() throws IOException;
-
-    /** @return canonical path to class file.
-     */
-    public abstract String getPath();
-
-    /** @return base path of found class, i.e. class is contained relative
-     * to that path, which may either denote a directory, or zip file
-     */
-    public abstract String getBase();
-
-    /** @return modification time of class file.
-     */
-    public abstract long getTime();
-
-    /** @return size of class file.
-     */
-    public abstract long getSize();
-  }
-
-  private static class Dir extends PathEntry {
-    private String dir;
-
-    Dir(String d) { dir = d; }
-
-    ClassFile getClassFile(String name, String suffix) throws IOException {
-      final File file = new File(dir + File.separatorChar +
-                                 name.replace('.', File.separatorChar) + suffix);
-
-      return SecuritySupport.getFileExists(file)? new ClassFile() {
-        public InputStream getInputStream() throws IOException { return new FileInputStream(file); }
-
-        public String      getPath()        { try {
-          return file.getCanonicalPath();
-        } catch(IOException e) { return null; }
-
-        }
-        public long        getTime()        { return file.lastModified(); }
-        public long        getSize()        { return file.length(); }
-        public String getBase() {  return dir;  }
-
-      } : null;
-    }
-
-    public String toString() { return dir; }
-  }
-
-  private static class Zip extends PathEntry {
-    private ZipFile zip;
-
-    Zip(ZipFile z) { zip = z; }
-
-    ClassFile getClassFile(String name, String suffix) throws IOException {
-      final ZipEntry entry = zip.getEntry(name.replace('.', '/') + suffix);
-
-      return (entry != null)? new ClassFile() {
-        public InputStream getInputStream() throws IOException { return zip.getInputStream(entry); }
-        public String      getPath()        { return entry.toString(); }
-        public long        getTime()        { return entry.getTime(); }
-        public long        getSize()       { return entry.getSize(); }
-        public String getBase() {
-          return zip.getName();
-        }
-      } : null;
-    }
-  }
-}
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/SyntheticRepository.java	Mon Aug 03 05:05:40 2015 -0400
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/SyntheticRepository.java	Tue Aug 04 13:41:09 2015 +0200
@@ -60,7 +60,6 @@
 
 import java.io.*;
 
-import java.util.Map;
 import java.util.HashMap;
 
 import com.sun.org.apache.bcel.internal.classfile.*;
@@ -86,30 +85,16 @@
  * @author David Dixon-Peugh
  */
 public class SyntheticRepository implements Repository {
-  private static final String DEFAULT_PATH = ClassPath.getClassPath();
 
   private static HashMap _instances = new HashMap(); // CLASSPATH X REPOSITORY
 
-  private ClassPath _path = null;
   private HashMap   _loadedClasses = new HashMap(); // CLASSNAME X JAVACLASS
 
-  private SyntheticRepository(ClassPath path) {
-    _path = path;
-  }
+    private SyntheticRepository() {
+    }
 
   public static SyntheticRepository getInstance() {
-    return getInstance(ClassPath.SYSTEM_CLASS_PATH);
-  }
-
-  public static SyntheticRepository getInstance(ClassPath classPath) {
-    SyntheticRepository rep = (SyntheticRepository)_instances.get(classPath);
-
-    if(rep == null) {
-      rep = new SyntheticRepository(classPath);
-      _instances.put(classPath, rep);
-    }
-
-    return rep;
+      return new SyntheticRepository();
   }
 
   /**
@@ -147,12 +132,9 @@
 
     className = className.replace('/', '.'); // Just in case, canonical form
 
-    try {
-      return loadClass(_path.getInputStream(className), className);
-    } catch(IOException e) {
-      throw new ClassNotFoundException("Exception while looking for class " +
+    IOException e = new IOException("Couldn't find: " + className + ".class");
+    throw new ClassNotFoundException("Exception while looking for class " +
                                        className + ": " + e.toString());
-    }
   }
 
   /**
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java	Mon Aug 03 05:05:40 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1285 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: EnvironmentCheck.java,v 1.2.4.1 2005/09/09 07:13:59 pvedula Exp $
- */
-package com.sun.org.apache.xalan.internal.xslt;
-
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Utility class to report simple information about the environment.
- * Simplistic reporting about certain classes found in your JVM may
- * help answer some FAQs for simple problems.
- *
- * <p>Usage-command line:
- * <code>
- * java com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck [-out outFile]
- * </code></p>
- *
- * <p>Usage-from program:
- * <code>
- * boolean environmentOK =
- * (new EnvironmentCheck()).checkEnvironment(yourPrintWriter);
- * </code></p>
- *
- * <p>Usage-from stylesheet:
- * <code><pre>
- *    &lt;?xml version="1.0"?&gt;
- *    &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
- *        xmlns:xalan="http://xml.apache.org/xalan"
- *        exclude-result-prefixes="xalan"&gt;
- *    &lt;xsl:output indent="yes"/&gt;
- *    &lt;xsl:template match="/"&gt;
- *      &lt;xsl:copy-of select="xalan:checkEnvironment()"/&gt;
- *    &lt;/xsl:template&gt;
- *    &lt;/xsl:stylesheet&gt;
- * </pre></code></p>
- *
- * <p>Xalan users reporting problems are encouraged to use this class
- * to see if there are potential problems with their actual
- * Java environment <b>before</b> reporting a bug.  Note that you
- * should both check from the JVM/JRE's command line as well as
- * temporarily calling checkEnvironment() directly from your code,
- * since the classpath may differ (especially for servlets, etc).</p>
- *
- * <p>Also see http://xml.apache.org/xalan-j/faq.html</p>
- *
- * <p>Note: This class is pretty simplistic:
- * results are not necessarily definitive nor will it find all
- * problems related to environment setup.  Also, you should avoid
- * calling this in deployed production code, both because it is
- * quite slow and because it forces classes to get loaded.</p>
- *
- * <p>Note: This class explicitly has very limited compile-time
- * dependencies to enable easy compilation and usage even when
- * Xalan, DOM/SAX/JAXP, etc. are not present.</p>
- *
- * <p>Note: for an improved version of this utility, please see
- * the xml-commons' project Which utility which does the same kind
- * of thing but in a much simpler manner.</p>
- *
- * @author Shane_Curcuru@us.ibm.com
- */
-public class EnvironmentCheck
-{
-
-  /**
-   * Command line runnability: checks for [-out outFilename] arg.
-   * <p>Command line entrypoint; Sets output and calls
-   * {@link #checkEnvironment(PrintWriter)}.</p>
-   * @param args command line args
-   */
-  public static void main(String[] args)
-  {
-    // Default to System.out, autoflushing
-    PrintWriter sendOutputTo = new PrintWriter(System.out, true);
-
-    // Read our simplistic input args, if supplied
-    for (int i = 0; i < args.length; i++)
-    {
-      if ("-out".equalsIgnoreCase(args[i]))
-      {
-        i++;
-
-        if (i < args.length)
-        {
-          try
-          {
-            sendOutputTo = new PrintWriter(new FileWriter(args[i], true));
-          }
-          catch (Exception e)
-          {
-            System.err.println("# WARNING: -out " + args[i] + " threw "
-                               + e.toString());
-          }
-        }
-        else
-        {
-          System.err.println(
-            "# WARNING: -out argument should have a filename, output sent to console");
-        }
-      }
-    }
-
-    EnvironmentCheck app = new EnvironmentCheck();
-    app.checkEnvironment(sendOutputTo);
-  }
-
-  /**
-   * Programmatic entrypoint: Report on basic Java environment
-   * and CLASSPATH settings that affect Xalan.
-   *
-   * <p>Note that this class is not advanced enough to tell you
-   * everything about the environment that affects Xalan, and
-   * sometimes reports errors that will not actually affect
-   * Xalan's behavior.  Currently, it very simplistically
-   * checks the JVM's environment for some basic properties and
-   * logs them out; it will report a problem if it finds a setting
-   * or .jar file that is <i>likely</i> to cause problems.</p>
-   *
-   * <p>Advanced users can peruse the code herein to help them
-   * investigate potential environment problems found; other users
-   * may simply send the output from this tool along with any bugs
-   * they submit to help us in the debugging process.</p>
-   *
-   * @param pw PrintWriter to send output to; can be sent to a
-   * file that will look similar to a Properties file; defaults
-   * to System.out if null
-   * @return true if your environment appears to have no major
-   * problems; false if potential environment problems found
-   * @see #getEnvironmentHash()
-   */
-  public boolean checkEnvironment(PrintWriter pw)
-  {
-
-    // Use user-specified output writer if non-null
-    if (null != pw)
-      outWriter = pw;
-
-    // Setup a hash to store various environment information in
-    Hashtable hash = getEnvironmentHash();
-
-    // Check for ERROR keys in the hashtable, and print report
-    boolean environmentHasErrors = writeEnvironmentReport(hash);
-
-    if (environmentHasErrors)
-    {
-      // Note: many logMsg calls have # at the start to
-      //  fake a property-file like output
-      logMsg("# WARNING: Potential problems found in your environment!");
-      logMsg("#    Check any 'ERROR' items above against the Xalan FAQs");
-      logMsg("#    to correct potential problems with your classes/jars");
-      logMsg("#    http://xml.apache.org/xalan-j/faq.html");
-      if (null != outWriter)
-        outWriter.flush();
-      return false;
-    }
-    else
-    {
-      logMsg("# YAHOO! Your environment seems to be OK.");
-      if (null != outWriter)
-        outWriter.flush();
-      return true;
-    }
-  }
-
-  /**
-   * Fill a hash with basic environment settings that affect Xalan.
-   *
-   * <p>Worker method called from various places.</p>
-   * <p>Various system and CLASSPATH, etc. properties are put into
-   * the hash as keys with a brief description of the current state
-   * of that item as the value.  Any serious problems will be put in
-   * with a key that is prefixed with {@link #ERROR 'ERROR.'} so it
-   * stands out in any resulting report; also a key with just that
-   * constant will be set as well for any error.</p>
-   * <p>Note that some legitimate cases are flaged as potential
-   * errors - namely when a developer recompiles xalan.jar on their
-   * own - and even a non-error state doesn't guaruntee that
-   * everything in the environment is correct.  But this will help
-   * point out the most common classpath and system property
-   * problems that we've seen.</p>
-   *
-   * @return Hashtable full of useful environment info about Xalan
-   * and related system properties, etc.
-   */
-  public Hashtable getEnvironmentHash()
-  {
-    // Setup a hash to store various environment information in
-    Hashtable hash = new Hashtable();
-
-    // Call various worker methods to fill in the hash
-    //  These are explicitly separate for maintenance and so
-    //  advanced users could call them standalone
-    checkJAXPVersion(hash);
-    checkProcessorVersion(hash);
-    checkParserVersion(hash);
-    checkAntVersion(hash);
-    if (!checkDOML3(hash)) {
-    checkDOMVersion(hash);
-    }
-    checkSAXVersion(hash);
-    checkSystemProperties(hash);
-
-    return hash;
-  }
-
-  /**
-   * Dump a basic Xalan environment report to outWriter.
-   *
-   * <p>This dumps a simple header and then each of the entries in
-   * the Hashtable to our PrintWriter; it does special processing
-   * for entries that are .jars found in the classpath.</p>
-   *
-   * @param h Hashtable of items to report on; presumably
-   * filled in by our various check*() methods
-   * @return true if your environment appears to have no major
-   * problems; false if potential environment problems found
-   * @see #appendEnvironmentReport(Node, Document, Hashtable)
-   * for an equivalent that appends to a Node instead
-   */
-  protected boolean writeEnvironmentReport(Hashtable h)
-  {
-
-    if (null == h)
-    {
-      logMsg("# ERROR: writeEnvironmentReport called with null Hashtable");
-      return false;
-    }
-
-    boolean errors = false;
-
-    logMsg(
-      "#---- BEGIN writeEnvironmentReport($Revision: 1.10 $): Useful stuff found: ----");
-
-    // Fake the Properties-like output
-    for (Enumeration keys = h.keys();
-         keys.hasMoreElements();
-        /* no increment portion */
-        )
-    {
-      Object key = keys.nextElement();
-      String keyStr = (String) key;
-      try
-      {
-        // Special processing for classes found..
-        if (keyStr.startsWith(FOUNDCLASSES))
-        {
-          Vector v = (Vector) h.get(keyStr);
-          errors |= logFoundJars(v, keyStr);
-        }
-        // ..normal processing for all other entries
-        else
-        {
-          // Note: we could just check for the ERROR key by itself,
-          //    since we now set that, but since we have to go
-          //    through the whole hash anyway, do it this way,
-          //    which is safer for maintenance
-          if (keyStr.startsWith(ERROR))
-          {
-            errors = true;
-          }
-          logMsg(keyStr + "=" + h.get(keyStr));
-        }
-      }
-      catch (Exception e)
-      {
-        logMsg("Reading-" + key + "= threw: " + e.toString());
-      }
-    }
-
-    logMsg(
-      "#----- END writeEnvironmentReport: Useful properties found: -----");
-
-    return errors;
-  }
-
-  /** Prefixed to hash keys that signify serious problems.  */
-  public static final String ERROR = "ERROR.";
-
-  /** Added to descriptions that signify potential problems.  */
-  public static final String WARNING = "WARNING.";
-
-  /** Value for any error found.  */
-  public static final String ERROR_FOUND = "At least one error was found!";
-
-  /** Prefixed to hash keys that signify version numbers.  */
-  public static final String VERSION = "version.";
-
-  /** Prefixed to hash keys that signify .jars found in classpath.  */
-  public static final String FOUNDCLASSES = "foundclasses.";
-
-  /** Marker that a class or .jar was found.  */
-  public static final String CLASS_PRESENT = "present-unknown-version";
-
-  /** Marker that a class or .jar was not found.  */
-  public static final String CLASS_NOTPRESENT = "not-present";
-
-  /** Listing of common .jar files that include Xalan-related classes.  */
-  public String[] jarNames =
-  {
-    "xalan.jar", "xalansamples.jar", "xalanj1compat.jar", "xalanservlet.jar",
-    "serializer.jar",   // Serializer (shared between Xalan & Xerces)
-    "xerces.jar",       // Xerces-J 1.x
-    "xercesImpl.jar",   // Xerces-J 2.x
-    "testxsl.jar",
-    "crimson.jar",
-    "lotusxsl.jar",
-    "jaxp.jar", "parser.jar", "dom.jar", "sax.jar", "xml.jar",
-    "xml-apis.jar",
-    "xsltc.jar"
-  };
-
-  /**
-   * Print out report of .jars found in a classpath.
-   *
-   * Takes the information encoded from a checkPathForJars()
-   * call and dumps it out to our PrintWriter.
-   *
-   * @param v Vector of Hashtables of .jar file info
-   * @param desc description to print out in header
-   *
-   * @return false if OK, true if any .jars were reported
-   * as having errors
-   * @see #checkPathForJars(String, String[])
-   */
-  protected boolean logFoundJars(Vector v, String desc)
-  {
-
-    if ((null == v) || (v.size() < 1))
-      return false;
-
-    boolean errors = false;
-
-    logMsg("#---- BEGIN Listing XML-related jars in: " + desc + " ----");
-
-    for (int i = 0; i < v.size(); i++)
-    {
-      Hashtable subhash = (Hashtable) v.elementAt(i);
-
-      for (Enumeration keys = subhash.keys();
-           keys.hasMoreElements();
-           /* no increment portion */
-          )
-      {
-        Object key = keys.nextElement();
-        String keyStr = (String) key;
-        try
-        {
-          if (keyStr.startsWith(ERROR))
-          {
-            errors = true;
-          }
-          logMsg(keyStr + "=" + subhash.get(keyStr));
-
-        }
-        catch (Exception e)
-        {
-          errors = true;
-          logMsg("Reading-" + key + "= threw: " + e.toString());
-        }
-      }
-    }
-
-    logMsg("#----- END Listing XML-related jars in: " + desc + " -----");
-
-    return errors;
-  }
-
-  /**
-   * Stylesheet extension entrypoint: Dump a basic Xalan
-   * environment report from getEnvironmentHash() to a Node.
-   *
-   * <p>Copy of writeEnvironmentReport that creates a Node suitable
-   * for other processing instead of a properties-like text output.
-   * </p>
-   * @param container Node to append our report to
-   * @param factory Document providing createElement, etc. services
-   * @param h Hash presumably from {@link #getEnvironmentHash()}
-   * @see #writeEnvironmentReport(Hashtable)
-   * for an equivalent that writes to a PrintWriter instead
-   */
-  public void appendEnvironmentReport(Node container, Document factory, Hashtable h)
-  {
-    if ((null == container) || (null == factory))
-    {
-      return;
-    }
-
-    try
-    {
-      Element envCheckNode = factory.createElement("EnvironmentCheck");
-      envCheckNode.setAttribute("version", "$Revision: 1.10 $");
-      container.appendChild(envCheckNode);
-
-      if (null == h)
-      {
-        Element statusNode = factory.createElement("status");
-        statusNode.setAttribute("result", "ERROR");
-        statusNode.appendChild(factory.createTextNode("appendEnvironmentReport called with null Hashtable!"));
-        envCheckNode.appendChild(statusNode);
-        return;
-      }
-
-      boolean errors = false;
-
-      Element hashNode = factory.createElement("environment");
-      envCheckNode.appendChild(hashNode);
-
-      for (Enumeration keys = h.keys();
-           keys.hasMoreElements();
-          /* no increment portion */
-          )
-      {
-        Object key = keys.nextElement();
-        String keyStr = (String) key;
-        try
-        {
-          // Special processing for classes found..
-          if (keyStr.startsWith(FOUNDCLASSES))
-          {
-            Vector v = (Vector) h.get(keyStr);
-            // errors |= logFoundJars(v, keyStr);
-            errors |= appendFoundJars(hashNode, factory, v, keyStr);
-          }
-          // ..normal processing for all other entries
-          else
-          {
-            // Note: we could just check for the ERROR key by itself,
-            //    since we now set that, but since we have to go
-            //    through the whole hash anyway, do it this way,
-            //    which is safer for maintenance
-            if (keyStr.startsWith(ERROR))
-            {
-              errors = true;
-            }
-            Element node = factory.createElement("item");
-            node.setAttribute("key", keyStr);
-            node.appendChild(factory.createTextNode((String)h.get(keyStr)));
-            hashNode.appendChild(node);
-          }
-        }
-        catch (Exception e)
-        {
-          errors = true;
-          Element node = factory.createElement("item");
-          node.setAttribute("key", keyStr);
-          node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString()));
-          hashNode.appendChild(node);
-        }
-      } // end of for...
-
-      Element statusNode = factory.createElement("status");
-      statusNode.setAttribute("result", (errors ? "ERROR" : "OK" ));
-      envCheckNode.appendChild(statusNode);
-    }
-    catch (Exception e2)
-    {
-      System.err.println("appendEnvironmentReport threw: " + e2.toString());
-      e2.printStackTrace();
-    }
-  }
-
-  /**
-   * Print out report of .jars found in a classpath.
-   *
-   * Takes the information encoded from a checkPathForJars()
-   * call and dumps it out to our PrintWriter.
-   *
-   * @param container Node to append our report to
-   * @param factory Document providing createElement, etc. services
-   * @param v Vector of Hashtables of .jar file info
-   * @param desc description to print out in header
-   *
-   * @return false if OK, true if any .jars were reported
-   * as having errors
-   * @see #checkPathForJars(String, String[])
-   */
-  protected boolean appendFoundJars(Node container, Document factory,
-        Vector v, String desc)
-  {
-
-    if ((null == v) || (v.size() < 1))
-      return false;
-
-    boolean errors = false;
-
-    for (int i = 0; i < v.size(); i++)
-    {
-      Hashtable subhash = (Hashtable) v.elementAt(i);
-
-      for (Enumeration keys = subhash.keys();
-           keys.hasMoreElements();
-           /* no increment portion */
-          )
-      {
-        Object key = keys.nextElement();
-        try
-        {
-          String keyStr = (String) key;
-          if (keyStr.startsWith(ERROR))
-          {
-            errors = true;
-          }
-          Element node = factory.createElement("foundJar");
-          node.setAttribute("name", keyStr.substring(0, keyStr.indexOf("-")));
-          node.setAttribute("desc", keyStr.substring(keyStr.indexOf("-") + 1));
-          node.appendChild(factory.createTextNode((String)subhash.get(keyStr)));
-          container.appendChild(node);
-        }
-        catch (Exception e)
-        {
-          errors = true;
-          Element node = factory.createElement("foundJar");
-          node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString()));
-          container.appendChild(node);
-        }
-      }
-    }
-    return errors;
-  }
-
-  /**
-   * Fillin hash with info about SystemProperties.
-   *
-   * Logs java.class.path and other likely paths; then attempts
-   * to search those paths for .jar files with Xalan-related classes.
-   *
-   * @param h Hashtable to put information in
-   * @see #jarNames
-   * @see #checkPathForJars(String, String[])
-   */
-  protected void checkSystemProperties(Hashtable h)
-  {
-
-    if (null == h)
-      h = new Hashtable();
-
-    // Grab java version for later use
-    try
-    {
-      String javaVersion = SecuritySupport.getSystemProperty("java.version");
-
-      h.put("java.version", javaVersion);
-    }
-    catch (SecurityException se)
-    {
-
-      // For applet context, etc.
-      h.put(
-        "java.version",
-        "WARNING: SecurityException thrown accessing system version properties");
-    }
-
-    // Printout jar files on classpath(s) that may affect operation
-    //  Do this in order
-    try
-    {
-
-      // This is present in all JVM's
-      String cp = SecuritySupport.getSystemProperty("java.class.path");
-
-      h.put("java.class.path", cp);
-
-      Vector classpathJars = checkPathForJars(cp, jarNames);
-
-      if (null != classpathJars)
-        h.put(FOUNDCLASSES + "java.class.path", classpathJars);
-
-      // Also check for JDK 1.2+ type classpaths
-      String othercp = SecuritySupport.getSystemProperty("sun.boot.class.path");
-
-      if (null != othercp)
-      {
-        h.put("sun.boot.class.path", othercp);
-
-        classpathJars = checkPathForJars(othercp, jarNames);
-
-        if (null != classpathJars)
-          h.put(FOUNDCLASSES + "sun.boot.class.path", classpathJars);
-      }
-
-      //@todo also check other System properties' paths?
-      //  v2 = checkPathForJars(System.getProperty("sun.boot.library.path"), jarNames);   // ?? may not be needed
-      //  v3 = checkPathForJars(System.getProperty("java.library.path"), jarNames);   // ?? may not be needed
-    }
-    catch (SecurityException se2)
-    {
-      // For applet context, etc.
-      h.put(
-        "java.class.path",
-        "WARNING: SecurityException thrown accessing system classpath properties");
-    }
-  }
-
-  /**
-   * Cheap-o listing of specified .jars found in the classpath.
-   *
-   * cp should be separated by the usual File.pathSeparator.  We
-   * then do a simplistic search of the path for any requested
-   * .jar filenames, and return a listing of their names and
-   * where (apparently) they came from.
-   *
-   * @param cp classpath to search
-   * @param jars array of .jar base filenames to look for
-   *
-   * @return Vector of Hashtables filled with info about found .jars
-   * @see #jarNames
-   * @see #logFoundJars(Vector, String)
-   * @see #appendFoundJars(Node, Document, Vector, String )
-   * @see #getApparentVersion(String, long)
-   */
-  protected Vector checkPathForJars(String cp, String[] jars)
-  {
-
-    if ((null == cp) || (null == jars) || (0 == cp.length())
-            || (0 == jars.length))
-      return null;
-
-    Vector v = new Vector();
-    StringTokenizer st = new StringTokenizer(cp, File.pathSeparator);
-
-    while (st.hasMoreTokens())
-    {
-
-      // Look at each classpath entry for each of our requested jarNames
-      String filename = st.nextToken();
-
-      for (int i = 0; i < jars.length; i++)
-      {
-        if (filename.indexOf(jars[i]) > -1)
-        {
-          File f = new File(filename);
-
-          if (f.exists())
-          {
-
-            // If any requested jarName exists, report on
-            //  the details of that .jar file
-            try
-            {
-              Hashtable h = new Hashtable(2);
-              // Note "-" char is looked for in appendFoundJars
-              h.put(jars[i] + "-path", f.getAbsolutePath());
-
-              // We won't bother reporting on the xalan.jar apparent version
-              // since this requires knowing the jar size of the xalan.jar
-              // before we build it.
-              // For other jars, eg. xml-apis.jar and xercesImpl.jar, we
-              // report the apparent version of the file we've found
-              if (!("xalan.jar".equalsIgnoreCase(jars[i]))) {
-                h.put(jars[i] + "-apparent.version",
-                    getApparentVersion(jars[i], f.length()));
-              }
-              v.addElement(h);
-            }
-            catch (Exception e)
-            {
-
-              /* no-op, don't add it  */
-            }
-          }
-          else
-          {
-            Hashtable h = new Hashtable(2);
-            // Note "-" char is looked for in appendFoundJars
-            h.put(jars[i] + "-path", WARNING + " Classpath entry: "
-                  + filename + " does not exist");
-            h.put(jars[i] + "-apparent.version", CLASS_NOTPRESENT);
-            v.addElement(h);
-          }
-        }
-      }
-    }
-
-    return v;
-  }
-
-  /**
-   * Cheap-o method to determine the product version of a .jar.
-   *
-   * Currently does a lookup into a local table of some recent
-   * shipped Xalan builds to determine where the .jar probably
-   * came from.  Note that if you recompile Xalan or Xerces
-   * yourself this will likely report a potential error, since
-   * we can't certify builds other than the ones we ship.
-   * Only reports against selected posted Xalan-J builds.
-   *
-   * //@todo actually look up version info in manifests
-   *
-   * @param jarName base filename of the .jarfile
-   * @param jarSize size of the .jarfile
-   *
-   * @return String describing where the .jar file probably
-   * came from
-   */
-  protected String getApparentVersion(String jarName, long jarSize)
-  {
-    // If we found a matching size and it's for our
-    //  jar, then return it's description
-    // Lookup in static jarVersions Hashtable
-    String foundSize = (String) jarVersions.get(new Long(jarSize));
-
-    if ((null != foundSize) && (foundSize.startsWith(jarName)))
-    {
-      return foundSize;
-    }
-    else
-    {
-      if ("xerces.jar".equalsIgnoreCase(jarName)
-              || "xercesImpl.jar".equalsIgnoreCase(jarName))
-//              || "xalan.jar".equalsIgnoreCase(jarName))
-      {
-
-        // For xalan.jar and xerces.jar/xercesImpl.jar, which we ship together:
-        // The jar is not from a shipped copy of xalan-j, so
-        //  it's up to the user to ensure that it's compatible
-        return jarName + " " + WARNING + CLASS_PRESENT;
-      }
-      else
-      {
-
-        // Otherwise, it's just a jar we don't have the version info calculated for
-        return jarName + " " + CLASS_PRESENT;
-      }
-    }
-  }
-
-  /**
-   * Report version information about JAXP interfaces.
-   *
-   * Currently distinguishes between JAXP 1.0.1 and JAXP 1.1,
-   * and not found; only tests the interfaces, and does not
-   * check for reference implementation versions.
-   *
-   * @param h Hashtable to put information in
-   */
-  protected void checkJAXPVersion(Hashtable h)
-  {
-
-    if (null == h)
-      h = new Hashtable();
-
-    Class clazz = null;
-
-    try
-    {
-      final String JAXP1_CLASS = "javax.xml.stream.XMLStreamConstants";
-
-      clazz = ObjectFactory.findProviderClass(JAXP1_CLASS, true);
-
-      // If we succeeded, we have JAXP 1.4 available
-      h.put(VERSION + "JAXP", "1.4");
-    }
-    catch (Exception e)
-    {
-        h.put(ERROR + VERSION + "JAXP", "1.3");
-        h.put(ERROR, ERROR_FOUND);
-      }
-      }
-
-  /**
-   * Report product version information from Xalan-J.
-   *
-   * Looks for version info in xalan.jar from Xalan-J products.
-   *
-   * @param h Hashtable to put information in
-   */
-  protected void checkProcessorVersion(Hashtable h)
-  {
-
-    if (null == h)
-      h = new Hashtable();
-
-    try
-    {
-      final String XALAN1_VERSION_CLASS =
-        "com.sun.org.apache.xalan.internal.xslt.XSLProcessorVersion";
-
-      Class clazz = ObjectFactory.findProviderClass(XALAN1_VERSION_CLASS, true);
-
-      // Found Xalan-J 1.x, grab it's version fields
-      StringBuffer buf = new StringBuffer();
-      Field f = clazz.getField("PRODUCT");
-
-      buf.append(f.get(null));
-      buf.append(';');
-
-      f = clazz.getField("LANGUAGE");
-
-      buf.append(f.get(null));
-      buf.append(';');
-
-      f = clazz.getField("S_VERSION");
-
-      buf.append(f.get(null));
-      buf.append(';');
-      h.put(VERSION + "xalan1", buf.toString());
-    }
-    catch (Exception e1)
-    {
-      h.put(VERSION + "xalan1", CLASS_NOTPRESENT);
-    }
-
-    try
-    {
-      // NOTE: This is the old Xalan 2.0, 2.1, 2.2 version class,
-      //    is being replaced by class below
-      final String XALAN2_VERSION_CLASS =
-        "com.sun.org.apache.xalan.internal.processor.XSLProcessorVersion";
-
-      Class clazz = ObjectFactory.findProviderClass(XALAN2_VERSION_CLASS, true);
-
-      // Found Xalan-J 2.x, grab it's version fields
-      StringBuffer buf = new StringBuffer();
-      Field f = clazz.getField("S_VERSION");
-      buf.append(f.get(null));
-
-      h.put(VERSION + "xalan2x", buf.toString());
-    }
-    catch (Exception e2)
-    {
-      h.put(VERSION + "xalan2x", CLASS_NOTPRESENT);
-    }
-    try
-    {
-      // NOTE: This is the new Xalan 2.2+ version class
-      final String XALAN2_2_VERSION_CLASS =
-        "com.sun.org.apache.xalan.internal.Version";
-      final String XALAN2_2_VERSION_METHOD = "getVersion";
-      final Class noArgs[] = new Class[0];
-
-      Class clazz = ObjectFactory.findProviderClass(XALAN2_2_VERSION_CLASS, true);
-
-      Method method = clazz.getMethod(XALAN2_2_VERSION_METHOD, noArgs);
-      Object returnValue = method.invoke(null, new Object[0]);
-
-      h.put(VERSION + "xalan2_2", (String)returnValue);
-    }
-    catch (Exception e2)
-    {
-      h.put(VERSION + "xalan2_2", CLASS_NOTPRESENT);
-    }
-  }
-
-  /**
-   * Report product version information from common parsers.
-   *
-   * Looks for version info in xerces.jar/xercesImpl.jar/crimson.jar.
-   *
-   * //@todo actually look up version info in crimson manifest
-   *
-   * @param h Hashtable to put information in
-   */
-  protected void checkParserVersion(Hashtable h)
-  {
-
-    if (null == h)
-      h = new Hashtable();
-
-    try
-    {
-      final String XERCES1_VERSION_CLASS = "com.sun.org.apache.xerces.internal.framework.Version";
-
-      Class clazz = ObjectFactory.findProviderClass(XERCES1_VERSION_CLASS, true);
-
-      // Found Xerces-J 1.x, grab it's version fields
-      Field f = clazz.getField("fVersion");
-      String parserVersion = (String) f.get(null);
-
-      h.put(VERSION + "xerces1", parserVersion);
-    }
-    catch (Exception e)
-    {
-      h.put(VERSION + "xerces1", CLASS_NOTPRESENT);
-    }
-
-    // Look for xerces1 and xerces2 parsers separately
-    try
-    {
-      final String XERCES2_VERSION_CLASS = "com.sun.org.apache.xerces.internal.impl.Version";
-
-      Class clazz = ObjectFactory.findProviderClass(XERCES2_VERSION_CLASS, true);
-
-      // Found Xerces-J 2.x, grab it's version fields
-      Field f = clazz.getField("fVersion");
-      String parserVersion = (String) f.get(null);
-
-      h.put(VERSION + "xerces2", parserVersion);
-    }
-    catch (Exception e)
-    {
-      h.put(VERSION + "xerces2", CLASS_NOTPRESENT);
-    }
-
-    try
-    {
-      final String CRIMSON_CLASS = "org.apache.crimson.parser.Parser2";
-
-      Class clazz = ObjectFactory.findProviderClass(CRIMSON_CLASS, true);
-
-      //@todo determine specific crimson version
-      h.put(VERSION + "crimson", CLASS_PRESENT);
-    }
-    catch (Exception e)
-    {
-      h.put(VERSION + "crimson", CLASS_NOTPRESENT);
-    }
-  }
-
-  /**
-   * Report product version information from Ant.
-   *
-   * @param h Hashtable to put information in
-   */
-  protected void checkAntVersion(Hashtable h)
-  {
-
-    if (null == h)
-      h = new Hashtable();
-
-    try
-    {
-      final String ANT_VERSION_CLASS = "org.apache.tools.ant.Main";
-      final String ANT_VERSION_METHOD = "getAntVersion"; // noArgs
-      final Class noArgs[] = new Class[0];
-
-      Class clazz = ObjectFactory.findProviderClass(ANT_VERSION_CLASS, true);
-
-      Method method = clazz.getMethod(ANT_VERSION_METHOD, noArgs);
-      Object returnValue = method.invoke(null, new Object[0]);
-
-      h.put(VERSION + "ant", (String)returnValue);
-    }
-    catch (Exception e)
-    {
-      h.put(VERSION + "ant", CLASS_NOTPRESENT);
-    }
-  }
-
-  /**
-   * Report version info from DOM interfaces.
-   *
-   * @param h Hashtable to put information in
-   */
-  protected boolean checkDOML3(Hashtable h)
-  {
-
-    if (null == h)
-      h = new Hashtable();
-
-    final String DOM_CLASS = "org.w3c.dom.Document";
-    final String DOM_LEVEL3_METHOD = "getDoctype";  // no parameter
-
-    try
-    {
-      Class clazz = ObjectFactory.findProviderClass(DOM_CLASS, true);
-
-      Method method = clazz.getMethod(DOM_LEVEL3_METHOD, (Class<?>[])null);
-
-      // If we succeeded, we have loaded interfaces from a
-      //  level 3 DOM somewhere
-      h.put(VERSION + "DOM", "3.0");
-      return true;
-    }
-    catch (Exception e)
-    {
-      return false;
-    }
-  }
-
-  /**
-   * Report version info from DOM interfaces.
-   *
-   * Currently distinguishes between pre-DOM level 2, the DOM
-   * level 2 working draft, the DOM level 2 final draft,
-   * and not found.
-   *
-   * @param h Hashtable to put information in
-   */
-  protected void checkDOMVersion(Hashtable h)
-  {
-
-    if (null == h)
-      h = new Hashtable();
-
-    final String DOM_LEVEL2_CLASS = "org.w3c.dom.Document";
-    final String DOM_LEVEL2_METHOD = "createElementNS";  // String, String
-    final String DOM_LEVEL3_METHOD = "getDoctype";  // no parameter
-    final String DOM_LEVEL2WD_CLASS = "org.w3c.dom.Node";
-    final String DOM_LEVEL2WD_METHOD = "supported";  // String, String
-    final String DOM_LEVEL2FD_CLASS = "org.w3c.dom.Node";
-    final String DOM_LEVEL2FD_METHOD = "isSupported";  // String, String
-    final Class twoStringArgs[] = { java.lang.String.class,
-                                    java.lang.String.class };
-
-    try
-    {
-      Class clazz = ObjectFactory.findProviderClass(DOM_LEVEL2_CLASS, true);
-
-      Method method = clazz.getMethod(DOM_LEVEL2_METHOD, twoStringArgs);
-
-      // If we succeeded, we have loaded interfaces from a
-      //  level 2 DOM somewhere
-      h.put(VERSION + "DOM", "2.0");
-
-      try
-      {
-        // Check for the working draft version, which is
-        //  commonly found, but won't work anymore
-        clazz = ObjectFactory.findProviderClass(DOM_LEVEL2WD_CLASS, true);
-
-        method = clazz.getMethod(DOM_LEVEL2WD_METHOD, twoStringArgs);
-
-        h.put(ERROR + VERSION + "DOM.draftlevel", "2.0wd");
-        h.put(ERROR, ERROR_FOUND);
-      }
-      catch (Exception e2)
-      {
-        try
-        {
-          // Check for the final draft version as well
-          clazz = ObjectFactory.findProviderClass(DOM_LEVEL2FD_CLASS, true);
-
-          method = clazz.getMethod(DOM_LEVEL2FD_METHOD, twoStringArgs);
-
-          h.put(VERSION + "DOM.draftlevel", "2.0fd");
-        }
-        catch (Exception e3)
-        {
-          h.put(ERROR + VERSION + "DOM.draftlevel", "2.0unknown");
-          h.put(ERROR, ERROR_FOUND);
-        }
-      }
-    }
-    catch (Exception e)
-    {
-      h.put(ERROR + VERSION + "DOM",
-            "ERROR attempting to load DOM level 2 class: " + e.toString());
-      h.put(ERROR, ERROR_FOUND);
-    }
-
-    //@todo load an actual DOM implmementation and query it as well
-    //@todo load an actual DOM implmementation and check if
-    //  isNamespaceAware() == true, which is needed to parse
-    //  xsl stylesheet files into a DOM
-  }
-
-  /**
-   * Report version info from SAX interfaces.
-   *
-   * Currently distinguishes between SAX 2, SAX 2.0beta2,
-   * SAX1, and not found.
-   *
-   * @param h Hashtable to put information in
-   */
-  protected void checkSAXVersion(Hashtable h)
-  {
-
-    if (null == h)
-      h = new Hashtable();
-
-    final String SAX_VERSION1_CLASS = "org.xml.sax.Parser";
-    final String SAX_VERSION1_METHOD = "parse";  // String
-    final String SAX_VERSION2_CLASS = "org.xml.sax.XMLReader";
-    final String SAX_VERSION2_METHOD = "parse";  // String
-    final String SAX_VERSION2BETA_CLASSNF = "org.xml.sax.helpers.AttributesImpl";
-    final String SAX_VERSION2BETA_METHODNF = "setAttributes";  // Attributes
-    final Class oneStringArg[] = { java.lang.String.class };
-    // Note this introduces a minor compile dependency on SAX...
-    final Class attributesArg[] = { org.xml.sax.Attributes.class };
-
-    try
-    {
-      // This method was only added in the final SAX 2.0 release;
-      //  see changes.html "Changes from SAX 2.0beta2 to SAX 2.0prerelease"
-      Class clazz = ObjectFactory.findProviderClass(SAX_VERSION2BETA_CLASSNF, true);
-
-      Method method = clazz.getMethod(SAX_VERSION2BETA_METHODNF, attributesArg);
-
-      // If we succeeded, we have loaded interfaces from a
-      //  real, final SAX version 2.0 somewhere
-      h.put(VERSION + "SAX", "2.0");
-    }
-    catch (Exception e)
-    {
-      // If we didn't find the SAX 2.0 class, look for a 2.0beta2
-      h.put(ERROR + VERSION + "SAX",
-            "ERROR attempting to load SAX version 2 class: " + e.toString());
-      h.put(ERROR, ERROR_FOUND);
-
-      try
-      {
-        Class clazz = ObjectFactory.findProviderClass(SAX_VERSION2_CLASS, true);
-
-        Method method = clazz.getMethod(SAX_VERSION2_METHOD, oneStringArg);
-
-        // If we succeeded, we have loaded interfaces from a
-        //  SAX version 2.0beta2 or earlier; these might work but
-        //  you should really have the final SAX 2.0
-        h.put(VERSION + "SAX-backlevel", "2.0beta2-or-earlier");
-      }
-      catch (Exception e2)
-      {
-        // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one
-        h.put(ERROR + VERSION + "SAX",
-              "ERROR attempting to load SAX version 2 class: " + e.toString());
-        h.put(ERROR, ERROR_FOUND);
-
-        try
-        {
-          Class clazz = ObjectFactory.findProviderClass(SAX_VERSION1_CLASS, true);
-
-          Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg);
-
-          // If we succeeded, we have loaded interfaces from a
-          //  SAX version 1.0 somewhere; which won't work very
-          //  well for JAXP 1.1 or beyond!
-          h.put(VERSION + "SAX-backlevel", "1.0");
-        }
-        catch (Exception e3)
-        {
-          // If we didn't find the SAX 2.0 class, look for a 1.0 one
-          // Note that either 1.0 or no SAX are both errors
-          h.put(ERROR + VERSION + "SAX-backlevel",
-                "ERROR attempting to load SAX version 1 class: " + e3.toString());
-
-        }
-      }
-    }
-  }
-
-  /**
-   * Manual table of known .jar sizes.
-   * Only includes shipped versions of certain projects.
-   * key=jarsize, value=jarname ' from ' distro name
-   * Note assumption: two jars cannot have the same size!
-   *
-   * @see #getApparentVersion(String, long)
-   */
-  private static Hashtable jarVersions = new Hashtable();
-
-  /**
-   * Static initializer for jarVersions table.
-   * Doing this just once saves time and space.
-   *
-   * @see #getApparentVersion(String, long)
-   */
-  static
-  {
-    // Note: hackish Hashtable, this could use improvement
-    jarVersions.put(new Long(857192), "xalan.jar from xalan-j_1_1");
-    jarVersions.put(new Long(440237), "xalan.jar from xalan-j_1_2");
-    jarVersions.put(new Long(436094), "xalan.jar from xalan-j_1_2_1");
-    jarVersions.put(new Long(426249), "xalan.jar from xalan-j_1_2_2");
-    jarVersions.put(new Long(702536), "xalan.jar from xalan-j_2_0_0");
-    jarVersions.put(new Long(720930), "xalan.jar from xalan-j_2_0_1");
-    jarVersions.put(new Long(732330), "xalan.jar from xalan-j_2_1_0");
-    jarVersions.put(new Long(872241), "xalan.jar from xalan-j_2_2_D10");
-    jarVersions.put(new Long(882739), "xalan.jar from xalan-j_2_2_D11");
-    jarVersions.put(new Long(923866), "xalan.jar from xalan-j_2_2_0");
-    jarVersions.put(new Long(905872), "xalan.jar from xalan-j_2_3_D1");
-    jarVersions.put(new Long(906122), "xalan.jar from xalan-j_2_3_0");
-    jarVersions.put(new Long(906248), "xalan.jar from xalan-j_2_3_1");
-    jarVersions.put(new Long(983377), "xalan.jar from xalan-j_2_4_D1");
-    jarVersions.put(new Long(997276), "xalan.jar from xalan-j_2_4_0");
-    jarVersions.put(new Long(1031036), "xalan.jar from xalan-j_2_4_1");
-    // Stop recording xalan.jar sizes as of Xalan Java 2.5.0
-
-    jarVersions.put(new Long(596540), "xsltc.jar from xalan-j_2_2_0");
-    jarVersions.put(new Long(590247), "xsltc.jar from xalan-j_2_3_D1");
-    jarVersions.put(new Long(589914), "xsltc.jar from xalan-j_2_3_0");
-    jarVersions.put(new Long(589915), "xsltc.jar from xalan-j_2_3_1");
-    jarVersions.put(new Long(1306667), "xsltc.jar from xalan-j_2_4_D1");
-    jarVersions.put(new Long(1328227), "xsltc.jar from xalan-j_2_4_0");
-    jarVersions.put(new Long(1344009), "xsltc.jar from xalan-j_2_4_1");
-    jarVersions.put(new Long(1348361), "xsltc.jar from xalan-j_2_5_D1");
-    // Stop recording xsltc.jar sizes as of Xalan Java 2.5.0
-
-    jarVersions.put(new Long(1268634), "xsltc.jar-bundled from xalan-j_2_3_0");
-
-    jarVersions.put(new Long(100196), "xml-apis.jar from xalan-j_2_2_0 or xalan-j_2_3_D1");
-    jarVersions.put(new Long(108484), "xml-apis.jar from xalan-j_2_3_0, or xalan-j_2_3_1 from xml-commons-1.0.b2");
-    jarVersions.put(new Long(109049), "xml-apis.jar from xalan-j_2_4_0 from xml-commons RIVERCOURT1 branch");
-    jarVersions.put(new Long(113749), "xml-apis.jar from xalan-j_2_4_1 from factoryfinder-build of xml-commons RIVERCOURT1");
-    jarVersions.put(new Long(124704), "xml-apis.jar from tck-jaxp-1_2_0 branch of xml-commons");
-    jarVersions.put(new Long(124724), "xml-apis.jar from tck-jaxp-1_2_0 branch of xml-commons, tag: xml-commons-external_1_2_01");
-    jarVersions.put(new Long(194205), "xml-apis.jar from head branch of xml-commons, tag: xml-commons-external_1_3_02");
-
-    // If the below were more common I would update it to report
-    //  errors better; but this is so old hardly anyone has it
-    jarVersions.put(new Long(424490), "xalan.jar from Xerces Tools releases - ERROR:DO NOT USE!");
-
-    jarVersions.put(new Long(1591855), "xerces.jar from xalan-j_1_1 from xerces-1...");
-    jarVersions.put(new Long(1498679), "xerces.jar from xalan-j_1_2 from xerces-1_2_0.bin");
-    jarVersions.put(new Long(1484896), "xerces.jar from xalan-j_1_2_1 from xerces-1_2_1.bin");
-    jarVersions.put(new Long(804460),  "xerces.jar from xalan-j_1_2_2 from xerces-1_2_2.bin");
-    jarVersions.put(new Long(1499244), "xerces.jar from xalan-j_2_0_0 from xerces-1_2_3.bin");
-    jarVersions.put(new Long(1605266), "xerces.jar from xalan-j_2_0_1 from xerces-1_3_0.bin");
-    jarVersions.put(new Long(904030), "xerces.jar from xalan-j_2_1_0 from xerces-1_4.bin");
-    jarVersions.put(new Long(904030), "xerces.jar from xerces-1_4_0.bin");
-    jarVersions.put(new Long(1802885), "xerces.jar from xerces-1_4_2.bin");
-    jarVersions.put(new Long(1734594), "xerces.jar from Xerces-J-bin.2.0.0.beta3");
-    jarVersions.put(new Long(1808883), "xerces.jar from xalan-j_2_2_D10,D11,D12 or xerces-1_4_3.bin");
-    jarVersions.put(new Long(1812019), "xerces.jar from xalan-j_2_2_0");
-    jarVersions.put(new Long(1720292), "xercesImpl.jar from xalan-j_2_3_D1");
-    jarVersions.put(new Long(1730053), "xercesImpl.jar from xalan-j_2_3_0 or xalan-j_2_3_1 from xerces-2_0_0");
-    jarVersions.put(new Long(1728861), "xercesImpl.jar from xalan-j_2_4_D1 from xerces-2_0_1");
-    jarVersions.put(new Long(972027), "xercesImpl.jar from xalan-j_2_4_0 from xerces-2_1");
-    jarVersions.put(new Long(831587), "xercesImpl.jar from xalan-j_2_4_1 from xerces-2_2");
-    jarVersions.put(new Long(891817), "xercesImpl.jar from xalan-j_2_5_D1 from xerces-2_3");
-    jarVersions.put(new Long(895924), "xercesImpl.jar from xerces-2_4");
-    jarVersions.put(new Long(1010806), "xercesImpl.jar from Xerces-J-bin.2.6.2");
-    jarVersions.put(new Long(1203860), "xercesImpl.jar from Xerces-J-bin.2.7.1");
-
-    jarVersions.put(new Long(37485), "xalanj1compat.jar from xalan-j_2_0_0");
-    jarVersions.put(new Long(38100), "xalanj1compat.jar from xalan-j_2_0_1");
-
-    jarVersions.put(new Long(18779), "xalanservlet.jar from xalan-j_2_0_0");
-    jarVersions.put(new Long(21453), "xalanservlet.jar from xalan-j_2_0_1");
-    jarVersions.put(new Long(24826), "xalanservlet.jar from xalan-j_2_3_1 or xalan-j_2_4_1");
-    jarVersions.put(new Long(24831), "xalanservlet.jar from xalan-j_2_4_1");
-    // Stop recording xalanservlet.jar sizes as of Xalan Java 2.5.0; now a .war file
-
-    // For those who've downloaded JAXP from sun
-    jarVersions.put(new Long(5618), "jaxp.jar from jaxp1.0.1");
-    jarVersions.put(new Long(136133), "parser.jar from jaxp1.0.1");
-    jarVersions.put(new Long(28404), "jaxp.jar from jaxp-1.1");
-    jarVersions.put(new Long(187162), "crimson.jar from jaxp-1.1");
-    jarVersions.put(new Long(801714), "xalan.jar from jaxp-1.1");
-    jarVersions.put(new Long(196399), "crimson.jar from crimson-1.1.1");
-    jarVersions.put(new Long(33323), "jaxp.jar from crimson-1.1.1 or jakarta-ant-1.4.1b1");
-    jarVersions.put(new Long(152717), "crimson.jar from crimson-1.1.2beta2");
-    jarVersions.put(new Long(88143), "xml-apis.jar from crimson-1.1.2beta2");
-    jarVersions.put(new Long(206384), "crimson.jar from crimson-1.1.3 or jakarta-ant-1.4.1b1");
-
-    // jakarta-ant: since many people use ant these days
-    jarVersions.put(new Long(136198), "parser.jar from jakarta-ant-1.3 or 1.2");
-    jarVersions.put(new Long(5537), "jaxp.jar from jakarta-ant-1.3 or 1.2");
-  }
-
-  /** Simple PrintWriter we send output to; defaults to System.out.  */
-  protected PrintWriter outWriter = new PrintWriter(System.out, true);
-
-  /**
-   * Bottleneck output: calls outWriter.println(s).
-   * @param s String to print
-   */
-  protected void logMsg(String s)
-  {
-    outWriter.println(s);
-  }
-}
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/Hashtree2Node.java	Mon Aug 03 05:05:40 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: Hashtree2Node.java,v 1.2.4.1 2005/09/15 08:15:45 suresh_emailid Exp $
- */
-
-package com.sun.org.apache.xml.internal.utils;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Simple static utility to convert Hashtable to a Node.
- *
- * Please maintain JDK 1.1.x compatibility; no Collections!
- *
- * @see com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck
- * @see com.sun.org.apache.xalan.internal.lib.Extensions
- * @author shane_curcuru@us.ibm.com
- * @xsl.usage general
- */
-public abstract class Hashtree2Node
-{
-
-    /**
-     * Convert a Hashtable into a Node tree.
-     *
-     * <p>The hash may have either Hashtables as values (in which
-     * case we recurse) or other values, in which case we print them
-     * as &lt;item> elements, with a 'key' attribute with the value
-     * of the key, and the element contents as the value.</p>
-     *
-     * <p>If args are null we simply return without doing anything.
-     * If we encounter an error, we will attempt to add an 'ERROR'
-     * Element with exception info; if that doesn't work we simply
-     * return without doing anything else byt printStackTrace().</p>
-     *
-     * @param hash to get info from (may have sub-hashtables)
-     * @param name to use as parent element for appended node
-     * futurework could have namespace and prefix as well
-     * @param container Node to append our report to
-     * @param factory Document providing createElement, etc. services
-     */
-    public static void appendHashToNode(Hashtable hash, String name,
-            Node container, Document factory)
-    {
-        // Required arguments must not be null
-        if ((null == container) || (null == factory) || (null == hash))
-        {
-            return;
-        }
-
-        // name we will provide a default value for
-        String elemName = null;
-        if ((null == name) || ("".equals(name)))
-            elemName = "appendHashToNode";
-        else
-            elemName = name;
-
-        try
-        {
-            Element hashNode = factory.createElement(elemName);
-            container.appendChild(hashNode);
-
-            Enumeration keys = hash.keys();
-            Vector v = new Vector();
-
-            while (keys.hasMoreElements())
-            {
-                Object key = keys.nextElement();
-                String keyStr = key.toString();
-                Object item = hash.get(key);
-
-                if (item instanceof Hashtable)
-                {
-                    // Ensure a pre-order traversal; add this hashes
-                    //  items before recursing to child hashes
-                    // Save name and hash in two steps
-                    v.addElement(keyStr);
-                    v.addElement((Hashtable) item);
-                }
-                else
-                {
-                    try
-                    {
-                        // Add item to node
-                        Element node = factory.createElement("item");
-                        node.setAttribute("key", keyStr);
-                        node.appendChild(factory.createTextNode((String)item));
-                        hashNode.appendChild(node);
-                    }
-                    catch (Exception e)
-                    {
-                        Element node = factory.createElement("item");
-                        node.setAttribute("key", keyStr);
-                        node.appendChild(factory.createTextNode("ERROR: Reading " + key + " threw: " + e.toString()));
-                        hashNode.appendChild(node);
-                    }
-                }
-            }
-
-            // Now go back and do the saved hashes
-            keys = v.elements();
-            while (keys.hasMoreElements())
-            {
-                // Retrieve name and hash in two steps
-                String n = (String) keys.nextElement();
-                Hashtable h = (Hashtable) keys.nextElement();
-
-                appendHashToNode(h, n, hashNode, factory);
-            }
-        }
-        catch (Exception e2)
-        {
-            // Ooops, just bail (suggestions for a safe thing
-            //  to do in this case appreciated)
-            e2.printStackTrace();
-        }
-    }
-}
--- a/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/common/bug6979306/Bug6979306Test.java	Mon Aug 03 05:05:40 2015 -0400
+++ b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/common/bug6979306/Bug6979306Test.java	Tue Aug 04 13:41:09 2015 +0200
@@ -25,21 +25,17 @@
  * @test
  * @modules java.xml/com.sun.org.apache.xerces.internal.impl
  *          java.xml/com.sun.org.apache.xalan.internal
- *          java.xml/com.sun.org.apache.xalan.internal.xslt
  * @bug 6979306
  * @summary Test JAXP component version.
  */
 
 import org.testng.annotations.Test;
 
-import com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck;
-
 public class Bug6979306Test {
 
     @Test
     public void test() {
         String[] input = {};
-        EnvironmentCheck.main(input);
         com.sun.org.apache.xerces.internal.impl.Version.main(input);
         com.sun.org.apache.xalan.internal.Version._main(input);
     }
--- a/jaxws/.hgtags	Mon Aug 03 05:05:40 2015 -0400
+++ b/jaxws/.hgtags	Tue Aug 04 13:41:09 2015 +0200
@@ -320,3 +320,4 @@
 1d87054e2d2f405c114f0061b97cbf8214bddf0a jdk9-b72
 285939df908721cdb2b18a119638114306b8dca7 jdk9-b73
 6232472e51418757f7b2bf05332678ea78096e6b jdk9-b74
+086bcd5e4a531a350c84668c8dc019461588ee3d jdk9-b75
--- a/jdk/.hgtags	Mon Aug 03 05:05:40 2015 -0400
+++ b/jdk/.hgtags	Tue Aug 04 13:41:09 2015 +0200
@@ -317,3 +317,4 @@
 f376824d4940f45719d91838f3f6249f873440db jdk9-b72
 1c8bca2ebba13948199de33a1b71e2d6f1c7a8a6 jdk9-b73
 6dd82d2e4a104f4d204b2890f33ef11ec3e3f8d0 jdk9-b74
+4dd09cb5f7c2a2a23a9958ea7a602dd74d5709b2 jdk9-b75
--- a/jdk/make/data/charsetmapping/charsets	Mon Aug 03 05:05:40 2015 -0400
+++ b/jdk/make/data/charsetmapping/charsets	Tue Aug 04 13:41:09 2015 +0200
@@ -547,7 +547,7 @@
 
 charset GB18030 GB18030
     package sun.nio.cs.ext
-    type    source
+    type    template
     alias   gb18030-2000
 
 charset GB2312 EUC_CN
--- a/jdk/make/data/charsetmapping/stdcs-linux	Mon Aug 03 05:05:40 2015 -0400
+++ b/jdk/make/data/charsetmapping/stdcs-linux	Tue Aug 04 13:41:09 2015 +0200
@@ -9,9 +9,16 @@
 EUC_JP
 EUC_JP_LINUX
 EUC_JP_Open
+EUC_TW
 GBK
+GB18030
+ISO_8859_11
+ISO_8859_3
+ISO_8859_6
+ISO_8859_8
 Johab
 PCK
+TIS_620
 JIS_X_0201
 JIS_X_0208
 JIS_X_0212
--- a/jdk/make/data/charsetmapping/stdcs-solaris	Mon Aug 03 05:05:40 2015 -0400
+++ b/jdk/make/data/charsetmapping/stdcs-solaris	Tue Aug 04 13:41:09 2015 +0200
@@ -11,12 +11,14 @@
 EUC_JP_Open
 EUC_TW
 GBK
+GB18030
 ISO_8859_11
 ISO_8859_3
 ISO_8859_6
 ISO_8859_8
 Johab
 PCK
+TIS_620
 JIS_X_0201
 JIS_X_0208
 JIS_X_0212
--- a/jdk/make/data/currency/CurrencyData.properties	Mon Aug 03 05:05:40 2015 -0400
+++ b/jdk/make/data/currency/CurrencyData.properties	Tue Aug 04 13:41:09 2015 +0200
@@ -31,7 +31,7 @@
 # Version of the currency code information in this class.
 # It is a serial number that accompanies with each amendment.
 
-dataVersion=159
+dataVersion=160
 
 # List of all valid ISO 4217 currency codes.
 # To ensure compatibility, do not remove codes.
@@ -109,7 +109,7 @@
 AT=EUR
 # AZERBAIJAN
 AZ=AZN
-# BAHAMAS
+# BAHAMAS (THE)
 BS=BSD
 # BAHRAIN
 BH=BHD
@@ -131,7 +131,7 @@
 BQ=USD
 # BHUTAN
 BT=BTN
-# BOLIVIA
+# BOLIVIA (PLURINATIONAL STATE OF)
 BO=BOB
 # BOSNIA AND HERZEGOVINA
 BA=BAM
@@ -141,7 +141,7 @@
 BV=NOK
 # BRAZIL
 BR=BRL
-# BRITISH INDIAN OCEAN TERRITORY
+# BRITISH INDIAN OCEAN TERRITORY (THE)
 IO=USD
 # BRUNEI DARUSSALAM
 BN=BND
@@ -159,9 +159,9 @@
 CA=CAD
 # CAPE VERDE
 CV=CVE
-# CAYMAN ISLANDS
+# CAYMAN ISLANDS (THE)
 KY=KYD
-# CENTRAL AFRICAN REPUBLIC
+# CENTRAL AFRICAN REPUBLIC (THE)
 CF=XAF
 # CHAD
 TD=XAF
@@ -171,17 +171,17 @@
 CN=CNY
 # CHRISTMAS ISLAND
 CX=AUD
-# COCOS (KEELING) ISLANDS
+# COCOS (KEELING) ISLANDS (THE)
 CC=AUD
 # COLOMBIA
 CO=COP
-# COMOROS
+# COMOROS (THE)
 KM=KMF
-# CONGO
+# CONGO (THE)
 CG=XAF
-# CONGO, THE DEMOCRATIC REPUBLIC OF THE
+# CONGO (THE DEMOCRATIC REPUBLIC OF THE)
 CD=CDF
-# COOK ISLANDS
+# COOK ISLANDS (THE)
 CK=NZD
 # COSTA RICA
 CR=CRC
@@ -195,7 +195,7 @@
 CW=ANG
 # CYPRUS
 CY=EUR
-# CZECH REPUBLIC
+# CZECH REPUBLIC (THE)
 CZ=CZK
 # DENMARK
 DK=DKK
@@ -203,7 +203,7 @@
 DJ=DJF
 # DOMINICA
 DM=XCD
-# DOMINICAN REPUBLIC
+# DOMINICAN REPUBLIC (THE)
 DO=DOP
 # ECUADOR
 EC=USD
@@ -220,9 +220,9 @@
 EE=EUR
 # ETHIOPIA
 ET=ETB
-# FALKLAND ISLANDS (MALVINAS)
+# FALKLAND ISLANDS (THE) [MALVINAS]
 FK=FKP
-# FAROE ISLANDS
+# FAROE ISLANDS (THE)
 FO=DKK
 # FIJI
 FJ=FJD
@@ -234,11 +234,11 @@
 GF=EUR
 # FRENCH POLYNESIA
 PF=XPF
-# FRENCH SOUTHERN TERRITORIES
+# FRENCH SOUTHERN TERRITORIES (THE)
 TF=EUR
 # GABON
 GA=XAF
-# GAMBIA
+# GAMBIA (THE)
 GM=GMD
 # GEORGIA
 GE=GEL
@@ -272,7 +272,7 @@
 HT=HTG
 # HEARD ISLAND AND MCDONALD ISLANDS
 HM=AUD
-# HOLY SEE (VATICAN CITY STATE)
+# HOLY SEE (THE)
 VA=EUR
 # HONDURAS
 HN=HNL
@@ -286,7 +286,7 @@
 IN=INR
 # INDONESIA
 ID=IDR
-# IRAN, ISLAMIC REPUBLIC OF
+# IRAN (ISLAMIC REPUBLIC OF)
 IR=IRR
 # IRAQ
 IQ=IQD
@@ -312,15 +312,15 @@
 KE=KES
 # KIRIBATI
 KI=AUD
-# KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF
+# KOREA (THE DEMOCRATIC PEOPLE'S REPUBLIC OF)
 KP=KPW
-# KOREA, REPUBLIC OF
+# KOREA (THE REPUBLIC OF)
 KR=KRW
 # KUWAIT
 KW=KWD
 # KYRGYZSTAN
 KG=KGS
-# LAO PEOPLE'S DEMOCRATIC REPUBLIC
+# LAO PEOPLE'S DEMOCRATIC REPUBLIC (THE)
 LA=LAK
 # LATVIA
 LV=LVL;2013-12-31-22-00-00;EUR
@@ -340,7 +340,7 @@
 LU=EUR
 # MACAU
 MO=MOP
-# MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF
+# MACEDONIA (THE FORMER YUGOSLAV REPUBLIC OF)
 MK=MKD
 # MADAGASCAR
 MG=MGA
@@ -354,7 +354,7 @@
 ML=XOF
 # MALTA
 MT=EUR
-# MARSHALL ISLANDS
+# MARSHALL ISLANDS (THE)
 MH=USD
 # MARTINIQUE
 MQ=EUR
@@ -366,9 +366,9 @@
 YT=EUR
 # MEXICO
 MX=MXN
-# MICRONESIA, FEDERATED STATES OF
+# MICRONESIA (FEDERATED STATES OF)
 FM=USD
-# MOLDOVA, REPUBLIC OF
+# MOLDOVA (THE REPUBLIC OF)
 MD=MDL
 # MONACO
 MC=EUR
@@ -390,7 +390,7 @@
 NR=AUD
 # NEPAL
 NP=NPR
-# NETHERLANDS
+# NETHERLANDS (THE)
 NL=EUR
 # NETHERLANDS ANTILLES
 AN=ANG
@@ -400,7 +400,7 @@
 NZ=NZD
 # NICARAGUA
 NI=NIO
-# NIGER
+# NIGER (THE)
 NE=XOF
 # NIGERIA
 NG=NGN
@@ -408,7 +408,7 @@
 NU=NZD
 # NORFOLK ISLAND
 NF=AUD
-# NORTHERN MARIANA ISLANDS
+# NORTHERN MARIANA ISLANDS (THE)
 MP=USD
 # NORWAY
 NO=NOK
@@ -428,7 +428,7 @@
 PY=PYG
 # PERU
 PE=PEN
-# PHILIPPINES
+# PHILIPPINES (THE)
 PH=PHP
 # PITCAIRN
 PN=NZD
@@ -444,7 +444,7 @@
 RE=EUR
 # ROMANIA
 RO=RON
-# RUSSIAN FEDERATION
+# RUSSIAN FEDERATION (THE)
 RU=RUB
 # RWANDA
 RW=RWF
@@ -500,7 +500,7 @@
 ES=EUR
 # SRI LANKA
 LK=LKR
-# SUDAN
+# SUDAN (THE)
 SD=SDG
 # SURINAME
 SR=SRD
@@ -516,7 +516,7 @@
 CH=CHF
 # SYRIAN ARAB REPUBLIC
 SY=SYP
-# TAIWAN
+# TAIWAN (PROVINCE OF CHINA)
 TW=TWD
 # TAJIKISTAN
 TJ=TJS
@@ -540,7 +540,7 @@
 TR=TRY
 # TURKMENISTAN
 TM=TMT
-# TURKS AND CAICOS ISLANDS
+# TURKS AND CAICOS ISLANDS (THE)
 TC=USD
 # TUVALU
 TV=AUD
@@ -548,13 +548,13 @@
 UG=UGX
 # UKRAINE
 UA=UAH
-# UNITED ARAB EMIRATES
+# UNITED ARAB EMIRATES (THE)
 AE=AED
-# UNITED KINGDOM
+# UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND (THE)
 GB=GBP
-# UNITED STATES
+# UNITED STATES OF AMERICA (THE)
 US=USD
-# UNITED STATES MINOR OUTLYING ISLANDS
+# UNITED STATES MINOR OUTLYING ISLANDS (THE)
 UM=USD
 # URUGUAY
 UY=UYU
@@ -562,7 +562,7 @@
 UZ=UZS
 # VANUATU
 VU=VUV
-# VENEZUELA
+# VENEZUELA (BOLIVARIAN REPUBLIC OF)
 VE=VEF
 # VIET NAM
 VN=VND
--- a/jdk/src/bsd/doc/man/appletviewer.1	Mon Aug 03 05:05:40 2015 -0400
+++ b/jdk/src/bsd/doc/man/appletviewer.1	Tue Aug 04 13:41:09 2015 +0200
@@ -1,26 +1,25 @@
 '\" t
-.\"  Copyright (c) 1995, 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.
-.\"
+.\" Copyright (c) 1995, 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.
+.\"
 .\"     Arch: generic
 .\"     Software: JDK 8
 .\"     Date: 21 November 2013
@@ -29,25 +28,25 @@
 .\"
 .if n .pl 99999
 .TH appletviewer 1 "21 November 2013" "JDK 8" "Basic Tools"
-.\" -----------------------------------------------------------------
-.\" * Define some portability stuff
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el       .ds Aq '
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
 
 .SH NAME    
 appletviewer \- Runs applets outside of a web browser\&.
@@ -84,7 +83,7 @@
 .br
 Passes the string \f3javaoption\fR as a single argument to the Java interpreter, which runs the Applet Viewer\&. The argument should not contain spaces\&. Multiple argument words must all begin with the prefix \f3-J\fR\&. This is useful for adjusting the compiler\&'s execution environment or memory usage\&.
 .PP
-.RE
-.br
-'pl 8.5i
-'bp
+.RE
+.br
+'pl 8.5i
+'bp
--- a/jdk/src/bsd/doc/man/idlj.1	Mon Aug 03 05:05:40 2015 -0400
+++ b/jdk/src/bsd/doc/man/idlj.1	Tue Aug 04 13:41:09 2015 +0200
@@ -1,26 +1,25 @@
 '\" t
-.\"  Copyright (c) 2001, 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.
-.\"
+.\" Copyright (c) 2001, 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.
+.\"
 .\"     Arch: generic
 .\"     Software: JDK 8
 .\"     Date: 21 November 2013
@@ -29,25 +28,25 @@
 .\"
 .if n .pl 99999
 .TH idlj 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools"
-.\" -----------------------------------------------------------------
-.\" * Define some portability stuff
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el       .ds Aq '
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
 
 .SH NAME    
 idlj \- Generates Java bindings for a specified Interface Definition Language (IDL) file\&.
@@ -562,7 +561,7 @@
 The \f3fixed\fR IDL type is not supported\&.
 .SH KNOWN\ PROBLEMS    
 No import is generated for global identifiers\&. If you call an unexported local \f3impl\fR object, then you do get an exception, but it seems to be due to a \f3NullPointerException\fR in the \f3ServerDelegate\fR DSI code\&.
-.RE
-.br
-'pl 8.5i
-'bp
+.RE
+.br
+'pl 8.5i
+'bp
--- a/jdk/src/bsd/doc/man/jar.1	Mon Aug 03 05:05:40 2015 -0400
+++ b/jdk/src/bsd/doc/man/jar.1	Tue Aug 04 13:41:09 2015 +0200
@@ -1,26 +1,25 @@
 '\" t
-.\"  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.
-.\"
+.\" 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.
+.\"
 .\"     Arch: generic
 .\"     Software: JDK 8
 .\"     Date: 21 November 2013
@@ -29,25 +28,25 @@
 .\"
 .if n .pl 99999
 .TH jar 1 "21 November 2013" "JDK 8" "Basic Tools"
-.\" -----------------------------------------------------------------
-.\" * Define some portability stuff
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el       .ds Aq '
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
 
 .SH NAME    
 jar \- Manipulates Java Archive (JAR) files\&.
@@ -479,7 +478,7 @@
 .TP 0.2i    
 \(bu
 The JAR section of The Java Tutorials at http://docs\&.oracle\&.com/javase/tutorial/deployment/jar/index\&.html
-.RE
-.br
-'pl 8.5i
-'bp
+.RE
+.br
+'pl 8.5i
+'bp
--- a/jdk/src/bsd/doc/man/jarsigner.1	Mon Aug 03 05:05:40 2015 -0400
+++ b/jdk/src/bsd/doc/man/jarsigner.1	Tue Aug 04 13:41:09 2015 +0200
@@ -1,26 +1,25 @@
 '\" t
-.\"  Copyright (c) 1998, 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.
-.\"
+.\" Copyright (c) 1998, 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.
+.\"
 .\"     Arch: generic
 .\"     Software: JDK 8
 .\"     Date: 21 November 2013
@@ -29,25 +28,25 @@
 .\"
 .if n .pl 99999
 .TH jarsigner 1 "21 November 2013" "JDK 8" "Security Tools"
-.\" -----------------------------------------------------------------
-.\" * Define some portability stuff
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el       .ds Aq '
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
 
 .SH NAME    
 jarsigner \- Signs and verifies Java Archive (JAR) files\&.
@@ -308,11 +307,7 @@
 .nf     
 \f3KEVIN\&.DSA\fP
 .fi     
-.nf     
-\f3\fR
-.fi     
 .sp     
-\fINote:\fR It is also possible for a JAR file to have mixed signatures, some generated by the JDK 1\&.1 by the \f3javakey\fR command and others by \f3jarsigner\fR\&. The \f3jarsigner\fR command can be used to sign JAR files that are already signed with the \f3javakey\fR command\&.
 .SH OPTIONS    
 The following sections describe the various \f3jarsigner\fR options\&. Be aware of the following standards:
 .TP 0.2i    
@@ -443,7 +438,7 @@
 .br
 If the \f3-certs\fR option appears on the command line with the \f3-verify\fR and \f3-verbose\fR options, then the output includes certificate information for each signer of the JAR file\&. This information includes the name of the type of certificate (stored in the \f3\&.DSA\fR file) that certifies the signer\&'s public key, and if the certificate is an X\&.509 certificate (an instance of the \f3java\&.security\&.cert\&.X509Certificate\fR), then the distinguished name of the signer\&.
 
-The keystore is also examined\&. If no keystore value is specified on the command line, then the default keystore file (if any) is checked\&. If the public key certificate for a signer matches an entry in the keystore, then the alias name for the keystore entry for that signer is displayed in parentheses\&. If the signer comes from a JDK 1\&.1 identity database instead of from a keystore, then the alias name displays in brackets instead of parentheses\&.
+The keystore is also examined\&. If no keystore value is specified on the command line, then the default keystore file (if any) is checked\&. If the public key certificate for a signer matches an entry in the keystore, then the alias name for the keystore entry for that signer is displayed in parentheses\&.
 .TP
 -certchain \fIfile\fR
 .br
@@ -797,178 +792,6 @@
 .fi     
 .sp     
 If the certificate for a signer is not an X\&.509 certificate, then there is no distinguished name information\&. In that case, just the certificate type and the alias are shown\&. For example, if the certificate is a PGP certificate, and the alias is \f3bob\fR, then you would get: \f3PGP, (bob)\fR\&.
-.SS VERIFICATION\ THAT\ INCLUDES\ IDENTITY\ DATABASE\ SIGNERS    
-If a JAR file was signed with the JDK 1\&.1 \f3javakey\fR tool, and the signer is an alias in an identity database, then the verification output includes an \f3i\fR\&. If the JAR file was signed by both an alias in an identity database and an alias in a keystore, then both \f3k\fR and \f3i\fR appear\&.
-.PP
-When the \f3-certs\fR option is used, any identity database aliases are shown in brackets rather than the parentheses used for keystore aliases, for example:
-.sp     
-.nf     
-\f3    jarsigner \-keystore /working/mystore \-verify \-verbose \-certs writeFile\&.jar\fP
-.fi     
-.nf     
-\f3\fR
-.fi     
-.nf     
-\f3           198 Fri Sep 26 16:14:06 PDT 1997 META\-INF/MANIFEST\&.MF\fP
-.fi     
-.nf     
-\f3           199 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.SF\fP
-.fi     
-.nf     
-\f3          1013 Fri Sep 26 16:22:10 PDT 1997 META\-INF/JANE\&.DSA\fP
-.fi     
-.nf     
-\f3           199 Fri Sep 27 12:22:30 PDT 1997 META\-INF/DUKE\&.SF\fP
-.fi     
-.nf     
-\f3          1013 Fri Sep 27 12:22:30 PDT 1997 META\-INF/DUKE\&.DSA\fP
-.fi     
-.nf     
-\f3   smki   2752 Fri Sep 26 16:12:30 PDT 1997 writeFile\&.html\fP
-.fi     
-.nf     
-\f3\fR
-.fi     
-.nf     
-\f3      X\&.509, CN=Jane Smith, OU=Java Software, O=Oracle, L=cup, S=ca, C=us (jane)\fP
-.fi     
-.nf     
-\f3      X\&.509, CN=Duke, OU=Java Software, O=Oracle, L=cup, S=ca, C=us [duke]\fP
-.fi     
-.nf     
-\f3\fR
-.fi     
-.nf     
-\f3      s = signature was verified\fP
-.fi     
-.nf     
-\f3      m = entry is listed in manifest\fP
-.fi     
-.nf     
-\f3      k = at least one certificate was found in keystore\fP
-.fi     
-.nf     
-\f3      i = at least one certificate was found in identity scope\fP
-.fi     
-.nf     
-\f3\fR
-.fi     
-.nf     
-\f3    jar verified\&.\fP
-.fi     
-.nf     
-\f3\fR
-.fi     
-.sp     
-\fINote:\fR The alias \f3duke\fR is in brackets to denote that it is an identity database alias, and not a keystore alias\&.
-.SH JDK\ 1\&.1\ COMPATIBILITY    
-The \f3keytool\fR and \f3jarsigner\fR tools replace the \f3javakey\fR tool in JDK 1\&.1\&. These new tools provide more features than \f3javakey\fR, including the ability to protect the keystore and private keys with passwords, and the ability to verify signatures in addition to generating them\&.
-.PP
-The new keystore architecture replaces the identity database that \f3javakey\fR created and managed\&. There is no backward compatibility between the keystore format and the database format used by \f3javakey\fR in JDK 1\&.1\&. However, be aware of the following:
-.TP 0.2i    
-\(bu
-It is possible to import the information from an identity database into a keystore through the \f3keytool -identitydb\fR command\&.
-.TP 0.2i    
-\(bu
-The \f3jarsigner\fR command can sign JAR files that were signed with the \f3javakey\fR command\&.
-.TP 0.2i    
-\(bu
-The \f3jarsigner\fR command can verify JAR files signed with \f3javakey\fR\&. The \f3jarsigner\fR command recognizes and can work with signer aliases that are from a JDK 1\&.1 identity database rather than a JDK keystore\&.
-.SS UNSIGNED\ JARS    
-Unsigned JARs have the default privileges that are granted to all code\&.
-.SS SIGNED\ JARS    
-Signed JARs have the privilege configurations based on their JDK 1\&.1\&.\fIn\fR identity and policy file status as described\&. Only trusted identities can be imported into the JDK keystore\&.
-.PP
-Default Privileges Granted to All Code
-
-Identity in 1\&.1 database: \fINo\fR
-.br     
-Trusted identity imported into Java keystore from 1\&.1\&. database: \fINo\fR
-.br     
-Policy file grants privileges to identity/alias: \fINo\fR
-.PP
-
-.PP
-Identity in 1\&.1 database: \fINo\fR
-.br     
-Trusted identity imported into Java keystore from 1\&.1\&. database: \fIYes\fR
-.br     
-Policy file grants privileges to identity/alias: \fINo\fR
-.PP
-
-.PP
-Identity in 1\&.1 database: Yes/Untrusted
-.br     
-Trusted identity imported into Java keystore from 1\&.1\&. database: \fINo\fR
-.br     
-Policy file grants privileges to identity/alias: \fINo\fR
-.br     
-See 3 in Notes Regarding Privileges of Signed JARs\&.
-.PP
-
-.PP
-Identity in 1\&.1 database: Yes/Untrusted
-.br     
-Trusted identity imported into Java keystore from 1\&.1\&. database: \fINo\fR
-.br     
-Policy file grants privileges to identity/alias: \fIYes\fR
-.br     
-See 1 and 3 in Notes Regarding Privileges of Signed JARs\&.
-.PP
-Default Privileges and Policy File Privileges Granted
-
-Identity in 1\&.1 database: \fINo\fR
-.br     
-Trusted identity imported into Java keystore from 1\&.1\&. database: \fIYes\fR
-.br     
-Policy file grants privileges to identity/alias: \fIYes\fR
-.PP
-
-.PP
-Identity in 1\&.1 database: \fIYes/Trusted\fR
-.br     
-Trusted identity imported into Java keystore from 1\&.1\&. database: \fIYes\fR
-.br     
-Policy file grants privileges to identity/alias: \fIYes\fR
-.br     
-See 2 in Notes Regarding Privileges of Signed JARs\&.
-.PP
-All Privileges Granted
-
-Identity in 1\&.1 database: \fIYes/Trusted\fR
-.br     
-Trusted identity imported into Java keystore from 1\&.1\&. database: \fINo\fR
-.br     
-Policy file grants privileges to identity/alias: \fINo\fR
-.PP
-
-.PP
-Identity in 1\&.1 database: \fIYes/Trusted\fR
-.br     
-Trusted identity imported into Java keystore from 1\&.1\&. database: \fIYes\fR
-.br     
-Policy file grants privileges to identity/alias: \fINo\fR
-.br     
-See 1 in Notes Regarding Privileges of Signed JARs\&.
-.PP
-Identity in 1\&.1 database: \fIYes/Trusted\fR
-.br     
-Trusted identity imported into Java keystore from 1\&.1\&. database: \fINo\fR
-.br     
-Policy file grants privileges to identity/alias: \fIYes\fR
-.br     
-See 1 in Notes Regarding Privileges of Signed JARs\&.
-.PP
-Notes Regarding Privileges of Signed JARs
-.TP 0.4i    
-1\&.
-If an identity or alias is mentioned in the policy file, then it must be imported into the keystore for the policy file to have any effect on privileges granted\&.
-.TP 0.4i    
-2\&.
-The policy file/keystore combination has precedence over a trusted identity in the identity database\&.
-.TP 0.4i    
-3\&.
-Untrusted identities are ignored in the Java platform\&.
 .SH SEE\ ALSO    
 .TP 0.2i    
 \(bu
@@ -979,7 +802,7 @@
 .TP 0.2i    
 \(bu
 Trail: Security Features in Java SE at http://docs\&.oracle\&.com/javase/tutorial/security/index\&.html
-.RE
-.br
-'pl 8.5i
-'bp
+.RE
+.br
+'pl 8.5i
+'bp
--- a/jdk/src/bsd/doc/man/java.1	Mon Aug 03 05:05:40 2015 -0400
+++ b/jdk/src/bsd/doc/man/java.1	Tue Aug 04 13:41:09 2015 +0200
@@ -1,1991 +1,3801 @@
 '\" t
-.\"  Copyright (c) 1994, 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.
-.\"
-.\"     Arch: generic
-.\"     Software: JDK 8
-.\"     Date: 21 November 2013
-.\"     SectDesc: Basic Tools
-.\"     Title: java.1
+.\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
+.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+.\"
+.\" This code is free software; you can redistribute it and/or modify it
+.\" 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.
+.\"
+.\" Title: java
+.\" Language: English
+.\" Date: 03 March 2015
+.\" SectDesc: Basic Tools
+.\" Software: JDK 8
+.\" Arch: generic
+.\" Part Number: E38207-04
+.\" Doc ID: JSSON
 .\"
 .if n .pl 99999
-.TH java 1 "21 November 2013" "JDK 8" "Basic Tools"
-.\" -----------------------------------------------------------------
-.\" * Define some portability stuff
-.\" -----------------------------------------------------------------
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el       .ds Aq '
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
-
-.SH NAME    
+.TH "java" "1" "03 March 2015" "JDK 8" "Basic Tools"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
 java \- Launches a Java application\&.
-.SH SYNOPSIS    
-.sp     
-.nf     
-
+.SH "SYNOPSIS"
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
 \fBjava\fR [\fIoptions\fR] \fIclassname\fR [\fIargs\fR]
-.fi     
-.nf     
-
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
 \fBjava\fR [\fIoptions\fR] \fB\-jar\fR \fIfilename\fR [\fIargs\fR]
-.fi     
-.sp     
-.TP     
+.fi
+.if n \{\
+.RE
+.\}
+.PP
 \fIoptions\fR
-Command-line options separated by spaces\&. See Options\&.
-.TP     
+.RS 4
+Command\-line options separated by spaces\&. See Options\&.
+.RE
+.PP
 \fIclassname\fR
+.RS 4
 The name of the class to be launched\&.
-.TP     
+.RE
+.PP
 \fIfilename\fR
-The name of the Java Archive (JAR) file to be called\&. Used only with the \f3-jar\fR option\&.
-.TP     
+.RS 4
+The name of the Java Archive (JAR) file to be called\&. Used only with the
+\fB\-jar\fR
+option\&.
+.RE
+.PP
 \fIargs\fR
-The arguments passed to the \f3main()\fR method separated by spaces\&.
-.SH DESCRIPTION    
-The \f3java\fR command starts a Java application\&. It does this by starting the Java Runtime Environment (JRE), loading the specified class, and calling that class\&'s \f3main()\fR method\&. The method must be declared \fIpublic\fR and \fIstatic\fR, it must not return any value, and it must accept a \f3String\fR array as a parameter\&. The method declaration has the following form:
-.sp     
-.nf     
-\f3public static void main(String[] args)\fP
-.fi     
-.nf     
-\f3\fP
-.fi     
-.sp     
-The \f3java\fR command can be used to launch a JavaFX application by loading a class that either has a \f3main()\fR method or that extends \f3javafx\&.application\&.Application\fR\&. In the latter case, the launcher constructs an instance of the \f3Application\fR class, calls its \f3init()\fR method, and then calls the \f3start(javafx\&.stage\&.Stage)\fR method\&.
+.RS 4
+The arguments passed to the
+\fBmain()\fR
+method separated by spaces\&.
+.RE
+.SH "DESCRIPTION"
 .PP
-By default, the first argument that is not an option of the \f3java\fR command is the fully qualified name of the class to be called\&. If the \f3-jar\fR option is specified, its argument is the name of the JAR file containing class and resource files for the application\&. The startup class must be indicated by the \f3Main-Class\fR manifest header in its source code\&.
+The
+\fBjava\fR
+command starts a Java application\&. It does this by starting the Java Runtime Environment (JRE), loading the specified class, and calling that class\*(Aqs
+\fBmain()\fR
+method\&. The method must be declared
+\fIpublic\fR
+and
+\fIstatic\fR, it must not return any value, and it must accept a
+\fBString\fR
+array as a parameter\&. The method declaration has the following form:
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+\fBpublic static void main(String[] args)\fR
+ 
+.fi
+.if n \{\
+.RE
+.\}
+.PP
+The
+\fBjava\fR
+command can be used to launch a JavaFX application by loading a class that either has a
+\fBmain()\fR
+method or that extends
+\fBjavafx\&.application\&.Application\fR\&. In the latter case, the launcher constructs an instance of the
+\fBApplication\fR
+class, calls its
+\fBinit()\fR
+method, and then calls the
+\fBstart(javafx\&.stage\&.Stage)\fR
+method\&.
+.PP
+By default, the first argument that is not an option of the
+\fBjava\fR
+command is the fully qualified name of the class to be called\&. If the
+\fB\-jar\fR
+option is specified, its argument is the name of the JAR file containing class and resource files for the application\&. The startup class must be indicated by the
+\fBMain\-Class\fR
+manifest header in its source code\&.
 .PP
 The JRE searches for the startup class (and other classes used by the application) in three sets of locations: the bootstrap class path, the installed extensions, and the user\(cqs class path\&.
 .PP
-Arguments after the class file name or the JAR file name are passed to the \f3main()\fR method\&.
-.SH OPTIONS    
-The \f3java\fR command supports a wide range of options that can be divided into the following categories:
-.TP 0.2i    
-\(bu
+Arguments after the class file name or the JAR file name are passed to the</