changeset 11294:5699d4102cd5

Merge
author vlivanov
date Wed, 11 May 2016 00:38:58 +0300
parents 4a62c2319956 adfd695e80ff
children cd6f5caac109
files src/os_cpu/linux_x86/vm/os_linux_x86.cpp src/share/tools/ProjectCreator/ArgsParser.java src/share/tools/ProjectCreator/BuildConfig.java src/share/tools/ProjectCreator/FileTreeCreator.java src/share/tools/ProjectCreator/FileTreeCreatorVC10.java src/share/tools/ProjectCreator/ProjectCreator.java src/share/tools/ProjectCreator/Util.java src/share/tools/ProjectCreator/WinGammaPlatform.java src/share/tools/ProjectCreator/WinGammaPlatformVC10.java src/share/vm/classfile/classLoader.cpp src/share/vm/classfile/vmSymbols.hpp src/share/vm/opto/library_call.cpp src/share/vm/prims/jvmtiRedefineClassesTrace.hpp src/share/vm/runtime/globals.hpp
diffstat 145 files changed, 6136 insertions(+), 4390 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/lib/CompileGtest.gmk	Wed May 11 00:38:58 2016 +0300
@@ -0,0 +1,116 @@
+#
+# Copyright (c) 2016, 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.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# 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.
+#
+
+GTEST_TEST_SRC := $(HOTSPOT_TOPDIR)/test/native
+GTEST_FRAMEWORK_SRC := $(SRC_ROOT)/test/fmw/gtest
+
+# On Windows, there are no internal debug symbols so must set copying to true
+# to get any at all.
+ifeq ($(OPENJDK_TARGET_OS), windows)
+  GTEST_COPY_DEBUG_SYMBOLS := true
+else
+  GTEST_COPY_DEBUG_SYMBOLS := false
+endif
+
+################################################################################
+
+GTEST_TEST_SRC_FILES := $(shell $(FIND) $(HOTSPOT_TOPDIR)/test/native -name \
+    "test*.cpp" -type f)
+
+ifeq ($(OPENJDK_TARGET_OS), windows)
+  GTEST_JVM_MAPFILE := $(JVM_MAPFILE)
+else
+  GTEST_JVM_MAPFILE := $(JVM_OUTPUTDIR)/gtest/mapfile
+
+  $(JVM_OUTPUTDIR)/gtest/symbols: $(JVM_OUTPUTDIR)/symbols
+	$(call MakeDir, $(@D))
+	( $(CAT) $< ; echo "runUnitTests" ) > $@
+
+  $(GTEST_JVM_MAPFILE): $(JVM_OUTPUTDIR)/gtest/symbols
+	$(call create-mapfile)
+endif
+
+# Disabling switch warning for clang because of test source.
+
+$(eval $(call SetupNativeCompilation, BUILD_GTEST_LIBJVM, \
+    TOOLCHAIN := $(JVM_TOOLCHAIN), \
+    LIBRARY := jvm, \
+    OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
+    EXTRA_FILES := $(GTEST_TEST_SRC_FILES) \
+        $(GTEST_FRAMEWORK_SRC)/src/gtest-all.cc \
+        $(GTEST_TEST_SRC)/gtestMain.cpp, \
+    OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/objs, \
+    EXTRA_OBJECT_FILES := $(filter-out %/operator_new$(OBJ_SUFFIX), \
+        $(BUILD_LIBJVM_ALL_OBJS)), \
+    CFLAGS := $(JVM_CFLAGS) -I$(GTEST_FRAMEWORK_SRC) \
+        -I$(GTEST_FRAMEWORK_SRC)/include \
+        -I$(GTEST_TEST_SRC), \
+    CFLAGS_windows := /EHsc, \
+    CFLAGS_solaris := -DGTEST_HAS_EXCEPTIONS=0 -library=stlport4, \
+    CFLAGS_macosx := -DGTEST_OS_MAC=1, \
+    CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
+    CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
+    DISABLED_WARNINGS_gcc := undef, \
+    DISABLED_WARNINGS_clang := undef switch format-nonliteral \
+        tautological-undefined-compare, \
+    DISABLED_WARNINGS_solstudio := identexpected, \
+    LDFLAGS := $(JVM_LDFLAGS), \
+    LDFLAGS_solaris := -library=stlport4 $(call SET_SHARED_LIBRARY_ORIGIN), \
+    LIBS := $(JVM_LIBS), \
+    OPTIMIZATION := $(JVM_OPTIMIZATION), \
+    MAPFILE := $(GTEST_JVM_MAPFILE), \
+    USE_MAPFILE_FOR_SYMBOLS := true, \
+    COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
+    ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \
+))
+
+TARGETS += $(BUILD_GTEST_LIBJVM)
+
+################################################################################
+
+$(eval $(call SetupNativeCompilation, BUILD_GTEST_LAUNCHER, \
+    TOOLCHAIN := $(JVM_TOOLCHAIN), \
+    PROGRAM := gtestLauncher, \
+    OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
+    EXTRA_FILES := $(GTEST_TEST_SRC)/gtestLauncher.cpp, \
+    OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/launcher-objs, \
+    CFLAGS := $(JVM_CFLAGS) -I$(GTEST_FRAMEWORK_SRC) \
+        -I$(GTEST_FRAMEWORK_SRC)/include, \
+    CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
+    CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
+    LDFLAGS := $(LDFLAGS_TESTEXE), \
+    LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/gtest $(call SET_SHARED_LIBRARY_ORIGIN), \
+    LDFLAGS_solaris := -library=stlport4, \
+    LIBS_unix := -ljvm, \
+    LIBS_windows := $(JVM_OUTPUTDIR)/gtest/objs/jvm.lib, \
+    COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \
+    ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \
+))
+
+$(BUILD_GTEST_LAUNCHER): $(BUILD_GTEST_LIBJVM)
+
+TARGETS += $(BUILD_GTEST_LAUNCHER)
+
+################################################################################
--- a/make/lib/CompileLibraries.gmk	Tue May 10 12:18:22 2016 +0200
+++ b/make/lib/CompileLibraries.gmk	Wed May 11 00:38:58 2016 +0300
@@ -37,6 +37,10 @@
 include lib/CompileJvm.gmk
 include lib/CompileDtracePostJvm.gmk
 
+ifeq ($(BUILD_GTEST), true)
+  include lib/CompileGtest.gmk
+endif
+
 all: $(TARGETS)
 
 .PHONY: all
--- a/make/lib/JvmMapfile.gmk	Tue May 10 12:18:22 2016 +0200
+++ b/make/lib/JvmMapfile.gmk	Wed May 11 00:38:58 2016 +0300
@@ -153,20 +153,33 @@
 ################################################################################
 # Finally convert the symbol list into a platform-specific mapfile
 
-$(JVM_MAPFILE): $(JVM_OUTPUTDIR)/symbols
-	$(call LogInfo, Creating mapfile)
-	$(RM) $@
-        ifeq ($(OPENJDK_TARGET_OS), macosx)
-          # On macosx, we need to add a leading underscore
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+  # On macosx, we need to add a leading underscore
+  define create-mapfile-work
 	  $(AWK) '{ if ($$0 ~ ".") { print "  _" $$0 } }'  < $^ > $@.tmp
-        else ifeq ($(OPENJDK_TARGET_OS), windows)
-          # On windows, add an 'EXPORTS' header
+  endef
+else ifeq ($(OPENJDK_TARGET_OS), windows)
+  # On windows, add an 'EXPORTS' header
+  define create-mapfile-work
 	  $(ECHO) "EXPORTS" > $@.tmp
 	  $(AWK) '{ if ($$0 ~ ".") { print "  " $$0 } }'  < $^ >> $@.tmp
-        else
-          # Assume standard linker script
+  endef
+else
+  # Assume standard linker script
+  define create-mapfile-work
 	  $(PRINTF) "SUNWprivate_1.1 { \n  global: \n" > $@.tmp
 	  $(AWK) '{ if ($$0 ~ ".") { print "    " $$0 ";" } }' < $^ >> $@.tmp
 	  $(PRINTF) "  local: \n    *; \n }; \n" >> $@.tmp
-        endif
+  endef
+endif
+
+define create-mapfile
+	$(call LogInfo, Creating mapfile)
+	$(call MakeDir, $(@D))
+	$(call create-mapfile-work)
+	$(RM) $@
 	$(MV) $@.tmp $@
+endef
+
+$(JVM_MAPFILE): $(JVM_OUTPUTDIR)/symbols
+	$(call create-mapfile)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/projectcreator/ArgsParser.java	Wed May 11 00:38:58 2016 +0300
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2005, 2016, 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 build.tools.projectcreator;
+
+class ArgIterator {
+    String[] args;
+    int i;
+    ArgIterator(String[] args) {
+        this.args = args;
+        this.i = 0;
+    }
+    String get() { return args[i]; }
+    boolean hasMore() { return args != null && i  < args.length; }
+    boolean next() { return ++i < args.length; }
+}
+
+abstract class ArgHandler {
+    public abstract void handle(ArgIterator it);
+
+}
+
+class ArgRule {
+    String arg;
+    ArgHandler handler;
+    ArgRule(String arg, ArgHandler handler) {
+        this.arg = arg;
+        this.handler = handler;
+    }
+
+    boolean process(ArgIterator it) {
+        if (match(it.get(), arg)) {
+            handler.handle(it);
+            return true;
+        }
+        return false;
+    }
+    boolean match(String rule_pattern, String arg) {
+        return arg.equals(rule_pattern);
+    }
+}
+
+class ArgsParser {
+    ArgsParser(String[] args,
+               ArgRule[] rules,
+               ArgHandler defaulter) {
+        ArgIterator ai = new ArgIterator(args);
+        while (ai.hasMore()) {
+            boolean processed = false;
+            for (int i=0; i<rules.length; i++) {
+                processed |= rules[i].process(ai);
+                if (processed) {
+                    break;
+                }
+            }
+            if (!processed) {
+                if (defaulter != null) {
+                    defaulter.handle(ai);
+                } else {
+                    System.err.println("ERROR: unparsed \""+ai.get()+"\"");
+                    ai.next();
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/projectcreator/BuildConfig.java	Wed May 11 00:38:58 2016 +0300
@@ -0,0 +1,624 @@
+/*
+ * Copyright (c) 2005, 2016, 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 build.tools.projectcreator;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Vector;
+
+class BuildConfig {
+    @SuppressWarnings("rawtypes")
+    Hashtable vars;
+    Vector<String> basicNames, basicPaths;
+    String[] context;
+
+    static CompilerInterface ci;
+    static CompilerInterface getCI() {
+        if (ci == null) {
+            String comp = (String)getField(null, "CompilerVersion");
+            try {
+                ci = (CompilerInterface)Class.forName("build.tools.projectcreator.CompilerInterface" + comp).newInstance();
+            } catch (Exception cnfe) {
+                System.err.println("Cannot find support for compiler " + comp);
+                throw new RuntimeException(cnfe.toString());
+            }
+        }
+        return ci;
+    }
+
+    @SuppressWarnings("rawtypes")
+    protected void initNames(String flavour, String build, String outDll) {
+        if (vars == null) vars = new Hashtable();
+
+        String flavourBuild =  flavour + "_" + build;
+        String platformName = getFieldString(null, "PlatformName");
+        System.out.println();
+        System.out.println(flavourBuild);
+
+        put("Name", getCI().makeCfgName(flavourBuild, platformName));
+        put("Flavour", flavour);
+        put("Build", build);
+        put("PlatformName", platformName);
+
+        // ones mentioned above were needed to expand format
+        String buildBase = expandFormat(getFieldString(null, "BuildBase"));
+        String sourceBase = getFieldString(null, "SourceBase");
+        String buildSpace = getFieldString(null, "BuildSpace");
+        String outDir = buildBase;
+        String jdkTargetRoot = getFieldString(null, "JdkTargetRoot");
+        String makeBinary = getFieldString(null, "MakeBinary");
+        String makeOutput = expandFormat(getFieldString(null, "MakeOutput"));
+
+        put("Id", flavourBuild);
+        put("OutputDir", outDir);
+        put("SourceBase", sourceBase);
+        put("BuildBase", buildBase);
+        put("BuildSpace", buildSpace);
+        put("OutputDll", outDir + Util.sep + outDll);
+        put("JdkTargetRoot", jdkTargetRoot);
+        put("MakeBinary", makeBinary);
+        put("MakeOutput", makeOutput);
+
+        context = new String [] {flavourBuild, flavour, build, null};
+    }
+
+    protected void init(Vector<String> includes, Vector<String> defines) {
+        initDefaultDefines(defines);
+        initDefaultCompilerFlags(includes);
+        initDefaultLinkerFlags();
+        //handleDB();
+    }
+
+
+    protected void initDefaultCompilerFlags(Vector<String> includes) {
+        Vector compilerFlags = new Vector();
+
+        compilerFlags.addAll(getCI().getBaseCompilerFlags(getV("Define"),
+                                                          includes,
+                                                          get("OutputDir")));
+
+        put("CompilerFlags", compilerFlags);
+    }
+
+    protected void initDefaultLinkerFlags() {
+        Vector linkerFlags = new Vector();
+
+        linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"), get("PlatformName")));
+
+        put("LinkerFlags", linkerFlags);
+    }
+
+    public boolean matchesIgnoredPath(String path) {
+        Vector<String> rv = new Vector<String>();
+        collectRelevantVectors(rv, "IgnorePath");
+        for (String pathPart : rv) {
+            if (path.contains(pathPart))  {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public boolean matchesHidePath(String path) {
+        Vector<String> rv = new Vector<String>();
+        collectRelevantVectors(rv, "HidePath");
+        for (String pathPart : rv) {
+            if (path.contains(Util.normalize(pathPart)))  {
+                return true;
+            }
+        }
+        return false;
+    }
+
+   public Vector<String> matchesAdditionalGeneratedPath(String fullPath) {
+        Vector<String> rv = new Vector<String>();
+        Hashtable<String, String> v = (Hashtable<String, String>)BuildConfig.getField(this.toString(), "AdditionalGeneratedFile");
+        if (v != null) {
+            for (Enumeration<String> e=v.keys(); e.hasMoreElements(); ) {
+                String key = e.nextElement();
+                String val = v.get(key);
+
+                if (fullPath.endsWith(expandFormat(key))) {
+                    rv.add(expandFormat(val));
+                }
+            }
+        }
+        return rv;
+    }
+
+    // Returns true if the specified path refers to a relative alternate
+    // source file. RelativeAltSrcInclude is usually "src\closed".
+    public static boolean matchesRelativeAltSrcInclude(String path) {
+        String relativeAltSrcInclude =
+            getFieldString(null, "RelativeAltSrcInclude");
+        Vector<String> v = getFieldVector(null, "AltRelativeInclude");
+        if (v != null) {
+            for (String pathPart : v) {
+                if (path.contains(relativeAltSrcInclude + Util.sep + pathPart))  {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    // Returns the relative alternate source file for the specified path.
+    // Null is returned if the specified path does not have a matching
+    // alternate source file.
+    public static String getMatchingRelativeAltSrcFile(String path) {
+        Vector<String> v = getFieldVector(null, "RelativeAltSrcFileList");
+        if (v == null) {
+            return null;
+        }
+        for (String pathPart : v) {
+            if (path.endsWith(pathPart)) {
+                String relativeAltSrcInclude =
+                    getFieldString(null, "RelativeAltSrcInclude");
+                return relativeAltSrcInclude + Util.sep + pathPart;
+            }
+        }
+        return null;
+    }
+
+    // Returns true if the specified path has a matching alternate
+    // source file.
+    public static boolean matchesRelativeAltSrcFile(String path) {
+        return getMatchingRelativeAltSrcFile(path) != null;
+    }
+
+    // Track the specified alternate source file. The source file is
+    // tracked without the leading .*<sep><RelativeAltSrcFileList><sep>
+    // part to make matching regular source files easier.
+    public static void trackRelativeAltSrcFile(String path) {
+        String pattern = getFieldString(null, "RelativeAltSrcInclude") +
+            Util.sep;
+        int altSrcInd = path.indexOf(pattern);
+        if (altSrcInd == -1) {
+            // not an AltSrc path
+            return;
+        }
+
+        altSrcInd += pattern.length();
+        if (altSrcInd >= path.length()) {
+            // not a valid AltSrc path
+            return;
+        }
+
+        String altSrcFile = path.substring(altSrcInd);
+        Vector v = getFieldVector(null, "RelativeAltSrcFileList");
+        if (v == null || !v.contains(altSrcFile)) {
+            addFieldVector(null, "RelativeAltSrcFileList", altSrcFile);
+        }
+    }
+
+    void addTo(Hashtable ht, String key, String value) {
+        ht.put(expandFormat(key), expandFormat(value));
+    }
+
+    void initDefaultDefines(Vector defines) {
+        Vector sysDefines = new Vector();
+        sysDefines.add("WIN32");
+        sysDefines.add("_WINDOWS");
+        sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\"");
+        sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\"");
+        sysDefines.add("INCLUDE_TRACE=1");
+        sysDefines.add("_JNI_IMPLEMENTATION_");
+        if (vars.get("PlatformName").equals("Win32")) {
+            sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\"");
+        } else {
+            sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\"");
+        }
+        sysDefines.add("DEBUG_LEVEL=\\\"" + get("Build")+"\\\"");
+        sysDefines.addAll(defines);
+
+        put("Define", sysDefines);
+    }
+
+    String get(String key) {
+        return (String)vars.get(key);
+    }
+
+    Vector getV(String key) {
+        return (Vector)vars.get(key);
+    }
+
+    Object getO(String key) {
+        return vars.get(key);
+    }
+
+    Hashtable getH(String key) {
+        return (Hashtable)vars.get(key);
+    }
+
+    Object getFieldInContext(String field) {
+        for (int i=0; i<context.length; i++) {
+            Object rv = getField(context[i], field);
+            if (rv != null) {
+                return rv;
+            }
+        }
+        return null;
+    }
+
+    Object lookupHashFieldInContext(String field, String key) {
+        for (int i=0; i<context.length; i++) {
+            Hashtable ht = (Hashtable)getField(context[i], field);
+            if (ht != null) {
+                Object rv = ht.get(key);
+                if (rv != null) {
+                    return rv;
+                }
+            }
+        }
+        return null;
+    }
+
+    void put(String key, String value) {
+        vars.put(key, value);
+    }
+
+    void put(String key, Vector vvalue) {
+        vars.put(key, vvalue);
+    }
+
+    void add(String key, Vector vvalue) {
+        getV(key).addAll(vvalue);
+    }
+
+    String flavour() {
+        return get("Flavour");
+    }
+
+    String build() {
+        return get("Build");
+    }
+
+    Object getSpecificField(String field) {
+        return getField(get("Id"), field);
+    }
+
+    void putSpecificField(String field, Object value) {
+        putField(get("Id"), field, value);
+    }
+
+    void collectRelevantVectors(Vector rv, String field) {
+        for (String ctx : context) {
+            Vector<String> v = getFieldVector(ctx, field);
+            if (v != null) {
+                for (String val : v) {
+                    rv.add(expandFormat(val).replace('/', '\\'));
+                }
+            }
+        }
+    }
+
+    void collectRelevantHashes(Hashtable rv, String field) {
+        for (String ctx : context) {
+            Hashtable v = (Hashtable)getField(ctx, field);
+            if (v != null) {
+                for (Enumeration e=v.keys(); e.hasMoreElements(); ) {
+                    String key = (String)e.nextElement();
+                    String val =  (String)v.get(key);
+                    addTo(rv, key, val);
+                }
+            }
+        }
+    }
+
+
+    Vector getDefines() {
+        Vector rv = new Vector();
+        collectRelevantVectors(rv, "Define");
+        return rv;
+    }
+
+    Vector getIncludes() {
+        Vector rv = new Vector();
+        collectRelevantVectors(rv, "AbsoluteInclude");
+        rv.addAll(getSourceIncludes());
+        return rv;
+    }
+
+    private Vector getSourceIncludes() {
+        Vector<String> rv = new Vector<String>();
+        String sourceBase = getFieldString(null, "SourceBase");
+
+        // add relative alternate source include values:
+        String relativeAltSrcInclude =
+            getFieldString(null, "RelativeAltSrcInclude");
+        Vector<String> asri = new Vector<String>();
+        collectRelevantVectors(asri, "AltRelativeInclude");
+        for (String f : asri) {
+            rv.add(sourceBase + Util.sep + relativeAltSrcInclude +
+                   Util.sep + f);
+        }
+
+        Vector<String> ri = new Vector<String>();
+        collectRelevantVectors(ri, "RelativeInclude");
+        for (String f : ri) {
+            rv.add(sourceBase + Util.sep + f);
+        }
+        return rv;
+    }
+
+    static Hashtable cfgData = new Hashtable();
+    static Hashtable globalData = new Hashtable();
+
+    static boolean appliesToTieredBuild(String cfg) {
+        return (cfg != null &&
+                cfg.startsWith("server"));
+    }
+
+    // Filters out the IgnoreFile and IgnorePaths since they are
+    // handled specially for tiered builds.
+    static boolean appliesToTieredBuild(String cfg, String key) {
+        return (appliesToTieredBuild(cfg))&& (key != null && !key.startsWith("Ignore"));
+    }
+
+    static String getTieredBuildCfg(String cfg) {
+        assert appliesToTieredBuild(cfg) : "illegal configuration " + cfg;
+        return "server";
+    }
+
+    static Object getField(String cfg, String field) {
+        if (cfg == null) {
+            return globalData.get(field);
+        }
+
+        Hashtable ht =  (Hashtable)cfgData.get(cfg);
+        return ht == null ? null : ht.get(field);
+    }
+
+    static String getFieldString(String cfg, String field) {
+        return (String)getField(cfg, field);
+    }
+
+    static Vector getFieldVector(String cfg, String field) {
+        return (Vector)getField(cfg, field);
+    }
+
+    static void putField(String cfg, String field, Object value) {
+        putFieldImpl(cfg, field, value);
+        if (appliesToTieredBuild(cfg, field)) {
+            putFieldImpl(getTieredBuildCfg(cfg), field, value);
+        }
+    }
+
+    private static void putFieldImpl(String cfg, String field, Object value) {
+        if (cfg == null) {
+            globalData.put(field, value);
+            return;
+        }
+
+        Hashtable ht = (Hashtable)cfgData.get(cfg);
+        if (ht == null) {
+            ht = new Hashtable();
+            cfgData.put(cfg, ht);
+        }
+
+        ht.put(field, value);
+    }
+
+    static Object getFieldHash(String cfg, String field, String name) {
+        Hashtable ht = (Hashtable)getField(cfg, field);
+
+        return ht == null ? null : ht.get(name);
+    }
+
+    static void putFieldHash(String cfg, String field, String name, Object val) {
+        putFieldHashImpl(cfg, field, name, val);
+        if (appliesToTieredBuild(cfg, field)) {
+            putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val);
+        }
+    }
+
+    private static void putFieldHashImpl(String cfg, String field, String name, Object val) {
+        Hashtable ht = (Hashtable)getField(cfg, field);
+
+        if (ht == null) {
+            ht = new Hashtable();
+            putFieldImpl(cfg, field, ht);
+        }
+
+        ht.put(name, val);
+    }
+
+    static void addFieldVector(String cfg, String field, String element) {
+        addFieldVectorImpl(cfg, field, element);
+        if (appliesToTieredBuild(cfg, field)) {
+            addFieldVectorImpl(getTieredBuildCfg(cfg), field, element);
+        }
+    }
+
+    private static void addFieldVectorImpl(String cfg, String field, String element) {
+        Vector v = (Vector)getField(cfg, field);
+
+        if (v == null) {
+            v = new Vector();
+            putFieldImpl(cfg, field, v);
+        }
+
+        v.add(element);
+    }
+
+    String expandFormat(String format) {
+        if (format == null) {
+            return null;
+        }
+
+        if (format.indexOf('%') == -1) {
+            return format;
+        }
+
+        StringBuffer sb = new StringBuffer();
+        int len = format.length();
+        for (int i=0; i<len; i++) {
+            char ch = format.charAt(i);
+            if (ch == '%') {
+                char ch1 = format.charAt(i+1);
+                switch (ch1) {
+                case '%':
+                    sb.append(ch1);
+                    break;
+                case 'b':
+                    sb.append(build());
+                    break;
+                case 'f':
+                    sb.append(flavour());
+                    break;
+                default:
+                    sb.append(ch);
+                    sb.append(ch1);
+                }
+                i++;
+            } else {
+                sb.append(ch);
+            }
+        }
+
+        return sb.toString();
+    }
+}
+
+abstract class GenericDebugConfig extends BuildConfig {
+    abstract String getOptFlag();
+
+    protected void init(Vector includes, Vector defines) {
+        defines.add("_DEBUG");
+        defines.add("ASSERT");
+
+        super.init(includes, defines);
+
+        getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag(), get("PlatformName")));
+        getV("LinkerFlags").addAll(getCI().getDebugLinkerFlags());
+   }
+}
+
+abstract class GenericDebugNonKernelConfig extends GenericDebugConfig {
+    protected void init(Vector includes, Vector defines) {
+        super.init(includes, defines);
+        if (get("PlatformName").equals("Win32")) {
+            getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags"));
+        }
+   }
+}
+
+class C1DebugConfig extends GenericDebugNonKernelConfig {
+    String getOptFlag() {
+        return getCI().getNoOptFlag();
+    }
+
+    C1DebugConfig() {
+        initNames("client", "debug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+class C1FastDebugConfig extends GenericDebugNonKernelConfig {
+    String getOptFlag() {
+        return getCI().getOptFlag();
+    }
+
+    C1FastDebugConfig() {
+        initNames("client", "fastdebug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+class TieredDebugConfig extends GenericDebugNonKernelConfig {
+    String getOptFlag() {
+        return getCI().getNoOptFlag();
+    }
+
+    TieredDebugConfig() {
+        initNames("server", "debug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+class TieredFastDebugConfig extends GenericDebugNonKernelConfig {
+    String getOptFlag() {
+        return getCI().getOptFlag();
+    }
+
+    TieredFastDebugConfig() {
+        initNames("server", "fastdebug", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+abstract class ProductConfig extends BuildConfig {
+    protected void init(Vector includes, Vector defines) {
+        defines.add("NDEBUG");
+        defines.add("PRODUCT");
+
+        super.init(includes, defines);
+
+        getV("CompilerFlags").addAll(getCI().getProductCompilerFlags());
+        getV("LinkerFlags").addAll(getCI().getProductLinkerFlags());
+    }
+}
+
+class C1ProductConfig extends ProductConfig {
+    C1ProductConfig() {
+        initNames("client", "product", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+class TieredProductConfig extends ProductConfig {
+    TieredProductConfig() {
+        initNames("server", "product", "jvm.dll");
+        init(getIncludes(), getDefines());
+    }
+}
+
+
+abstract class CompilerInterface {
+    abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
+    abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName);
+    abstract Vector getDebugCompilerFlags(String opt, String platformName);
+    abstract Vector getDebugLinkerFlags();
+    abstract void   getAdditionalNonKernelLinkerFlags(Vector rv);
+    abstract Vector getProductCompilerFlags();
+    abstract Vector getProductLinkerFlags();
+    abstract String getOptFlag();
+    abstract String getNoOptFlag();
+    abstract String makeCfgName(String flavourBuild, String platformName);
+
+    void addAttr(Vector receiver, String attr, String value) {
+        receiver.add(attr); receiver.add(value);
+    }
+    void extAttr(Vector receiver, String attr, String value) {
+        int attr_pos=receiver.indexOf(attr) ;
+        if ( attr_pos == -1) {
+          // If attr IS NOT present in the Vector - add it
+          receiver.add(attr); receiver.add(value);
+        } else {
+          // If attr IS present in the Vector - append value to it
+          receiver.set(attr_pos+1,receiver.get(attr_pos+1)+value);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/projectcreator/FileTreeCreator.java	Wed May 11 00:38:58 2016 +0300
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2012, 2016, 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 build.tools.projectcreator;
+
+import java.nio.file.FileSystems;
+import java.nio.file.Path;
+import java.nio.file.SimpleFileVisitor;
+import java.util.HashSet;
+import java.util.Stack;
+import java.util.Vector;
+
+public class FileTreeCreator extends SimpleFileVisitor<Path>
+{
+   Path vcProjLocation;
+   Path startDir;
+   final int startDirLength;
+   Stack<DirAttributes> attributes = new Stack<DirAttributes>();
+   Vector<BuildConfig> allConfigs;
+   WinGammaPlatform wg;
+   WinGammaPlatformVC10 wg10;
+
+   public FileTreeCreator(Path startDir, Vector<BuildConfig> allConfigs, WinGammaPlatform wg) {
+      super();
+      this.wg = wg;
+      if (wg instanceof WinGammaPlatformVC10) {
+          wg10 = (WinGammaPlatformVC10)wg;
+      }
+      this.allConfigs = allConfigs;
+      this.startDir = startDir;
+      startDirLength = startDir.toAbsolutePath().toString().length();
+      vcProjLocation = FileSystems.getDefault().getPath(allConfigs.firstElement().get("BuildSpace"));
+      attributes.push(new DirAttributes());
+   }
+
+   public class DirAttributes {
+
+      private HashSet<BuildConfig> ignores;
+      private HashSet<BuildConfig> disablePch;
+
+      public DirAttributes() {
+         ignores = new HashSet<BuildConfig>();
+         disablePch = new HashSet<BuildConfig>();
+      }
+
+      public DirAttributes(HashSet<BuildConfig> excludes2, HashSet<BuildConfig> disablePch2) {
+         ignores = excludes2;
+         disablePch = disablePch2;
+      }
+
+      @SuppressWarnings("unchecked")
+      public DirAttributes clone() {
+         return new DirAttributes((HashSet<BuildConfig>)this.ignores.clone(), (HashSet<BuildConfig>)this.disablePch.clone());
+      }
+
+      public void setIgnore(BuildConfig conf) {
+         ignores.add(conf);
+      }
+
+      public boolean hasIgnore(BuildConfig cfg) {
+         return ignores.contains(cfg);
+      }
+
+      public void removeFromIgnored(BuildConfig cfg) {
+         ignores.remove(cfg);
+      }
+
+      public void setDisablePch(BuildConfig conf) {
+         disablePch.add(conf);
+      }
+
+      public boolean hasDisablePch(BuildConfig cfg) {
+         return disablePch.contains(cfg);
+      }
+
+      public void removeFromDisablePch(BuildConfig cfg) {
+         disablePch.remove(cfg);
+      }
+
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/projectcreator/FileTreeCreatorVC10.java	Wed May 11 00:38:58 2016 +0300
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2012, 2016, 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 build.tools.projectcreator;
+
+import static java.nio.file.FileVisitResult.CONTINUE;
+
+import java.io.IOException;
+import java.nio.file.FileSystems;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.Stack;
+import java.util.Vector;
+
+public class FileTreeCreatorVC10 extends FileTreeCreator {
+
+      public FileTreeCreatorVC10(Path startDir, Vector<BuildConfig> allConfigs, WinGammaPlatformVC10 wg) {
+         super(startDir, allConfigs, wg);
+      }
+
+      @Override
+      public FileVisitResult visitFile(Path file, BasicFileAttributes attr) {
+         DirAttributes currentFileAttr = attributes.peek().clone();
+         boolean usePch = false;
+         boolean disablePch = false;
+         boolean useIgnore = false;
+         boolean isAltSrc = false;  // only needed as a debugging crumb
+         boolean isReplacedByAltSrc = false;
+         String fileName = file.getFileName().toString();
+
+         // TODO hideFile
+
+         // usePch applies to all configs for a file.
+         if (fileName.equals(BuildConfig.getFieldString(null, "UseToGeneratePch"))) {
+            usePch = true;
+         }
+
+         String fileLoc = vcProjLocation.relativize(file).toString();
+
+         // isAltSrc and isReplacedByAltSrc applies to all configs for a file
+         if (BuildConfig.matchesRelativeAltSrcInclude(
+               file.toAbsolutePath().toString())) {
+            // current file is an alternate source file so track it
+            isAltSrc = true;
+            BuildConfig.trackRelativeAltSrcFile(
+                file.toAbsolutePath().toString());
+         } else if (BuildConfig.matchesRelativeAltSrcFile(
+                    file.toAbsolutePath().toString())) {
+            // current file is a regular file that matches an alternate
+            // source file so yack about replacing the regular file
+            isReplacedByAltSrc = true;
+            System.out.println("INFO: alternate source file '" +
+                               BuildConfig.getMatchingRelativeAltSrcFile(
+                                   file.toAbsolutePath().toString()) +
+                               "' replaces '" + fileLoc + "'");
+         }
+
+         for (BuildConfig cfg : allConfigs) {
+            if (cfg.lookupHashFieldInContext("IgnoreFile", fileName) != null) {
+               useIgnore = true;
+               currentFileAttr.setIgnore(cfg);
+            } else if (cfg.matchesIgnoredPath(file.toAbsolutePath().toString())) {
+               useIgnore = true;
+               currentFileAttr.setIgnore(cfg);
+            }
+
+            if (cfg.lookupHashFieldInContext("DisablePch", fileName) != null) {
+               disablePch = true;
+               currentFileAttr.setDisablePch(cfg);
+            }
+
+            Vector<String> rv = new Vector<String>();
+            cfg.collectRelevantVectors(rv, "AdditionalFile");
+            for(String addFile : rv) {
+               if (addFile.equals(fileName)) {
+                  // supress any ignore
+                  // TODO - may need some adjustments
+                  if (file.toAbsolutePath().toString().contains(cfg.get("Flavour"))) {
+                     currentFileAttr.removeFromIgnored(cfg);
+                  }
+               }
+            }
+         }
+
+         String tagName = wg10.getFileTagFromSuffix(fileName);
+
+         if (!useIgnore && !disablePch && !usePch && !isReplacedByAltSrc) {
+            wg.tag(tagName, new String[] { "Include", fileLoc});
+         } else {
+            wg.startTag(
+                  tagName,
+                  new String[] { "Include", fileLoc});
+
+            for (BuildConfig cfg : allConfigs) {
+               boolean ignore = currentFileAttr.hasIgnore(cfg);
+               if (ignore) {
+                  wg.tagData("ExcludedFromBuild", "true", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
+               }
+               if (usePch) {
+                  wg.tagData("PrecompiledHeader", "Create", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
+               }
+               if (disablePch) {
+                  wg.tag("PrecompiledHeader", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
+               }
+               if (isReplacedByAltSrc) {
+                  wg.tagData("ExcludedFromBuild", "true", "Condition",
+                             "'$(Configuration)|$(Platform)'=='" +
+                             cfg.get("Name") + "'");
+               }
+            }
+            wg.endTag();
+         }
+
+         String filter = startDir.relativize(file.getParent().toAbsolutePath()).toString();
+         wg10.addFilterDependency(fileLoc, filter);
+
+         return CONTINUE;
+      }
+
+      @Override
+      public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs)
+            throws IOException {
+         Boolean hide = false;
+         // TODO remove attrs, if path is matched in this dir, then it is too in every subdir.
+         // And we will check anyway
+         DirAttributes newAttr = attributes.peek().clone();
+
+         // check per config ignorePaths!
+         for (BuildConfig cfg : allConfigs) {
+            if (cfg.matchesIgnoredPath(path.toAbsolutePath().toString())) {
+               newAttr.setIgnore(cfg);
+            }
+
+            // Hide is always on all configs. And additional files are never hiddden
+            if (cfg.matchesHidePath(path.toAbsolutePath().toString())) {
+               hide = true;
+               break;
+            }
+         }
+
+         if (!hide) {
+            String name = startDir.relativize(path.toAbsolutePath()).toString();
+            if (!"".equals(name)) {
+               wg10.addFilter(name);
+            }
+
+            attributes.push(newAttr);
+            return super.preVisitDirectory(path, attrs);
+         } else {
+            return FileVisitResult.SKIP_SUBTREE;
+         }
+      }
+
+      @Override
+      public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
+         //end matching attributes set by ignorepath
+         attributes.pop();
+         return CONTINUE;
+      }
+
+      @Override
+      public FileVisitResult visitFileFailed(Path file, IOException exc) {
+         return CONTINUE;
+      }
+
+      public void writeFileTree() throws IOException {
+         Files.walkFileTree(this.startDir, this);
+      }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/projectcreator/ProjectCreator.java	Wed May 11 00:38:58 2016 +0300
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 1999, 2016, 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 build.tools.projectcreator;
+
+public class ProjectCreator {
+
+   public static void usage() {
+      System.out.println("ProjectCreator options:");
+      System.err.println("WinGammaPlatform platform-specific options:");
+      System.err.println("  -sourceBase <path to directory (workspace) "
+            + "containing source files; no trailing slash>");
+      System.err.println("  -dspFileName <full pathname to which .dsp file "
+            + "will be written; all parent directories must "
+            + "already exist>");
+      System.err.println("  -envVar <environment variable to be inserted "
+            + "into .dsp file, substituting for path given in "
+            + "-sourceBase. Example: HotSpotWorkSpace>");
+      System.err.println("  -dllLoc <path to directory in which to put "
+            + "jvm.dll; no trailing slash>");
+      System.err.println("  If any of the above are specified, "
+            + "they must all be.");
+      System.err.println("  Note: if '-altRelativeInclude' option below is "
+            + "used, then the '-relativeAltSrcInclude' option must be used "
+            + "to specify the alternate source dir, e.g., 'src\\closed'");
+      System.err.println("  Additional, optional arguments, which can be "
+            + "specified multiple times:");
+      System.err.println("    -absoluteInclude <string containing absolute "
+            + "path to include directory>");
+      System.err.println("    -altRelativeInclude <string containing "
+            + "alternate include directory relative to -envVar>");
+      System.err.println("    -relativeInclude <string containing include "
+            + "directory relative to -envVar>");
+      System.err.println("    -define <preprocessor flag to be #defined "
+            + "(note: doesn't yet support " + "#define (flag) (value))>");
+      System.err.println("    -perFileLine <file> <line>");
+      System.err.println("    -conditionalPerFileLine <file> <line for "
+            + "release build> <line for debug build>");
+      System.err.println("  (NOTE: To work around a bug in nmake, where "
+            + "you can't have a '#' character in a quoted "
+            + "string, all of the lines outputted have \"#\"" + "prepended)");
+      System.err.println("    -startAt <subdir of sourceBase>");
+      System.err.println("    -ignoreFile <file which won't be able to be "
+            + "found in the sourceBase because it's generated " + "later>");
+      System.err.println("    -additionalFile <file not in database but "
+            + "which should show up in .dsp file>");
+      System.err
+            .println("    -additionalGeneratedFile <environment variable of "
+                  + "generated file's location> <relative path to "
+                  + "directory containing file; no trailing slash> "
+                  + "<name of file generated later in the build process>");
+      System.err.println("    -prelink <build> <desc> <cmds>:");
+      System.err
+            .println(" Generate a set of prelink commands for the given BUILD");
+      System.err
+            .println(" (\"Debug\" or \"Release\"). The prelink description and commands");
+      System.err.println(" are both quoted strings.");
+      System.err.println("    Default includes: \".\"");
+      System.err
+            .println("    Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\"");
+   }
+
+   public static void main(String[] args) {
+      try {
+         if (args.length < 3) {
+            usage();
+            System.exit(1);
+         }
+
+         String platformName = args[0];
+         Class platformClass = Class.forName(platformName);
+         WinGammaPlatform platform = (WinGammaPlatform) platformClass
+               .newInstance();
+
+         String[] platformArgs = new String[args.length - 1];
+         System.arraycopy(args, 1, platformArgs, 0, platformArgs.length);
+
+         // Allow the platform to write platform-specific files
+         platform.createVcproj(platformArgs);
+      } catch (Exception e) {
+         e.printStackTrace();
+         System.exit(1);
+      }
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/projectcreator/Util.java	Wed May 11 00:38:58 2016 +0300
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2005, 2016, 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 build.tools.projectcreator;
+
+import java.util.*;
+import java.io.File;
+
+public class Util {
+
+    static String join(String padder, Vector<String> v) {
+        return join(padder, v, false);
+    }
+
+    static String join(String padder, Vector<String> v, boolean quoted) {
+        StringBuffer sb = new StringBuffer();
+
+        for (Iterator<String> iter = v.iterator(); iter.hasNext(); ) {
+            if (quoted) {
+                sb.append('"');
+            }
+            sb.append(iter.next());
+            if (quoted) {
+                sb.append('"');
+            }
+            if (iter.hasNext()) sb.append(padder);
+        }
+
+        return sb.toString();
+    }
+
+
+    static String prefixed_join(String padder, Vector<String> v, boolean quoted) {
+        StringBuffer sb = new StringBuffer();
+
+        for (Iterator<String> iter = v.iterator(); iter.hasNext(); ) {
+            sb.append(padder);
+
+            if (quoted) {
+                sb.append('"');
+            }
+            sb.append((String)iter.next());
+            if (quoted) {
+                sb.append('"');
+            }
+        }
+
+        return sb.toString();
+    }
+
+
+    static String normalize(String file) {
+        file = file.replace('\\', '/');
+        if (file.length() > 2) {
+            if (file.charAt(1) == ':' && file.charAt(2) == '/') {
+                // convert drive letter to uppercase
+                String drive = file.substring(0, 1).toUpperCase();
+                return drive + file.substring(1);
+            }
+        }
+        return file;
+    }
+
+    static String sep = File.separator;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/projectcreator/WinGammaPlatform.java	Wed May 11 00:38:58 2016 +0300
@@ -0,0 +1,685 @@
+/*
+ * Copyright (c) 1999, 2016, 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 build.tools.projectcreator;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Stack;
+import java.util.Vector;
+
+abstract class HsArgHandler extends ArgHandler {
+    static final int STRING = 1;
+    static final int VECTOR = 2;
+    static final int HASH   = 3;
+
+    boolean nextNotKey(ArgIterator it) {
+        if (it.next()) {
+            String s = it.get();
+            return (s.length() == 0) || (s.charAt(0) != '-');
+        } else {
+            return false;
+        }
+    }
+
+    void empty(String key, String message) {
+        if (key != null) {
+            System.err.println("** Error: empty " + key);
+        }
+        if (message != null) {
+            System.err.println(message);
+        }
+        WinGammaPlatform.usage();
+    }
+
+    static String getCfg(String val) {
+        int under = val.indexOf('_');
+        int len = val.length();
+        if (under != -1 && under < len - 1) {
+            return val.substring(under+1, len);
+        } else {
+            return null;
+        }
+    }
+}
+
+class ArgRuleSpecific extends ArgRule {
+    ArgRuleSpecific(String arg, ArgHandler handler) {
+        super(arg, handler);
+    }
+
+    boolean match(String rulePattern, String arg) {
+        return rulePattern.startsWith(arg);
+    }
+}
+
+
+class SpecificHsArgHandler extends HsArgHandler {
+
+    String message, argKey, valKey;
+    int type;
+
+    public void handle(ArgIterator it) {
+        String cfg = getCfg(it.get());
+        if (nextNotKey(it)) {
+            String val = it.get();
+            switch (type) {
+            case VECTOR:
+                BuildConfig.addFieldVector(cfg, valKey, val);
+                break;
+            case HASH:
+                BuildConfig.putFieldHash(cfg, valKey, val, "1");
+                break;
+            case STRING:
+                BuildConfig.putField(cfg, valKey, val);
+                break;
+            default:
+                empty(valKey, "Unknown type: "+type);
+            }
+            it.next();
+
+        } else {
+            empty(argKey, message);
+        }
+    }
+
+    SpecificHsArgHandler(String argKey, String valKey, String message, int type) {
+        this.argKey = argKey;
+        this.valKey = valKey;
+        this.message = message;
+        this.type = type;
+    }
+}
+
+
+class HsArgRule extends ArgRuleSpecific {
+
+    HsArgRule(String argKey, String valKey, String message, int type) {
+        super(argKey, new SpecificHsArgHandler(argKey, valKey, message, type));
+    }
+
+}
+
+public abstract class WinGammaPlatform {
+
+    public boolean fileNameStringEquality(String s1, String s2) {
+        return s1.equalsIgnoreCase(s2);
+    }
+
+    static void usage() throws IllegalArgumentException {
+        System.err.println("WinGammaPlatform platform-specific options:");
+        System.err.println("  -sourceBase <path to directory (workspace) " +
+                           "containing source files; no trailing slash>");
+        System.err.println("  -projectFileName <full pathname to which project file " +
+                           "will be written; all parent directories must " +
+                           "already exist>");
+        System.err.println("  If any of the above are specified, "+
+                           "they must all be.");
+        System.err.println("  Note: if '-altRelativeInclude' option below " +
+                           "is used, then the '-relativeAltSrcInclude' " +
+                           "option must be used to specify the alternate " +
+                           "source dir, e.g., 'src\\closed'");
+        System.err.println("  Additional, optional arguments, which can be " +
+                           "specified multiple times:");
+        System.err.println("    -absoluteInclude <string containing absolute " +
+                           "path to include directory>");
+        System.err.println("    -altRelativeInclude <string containing " +
+                           "alternate include directory relative to " +
+                           "-sourceBase>");
+        System.err.println("    -relativeInclude <string containing include " +
+                           "directory relative to -sourceBase>");
+        System.err.println("    -define <preprocessor flag to be #defined " +
+                           "(note: doesn't yet support " +
+                           "#define (flag) (value))>");
+        System.err.println("    -startAt <subdir of sourceBase>");
+        System.err.println("    -additionalFile <file not in database but " +
+                           "which should show up in project file>");
+        System.err.println("    -additionalGeneratedFile <absolute path to " +
+                           "directory containing file; no trailing slash> " +
+                           "<name of file generated later in the build process>");
+        throw new IllegalArgumentException();
+    }
+
+
+    public void addPerFileLine(Hashtable table,
+                               String fileName,
+                               String line) {
+        Vector v = (Vector) table.get(fileName);
+        if (v != null) {
+            v.add(line);
+        } else {
+            v = new Vector();
+            v.add(line);
+            table.put(fileName, v);
+        }
+    }
+
+    protected static class PerFileCondData {
+        public String releaseString;
+        public String debugString;
+    }
+
+    protected void addConditionalPerFileLine(Hashtable table,
+                                           String fileName,
+                                           String releaseLine,
+                                           String debugLine) {
+        PerFileCondData data = new PerFileCondData();
+        data.releaseString = releaseLine;
+        data.debugString = debugLine;
+        Vector v = (Vector) table.get(fileName);
+        if (v != null) {
+            v.add(data);
+        } else {
+            v = new Vector();
+            v.add(data);
+            table.put(fileName, v);
+        }
+    }
+
+    protected static class PrelinkCommandData {
+      String description;
+      String commands;
+    }
+
+    protected void addPrelinkCommand(Hashtable table,
+                                     String build,
+                                     String description,
+                                     String commands) {
+      PrelinkCommandData data = new PrelinkCommandData();
+      data.description = description;
+      data.commands = commands;
+      table.put(build, data);
+    }
+
+    public boolean findString(Vector v, String s) {
+        for (Iterator iter = v.iterator(); iter.hasNext(); ) {
+            if (((String) iter.next()).equals(s)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+     String getProjectName(String fullPath, String extension)
+        throws IllegalArgumentException, IOException {
+        File file = new File(fullPath).getCanonicalFile();
+        fullPath = file.getCanonicalPath();
+        String parent = file.getParent();
+
+        if (!fullPath.endsWith(extension)) {
+            throw new IllegalArgumentException("project file name \"" +
+                                               fullPath +
+                                               "\" does not end in "+extension);
+        }
+
+        if ((parent != null) &&
+            (!fullPath.startsWith(parent))) {
+            throw new RuntimeException(
+                "Internal error: parent of file name \"" + parent +
+                "\" does not match file name \"" + fullPath + "\""
+            );
+        }
+
+        int len = parent.length();
+        if (!parent.endsWith(Util.sep)) {
+            len += Util.sep.length();
+        }
+
+        int end = fullPath.length() - extension.length();
+
+        if (len == end) {
+            throw new RuntimeException(
+                "Internal error: file name was empty"
+            );
+        }
+
+        return fullPath.substring(len, end);
+    }
+
+    protected abstract String getProjectExt();
+
+    public void createVcproj(String[] args)
+        throws IllegalArgumentException, IOException {
+
+        parseArguments(args);
+
+        String projectFileName = BuildConfig.getFieldString(null, "ProjectFileName");
+        String ext = getProjectExt();
+
+        String projectName = getProjectName(projectFileName, ext);
+
+        writeProjectFile(projectFileName, projectName, createAllConfigs(BuildConfig.getFieldString(null, "PlatformName")));
+    }
+
+    protected void writePrologue(String[] args) {
+        System.err.println("WinGammaPlatform platform-specific arguments:");
+        for (int i = 0; i < args.length; i++) {
+            System.err.print(args[i] + " ");
+        }
+        System.err.println();
+    }
+
+
+    void parseArguments(String[] args) {
+        new ArgsParser(args,
+                       new ArgRule[]
+            {
+                new ArgRule("-sourceBase",
+                            new HsArgHandler() {
+                                public void handle(ArgIterator it) {
+                                   String cfg = getCfg(it.get());
+                                   if (nextNotKey(it)) {
+                                      String sb = (String) it.get();
+                                      if (sb.endsWith(Util.sep)) {
+                                         sb = sb.substring(0, sb.length() - 1);
+                                      }
+                                      BuildConfig.putField(cfg, "SourceBase", sb);
+                                      it.next();
+                                   } else {
+                                      empty("-sourceBase", null);
+                                   }
+                                }
+                            }
+                            ),
+
+                new HsArgRule("-buildBase",
+                              "BuildBase",
+                              "   (Did you set the HotSpotBuildSpace environment variable?)",
+                              HsArgHandler.STRING
+                              ),
+
+               new HsArgRule("-buildSpace",
+                              "BuildSpace",
+                              null,
+                              HsArgHandler.STRING
+                              ),
+
+               new HsArgRule("-makeBinary",
+                              "MakeBinary",
+                              null,
+                              HsArgHandler.STRING
+                              ),
+
+               new HsArgRule("-makeOutput",
+                              "MakeOutput",
+                              null,
+                              HsArgHandler.STRING
+                              ),
+
+              new HsArgRule("-platformName",
+                              "PlatformName",
+                              null,
+                              HsArgHandler.STRING
+                              ),
+
+              new HsArgRule("-projectFileName",
+                              "ProjectFileName",
+                              null,
+                              HsArgHandler.STRING
+                              ),
+
+                new HsArgRule("-jdkTargetRoot",
+                              "JdkTargetRoot",
+                              "   (Did you set the HotSpotJDKDist environment variable?)",
+                              HsArgHandler.STRING
+                              ),
+
+                new HsArgRule("-compiler",
+                              "CompilerVersion",
+                              "   (Did you set the VcVersion correctly?)",
+                              HsArgHandler.STRING
+                              ),
+
+                new HsArgRule("-absoluteInclude",
+                              "AbsoluteInclude",
+                              null,
+                              HsArgHandler.VECTOR
+                              ),
+
+                new HsArgRule("-altRelativeInclude",
+                              "AltRelativeInclude",
+                              null,
+                              HsArgHandler.VECTOR
+                              ),
+
+                new HsArgRule("-relativeInclude",
+                              "RelativeInclude",
+                              null,
+                              HsArgHandler.VECTOR
+                              ),
+
+                new HsArgRule("-absoluteSrcInclude",
+                              "AbsoluteSrcInclude",
+                              null,
+                              HsArgHandler.VECTOR
+                              ),
+
+                new HsArgRule("-relativeAltSrcInclude",
+                              "RelativeAltSrcInclude",
+                              null,
+                              HsArgHandler.STRING
+                              ),
+
+                new HsArgRule("-relativeSrcInclude",
+                              "RelativeSrcInclude",
+                              null,
+                              HsArgHandler.VECTOR
+                              ),
+
+                new HsArgRule("-define",
+                              "Define",
+                              null,
+                              HsArgHandler.VECTOR
+                              ),
+
+                new HsArgRule("-useToGeneratePch",
+                              "UseToGeneratePch",
+                              null,
+                              HsArgHandler.STRING
+                              ),
+
+                new ArgRuleSpecific("-perFileLine",
+                            new HsArgHandler() {
+                                public void handle(ArgIterator it) {
+                                    String cfg = getCfg(it.get());
+                                    if (nextNotKey(it)) {
+                                        String fileName = it.get();
+                                        if (nextNotKey(it)) {
+                                            String line = it.get();
+                                            BuildConfig.putFieldHash(cfg, "PerFileLine", fileName, line);
+                                            it.next();
+                                            return;
+                                        }
+                                    }
+                                    empty(null, "** Error: wrong number of args to -perFileLine");
+                                }
+                            }
+                            ),
+
+                new ArgRuleSpecific("-conditionalPerFileLine",
+                            new HsArgHandler() {
+                                public void handle(ArgIterator it) {
+                                    String cfg = getCfg(it.get());
+                                    if (nextNotKey(it)) {
+                                        String fileName = it.get();
+                                        if (nextNotKey(it)) {
+                                            String productLine = it.get();
+                                            if (nextNotKey(it)) {
+                                                String debugLine = it.get();
+                                                BuildConfig.putFieldHash(cfg+"_debug", "CondPerFileLine",
+                                                                         fileName, debugLine);
+                                                BuildConfig.putFieldHash(cfg+"_product", "CondPerFileLine",
+                                                                         fileName, productLine);
+                                                it.next();
+                                                return;
+                                            }
+                                        }
+                                    }
+
+                                    empty(null, "** Error: wrong number of args to -conditionalPerFileLine");
+                                }
+                            }
+                            ),
+
+                new HsArgRule("-disablePch",
+                              "DisablePch",
+                              null,
+                              HsArgHandler.HASH
+                              ),
+
+                new ArgRule("-startAt",
+                            new HsArgHandler() {
+                                public void handle(ArgIterator it) {
+                                    if (BuildConfig.getField(null, "StartAt") != null) {
+                                        empty(null, "** Error: multiple -startAt");
+                                    }
+                                    if (nextNotKey(it)) {
+                                        BuildConfig.putField(null, "StartAt", it.get());
+                                        it.next();
+                                    } else {
+                                        empty("-startAt", null);
+                                    }
+                                }
+                            }
+                            ),
+
+                new HsArgRule("-ignoreFile",
+                                      "IgnoreFile",
+                                      null,
+                                      HsArgHandler.HASH
+                                      ),
+
+                new HsArgRule("-ignorePath",
+                              "IgnorePath",
+                              null,
+                              HsArgHandler.VECTOR
+                              ),
+
+                new HsArgRule("-hidePath",
+                      "HidePath",
+                      null,
+                      HsArgHandler.VECTOR
+                      ),
+
+                new HsArgRule("-additionalFile",
+                              "AdditionalFile",
+                              null,
+                              HsArgHandler.VECTOR
+                              ),
+
+                new ArgRuleSpecific("-additionalGeneratedFile",
+                            new HsArgHandler() {
+                                public void handle(ArgIterator it) {
+                                    String cfg = getCfg(it.get());
+                                    if (nextNotKey(it)) {
+                                        String dir = it.get();
+                                        if (nextNotKey(it)) {
+                                            String fileName = it.get();
+                                            BuildConfig.putFieldHash(cfg, "AdditionalGeneratedFile",
+                                                                     Util.normalize(dir + Util.sep + fileName),
+                                                                     fileName);
+                                            it.next();
+                                            return;
+                                        }
+                                    }
+                                    empty(null, "** Error: wrong number of args to -additionalGeneratedFile");
+                                }
+                            }
+                            ),
+
+                new ArgRule("-prelink",
+                            new HsArgHandler() {
+                                public void handle(ArgIterator it) {
+                                    if (nextNotKey(it)) {
+                                        if (nextNotKey(it)) {
+                                            String description = it.get();
+                                            if (nextNotKey(it)) {
+                                                String command = it.get();
+                                                BuildConfig.putField(null, "PrelinkDescription", description);
+                                                BuildConfig.putField(null, "PrelinkCommand", command);
+                                                it.next();
+                                                return;
+                                            }
+                                        }
+                                    }
+
+                                    empty(null,  "** Error: wrong number of args to -prelink");
+                                }
+                            }
+                            ),
+
+                new ArgRule("-postbuild",
+                            new HsArgHandler() {
+                                public void handle(ArgIterator it) {
+                                    if (nextNotKey(it)) {
+                                        if (nextNotKey(it)) {
+                                            String description = it.get();
+                                            if (nextNotKey(it)) {
+                                                String command = it.get();
+                                                BuildConfig.putField(null, "PostbuildDescription", description);
+                                                BuildConfig.putField(null, "PostbuildCommand", command);
+                                                it.next();
+                                                return;
+                                            }
+                                        }
+                                    }
+
+                                    empty(null,  "** Error: wrong number of args to -postbuild");
+                                }
+                            }
+                            ),
+            },
+                                       new ArgHandler() {
+                                           public void handle(ArgIterator it) {
+
+                                               throw new RuntimeException("Arg Parser: unrecognized option "+it.get());
+                                           }
+                                       }
+                                       );
+        if (BuildConfig.getField(null, "SourceBase") == null      ||
+            BuildConfig.getField(null, "BuildBase") == null       ||
+            BuildConfig.getField(null, "ProjectFileName") == null ||
+            BuildConfig.getField(null, "CompilerVersion") == null) {
+            usage();
+        }
+
+        BuildConfig.putField(null, "PlatformObject", this);
+    }
+
+    Vector createAllConfigs(String platform) {
+        Vector allConfigs = new Vector();
+
+        allConfigs.add(new C1DebugConfig());
+        allConfigs.add(new C1FastDebugConfig());
+        allConfigs.add(new C1ProductConfig());
+
+        allConfigs.add(new TieredDebugConfig());
+        allConfigs.add(new TieredFastDebugConfig());
+        allConfigs.add(new TieredProductConfig());
+
+        return allConfigs;
+    }
+
+    PrintWriter printWriter;
+
+    public void writeProjectFile(String projectFileName, String projectName,
+                                 Vector<BuildConfig> allConfigs) throws IOException {
+        throw new RuntimeException("use compiler version specific version");
+    }
+
+    int indent;
+    private Stack<String> tagStack = new Stack<String>();
+
+    private void startTagPrim(String name, String[] attrs, boolean close) {
+       startTagPrim(name, attrs, close, true);
+    }
+
+    private void startTagPrim(String name, String[] attrs, boolean close,
+          boolean newline) {
+       doIndent();
+       printWriter.print("<" + name);
+       indent++;
+
+       if (attrs != null && attrs.length > 0) {
+          for (int i = 0; i < attrs.length; i += 2) {
+             printWriter.print(" " + attrs[i] + "=\"" + attrs[i + 1] + "\"");
+             if (i < attrs.length - 2) {
+             }
+          }
+       }
+
+       if (close) {
+          indent--;
+          printWriter.print(" />");
+       } else {
+          // TODO push tag name, and change endTag to pop and print.
+          tagStack.push(name);
+          printWriter.print(">");
+       }
+       if (newline) {
+          printWriter.println();
+       }
+    }
+
+    void startTag(String name, String... attrs) {
+       startTagPrim(name, attrs, false);
+    }
+
+    void startTagV(String name, Vector attrs) {
+       String s[] = new String[attrs.size()];
+       for (int i = 0; i < attrs.size(); i++) {
+          s[i] = (String) attrs.elementAt(i);
+       }
+       startTagPrim(name, s, false);
+    }
+
+    void endTag() {
+       String name = tagStack.pop();
+       indent--;
+       doIndent();
+       printWriter.println("</" + name + ">");
+    }
+
+    private void endTagNoIndent() {
+       String name = tagStack.pop();
+       indent--;
+       printWriter.println("</" + name + ">");
+    }
+
+    void tag(String name, String... attrs) {
+       startTagPrim(name, attrs, true);
+    }
+
+    void tagData(String name, String data) {
+       startTagPrim(name, null, false, false);
+       printWriter.print(data);
+       endTagNoIndent();
+    }
+
+    void tagData(String name, String data, String... attrs) {
+       startTagPrim(name, attrs, false, false);
+       printWriter.print(data);
+       endTagNoIndent();
+    }
+
+    void tagV(String name, Vector attrs) {
+       String s[] = new String[attrs.size()];
+       for (int i = 0; i < attrs.size(); i++) {
+          s[i] = (String) attrs.elementAt(i);
+       }
+       startTagPrim(name, s, true);
+    }
+
+    void doIndent() {
+       for (int i = 0; i < indent; i++) {
+          printWriter.print("  ");
+       }
+    }
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/src/classes/build/tools/projectcreator/WinGammaPlatformVC10.java	Wed May 11 00:38:58 2016 +0300
@@ -0,0 +1,471 @@
+/*
+ * Copyright (c) 2011, 2016, 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 build.tools.projectcreator;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.nio.file.FileSystems;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.UUID;
+import java.util.Vector;
+
+public class WinGammaPlatformVC10 extends WinGammaPlatform {
+
+
+   LinkedList <String>filters = new LinkedList<String>();
+   LinkedList <String[]>filterDeps = new LinkedList<String[]>();
+
+    @Override
+    protected String getProjectExt() {
+        return ".vcxproj";
+    }
+
+    @Override
+    public void writeProjectFile(String projectFileName, String projectName,
+            Vector<BuildConfig> allConfigs) throws IOException {
+        System.out.println();
+        System.out.println("    Writing .vcxproj file: " + projectFileName);
+
+        String projDir = Util.normalize(new File(projectFileName).getParent());
+
+        printWriter = new PrintWriter(projectFileName, "UTF-8");
+        printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
+        startTag("Project",
+                "DefaultTargets", "Build",
+                "ToolsVersion", "4.0",
+                "xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
+        startTag("ItemGroup",
+                "Label", "ProjectConfigurations");
+        for (BuildConfig cfg : allConfigs) {
+            startTag("ProjectConfiguration",
+                    "Include", cfg.get("Name"));
+            tagData("Configuration", cfg.get("Id"));
+            tagData("Platform", cfg.get("PlatformName"));
+            endTag();
+        }
+        endTag();
+
+        startTag("PropertyGroup", "Label", "Globals");
+        tagData("ProjectGuid", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}");
+        tagData("Keyword", "MakeFileProj");
+        tag("SccProjectName");
+        tag("SccLocalPath");
+        endTag();
+
+        tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props");
+
+        for (BuildConfig cfg : allConfigs) {
+            startTag(cfg, "PropertyGroup", "Label", "Configuration");
+            tagData("ConfigurationType", "Makefile");
+            tagData("UseDebugLibraries", "true");
+            endTag();
+        }
+
+        tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.props");
+        startTag("ImportGroup", "Label", "ExtensionSettings");
+        endTag();
+        for (BuildConfig cfg : allConfigs) {
+            startTag(cfg, "ImportGroup", "Label", "PropertySheets");
+            tag("Import",
+                    "Project", "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props",
+                    "Condition", "exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')",
+                    "Label", "LocalAppDataPlatform");
+            endTag();
+        }
+
+        tag("PropertyGroup", "Label", "UserMacros");
+
+        startTag("PropertyGroup");
+        tagData("_ProjectFileVersion", "10.0.30319.1");
+        for (BuildConfig cfg : allConfigs) {
+            tagData(cfg, "OutDir", cfg.get("OutputDir") + Util.sep);
+            tagData(cfg, "IntDir", cfg.get("OutputDir") + Util.sep);
+            tagData(cfg, "LinkIncremental", "false");
+        }
+        for (BuildConfig cfg : allConfigs) {
+            tagData(cfg, "CodeAnalysisRuleSet", "AllRules.ruleset");
+            tag(cfg, "CodeAnalysisRules");
+            tag(cfg, "CodeAnalysisRuleAssemblies");
+        }
+        for (BuildConfig cfg : allConfigs) {
+            tagData(cfg, "NMakeBuildCommandLine", cfg.get("MakeBinary") + " -f ../../Makefile import-hotspot LOG=info");
+            tagData(cfg, "NMakeReBuildCommandLine", cfg.get("MakeBinary") + " -f ../../Makefile clean-hotspot import-hotspot LOG=info");
+            tagData(cfg, "NMakeCleanCommandLine", cfg.get("MakeBinary") + " -f ../../Makefile clean-hotspot LOG=info");
+            tagData(cfg, "NMakeOutput", cfg.get("MakeOutput") + Util.sep + "jvm.dll");
+            tagData(cfg, "NMakePreprocessorDefinitions", Util.join(";", cfg.getDefines()));
+            tagData(cfg, "NMakeIncludeSearchPath", Util.join(";", cfg.getIncludes()));
+        }
+        endTag();
+
+        for (BuildConfig cfg : allConfigs) {
+            startTag(cfg, "ItemDefinitionGroup");
+            startTag("ClCompile");
+            tagV(cfg.getV("CompilerFlags"));
+            endTag();
+
+            startTag("Link");
+            tagV(cfg.getV("LinkerFlags"));
+            endTag();
+
+            endTag();
+        }
+
+        writeFiles(allConfigs, projDir);
+
+        tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets");
+        startTag("ImportGroup", "Label", "ExtensionTargets");
+        endTag();
+
+        endTag();
+        printWriter.close();
+        System.out.println("    Done writing .vcxproj file.");
+
+        writeFilterFile(projectFileName, projectName, allConfigs, projDir);
+        writeUserFile(projectFileName, allConfigs);
+    }
+
+
+    private void writeUserFile(String projectFileName, Vector<BuildConfig> allConfigs) throws FileNotFoundException, UnsupportedEncodingException {
+        String userFileName = projectFileName + ".user";
+        if (new File(userFileName).exists()) {
+            return;
+        }
+        System.out.print("    Writing .vcxproj.user file: " + userFileName);
+        printWriter = new PrintWriter(userFileName, "UTF-8");
+
+        printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
+        startTag("Project",
+                "ToolsVersion", "4.0",
+                "xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
+
+        for (BuildConfig cfg : allConfigs) {
+            startTag(cfg, "PropertyGroup");
+            tagData("LocalDebuggerCommand", cfg.get("JdkTargetRoot") + "\\bin\\java.exe");
+            // Since we run "make hotspot-import", we get the correct jvm.dll by java.exe.
+            // The '-XX:+PauseAtExit' option
+            // causes the VM to wait for key press before exiting; this
+            // allows any stdout or stderr messages to be seen before
+            // the cmdtool exits.
+            tagData("LocalDebuggerCommandArguments",
+                    "-XX:+UnlockDiagnosticVMOptions -XX:+PauseAtExit");
+            tagData("LocalDebuggerEnvironment", "JAVA_HOME=" + cfg.get("JdkTargetRoot"));
+            endTag();
+        }
+
+        endTag();
+        printWriter.close();
+        System.out.println("    Done.");
+    }
+
+    public void addFilter(String rPath) {
+       filters.add(rPath);
+    }
+
+    public void addFilterDependency(String fileLoc, String filter) {
+      filterDeps.add(new String[] {fileLoc, filter});
+    }
+
+    private void writeFilterFile(String projectFileName, String projectName,
+            Vector<BuildConfig> allConfigs, String base) throws FileNotFoundException, UnsupportedEncodingException {
+        String filterFileName = projectFileName + ".filters";
+        System.out.print("    Writing .vcxproj.filters file: " + filterFileName);
+        printWriter = new PrintWriter(filterFileName, "UTF-8");
+
+        printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
+        startTag("Project",
+                "ToolsVersion", "4.0",
+                "xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
+
+        startTag("ItemGroup");
+        for (String filter : filters) {
+           startTag("Filter", "Include",filter);
+           UUID uuid = UUID.randomUUID();
+           tagData("UniqueIdentifier", "{" + uuid.toString() + "}");
+           endTag();
+        }
+        endTag();
+
+        //TODO - do I need to split cpp and hpp files?
+
+        // then all files
+        startTag("ItemGroup");
+        for (String[] dep : filterDeps) {
+           String tagName = getFileTagFromSuffix(dep[0]);
+
+           startTag(tagName, "Include", dep[0]);
+           tagData("Filter", dep[1]);
+           endTag();
+        }
+        endTag();
+
+        endTag();
+        printWriter.close();
+        System.out.println("    Done.");
+    }
+
+    public String getFileTagFromSuffix(String fileName) {
+       if (fileName.endsWith(".cpp")) {
+          return"ClCompile";
+       } else if (fileName.endsWith(".c")) {
+          return "ClCompile";
+       } else if (fileName.endsWith(".hpp")) {
+          return"ClInclude";
+       } else if (fileName.endsWith(".h")) {
+          return "ClInclude";
+       } else {
+          return"None";
+       }
+    }
+
+    void writeFiles(Vector<BuildConfig> allConfigs, String projDir) {
+       // This code assummes there are no config specific includes.
+       startTag("ItemGroup");
+
+       String sourceBase = BuildConfig.getFieldString(null, "SourceBase");
+
+       // Use first config for all global absolute includes.
+       BuildConfig baseConfig = allConfigs.firstElement();
+       Vector<String> rv = new Vector<String>();
+
+       // Then use first config for all relative includes
+       Vector<String> ri = new Vector<String>();
+       baseConfig.collectRelevantVectors(ri, "RelativeSrcInclude");
+       for (String f : ri) {
+          rv.add(sourceBase + Util.sep + f);
+       }
+
+       baseConfig.collectRelevantVectors(rv, "AbsoluteSrcInclude");
+
+       handleIncludes(rv, allConfigs);
+
+       endTag();
+    }
+
+    // Will visit file tree for each include
+    private void handleIncludes(Vector<String> includes, Vector<BuildConfig> allConfigs) {
+       for (String path : includes)  {
+          FileTreeCreatorVC10 ftc = new FileTreeCreatorVC10(FileSystems.getDefault().getPath(path) , allConfigs, this);
+          try {
+             ftc.writeFileTree();
+          } catch (IOException e) {
+             e.printStackTrace();
+          }
+       }
+    }
+
+    String buildCond(BuildConfig cfg) {
+        return "'$(Configuration)|$(Platform)'=='"+cfg.get("Name")+"'";
+    }
+
+    void tagV(Vector<String> v) {
+        Iterator<String> i = v.iterator();
+        while(i.hasNext()) {
+            String name = i.next();
+            String data = i.next();
+            tagData(name, data);
+        }
+    }
+
+    void tagData(BuildConfig cfg, String name, String data) {
+        tagData(name, data, "Condition", buildCond(cfg));
+    }
+
+    void tag(BuildConfig cfg, String name, String... attrs) {
+        String[] ss = new String[attrs.length + 2];
+        ss[0] = "Condition";
+        ss[1] = buildCond(cfg);
+        System.arraycopy(attrs, 0, ss, 2, attrs.length);
+
+        tag(name, ss);
+    }
+
+    void startTag(BuildConfig cfg, String name, String... attrs) {
+        String[] ss = new String[attrs.length + 2];
+        ss[0] = "Condition";
+        ss[1] = buildCond(cfg);
+        System.arraycopy(attrs, 0, ss, 2, attrs.length);
+
+        startTag(name, ss);
+    }
+
+}
+
+class CompilerInterfaceVC10 extends CompilerInterface {
+
+    @Override
+    Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) {
+        Vector rv = new Vector();
+
+        addAttr(rv, "AdditionalIncludeDirectories", Util.join(";", includes));
+        addAttr(rv, "PreprocessorDefinitions",
+                Util.join(";", defines).replace("\\\"", "\""));
+        addAttr(rv, "PrecompiledHeaderFile", "precompiled.hpp");
+        addAttr(rv, "PrecompiledHeaderOutputFile", outDir+Util.sep+"vm.pch");
+        addAttr(rv, "AssemblerListingLocation", outDir);
+        addAttr(rv, "ObjectFileName", outDir+Util.sep);
+        addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"jvm.pdb");
+        // Set /nologo option
+        addAttr(rv, "SuppressStartupBanner", "true");
+        // Surpass the default /Tc or /Tp.
+        addAttr(rv, "CompileAs", "Default");
+        // Set /W3 option.
+        addAttr(rv, "WarningLevel", "Level3");
+        // Set /WX option,
+        addAttr(rv, "TreatWarningAsError", "true");
+        // Set /GS option
+        addAttr(rv, "BufferSecurityCheck", "false");
+        // Set /Zi option.
+        addAttr(rv, "DebugInformationFormat", "ProgramDatabase");
+        // Set /Yu option.
+        addAttr(rv, "PrecompiledHeader", "Use");
+        // Set /EHsc- option
+        addAttr(rv, "ExceptionHandling", "");
+
+        addAttr(rv, "MultiProcessorCompilation", "true");
+
+        return rv;
+    }
+
+    @Override
+    Vector getDebugCompilerFlags(String opt, String platformName) {
+        Vector rv = new Vector();
+
+        // Set /On option
+        addAttr(rv, "Optimization", opt);
+        // Set /MD option.
+        addAttr(rv, "RuntimeLibrary", "MultiThreadedDLL");
+        // Set /Oy- option
+        addAttr(rv, "OmitFramePointers", "false");
+        // Set /homeparams for x64 debug builds
+        if(platformName.equals("x64")) {
+            addAttr(rv, "AdditionalOptions", "/homeparams");
+        }
+
+        return rv;
+    }
+
+    @Override
+    Vector getProductCompilerFlags() {
+        Vector rv = new Vector();
+
+        // Set /O2 option.
+        addAttr(rv, "Optimization", "MaxSpeed");
+        // Set /Oy- option
+        addAttr(rv, "OmitFramePointers", "false");
+        // Set /Ob option.  1 is expandOnlyInline
+        addAttr(rv, "InlineFunctionExpansion", "OnlyExplicitInline");
+        // Set /GF option.
+        addAttr(rv, "StringPooling", "true");
+        // Set /MD option. 2 is rtMultiThreadedDLL
+        addAttr(rv, "RuntimeLibrary", "MultiThreadedDLL");
+        // Set /Gy option
+        addAttr(rv, "FunctionLevelLinking", "true");
+
+        return rv;
+    }
+
+    @Override
+    Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) {
+        Vector rv = new Vector();
+
+        if(platformName.equals("Win32")) {
+            addAttr(rv, "AdditionalOptions",
+                    "/export:JNI_GetDefaultJavaVMInitArgs " +
+                    "/export:JNI_CreateJavaVM " +
+                    "/export:JVM_FindClassFromBootLoader "+
+                    "/export:JNI_GetCreatedJavaVMs "+
+                    "/export:jio_snprintf /export:jio_printf "+
+                    "/export:jio_fprintf /export:jio_vfprintf "+
+                    "/export:jio_vsnprintf "+
+                    "/export:JVM_GetVersionInfo "+
+                    "/export:JVM_InitAgentProperties");
+        }
+        addAttr(rv, "AdditionalDependencies", "kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;Wsock32.lib;winmm.lib;psapi.lib;version.lib");
+        addAttr(rv, "OutputFile", outDll);
+        addAttr(rv, "SuppressStartupBanner", "true");
+        addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def");
+        addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"jvm.pdb");
+        addAttr(rv, "SubSystem", "Windows");
+        addAttr(rv, "BaseAddress", "0x8000000");
+        addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib");
+
+        if(platformName.equals("Win32")) {
+            addAttr(rv, "TargetMachine", "MachineX86");
+        } else {
+            addAttr(rv, "TargetMachine", "MachineX64");
+        }
+
+        // We always want the /DEBUG option to get full symbol information in the pdb files
+        addAttr(rv, "GenerateDebugInformation", "true");
+
+        return rv;
+    }
+
+    @Override
+    Vector getDebugLinkerFlags() {
+        Vector rv = new Vector();
+
+        // Empty now that /DEBUG option is used by all configs
+
+        return rv;
+    }
+
+    @Override
+    Vector getProductLinkerFlags() {
+        Vector rv = new Vector();
+
+        // Set /OPT:REF option.
+        addAttr(rv, "OptimizeReferences", "true");
+        // Set /OPT:ICF option.
+        addAttr(rv, "EnableCOMDATFolding", "true");
+
+        return rv;
+    }
+
+    @Override
+    void getAdditionalNonKernelLinkerFlags(Vector rv) {
+        extAttr(rv, "AdditionalOptions", " /export:AsyncGetCallTrace");
+    }
+
+    @Override
+    String getOptFlag() {
+        return "MaxSpeed";
+    }
+
+    @Override
+    String getNoOptFlag() {
+        return "Disabled";
+    }
+
+    @Override
+    String makeCfgName(String flavourBuild, String platform) {
+        return  flavourBuild + "|" + platform;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/test/GtestImage.gmk	Wed May 11 00:38:58 2016 +0300
@@ -0,0 +1,67 @@
+#
+# Copyright (c) 2016, 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.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# 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.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+
+$(foreach v, $(JVM_VARIANTS), \
+  $(eval $(call SetupCopyFiles, COPY_GTEST_$v, \
+      SRC := $(HOTSPOT_OUTPUTDIR)/variant-$v/libjvm/gtest, \
+      DEST := $(TEST_IMAGE_DIR)/hotspot/gtest/$v, \
+      FILES := $(call SHARED_LIBRARY,jvm) gtestLauncher$(EXE_SUFFIX), \
+  )) \
+  $(eval TARGETS += $$(COPY_GTEST_$v)) \
+)
+
+ifeq ($(OPENJDK_TARGET_OS), windows)
+  $(foreach v, $(JVM_VARIANTS), \
+    $(eval $(call SetupCopyFiles, COPY_GTEST_MSVCR_$v, \
+        DEST := $(TEST_IMAGE_DIR)/hotspot/gtest/$v, \
+        FILES := $(MSVCR_DLL) $(MSVCP_DLL), \
+        FLATTEN := true, \
+    )) \
+    $(eval TARGETS += $$(COPY_GTEST_MSVCR_$v)) \
+    $(eval $(call SetupCopyFiles, COPY_GTEST_PDB_$v, \
+        SRC := $(HOTSPOT_OUTPUTDIR)/variant-$v/libjvm/gtest, \
+        DEST := $(TEST_IMAGE_DIR)/hotspot/gtest/$v, \
+        FILES := jvm.pdb gtestLauncher.pdb, \
+    )) \
+    $(eval TARGETS += $$(COPY_GTEST_PDB_$v)) \
+  )
+endif
+
+ifeq ($(OPENJDK_TARGET_OS), solaris)
+  $(foreach v, $(JVM_VARIANTS), \
+    $(eval $(call SetupCopyFiles, COPY_GTEST_STLPORT_$v, \
+        DEST := $(TEST_IMAGE_DIR)/hotspot/gtest/$v, \
+        FILES := $(STLPORT_LIB), \
+    )) \
+    $(eval TARGETS += $$(COPY_GTEST_STLPORT_$v)) \
+  )
+endif
+
+all: $(TARGETS)
--- a/src/cpu/aarch64/vm/interp_masm_aarch64.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/cpu/aarch64/vm/interp_masm_aarch64.cpp	Wed May 11 00:38:58 2016 +0300
@@ -27,12 +27,12 @@
 #include "interp_masm_aarch64.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "logging/log.hpp"
 #include "oops/arrayOop.hpp"
 #include "oops/markOop.hpp"
 #include "oops/methodData.hpp"
 #include "oops/method.hpp"
 #include "prims/jvmtiExport.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "prims/jvmtiThreadState.hpp"
 #include "runtime/basicLock.hpp"
 #include "runtime/biasedLocking.hpp"
@@ -1450,7 +1450,7 @@
   }
 
   // RedefineClasses() tracing support for obsolete method entry
-  if (RC_TRACE_IN_RANGE(0x00001000, 0x00002000)) {
+  if (log_is_enabled(Trace, redefine, class, obsolete)) {
     get_method(c_rarg1);
     call_VM_leaf(
       CAST_FROM_FN_PTR(address, SharedRuntime::rc_trace_method_entry),
--- a/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp	Wed May 11 00:38:58 2016 +0300
@@ -31,9 +31,9 @@
 #include "code/vtableStubs.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interp_masm.hpp"
+#include "logging/log.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/compiledICHolder.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/vframeArray.hpp"
 #include "vmreg_aarch64.inline.hpp"
@@ -1781,7 +1781,7 @@
   }
 
   // RedefineClasses() tracing support for obsolete method entry
-  if (RC_TRACE_IN_RANGE(0x00001000, 0x00002000)) {
+  if (log_is_enabled(Trace, redefine, class, obsolete)) {
     // protect the args we've loaded
     save_args(masm, total_c_args, c_arg, out_regs);
     __ mov_metadata(c_rarg1, method());
--- a/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Wed May 11 00:38:58 2016 +0300
@@ -33,7 +33,6 @@
 #include "interpreter/interp_masm.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/compiledICHolder.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/vframeArray.hpp"
 #include "vmreg_ppc.inline.hpp"
--- a/src/cpu/ppc/vm/stubGenerator_ppc.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/cpu/ppc/vm/stubGenerator_ppc.cpp	Wed May 11 00:38:58 2016 +0300
@@ -825,17 +825,6 @@
     return start;
   }
 
-  // The following routine generates a subroutine to throw an asynchronous
-  // UnknownError when an unsafe access gets a fault that could not be
-  // reasonably prevented by the programmer.  (Example: SIGBUS/OBJERR.)
-  //
-  address generate_handler_for_unsafe_access() {
-    StubCodeMark mark(this, "StubRoutines", "handler_for_unsafe_access");
-    address start = __ function_entry();
-    __ unimplemented("StubRoutines::handler_for_unsafe_access", 93);
-    return start;
-  }
-
 #if !defined(PRODUCT)
   // Wrapper which calls oopDesc::is_oop_or_null()
   // Only called by MacroAssembler::verify_oop
@@ -3111,8 +3100,6 @@
     StubRoutines::_throw_IncompatibleClassChangeError_entry= generate_throw_exception("IncompatibleClassChangeError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_IncompatibleClassChangeError),  false);
     StubRoutines::_throw_NullPointerException_at_call_entry= generate_throw_exception("NullPointerException at call throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_NullPointerException_at_call), false);
 
-    StubRoutines::_handler_for_unsafe_access_entry         = generate_handler_for_unsafe_access();
-
     // support for verify_oop (must happen after universe_init)
     StubRoutines::_verify_oop_subroutine_entry             = generate_verify_oop();
 
--- a/src/cpu/sparc/vm/interp_masm_sparc.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/cpu/sparc/vm/interp_masm_sparc.cpp	Wed May 11 00:38:58 2016 +0300
@@ -26,13 +26,13 @@
 #include "interp_masm_sparc.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "logging/log.hpp"
 #include "oops/arrayOop.hpp"
 #include "oops/markOop.hpp"
 #include "oops/methodData.hpp"
 #include "oops/method.hpp"
 #include "oops/methodCounters.hpp"
 #include "prims/jvmtiExport.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "prims/jvmtiThreadState.hpp"
 #include "runtime/basicLock.hpp"
 #include "runtime/biasedLocking.hpp"
@@ -2645,7 +2645,7 @@
   }
 
   // RedefineClasses() tracing support for obsolete method entry
-  if (RC_TRACE_IN_RANGE(0x00001000, 0x00002000)) {
+  if (log_is_enabled(Trace, redefine, class, obsolete)) {
     call_VM_leaf(noreg,
       CAST_FROM_FN_PTR(address, SharedRuntime::rc_trace_method_entry),
       G2_thread, Lmethod);
--- a/src/cpu/sparc/vm/sharedRuntime_sparc.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/cpu/sparc/vm/sharedRuntime_sparc.cpp	Wed May 11 00:38:58 2016 +0300
@@ -28,9 +28,9 @@
 #include "code/icBuffer.hpp"
 #include "code/vtableStubs.hpp"
 #include "interpreter/interpreter.hpp"
+#include "logging/log.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/compiledICHolder.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/vframeArray.hpp"
 #include "vmreg_sparc.inline.hpp"
@@ -2450,7 +2450,7 @@
   }
 
   // RedefineClasses() tracing support for obsolete method entry
-  if (RC_TRACE_IN_RANGE(0x00001000, 0x00002000)) {
+  if (log_is_enabled(Trace, redefine, class, obsolete)) {
     // create inner frame
     __ save_frame(0);
     __ mov(G2_thread, L7_thread_cache);
--- a/src/cpu/sparc/vm/stubGenerator_sparc.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/cpu/sparc/vm/stubGenerator_sparc.cpp	Wed May 11 00:38:58 2016 +0300
@@ -64,20 +64,6 @@
 // -------------------------------------------------------------------------------------------------------------------------
 // Stub Code definitions
 
-static address handle_unsafe_access() {
-  JavaThread* thread = JavaThread::current();
-  address pc  = thread->saved_exception_pc();
-  address npc = thread->saved_exception_npc();
-  // pc is the instruction which we must emulate
-  // doing a no-op is fine:  return garbage from the load
-
-  // request an async exception
-  thread->set_pending_unsafe_access_error();
-
-  // return address of next instruction to execute
-  return npc;
-}
-
 class StubGenerator: public StubCodeGenerator {
  private:
 
@@ -746,62 +732,6 @@
   Label _atomic_add_stub;  // called from other stubs
 
 
-  //------------------------------------------------------------------------------------------------------------------------
-  // The following routine generates a subroutine to throw an asynchronous
-  // UnknownError when an unsafe access gets a fault that could not be
-  // reasonably prevented by the programmer.  (Example: SIGBUS/OBJERR.)
-  //
-  // Arguments :
-  //
-  //      trapping PC:    O7
-  //
-  // Results:
-  //     posts an asynchronous exception, skips the trapping instruction
-  //
-
-  address generate_handler_for_unsafe_access() {
-    StubCodeMark mark(this, "StubRoutines", "handler_for_unsafe_access");
-    address start = __ pc();
-
-    const int preserve_register_words = (64 * 2);
-    Address preserve_addr(FP, (-preserve_register_words * wordSize) + STACK_BIAS);
-
-    Register Lthread = L7_thread_cache;
-    int i;
-
-    __ save_frame(0);
-    __ mov(G1, L1);
-    __ mov(G2, L2);
-    __ mov(G3, L3);
-    __ mov(G4, L4);
-    __ mov(G5, L5);
-    for (i = 0; i < 64; i += 2) {
-      __ stf(FloatRegisterImpl::D, as_FloatRegister(i), preserve_addr, i * wordSize);
-    }
-
-    address entry_point = CAST_FROM_FN_PTR(address, handle_unsafe_access);
-    BLOCK_COMMENT("call handle_unsafe_access");
-    __ call(entry_point, relocInfo::runtime_call_type);
-    __ delayed()->nop();
-
-    __ mov(L1, G1);
-    __ mov(L2, G2);
-    __ mov(L3, G3);
-    __ mov(L4, G4);
-    __ mov(L5, G5);
-    for (i = 0; i < 64; i += 2) {
-      __ ldf(FloatRegisterImpl::D, preserve_addr, as_FloatRegister(i), i * wordSize);
-    }
-
-    __ verify_thread();
-
-    __ jmp(O0, 0);
-    __ delayed()->restore();
-
-    return start;
-  }
-
-
   // Support for uint StubRoutine::Sparc::partial_subtype_check( Klass sub, Klass super );
   // Arguments :
   //
@@ -5218,9 +5148,6 @@
     StubRoutines::_throw_IncompatibleClassChangeError_entry= generate_throw_exception("IncompatibleClassChangeError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_IncompatibleClassChangeError));
     StubRoutines::_throw_NullPointerException_at_call_entry= generate_throw_exception("NullPointerException at call throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_NullPointerException_at_call));
 
-    StubRoutines::_handler_for_unsafe_access_entry =
-      generate_handler_for_unsafe_access();
-
     // support for verify_oop (must happen after universe_init)
     StubRoutines::_verify_oop_subroutine_entry     = generate_verify_oop_subroutine();
 
--- a/src/cpu/x86/vm/interp_masm_x86.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/cpu/x86/vm/interp_masm_x86.cpp	Wed May 11 00:38:58 2016 +0300
@@ -26,12 +26,12 @@
 #include "interp_masm_x86.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/interpreterRuntime.hpp"
+#include "logging/log.hpp"
 #include "oops/arrayOop.hpp"
 #include "oops/markOop.hpp"
 #include "oops/methodData.hpp"
 #include "oops/method.hpp"
 #include "prims/jvmtiExport.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "prims/jvmtiThreadState.hpp"
 #include "runtime/basicLock.hpp"
 #include "runtime/biasedLocking.hpp"
@@ -1953,7 +1953,7 @@
   }
 
   // RedefineClasses() tracing support for obsolete method entry
-  if (RC_TRACE_IN_RANGE(0x00001000, 0x00002000)) {
+  if (log_is_enabled(Trace, redefine, class, obsolete)) {
     NOT_LP64(get_thread(rthread);)
     get_method(rarg);
     call_VM_leaf(
--- a/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Wed May 11 00:38:58 2016 +0300
@@ -29,9 +29,9 @@
 #include "code/icBuffer.hpp"
 #include "code/vtableStubs.hpp"
 #include "interpreter/interpreter.hpp"
+#include "logging/log.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/compiledICHolder.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/vframeArray.hpp"
 #include "vmreg_x86.inline.hpp"
@@ -1953,7 +1953,7 @@
   }
 
   // RedefineClasses() tracing support for obsolete method entry
-  if (RC_TRACE_IN_RANGE(0x00001000, 0x00002000)) {
+  if (log_is_enabled(Trace, redefine, class, obsolete)) {
     __ mov_metadata(rax, method());
     __ call_VM_leaf(
          CAST_FROM_FN_PTR(address, SharedRuntime::rc_trace_method_entry),
--- a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Wed May 11 00:38:58 2016 +0300
@@ -32,9 +32,9 @@
 #include "code/icBuffer.hpp"
 #include "code/vtableStubs.hpp"
 #include "interpreter/interpreter.hpp"
+#include "logging/log.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/compiledICHolder.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/vframeArray.hpp"
 #include "vmreg_x86.inline.hpp"
@@ -2322,7 +2322,7 @@
   }
 
   // RedefineClasses() tracing support for obsolete method entry
-  if (RC_TRACE_IN_RANGE(0x00001000, 0x00002000)) {
+  if (log_is_enabled(Trace, redefine, class, obsolete)) {
     // protect the args we've loaded
     save_args(masm, total_c_args, c_arg, out_regs);
     __ mov_metadata(c_rarg1, method());
--- a/src/cpu/x86/vm/stubGenerator_x86_32.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/cpu/x86/vm/stubGenerator_x86_32.cpp	Wed May 11 00:38:58 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, 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
@@ -63,21 +63,6 @@
 // -------------------------------------------------------------------------------------------------------------------------
 // Stub Code definitions
 
-static address handle_unsafe_access() {
-  JavaThread* thread = JavaThread::current();
-  address pc  = thread->saved_exception_pc();
-  // pc is the instruction which we must emulate
-  // doing a no-op is fine:  return garbage from the load
-  // therefore, compute npc
-  address npc = Assembler::locate_next_instruction(pc);
-
-  // request an async exception
-  thread->set_pending_unsafe_access_error();
-
-  // return address of next instruction to execute
-  return npc;
-}
-
 class StubGenerator: public StubCodeGenerator {
  private:
 
@@ -623,27 +608,6 @@
   }
 
 
-  //---------------------------------------------------------------------------
-  // The following routine generates a subroutine to throw an asynchronous
-  // UnknownError when an unsafe access gets a fault that could not be
-  // reasonably prevented by the programmer.  (Example: SIGBUS/OBJERR.)
-  address generate_handler_for_unsafe_access() {
-    StubCodeMark mark(this, "StubRoutines", "handler_for_unsafe_access");
-    address start = __ pc();
-
-    __ push(0);                       // hole for return address-to-be
-    __ pusha();                       // push registers
-    Address next_pc(rsp, RegisterImpl::number_of_registers * BytesPerWord);
-    BLOCK_COMMENT("call handle_unsafe_access");
-    __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, handle_unsafe_access)));
-    __ movptr(next_pc, rax);          // stuff next address
-    __ popa();
-    __ ret(0);                        // jump to next address
-
-    return start;
-  }
-
-
   //----------------------------------------------------------------------------------------------------
   // Non-destructive plausibility checks for oops
 
@@ -3865,9 +3829,6 @@
     // These are currently used by Solaris/Intel
     StubRoutines::_atomic_xchg_entry            = generate_atomic_xchg();
 
-    StubRoutines::_handler_for_unsafe_access_entry =
-      generate_handler_for_unsafe_access();
-
     // platform dependent
     create_control_words();
 
--- a/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Wed May 11 00:38:58 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -61,21 +61,6 @@
 
 // Stub Code definitions
 
-static address handle_unsafe_access() {
-  JavaThread* thread = JavaThread::current();
-  address pc = thread->saved_exception_pc();
-  // pc is the instruction which we must emulate
-  // doing a no-op is fine:  return garbage from the load
-  // therefore, compute npc
-  address npc = Assembler::locate_next_instruction(pc);
-
-  // request an async exception
-  thread->set_pending_unsafe_access_error();
-
-  // return address of next instruction to execute
-  return npc;
-}
-
 class StubGenerator: public StubCodeGenerator {
  private:
 
@@ -989,32 +974,6 @@
     return start;
   }
 
-  // The following routine generates a subroutine to throw an
-  // asynchronous UnknownError when an unsafe access gets a fault that
-  // could not be reasonably prevented by the programmer.  (Example:
-  // SIGBUS/OBJERR.)
-  address generate_handler_for_unsafe_access() {
-    StubCodeMark mark(this, "StubRoutines", "handler_for_unsafe_access");
-    address start = __ pc();
-
-    __ push(0);                       // hole for return address-to-be
-    __ pusha();                       // push registers
-    Address next_pc(rsp, RegisterImpl::number_of_registers * BytesPerWord);
-
-    // FIXME: this probably needs alignment logic
-
-    __ subptr(rsp, frame::arg_reg_save_area_bytes);
-    BLOCK_COMMENT("call handle_unsafe_access");
-    __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, handle_unsafe_access)));
-    __ addptr(rsp, frame::arg_reg_save_area_bytes);
-
-    __ movptr(next_pc, rax);          // stuff next address
-    __ popa();
-    __ ret(0);                        // jump to next address
-
-    return start;
-  }
-
   // Non-destructive plausibility checks for oops
   //
   // Arguments:
@@ -5139,9 +5098,6 @@
     StubRoutines::_atomic_add_ptr_entry      = generate_atomic_add_ptr();
     StubRoutines::_fence_entry               = generate_orderaccess_fence();
 
-    StubRoutines::_handler_for_unsafe_access_entry =
-      generate_handler_for_unsafe_access();
-
     // platform dependent
     StubRoutines::x86::_get_previous_fp_entry = generate_get_previous_fp();
     StubRoutines::x86::_get_previous_sp_entry = generate_get_previous_sp();
--- a/src/cpu/zero/vm/sharedRuntime_zero.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/cpu/zero/vm/sharedRuntime_zero.cpp	Wed May 11 00:38:58 2016 +0300
@@ -31,7 +31,6 @@
 #include "code/vtableStubs.hpp"
 #include "interpreter/interpreter.hpp"
 #include "oops/compiledICHolder.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/vframeArray.hpp"
 #include "vmreg_zero.inline.hpp"
--- a/src/cpu/zero/vm/stubGenerator_zero.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/cpu/zero/vm/stubGenerator_zero.cpp	Wed May 11 00:38:58 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2010, 2015 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -261,10 +261,6 @@
     StubRoutines::_atomic_add_entry          = ShouldNotCallThisStub();
     StubRoutines::_atomic_add_ptr_entry      = ShouldNotCallThisStub();
     StubRoutines::_fence_entry               = ShouldNotCallThisStub();
-
-    // amd64 does this here, sparc does it in generate_all()
-    StubRoutines::_handler_for_unsafe_access_entry =
-      ShouldNotCallThisStub();
   }
 
   void generate_all() {
--- a/src/os/posix/vm/os_posix.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/os/posix/vm/os_posix.cpp	Wed May 11 00:38:58 2016 +0300
@@ -47,6 +47,12 @@
 
 // Check core dump limit and report possible place where core can be found
 void os::check_dump_limit(char* buffer, size_t bufferSize) {
+  if (!FLAG_IS_DEFAULT(CreateCoredumpOnCrash) && !CreateCoredumpOnCrash) {
+    jio_snprintf(buffer, bufferSize, "CreateCoredumpOnCrash is disabled from command line");
+    VMError::record_coredump_status(buffer, false);
+    return;
+  }
+
   int n;
   struct rlimit rlim;
   bool success;
--- a/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp	Wed May 11 00:38:58 2016 +0300
@@ -392,11 +392,9 @@
         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
         CompiledMethod* nm = cb->as_compiled_method_or_null();
         if (nm != NULL && nm->has_unsafe_access()) {
-          // We don't really need a stub here! Just set the pending exeption and
-          // continue at the next instruction after the faulting read. Returning
-          // garbage from this read is ok.
-          thread->set_pending_unsafe_access_error();
-          os::Aix::ucontext_set_pc(uc, pc + 4);
+          address next_pc = pc + 4;
+          next_pc = SharedRuntime::handle_unsafe_access(thread, next_pc);
+          os::Aix::ucontext_set_pc(uc, next_pc);
           return 1;
         }
       }
@@ -415,11 +413,9 @@
       }
       else if (thread->thread_state() == _thread_in_vm &&
                sig == SIGBUS && thread->doing_unsafe_access()) {
-        // We don't really need a stub here! Just set the pending exeption and
-        // continue at the next instruction after the faulting read. Returning
-        // garbage from this read is ok.
-        thread->set_pending_unsafe_access_error();
-        os::Aix::ucontext_set_pc(uc, pc + 4);
+        address next_pc = pc + 4;
+        next_pc = SharedRuntime::handle_unsafe_access(thread, next_pc);
+        os::Aix::ucontext_set_pc(uc, next_pc);
         return 1;
       }
     }
--- a/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Wed May 11 00:38:58 2016 +0300
@@ -584,7 +584,8 @@
         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
         CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
         if (nm != NULL && nm->has_unsafe_access()) {
-          stub = StubRoutines::handler_for_unsafe_access();
+          address next_pc = Assembler::locate_next_instruction(pc);
+          stub = SharedRuntime::handle_unsafe_access(thread, next_pc);
         }
       }
       else
@@ -655,7 +656,8 @@
     } else if (thread->thread_state() == _thread_in_vm &&
                sig == SIGBUS && /* info->si_code == BUS_OBJERR && */
                thread->doing_unsafe_access()) {
-        stub = StubRoutines::handler_for_unsafe_access();
+        address next_pc = Assembler::locate_next_instruction(pc);
+        stub = SharedRuntime::handle_unsafe_access(thread, next_pc);
     }
 
     // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
--- a/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp	Wed May 11 00:38:58 2016 +0300
@@ -226,23 +226,6 @@
 extern "C" void FetchNResume () ;
 #endif
 
-// An operation in Unsafe has faulted.  We're going to return to the
-// instruction after the faulting load or store.  We also set
-// pending_unsafe_access_error so that at some point in the future our
-// user will get a helpful message.
-static address handle_unsafe_access(JavaThread* thread, address pc) {
-  // pc is the instruction which we must emulate
-  // doing a no-op is fine:  return garbage from the load
-  // therefore, compute npc
-  address npc = pc + NativeCall::instruction_size;
-
-  // request an async exception
-  thread->set_pending_unsafe_access_error();
-
-  // return address of next instruction to execute
-  return npc;
-}
-
 extern "C" JNIEXPORT int
 JVM_handle_linux_signal(int sig,
                         siginfo_t* info,
@@ -387,7 +370,8 @@
         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
         CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
         if (nm != NULL && nm->has_unsafe_access()) {
-          stub = handle_unsafe_access(thread, pc);
+          address next_pc = pc + NativeCall::instruction_size;
+          stub = SharedRuntime::handle_unsafe_access(thread, next_pc);
         }
       }
       else
@@ -408,7 +392,8 @@
     } else if (thread->thread_state() == _thread_in_vm &&
                sig == SIGBUS && /* info->si_code == BUS_OBJERR && */
                thread->doing_unsafe_access()) {
-        stub = handle_unsafe_access(thread, pc);
+      address next_pc = pc + NativeCall::instruction_size;
+      stub = SharedRuntime::handle_unsafe_access(thread, next_pc);
     }
 
     // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
--- a/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp	Wed May 11 00:38:58 2016 +0300
@@ -366,11 +366,9 @@
         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
         CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
         if (nm != NULL && nm->has_unsafe_access()) {
-          // We don't really need a stub here! Just set the pending exeption and
-          // continue at the next instruction after the faulting read. Returning
-          // garbage from this read is ok.
-          thread->set_pending_unsafe_access_error();
-          os::Linux::ucontext_set_pc(uc, pc + 4);
+          address next_pc = pc + 4;
+          next_pc = SharedRuntime::handle_unsafe_access(thread, next_pc);
+          os::Linux::ucontext_set_pc(uc, next_pc);
           return true;
         }
       }
@@ -385,10 +383,8 @@
       }
       else if (thread->thread_state() == _thread_in_vm &&
                sig == SIGBUS && thread->doing_unsafe_access()) {
-        // We don't really need a stub here! Just set the pending exeption and
-        // continue at the next instruction after the faulting read. Returning
-        // garbage from this read is ok.
-        thread->set_pending_unsafe_access_error();
+        address next_pc = pc + 4;
+        next_pc = SharedRuntime::handle_unsafe_access(thread, next_pc);
         os::Linux::ucontext_set_pc(uc, pc + 4);
         return true;
       }
--- a/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp	Wed May 11 00:38:58 2016 +0300
@@ -433,14 +433,14 @@
   return false;
 }
 
-inline static bool checkByteBuffer(address pc, address* stub) {
+inline static bool checkByteBuffer(address pc, address npc, address* stub) {
   // BugId 4454115: A read from a MappedByteBuffer can fault
   // here if the underlying file has been truncated.
   // Do not crash the VM in such a case.
   CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
   CompiledMethod* nm = cb->as_compiled_method_or_null();
   if (nm != NULL && nm->has_unsafe_access()) {
-    *stub = StubRoutines::handler_for_unsafe_access();
+    *stub = SharedRuntime::handle_unsafe_access(thread, npc);
     return true;
   }
   return false;
@@ -613,7 +613,7 @@
     if (sig == SIGBUS &&
         thread->thread_state() == _thread_in_vm &&
         thread->doing_unsafe_access()) {
-      stub = StubRoutines::handler_for_unsafe_access();
+      stub = SharedRuntime::handle_unsafe_access(thread, npc);
     }
 
     if (thread->thread_state() == _thread_in_Java) {
@@ -625,7 +625,7 @@
           break;
         }
 
-        if ((sig == SIGBUS) && checkByteBuffer(pc, &stub)) {
+        if ((sig == SIGBUS) && checkByteBuffer(pc, npc, &stub)) {
           break;
         }
 
--- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Wed May 11 00:38:58 2016 +0300
@@ -420,7 +420,8 @@
         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
         CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
         if (nm != NULL && nm->has_unsafe_access()) {
-          stub = StubRoutines::handler_for_unsafe_access();
+          address next_pc = Assembler::locate_next_instruction(pc);
+          stub = SharedRuntime::handle_unsafe_access(thread, next_pc);
         }
       }
       else
@@ -469,7 +470,8 @@
     } else if (thread->thread_state() == _thread_in_vm &&
                sig == SIGBUS && /* info->si_code == BUS_OBJERR && */
                thread->doing_unsafe_access()) {
-        stub = StubRoutines::handler_for_unsafe_access();
+        address next_pc = Assembler::locate_next_instruction(pc);
+        stub = SharedRuntime::handle_unsafe_access(thread, next_pc);
     }
 
     // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
--- a/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Wed May 11 00:38:58 2016 +0300
@@ -441,7 +441,7 @@
 
     if (thread->thread_state() == _thread_in_vm) {
       if (sig == SIGBUS && info->si_code == BUS_OBJERR && thread->doing_unsafe_access()) {
-        stub = StubRoutines::handler_for_unsafe_access();
+        stub = SharedRuntime::handle_unsafe_access(thread, npc);
       }
     }
 
@@ -480,7 +480,7 @@
         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
         CompiledMethod* nm = cb->as_compiled_method_or_null();
         if (nm != NULL && nm->has_unsafe_access()) {
-          stub = StubRoutines::handler_for_unsafe_access();
+          stub = SharedRuntime::handle_unsafe_access(thread, npc);
         }
       }
 
--- a/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp	Wed May 11 00:38:58 2016 +0300
@@ -503,7 +503,8 @@
 
     if (thread->thread_state() == _thread_in_vm) {
       if (sig == SIGBUS && info->si_code == BUS_OBJERR && thread->doing_unsafe_access()) {
-        stub = StubRoutines::handler_for_unsafe_access();
+        address next_pc = Assembler::locate_next_instruction(pc);
+        stub = SharedRuntime::handle_unsafe_access(thread, next_pc);
       }
     }
 
@@ -520,7 +521,8 @@
         if (cb != NULL) {
           CompiledMethod* nm = cb->as_compiled_method_or_null();
           if (nm != NULL && nm->has_unsafe_access()) {
-            stub = StubRoutines::handler_for_unsafe_access();
+            address next_pc = Assembler::locate_next_instruction(pc);
+            stub = SharedRuntime::handle_unsafe_access(thread, next_pc);
           }
         }
       }
--- a/src/share/tools/ProjectCreator/ArgsParser.java	Tue May 10 12:18:22 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-class ArgIterator {
-    String[] args;
-    int i;
-    ArgIterator(String[] args) {
-        this.args = args;
-        this.i = 0;
-    }
-    String get() { return args[i]; }
-    boolean hasMore() { return args != null && i  < args.length; }
-    boolean next() { return ++i < args.length; }
-}
-
-abstract class ArgHandler {
-    public abstract void handle(ArgIterator it);
-
-}
-
-class ArgRule {
-    String arg;
-    ArgHandler handler;
-    ArgRule(String arg, ArgHandler handler) {
-        this.arg = arg;
-        this.handler = handler;
-    }
-
-    boolean process(ArgIterator it) {
-        if (match(it.get(), arg)) {
-            handler.handle(it);
-            return true;
-        }
-        return false;
-    }
-    boolean match(String rule_pattern, String arg) {
-        return arg.equals(rule_pattern);
-    }
-}
-
-class ArgsParser {
-    ArgsParser(String[] args,
-               ArgRule[] rules,
-               ArgHandler defaulter) {
-        ArgIterator ai = new ArgIterator(args);
-        while (ai.hasMore()) {
-            boolean processed = false;
-            for (int i=0; i<rules.length; i++) {
-                processed |= rules[i].process(ai);
-                if (processed) {
-                    break;
-                }
-            }
-            if (!processed) {
-                if (defaulter != null) {
-                    defaulter.handle(ai);
-                } else {
-                    System.err.println("ERROR: unparsed \""+ai.get()+"\"");
-                    ai.next();
-                }
-            }
-        }
-    }
-}
--- a/src/share/tools/ProjectCreator/BuildConfig.java	Tue May 10 12:18:22 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,617 +0,0 @@
-/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-class BuildConfig {
-    @SuppressWarnings("rawtypes")
-    Hashtable vars;
-    Vector<String> basicNames, basicPaths;
-    String[] context;
-
-    static CompilerInterface ci;
-    static CompilerInterface getCI() {
-        if (ci == null) {
-            String comp = (String)getField(null, "CompilerVersion");
-            try {
-                ci = (CompilerInterface)Class.forName("CompilerInterface" + comp).newInstance();
-            } catch (Exception cnfe) {
-                System.err.println("Cannot find support for compiler " + comp);
-                throw new RuntimeException(cnfe.toString());
-            }
-        }
-        return ci;
-    }
-
-    @SuppressWarnings("rawtypes")
-    protected void initNames(String flavour, String build, String outDll) {
-        if (vars == null) vars = new Hashtable();
-
-        String flavourBuild =  flavour + "_" + build;
-        String platformName = getFieldString(null, "PlatformName");
-        System.out.println();
-        System.out.println(flavourBuild);
-
-        put("Name", getCI().makeCfgName(flavourBuild, platformName));
-        put("Flavour", flavour);
-        put("Build", build);
-        put("PlatformName", platformName);
-
-        // ones mentioned above were needed to expand format
-        String buildBase = expandFormat(getFieldString(null, "BuildBase"));
-        String sourceBase = getFieldString(null, "SourceBase");
-        String buildSpace = getFieldString(null, "BuildSpace");
-        String outDir = buildBase;
-        String jdkTargetRoot = getFieldString(null, "JdkTargetRoot");
-
-        put("Id", flavourBuild);
-        put("OutputDir", outDir);
-        put("SourceBase", sourceBase);
-        put("BuildBase", buildBase);
-        put("BuildSpace", buildSpace);
-        put("OutputDll", outDir + Util.sep + outDll);
-        put("JdkTargetRoot", jdkTargetRoot);
-
-        context = new String [] {flavourBuild, flavour, build, null};
-    }
-
-    protected void init(Vector<String> includes, Vector<String> defines) {
-        initDefaultDefines(defines);
-        initDefaultCompilerFlags(includes);
-        initDefaultLinkerFlags();
-        //handleDB();
-    }
-
-
-    protected void initDefaultCompilerFlags(Vector<String> includes) {
-        Vector compilerFlags = new Vector();
-
-        compilerFlags.addAll(getCI().getBaseCompilerFlags(getV("Define"),
-                                                          includes,
-                                                          get("OutputDir")));
-
-        put("CompilerFlags", compilerFlags);
-    }
-
-    protected void initDefaultLinkerFlags() {
-        Vector linkerFlags = new Vector();
-
-        linkerFlags.addAll(getCI().getBaseLinkerFlags( get("OutputDir"), get("OutputDll"), get("PlatformName")));
-
-        put("LinkerFlags", linkerFlags);
-    }
-
-    public boolean matchesIgnoredPath(String path) {
-        Vector<String> rv = new Vector<String>();
-        collectRelevantVectors(rv, "IgnorePath");
-        for (String pathPart : rv) {
-            if (path.contains(pathPart))  {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public boolean matchesHidePath(String path) {
-        Vector<String> rv = new Vector<String>();
-        collectRelevantVectors(rv, "HidePath");
-        for (String pathPart : rv) {
-            if (path.contains(Util.normalize(pathPart)))  {
-                return true;
-            }
-        }
-        return false;
-    }
-
-   public Vector<String> matchesAdditionalGeneratedPath(String fullPath) {
-        Vector<String> rv = new Vector<String>();
-        Hashtable<String, String> v = (Hashtable<String, String>)BuildConfig.getField(this.toString(), "AdditionalGeneratedFile");
-        if (v != null) {
-            for (Enumeration<String> e=v.keys(); e.hasMoreElements(); ) {
-                String key = e.nextElement();
-                String val = v.get(key);
-
-                if (fullPath.endsWith(expandFormat(key))) {
-                    rv.add(expandFormat(val));
-                }
-            }
-        }
-        return rv;
-    }
-
-    // Returns true if the specified path refers to a relative alternate
-    // source file. RelativeAltSrcInclude is usually "src\closed".
-    public static boolean matchesRelativeAltSrcInclude(String path) {
-        String relativeAltSrcInclude =
-            getFieldString(null, "RelativeAltSrcInclude");
-        Vector<String> v = getFieldVector(null, "AltRelativeInclude");
-        for (String pathPart : v) {
-            if (path.contains(relativeAltSrcInclude + Util.sep + pathPart))  {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    // Returns the relative alternate source file for the specified path.
-    // Null is returned if the specified path does not have a matching
-    // alternate source file.
-    public static String getMatchingRelativeAltSrcFile(String path) {
-        Vector<String> v = getFieldVector(null, "RelativeAltSrcFileList");
-        if (v == null) {
-            return null;
-        }
-        for (String pathPart : v) {
-            if (path.endsWith(pathPart)) {
-                String relativeAltSrcInclude =
-                    getFieldString(null, "RelativeAltSrcInclude");
-                return relativeAltSrcInclude + Util.sep + pathPart;
-            }
-        }
-        return null;
-    }
-
-    // Returns true if the specified path has a matching alternate
-    // source file.
-    public static boolean matchesRelativeAltSrcFile(String path) {
-        return getMatchingRelativeAltSrcFile(path) != null;
-    }
-
-    // Track the specified alternate source file. The source file is
-    // tracked without the leading .*<sep><RelativeAltSrcFileList><sep>
-    // part to make matching regular source files easier.
-    public static void trackRelativeAltSrcFile(String path) {
-        String pattern = getFieldString(null, "RelativeAltSrcInclude") +
-            Util.sep;
-        int altSrcInd = path.indexOf(pattern);
-        if (altSrcInd == -1) {
-            // not an AltSrc path
-            return;
-        }
-
-        altSrcInd += pattern.length();
-        if (altSrcInd >= path.length()) {
-            // not a valid AltSrc path
-            return;
-        }
-
-        String altSrcFile = path.substring(altSrcInd);
-        Vector v = getFieldVector(null, "RelativeAltSrcFileList");
-        if (v == null || !v.contains(altSrcFile)) {
-            addFieldVector(null, "RelativeAltSrcFileList", altSrcFile);
-        }
-    }
-
-    void addTo(Hashtable ht, String key, String value) {
-        ht.put(expandFormat(key), expandFormat(value));
-    }
-
-    void initDefaultDefines(Vector defines) {
-        Vector sysDefines = new Vector();
-        sysDefines.add("WIN32");
-        sysDefines.add("_WINDOWS");
-        sysDefines.add("HOTSPOT_BUILD_USER=\\\""+System.getProperty("user.name")+"\\\"");
-        sysDefines.add("HOTSPOT_BUILD_TARGET=\\\""+get("Build")+"\\\"");
-        sysDefines.add("INCLUDE_TRACE=1");
-        sysDefines.add("_JNI_IMPLEMENTATION_");
-        if (vars.get("PlatformName").equals("Win32")) {
-            sysDefines.add("HOTSPOT_LIB_ARCH=\\\"i386\\\"");
-        } else {
-            sysDefines.add("HOTSPOT_LIB_ARCH=\\\"amd64\\\"");
-        }
-        sysDefines.add("DEBUG_LEVEL=\\\"" + get("Build")+"\\\"");
-        sysDefines.addAll(defines);
-
-        put("Define", sysDefines);
-    }
-
-    String get(String key) {
-        return (String)vars.get(key);
-    }
-
-    Vector getV(String key) {
-        return (Vector)vars.get(key);
-    }
-
-    Object getO(String key) {
-        return vars.get(key);
-    }
-
-    Hashtable getH(String key) {
-        return (Hashtable)vars.get(key);
-    }
-
-    Object getFieldInContext(String field) {
-        for (int i=0; i<context.length; i++) {
-            Object rv = getField(context[i], field);
-            if (rv != null) {
-                return rv;
-            }
-        }
-        return null;
-    }
-
-    Object lookupHashFieldInContext(String field, String key) {
-        for (int i=0; i<context.length; i++) {
-            Hashtable ht = (Hashtable)getField(context[i], field);
-            if (ht != null) {
-                Object rv = ht.get(key);
-                if (rv != null) {
-                    return rv;
-                }
-            }
-        }
-        return null;
-    }
-
-    void put(String key, String value) {
-        vars.put(key, value);
-    }
-
-    void put(String key, Vector vvalue) {
-        vars.put(key, vvalue);
-    }
-
-    void add(String key, Vector vvalue) {
-        getV(key).addAll(vvalue);
-    }
-
-    String flavour() {
-        return get("Flavour");
-    }
-
-    String build() {
-        return get("Build");
-    }
-
-    Object getSpecificField(String field) {
-        return getField(get("Id"), field);
-    }
-
-    void putSpecificField(String field, Object value) {
-        putField(get("Id"), field, value);
-    }
-
-    void collectRelevantVectors(Vector rv, String field) {
-        for (String ctx : context) {
-            Vector<String> v = getFieldVector(ctx, field);
-            if (v != null) {
-                for (String val : v) {
-                    rv.add(expandFormat(val).replace('/', '\\'));
-                }
-            }
-        }
-    }
-
-    void collectRelevantHashes(Hashtable rv, String field) {
-        for (String ctx : context) {
-            Hashtable v = (Hashtable)getField(ctx, field);
-            if (v != null) {
-                for (Enumeration e=v.keys(); e.hasMoreElements(); ) {
-                    String key = (String)e.nextElement();
-                    String val =  (String)v.get(key);
-                    addTo(rv, key, val);
-                }
-            }
-        }
-    }
-
-
-    Vector getDefines() {
-        Vector rv = new Vector();
-        collectRelevantVectors(rv, "Define");
-        return rv;
-    }
-
-    Vector getIncludes() {
-        Vector rv = new Vector();
-        collectRelevantVectors(rv, "AbsoluteInclude");
-        rv.addAll(getSourceIncludes());
-        return rv;
-    }
-
-    private Vector getSourceIncludes() {
-        Vector<String> rv = new Vector<String>();
-        String sourceBase = getFieldString(null, "SourceBase");
-
-        // add relative alternate source include values:
-        String relativeAltSrcInclude =
-            getFieldString(null, "RelativeAltSrcInclude");
-        Vector<String> asri = new Vector<String>();
-        collectRelevantVectors(asri, "AltRelativeInclude");
-        for (String f : asri) {
-            rv.add(sourceBase + Util.sep + relativeAltSrcInclude +
-                   Util.sep + f);
-        }
-
-        Vector<String> ri = new Vector<String>();
-        collectRelevantVectors(ri, "RelativeInclude");
-        for (String f : ri) {
-            rv.add(sourceBase + Util.sep + f);
-        }
-        return rv;
-    }
-
-    static Hashtable cfgData = new Hashtable();
-    static Hashtable globalData = new Hashtable();
-
-    static boolean appliesToTieredBuild(String cfg) {
-        return (cfg != null &&
-                (cfg.startsWith("compiler1") ||
-                 cfg.startsWith("compiler2")));
-    }
-
-    // Filters out the IgnoreFile and IgnorePaths since they are
-    // handled specially for tiered builds.
-    static boolean appliesToTieredBuild(String cfg, String key) {
-        return (appliesToTieredBuild(cfg))&& (key != null && !key.startsWith("Ignore"));
-    }
-
-    static String getTieredBuildCfg(String cfg) {
-        assert appliesToTieredBuild(cfg) : "illegal configuration " + cfg;
-        return "tiered" + cfg.substring(9);
-    }
-
-    static Object getField(String cfg, String field) {
-        if (cfg == null) {
-            return globalData.get(field);
-        }
-
-        Hashtable ht =  (Hashtable)cfgData.get(cfg);
-        return ht == null ? null : ht.get(field);
-    }
-
-    static String getFieldString(String cfg, String field) {
-        return (String)getField(cfg, field);
-    }
-
-    static Vector getFieldVector(String cfg, String field) {
-        return (Vector)getField(cfg, field);
-    }
-
-    static void putField(String cfg, String field, Object value) {
-        putFieldImpl(cfg, field, value);
-        if (appliesToTieredBuild(cfg, field)) {
-            putFieldImpl(getTieredBuildCfg(cfg), field, value);
-        }
-    }
-
-    private static void putFieldImpl(String cfg, String field, Object value) {
-        if (cfg == null) {
-            globalData.put(field, value);
-            return;
-        }
-
-        Hashtable ht = (Hashtable)cfgData.get(cfg);
-        if (ht == null) {
-            ht = new Hashtable();
-            cfgData.put(cfg, ht);
-        }
-
-        ht.put(field, value);
-    }
-
-    static Object getFieldHash(String cfg, String field, String name) {
-        Hashtable ht = (Hashtable)getField(cfg, field);
-
-        return ht == null ? null : ht.get(name);
-    }
-
-    static void putFieldHash(String cfg, String field, String name, Object val) {
-        putFieldHashImpl(cfg, field, name, val);
-        if (appliesToTieredBuild(cfg, field)) {
-            putFieldHashImpl(getTieredBuildCfg(cfg), field, name, val);
-        }
-    }
-
-    private static void putFieldHashImpl(String cfg, String field, String name, Object val) {
-        Hashtable ht = (Hashtable)getField(cfg, field);
-
-        if (ht == null) {
-            ht = new Hashtable();
-            putFieldImpl(cfg, field, ht);
-        }
-
-        ht.put(name, val);
-    }
-
-    static void addFieldVector(String cfg, String field, String element) {
-        addFieldVectorImpl(cfg, field, element);
-        if (appliesToTieredBuild(cfg, field)) {
-            addFieldVectorImpl(getTieredBuildCfg(cfg), field, element);
-        }
-    }
-
-    private static void addFieldVectorImpl(String cfg, String field, String element) {
-        Vector v = (Vector)getField(cfg, field);
-
-        if (v == null) {
-            v = new Vector();
-            putFieldImpl(cfg, field, v);
-        }
-
-        v.add(element);
-    }
-
-    String expandFormat(String format) {
-        if (format == null) {
-            return null;
-        }
-
-        if (format.indexOf('%') == -1) {
-            return format;
-        }
-
-        StringBuffer sb = new StringBuffer();
-        int len = format.length();
-        for (int i=0; i<len; i++) {
-            char ch = format.charAt(i);
-            if (ch == '%') {
-                char ch1 = format.charAt(i+1);
-                switch (ch1) {
-                case '%':
-                    sb.append(ch1);
-                    break;
-                case 'b':
-                    sb.append(build());
-                    break;
-                case 'f':
-                    sb.append(flavour());
-                    break;
-                default:
-                    sb.append(ch);
-                    sb.append(ch1);
-                }
-                i++;
-            } else {
-                sb.append(ch);
-            }
-        }
-
-        return sb.toString();
-    }
-}
-
-abstract class GenericDebugConfig extends BuildConfig {
-    abstract String getOptFlag();
-
-    protected void init(Vector includes, Vector defines) {
-        defines.add("_DEBUG");
-        defines.add("ASSERT");
-
-        super.init(includes, defines);
-
-        getV("CompilerFlags").addAll(getCI().getDebugCompilerFlags(getOptFlag(), get("PlatformName")));
-        getV("LinkerFlags").addAll(getCI().getDebugLinkerFlags());
-   }
-}
-
-abstract class GenericDebugNonKernelConfig extends GenericDebugConfig {
-    protected void init(Vector includes, Vector defines) {
-        super.init(includes, defines);
-        if (get("PlatformName").equals("Win32")) {
-            getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags"));
-        }
-   }
-}
-
-class C1DebugConfig extends GenericDebugNonKernelConfig {
-    String getOptFlag() {
-        return getCI().getNoOptFlag();
-    }
-
-    C1DebugConfig() {
-        initNames("compiler1", "debug", "jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-class C1FastDebugConfig extends GenericDebugNonKernelConfig {
-    String getOptFlag() {
-        return getCI().getOptFlag();
-    }
-
-    C1FastDebugConfig() {
-        initNames("compiler1", "fastdebug", "jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-class TieredDebugConfig extends GenericDebugNonKernelConfig {
-    String getOptFlag() {
-        return getCI().getNoOptFlag();
-    }
-
-    TieredDebugConfig() {
-        initNames("tiered", "debug", "jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-class TieredFastDebugConfig extends GenericDebugNonKernelConfig {
-    String getOptFlag() {
-        return getCI().getOptFlag();
-    }
-
-    TieredFastDebugConfig() {
-        initNames("tiered", "fastdebug", "jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-abstract class ProductConfig extends BuildConfig {
-    protected void init(Vector includes, Vector defines) {
-        defines.add("NDEBUG");
-        defines.add("PRODUCT");
-
-        super.init(includes, defines);
-
-        getV("CompilerFlags").addAll(getCI().getProductCompilerFlags());
-        getV("LinkerFlags").addAll(getCI().getProductLinkerFlags());
-    }
-}
-
-class C1ProductConfig extends ProductConfig {
-    C1ProductConfig() {
-        initNames("compiler1", "product", "jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-class TieredProductConfig extends ProductConfig {
-    TieredProductConfig() {
-        initNames("tiered", "product", "jvm.dll");
-        init(getIncludes(), getDefines());
-    }
-}
-
-
-abstract class CompilerInterface {
-    abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
-    abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName);
-    abstract Vector getDebugCompilerFlags(String opt, String platformName);
-    abstract Vector getDebugLinkerFlags();
-    abstract void   getAdditionalNonKernelLinkerFlags(Vector rv);
-    abstract Vector getProductCompilerFlags();
-    abstract Vector getProductLinkerFlags();
-    abstract String getOptFlag();
-    abstract String getNoOptFlag();
-    abstract String makeCfgName(String flavourBuild, String platformName);
-
-    void addAttr(Vector receiver, String attr, String value) {
-        receiver.add(attr); receiver.add(value);
-    }
-    void extAttr(Vector receiver, String attr, String value) {
-        int attr_pos=receiver.indexOf(attr) ;
-        if ( attr_pos == -1) {
-          // If attr IS NOT present in the Vector - add it
-          receiver.add(attr); receiver.add(value);
-        } else {
-          // If attr IS present in the Vector - append value to it
-          receiver.set(attr_pos+1,receiver.get(attr_pos+1)+value);
-        }
-    }
-}
--- a/src/share/tools/ProjectCreator/FileTreeCreator.java	Tue May 10 12:18:22 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-import java.nio.file.FileSystems;
-import java.nio.file.Path;
-import java.nio.file.SimpleFileVisitor;
-import java.util.HashSet;
-import java.util.Stack;
-import java.util.Vector;
-
-public class FileTreeCreator extends SimpleFileVisitor<Path>
-{
-   Path vcProjLocation;
-   Path startDir;
-   final int startDirLength;
-   Stack<DirAttributes> attributes = new Stack<DirAttributes>();
-   Vector<BuildConfig> allConfigs;
-   WinGammaPlatform wg;
-   WinGammaPlatformVC10 wg10;
-
-   public FileTreeCreator(Path startDir, Vector<BuildConfig> allConfigs, WinGammaPlatform wg) {
-      super();
-      this.wg = wg;
-      if (wg instanceof WinGammaPlatformVC10) {
-          wg10 = (WinGammaPlatformVC10)wg;
-      }
-      this.allConfigs = allConfigs;
-      this.startDir = startDir;
-      startDirLength = startDir.toAbsolutePath().toString().length();
-      vcProjLocation = FileSystems.getDefault().getPath(allConfigs.firstElement().get("BuildSpace"));
-      attributes.push(new DirAttributes());
-   }
-
-   public class DirAttributes {
-
-      private HashSet<BuildConfig> ignores;
-      private HashSet<BuildConfig> disablePch;
-
-      public DirAttributes() {
-         ignores = new HashSet<BuildConfig>();
-         disablePch = new HashSet<BuildConfig>();
-      }
-
-      public DirAttributes(HashSet<BuildConfig> excludes2, HashSet<BuildConfig> disablePch2) {
-         ignores = excludes2;
-         disablePch = disablePch2;
-      }
-
-      @SuppressWarnings("unchecked")
-      public DirAttributes clone() {
-         return new DirAttributes((HashSet<BuildConfig>)this.ignores.clone(), (HashSet<BuildConfig>)this.disablePch.clone());
-      }
-
-      public void setIgnore(BuildConfig conf) {
-         ignores.add(conf);
-      }
-
-      public boolean hasIgnore(BuildConfig cfg) {
-         return ignores.contains(cfg);
-      }
-
-      public void removeFromIgnored(BuildConfig cfg) {
-         ignores.remove(cfg);
-      }
-
-      public void setDisablePch(BuildConfig conf) {
-         disablePch.add(conf);
-      }
-
-      public boolean hasDisablePch(BuildConfig cfg) {
-         return disablePch.contains(cfg);
-      }
-
-      public void removeFromDisablePch(BuildConfig cfg) {
-         disablePch.remove(cfg);
-      }
-
-   }
-}
--- a/src/share/tools/ProjectCreator/FileTreeCreatorVC10.java	Tue May 10 12:18:22 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import static java.nio.file.FileVisitResult.CONTINUE;
-
-import java.io.IOException;
-import java.nio.file.FileSystems;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.Stack;
-import java.util.Vector;
-
-public class FileTreeCreatorVC10 extends FileTreeCreator {
-
-      public FileTreeCreatorVC10(Path startDir, Vector<BuildConfig> allConfigs, WinGammaPlatformVC10 wg) {
-         super(startDir, allConfigs, wg);
-      }
-
-      @Override
-      public FileVisitResult visitFile(Path file, BasicFileAttributes attr) {
-         DirAttributes currentFileAttr = attributes.peek().clone();
-         boolean usePch = false;
-         boolean disablePch = false;
-         boolean useIgnore = false;
-         boolean isAltSrc = false;  // only needed as a debugging crumb
-         boolean isReplacedByAltSrc = false;
-         String fileName = file.getFileName().toString();
-
-         // TODO hideFile
-
-         // usePch applies to all configs for a file.
-         if (fileName.equals(BuildConfig.getFieldString(null, "UseToGeneratePch"))) {
-            usePch = true;
-         }
-
-         String fileLoc = vcProjLocation.relativize(file).toString();
-
-         // isAltSrc and isReplacedByAltSrc applies to all configs for a file
-         if (BuildConfig.matchesRelativeAltSrcInclude(
-               file.toAbsolutePath().toString())) {
-            // current file is an alternate source file so track it
-            isAltSrc = true;
-            BuildConfig.trackRelativeAltSrcFile(
-                file.toAbsolutePath().toString());
-         } else if (BuildConfig.matchesRelativeAltSrcFile(
-                    file.toAbsolutePath().toString())) {
-            // current file is a regular file that matches an alternate
-            // source file so yack about replacing the regular file
-            isReplacedByAltSrc = true;
-            System.out.println("INFO: alternate source file '" +
-                               BuildConfig.getMatchingRelativeAltSrcFile(
-                                   file.toAbsolutePath().toString()) +
-                               "' replaces '" + fileLoc + "'");
-         }
-
-         for (BuildConfig cfg : allConfigs) {
-            if (cfg.lookupHashFieldInContext("IgnoreFile", fileName) != null) {
-               useIgnore = true;
-               currentFileAttr.setIgnore(cfg);
-            } else if (cfg.matchesIgnoredPath(file.toAbsolutePath().toString())) {
-               useIgnore = true;
-               currentFileAttr.setIgnore(cfg);
-            }
-
-            if (cfg.lookupHashFieldInContext("DisablePch", fileName) != null) {
-               disablePch = true;
-               currentFileAttr.setDisablePch(cfg);
-            }
-
-            Vector<String> rv = new Vector<String>();
-            cfg.collectRelevantVectors(rv, "AdditionalFile");
-            for(String addFile : rv) {
-               if (addFile.equals(fileName)) {
-                  // supress any ignore
-                  // TODO - may need some adjustments
-                  if (file.toAbsolutePath().toString().contains(cfg.get("Flavour"))) {
-                     currentFileAttr.removeFromIgnored(cfg);
-                  }
-               }
-            }
-         }
-
-         String tagName = wg10.getFileTagFromSuffix(fileName);
-
-         if (!useIgnore && !disablePch && !usePch && !isReplacedByAltSrc) {
-            wg.tag(tagName, new String[] { "Include", fileLoc});
-         } else {
-            wg.startTag(
-                  tagName,
-                  new String[] { "Include", fileLoc});
-
-            for (BuildConfig cfg : allConfigs) {
-               boolean ignore = currentFileAttr.hasIgnore(cfg);
-               if (ignore) {
-                  wg.tagData("ExcludedFromBuild", "true", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
-               }
-               if (usePch) {
-                  wg.tagData("PrecompiledHeader", "Create", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
-               }
-               if (disablePch) {
-                  wg.tag("PrecompiledHeader", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
-               }
-               if (isReplacedByAltSrc) {
-                  wg.tagData("ExcludedFromBuild", "true", "Condition",
-                             "'$(Configuration)|$(Platform)'=='" +
-                             cfg.get("Name") + "'");
-               }
-            }
-            wg.endTag();
-         }
-
-         String filter = startDir.relativize(file.getParent().toAbsolutePath()).toString();
-         wg10.addFilterDependency(fileLoc, filter);
-
-         return CONTINUE;
-      }
-
-      @Override
-      public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs)
-            throws IOException {
-         Boolean hide = false;
-         // TODO remove attrs, if path is matched in this dir, then it is too in every subdir.
-         // And we will check anyway
-         DirAttributes newAttr = attributes.peek().clone();
-
-         // check per config ignorePaths!
-         for (BuildConfig cfg : allConfigs) {
-            if (cfg.matchesIgnoredPath(path.toAbsolutePath().toString())) {
-               newAttr.setIgnore(cfg);
-            }
-
-            // Hide is always on all configs. And additional files are never hiddden
-            if (cfg.matchesHidePath(path.toAbsolutePath().toString())) {
-               hide = true;
-               break;
-            }
-         }
-
-         if (!hide) {
-            String name = startDir.relativize(path.toAbsolutePath()).toString();
-            if (!"".equals(name)) {
-               wg10.addFilter(name);
-            }
-
-            attributes.push(newAttr);
-            return super.preVisitDirectory(path, attrs);
-         } else {
-            return FileVisitResult.SKIP_SUBTREE;
-         }
-      }
-
-      @Override
-      public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
-         //end matching attributes set by ignorepath
-         attributes.pop();
-         return CONTINUE;
-      }
-
-      @Override
-      public FileVisitResult visitFileFailed(Path file, IOException exc) {
-         return CONTINUE;
-      }
-
-      public void writeFileTree() throws IOException {
-         Files.walkFileTree(this.startDir, this);
-      }
-}
--- a/src/share/tools/ProjectCreator/ProjectCreator.java	Tue May 10 12:18:22 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 1999, 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.
- *
- */
-
-public class ProjectCreator {
-
-   public static void usage() {
-      System.out.println("ProjectCreator options:");
-      System.err.println("WinGammaPlatform platform-specific options:");
-      System.err.println("  -sourceBase <path to directory (workspace) "
-            + "containing source files; no trailing slash>");
-      System.err.println("  -dspFileName <full pathname to which .dsp file "
-            + "will be written; all parent directories must "
-            + "already exist>");
-      System.err.println("  -envVar <environment variable to be inserted "
-            + "into .dsp file, substituting for path given in "
-            + "-sourceBase. Example: HotSpotWorkSpace>");
-      System.err.println("  -dllLoc <path to directory in which to put "
-            + "jvm.dll; no trailing slash>");
-      System.err.println("  If any of the above are specified, "
-            + "they must all be.");
-      System.err.println("  Note: if '-altRelativeInclude' option below is "
-            + "used, then the '-relativeAltSrcInclude' option must be used "
-            + "to specify the alternate source dir, e.g., 'src\\closed'");
-      System.err.println("  Additional, optional arguments, which can be "
-            + "specified multiple times:");
-      System.err.println("    -absoluteInclude <string containing absolute "
-            + "path to include directory>");
-      System.err.println("    -altRelativeInclude <string containing "
-            + "alternate include directory relative to -envVar>");
-      System.err.println("    -relativeInclude <string containing include "
-            + "directory relative to -envVar>");
-      System.err.println("    -define <preprocessor flag to be #defined "
-            + "(note: doesn't yet support " + "#define (flag) (value))>");
-      System.err.println("    -perFileLine <file> <line>");
-      System.err.println("    -conditionalPerFileLine <file> <line for "
-            + "release build> <line for debug build>");
-      System.err.println("  (NOTE: To work around a bug in nmake, where "
-            + "you can't have a '#' character in a quoted "
-            + "string, all of the lines outputted have \"#\"" + "prepended)");
-      System.err.println("    -startAt <subdir of sourceBase>");
-      System.err.println("    -ignoreFile <file which won't be able to be "
-            + "found in the sourceBase because it's generated " + "later>");
-      System.err.println("    -additionalFile <file not in database but "
-            + "which should show up in .dsp file>");
-      System.err
-            .println("    -additionalGeneratedFile <environment variable of "
-                  + "generated file's location> <relative path to "
-                  + "directory containing file; no trailing slash> "
-                  + "<name of file generated later in the build process>");
-      System.err.println("    -prelink <build> <desc> <cmds>:");
-      System.err
-            .println(" Generate a set of prelink commands for the given BUILD");
-      System.err
-            .println(" (\"Debug\" or \"Release\"). The prelink description and commands");
-      System.err.println(" are both quoted strings.");
-      System.err.println("    Default includes: \".\"");
-      System.err
-            .println("    Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\"");
-   }
-
-   public static void main(String[] args) {
-      try {
-         if (args.length < 3) {
-            usage();
-            System.exit(1);
-         }
-
-         String platformName = args[0];
-         Class platformClass = Class.forName(platformName);
-         WinGammaPlatform platform = (WinGammaPlatform) platformClass
-               .newInstance();
-
-         String[] platformArgs = new String[args.length - 1];
-         System.arraycopy(args, 1, platformArgs, 0, platformArgs.length);
-
-         // Allow the platform to write platform-specific files
-         platform.createVcproj(platformArgs);
-      } catch (Exception e) {
-         e.printStackTrace();
-         System.exit(1);
-      }
-   }
-}
--- a/src/share/tools/ProjectCreator/Util.java	Tue May 10 12:18:22 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.util.*;
-import java.io.File;
-
-public class Util {
-
-    static String join(String padder, Vector<String> v) {
-        return join(padder, v, false);
-    }
-
-    static String join(String padder, Vector<String> v, boolean quoted) {
-        StringBuffer sb = new StringBuffer();
-
-        for (Iterator<String> iter = v.iterator(); iter.hasNext(); ) {
-            if (quoted) {
-                sb.append('"');
-            }
-            sb.append(iter.next());
-            if (quoted) {
-                sb.append('"');
-            }
-            if (iter.hasNext()) sb.append(padder);
-        }
-
-        return sb.toString();
-    }
-
-
-    static String prefixed_join(String padder, Vector<String> v, boolean quoted) {
-        StringBuffer sb = new StringBuffer();
-
-        for (Iterator<String> iter = v.iterator(); iter.hasNext(); ) {
-            sb.append(padder);
-
-            if (quoted) {
-                sb.append('"');
-            }
-            sb.append((String)iter.next());
-            if (quoted) {
-                sb.append('"');
-            }
-        }
-
-        return sb.toString();
-    }
-
-
-    static String normalize(String file) {
-        file = file.replace('\\', '/');
-        if (file.length() > 2) {
-            if (file.charAt(1) == ':' && file.charAt(2) == '/') {
-                // convert drive letter to uppercase
-                String drive = file.substring(0, 1).toUpperCase();
-                return drive + file.substring(1);
-            }
-        }
-        return file;
-    }
-
-    static String sep = File.separator;
-}
--- a/src/share/tools/ProjectCreator/WinGammaPlatform.java	Tue May 10 12:18:22 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,675 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Stack;
-import java.util.Vector;
-
-abstract class HsArgHandler extends ArgHandler {
-    static final int STRING = 1;
-    static final int VECTOR = 2;
-    static final int HASH   = 3;
-
-    boolean nextNotKey(ArgIterator it) {
-        if (it.next()) {
-            String s = it.get();
-            return (s.length() == 0) || (s.charAt(0) != '-');
-        } else {
-            return false;
-        }
-    }
-
-    void empty(String key, String message) {
-        if (key != null) {
-            System.err.println("** Error: empty " + key);
-        }
-        if (message != null) {
-            System.err.println(message);
-        }
-        WinGammaPlatform.usage();
-    }
-
-    static String getCfg(String val) {
-        int under = val.indexOf('_');
-        int len = val.length();
-        if (under != -1 && under < len - 1) {
-            return val.substring(under+1, len);
-        } else {
-            return null;
-        }
-    }
-}
-
-class ArgRuleSpecific extends ArgRule {
-    ArgRuleSpecific(String arg, ArgHandler handler) {
-        super(arg, handler);
-    }
-
-    boolean match(String rulePattern, String arg) {
-        return rulePattern.startsWith(arg);
-    }
-}
-
-
-class SpecificHsArgHandler extends HsArgHandler {
-
-    String message, argKey, valKey;
-    int type;
-
-    public void handle(ArgIterator it) {
-        String cfg = getCfg(it.get());
-        if (nextNotKey(it)) {
-            String val = it.get();
-            switch (type) {
-            case VECTOR:
-                BuildConfig.addFieldVector(cfg, valKey, val);
-                break;
-            case HASH:
-                BuildConfig.putFieldHash(cfg, valKey, val, "1");
-                break;
-            case STRING:
-                BuildConfig.putField(cfg, valKey, val);
-                break;
-            default:
-                empty(valKey, "Unknown type: "+type);
-            }
-            it.next();
-
-        } else {
-            empty(argKey, message);
-        }
-    }
-
-    SpecificHsArgHandler(String argKey, String valKey, String message, int type) {
-        this.argKey = argKey;
-        this.valKey = valKey;
-        this.message = message;
-        this.type = type;
-    }
-}
-
-
-class HsArgRule extends ArgRuleSpecific {
-
-    HsArgRule(String argKey, String valKey, String message, int type) {
-        super(argKey, new SpecificHsArgHandler(argKey, valKey, message, type));
-    }
-
-}
-
-public abstract class WinGammaPlatform {
-
-    public boolean fileNameStringEquality(String s1, String s2) {
-        return s1.equalsIgnoreCase(s2);
-    }
-
-    static void usage() throws IllegalArgumentException {
-        System.err.println("WinGammaPlatform platform-specific options:");
-        System.err.println("  -sourceBase <path to directory (workspace) " +
-                           "containing source files; no trailing slash>");
-        System.err.println("  -projectFileName <full pathname to which project file " +
-                           "will be written; all parent directories must " +
-                           "already exist>");
-        System.err.println("  If any of the above are specified, "+
-                           "they must all be.");
-        System.err.println("  Note: if '-altRelativeInclude' option below " +
-                           "is used, then the '-relativeAltSrcInclude' " +
-                           "option must be used to specify the alternate " +
-                           "source dir, e.g., 'src\\closed'");
-        System.err.println("  Additional, optional arguments, which can be " +
-                           "specified multiple times:");
-        System.err.println("    -absoluteInclude <string containing absolute " +
-                           "path to include directory>");
-        System.err.println("    -altRelativeInclude <string containing " +
-                           "alternate include directory relative to " +
-                           "-sourceBase>");
-        System.err.println("    -relativeInclude <string containing include " +
-                           "directory relative to -sourceBase>");
-        System.err.println("    -define <preprocessor flag to be #defined " +
-                           "(note: doesn't yet support " +
-                           "#define (flag) (value))>");
-        System.err.println("    -startAt <subdir of sourceBase>");
-        System.err.println("    -additionalFile <file not in database but " +
-                           "which should show up in project file>");
-        System.err.println("    -additionalGeneratedFile <absolute path to " +
-                           "directory containing file; no trailing slash> " +
-                           "<name of file generated later in the build process>");
-        throw new IllegalArgumentException();
-    }
-
-
-    public void addPerFileLine(Hashtable table,
-                               String fileName,
-                               String line) {
-        Vector v = (Vector) table.get(fileName);
-        if (v != null) {
-            v.add(line);
-        } else {
-            v = new Vector();
-            v.add(line);
-            table.put(fileName, v);
-        }
-    }
-
-    protected static class PerFileCondData {
-        public String releaseString;
-        public String debugString;
-    }
-
-    protected void addConditionalPerFileLine(Hashtable table,
-                                           String fileName,
-                                           String releaseLine,
-                                           String debugLine) {
-        PerFileCondData data = new PerFileCondData();
-        data.releaseString = releaseLine;
-        data.debugString = debugLine;
-        Vector v = (Vector) table.get(fileName);
-        if (v != null) {
-            v.add(data);
-        } else {
-            v = new Vector();
-            v.add(data);
-            table.put(fileName, v);
-        }
-    }
-
-    protected static class PrelinkCommandData {
-      String description;
-      String commands;
-    }
-
-    protected void addPrelinkCommand(Hashtable table,
-                                     String build,
-                                     String description,
-                                     String commands) {
-      PrelinkCommandData data = new PrelinkCommandData();
-      data.description = description;
-      data.commands = commands;
-      table.put(build, data);
-    }
-
-    public boolean findString(Vector v, String s) {
-        for (Iterator iter = v.iterator(); iter.hasNext(); ) {
-            if (((String) iter.next()).equals(s)) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-     String getProjectName(String fullPath, String extension)
-        throws IllegalArgumentException, IOException {
-        File file = new File(fullPath).getCanonicalFile();
-        fullPath = file.getCanonicalPath();
-        String parent = file.getParent();
-
-        if (!fullPath.endsWith(extension)) {
-            throw new IllegalArgumentException("project file name \"" +
-                                               fullPath +
-                                               "\" does not end in "+extension);
-        }
-
-        if ((parent != null) &&
-            (!fullPath.startsWith(parent))) {
-            throw new RuntimeException(
-                "Internal error: parent of file name \"" + parent +
-                "\" does not match file name \"" + fullPath + "\""
-            );
-        }
-
-        int len = parent.length();
-        if (!parent.endsWith(Util.sep)) {
-            len += Util.sep.length();
-        }
-
-        int end = fullPath.length() - extension.length();
-
-        if (len == end) {
-            throw new RuntimeException(
-                "Internal error: file name was empty"
-            );
-        }
-
-        return fullPath.substring(len, end);
-    }
-
-    protected abstract String getProjectExt();
-
-    public void createVcproj(String[] args)
-        throws IllegalArgumentException, IOException {
-
-        parseArguments(args);
-
-        String projectFileName = BuildConfig.getFieldString(null, "ProjectFileName");
-        String ext = getProjectExt();
-
-        String projectName = getProjectName(projectFileName, ext);
-
-        writeProjectFile(projectFileName, projectName, createAllConfigs(BuildConfig.getFieldString(null, "PlatformName")));
-    }
-
-    protected void writePrologue(String[] args) {
-        System.err.println("WinGammaPlatform platform-specific arguments:");
-        for (int i = 0; i < args.length; i++) {
-            System.err.print(args[i] + " ");
-        }
-        System.err.println();
-    }
-
-
-    void parseArguments(String[] args) {
-        new ArgsParser(args,
-                       new ArgRule[]
-            {
-                new ArgRule("-sourceBase",
-                            new HsArgHandler() {
-                                public void handle(ArgIterator it) {
-                                   String cfg = getCfg(it.get());
-                                   if (nextNotKey(it)) {
-                                      String sb = (String) it.get();
-                                      if (sb.endsWith(Util.sep)) {
-                                         sb = sb.substring(0, sb.length() - 1);
-                                      }
-                                      BuildConfig.putField(cfg, "SourceBase", sb);
-                                      it.next();
-                                   } else {
-                                      empty("-sourceBase", null);
-                                   }
-                                }
-                            }
-                            ),
-
-                new HsArgRule("-buildBase",
-                              "BuildBase",
-                              "   (Did you set the HotSpotBuildSpace environment variable?)",
-                              HsArgHandler.STRING
-                              ),
-
-               new HsArgRule("-buildSpace",
-                              "BuildSpace",
-                              null,
-                              HsArgHandler.STRING
-                              ),
-
-              new HsArgRule("-platformName",
-                              "PlatformName",
-                              null,
-                              HsArgHandler.STRING
-                              ),
-
-              new HsArgRule("-projectFileName",
-                              "ProjectFileName",
-                              null,
-                              HsArgHandler.STRING
-                              ),
-
-                new HsArgRule("-jdkTargetRoot",
-                              "JdkTargetRoot",
-                              "   (Did you set the HotSpotJDKDist environment variable?)",
-                              HsArgHandler.STRING
-                              ),
-
-                new HsArgRule("-compiler",
-                              "CompilerVersion",
-                              "   (Did you set the VcVersion correctly?)",
-                              HsArgHandler.STRING
-                              ),
-
-                new HsArgRule("-absoluteInclude",
-                              "AbsoluteInclude",
-                              null,
-                              HsArgHandler.VECTOR
-                              ),
-
-                new HsArgRule("-altRelativeInclude",
-                              "AltRelativeInclude",
-                              null,
-                              HsArgHandler.VECTOR
-                              ),
-
-                new HsArgRule("-relativeInclude",
-                              "RelativeInclude",
-                              null,
-                              HsArgHandler.VECTOR
-                              ),
-
-                new HsArgRule("-absoluteSrcInclude",
-                              "AbsoluteSrcInclude",
-                              null,
-                              HsArgHandler.VECTOR
-                              ),
-
-                new HsArgRule("-relativeAltSrcInclude",
-                              "RelativeAltSrcInclude",
-                              null,
-                              HsArgHandler.STRING
-                              ),
-
-                new HsArgRule("-relativeSrcInclude",
-                              "RelativeSrcInclude",
-                              null,
-                              HsArgHandler.VECTOR
-                              ),
-
-                new HsArgRule("-define",
-                              "Define",
-                              null,
-                              HsArgHandler.VECTOR
-                              ),
-
-                new HsArgRule("-useToGeneratePch",
-                              "UseToGeneratePch",
-                              null,
-                              HsArgHandler.STRING
-                              ),
-
-                new ArgRuleSpecific("-perFileLine",
-                            new HsArgHandler() {
-                                public void handle(ArgIterator it) {
-                                    String cfg = getCfg(it.get());
-                                    if (nextNotKey(it)) {
-                                        String fileName = it.get();
-                                        if (nextNotKey(it)) {
-                                            String line = it.get();
-                                            BuildConfig.putFieldHash(cfg, "PerFileLine", fileName, line);
-                                            it.next();
-                                            return;
-                                        }
-                                    }
-                                    empty(null, "** Error: wrong number of args to -perFileLine");
-                                }
-                            }
-                            ),
-
-                new ArgRuleSpecific("-conditionalPerFileLine",
-                            new HsArgHandler() {
-                                public void handle(ArgIterator it) {
-                                    String cfg = getCfg(it.get());
-                                    if (nextNotKey(it)) {
-                                        String fileName = it.get();
-                                        if (nextNotKey(it)) {
-                                            String productLine = it.get();
-                                            if (nextNotKey(it)) {
-                                                String debugLine = it.get();
-                                                BuildConfig.putFieldHash(cfg+"_debug", "CondPerFileLine",
-                                                                         fileName, debugLine);
-                                                BuildConfig.putFieldHash(cfg+"_product", "CondPerFileLine",
-                                                                         fileName, productLine);
-                                                it.next();
-                                                return;
-                                            }
-                                        }
-                                    }
-
-                                    empty(null, "** Error: wrong number of args to -conditionalPerFileLine");
-                                }
-                            }
-                            ),
-
-                new HsArgRule("-disablePch",
-                              "DisablePch",
-                              null,
-                              HsArgHandler.HASH
-                              ),
-
-                new ArgRule("-startAt",
-                            new HsArgHandler() {
-                                public void handle(ArgIterator it) {
-                                    if (BuildConfig.getField(null, "StartAt") != null) {
-                                        empty(null, "** Error: multiple -startAt");
-                                    }
-                                    if (nextNotKey(it)) {
-                                        BuildConfig.putField(null, "StartAt", it.get());
-                                        it.next();
-                                    } else {
-                                        empty("-startAt", null);
-                                    }
-                                }
-                            }
-                            ),
-
-                new HsArgRule("-ignoreFile",
-                                      "IgnoreFile",
-                                      null,
-                                      HsArgHandler.HASH
-                                      ),
-
-                new HsArgRule("-ignorePath",
-                              "IgnorePath",
-                              null,
-                              HsArgHandler.VECTOR
-                              ),
-
-                new HsArgRule("-hidePath",
-                      "HidePath",
-                      null,
-                      HsArgHandler.VECTOR
-                      ),
-
-                new HsArgRule("-additionalFile",
-                              "AdditionalFile",
-                              null,
-                              HsArgHandler.VECTOR
-                              ),
-
-                new ArgRuleSpecific("-additionalGeneratedFile",
-                            new HsArgHandler() {
-                                public void handle(ArgIterator it) {
-                                    String cfg = getCfg(it.get());
-                                    if (nextNotKey(it)) {
-                                        String dir = it.get();
-                                        if (nextNotKey(it)) {
-                                            String fileName = it.get();
-                                            BuildConfig.putFieldHash(cfg, "AdditionalGeneratedFile",
-                                                                     Util.normalize(dir + Util.sep + fileName),
-                                                                     fileName);
-                                            it.next();
-                                            return;
-                                        }
-                                    }
-                                    empty(null, "** Error: wrong number of args to -additionalGeneratedFile");
-                                }
-                            }
-                            ),
-
-                new ArgRule("-prelink",
-                            new HsArgHandler() {
-                                public void handle(ArgIterator it) {
-                                    if (nextNotKey(it)) {
-                                        if (nextNotKey(it)) {
-                                            String description = it.get();
-                                            if (nextNotKey(it)) {
-                                                String command = it.get();
-                                                BuildConfig.putField(null, "PrelinkDescription", description);
-                                                BuildConfig.putField(null, "PrelinkCommand", command);
-                                                it.next();
-                                                return;
-                                            }
-                                        }
-                                    }
-
-                                    empty(null,  "** Error: wrong number of args to -prelink");
-                                }
-                            }
-                            ),
-
-                new ArgRule("-postbuild",
-                            new HsArgHandler() {
-                                public void handle(ArgIterator it) {
-                                    if (nextNotKey(it)) {
-                                        if (nextNotKey(it)) {
-                                            String description = it.get();
-                                            if (nextNotKey(it)) {
-                                                String command = it.get();
-                                                BuildConfig.putField(null, "PostbuildDescription", description);
-                                                BuildConfig.putField(null, "PostbuildCommand", command);
-                                                it.next();
-                                                return;
-                                            }
-                                        }
-                                    }
-
-                                    empty(null,  "** Error: wrong number of args to -postbuild");
-                                }
-                            }
-                            ),
-            },
-                                       new ArgHandler() {
-                                           public void handle(ArgIterator it) {
-
-                                               throw new RuntimeException("Arg Parser: unrecognized option "+it.get());
-                                           }
-                                       }
-                                       );
-        if (BuildConfig.getField(null, "SourceBase") == null      ||
-            BuildConfig.getField(null, "BuildBase") == null       ||
-            BuildConfig.getField(null, "ProjectFileName") == null ||
-            BuildConfig.getField(null, "CompilerVersion") == null) {
-            usage();
-        }
-
-        if (BuildConfig.getField(null, "UseToGeneratePch") == null) {
-            throw new RuntimeException("ERROR: need to specify one file to compute PCH, with -useToGeneratePch flag");
-        }
-
-        BuildConfig.putField(null, "PlatformObject", this);
-    }
-
-    Vector createAllConfigs(String platform) {
-        Vector allConfigs = new Vector();
-
-        allConfigs.add(new C1DebugConfig());
-        allConfigs.add(new C1FastDebugConfig());
-        allConfigs.add(new C1ProductConfig());
-
-        allConfigs.add(new TieredDebugConfig());
-        allConfigs.add(new TieredFastDebugConfig());
-        allConfigs.add(new TieredProductConfig());
-
-        return allConfigs;
-    }
-
-    PrintWriter printWriter;
-
-    public void writeProjectFile(String projectFileName, String projectName,
-                                 Vector<BuildConfig> allConfigs) throws IOException {
-        throw new RuntimeException("use compiler version specific version");
-    }
-
-    int indent;
-    private Stack<String> tagStack = new Stack<String>();
-
-    private void startTagPrim(String name, String[] attrs, boolean close) {
-       startTagPrim(name, attrs, close, true);
-    }
-
-    private void startTagPrim(String name, String[] attrs, boolean close,
-          boolean newline) {
-       doIndent();
-       printWriter.print("<" + name);
-       indent++;
-
-       if (attrs != null && attrs.length > 0) {
-          for (int i = 0; i < attrs.length; i += 2) {
-             printWriter.print(" " + attrs[i] + "=\"" + attrs[i + 1] + "\"");
-             if (i < attrs.length - 2) {
-             }
-          }
-       }
-
-       if (close) {
-          indent--;
-          printWriter.print(" />");
-       } else {
-          // TODO push tag name, and change endTag to pop and print.
-          tagStack.push(name);
-          printWriter.print(">");
-       }
-       if (newline) {
-          printWriter.println();
-       }
-    }
-
-    void startTag(String name, String... attrs) {
-       startTagPrim(name, attrs, false);
-    }
-
-    void startTagV(String name, Vector attrs) {
-       String s[] = new String[attrs.size()];
-       for (int i = 0; i < attrs.size(); i++) {
-          s[i] = (String) attrs.elementAt(i);
-       }
-       startTagPrim(name, s, false);
-    }
-
-    void endTag() {
-       String name = tagStack.pop();
-       indent--;
-       doIndent();
-       printWriter.println("</" + name + ">");
-    }
-
-    private void endTagNoIndent() {
-       String name = tagStack.pop();
-       indent--;
-       printWriter.println("</" + name + ">");
-    }
-
-    void tag(String name, String... attrs) {
-       startTagPrim(name, attrs, true);
-    }
-
-    void tagData(String name, String data) {
-       startTagPrim(name, null, false, false);
-       printWriter.print(data);
-       endTagNoIndent();
-    }
-
-    void tagData(String name, String data, String... attrs) {
-       startTagPrim(name, attrs, false, false);
-       printWriter.print(data);
-       endTagNoIndent();
-    }
-
-    void tagV(String name, Vector attrs) {
-       String s[] = new String[attrs.size()];
-       for (int i = 0; i < attrs.size(); i++) {
-          s[i] = (String) attrs.elementAt(i);
-       }
-       startTagPrim(name, s, true);
-    }
-
-    void doIndent() {
-       for (int i = 0; i < indent; i++) {
-          printWriter.print("  ");
-       }
-    }
-
-
-}
--- a/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java	Tue May 10 12:18:22 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,476 +0,0 @@
-/*
- * Copyright (c) 2011, 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.
- *
- */
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.nio.file.FileSystems;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.UUID;
-import java.util.Vector;
-
-public class WinGammaPlatformVC10 extends WinGammaPlatform {
-
-
-   LinkedList <String>filters = new LinkedList<String>();
-   LinkedList <String[]>filterDeps = new LinkedList<String[]>();
-
-    @Override
-    protected String getProjectExt() {
-        return ".vcxproj";
-    }
-
-    @Override
-    public void writeProjectFile(String projectFileName, String projectName,
-            Vector<BuildConfig> allConfigs) throws IOException {
-        System.out.println();
-        System.out.println("    Writing .vcxproj file: " + projectFileName);
-
-        String projDir = Util.normalize(new File(projectFileName).getParent());
-
-        printWriter = new PrintWriter(projectFileName, "UTF-8");
-        printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
-        startTag("Project",
-                "DefaultTargets", "Build",
-                "ToolsVersion", "4.0",
-                "xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
-        startTag("ItemGroup",
-                "Label", "ProjectConfigurations");
-        for (BuildConfig cfg : allConfigs) {
-            startTag("ProjectConfiguration",
-                    "Include", cfg.get("Name"));
-            tagData("Configuration", cfg.get("Id"));
-            tagData("Platform", cfg.get("PlatformName"));
-            endTag();
-        }
-        endTag();
-
-        startTag("PropertyGroup", "Label", "Globals");
-        tagData("ProjectGuid", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}");
-        tag("SccProjectName");
-        tag("SccLocalPath");
-        endTag();
-
-        tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props");
-
-        for (BuildConfig cfg : allConfigs) {
-            startTag(cfg, "PropertyGroup", "Label", "Configuration");
-            tagData("ConfigurationType", "DynamicLibrary");
-            tagData("UseOfMfc", "false");
-            tagData("PlatformToolset", "v120");
-            endTag();
-        }
-
-        tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.props");
-        startTag("ImportGroup", "Label", "ExtensionSettings");
-        endTag();
-        for (BuildConfig cfg : allConfigs) {
-            startTag(cfg, "ImportGroup", "Label", "PropertySheets");
-            tag("Import",
-                    "Project", "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props",
-                    "Condition", "exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')",
-                    "Label", "LocalAppDataPlatform");
-            endTag();
-        }
-
-        tag("PropertyGroup", "Label", "UserMacros");
-
-        startTag("PropertyGroup");
-        tagData("_ProjectFileVersion", "10.0.30319.1");
-        for (BuildConfig cfg : allConfigs) {
-            tagData(cfg, "OutDir", cfg.get("OutputDir") + Util.sep);
-            tagData(cfg, "IntDir", cfg.get("OutputDir") + Util.sep);
-            tagData(cfg, "LinkIncremental", "false");
-        }
-        for (BuildConfig cfg : allConfigs) {
-            tagData(cfg, "CodeAnalysisRuleSet", "AllRules.ruleset");
-            tag(cfg, "CodeAnalysisRules");
-            tag(cfg, "CodeAnalysisRuleAssemblies");
-        }
-        endTag();
-
-        for (BuildConfig cfg : allConfigs) {
-            startTag(cfg, "ItemDefinitionGroup");
-            startTag("ClCompile");
-            tagV(cfg.getV("CompilerFlags"));
-            endTag();
-
-            startTag("Link");
-            tagV(cfg.getV("LinkerFlags"));
-            endTag();
-
-            startTag("PreLinkEvent");
-            tagData("Message", BuildConfig.getFieldString(null, "PrelinkDescription"));
-            tagData("Command", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace("\t", "\r\n")));
-            endTag();
-
-            endTag();
-        }
-
-        writeFiles(allConfigs, projDir);
-
-        tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets");
-        startTag("ImportGroup", "Label", "ExtensionTargets");
-        endTag();
-
-        endTag();
-        printWriter.close();
-        System.out.println("    Done writing .vcxproj file.");
-
-        writeFilterFile(projectFileName, projectName, allConfigs, projDir);
-        writeUserFile(projectFileName, allConfigs);
-    }
-
-
-    private void writeUserFile(String projectFileName, Vector<BuildConfig> allConfigs) throws FileNotFoundException, UnsupportedEncodingException {
-        String userFileName = projectFileName + ".user";
-        if (new File(userFileName).exists()) {
-            return;
-        }
-        System.out.print("    Writing .vcxproj.user file: " + userFileName);
-        printWriter = new PrintWriter(userFileName, "UTF-8");
-
-        printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
-        startTag("Project",
-                "ToolsVersion", "4.0",
-                "xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
-
-        for (BuildConfig cfg : allConfigs) {
-            startTag(cfg, "PropertyGroup");
-            tagData("LocalDebuggerCommand", cfg.get("JdkTargetRoot") + "\\bin\\java.exe");
-            // The JVM loads some libraries using a path relative to
-            // itself because it expects to be in a JRE or a JDK. The java
-            // launcher's '-XXaltjvm=' option allows the JVM to be outside
-            // the JRE or JDK so '-Dsun.java.launcher.is_altjvm=true'
-            // forces a fake JAVA_HOME relative path to be used to
-            // find the other libraries. The '-XX:+PauseAtExit' option
-            // causes the VM to wait for key press before exiting; this
-            // allows any stdout or stderr messages to be seen before
-            // the cmdtool exits.
-            tagData("LocalDebuggerCommandArguments", "-XXaltjvm=$(TargetDir) "
-                    + "-Dsun.java.launcher.is_altjvm=true "
-                    + "-XX:+UnlockDiagnosticVMOptions -XX:+PauseAtExit");
-            tagData("LocalDebuggerEnvironment", "JAVA_HOME=" + cfg.get("JdkTargetRoot"));
-            endTag();
-        }
-
-        endTag();
-        printWriter.close();
-        System.out.println("    Done.");
-    }
-
-    public void addFilter(String rPath) {
-       filters.add(rPath);
-    }
-
-    public void addFilterDependency(String fileLoc, String filter) {
-      filterDeps.add(new String[] {fileLoc, filter});
-    }
-
-    private void writeFilterFile(String projectFileName, String projectName,
-            Vector<BuildConfig> allConfigs, String base) throws FileNotFoundException, UnsupportedEncodingException {
-        String filterFileName = projectFileName + ".filters";
-        System.out.print("    Writing .vcxproj.filters file: " + filterFileName);
-        printWriter = new PrintWriter(filterFileName, "UTF-8");
-
-        printWriter.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
-        startTag("Project",
-                "ToolsVersion", "4.0",
-                "xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
-
-        startTag("ItemGroup");
-        for (String filter : filters) {
-           startTag("Filter", "Include",filter);
-           UUID uuid = UUID.randomUUID();
-           tagData("UniqueIdentifier", "{" + uuid.toString() + "}");
-           endTag();
-        }
-        startTag("Filter", "Include", "Resource Files");
-        UUID uuid = UUID.randomUUID();
-        tagData("UniqueIdentifier", "{" + uuid.toString() + "}");
-        tagData("Extensions", "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe");
-        endTag();
-        endTag();
-
-        //TODO - do I need to split cpp and hpp files?
-
-        // then all files
-        startTag("ItemGroup");
-        for (String[] dep : filterDeps) {
-           String tagName = getFileTagFromSuffix(dep[0]);
-
-           startTag(tagName, "Include", dep[0]);
-           tagData("Filter", dep[1]);
-           endTag();
-        }
-        endTag();
-
-        endTag();
-        printWriter.close();
-        System.out.println("    Done.");
-    }
-
-    public String getFileTagFromSuffix(String fileName) {
-       if (fileName.endsWith(".cpp")) {
-          return"ClCompile";
-       } else if (fileName.endsWith(".c")) {
-          return "ClCompile";
-       } else if (fileName.endsWith(".hpp")) {
-          return"ClInclude";
-       } else if (fileName.endsWith(".h")) {
-          return "ClInclude";
-       } else {
-          return"None";
-       }
-    }
-
-    void writeFiles(Vector<BuildConfig> allConfigs, String projDir) {
-       // This code assummes there are no config specific includes.
-       startTag("ItemGroup");
-
-       String sourceBase = BuildConfig.getFieldString(null, "SourceBase");
-
-       // Use first config for all global absolute includes.
-       BuildConfig baseConfig = allConfigs.firstElement();
-       Vector<String> rv = new Vector<String>();
-
-       // Then use first config for all relative includes
-       Vector<String> ri = new Vector<String>();
-       baseConfig.collectRelevantVectors(ri, "RelativeSrcInclude");
-       for (String f : ri) {
-          rv.add(sourceBase + Util.sep + f);
-       }
-
-       baseConfig.collectRelevantVectors(rv, "AbsoluteSrcInclude");
-
-       handleIncludes(rv, allConfigs);
-
-       endTag();
-    }
-
-    // Will visit file tree for each include
-    private void handleIncludes(Vector<String> includes, Vector<BuildConfig> allConfigs) {
-       for (String path : includes)  {
-          FileTreeCreatorVC10 ftc = new FileTreeCreatorVC10(FileSystems.getDefault().getPath(path) , allConfigs, this);
-          try {
-             ftc.writeFileTree();
-          } catch (IOException e) {
-             e.printStackTrace();
-          }
-       }
-    }
-
-    String buildCond(BuildConfig cfg) {
-        return "'$(Configuration)|$(Platform)'=='"+cfg.get("Name")+"'";
-    }
-
-    void tagV(Vector<String> v) {
-        Iterator<String> i = v.iterator();
-        while(i.hasNext()) {
-            String name = i.next();
-            String data = i.next();
-            tagData(name, data);
-        }
-    }
-
-    void tagData(BuildConfig cfg, String name, String data) {
-        tagData(name, data, "Condition", buildCond(cfg));
-    }
-
-    void tag(BuildConfig cfg, String name, String... attrs) {
-        String[] ss = new String[attrs.length + 2];
-        ss[0] = "Condition";
-        ss[1] = buildCond(cfg);
-        System.arraycopy(attrs, 0, ss, 2, attrs.length);
-
-        tag(name, ss);
-    }
-
-    void startTag(BuildConfig cfg, String name, String... attrs) {
-        String[] ss = new String[attrs.length + 2];
-        ss[0] = "Condition";
-        ss[1] = buildCond(cfg);
-        System.arraycopy(attrs, 0, ss, 2, attrs.length);
-
-        startTag(name, ss);
-    }
-
-}
-
-class CompilerInterfaceVC10 extends CompilerInterface {
-
-    @Override
-    Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) {
-        Vector rv = new Vector();
-
-        addAttr(rv, "AdditionalIncludeDirectories", Util.join(";", includes));
-        addAttr(rv, "PreprocessorDefinitions",
-                Util.join(";", defines).replace("\\\"", "\""));
-        addAttr(rv, "PrecompiledHeaderFile", "precompiled.hpp");
-        addAttr(rv, "PrecompiledHeaderOutputFile", outDir+Util.sep+"vm.pch");
-        addAttr(rv, "AssemblerListingLocation", outDir);
-        addAttr(rv, "ObjectFileName", outDir+Util.sep);
-        addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"jvm.pdb");
-        // Set /nologo option
-        addAttr(rv, "SuppressStartupBanner", "true");
-        // Surpass the default /Tc or /Tp.
-        addAttr(rv, "CompileAs", "Default");
-        // Set /W3 option.
-        addAttr(rv, "WarningLevel", "Level3");
-        // Set /WX option,
-        addAttr(rv, "TreatWarningAsError", "true");
-        // Set /GS option
-        addAttr(rv, "BufferSecurityCheck", "false");
-        // Set /Zi option.
-        addAttr(rv, "DebugInformationFormat", "ProgramDatabase");
-        // Set /Yu option.
-        addAttr(rv, "PrecompiledHeader", "Use");
-        // Set /EHsc- option
-        addAttr(rv, "ExceptionHandling", "");
-
-        addAttr(rv, "MultiProcessorCompilation", "true");
-
-        return rv;
-    }
-
-    @Override
-    Vector getDebugCompilerFlags(String opt, String platformName) {
-        Vector rv = new Vector();
-
-        // Set /On option
-        addAttr(rv, "Optimization", opt);
-        // Set /MD option.
-        addAttr(rv, "RuntimeLibrary", "MultiThreadedDLL");
-        // Set /Oy- option
-        addAttr(rv, "OmitFramePointers", "false");
-        // Set /homeparams for x64 debug builds
-        if(platformName.equals("x64")) {
-            addAttr(rv, "AdditionalOptions", "/homeparams");
-        }
-
-        return rv;
-    }
-
-    @Override
-    Vector getProductCompilerFlags() {
-        Vector rv = new Vector();
-
-        // Set /O2 option.
-        addAttr(rv, "Optimization", "MaxSpeed");
-        // Set /Oy- option
-        addAttr(rv, "OmitFramePointers", "false");
-        // Set /Ob option.  1 is expandOnlyInline
-        addAttr(rv, "InlineFunctionExpansion", "OnlyExplicitInline");
-        // Set /GF option.
-        addAttr(rv, "StringPooling", "true");
-        // Set /MD option. 2 is rtMultiThreadedDLL
-        addAttr(rv, "RuntimeLibrary", "MultiThreadedDLL");
-        // Set /Gy option
-        addAttr(rv, "FunctionLevelLinking", "true");
-
-        return rv;
-    }
-
-    @Override
-    Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) {
-        Vector rv = new Vector();
-
-        if(platformName.equals("Win32")) {
-            addAttr(rv, "AdditionalOptions",
-                    "/export:JNI_GetDefaultJavaVMInitArgs " +
-                    "/export:JNI_CreateJavaVM " +
-                    "/export:JVM_FindClassFromBootLoader "+
-                    "/export:JNI_GetCreatedJavaVMs "+
-                    "/export:jio_snprintf /export:jio_printf "+
-                    "/export:jio_fprintf /export:jio_vfprintf "+
-                    "/export:jio_vsnprintf "+
-                    "/export:JVM_GetVersionInfo "+
-                    "/export:JVM_InitAgentProperties");
-        }
-        addAttr(rv, "AdditionalDependencies", "kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;Wsock32.lib;winmm.lib;psapi.lib;version.lib");
-        addAttr(rv, "OutputFile", outDll);
-        addAttr(rv, "SuppressStartupBanner", "true");
-        addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def");
-        addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"jvm.pdb");
-        addAttr(rv, "SubSystem", "Windows");
-        addAttr(rv, "BaseAddress", "0x8000000");
-        addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib");
-
-        if(platformName.equals("Win32")) {
-            addAttr(rv, "TargetMachine", "MachineX86");
-        } else {
-            addAttr(rv, "TargetMachine", "MachineX64");
-        }
-
-        // We always want the /DEBUG option to get full symbol information in the pdb files
-        addAttr(rv, "GenerateDebugInformation", "true");
-
-        return rv;
-    }
-
-    @Override
-    Vector getDebugLinkerFlags() {
-        Vector rv = new Vector();
-
-        // Empty now that /DEBUG option is used by all configs
-
-        return rv;
-    }
-
-    @Override
-    Vector getProductLinkerFlags() {
-        Vector rv = new Vector();
-
-        // Set /OPT:REF option.
-        addAttr(rv, "OptimizeReferences", "true");
-        // Set /OPT:ICF option.
-        addAttr(rv, "EnableCOMDATFolding", "true");
-
-        return rv;
-    }
-
-    @Override
-    void getAdditionalNonKernelLinkerFlags(Vector rv) {
-        extAttr(rv, "AdditionalOptions", " /export:AsyncGetCallTrace");
-    }
-
-    @Override
-    String getOptFlag() {
-        return "MaxSpeed";
-    }
-
-    @Override
-    String getNoOptFlag() {
-        return "Disabled";
-    }
-
-    @Override
-    String makeCfgName(String flavourBuild, String platform) {
-        return  flavourBuild + "|" + platform;
-    }
-
-}
--- a/src/share/vm/c1/c1_Compiler.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/c1/c1_Compiler.cpp	Wed May 11 00:38:58 2016 +0300
@@ -198,20 +198,6 @@
   case vmIntrinsics::_putLongVolatile:
   case vmIntrinsics::_putFloatVolatile:
   case vmIntrinsics::_putDoubleVolatile:
-  case vmIntrinsics::_getByte_raw:
-  case vmIntrinsics::_getShort_raw:
-  case vmIntrinsics::_getChar_raw:
-  case vmIntrinsics::_getInt_raw:
-  case vmIntrinsics::_getLong_raw:
-  case vmIntrinsics::_getFloat_raw:
-  case vmIntrinsics::_getDouble_raw:
-  case vmIntrinsics::_putByte_raw:
-  case vmIntrinsics::_putShort_raw:
-  case vmIntrinsics::_putChar_raw:
-  case vmIntrinsics::_putInt_raw:
-  case vmIntrinsics::_putLong_raw:
-  case vmIntrinsics::_putFloat_raw:
-  case vmIntrinsics::_putDouble_raw:
   case vmIntrinsics::_getShortUnaligned:
   case vmIntrinsics::_getCharUnaligned:
   case vmIntrinsics::_getIntUnaligned:
--- a/src/share/vm/c1/c1_GraphBuilder.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/c1/c1_GraphBuilder.cpp	Wed May 11 00:38:58 2016 +0300
@@ -3465,20 +3465,6 @@
   case vmIntrinsics::_putLongVolatile    : append_unsafe_put_obj(callee, T_LONG,    true); return;
   case vmIntrinsics::_putFloatVolatile   : append_unsafe_put_obj(callee, T_FLOAT,   true); return;
   case vmIntrinsics::_putDoubleVolatile  : append_unsafe_put_obj(callee, T_DOUBLE,  true); return;
-  case vmIntrinsics::_getByte_raw        : append_unsafe_get_raw(callee, T_BYTE  ); return;
-  case vmIntrinsics::_getShort_raw       : append_unsafe_get_raw(callee, T_SHORT ); return;
-  case vmIntrinsics::_getChar_raw        : append_unsafe_get_raw(callee, T_CHAR  ); return;
-  case vmIntrinsics::_getInt_raw         : append_unsafe_get_raw(callee, T_INT   ); return;
-  case vmIntrinsics::_getLong_raw        : append_unsafe_get_raw(callee, T_LONG  ); return;
-  case vmIntrinsics::_getFloat_raw       : append_unsafe_get_raw(callee, T_FLOAT ); return;
-  case vmIntrinsics::_getDouble_raw      : append_unsafe_get_raw(callee, T_DOUBLE); return;
-  case vmIntrinsics::_putByte_raw        : append_unsafe_put_raw(callee, T_BYTE  ); return;
-  case vmIntrinsics::_putShort_raw       : append_unsafe_put_raw(callee, T_SHORT ); return;
-  case vmIntrinsics::_putChar_raw        : append_unsafe_put_raw(callee, T_CHAR  ); return;
-  case vmIntrinsics::_putInt_raw         : append_unsafe_put_raw(callee, T_INT   ); return;
-  case vmIntrinsics::_putLong_raw        : append_unsafe_put_raw(callee, T_LONG  ); return;
-  case vmIntrinsics::_putFloat_raw       : append_unsafe_put_raw(callee, T_FLOAT ); return;
-  case vmIntrinsics::_putDouble_raw      : append_unsafe_put_raw(callee, T_DOUBLE);  return;
   case vmIntrinsics::_compareAndSwapLong:
   case vmIntrinsics::_compareAndSwapInt:
   case vmIntrinsics::_compareAndSwapObject: append_unsafe_CAS(callee); return;
--- a/src/share/vm/classfile/classLoader.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/classfile/classLoader.cpp	Wed May 11 00:38:58 2016 +0300
@@ -140,9 +140,10 @@
 PerfCounter*    ClassLoader::_isUnsyncloadClass = NULL;
 PerfCounter*    ClassLoader::_load_instance_class_failCounter = NULL;
 
-ClassPathEntry* ClassLoader::_first_entry         = NULL;
-ClassPathEntry* ClassLoader::_last_entry          = NULL;
-int             ClassLoader::_num_entries         = 0;
+GrowableArray<ModuleClassPathList*>* ClassLoader::_xpatch_entries = NULL;
+ClassPathEntry* ClassLoader::_first_entry        = NULL;
+ClassPathEntry* ClassLoader::_last_entry         = NULL;
+int             ClassLoader::_num_entries        = 0;
 ClassPathEntry* ClassLoader::_first_append_entry = NULL;
 bool            ClassLoader::_has_jimage = false;
 #if INCLUDE_CDS
@@ -179,6 +180,44 @@
   return (strncmp(str + (str_len - str_to_find_len), str_to_find, str_to_find_len) == 0);
 }
 
+// Used to obtain the package name from a fully qualified class name.
+// It is the responsibility of the caller to establish ResourceMark.
+const char* ClassLoader::package_from_name(const char* class_name) {
+  const char* last_slash = strrchr(class_name, '/');
+  if (last_slash == NULL) {
+    // No package name
+    return NULL;
+  }
+  int length = last_slash - class_name;
+
+  // A class name could have just the slash character in the name,
+  // resulting in a negative length.
+  if (length <= 0) {
+    // No package name
+    return NULL;
+  }
+
+  // drop name after last slash (including slash)
+  // Ex., "java/lang/String.class" => "java/lang"
+  char* pkg_name = NEW_RESOURCE_ARRAY(char, length + 1);
+  strncpy(pkg_name, class_name, length);
+  *(pkg_name+length) = '\0';
+
+  return (const char *)pkg_name;
+}
+
+// Given a fully qualified class name, find its defining package in the class loader's
+// package entry table.
+static PackageEntry* get_package_entry(const char* class_name, ClassLoaderData* loader_data, TRAPS) {
+  ResourceMark rm(THREAD);
+  const char *pkg_name = ClassLoader::package_from_name(class_name);
+  if (pkg_name == NULL) {
+    return NULL;
+  }
+  PackageEntryTable* pkgEntryTable = loader_data->packages();
+  TempNewSymbol pkg_symbol = SymbolTable::new_symbol(pkg_name, CHECK_NULL);
+  return pkgEntryTable->lookup_only(pkg_symbol);
+}
 
 ClassPathDirEntry::ClassPathDirEntry(const char* dir) : ClassPathEntry() {
   char* copy = NEW_C_HEAP_ARRAY(char, strlen(dir)+1, mtClass);
@@ -281,8 +320,7 @@
 #if INCLUDE_CDS
 u1* ClassPathZipEntry::open_versioned_entry(const char* name, jint* filesize, TRAPS) {
   u1* buffer = NULL;
-  if (!_is_boot_append) {
-    assert(DumpSharedSpaces, "Should be called only for non-boot entries during dump time");
+  if (DumpSharedSpaces) {
     // We presume default is multi-release enabled
     const char* multi_ver = Arguments::get_property("jdk.util.jar.enableMultiRelease");
     const char* verstr = Arguments::get_property("jdk.util.jar.version");
@@ -399,31 +437,6 @@
   }
 }
 
-void ClassPathImageEntry::name_to_package(const char* name, char* buffer, int length) {
-  const char *pslash = strrchr(name, '/');
-  if (pslash == NULL) {
-    buffer[0] = '\0';
-    return;
-  }
-  int len = pslash - name;
-#if INCLUDE_CDS
-  if (len <= 0 && DumpSharedSpaces) {
-    buffer[0] = '\0';
-    return;
-  }
-#endif
-  assert(len > 0, "Bad length for package name");
-  if (len >= length) {
-    buffer[0] = '\0';
-    return;
-  }
-  // drop name after last slash (including slash)
-  // Ex., "java/lang/String.class" => "java/lang"
-  strncpy(buffer, name, len);
-  // ensure string termination (strncpy does not guarantee)
-  buffer[len] = '\0';
-}
-
 // For a class in a named module, look it up in the jimage file using this syntax:
 //    /<module-name>/<package-name>/<base-class>
 //
@@ -436,15 +449,10 @@
   JImageLocationRef location = (*JImageFindResource)(_jimage, "", get_jimage_version_string(), name, &size);
 
   if (location == 0) {
-    char package[JIMAGE_MAX_PATH];
-    name_to_package(name, package, JIMAGE_MAX_PATH);
+    ResourceMark rm;
+    const char* pkg_name = ClassLoader::package_from_name(name);
 
-#if INCLUDE_CDS
-    if (package[0] == '\0' && DumpSharedSpaces) {
-      return NULL;
-    }
-#endif
-    if (package[0] != '\0') {
+    if (pkg_name != NULL) {
       if (!Universe::is_module_initialized()) {
         location = (*JImageFindResource)(_jimage, "java.base", get_jimage_version_string(), name, &size);
 #if INCLUDE_CDS
@@ -452,7 +460,7 @@
         // modules defined for other class loaders.  So, for now, get their module
         // names from the "modules" jimage file.
         if (DumpSharedSpaces && location == 0) {
-          const char* module_name = (*JImagePackageToModule)(_jimage, package);
+          const char* module_name = (*JImagePackageToModule)(_jimage, pkg_name);
           if (module_name != NULL) {
             location = (*JImageFindResource)(_jimage, module_name, get_jimage_version_string(), name, &size);
           }
@@ -460,13 +468,7 @@
 #endif
 
       } else {
-        // Get boot class loader's package entry table
-        PackageEntryTable* pkgEntryTable =
-          ClassLoaderData::the_null_class_loader_data()->packages();
-        // Get package's package entry
-        TempNewSymbol pkg_symbol = SymbolTable::new_symbol(package, CHECK_NULL);
-        PackageEntry* package_entry = pkgEntryTable->lookup_only(pkg_symbol);
-
+        PackageEntry* package_entry = get_package_entry(name, ClassLoaderData::the_null_class_loader_data(), THREAD);
         if (package_entry != NULL) {
           ResourceMark rm;
           // Get the module name
@@ -539,6 +541,33 @@
 }
 #endif
 
+ModuleClassPathList::ModuleClassPathList(Symbol* module_name) {
+  _module_name = module_name;
+  _module_first_entry = NULL;
+  _module_last_entry = NULL;
+}
+
+ModuleClassPathList::~ModuleClassPathList() {
+  // Clean out each ClassPathEntry on list
+  ClassPathEntry* e = _module_first_entry;
+  while (e != NULL) {
+    ClassPathEntry* next_entry = e->next();
+    delete e;
+    e = next_entry;
+  }
+}
+
+void ModuleClassPathList::add_to_list(ClassPathEntry* new_entry) {
+  if (new_entry != NULL) {
+    if (_module_last_entry == NULL) {
+      _module_first_entry = _module_last_entry = new_entry;
+    } else {
+      _module_last_entry->set_next(new_entry);
+      _module_last_entry = new_entry;
+    }
+  }
+}
+
 void ClassLoader::trace_class_path(const char* msg, const char* name) {
   if (log_is_enabled(Info, class, path)) {
     ResourceMark rm;
@@ -616,6 +645,61 @@
 }
 #endif
 
+// Construct the array of module/path pairs as specified to -Xpatch
+// for the boot loader to search ahead of the jimage, if the class being
+// loaded is defined to a module that has been specified to -Xpatch.
+void ClassLoader::setup_xpatch_entries() {
+  Thread* THREAD = Thread::current();
+  GrowableArray<ModuleXPatchPath*>* xpatch_args = Arguments::get_xpatchprefix();
+  int num_of_entries = xpatch_args->length();
+
+  // Set up the boot loader's xpatch_entries list
+  _xpatch_entries = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<ModuleClassPathList*>(num_of_entries, true);
+
+  for (int i = 0; i < num_of_entries; i++) {
+    const char* module_name = (xpatch_args->at(i))->module_name();
+    Symbol* const module_sym = SymbolTable::lookup(module_name, (int)strlen(module_name), CHECK);
+    assert(module_sym != NULL, "Failed to obtain Symbol for module name");
+    ModuleClassPathList* module_cpl = new ModuleClassPathList(module_sym);
+
+    char* class_path = (xpatch_args->at(i))->path_string();
+    int len = (int)strlen(class_path);
+    int end = 0;
+    // Iterate over the module's class path entries
+    for (int start = 0; start < len; start = end) {
+      while (class_path[end] && class_path[end] != os::path_separator()[0]) {
+        end++;
+      }
+      EXCEPTION_MARK;
+      ResourceMark rm(THREAD);
+      char* path = NEW_RESOURCE_ARRAY(char, end - start + 1);
+      strncpy(path, &class_path[start], end - start);
+      path[end - start] = '\0';
+
+      struct stat st;
+      if (os::stat(path, &st) == 0) {
+        // File or directory found
+        Thread* THREAD = Thread::current();
+        ClassPathEntry* new_entry = create_class_path_entry(path, &st, false, false, CHECK);
+        // If the path specification is valid, enter it into this module's list
+        if (new_entry != NULL) {
+          module_cpl->add_to_list(new_entry);
+        }
+      }
+
+      while (class_path[end] == os::path_separator()[0]) {
+        end++;
+      }
+    }
+
+    // Record the module into the list of -Xpatch entries only if
+    // valid ClassPathEntrys have been created
+    if (module_cpl->module_first_entry() != NULL) {
+      _xpatch_entries->push(module_cpl);
+    }
+  }
+}
+
 void ClassLoader::setup_search_path(const char *class_path, bool bootstrap_search) {
   int offset = 0;
   int len = (int)strlen(class_path);
@@ -847,8 +931,29 @@
 }
 
 void ClassLoader::print_bootclasspath() {
-  ClassPathEntry* e = _first_entry;
+  ClassPathEntry* e;
   tty->print("[bootclasspath= ");
+
+  // Print -Xpatch module/path specifications first
+  if (_xpatch_entries != NULL) {
+    ResourceMark rm;
+    int num_of_entries = _xpatch_entries->length();
+    for (int i = 0; i < num_of_entries; i++) {
+      ModuleClassPathList* mpl = _xpatch_entries->at(i);
+      tty->print("%s=", mpl->module_name()->as_C_string());
+      e = mpl->module_first_entry();
+      while (e != NULL) {
+        tty->print("%s", e->name());
+        e = e->next();
+        if (e != NULL) {
+          tty->print("%s", os::path_separator());
+        }
+      }
+      tty->print(" ;");
+    }
+  }
+
+  e = _first_entry;
   while (e != NULL) {
     tty->print("%s ;", e->name());
     e = e->next();
@@ -942,13 +1047,15 @@
     return; // only needed for CDS dump time
   }
 
+  ResourceMark rm;
   jlong size;
   JImageLocationRef location = (*JImageFindResource)(jimage, "java.base", get_jimage_version_string(), MODULE_LOADER_MAP, &size);
   if (location == 0) {
     vm_exit_during_initialization(
       "Cannot find ModuleLoaderMap location from modules jimage.", NULL);
   }
-  char* buffer = NEW_RESOURCE_ARRAY(char, size);
+  char* buffer = NEW_RESOURCE_ARRAY(char, size + 1);
+  buffer[size] = '\0';
   jlong read = (*JImageGetResource)(jimage, location, buffer, size);
   if (read != size) {
     vm_exit_during_initialization(
@@ -986,7 +1093,6 @@
     begin_ptr = ++end_ptr;
     end_ptr = strchr(begin_ptr, '\n');
   }
-  FREE_RESOURCE_ARRAY(u1, buffer, size);
 }
 #endif
 
@@ -1107,8 +1213,7 @@
   return APP_LOADER;
 }
 
-s2 ClassLoader::classloader_type(Symbol* class_name, ClassPathEntry* e,
-                                     int classpath_index, TRAPS) {
+s2 ClassLoader::classloader_type(Symbol* class_name, ClassPathEntry* e, int classpath_index, TRAPS) {
   assert(DumpSharedSpaces, "Only used for CDS dump time");
 
   // obtain the classloader type based on the class name.
@@ -1157,12 +1262,11 @@
 }
 
 instanceKlassHandle ClassLoader::load_class(Symbol* name, bool search_append_only, TRAPS) {
-
   assert(name != NULL, "invariant");
   assert(THREAD->is_Java_thread(), "must be a JavaThread");
 
-  ResourceMark rm;
-  HandleMark hm;
+  ResourceMark rm(THREAD);
+  HandleMark hm(THREAD);
 
   const char* const class_name = name->as_C_string();
 
@@ -1178,30 +1282,101 @@
   // Lookup stream for parsing .class file
   ClassFileStream* stream = NULL;
   s2 classpath_index = 0;
+  ClassPathEntry* e = NULL;
 
   // If DumpSharedSpaces is true, boot loader visibility boundaries are set
-  // to be _first_entry to the end (all path entries).
+  // to be _first_entry to the end (all path entries). No -Xpatch entries are
+  // included since CDS and AppCDS are not supported if -Xpatch is specified.
   //
   // If search_append_only is true, boot loader visibility boundaries are
-  // set to be _fist_append_entry to the end. This includes:
+  // set to be _first_append_entry to the end. This includes:
   //   [-Xbootclasspath/a]; [jvmti appended entries]
   //
   // If both DumpSharedSpaces and search_append_only are false, boot loader
   // visibility boundaries are set to be _first_entry to the entry before
   // the _first_append_entry.  This would include:
-  //   [-Xpatch:<dirs>];  [exploded build | modules]
+  //   [-Xpatch:<module>=<file>(<pathsep><file>)*];  [exploded build | jimage]
   //
   // DumpSharedSpaces and search_append_only are mutually exclusive and cannot
   // be true at the same time.
-  ClassPathEntry* e = (search_append_only ? _first_append_entry : _first_entry);
-  ClassPathEntry* last_e =
-      (search_append_only || DumpSharedSpaces ? NULL : _first_append_entry);
+  assert(!(DumpSharedSpaces && search_append_only), "DumpSharedSpaces and search_append_only are both true");
 
-  {
+  // Load Attempt #1: -Xpatch
+  // Determine the class' defining module.  If it appears in the _xpatch_entries,
+  // attempt to load the class from those locations specific to the module.
+  // Note: The -Xpatch entries are never searched if the boot loader's
+  //       visibility boundary is limited to only searching the append entries.
+  if (_xpatch_entries != NULL && !search_append_only && !DumpSharedSpaces) {
+    // Find the module in the boot loader's module entry table
+    PackageEntry* pkg_entry = get_package_entry(class_name, ClassLoaderData::the_null_class_loader_data(), THREAD);
+    ModuleEntry* mod_entry = (pkg_entry != NULL) ? pkg_entry->module() : NULL;
+
+    // If the module system has not defined java.base yet, then
+    // classes loaded are assumed to be defined to java.base.
+    // When java.base is eventually defined by the module system,
+    // all packages of classes that have been previously loaded
+    // are verified in ModuleEntryTable::verify_javabase_packages().
+    if (!Universe::is_module_initialized() &&
+        !ModuleEntryTable::javabase_defined() &&
+        mod_entry == NULL) {
+      mod_entry = ModuleEntryTable::javabase_module();
+    }
+
+    // The module must be a named module
+    if (mod_entry != NULL && mod_entry->is_named()) {
+      int num_of_entries = _xpatch_entries->length();
+      const Symbol* class_module_name = mod_entry->name();
+
+      // Loop through all the xpatch entries looking for module
+      for (int i = 0; i < num_of_entries; i++) {
+        ModuleClassPathList* module_cpl = _xpatch_entries->at(i);
+        Symbol* module_cpl_name = module_cpl->module_name();
+
+        if (module_cpl_name->fast_compare(class_module_name) == 0) {
+          // Class' module has been located, attempt to load
+          // the class from the module's ClassPathEntry list.
+          e = module_cpl->module_first_entry();
+          while (e != NULL) {
+            stream = e->open_stream(file_name, CHECK_NULL);
+            // No context.check is required since both CDS
+            // and AppCDS are turned off if -Xpatch is specified.
+            if (NULL != stream) {
+              break;
+            }
+            e = e->next();
+          }
+          // If the module was located in the xpatch entries, break out
+          // even if the class was not located successfully from that module's
+          // ClassPathEntry list. There will not be another valid entry for
+          // that module in the _xpatch_entries array.
+          break;
+        }
+      }
+    }
+  }
+
+  // Load Attempt #2: [exploded build | jimage]
+  if (!search_append_only && (NULL == stream)) {
+    e = _first_entry;
+    while ((e != NULL) && (e != _first_append_entry)) {
+      stream = e->open_stream(file_name, CHECK_NULL);
+      if (!context.check(stream, classpath_index)) {
+        return NULL;
+      }
+      if (NULL != stream) {
+        break;
+      }
+      e = e->next();
+      ++classpath_index;
+    }
+  }
+
+  // Load Attempt #3: [-Xbootclasspath/a]; [jvmti appended entries]
+  if ((search_append_only || DumpSharedSpaces) && (NULL == stream)) {
+    // For the boot loader append path search, must calculate
+    // the starting classpath_index prior to attempting to
+    // load the classfile.
     if (search_append_only) {
-      // For the boot loader append path search, must calculate
-      // the starting classpath_index prior to attempting to
-      // load the classfile.
       ClassPathEntry *tmp_e = _first_entry;
       while ((tmp_e != NULL) && (tmp_e != _first_append_entry)) {
         tmp_e = tmp_e->next();
@@ -1209,11 +1384,8 @@
       }
     }
 
-    // Attempt to load the classfile from either:
-    //   - [-Xpatch:dir]; exploded build | modules
-    //     or
-    //   - [-Xbootclasspath/a]; [jvmti appended entries]
-    while ((e != NULL) && (e != last_e)) {
+    e = _first_append_entry;
+    while (e != NULL) {
       stream = e->open_stream(file_name, CHECK_NULL);
       if (!context.check(stream, classpath_index)) {
         return NULL;
@@ -1383,10 +1555,23 @@
 }
 
 
-void classLoader_init() {
+void classLoader_init1() {
   ClassLoader::initialize();
 }
 
+// Complete the ClassPathEntry setup for the boot loader
+void classLoader_init2() {
+  // Setup the list of module/path pairs for -Xpatch processing
+  // This must be done after the SymbolTable is created in order
+  // to use fast_compare on module names instead of a string compare.
+  if (Arguments::get_xpatchprefix() != NULL) {
+    ClassLoader::setup_xpatch_entries();
+  }
+
+  // Determine if this is an exploded build
+  ClassLoader::set_has_jimage();
+}
+
 
 bool ClassLoader::get_canonical_path(const char* orig, char* out, int len) {
   assert(orig != NULL && out != NULL && len > 0, "bad arguments");
@@ -1430,17 +1615,19 @@
     }
     ModuleEntryTable::set_javabase_module(jb_module);
   }
+}
 
-  // When looking for the jimage file, only
-  // search the boot loader's module path which
-  // can consist of [-Xpatch]; exploded build | modules
-  // Do not search the boot loader's append path.
+void ClassLoader::set_has_jimage() {
+  // Determine if this is an exploded build. When looking for
+  // the jimage file, only search the piece of the boot
+  // loader's boot class path which contains [exploded build | jimage].
+  // Do not search the boot loader's xpatch entries or append path.
   ClassPathEntry* e = _first_entry;
   ClassPathEntry* last_e = _first_append_entry;
   while ((e != NULL) && (e != last_e)) {
     JImageFile *jimage = e->jimage();
     if (jimage != NULL && e->is_jrt()) {
-      set_has_jimage(true);
+      _has_jimage = true;
 #if INCLUDE_CDS
       ClassLoader::initialize_module_loader_map(jimage);
 #endif
--- a/src/share/vm/classfile/classLoader.hpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/classfile/classLoader.hpp	Wed May 11 00:38:58 2016 +0300
@@ -142,13 +142,30 @@
   JImageFile* jimage() const { return _jimage; }
   ClassPathImageEntry(JImageFile* jimage, const char* name);
   ~ClassPathImageEntry();
-  void name_to_package(const char* name, char* package, int length);
   ClassFileStream* open_stream(const char* name, TRAPS);
 
   // Debugging
   NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
 };
 
+// ModuleClassPathList contains a linked list of ClassPathEntry's
+// that have been specified for a specific module.  Currently,
+// the only way to specify a module/path pair is via the -Xpatch
+// command line option.
+class ModuleClassPathList : public CHeapObj<mtClass> {
+private:
+  Symbol* _module_name;
+  // First and last entries of class path entries for a specific module
+  ClassPathEntry* _module_first_entry;
+  ClassPathEntry* _module_last_entry;
+public:
+  Symbol* module_name() const { return _module_name; }
+  ClassPathEntry* module_first_entry() const { return _module_first_entry; }
+  ModuleClassPathList(Symbol* module_name);
+  ~ModuleClassPathList();
+  void add_to_list(ClassPathEntry* new_entry);
+};
+
 class SharedPathsMiscInfo;
 
 class ClassLoader: AllStatic {
@@ -195,21 +212,31 @@
   static PerfCounter* _isUnsyncloadClass;
   static PerfCounter* _load_instance_class_failCounter;
 
-  // First entry in linked list of ClassPathEntry instances.
-  // This consists of entries made up by:
-  //   - boot loader modules
-  //     [-Xpatch]; exploded build | modules;
-  //   - boot loader append path
-  //     [-Xbootclasspath/a]; [jvmti appended entries]
+  // The boot class path consists of 3 ordered pieces:
+  //  1. the module/path pairs specified to -Xpatch
+  //    -Xpatch:<module>=<file>(<pathsep><file>)*
+  //  2. the base piece
+  //    [exploded build | jimage]
+  //  3. boot loader append path
+  //    [-Xbootclasspath/a]; [jvmti appended entries]
+  //
+  // The boot loader must obey this order when attempting
+  // to load a class.
+
+  // Contains the module/path pairs specified to -Xpatch
+  static GrowableArray<ModuleClassPathList*>* _xpatch_entries;
+
+  // Contains the ClassPathEntry instances that include
+  // both the base piece and the boot loader append path.
   static ClassPathEntry* _first_entry;
   // Last entry in linked list of ClassPathEntry instances
   static ClassPathEntry* _last_entry;
   static int _num_entries;
 
-  // Pointer into the linked list of ClassPathEntry instances.
   // Marks the start of:
   //   - the boot loader's append path
   //     [-Xbootclasspath/a]; [jvmti appended entries]
+  // within the linked list of ClassPathEntry instances.
   static ClassPathEntry* _first_append_entry;
 
   static const char* _shared_archive;
@@ -325,11 +352,11 @@
     return _load_instance_class_failCounter;
   }
 
+  // Set up the module/path pairs as specified to -Xpatch
+  static void setup_xpatch_entries();
+
   // Sets _has_jimage to TRUE if "modules" jimage file exists
-  static void set_has_jimage(bool val) {
-    _has_jimage = val;
-  }
-
+  static void set_has_jimage();
   static bool has_jimage() { return _has_jimage; }
 
   // Create the ModuleEntry for java.base
@@ -416,6 +443,9 @@
 
   static bool string_ends_with(const char* str, const char* str_to_find);
 
+  // obtain package name from a fully qualified class name
+  static const char* package_from_name(const char* class_name);
+
   static bool is_jrt(const char* name) { return string_ends_with(name, MODULES_IMAGE_NAME); }
 
   // Debugging
--- a/src/share/vm/classfile/dictionary.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/classfile/dictionary.cpp	Wed May 11 00:38:58 2016 +0300
@@ -31,7 +31,6 @@
 #include "memory/iterator.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "runtime/orderAccess.inline.hpp"
 #include "utilities/hashtable.inline.hpp"
 
--- a/src/share/vm/classfile/javaClasses.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/classfile/javaClasses.cpp	Wed May 11 00:38:58 2016 +0300
@@ -45,7 +45,6 @@
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
 #include "oops/typeArrayOop.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "runtime/fieldDescriptor.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/interfaceSupport.hpp"
--- a/src/share/vm/classfile/modules.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/classfile/modules.cpp	Wed May 11 00:38:58 2016 +0300
@@ -133,68 +133,31 @@
   return NULL;
 }
 
-// Check if -Xpatch:<dirs> was specified.  If so, prepend each <dir>/module_name,
-// if it exists, to bootpath so boot loader can find the class files.  Also, if
-// using exploded modules, append <java.home>/modules/module_name, if it exists,
-// to bootpath so that its class files can be found by the boot loader.
-static void add_to_boot_loader_list(char *module_name, TRAPS) {
-  // java.base should be handled by argument parsing.
+// If using exploded build, append <java.home>/modules/module_name, if it exists,
+// to the system boot class path in order for the boot loader to locate class files.
+static void add_to_exploded_build_list(char *module_name, TRAPS) {
+  assert(!ClassLoader::has_jimage(), "Exploded build not applicable");
+  // java.base is handled by os::set_boot_path
   assert(strcmp(module_name, "java.base") != 0, "Unexpected java.base module name");
+
   char file_sep = os::file_separator()[0];
   size_t module_len = strlen(module_name);
 
-  // If -Xpatch is set then add <patch-dir>/module_name paths.
-  char** patch_dirs = Arguments::patch_dirs();
-  if (patch_dirs != NULL) {
-    int dir_count = Arguments::patch_dirs_count();
-    for (int x = 0; x < dir_count; x++) {
-      // Really shouldn't be NULL, but check can't hurt
-      if (patch_dirs[x] != NULL) {
-        size_t len = strlen(patch_dirs[x]);
-        if (len != 0) { // Ignore empty strings.
-          len = len + module_len + 2;
-          char* prefix_path = NEW_C_HEAP_ARRAY(char, len, mtInternal);
-          jio_snprintf(prefix_path, len, "%s%c%s", patch_dirs[x], file_sep, module_name);
-
-          // See if Xpatch module path exists.
-          struct stat st;
-          if ((os::stat(prefix_path, &st) != 0)) {
-            FREE_C_HEAP_ARRAY(char, prefix_path);
-          } else {
-            {
-              HandleMark hm;
-              Handle loader_lock = Handle(THREAD, SystemDictionary::system_loader_lock());
-              ObjectLocker ol(loader_lock, THREAD);
-              ClassLoader::prepend_to_list(prefix_path);
-            }
-            log_info(class, load)("opened: -Xpatch %s", prefix_path);
-          }
-        }
-      }
-    }
-  }
-
-  // If "modules" jimage does not exist then assume exploded form
-  // ${java.home}/modules/<module-name>
-  char* path = NULL;
-  if (!ClassLoader::has_jimage()) {
-    const char* home = Arguments::get_java_home();
-    size_t len = strlen(home) + module_len + 32;
-    path = NEW_C_HEAP_ARRAY(char, len, mtInternal);
-    jio_snprintf(path, len, "%s%cmodules%c%s", home, file_sep, file_sep, module_name);
-    struct stat st;
-    // See if exploded module path exists.
-    if ((os::stat(path, &st) != 0)) {
-      FREE_C_HEAP_ARRAY(char, path);
-      path = NULL;
-    }
+  const char* home = Arguments::get_java_home();
+  size_t len = strlen(home) + module_len + 32;
+  char* path = NEW_C_HEAP_ARRAY(char, len, mtInternal);
+  jio_snprintf(path, len, "%s%cmodules%c%s", home, file_sep, file_sep, module_name);
+  struct stat st;
+  // See if exploded module path exists
+  if ((os::stat(path, &st) != 0)) {
+    FREE_C_HEAP_ARRAY(char, path);
+    path = NULL;
   }
 
   if (path != NULL) {
     HandleMark hm;
     Handle loader_lock = Handle(THREAD, SystemDictionary::system_loader_lock());
     ObjectLocker ol(loader_lock, THREAD);
-
     log_info(class, load)("opened: %s", path);
     ClassLoader::add_to_list(path);
   }
@@ -498,13 +461,12 @@
     }
   }
 
-  if (loader == NULL && !Universe::is_module_initialized()) {
-    // Now that the module is defined, if it is in the bootloader, make sure that
-    // its classes can be found.  Check if -Xpatch:<path> was specified.  If
-    // so prepend <path>/module_name, if it exists, to bootpath.  Also, if using
-    // exploded modules, prepend <java.home>/modules/module_name, if it exists,
-    // to bootpath.
-    add_to_boot_loader_list(module_name, CHECK);
+  // If the module is defined to the boot loader and an exploded build is being
+  // used, prepend <java.home>/modules/modules_name, if it exists, to the system boot class path.
+  if (loader == NULL &&
+      !Universe::is_module_initialized() &&
+      !ClassLoader::has_jimage()) {
+    add_to_exploded_build_list(module_name, CHECK);
   }
 }
 
--- a/src/share/vm/classfile/vmSymbols.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/classfile/vmSymbols.cpp	Wed May 11 00:38:58 2016 +0300
@@ -580,20 +580,6 @@
   case vmIntrinsics::_putLongOpaque:
   case vmIntrinsics::_putFloatOpaque:
   case vmIntrinsics::_putDoubleOpaque:
-  case vmIntrinsics::_getByte_raw:
-  case vmIntrinsics::_getShort_raw:
-  case vmIntrinsics::_getChar_raw:
-  case vmIntrinsics::_getInt_raw:
-  case vmIntrinsics::_getLong_raw:
-  case vmIntrinsics::_getFloat_raw:
-  case vmIntrinsics::_getDouble_raw:
-  case vmIntrinsics::_putByte_raw:
-  case vmIntrinsics::_putShort_raw:
-  case vmIntrinsics::_putChar_raw:
-  case vmIntrinsics::_putInt_raw:
-  case vmIntrinsics::_putLong_raw:
-  case vmIntrinsics::_putFloat_raw:
-  case vmIntrinsics::_putDouble_raw:
   case vmIntrinsics::_getAndAddInt:
   case vmIntrinsics::_getAndAddLong:
   case vmIntrinsics::_getAndSetInt:
@@ -634,8 +620,6 @@
   case vmIntrinsics::_putIntUnaligned:
   case vmIntrinsics::_putLongUnaligned:
   case vmIntrinsics::_allocateInstance:
-  case vmIntrinsics::_getAddress_raw:
-  case vmIntrinsics::_putAddress_raw:
     if (!InlineUnsafeOps || !UseUnalignedAccesses) return true;
     break;
   case vmIntrinsics::_hashCode:
--- a/src/share/vm/classfile/vmSymbols.hpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/classfile/vmSymbols.hpp	Wed May 11 00:38:58 2016 +0300
@@ -1232,43 +1232,6 @@
   do_intrinsic(_putIntUnaligned,           jdk_internal_misc_Unsafe,    putIntUnaligned_name, putInt_signature,         F_R)  \
   do_intrinsic(_putLongUnaligned,          jdk_internal_misc_Unsafe,    putLongUnaligned_name, putLong_signature,       F_R)  \
                                                                                                                         \
-  /* %%% these are redundant except perhaps for getAddress, but Unsafe has native methods for them */                   \
-  do_signature(getByte_raw_signature,     "(J)B")                                                                       \
-  do_signature(putByte_raw_signature,     "(JB)V")                                                                      \
-  do_signature(getShort_raw_signature,    "(J)S")                                                                       \
-  do_signature(putShort_raw_signature,    "(JS)V")                                                                      \
-  do_signature(getChar_raw_signature,     "(J)C")                                                                       \
-  do_signature(putChar_raw_signature,     "(JC)V")                                                                      \
-  do_signature(putInt_raw_signature,      "(JI)V")                                                                      \
-      do_alias(getLong_raw_signature,    /*(J)J*/ long_long_signature)                                                  \
-      do_alias(putLong_raw_signature,    /*(JJ)V*/ long_long_void_signature)                                            \
-  do_signature(getFloat_raw_signature,    "(J)F")                                                                       \
-  do_signature(putFloat_raw_signature,    "(JF)V")                                                                      \
-      do_alias(getDouble_raw_signature,  /*(J)D*/ long_double_signature)                                                \
-  do_signature(putDouble_raw_signature,   "(JD)V")                                                                      \
-      do_alias(getAddress_raw_signature, /*(J)J*/ long_long_signature)                                                  \
-      do_alias(putAddress_raw_signature, /*(JJ)V*/ long_long_void_signature)                                            \
-                                                                                                                        \
-   do_name(    getAddress_name,           "getAddress")                                                                 \
-   do_name(    putAddress_name,           "putAddress")                                                                 \
-                                                                                                                        \
-  do_intrinsic(_getByte_raw,              jdk_internal_misc_Unsafe,     getByte_name, getByte_raw_signature,           F_R)  \
-  do_intrinsic(_getShort_raw,             jdk_internal_misc_Unsafe,     getShort_name, getShort_raw_signature,         F_R)  \
-  do_intrinsic(_getChar_raw,              jdk_internal_misc_Unsafe,     getChar_name, getChar_raw_signature,           F_R)  \
-  do_intrinsic(_getInt_raw,               jdk_internal_misc_Unsafe,     getInt_name, long_int_signature,               F_R)  \
-  do_intrinsic(_getLong_raw,              jdk_internal_misc_Unsafe,     getLong_name, getLong_raw_signature,           F_R)  \
-  do_intrinsic(_getFloat_raw,             jdk_internal_misc_Unsafe,     getFloat_name, getFloat_raw_signature,         F_R)  \
-  do_intrinsic(_getDouble_raw,            jdk_internal_misc_Unsafe,     getDouble_name, getDouble_raw_signature,       F_R)  \
-  do_intrinsic(_getAddress_raw,           jdk_internal_misc_Unsafe,     getAddress_name, getAddress_raw_signature,     F_R)  \
-  do_intrinsic(_putByte_raw,              jdk_internal_misc_Unsafe,     putByte_name, putByte_raw_signature,           F_R)  \
-  do_intrinsic(_putShort_raw,             jdk_internal_misc_Unsafe,     putShort_name, putShort_raw_signature,         F_R)  \
-  do_intrinsic(_putChar_raw,              jdk_internal_misc_Unsafe,     putChar_name, putChar_raw_signature,           F_R)  \
-  do_intrinsic(_putInt_raw,               jdk_internal_misc_Unsafe,     putInt_name, putInt_raw_signature,             F_R)  \
-  do_intrinsic(_putLong_raw,              jdk_internal_misc_Unsafe,     putLong_name, putLong_raw_signature,           F_R)  \
-  do_intrinsic(_putFloat_raw,             jdk_internal_misc_Unsafe,     putFloat_name, putFloat_raw_signature,         F_R)  \
-  do_intrinsic(_putDouble_raw,            jdk_internal_misc_Unsafe,     putDouble_name, putDouble_raw_signature,       F_R)  \
-  do_intrinsic(_putAddress_raw,           jdk_internal_misc_Unsafe,     putAddress_name, putAddress_raw_signature,     F_R)  \
-                                                                                                                        \
   do_signature(compareAndSwapObject_signature,     "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z")        \
   do_signature(compareAndExchangeObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") \
   do_signature(compareAndSwapLong_signature,       "(Ljava/lang/Object;JJJ)Z")                                          \
--- a/src/share/vm/code/nmethod.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/code/nmethod.cpp	Wed May 11 00:38:58 2016 +0300
@@ -36,10 +36,10 @@
 #include "compiler/directivesParser.hpp"
 #include "compiler/disassembler.hpp"
 #include "interpreter/bytecode.hpp"
+#include "logging/log.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/methodData.hpp"
 #include "oops/oop.inline.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "prims/jvmtiImpl.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/orderAccess.inline.hpp"
@@ -2001,15 +2001,18 @@
       Method* method = deps.method_argument(0);
       for (int j = 0; j < dependee_methods->length(); j++) {
         if (dependee_methods->at(j) == method) {
-          // RC_TRACE macro has an embedded ResourceMark
-          RC_TRACE(0x01000000,
-            ("Found evol dependency of nmethod %s.%s(%s) compile_id=%d on method %s.%s(%s)",
-            _method->method_holder()->external_name(),
-            _method->name()->as_C_string(),
-            _method->signature()->as_C_string(), compile_id(),
-            method->method_holder()->external_name(),
-            method->name()->as_C_string(),
-            method->signature()->as_C_string()));
+          if (log_is_enabled(Debug, redefine, class, nmethod)) {
+            ResourceMark rm;
+            log_debug(redefine, class, nmethod)
+              ("Found evol dependency of nmethod %s.%s(%s) compile_id=%d on method %s.%s(%s)",
+               _method->method_holder()->external_name(),
+               _method->name()->as_C_string(),
+               _method->signature()->as_C_string(),
+               compile_id(),
+               method->method_holder()->external_name(),
+               method->name()->as_C_string(),
+               method->signature()->as_C_string());
+          }
           if (TraceDependencies || LogCompilation)
             deps.log_dependency(dependee);
           return true;
--- a/src/share/vm/gc/g1/g1Analytics.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/gc/g1/g1Analytics.cpp	Wed May 11 00:38:58 2016 +0300
@@ -284,6 +284,10 @@
   }
 }
 
+double G1Analytics::predict_cost_per_byte_ms() const {
+  return get_new_prediction(_cost_per_byte_ms_seq);
+}
+
 double G1Analytics::predict_constant_other_time_ms() const {
   return get_new_prediction(_constant_other_time_ms_seq);
 }
@@ -326,4 +330,3 @@
 void G1Analytics::report_concurrent_mark_cleanup_times_ms(double ms) {
   _concurrent_mark_cleanup_times_ms->add(ms);
 }
-
--- a/src/share/vm/gc/g1/g1Analytics.hpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/gc/g1/g1Analytics.hpp	Wed May 11 00:38:58 2016 +0300
@@ -149,6 +149,8 @@
   size_t predict_rs_lengths() const;
   size_t predict_pending_cards() const;
 
+  double predict_cost_per_byte_ms() const;
+
   // Add a new GC of the given duration and end time to the record.
   void update_recent_gc_times(double end_time_sec, double elapsed_ms);
   void compute_pause_time_ratio(double interval_ms, double pause_time_ms);
--- a/src/share/vm/gc/parallel/gcTaskManager.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/gc/parallel/gcTaskManager.cpp	Wed May 11 00:38:58 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
 #include "precompiled.hpp"
 #include "gc/parallel/gcTaskManager.hpp"
 #include "gc/parallel/gcTaskThread.hpp"
-#include "gc/shared/adaptiveSizePolicy.hpp"
 #include "gc/shared/gcId.hpp"
+#include "gc/shared/workerManager.hpp"
 #include "logging/log.hpp"
 #include "memory/allocation.hpp"
 #include "memory/allocation.inline.hpp"
@@ -34,6 +34,7 @@
 #include "runtime/mutex.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/orderAccess.inline.hpp"
+#include "runtime/os.hpp"
 
 //
 // GCTask
@@ -372,10 +373,28 @@
 GCTaskManager::GCTaskManager(uint workers) :
   _workers(workers),
   _active_workers(0),
-  _idle_workers(0) {
+  _idle_workers(0),
+  _created_workers(0) {
   initialize();
 }
 
+GCTaskThread* GCTaskManager::install_worker(uint t) {
+  GCTaskThread* new_worker = GCTaskThread::create(this, t, _processor_assignment[t]);
+  set_thread(t, new_worker);
+  return new_worker;
+}
+
+void GCTaskManager::add_workers(bool initializing) {
+  os::ThreadType worker_type = os::pgc_thread;
+  _created_workers = WorkerManager::add_workers(this,
+                                                _active_workers,
+                                                (uint) _workers,
+                                                _created_workers,
+                                                worker_type,
+                                                initializing);
+  _active_workers = MIN2(_created_workers, _active_workers);
+}
+
 void GCTaskManager::initialize() {
   if (TraceGCTaskManager) {
     tty->print_cr("GCTaskManager::initialize: workers: %u", workers());
@@ -394,28 +413,30 @@
     // Set up worker threads.
     //     Distribute the workers among the available processors,
     //     unless we were told not to, or if the os doesn't want to.
-    uint* processor_assignment = NEW_C_HEAP_ARRAY(uint, workers(), mtGC);
+    _processor_assignment = NEW_C_HEAP_ARRAY(uint, workers(), mtGC);
     if (!BindGCTaskThreadsToCPUs ||
-        !os::distribute_processes(workers(), processor_assignment)) {
+        !os::distribute_processes(workers(), _processor_assignment)) {
       for (uint a = 0; a < workers(); a += 1) {
-        processor_assignment[a] = sentinel_worker();
+        _processor_assignment[a] = sentinel_worker();
       }
     }
+
     _thread = NEW_C_HEAP_ARRAY(GCTaskThread*, workers(), mtGC);
-    for (uint t = 0; t < workers(); t += 1) {
-      set_thread(t, GCTaskThread::create(this, t, processor_assignment[t]));
+    _active_workers = ParallelGCThreads;
+    if (UseDynamicNumberOfGCThreads && !FLAG_IS_CMDLINE(ParallelGCThreads)) {
+      _active_workers = 1U;
     }
+
     Log(gc, task, thread) log;
     if (log.is_trace()) {
       ResourceMark rm;
       outputStream* out = log.trace_stream();
       out->print("GCTaskManager::initialize: distribution:");
       for (uint t = 0; t < workers(); t += 1) {
-        out->print("  %u", processor_assignment[t]);
+        out->print("  %u", _processor_assignment[t]);
       }
       out->cr();
     }
-    FREE_C_HEAP_ARRAY(uint, processor_assignment);
   }
   reset_busy_workers();
   set_unblocked();
@@ -426,9 +447,8 @@
   reset_completed_tasks();
   reset_barriers();
   reset_emptied_queue();
-  for (uint s = 0; s < workers(); s += 1) {
-    thread(s)->start();
-  }
+
+  add_workers(true);
 }
 
 GCTaskManager::~GCTaskManager() {
@@ -437,13 +457,17 @@
   NoopGCTask::destroy(_noop_task);
   _noop_task = NULL;
   if (_thread != NULL) {
-    for (uint i = 0; i < workers(); i += 1) {
+    for (uint i = 0; i < created_workers(); i += 1) {
       GCTaskThread::destroy(thread(i));
       set_thread(i, NULL);
     }
     FREE_C_HEAP_ARRAY(GCTaskThread*, _thread);
     _thread = NULL;
   }
+  if (_processor_assignment != NULL) {
+    FREE_C_HEAP_ARRAY(uint, _processor_assignment);
+    _processor_assignment = NULL;
+  }
   if (_resource_flag != NULL) {
     FREE_C_HEAP_ARRAY(bool, _resource_flag);
     _resource_flag = NULL;
@@ -470,6 +494,9 @@
          "all_workers_active() is  incorrect: "
          "active %d  ParallelGCThreads %u", active_workers(),
          ParallelGCThreads);
+  _active_workers = MIN2(_active_workers, _workers);
+  // "add_workers" does not guarantee any additional workers
+  add_workers(false);
   log_trace(gc, task)("GCTaskManager::set_active_gang(): "
                       "all_workers_active()  %d  workers %d  "
                       "active  %d  ParallelGCThreads %u",
@@ -499,7 +526,7 @@
       // is starting).  Try later to release enough idle_workers
       // to allow the desired number of active_workers.
       more_inactive_workers =
-        workers() - active_workers() - idle_workers();
+        created_workers() - active_workers() - idle_workers();
       if (more_inactive_workers < 0) {
         int reduced_active_workers = active_workers() + more_inactive_workers;
         set_active_workers(reduced_active_workers);
@@ -507,7 +534,7 @@
       }
       log_trace(gc, task)("JT: %d  workers %d  active  %d  idle %d  more %d",
                           Threads::number_of_non_daemon_threads(),
-                          workers(),
+                          created_workers(),
                           active_workers(),
                           idle_workers(),
                           more_inactive_workers);
@@ -517,7 +544,7 @@
       q->enqueue(IdleGCTask::create_on_c_heap());
       increment_idle_workers();
     }
-    assert(workers() == active_workers() + idle_workers(),
+    assert(created_workers() == active_workers() + idle_workers(),
       "total workers should equal active + inactive");
     add_list(q);
     // GCTaskQueue* q was created in a ResourceArea so a
@@ -539,14 +566,15 @@
   if (!log_is_enabled(Debug, gc, task, time)) {
     return;
   }
-  for(uint i=0; i<ParallelGCThreads; i++) {
+  uint num_thr = created_workers();
+  for(uint i=0; i < num_thr; i++) {
     GCTaskThread* t = thread(i);
     t->print_task_time_stamps();
   }
 }
 
 void GCTaskManager::print_threads_on(outputStream* st) {
-  uint num_thr = workers();
+  uint num_thr = created_workers();
   for (uint i = 0; i < num_thr; i++) {
     thread(i)->print_on(st);
     st->cr();
@@ -555,19 +583,20 @@
 
 void GCTaskManager::threads_do(ThreadClosure* tc) {
   assert(tc != NULL, "Null ThreadClosure");
-  uint num_thr = workers();
+  uint num_thr = created_workers();
   for (uint i = 0; i < num_thr; i++) {
     tc->do_thread(thread(i));
   }
 }
 
 GCTaskThread* GCTaskManager::thread(uint which) {
-  assert(which < workers(), "index out of bounds");
+  assert(which < created_workers(), "index out of bounds");
   assert(_thread[which] != NULL, "shouldn't have null thread");
   return _thread[which];
 }
 
 void GCTaskManager::set_thread(uint which, GCTaskThread* value) {
+  // "_created_workers" may not have been updated yet so use workers()
   assert(which < workers(), "index out of bounds");
   assert(value != NULL, "shouldn't have null thread");
   _thread[which] = value;
@@ -728,7 +757,7 @@
 
 void GCTaskManager::release_all_resources() {
   // If you want this to be done atomically, do it in a WaitForBarrierGCTask.
-  for (uint i = 0; i < workers(); i += 1) {
+  for (uint i = 0; i < created_workers(); i += 1) {
     set_resource_flag(i, true);
   }
 }
--- a/src/share/vm/gc/parallel/gcTaskManager.hpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/gc/parallel/gcTaskManager.hpp	Wed May 11 00:38:58 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, 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
@@ -370,6 +370,7 @@
   Monitor*                  _monitor;           // Notification of changes.
   SynchronizedGCTaskQueue*  _queue;             // Queue of tasks.
   GCTaskThread**            _thread;            // Array of worker threads.
+  uint                      _created_workers;   // Number of workers created.
   uint                      _active_workers;    // Number of active workers.
   uint                      _busy_workers;      // Number of busy workers.
   uint                      _blocking_worker;   // The worker that's blocking.
@@ -381,6 +382,8 @@
   NoopGCTask*               _noop_task;         // The NoopGCTask instance.
   WaitHelper                _wait_helper;       // Used by inactive worker
   volatile uint             _idle_workers;      // Number of idled workers
+  uint*                     _processor_assignment; // Worker to cpu mappings. May
+                                                   // be used lazily
 public:
   // Factory create and destroy methods.
   static GCTaskManager* create(uint workers) {
@@ -546,6 +549,13 @@
   uint active_workers() const {
     return _active_workers;
   }
+  uint created_workers() const {
+    return _created_workers;
+  }
+  // Create a GC worker and install into GCTaskManager
+  GCTaskThread* install_worker(uint worker_id);
+  // Add GC workers as needed.
+  void add_workers(bool initializing);
 };
 
 //
--- a/src/share/vm/gc/parallel/gcTaskThread.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/gc/parallel/gcTaskThread.cpp	Wed May 11 00:38:58 2016 +0300
@@ -44,9 +44,6 @@
   _time_stamps(NULL),
   _time_stamp_index(0)
 {
-  if (!os::create_thread(this, os::pgc_thread))
-    vm_exit_out_of_memory(0, OOM_MALLOC_ERROR, "Cannot create GC thread. Out of system resources.");
-
   set_id(which);
   set_name("ParGC Thread#%d", which);
 }
@@ -57,10 +54,6 @@
   }
 }
 
-void GCTaskThread::start() {
-  os::start_thread(this);
-}
-
 GCTaskTimeStamp* GCTaskThread::time_stamp_at(uint index) {
   guarantee(index < GCTaskTimeStampEntries, "increase GCTaskTimeStampEntries");
   if (_time_stamps == NULL) {
--- a/src/share/vm/gc/parallel/gcTaskThread.hpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/gc/parallel/gcTaskThread.hpp	Wed May 11 00:38:58 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,13 +48,13 @@
 
   bool _is_working;                     // True if participating in GC tasks
 
- public:
   // Factory create and destroy methods.
   static GCTaskThread* create(GCTaskManager* manager,
                               uint           which,
                               uint           processor_id) {
     return new GCTaskThread(manager, which, processor_id);
   }
+ public:
   static void destroy(GCTaskThread* manager) {
     if (manager != NULL) {
       delete manager;
@@ -65,8 +65,6 @@
     return true;
   }
   virtual void run();
-  // Methods.
-  void start();
 
   void print_task_time_stamps();
 
--- a/src/share/vm/gc/parallel/pcTasks.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/gc/parallel/pcTasks.cpp	Wed May 11 00:38:58 2016 +0300
@@ -220,13 +220,13 @@
 }
 
 //
-// StealRegionCompactionTask
+// CompactionWithStealingTask
 //
 
-StealRegionCompactionTask::StealRegionCompactionTask(ParallelTaskTerminator* t):
+CompactionWithStealingTask::CompactionWithStealingTask(ParallelTaskTerminator* t):
   _terminator(t) {}
 
-void StealRegionCompactionTask::do_it(GCTaskManager* manager, uint which) {
+void CompactionWithStealingTask::do_it(GCTaskManager* manager, uint which) {
   assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
 
   ParCompactionManager* cm =
--- a/src/share/vm/gc/parallel/pcTasks.hpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/gc/parallel/pcTasks.hpp	Wed May 11 00:38:58 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, 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
@@ -195,16 +195,16 @@
 };
 
 //
-// StealRegionCompactionTask
+// CompactionWithStealingTask
 //
 // This task is used to distribute work to idle threads.
 //
 
-class StealRegionCompactionTask : public GCTask {
+class CompactionWithStealingTask : public GCTask {
  private:
    ParallelTaskTerminator* const _terminator;
  public:
-  StealRegionCompactionTask(ParallelTaskTerminator* t);
+  CompactionWithStealingTask(ParallelTaskTerminator* t);
 
   char* name() { return (char *)"steal-region-task"; }
   ParallelTaskTerminator* terminator() { return _terminator; }
--- a/src/share/vm/gc/parallel/psCompactionManager.hpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/gc/parallel/psCompactionManager.hpp	Wed May 11 00:38:58 2016 +0300
@@ -40,7 +40,7 @@
   friend class ParallelTaskTerminator;
   friend class ParMarkBitMap;
   friend class PSParallelCompact;
-  friend class StealRegionCompactionTask;
+  friend class CompactionWithStealingTask;
   friend class UpdateAndFillClosure;
   friend class RefProcTaskExecutor;
   friend class IdleGCTask;
--- a/src/share/vm/gc/parallel/psParallelCompact.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/gc/parallel/psParallelCompact.cpp	Wed May 11 00:38:58 2016 +0300
@@ -2371,7 +2371,7 @@
   // Once a thread has drained it's stack, it should try to steal regions from
   // other threads.
   for (uint j = 0; j < parallel_gc_threads; j++) {
-    q->enqueue(new StealRegionCompactionTask(terminator_ptr));
+    q->enqueue(new CompactionWithStealingTask(terminator_ptr));
   }
 }
 
--- a/src/share/vm/gc/shared/adaptiveSizePolicy.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/gc/shared/adaptiveSizePolicy.cpp	Wed May 11 00:38:58 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, 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
@@ -130,10 +130,7 @@
   uintx max_active_workers =
     MAX2(active_workers_by_JT, active_workers_by_heap_size);
 
-  // Limit the number of workers to the the number created,
-  // (workers()).
-  new_active_workers = MIN2(max_active_workers,
-                                (uintx) total_workers);
+  new_active_workers = MIN2(max_active_workers, (uintx) total_workers);
 
   // Increase GC workers instantly but decrease them more
   // slowly.
@@ -167,7 +164,7 @@
       "Jiggled active workers too much");
   }
 
-   log_trace(gc, task)("GCTaskManager::calc_default_active_workers() : "
+  log_trace(gc, task)("GCTaskManager::calc_default_active_workers() : "
      "active_workers(): " UINTX_FORMAT "  new_active_workers: " UINTX_FORMAT "  "
      "prev_active_workers: " UINTX_FORMAT "\n"
      " active_workers_by_JT: " UINTX_FORMAT "  active_workers_by_heap_size: " UINTX_FORMAT,
--- a/src/share/vm/gc/shared/adaptiveSizePolicy.hpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/gc/shared/adaptiveSizePolicy.hpp	Wed May 11 00:38:58 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2016, 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/gc/shared/workerManager.hpp	Wed May 11 00:38:58 2016 +0300
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2016 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_WORKERMANAGER_HPP
+#define SHARE_VM_GC_SHARED_WORKERMANAGER_HPP
+
+#include "gc/shared/adaptiveSizePolicy.hpp"
+
+class WorkerManager : public AllStatic {
+ public:
+  // Create additional workers as needed.
+  //   active_workers - number of workers being requested for an upcoming
+  // parallel task.
+  //   total_workers - total number of workers.  This is the maximum
+  // number possible.
+  //   created_workers - number of workers already created.  This maybe
+  // less than, equal to, or greater than active workers.  If greater than
+  // or equal to active_workers, nothing is done.
+  //   worker_type - type of thread.
+  //   initializing - true if this is called to get the initial number of
+  // GC workers.
+  // If initializing is true, do a vm exit if the workers cannot be created.
+  // The initializing = true case is for JVM start up and failing to
+  // create all the worker at start should considered a problem so exit.
+  // If initializing = false, there are already some number of worker
+  // threads and a failure would not be optimal but should not be fatal.
+  template <class WorkerType>
+  static uint add_workers (WorkerType* holder,
+                   uint active_workers,
+                   uint total_workers,
+                   uint created_workers,
+                   os::ThreadType worker_type,
+                   bool initializing) {
+    uint start = created_workers;
+    uint end = MIN2(active_workers, total_workers);
+    for (uint worker_id = start; worker_id < end; worker_id += 1) {
+      WorkerThread* new_worker = holder->install_worker(worker_id);
+      assert(new_worker != NULL, "Failed to allocate GangWorker");
+      if (new_worker == NULL || !os::create_thread(new_worker, worker_type)) {
+        if(initializing) {
+          vm_exit_out_of_memory(0, OOM_MALLOC_ERROR,
+                  "Cannot create worker GC thread. Out of system resources.");
+        }
+      }
+      created_workers++;
+      os::start_thread(new_worker);
+    }
+
+    log_trace(gc, task)("AdaptiveSizePolicy::add_workers() : "
+       "active_workers: %u created_workers: %u",
+       active_workers, created_workers);
+
+    return created_workers;
+  }
+};
+#endif // SHARE_VM_GC_SHARED_WORKERMANAGER_HPP
--- a/src/share/vm/gc/shared/workgroup.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/gc/shared/workgroup.cpp	Wed May 11 00:38:58 2016 +0300
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "gc/shared/gcId.hpp"
 #include "gc/shared/workgroup.hpp"
+#include "gc/shared/workerManager.hpp"
 #include "memory/allocation.hpp"
 #include "memory/allocation.inline.hpp"
 #include "runtime/atomic.inline.hpp"
@@ -35,37 +36,45 @@
 // Definitions of WorkGang methods.
 
 // The current implementation will exit if the allocation
-// of any worker fails.  Still, return a boolean so that
-// a future implementation can possibly do a partial
-// initialization of the workers and report such to the
-// caller.
-bool AbstractWorkGang::initialize_workers() {
+// of any worker fails.
+void  AbstractWorkGang::initialize_workers() {
   log_develop_trace(gc, workgang)("Constructing work gang %s with %u threads", name(), total_workers());
   _workers = NEW_C_HEAP_ARRAY(AbstractGangWorker*, total_workers(), mtInternal);
   if (_workers == NULL) {
     vm_exit_out_of_memory(0, OOM_MALLOC_ERROR, "Cannot create GangWorker array.");
-    return false;
   }
+
+  _active_workers = ParallelGCThreads;
+  if (UseDynamicNumberOfGCThreads && !FLAG_IS_CMDLINE(ParallelGCThreads)) {
+    _active_workers = 1U;
+  }
+
+  add_workers(true);
+}
+
+
+AbstractGangWorker* AbstractWorkGang::install_worker(uint worker_id) {
+  AbstractGangWorker* new_worker = allocate_worker(worker_id);
+  set_thread(worker_id, new_worker);
+  return new_worker;
+}
+
+void AbstractWorkGang::add_workers(bool initializing) {
+
   os::ThreadType worker_type;
   if (are_ConcurrentGC_threads()) {
     worker_type = os::cgc_thread;
   } else {
     worker_type = os::pgc_thread;
   }
-  for (uint worker = 0; worker < total_workers(); worker += 1) {
-    AbstractGangWorker* new_worker = allocate_worker(worker);
-    assert(new_worker != NULL, "Failed to allocate GangWorker");
-    _workers[worker] = new_worker;
-    if (new_worker == NULL || !os::create_thread(new_worker, worker_type)) {
-      vm_exit_out_of_memory(0, OOM_MALLOC_ERROR,
-              "Cannot create worker GC thread. Out of system resources.");
-      return false;
-    }
-    if (!DisableStartThread) {
-      os::start_thread(new_worker);
-    }
-  }
-  return true;
+
+  _created_workers = WorkerManager::add_workers(this,
+                                                _active_workers,
+                                                _total_workers,
+                                                _created_workers,
+                                                worker_type,
+                                                initializing);
+  _active_workers = MIN2(_created_workers, _active_workers);
 }
 
 AbstractGangWorker* AbstractWorkGang::worker(uint i) const {
@@ -79,7 +88,7 @@
 }
 
 void AbstractWorkGang::print_worker_threads_on(outputStream* st) const {
-  uint workers = total_workers();
+  uint workers = created_workers();
   for (uint i = 0; i < workers; i++) {
     worker(i)->print_on(st);
     st->cr();
@@ -88,7 +97,7 @@
 
 void AbstractWorkGang::threads_do(ThreadClosure* tc) const {
   assert(tc != NULL, "Null ThreadClosure");
-  uint workers = total_workers();
+  uint workers = created_workers();
   for (uint i = 0; i < workers; i++) {
     tc->do_thread(worker(i));
   }
--- a/src/share/vm/gc/shared/workgroup.hpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/gc/shared/workgroup.hpp	Wed May 11 00:38:58 2016 +0300
@@ -112,6 +112,8 @@
   uint _total_workers;
   // The currently active workers in this gang.
   uint _active_workers;
+  // The count of created workers in the gang.
+  uint _created_workers;
   // Printing support.
   const char* _name;
 
@@ -120,23 +122,32 @@
   const bool _are_GC_task_threads;
   const bool _are_ConcurrentGC_threads;
 
+  void set_thread(uint worker_id, AbstractGangWorker* worker) {
+    _workers[worker_id] = worker;
+  }
+
  public:
   AbstractWorkGang(const char* name, uint workers, bool are_GC_task_threads, bool are_ConcurrentGC_threads) :
       _name(name),
       _total_workers(workers),
       _active_workers(UseDynamicNumberOfGCThreads ? 1U : workers),
+      _created_workers(0),
       _are_GC_task_threads(are_GC_task_threads),
       _are_ConcurrentGC_threads(are_ConcurrentGC_threads)
   { }
 
   // Initialize workers in the gang.  Return true if initialization succeeded.
-  bool initialize_workers();
+  void initialize_workers();
 
   bool are_GC_task_threads()      const { return _are_GC_task_threads; }
   bool are_ConcurrentGC_threads() const { return _are_ConcurrentGC_threads; }
 
   uint total_workers() const { return _total_workers; }
 
+  uint created_workers() const {
+    return _created_workers;
+  }
+
   virtual uint active_workers() const {
     assert(_active_workers <= _total_workers,
            "_active_workers: %u > _total_workers: %u", _active_workers, _total_workers);
@@ -144,22 +155,29 @@
            "Unless dynamic should use total workers");
     return _active_workers;
   }
+
   void set_active_workers(uint v) {
     assert(v <= _total_workers,
            "Trying to set more workers active than there are");
     _active_workers = MIN2(v, _total_workers);
+    add_workers(false /* exit_on_failure */);
     assert(v != 0, "Trying to set active workers to 0");
-    _active_workers = MAX2(1U, _active_workers);
     assert(UseDynamicNumberOfGCThreads || _active_workers == _total_workers,
            "Unless dynamic should use total workers");
     log_info(gc, task)("GC Workers: using %d out of %d", _active_workers, _total_workers);
   }
 
+  // Add GC workers as needed.
+  void add_workers(bool initializing);
+
   // Return the Ith worker.
   AbstractGangWorker* worker(uint i) const;
 
   void threads_do(ThreadClosure* tc) const;
 
+  // Create a GC worker and install it into the work gang.
+  virtual AbstractGangWorker* install_worker(uint which);
+
   // Debugging.
   const char* name() const { return _name; }
 
--- a/src/share/vm/interpreter/oopMapCache.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/interpreter/oopMapCache.cpp	Wed May 11 00:38:58 2016 +0300
@@ -24,10 +24,10 @@
 
 #include "precompiled.hpp"
 #include "interpreter/oopMapCache.hpp"
+#include "logging/log.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/signature.hpp"
 
@@ -469,10 +469,12 @@
     if (!_array[i].is_empty() && _array[i].method()->is_old()) {
       // Cache entry is occupied by an old redefined method and we don't want
       // to pin it down so flush the entry.
-      RC_TRACE(0x08000000, ("flush: %s(%s): cached entry @%d",
-        _array[i].method()->name()->as_C_string(),
-        _array[i].method()->signature()->as_C_string(), i));
-
+      if (log_is_enabled(Debug, redefine, class, oopmap)) {
+        ResourceMark rm;
+        log_debug(redefine, class, oopmap)
+          ("flush: %s(%s): cached entry @%d",
+           _array[i].method()->name()->as_C_string(), _array[i].method()->signature()->as_C_string(), i);
+      }
       _array[i].flush();
     }
 }
--- a/src/share/vm/logging/logTag.hpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/logging/logTag.hpp	Wed May 11 00:38:58 2016 +0300
@@ -32,23 +32,28 @@
 // (The tags 'all', 'disable' and 'help' are special tags that can
 // not be used in log calls, and should not be listed below.)
 #define LOG_TAG_LIST \
+  LOG_TAG(add) \
+  LOG_TAG(age) \
   LOG_TAG(alloc) \
-  LOG_TAG(age) \
   LOG_TAG(arguments) \
+  LOG_TAG(annotation) \
   LOG_TAG(barrier) \
   LOG_TAG(biasedlocking) \
   LOG_TAG(bot) \
+  LOG_TAG(breakpoint) \
   LOG_TAG(census) \
   LOG_TAG(class) \
   LOG_TAG(classhisto) \
   LOG_TAG(cleanup) \
   LOG_TAG(compaction) \
   LOG_TAG(constraints) \
+  LOG_TAG(constantpool) \
   LOG_TAG(coops) \
   LOG_TAG(cpu) \
   LOG_TAG(cset) \
   LOG_TAG(data) \
   LOG_TAG(defaultmethods) \
+  LOG_TAG(dump) \
   LOG_TAG(ergo) \
   LOG_TAG(exceptions) \
   LOG_TAG(exit) \
@@ -57,6 +62,7 @@
   LOG_TAG(heap) \
   LOG_TAG(humongous) \
   LOG_TAG(ihop) \
+  LOG_TAG(iklass) \
   LOG_TAG(init) \
   LOG_TAG(itables) \
   LOG_TAG(jni) \
@@ -65,13 +71,20 @@
   LOG_TAG(load) /* Trace all classes loaded */ \
   LOG_TAG(loader) \
   LOG_TAG(logging) \
+  LOG_TAG(mark) \
   LOG_TAG(marking) \
+  LOG_TAG(methodcomparator) \
+  LOG_TAG(metadata) \
   LOG_TAG(metaspace) \
   LOG_TAG(mmu) \
   LOG_TAG(modules) \
   LOG_TAG(monitorinflation) \
   LOG_TAG(monitormismatch) \
+  LOG_TAG(nmethod) \
+  LOG_TAG(normalize) \
   LOG_TAG(objecttagging) \
+  LOG_TAG(obsolete) \
+  LOG_TAG(oopmap) \
   LOG_TAG(os) \
   LOG_TAG(pagesize) \
   LOG_TAG(path) \
@@ -81,9 +94,11 @@
   LOG_TAG(preorder) /* Trace all classes loaded in order referenced (not loaded) */ \
   LOG_TAG(protectiondomain) /* "Trace protection domain verification" */ \
   LOG_TAG(ref) \
+  LOG_TAG(redefine) \
   LOG_TAG(refine) \
   LOG_TAG(region) \
   LOG_TAG(remset) \
+  LOG_TAG(purge) \
   LOG_TAG(resolve) \
   LOG_TAG(safepoint) \
   LOG_TAG(scavenge) \
@@ -95,6 +110,8 @@
   LOG_TAG(stats) \
   LOG_TAG(stringdedup) \
   LOG_TAG(stringtable) \
+  LOG_TAG(stackmap) \
+  LOG_TAG(subclass) \
   LOG_TAG(survivor) \
   LOG_TAG(sweep) \
   LOG_TAG(task) \
@@ -102,6 +119,8 @@
   LOG_TAG(thread) \
   LOG_TAG(tlab) \
   LOG_TAG(time) \
+  LOG_TAG(timer) \
+  LOG_TAG(update) \
   LOG_TAG(unload) /* Trace unloading of classes */ \
   LOG_TAG(verification) \
   LOG_TAG(verify) \
--- a/src/share/vm/memory/allocation.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/memory/allocation.cpp	Wed May 11 00:38:58 2016 +0300
@@ -664,64 +664,6 @@
 // Non-product code
 
 #ifndef PRODUCT
-// The global operator new should never be called since it will usually indicate
-// a memory leak.  Use CHeapObj as the base class of such objects to make it explicit
-// that they're allocated on the C heap.
-// Commented out in product version to avoid conflicts with third-party C++ native code.
-//
-// In C++98/03 the throwing new operators are defined with the following signature:
-//
-// void* operator new(std::size_tsize) throw(std::bad_alloc);
-// void* operator new[](std::size_tsize) throw(std::bad_alloc);
-//
-// while all the other (non-throwing) new and delete operators are defined with an empty
-// throw clause (i.e. "operator delete(void* p) throw()") which means that they do not
-// throw any exceptions (see section 18.4 of the C++ standard).
-//
-// In the new C++11/14 standard, the signature of the throwing new operators was changed
-// by completely omitting the throw clause (which effectively means they could throw any
-// exception) while all the other new/delete operators where changed to have a 'nothrow'
-// clause instead of an empty throw clause.
-//
-// Unfortunately, the support for exception specifications among C++ compilers is still
-// very fragile. While some more strict compilers like AIX xlC or HP aCC reject to
-// override the default throwing new operator with a user operator with an empty throw()
-// clause, the MS Visual C++ compiler warns for every non-empty throw clause like
-// throw(std::bad_alloc) that it will ignore the exception specification. The following
-// operator definitions have been checked to correctly work with all currently supported
-// compilers and they should be upwards compatible with C++11/14. Therefore
-// PLEASE BE CAREFUL if you change the signature of the following operators!
-
-static void * zero = (void *) 0;
-
-void* operator new(size_t size) /* throw(std::bad_alloc) */ {
-  fatal("Should not call global operator new");
-  return zero;
-}
-
-void* operator new [](size_t size) /* throw(std::bad_alloc) */ {
-  fatal("Should not call global operator new[]");
-  return zero;
-}
-
-void* operator new(size_t size, const std::nothrow_t&  nothrow_constant) throw() {
-  fatal("Should not call global operator new");
-  return 0;
-}
-
-void* operator new [](size_t size, std::nothrow_t&  nothrow_constant) throw() {
-  fatal("Should not call global operator new[]");
-  return 0;
-}
-
-void operator delete(void* p) throw() {
-  fatal("Should not call global delete");
-}
-
-void operator delete [](void* p) throw() {
-  fatal("Should not call global delete []");
-}
-
 void AllocatedObj::print() const       { print_on(tty); }
 void AllocatedObj::print_value() const { print_value_on(tty); }
 
--- a/src/share/vm/memory/filemap.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/memory/filemap.cpp	Wed May 11 00:38:58 2016 +0300
@@ -881,7 +881,7 @@
     return false;
   }
 
-  if (Arguments::patch_dirs() != NULL) {
+  if (Arguments::get_xpatchprefix() != NULL) {
     FileMapInfo::fail_continue("The shared archive file cannot be used with -Xpatch.");
     return false;
   }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/memory/operator_new.cpp	Wed May 11 00:38:58 2016 +0300
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "utilities/debug.hpp"
+
+#include <new>
+
+//--------------------------------------------------------------------------------------
+// Non-product code
+
+#ifndef PRODUCT
+// The global operator new should never be called since it will usually indicate
+// a memory leak.  Use CHeapObj as the base class of such objects to make it explicit
+// that they're allocated on the C heap.
+// Commented out in product version to avoid conflicts with third-party C++ native code.
+//
+// In C++98/03 the throwing new operators are defined with the following signature:
+//
+// void* operator new(std::size_tsize) throw(std::bad_alloc);
+// void* operator new[](std::size_tsize) throw(std::bad_alloc);
+//
+// while all the other (non-throwing) new and delete operators are defined with an empty
+// throw clause (i.e. "operator delete(void* p) throw()") which means that they do not
+// throw any exceptions (see section 18.4 of the C++ standard).
+//
+// In the new C++11/14 standard, the signature of the throwing new operators was changed
+// by completely omitting the throw clause (which effectively means they could throw any
+// exception) while all the other new/delete operators where changed to have a 'nothrow'
+// clause instead of an empty throw clause.
+//
+// Unfortunately, the support for exception specifications among C++ compilers is still
+// very fragile. While some more strict compilers like AIX xlC or HP aCC reject to
+// override the default throwing new operator with a user operator with an empty throw()
+// clause, the MS Visual C++ compiler warns for every non-empty throw clause like
+// throw(std::bad_alloc) that it will ignore the exception specification. The following
+// operator definitions have been checked to correctly work with all currently supported
+// compilers and they should be upwards compatible with C++11/14. Therefore
+// PLEASE BE CAREFUL if you change the signature of the following operators!
+
+static void * zero = (void *) 0;
+
+void* operator new(size_t size) /* throw(std::bad_alloc) */ {
+  fatal("Should not call global operator new");
+  return zero;
+}
+
+void* operator new [](size_t size) /* throw(std::bad_alloc) */ {
+  fatal("Should not call global operator new[]");
+  return zero;
+}
+
+void* operator new(size_t size, const std::nothrow_t&  nothrow_constant) throw() {
+  fatal("Should not call global operator new");
+  return 0;
+}
+
+void* operator new [](size_t size, std::nothrow_t&  nothrow_constant) throw() {
+  fatal("Should not call global operator new[]");
+  return 0;
+}
+
+void operator delete(void* p) throw() {
+  fatal("Should not call global delete");
+}
+
+void operator delete [](void* p) throw() {
+  fatal("Should not call global delete []");
+}
+
+#endif // Non-product
--- a/src/share/vm/memory/universe.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/memory/universe.cpp	Wed May 11 00:38:58 2016 +0300
@@ -55,7 +55,6 @@
 #include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/typeArrayKlass.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/commandLineFlagConstraintList.hpp"
--- a/src/share/vm/oops/cpCache.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/oops/cpCache.cpp	Wed May 11 00:38:58 2016 +0300
@@ -25,12 +25,12 @@
 #include "precompiled.hpp"
 #include "interpreter/interpreter.hpp"
 #include "interpreter/rewriter.hpp"
+#include "logging/log.hpp"
 #include "memory/resourceArea.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/cpCache.hpp"
 #include "oops/objArrayOop.inline.hpp"
 #include "oops/oop.inline.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "prims/methodHandles.hpp"
 #include "runtime/atomic.inline.hpp"
 #include "runtime/handles.inline.hpp"
@@ -438,17 +438,14 @@
       // match old_method so need an update
       // NOTE: can't use set_f2_as_vfinal_method as it asserts on different values
       _f2 = (intptr_t)new_method;
-      if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
+      if (log_is_enabled(Info, redefine, class, update)) {
+        ResourceMark rm;
         if (!(*trace_name_printed)) {
-          // RC_TRACE_MESG macro has an embedded ResourceMark
-          RC_TRACE_MESG(("adjust: name=%s",
-            old_method->method_holder()->external_name()));
+          log_info(redefine, class, update)("adjust: name=%s", old_method->method_holder()->external_name());
           *trace_name_printed = true;
         }
-        // RC_TRACE macro has an embedded ResourceMark
-        RC_TRACE(0x00400000, ("cpc vf-entry update: %s(%s)",
-          new_method->name()->as_C_string(),
-          new_method->signature()->as_C_string()));
+        log_debug(redefine, class, update, constantpool)
+          ("cpc vf-entry update: %s(%s)", new_method->name()->as_C_string(), new_method->signature()->as_C_string());
       }
       return true;
     }
@@ -465,17 +462,14 @@
 
   if (_f1 == old_method) {
     _f1 = new_method;
-    if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
+    if (log_is_enabled(Info, redefine, class, update)) {
+      ResourceMark rm;
       if (!(*trace_name_printed)) {
-        // RC_TRACE_MESG macro has an embedded ResourceMark
-        RC_TRACE_MESG(("adjust: name=%s",
-          old_method->method_holder()->external_name()));
+        log_info(redefine, class, update)("adjust: name=%s", old_method->method_holder()->external_name());
         *trace_name_printed = true;
       }
-      // RC_TRACE macro has an embedded ResourceMark
-      RC_TRACE(0x00400000, ("cpc entry update: %s(%s)",
-        new_method->name()->as_C_string(),
-        new_method->signature()->as_C_string()));
+      log_debug(redefine, class, update, constantpool)
+        ("cpc entry update: %s(%s)", new_method->name()->as_C_string(), new_method->signature()->as_C_string());
     }
     return true;
   }
--- a/src/share/vm/oops/instanceKlass.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/oops/instanceKlass.cpp	Wed May 11 00:38:58 2016 +0300
@@ -53,7 +53,6 @@
 #include "oops/symbol.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "prims/jvmtiRedefineClasses.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "prims/jvmtiThreadState.hpp"
 #include "prims/methodComparator.hpp"
 #include "runtime/atomic.inline.hpp"
@@ -2574,17 +2573,17 @@
       assert(old_method != new_method, "sanity check");
 
       default_methods()->at_put(index, new_method);
-      if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
+      if (log_is_enabled(Info, redefine, class, update)) {
+        ResourceMark rm;
         if (!(*trace_name_printed)) {
-          // RC_TRACE_MESG macro has an embedded ResourceMark
-          RC_TRACE_MESG(("adjust: klassname=%s default methods from name=%s",
-                         external_name(),
-                         old_method->method_holder()->external_name()));
+          log_info(redefine, class, update)
+            ("adjust: klassname=%s default methods from name=%s",
+             external_name(), old_method->method_holder()->external_name());
           *trace_name_printed = true;
         }
-        RC_TRACE(0x00100000, ("default method update: %s(%s) ",
-                              new_method->name()->as_C_string(),
-                              new_method->signature()->as_C_string()));
+        log_debug(redefine, class, update, vtables)
+          ("default method update: %s(%s) ",
+           new_method->name()->as_C_string(), new_method->signature()->as_C_string());
       }
     }
   }
@@ -3353,8 +3352,8 @@
     ClassLoaderData* loader_data = ik->class_loader_data();
     assert(loader_data != NULL, "should never be null");
 
-    // RC_TRACE macro has an embedded ResourceMark
-    RC_TRACE(0x00000200, ("purge: %s: previous versions", ik->external_name()));
+    ResourceMark rm;
+    log_trace(redefine, class, iklass, purge)("%s: previous versions", ik->external_name());
 
     // previous versions are linked together through the InstanceKlass
     InstanceKlass* pv_node = ik->previous_versions();
@@ -3372,8 +3371,7 @@
         // are executing.  Unlink this previous_version.
         // The previous version InstanceKlass is on the ClassLoaderData deallocate list
         // so will be deallocated during the next phase of class unloading.
-        RC_TRACE(0x00000200, ("purge: previous version " INTPTR_FORMAT " is dead",
-                              p2i(pv_node)));
+        log_trace(redefine, class, iklass, purge)("previous version " INTPTR_FORMAT " is dead", p2i(pv_node));
         // For debugging purposes.
         pv_node->set_is_scratch_class();
         pv_node->class_loader_data()->add_to_deallocate_list(pv_node);
@@ -3383,8 +3381,7 @@
         version++;
         continue;
       } else {
-        RC_TRACE(0x00000200, ("purge: previous version " INTPTR_FORMAT " is alive",
-                              p2i(pv_node)));
+        log_trace(redefine, class, iklass, purge)("previous version " INTPTR_FORMAT " is alive", p2i(pv_node));
         assert(pvcp->pool_holder() != NULL, "Constant pool with no holder");
         guarantee (!loader_data->is_unloading(), "unloaded classes can't be on the stack");
         live_count++;
@@ -3396,8 +3393,7 @@
       // longer running.
       Array<Method*>* method_refs = pv_node->methods();
       if (method_refs != NULL) {
-        RC_TRACE(0x00000200, ("purge: previous methods length=%d",
-          method_refs->length()));
+        log_trace(redefine, class, iklass, purge)("previous methods length=%d", method_refs->length());
         for (int j = 0; j < method_refs->length(); j++) {
           Method* method = method_refs->at(j);
 
@@ -3409,11 +3405,9 @@
           } else {
             assert (method->is_obsolete() || method->is_running_emcp(),
                     "emcp method cannot run after emcp bit is cleared");
-            // RC_TRACE macro has an embedded ResourceMark
-            RC_TRACE(0x00000200,
+            log_trace(redefine, class, iklass, purge)
               ("purge: %s(%s): prev method @%d in version @%d is alive",
-              method->name()->as_C_string(),
-              method->signature()->as_C_string(), j, version));
+               method->name()->as_C_string(), method->signature()->as_C_string(), j, version);
           }
         }
       }
@@ -3422,9 +3416,9 @@
       pv_node = pv_node->previous_versions();
       version++;
     }
-    RC_TRACE(0x00000200,
-      ("purge: previous version stats: live=%d, deleted=%d", live_count,
-      deleted_count));
+    log_trace(redefine, class, iklass, purge)
+      ("previous version stats: live=%d, deleted=%d",
+       live_count, deleted_count);
   }
 }
 
@@ -3459,9 +3453,9 @@
                 method->signature() == m_signature) {
               // The current RedefineClasses() call has made all EMCP
               // versions of this method obsolete so mark it as obsolete
-              RC_TRACE(0x00000400,
-                ("add: %s(%s): flush obsolete method @%d in version @%d",
-                m_name->as_C_string(), m_signature->as_C_string(), k, j));
+              log_trace(redefine, class, iklass, add)
+                ("%s(%s): flush obsolete method @%d in version @%d",
+                 m_name->as_C_string(), m_signature->as_C_string(), k, j);
 
               method->set_is_obsolete();
               break;
@@ -3493,9 +3487,9 @@
   assert(Thread::current()->is_VM_thread(),
          "only VMThread can add previous versions");
 
-  // RC_TRACE macro has an embedded ResourceMark
-  RC_TRACE(0x00000400, ("adding previous version ref for %s, EMCP_cnt=%d",
-    scratch_class->external_name(), emcp_method_count));
+  ResourceMark rm;
+  log_trace(redefine, class, iklass, add)
+    ("adding previous version ref for %s, EMCP_cnt=%d", scratch_class->external_name(), emcp_method_count);
 
   // Clean out old previous versions
   purge_previous_versions(this);
@@ -3511,7 +3505,7 @@
   // we don't need to add this as a previous version.
   ConstantPool* cp_ref = scratch_class->constants();
   if (!cp_ref->on_stack()) {
-    RC_TRACE(0x00000400, ("add: scratch class not added; no methods are running"));
+    log_trace(redefine, class, iklass, add)("scratch class not added; no methods are running");
     // For debugging purposes.
     scratch_class->set_is_scratch_class();
     scratch_class->class_loader_data()->add_to_deallocate_list(scratch_class());
@@ -3534,17 +3528,17 @@
         // method may exit.   If so, we would set a breakpoint in a method that
         // is never reached, but this won't be noticeable to the programmer.
         old_method->set_running_emcp(true);
-        RC_TRACE(0x00000400, ("add: EMCP method %s is on_stack " INTPTR_FORMAT,
-                              old_method->name_and_sig_as_C_string(), p2i(old_method)));
+        log_trace(redefine, class, iklass, add)
+          ("EMCP method %s is on_stack " INTPTR_FORMAT, old_method->name_and_sig_as_C_string(), p2i(old_method));
       } else if (!old_method->is_obsolete()) {
-        RC_TRACE(0x00000400, ("add: EMCP method %s is NOT on_stack " INTPTR_FORMAT,
-                              old_method->name_and_sig_as_C_string(), p2i(old_method)));
+        log_trace(redefine, class, iklass, add)
+          ("EMCP method %s is NOT on_stack " INTPTR_FORMAT, old_method->name_and_sig_as_C_string(), p2i(old_method));
       }
     }
   }
 
   // Add previous version if any methods are still running.
-  RC_TRACE(0x00000400, ("add: scratch class added; one of its methods is on_stack"));
+  log_trace(redefine, class, iklass, add)("scratch class added; one of its methods is on_stack");
   assert(scratch_class->previous_versions() == NULL, "shouldn't have a previous version");
   scratch_class->link_previous_versions(previous_versions());
   link_previous_versions(scratch_class());
--- a/src/share/vm/oops/klassVtable.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/oops/klassVtable.cpp	Wed May 11 00:38:58 2016 +0300
@@ -34,7 +34,6 @@
 #include "oops/method.hpp"
 #include "oops/objArrayOop.hpp"
 #include "oops/oop.inline.hpp"
-#include "prims/jvmtiRedefineClassesTrace.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/handles.inline.hpp"
 #include "utilities/copy.hpp"
@@ -887,19 +886,17 @@
       updated_default = adjust_default_method(index, old_method, new_method);
     }
 
-    if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
+    if (log_is_enabled(Info, redefine, class, update)) {
+      ResourceMark rm;
       if (!(*trace_name_printed)) {
-        // RC_TRACE_MESG macro has an embedded ResourceMark
-        RC_TRACE_MESG(("adjust: klassname=%s for methods from name=%s",
-                       klass()->external_name(),
-                       old_method->method_holder()->external_name()));
+        log_info(redefine, class, update)
+          ("adjust: klassname=%s for methods from name=%s",
+           klass()->external_name(), old_method->method_holder()->external_name());
         *trace_name_printed = true;
       }
-      // RC_TRACE macro has an embedded ResourceMark
-      RC_TRACE(0x00100000, ("vtable method update: %s(%s), updated default = %s",
-                            new_method->name()->as_C_string(),
-                            new_method->signature()->as_C_string(),
-                            updated_default ? "true" : "false"));
+      log_debug(redefine, class, update, vtables)
+        ("vtable method update: %s(%s), updated default = %s",
+         new_method->name()->as_C_string(), new_method->signature()->as_C_string(), updated_default ? "true" : "false");
     }
   }
 }
@@ -1205,17 +1202,14 @@
 
     ime->initialize(new_method);
 
-    if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
+    if (log_is_enabled(Info, redefine, class, update)) {
+      ResourceMark rm;
       if (!(*trace_name_printed)) {
-        // RC_TRACE_MESG macro has an embedded ResourceMark
-        RC_TRACE_MESG(("adjust: name=%s",
-          old_method->method_holder()->external_name()));
+        log_info(redefine, class, update)("adjust: name=%s", old_method->method_holder()->external_name());
         *trace_name_printed = true;
       }
-      // RC_TRACE macro has an embedded ResourceMark
-      RC_TRACE(0x00200000, ("itable method update: %s(%s)",
-        new_method->name()->as_C_string(),
-        new_method->signature()->as_C_string()));
+      log_trace(redefine, class, update, itables)
+        ("itable method update: %s(%s)", new_method->name()->as_C_string(), new_method->signature()->as_C_string());
     }
   }
 }
--- a/src/share/vm/opto/c2compiler.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/opto/c2compiler.cpp	Wed May 11 00:38:58 2016 +0300
@@ -409,22 +409,6 @@
   case vmIntrinsics::_putLong:
   case vmIntrinsics::_putFloat:
   case vmIntrinsics::_putDouble:
-  case vmIntrinsics::_getByte_raw:
-  case vmIntrinsics::_getShort_raw:
-  case vmIntrinsics::_getChar_raw:
-  case vmIntrinsics::_getInt_raw:
-  case vmIntrinsics::_getLong_raw:
-  case vmIntrinsics::_getFloat_raw:
-  case vmIntrinsics::_getDouble_raw:
-  case vmIntrinsics::_getAddress_raw:
-  case vmIntrinsics::_putByte_raw:
-  case vmIntrinsics::_putShort_raw:
-  case vmIntrinsics::_putChar_raw:
-  case vmIntrinsics::_putInt_raw:
-  case vmIntrinsics::_putLong_raw:
-  case vmIntrinsics::_putFloat_raw:
-  case vmIntrinsics::_putDouble_raw:
-  case vmIntrinsics::_putAddress_raw:
   case vmIntrinsics::_getObjectVolatile:
   case vmIntrinsics::_getBooleanVolatile:
   case vmIntrinsics::_getByteVolatile:
--- a/src/share/vm/opto/library_call.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/opto/library_call.cpp	Wed May 11 00:38:58 2016 +0300
@@ -93,7 +93,7 @@
   Node*             _result;        // the result node, if any
   int               _reexecute_sp;  // the stack pointer when bytecode needs to be reexecuted
 
-  const TypeOopPtr* sharpen_unsafe_type(Compile::AliasType* alias_type, const TypePtr *adr_type, bool is_native_ptr = false);
+  const TypeOopPtr* sharpen_unsafe_type(Compile::AliasType* alias_type, const TypePtr *adr_type);
 
  public:
   LibraryCallKit(JVMState* jvms, LibraryIntrinsic* intrinsic)
@@ -247,7 +247,7 @@
   void insert_pre_barrier(Node* base_oop, Node* offset, Node* pre_val, bool need_mem_bar);
 
   typedef enum { Relaxed, Opaque, Volatile, Acquire, Release } AccessKind;
-  bool inline_unsafe_access(bool is_native_ptr, bool is_store, BasicType type, AccessKind kind, bool is_unaligned);
+  bool inline_unsafe_access(bool is_store, BasicType type, AccessKind kind, bool is_unaligned);
   static bool klass_needs_init_guard(Node* kls);
   bool inline_unsafe_allocate();
   bool inline_unsafe_newArray(bool uninitialized);
@@ -475,7 +475,6 @@
   // Handle symbolic names for otherwise undistinguished boolean switches:
   const bool is_store       = true;
   const bool is_compress    = true;
-  const bool is_native_ptr  = true;
   const bool is_static      = true;
   const bool is_volatile    = true;
 
@@ -555,113 +554,95 @@
   case vmIntrinsics::_inflateStringC:
   case vmIntrinsics::_inflateStringB:           return inline_string_copy(!is_compress);
 
-  case vmIntrinsics::_getObject:                return inline_unsafe_access(!is_native_ptr, !is_store, T_OBJECT,   Relaxed, false);
-  case vmIntrinsics::_getBoolean:               return inline_unsafe_access(!is_native_ptr, !is_store, T_BOOLEAN,  Relaxed, false);
-  case vmIntrinsics::_getByte:                  return inline_unsafe_access(!is_native_ptr, !is_store, T_BYTE,     Relaxed, false);
-  case vmIntrinsics::_getShort:                 return inline_unsafe_access(!is_native_ptr, !is_store, T_SHORT,    Relaxed, false);
-  case vmIntrinsics::_getChar:                  return inline_unsafe_access(!is_native_ptr, !is_store, T_CHAR,     Relaxed, false);
-  case vmIntrinsics::_getInt:                   return inline_unsafe_access(!is_native_ptr, !is_store, T_INT,      Relaxed, false);
-  case vmIntrinsics::_getLong:                  return inline_unsafe_access(!is_native_ptr, !is_store, T_LONG,     Relaxed, false);
-  case vmIntrinsics::_getFloat:                 return inline_unsafe_access(!is_native_ptr, !is_store, T_FLOAT,    Relaxed, false);
-  case vmIntrinsics::_getDouble:                return inline_unsafe_access(!is_native_ptr, !is_store, T_DOUBLE,   Relaxed, false);
-
-  case vmIntrinsics::_putObject:                return inline_unsafe_access(!is_native_ptr,  is_store, T_OBJECT,   Relaxed, false);
-  case vmIntrinsics::_putBoolean:               return inline_unsafe_access(!is_native_ptr,  is_store, T_BOOLEAN,  Relaxed, false);
-  case vmIntrinsics::_putByte:                  return inline_unsafe_access(!is_native_ptr,  is_store, T_BYTE,     Relaxed, false);
-  case vmIntrinsics::_putShort:                 return inline_unsafe_access(!is_native_ptr,  is_store, T_SHORT,    Relaxed, false);
-  case vmIntrinsics::_putChar:                  return inline_unsafe_access(!is_native_ptr,  is_store, T_CHAR,     Relaxed, false);
-  case vmIntrinsics::_putInt:                   return inline_unsafe_access(!is_native_ptr,  is_store, T_INT,      Relaxed, false);
-  case vmIntrinsics::_putLong:                  return inline_unsafe_access(!is_native_ptr,  is_store, T_LONG,     Relaxed, false);
-  case vmIntrinsics::_putFloat:                 return inline_unsafe_access(!is_native_ptr,  is_store, T_FLOAT,    Relaxed, false);
-  case vmIntrinsics::_putDouble:                return inline_unsafe_access(!is_native_ptr,  is_store, T_DOUBLE,   Relaxed, false);
-
-  case vmIntrinsics::_getByte_raw:              return inline_unsafe_access( is_native_ptr, !is_store, T_BYTE,     Relaxed, false);
-  case vmIntrinsics::_getShort_raw:             return inline_unsafe_access( is_native_ptr, !is_store, T_SHORT,    Relaxed, false);
-  case vmIntrinsics::_getChar_raw:              return inline_unsafe_access( is_native_ptr, !is_store, T_CHAR,     Relaxed, false);
-  case vmIntrinsics::_getInt_raw:               return inline_unsafe_access( is_native_ptr, !is_store, T_INT,      Relaxed, false);
-  case vmIntrinsics::_getLong_raw:              return inline_unsafe_access( is_native_ptr, !is_store, T_LONG,     Relaxed, false);
-  case vmIntrinsics::_getFloat_raw:             return inline_unsafe_access( is_native_ptr, !is_store, T_FLOAT,    Relaxed, false);
-  case vmIntrinsics::_getDouble_raw:            return inline_unsafe_access( is_native_ptr, !is_store, T_DOUBLE,   Relaxed, false);
-  case vmIntrinsics::_getAddress_raw:           return inline_unsafe_access( is_native_ptr, !is_store, T_ADDRESS,  Relaxed, false);
-
-  case vmIntrinsics::_putByte_raw:              return inline_unsafe_access( is_native_ptr,  is_store, T_BYTE,     Relaxed, false);
-  case vmIntrinsics::_putShort_raw:             return inline_unsafe_access( is_native_ptr,  is_store, T_SHORT,    Relaxed, false);
-  case vmIntrinsics::_putChar_raw:              return inline_unsafe_access( is_native_ptr,  is_store, T_CHAR,     Relaxed, false);
-  case vmIntrinsics::_putInt_raw:               return inline_unsafe_access( is_native_ptr,  is_store, T_INT,      Relaxed, false);
-  case vmIntrinsics::_putLong_raw:              return inline_unsafe_access( is_native_ptr,  is_store, T_LONG,     Relaxed, false);
-  case vmIntrinsics::_putFloat_raw:             return inline_unsafe_access( is_native_ptr,  is_store, T_FLOAT,    Relaxed, false);
-  case vmIntrinsics::_putDouble_raw:            return inline_unsafe_access( is_native_ptr,  is_store, T_DOUBLE,   Relaxed, false);
-  case vmIntrinsics::_putAddress_raw:           return inline_unsafe_access( is_native_ptr,  is_store, T_ADDRESS,  Relaxed, false);
-
-  case vmIntrinsics::_getObjectVolatile:        return inline_unsafe_access(!is_native_ptr, !is_store, T_OBJECT,   Volatile, false);
-  case vmIntrinsics::_getBooleanVolatile:       return inline_unsafe_access(!is_native_ptr, !is_store, T_BOOLEAN,  Volatile, false);
-  case vmIntrinsics::_getByteVolatile:          return inline_unsafe_access(!is_native_ptr, !is_store, T_BYTE,     Volatile, false);
-  case vmIntrinsics::_getShortVolatile:         return inline_unsafe_access(!is_native_ptr, !is_store, T_SHORT,    Volatile, false);
-  case vmIntrinsics::_getCharVolatile:          return inline_unsafe_access(!is_native_ptr, !is_store, T_CHAR,     Volatile, false);
-  case vmIntrinsics::_getIntVolatile:           return inline_unsafe_access(!is_native_ptr, !is_store, T_INT,      Volatile, false);
-  case vmIntrinsics::_getLongVolatile:          return inline_unsafe_access(!is_native_ptr, !is_store, T_LONG,     Volatile, false);
-  case vmIntrinsics::_getFloatVolatile:         return inline_unsafe_access(!is_native_ptr, !is_store, T_FLOAT,    Volatile, false);
-  case vmIntrinsics::_getDoubleVolatile:        return inline_unsafe_access(!is_native_ptr, !is_store, T_DOUBLE,   Volatile, false);
-
-  case vmIntrinsics::_putObjectVolatile:        return inline_unsafe_access(!is_native_ptr,  is_store, T_OBJECT,   Volatile, false);
-  case vmIntrinsics::_putBooleanVolatile:       return inline_unsafe_access(!is_native_ptr,  is_store, T_BOOLEAN,  Volatile, false);
-  case vmIntrinsics::_putByteVolatile:          return inline_unsafe_access(!is_native_ptr,  is_store, T_BYTE,     Volatile, false);
-  case vmIntrinsics::_putShortVolatile:         return inline_unsafe_access(!is_native_ptr,  is_store, T_SHORT,    Volatile, false);
-  case vmIntrinsics::_putCharVolatile:          return inline_unsafe_access(!is_native_ptr,  is_store, T_CHAR,     Volatile, false);
-  case vmIntrinsics::_putIntVolatile:           return inline_unsafe_access(!is_native_ptr,  is_store, T_INT,      Volatile, false);
-  case vmIntrinsics::_putLongVolatile:          return inline_unsafe_access(!is_native_ptr,  is_store, T_LONG,     Volatile, false);
-  case vmIntrinsics::_putFloatVolatile:         return inline_unsafe_access(!is_native_ptr,  is_store, T_FLOAT,    Volatile, false);
-  case vmIntrinsics::_putDoubleVolatile:        return inline_unsafe_access(!is_native_ptr,  is_store, T_DOUBLE,   Volatile, false);
-
-  case vmIntrinsics::_getShortUnaligned:        return inline_unsafe_access(!is_native_ptr, !is_store, T_SHORT,    Relaxed, true);
-  case vmIntrinsics::_getCharUnaligned:         return inline_unsafe_access(!is_native_ptr, !is_store, T_CHAR,     Relaxed, true);
-  case vmIntrinsics::_getIntUnaligned:          return inline_unsafe_access(!is_native_ptr, !is_store, T_INT,      Relaxed, true);
-  case vmIntrinsics::_getLongUnaligned:         return inline_unsafe_access(!is_native_ptr, !is_store, T_LONG,     Relaxed, true);
-
-  case vmIntrinsics::_putShortUnaligned:        return inline_unsafe_access(!is_native_ptr,  is_store, T_SHORT,    Relaxed, true);
-  case vmIntrinsics::_putCharUnaligned:         return inline_unsafe_access(!is_native_ptr,  is_store, T_CHAR,     Relaxed, true);
-  case vmIntrinsics::_putIntUnaligned:          return inline_unsafe_access(!is_native_ptr,  is_store, T_INT,      Relaxed, true);
-  case vmIntrinsics::_putLongUnaligned:         return inline_unsafe_access(!is_native_ptr,  is_store, T_LONG,     Relaxed, true);
-
-  case vmIntrinsics::_getObjectAcquire:         return inline_unsafe_access(!is_native_ptr, !is_store, T_OBJECT,   Acquire, false);
-  case vmIntrinsics::_getBooleanAcquire:        return inline_unsafe_access(!is_native_ptr, !is_store, T_BOOLEAN,  Acquire, false);
-  case vmIntrinsics::_getByteAcquire:           return inline_unsafe_access(!is_native_ptr, !is_store, T_BYTE,     Acquire, false);
-  case vmIntrinsics::_getShortAcquire:          return inline_unsafe_access(!is_native_ptr, !is_store, T_SHORT,    Acquire, false);
-  case vmIntrinsics::_getCharAcquire:           return inline_unsafe_access(!is_native_ptr, !is_store, T_CHAR,     Acquire, false);
-  case vmIntrinsics::_getIntAcquire:            return inline_unsafe_access(!is_native_ptr, !is_store, T_INT,      Acquire, false);
-  case vmIntrinsics::_getLongAcquire:           return inline_unsafe_access(!is_native_ptr, !is_store, T_LONG,     Acquire, false);
-  case vmIntrinsics::_getFloatAcquire:          return inline_unsafe_access(!is_native_ptr, !is_store, T_FLOAT,    Acquire, false);
-  case vmIntrinsics::_getDoubleAcquire:         return inline_unsafe_access(!is_native_ptr, !is_store, T_DOUBLE,   Acquire, false);
-
-  case vmIntrinsics::_putObjectRelease:         return inline_unsafe_access(!is_native_ptr,  is_store, T_OBJECT,   Release, false);
-  case vmIntrinsics::_putBooleanRelease:        return inline_unsafe_access(!is_native_ptr,  is_store, T_BOOLEAN,  Release, false);
-  case vmIntrinsics::_putByteRelease:           return inline_unsafe_access(!is_native_ptr,  is_store, T_BYTE,     Release, false);
-  case vmIntrinsics::_putShortRelease:          return inline_unsafe_access(!is_native_ptr,  is_store, T_SHORT,    Release, false);
-  case vmIntrinsics::_putCharRelease:           return inline_unsafe_access(!is_native_ptr,  is_store, T_CHAR,     Release, false);
-  case vmIntrinsics::_putIntRelease:            return inline_unsafe_access(!is_native_ptr,  is_store, T_INT,      Release, false);
-  case vmIntrinsics::_putLongRelease:           return inline_unsafe_access(!is_native_ptr,  is_store, T_LONG,     Release, false);
-  case vmIntrinsics::_putFloatRelease:          return inline_unsafe_access(!is_native_ptr,  is_store, T_FLOAT,    Release, false);
-  case vmIntrinsics::_putDoubleRelease:         return inline_unsafe_access(!is_native_ptr,  is_store, T_DOUBLE,   Release, false);
-
-  case vmIntrinsics::_getObjectOpaque:          return inline_unsafe_access(!is_native_ptr, !is_store, T_OBJECT,   Opaque, false);
-  case vmIntrinsics::_getBooleanOpaque:         return inline_unsafe_access(!is_native_ptr, !is_store, T_BOOLEAN,  Opaque, false);
-  case vmIntrinsics::_getByteOpaque:            return inline_unsafe_access(!is_native_ptr, !is_store, T_BYTE,     Opaque, false);
-  case vmIntrinsics::_getShortOpaque:           return inline_unsafe_access(!is_native_ptr, !is_store, T_SHORT,    Opaque, false);
-  case vmIntrinsics::_getCharOpaque:            return inline_unsafe_access(!is_native_ptr, !is_store, T_CHAR,     Opaque, false);
-  case vmIntrinsics::_getIntOpaque:             return inline_unsafe_access(!is_native_ptr, !is_store, T_INT,      Opaque, false);
-  case vmIntrinsics::_getLongOpaque:            return inline_unsafe_access(!is_native_ptr, !is_store, T_LONG,     Opaque, false);
-  case vmIntrinsics::_getFloatOpaque:           return inline_unsafe_access(!is_native_ptr, !is_store, T_FLOAT,    Opaque, false);
-  case vmIntrinsics::_getDoubleOpaque:          return inline_unsafe_access(!is_native_ptr, !is_store, T_DOUBLE,   Opaque, false);
-
-  case vmIntrinsics::_putObjectOpaque:          return inline_unsafe_access(!is_native_ptr,  is_store, T_OBJECT,   Opaque, false);
-  case vmIntrinsics::_putBooleanOpaque:         return inline_unsafe_access(!is_native_ptr,  is_store, T_BOOLEAN,  Opaque, false);
-  case vmIntrinsics::_putByteOpaque:            return inline_unsafe_access(!is_native_ptr,  is_store, T_BYTE,     Opaque, false);
-  case vmIntrinsics::_putShortOpaque:           return inline_unsafe_access(!is_native_ptr,  is_store, T_SHORT,    Opaque, false);
-  case vmIntrinsics::_putCharOpaque:            return inline_unsafe_access(!is_native_ptr,  is_store, T_CHAR,     Opaque, false);
-  case vmIntrinsics::_putIntOpaque:             return inline_unsafe_access(!is_native_ptr,  is_store, T_INT,      Opaque, false);
-  case vmIntrinsics::_putLongOpaque:            return inline_unsafe_access(!is_native_ptr,  is_store, T_LONG,     Opaque, false);
-  case vmIntrinsics::_putFloatOpaque:           return inline_unsafe_access(!is_native_ptr,  is_store, T_FLOAT,    Opaque, false);
-  case vmIntrinsics::_putDoubleOpaque:          return inline_unsafe_access(!is_native_ptr,  is_store, T_DOUBLE,   Opaque, false);
+  case vmIntrinsics::_getObject:                return inline_unsafe_access(!is_store, T_OBJECT,   Relaxed, false);
+  case vmIntrinsics::_getBoolean:               return inline_unsafe_access(!is_store, T_BOOLEAN,  Relaxed, false);
+  case vmIntrinsics::_getByte:                  return inline_unsafe_access(!is_store, T_BYTE,     Relaxed, false);
+  case vmIntrinsics::_getShort:                 return inline_unsafe_access(!is_store, T_SHORT,    Relaxed, false);
+  case vmIntrinsics::_getChar:                  return inline_unsafe_access(!is_store, T_CHAR,     Relaxed, false);
+  case vmIntrinsics::_getInt:                   return inline_unsafe_access(!is_store, T_INT,      Relaxed, false);
+  case vmIntrinsics::_getLong:                  return inline_unsafe_access(!is_store, T_LONG,     Relaxed, false);
+  case vmIntrinsics::_getFloat:                 return inline_unsafe_access(!is_store, T_FLOAT,    Relaxed, false);
+  case vmIntrinsics::_getDouble:                return inline_unsafe_access(!is_store, T_DOUBLE,   Relaxed, false);
+
+  case vmIntrinsics::_putObject:                return inline_unsafe_access( is_store, T_OBJECT,   Relaxed, false);
+  case vmIntrinsics::_putBoolean:               return inline_unsafe_access( is_store, T_BOOLEAN,  Relaxed, false);
+  case vmIntrinsics::_putByte:                  return inline_unsafe_access( is_store, T_BYTE,     Relaxed, false);
+  case vmIntrinsics::_putShort:                 return inline_unsafe_access( is_store, T_SHORT,    Relaxed, false);
+  case vmIntrinsics::_putChar:                  return inline_unsafe_access( is_store, T_CHAR,     Relaxed, false);
+  case vmIntrinsics::_putInt:                   return inline_unsafe_access( is_store, T_INT,      Relaxed, false);
+  case vmIntrinsics::_putLong:                  return inline_unsafe_access( is_store, T_LONG,     Relaxed, false);
+  case vmIntrinsics::_putFloat:                 return inline_unsafe_access( is_store, T_FLOAT,    Relaxed, false);
+  case vmIntrinsics::_putDouble:                return inline_unsafe_access( is_store, T_DOUBLE,   Relaxed, false);
+
+  case vmIntrinsics::_getObjectVolatile:        return inline_unsafe_access(!is_store, T_OBJECT,   Volatile, false);
+  case vmIntrinsics::_getBooleanVolatile:       return inline_unsafe_access(!is_store, T_BOOLEAN,  Volatile, false);
+  case vmIntrinsics::_getByteVolatile:          return inline_unsafe_access(!is_store, T_BYTE,     Volatile, false);
+  case vmIntrinsics::_getShortVolatile:         return inline_unsafe_access(!is_store, T_SHORT,    Volatile, false);
+  case vmIntrinsics::_getCharVolatile:          return inline_unsafe_access(!is_store, T_CHAR,     Volatile, false);
+  case vmIntrinsics::_getIntVolatile:           return inline_unsafe_access(!is_store, T_INT,      Volatile, false);
+  case vmIntrinsics::_getLongVolatile:          return inline_unsafe_access(!is_store, T_LONG,     Volatile, false);
+  case vmIntrinsics::_getFloatVolatile:         return inline_unsafe_access(!is_store, T_FLOAT,    Volatile, false);
+  case vmIntrinsics::_getDoubleVolatile:        return inline_unsafe_access(!is_store, T_DOUBLE,   Volatile, false);
+
+  case vmIntrinsics::_putObjectVolatile:        return inline_unsafe_access( is_store, T_OBJECT,   Volatile, false);
+  case vmIntrinsics::_putBooleanVolatile:       return inline_unsafe_access( is_store, T_BOOLEAN,  Volatile, false);
+  case vmIntrinsics::_putByteVolatile:          return inline_unsafe_access( is_store, T_BYTE,     Volatile, false);
+  case vmIntrinsics::_putShortVolatile:         return inline_unsafe_access( is_store, T_SHORT,    Volatile, false);
+  case vmIntrinsics::_putCharVolatile:          return inline_unsafe_access( is_store, T_CHAR,     Volatile, false);
+  case vmIntrinsics::_putIntVolatile:           return inline_unsafe_access( is_store, T_INT,      Volatile, false);
+  case vmIntrinsics::_putLongVolatile:          return inline_unsafe_access( is_store, T_LONG,     Volatile, false);
+  case vmIntrinsics::_putFloatVolatile:         return inline_unsafe_access( is_store, T_FLOAT,    Volatile, false);
+  case vmIntrinsics::_putDoubleVolatile:        return inline_unsafe_access( is_store, T_DOUBLE,   Volatile, false);
+
+  case vmIntrinsics::_getShortUnaligned:        return inline_unsafe_access(!is_store, T_SHORT,    Relaxed, true);
+  case vmIntrinsics::_getCharUnaligned:         return inline_unsafe_access(!is_store, T_CHAR,     Relaxed, true);
+  case vmIntrinsics::_getIntUnaligned:          return inline_unsafe_access(!is_store, T_INT,      Relaxed, true);
+  case vmIntrinsics::_getLongUnaligned:         return inline_unsafe_access(!is_store, T_LONG,     Relaxed, true);
+
+  case vmIntrinsics::_putShortUnaligned:        return inline_unsafe_access( is_store, T_SHORT,    Relaxed, true);
+  case vmIntrinsics::_putCharUnaligned:         return inline_unsafe_access( is_store, T_CHAR,     Relaxed, true);
+  case vmIntrinsics::_putIntUnaligned:          return inline_unsafe_access( is_store, T_INT,      Relaxed, true);
+  case vmIntrinsics::_putLongUnaligned:         return inline_unsafe_access( is_store, T_LONG,     Relaxed, true);
+
+  case vmIntrinsics::_getObjectAcquire:         return inline_unsafe_access(!is_store, T_OBJECT,   Acquire, false);
+  case vmIntrinsics::_getBooleanAcquire:        return inline_unsafe_access(!is_store, T_BOOLEAN,  Acquire, false);
+  case vmIntrinsics::_getByteAcquire:           return inline_unsafe_access(!is_store, T_BYTE,     Acquire, false);
+  case vmIntrinsics::_getShortAcquire:          return inline_unsafe_access(!is_store, T_SHORT,    Acquire, false);
+  case vmIntrinsics::_getCharAcquire:           return inline_unsafe_access(!is_store, T_CHAR,     Acquire, false);
+  case vmIntrinsics::_getIntAcquire:            return inline_unsafe_access(!is_store, T_INT,      Acquire, false);
+  case vmIntrinsics::_getLongAcquire:           return inline_unsafe_access(!is_store, T_LONG,     Acquire, false);
+  case vmIntrinsics::_getFloatAcquire:          return inline_unsafe_access(!is_store, T_FLOAT,    Acquire, false);
+  case vmIntrinsics::_getDoubleAcquire:         return inline_unsafe_access(!is_store, T_DOUBLE,   Acquire, false);
+
+  case vmIntrinsics::_putObjectRelease:         return inline_unsafe_access( is_store, T_OBJECT,   Release, false);
+  case vmIntrinsics::_putBooleanRelease:        return inline_unsafe_access( is_store, T_BOOLEAN,  Release, false);
+  case vmIntrinsics::_putByteRelease:           return inline_unsafe_access( is_store, T_BYTE,     Release, false);
+  case vmIntrinsics::_putShortRelease:          return inline_unsafe_access( is_store, T_SHORT,    Release, false);
+  case vmIntrinsics::_putCharRelease:           return inline_unsafe_access( is_store, T_CHAR,     Release, false);
+  case vmIntrinsics::_putIntRelease:            return inline_unsafe_access( is_store, T_INT,      Release, false);
+  case vmIntrinsics::_putLongRelease:           return inline_unsafe_access( is_store, T_LONG,     Release, false);
+  case vmIntrinsics::_putFloatRelease:          return inline_unsafe_access( is_store, T_FLOAT,    Release, false);
+  case vmIntrinsics::_putDoubleRelease:         return inline_unsafe_access( is_store, T_DOUBLE,   Release, false);
+
+  case vmIntrinsics::_getObjectOpaque:          return inline_unsafe_access(!is_store, T_OBJECT,   Opaque, false);
+  case vmIntrinsics::_getBooleanOpaque:         return inline_unsafe_access(!is_store, T_BOOLEAN,  Opaque, false);
+  case vmIntrinsics::_getByteOpaque:            return inline_unsafe_access(!is_store, T_BYTE,     Opaque, false);
+  case vmIntrinsics::_getShortOpaque:           return inline_unsafe_access(!is_store, T_SHORT,    Opaque, false);
+  case vmIntrinsics::_getCharOpaque:            return inline_unsafe_access(!is_store, T_CHAR,     Opaque, false);
+  case vmIntrinsics::_getIntOpaque:             return inline_unsafe_access(!is_store, T_INT,      Opaque, false);
+  case vmIntrinsics::_getLongOpaque:            return inline_unsafe_access(!is_store, T_LONG,     Opaque, false);
+  case vmIntrinsics::_getFloatOpaque:           return inline_unsafe_access(!is_store, T_FLOAT,    Opaque, false);
+  case vmIntrinsics::_getDoubleOpaque:          return inline_unsafe_access(!is_store, T_DOUBLE,   Opaque, false);
+
+  case vmIntrinsics::_putObjectOpaque:          return inline_unsafe_access( is_store, T_OBJECT,   Opaque, false);
+  case vmIntrinsics::_putBooleanOpaque:         return inline_unsafe_access( is_store, T_BOOLEAN,  Opaque, false);
+  case vmIntrinsics::_putByteOpaque:            return inline_unsafe_access( is_store, T_BYTE,     Opaque, false);
+  case vmIntrinsics::_putShortOpaque:           return inline_unsafe_access( is_store, T_SHORT,    Opaque, false);
+  case vmIntrinsics::_putCharOpaque:            return inline_unsafe_access( is_store, T_CHAR,     Opaque, false);
+  case vmIntrinsics::_putIntOpaque:             return inline_unsafe_access( is_store, T_INT,      Opaque, false);
+  case vmIntrinsics::_putLongOpaque:            return inline_unsafe_access( is_store, T_LONG,     Opaque, false);
+  case vmIntrinsics::_putFloatOpaque:           return inline_unsafe_access( is_store, T_FLOAT,    Opaque, false);
+  case vmIntrinsics::_putDoubleOpaque:          return inline_unsafe_access( is_store, T_DOUBLE,   Opaque, false);
 
   case vmIntrinsics::_compareAndSwapObject:             return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap,      Volatile);
   case vmIntrinsics::_compareAndSwapInt:                return inline_unsafe_load_store(T_INT,    LS_cmp_swap,      Volatile);
@@ -2199,8 +2180,6 @@
 
 //----------------------------inline_unsafe_access----------------------------
 
-const static BasicType T_ADDRESS_HOLDER = T_LONG;
-
 // Helper that guards and inserts a pre-barrier.
 void LibraryCallKit::insert_pre_barrier(Node* base_oop, Node* offset,
                                         Node* pre_val, bool need_mem_bar) {
@@ -2301,13 +2280,12 @@
 }
 
 
-const TypeOopPtr* LibraryCallKit::sharpen_unsafe_type(Compile::AliasType* alias_type, const TypePtr *adr_type, bool is_native_ptr) {
+const TypeOopPtr* LibraryCallKit::sharpen_unsafe_type(Compile::AliasType* alias_type, const TypePtr *adr_type) {
   // Attempt to infer a sharper value type from the offset and base type.
   ciKlass* sharpened_klass = NULL;
 
   // See if it is an instance field, with an object type.
   if (alias_type->field() != NULL) {
-    assert(!is_native_ptr, "native pointer op cannot use a java address");
     if (alias_type->field()->type()->is_klass()) {
       sharpened_klass = alias_type->field()->type()->as_klass();
     }
@@ -2340,7 +2318,7 @@
   return NULL;
 }
 
-bool LibraryCallKit::inline_unsafe_access(const bool is_native_ptr, bool is_store, const BasicType type, const AccessKind kind, const bool unaligned) {
+bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, const AccessKind kind, const bool unaligned) {
   if (callee()->is_static())  return false;  // caller must have the capability!
   guarantee(!is_store || kind != Acquire, "Acquire accesses can be produced only for loads");
   guarantee( is_store || kind != Release, "Release accesses can be produced only for stores");
@@ -2355,31 +2333,17 @@
     if (!is_store) {
       // Object getObject(Object base, int/long offset), etc.
       BasicType rtype = sig->return_type()->basic_type();
-      if (rtype == T_ADDRESS_HOLDER && callee()->name() == ciSymbol::getAddress_name())
-          rtype = T_ADDRESS;  // it is really a C void*
       assert(rtype == type, "getter must return the expected value");
-      if (!is_native_ptr) {
-        assert(sig->count() == 2, "oop getter has 2 arguments");
-        assert(sig->type_at(0)->basic_type() == T_OBJECT, "getter base is object");
-        assert(sig->type_at(1)->basic_type() == T_LONG, "getter offset is correct");
-      } else {
-        assert(sig->count() == 1, "native getter has 1 argument");
-        assert(sig->type_at(0)->basic_type() == T_LONG, "getter base is long");
-      }
+      assert(sig->count() == 2, "oop getter has 2 arguments");
+      assert(sig->type_at(0)->basic_type() == T_OBJECT, "getter base is object");
+      assert(sig->type_at(1)->basic_type() == T_LONG, "getter offset is correct");
     } else {
       // void putObject(Object base, int/long offset, Object x), etc.
       assert(sig->return_type()->basic_type() == T_VOID, "putter must not return a value");
-      if (!is_native_ptr) {
-        assert(sig->count() == 3, "oop putter has 3 arguments");
-        assert(sig->type_at(0)->basic_type() == T_OBJECT, "putter base is object");
-        assert(sig->type_at(1)->basic_type() == T_LONG, "putter offset is correct");
-      } else {
-        assert(sig->count() == 2, "native putter has 2 arguments");
-        assert(sig->type_at(0)->basic_type() == T_LONG, "putter base is long");
-      }
+      assert(sig->count() == 3, "oop putter has 3 arguments");
+      assert(sig->type_at(0)->basic_type() == T_OBJECT, "putter base is object");
+      assert(sig->type_at(1)->basic_type() == T_LONG, "putter offset is correct");
       BasicType vtype = sig->type_at(sig->count()-1)->basic_type();
-      if (vtype == T_ADDRESS_HOLDER && callee()->name() == ciSymbol::putAddress_name())
-        vtype = T_ADDRESS;  // it is really a C void*
       assert(vtype == type, "putter must accept the expected value");
     }
 #endif // ASSERT
@@ -2396,27 +2360,22 @@
   Node* offset = top();
   Node* val;
 
-  if (!is_native_ptr) {
-    // The base is either a Java object or a value produced by Unsafe.staticFieldBase
-    Node* base = argument(1);  // type: oop
-    // The offset is a value produced by Unsafe.staticFieldOffset or Unsafe.objectFieldOffset
-    offset = argument(2);  // type: long
-    // We currently rely on the cookies produced by Unsafe.xxxFieldOffset
-    // to be plain byte offsets, which are also the same as those accepted
-    // by oopDesc::field_base.
-    assert(Unsafe_field_offset_to_byte_offset(11) == 11,
-           "fieldOffset must be byte-scaled");
-    // 32-bit machines ignore the high half!
-    offset = ConvL2X(offset);
-    adr = make_unsafe_address(base, offset);
+  // The base is either a Java object or a value produced by Unsafe.staticFieldBase
+  Node* base = argument(1);  // type: oop
+  // The offset is a value produced by Unsafe.staticFieldOffset or Unsafe.objectFieldOffset
+  offset = argument(2);  // type: long
+  // We currently rely on the cookies produced by Unsafe.xxxFieldOffset
+  // to be plain byte offsets, which are also the same as those accepted
+  // by oopDesc::field_base.
+  assert(Unsafe_field_offset_to_byte_offset(11) == 11,
+         "fieldOffset must be byte-scaled");
+  // 32-bit machines ignore the high half!
+  offset = ConvL2X(offset);
+  adr = make_unsafe_address(base, offset);
+  if (_gvn.type(base)->isa_ptr() != TypePtr::NULL_PTR) {
     heap_base_oop = base;
-    val = is_store ? argument(4) : NULL;
-  } else {
-    Node* ptr = argument(1);  // type: long
-    ptr = ConvL2X(ptr);  // adjust Java long to machine word
-    adr = make_unsafe_address(NULL, ptr);
-    val = is_store ? argument(3) : NULL;
-  }
+  }
+  val = is_store ? argument(4) : NULL;
 
   const TypePtr *adr_type = _gvn.type(adr)->isa_ptr();
 
@@ -2498,11 +2457,11 @@
   // SATB log buffer using the pre-barrier mechanism.
   // Also we need to add memory barrier to prevent commoning reads
   // from this field across safepoint since GC can change its value.
-  bool need_read_barrier = !is_native_ptr && !is_store &&
+  bool need_read_barrier = !is_store &&
                            offset != top() && heap_base_oop != top();
 
   if (!is_store && type == T_OBJECT) {
-    const TypeOopPtr* tjp = sharpen_unsafe_type(alias_type, adr_type, is_native_ptr);
+    const TypeOopPtr* tjp = sharpen_unsafe_type(alias_type, adr_type);
     if (tjp != NULL) {
       value_type = tjp;
     }
--- a/src/share/vm/prims/jvmtiImpl.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/prims/jvmtiImpl.cpp	Wed May 11 00:38:58 2016 +0300
@@ -303,11 +303,10 @@
       if (method->is_running_emcp() &&
           method->name() == m_name &&
           method->signature() == m_signature) {
-        RC_TRACE(0x00000800, ("%sing breakpoint in %s(%s)",
-          meth_act == &Method::set_breakpoint ? "sett" : "clear",
-          method->name()->as_C_string(),
-          method->signature()->as_C_string()));
-
+        ResourceMark rm;
+        log_debug(redefine, class, breakpoint)
+          ("%sing breakpoint in %s(%s)", meth_act == &Method::set_breakpoint ? "sett" : "clear",
+           method->name()->as_C_string(), method->signature()->as_C_string());
         (method->*meth_act)(_bci);
         break;
       }
--- a/src/share/vm/prims/jvmtiRedefineClasses.cpp	Tue May 10 12:18:22 2016 +0200
+++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp	Wed May 11 00:38:58 2016 +0300
@@ -32,6 +32,7 @@
 #include "gc/shared/gcLocker.hpp"
 #include "interpreter/oopMapCache.hpp"
 #include "interpreter/rewriter.hpp"
+#include "logging/logStream.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/metaspaceShared.hpp"
 #include "memory/resourceArea.hpp"
@@ -94,7 +95,9 @@
 
   // Start timer after all the sanity checks; not quite accurate, but
   // better than adding a bunch of stop() calls.
-  RC_TIMER_START(_timer_vm_op_prologue);
+  if (log_is_enabled(Info, redefine, class, timer)) {
+    _timer_vm_op_prologue.start();
+  }
 
   // We first load new class versions in the prologue, because somewhere down the
   // call chain it is required that the current thread is a Java thread.
@@ -111,11 +114,11 @@
     }
     // Free os::malloc allocated memory in load_new_class_version.
     os::free(_scratch_classes);
-    RC_TIMER_STOP(_timer_vm_op_prologue);
+    _timer_vm_op_prologue.stop();
     return false;
   }
 
-  RC_TIMER_STOP(_timer_vm_op_prologue);
+  _timer_vm_op_prologue.stop();
   return true;
 }
 
@@ -128,8 +131,7 @@
     // a shared class. We do the remap during the doit() phase of
     // the safepoint to be safer.
     if (!MetaspaceShared::remap_shared_readonly_as_readwrite()) {
-      RC_TRACE_WITH_THREAD(0x00000001, thread,
-        ("failed to remap shared readonly space to readwrite, private"));
+      log_info(redefine, class, load)("failed to remap shared readonly space to readwrite, private");
       _res = JVMTI_ERROR_INTERNAL;
       return;
     }
@@ -161,9 +163,9 @@
   // check_class() is optionally called for product bits, but is
   // always called for non-product bits.
 #ifdef PRODUCT
-  if (RC_TRACE_ENABLED(0x00004000)) {
+  if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
 #endif
-    RC_TRACE_WITH_THREAD(0x00004000, thread, ("calling check_class"));
+    log_trace(redefine, class, obsolete, metadata)("calling check_class");
     CheckClass check_class(thread);
     ClassLoaderDataGraph::classes_do(&check_class);
 #ifdef PRODUCT
@@ -178,19 +180,19 @@
   // Reset the_class_oop to null for error printing.
   _the_class_oop = NULL;
 
-  if (RC_TRACE_ENABLED(0x00000004)) {
+  if (log_is_enabled(Info, redefine, class, timer)) {
     // Used to have separate timers for "doit" and "all", but the timer
     // overhead skewed the measurements.
     jlong doit_time = _timer_rsc_phase1.milliseconds() +
                       _timer_rsc_phase2.milliseconds();
     jlong all_time = _timer_vm_op_prologue.milliseconds() + doit_time;
 
-    RC_TRACE(0x00000004, ("vm_op: all=" UINT64_FORMAT
-      "  prologue=" UINT64_FORMAT "  doit=" UINT64_FORMAT, all_time,
-      _timer_vm_op_prologue.milliseconds(), doit_time));
-    RC_TRACE(0x00000004,
+    log_info(redefine, class, timer)
+      ("vm_op: all=" UINT64_FORMAT "  prologue=" UINT64_FORMAT "  doit=" UINT64_FORMAT,
+       all_time, _timer_vm_op_prologue.milliseconds(), doit_time);
+    log_info(redefine, class, timer)
       ("redefine_single_class: phase1=" UINT64_FORMAT "  phase2=" UINT64_FORMAT,
-       _timer_rsc_phase1.milliseconds(), _timer_rsc_phase2.milliseconds()));
+       _timer_rsc_phase1.milliseconds(), _timer_rsc_phase2.milliseconds());
   }
 }
 
@@ -305,14 +307,14 @@
       // both new_name_ref_i and new_signature_ref_i will both be 0.
       // In that case, all we are appending is the current entry.
       if (new_name_ref_i != name_ref_i) {
-        RC_TRACE(0x00080000,
+        log_trace(redefine, class, constantpool)
           ("NameAndType entry@%d name_ref_index change: %d to %d",
-          *merge_cp_length_p, name_ref_i, new_name_ref_i));
+           *merge_cp_length_p, name_ref_i, new_name_ref_i);
       }
       if (new_signature_ref_i != signature_ref_i) {
-        RC_TRACE(0x00080000,
+        log_trace(redefine, class, constantpool)
           ("NameAndType entry@%d signature_ref_index change: %d to %d",
-          *merge_cp_length_p, signature_ref_i, new_signature_ref_i));
+           *merge_cp_length_p, signature_ref_i, new_signature_ref_i);
       }
 
       (*merge_cp_p)->name_and_type_at_put(*merge_cp_length_p,
@@ -361,14 +363,13 @@
       }
 
       if (klass_ref_i != new_klass_ref_i) {
-        RC_TRACE(0x00080000, ("%s entry@%d class_index changed: %d to %d",
-          entry_name, *merge_cp_length_p, klass_ref_i, new_klass_ref_i));
+        log_trace(redefine, class, constantpool)
+          ("%s entry@%d class_index changed: %d to %d", entry_name, *merge_cp_length_p, klass_ref_i, new_klass_ref_i);
       }
       if (name_and_type_ref_i != new_name_and_type_ref_i) {
-        RC_TRACE(0x00080000,
+        log_trace(redefine, class, constantpool)
           ("%s entry@%d name_and_type_index changed: %d to %d",
-          entry_name, *merge_cp_length_p, name_and_type_ref_i,
-          new_name_and_type_ref_i));
+           entry_name, *merge_cp_length_p, name_and_type_ref_i, new_name_and_type_ref_i);
       }
 
       if (scratch_i != *merge_cp_length_p) {
@@ -386,9 +387,8 @@
       int new_ref_i = find_or_append_indirect_entry(scratch_cp, ref_i, merge_cp_p,
                                                     merge_cp_length_p, THREAD);
       if (new_ref_i != ref_i) {
-        RC_TRACE(0x00080000,
-                 ("MethodType entry@%d ref_index change: %d to %d",
-                  *merge_cp_length_p, ref_i, new_ref_i));
+        log_trace(redefine, class, constantpool)
+          ("MethodType entry@%d ref_index change: %d to %d", *merge_cp_length_p, ref_i, new_ref_i);
       }
       (*merge_cp_p)->method_type_index_at_put(*merge_cp_length_p, new_ref_i);
       if (scratch_i != *merge_cp_length_p) {
@@ -407,9 +407,8 @@
       int new_ref_i = find_or_append_indirect_entry(scratch_cp, ref_i, merge_cp_p,
                                                     merge_cp_length_p, THREAD);
       if (new_ref_i != ref_i) {
-        RC_TRACE(0x00080000,
-                 ("MethodHandle entry@%d ref_index change: %d to %d",
-                  *merge_cp_length_p, ref_i, new_ref_i));
+        log_trace(redefine, class, constantpool)
+          ("MethodHandle entry@%d ref_index change: %d to %d", *merge_cp_length_p, ref_i, new_ref_i);
       }
       (*merge_cp_p)->method_handle_index_at_put(*merge_cp_length_p, ref_kind, new_ref_i);
       if (scratch_i != *merge_cp_length_p) {
@@ -432,14 +431,13 @@
       int new_ref_i = find_or_append_indirect_entry(scratch_cp, old_ref_i, merge_cp_p,
                                                     merge_cp_length_p, THREAD);
       if (new_bs_i != old_bs_i) {
-        RC_TRACE(0x00080000,
-                 ("InvokeDynamic entry@%d bootstrap_method_attr_index change: %d to %d",
-                  *merge_cp_length_p, old_bs_i, new_bs_i));
+        log_trace(redefine, class, constantpool)
+          ("InvokeDynamic entry@%d bootstrap_method_attr_index change: %d to %d",
+           *merge_cp_length_p, old_bs_i, new_bs_i);
       }
       if (new_ref_i != old_ref_i) {
-        RC_TRACE(0x00080000,
-                 ("InvokeDynamic entry@%d name_and_type_index change: %d to %d",
-                  *merge_cp_length_p, old_ref_i, new_ref_i));
+        log_trace(redefine, class, constantpool)
+          ("InvokeDynamic entry@%d name_and_type_index change: %d to %d", *merge_cp_length_p, old_ref_i, new_ref_i);
       }
 
       (*merge_cp_p)->invoke_dynamic_at_put(*merge_cp_length_p, new_bs_i, new_ref_i);
@@ -516,9 +514,8 @@
   int new_ref_i = find_or_append_indirect_entry(scratch_cp, old_ref_i, merge_cp_p,
                                                 merge_cp_length_p, THREAD);
   if (new_ref_i != old_ref_i) {
-    RC_TRACE(0x00080000,
-             ("operands entry@%d bootstrap method ref_index change: %d to %d",
-              _operands_cur_length, old_ref_i, new_ref_i));
+    log_trace(redefine, class, constantpool)
+      ("operands entry@%d bootstrap method ref_index change: %d to %d", _operands_cur_length, old_ref_i, new_ref_i);
   }
 
   Array<u2>* merge_ops = (*merge_cp_p)->operands();
@@ -539,9 +536,9 @@
                                                       merge_cp_length_p, THREAD);
     merge_ops->at_put(new_base++, new_arg_ref_i);
     if (new_arg_ref_i != old_arg_ref_i) {
-      RC_TRACE(0x00080000,
-               ("operands entry@%d bootstrap method argument ref_index change: %d to %d",
-                _operands_cur_length, old_arg_ref_i, new_arg_ref_i));
+      log_trace(redefine, class, constantpool)
+        ("operands entry@%d bootstrap method argument ref_index change: %d to %d",
+         _operands_cur_length, old_arg_ref_i, new_arg_ref_i);
     }
   }
   if (old_bs_i != _operands_cur_length) {
@@ -586,14 +583,13 @@
   // Shrink the merge_cp operands
   merge_cp->shrink_operands(_operands_cur_length, CHECK);
 
-  if (RC_TRACE_ENABLED(0x00040000)) {
+  if (log_is_enabled(Trace, redefine, class, constantpool)) {
     // don't want to loop unless we are tracing
     int count = 0;
     for (int i = 1; i < _operands_index_map_p->length(); i++) {
       int value = _operands_index_map_p->at(i);
       if (value != -1) {
-        RC_TRACE_WITH_THREAD(0x00040000, THREAD,
-          ("operands_index_map[%d]: old=%d new=%d", count, i, value));
+        log_trace(redefine, class, constantpool)("operands_index_map[%d]: old=%d new=%d", count, i, value);
         count++;
       }
     }
@@ -795,9 +791,9 @@
           }
         }
       }
-      RC_TRACE(0x00008000, ("Method matched: new: %s [%d] == old: %s [%d]",
-                            k_new_method->name_and_sig_as_C_string(), ni,
-                            k_old_method->name_and_sig_as_C_string(), oi));
+      log_trace(redefine, class, normalize)
+        ("Method matched: new: %s [%d] == old: %s [%d]",
+         k_new_method->name_and_sig_as_C_string(), ni, k_old_method->name_and_sig_as_C_string(), oi);
       // advance to next pair of methods
       ++oi;
       ++ni;
@@ -832,8 +828,8 @@
           return JVMTI_ERROR_OUT_OF_MEMORY;
         }
       }
-      RC_TRACE(0x00008000, ("Method added: new: %s [%d]",
-                            k_new_method->name_and_sig_as_C_string(), ni));
+      log_trace(redefine, class, normalize)
+        ("Method added: new: %s [%d]", k_new_method->name_and_sig_as_C_string(), ni);
       ++ni; // advance to next new method
       break;
     case deleted:
@@ -846,8 +842,8 @@
         // deleted methods must be private
         return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED;
       }
-      RC_TRACE(0x00008000, ("Method deleted: old: %s [%d]",
-                            k_old_method->name_and_sig_as_C_string(), oi));
+      log_trace(redefine, class, normalize)
+        ("Method deleted: old: %s [%d]", k_old_method->name_and_sig_as_C_string(), oi);
       ++oi; // advance to next old method
       break;
     default:
@@ -973,11 +969,9 @@
     instanceKlassHandle the_class = instanceKlassHandle(THREAD, the_class_oop);
     Symbol*  the_class_sym = the_class->name();
 
-    // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
-    RC_TRACE_WITH_THREAD(0x00000001, THREAD,
+    log_debug(redefine, class, load)
       ("loading name=%s kind=%d (avail_mem=" UINT64_FORMAT "K)",
-      the_class->external_name(), _class_load_kind,
-      os::available_memory() >> 10));
+       the_class->external_name(), _class_load_kind, os::available_memory() >> 10);
 
     ClassFileStream st((u1*)_class_defs[i].class_bytes,
                        _class_defs[i].class_byte_count,
@@ -1011,9 +1005,7 @@
 
     if (HAS_PENDING_EXCEPTION) {
       Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
-      // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
-      RC_TRACE_WITH_THREAD(0x00000002, THREAD, ("parse_stream exception: '%s'",
-        ex_name->as_C_string()));
+      log_info(redefine, class, load, exceptions)("parse_stream exception: '%s'", ex_name->as_C_string());
       CLEAR_PENDING_EXCEPTION;
 
       if (ex_name == vmSymbols::java_lang_UnsupportedClassVersionError()) {
@@ -1037,9 +1029,7 @@
       the_class->link_class(THREAD);
       if (HAS_PENDING_EXCEPTION) {
         Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
-        // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
-        RC_TRACE_WITH_THREAD(0x00000002, THREAD, ("link_class exception: '%s'",
-          ex_name->as_C_string()));
+        log_info(redefine, class, load, exceptions)("link_class exception: '%s'", ex_name->as_C_string());
         CLEAR_PENDING_EXCEPTION;
         if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
           return JVMTI_ERROR_OUT_OF_MEMORY;
@@ -1075,9 +1065,7 @@
 
     if (HAS_PENDING_EXCEPTION) {
       Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
-      // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
-      RC_TRACE_WITH_THREAD(0x00000002, THREAD,
-        ("verify_byte_codes exception: '%s'", ex_name->as_C_string()));
+      log_info(redefine, class, load, exceptions)("verify_byte_codes exception: '%s'", ex_name->as_C_string());
       CLEAR_PENDING_EXCEPTION;
       if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
         return JVMTI_ERROR_OUT_OF_MEMORY;
@@ -1090,9 +1078,7 @@
     res = merge_cp_and_rewrite(the_class, scratch_class, THREAD);
     if (HAS_PENDING_EXCEPTION) {
       Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
-      // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
-      RC_TRACE_WITH_THREAD(0x00000002, THREAD,
-        ("merge_cp_and_rewrite exception: '%s'", ex_name->as_C_string()));
+      log_info(redefine, class, load, exceptions)("merge_cp_and_rewrite exception: '%s'", ex_name->as_C_string());
       CLEAR_PENDING_EXCEPTION;
       if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
         return JVMTI_ERROR_OUT_OF_MEMORY;
@@ -1110,10 +1096,8 @@
 
       if (HAS_PENDING_EXCEPTION) {
         Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
-        // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
-        RC_TRACE_WITH_THREAD(0x00000002, THREAD,
-          ("verify_byte_codes post merge-CP exception: '%s'",
-          ex_name->as_C_string()));
+        log_info(redefine, class, load, exceptions)
+          ("verify_byte_codes post merge-CP exception: '%s'", ex_name->as_C_string());
         CLEAR_PENDING_EXCEPTION;
         if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
           return JVMTI_ERROR_OUT_OF_MEMORY;
@@ -1130,9 +1114,8 @@
     }
     if (HAS_PENDING_EXCEPTION) {
       Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
-      // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
-      RC_TRACE_WITH_THREAD(0x00000002, THREAD,
-        ("Rewriter::rewrite or link_methods exception: '%s'", ex_name->as_C_string()));
+      log_info(redefine, class, load, exceptions)
+        ("Rewriter::rewrite or link_methods exception: '%s'", ex_name->as_C_string());
       CLEAR_PENDING_EXCEPTION;
       if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
         return JVMTI_ERROR_OUT_OF_MEMORY;
@@ -1141,10 +1124,8 @@
       }
     }
 
-    // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
-    RC_TRACE_WITH_THREAD(0x00000001, THREAD,
-      ("loaded name=%s (avail_mem=" UINT64_FORMAT "K)",
-      the_class->external_name(), os::available_memory() >> 10));
+    log_debug(redefine, class, load)
+      ("loaded name=%s (avail_mem=" UINT64_FORMAT "K)", the_class->external_name(), os::available_memory() >> 10);
   }
 
   return JVMTI_ERROR_NONE;
@@ -1152,7 +1133,7 @@
 
 
 // Map old_index to new_index as needed. scratch_cp is only needed
-// for RC_TRACE() calls.
+// for log calls.
 void VM_RedefineClasses::map_index(const constantPoolHandle& scratch_cp,
        int old_index, int new_index) {
   if (find_new_index(old_index) != 0) {
@@ -1168,8 +1149,8 @@
   _index_map_p->at_put(old_index, new_index);
   _index_map_count++;
 
-  RC_TRACE(0x00040000, ("mapped tag %d at index %d to %d",
-    scratch_cp->tag_at(old_index).value(), old_index, new_index));
+  log_trace(redefine, class, constantpool)
+    ("mapped tag %d at index %d to %d", scratch_cp->tag_at(old_index).value(), old_index, new_index);
 } // end map_index()
 
 
@@ -1188,7 +1169,7 @@
   _operands_index_map_p->at_put(old_index, new_index);
   _operands_index_map_count++;
 
-  RC_TRACE(0x00040000, ("mapped bootstrap specifier at index %d to %d", old_index, new_index));
+  log_trace(redefine, class, constantpool)("mapped bootstrap specifier at index %d to %d", old_index, new_index);
 } // end map_index()
 
 
@@ -1219,9 +1200,7 @@
     return false; // robustness
   }
 
-  RC_TRACE_WITH_THREAD(0x00010000, THREAD,
-    ("old_cp_len=%d, scratch_cp_len=%d", old_cp->length(),
-    scratch_cp->length()));
+  log_info(redefine, class, constantpool)("old_cp_len=%d, scratch_cp_len=%d", old_cp->length(), scratch_cp->length());
 
   {
     // Pass 0:
@@ -1273,8 +1252,7 @@
 
   // merge_cp_len should be the same as old_cp->length() at this point
   // so this trace message is really a "warm-and-breathing" message.
-  RC_TRACE_WITH_THREAD(0x00020000, THREAD,
-    ("after pass 0: merge_cp_len=%d", *merge_cp_length_p));
+  log_debug(redefine, class, constantpool)("after pass 0: merge_cp_len=%d", *merge_cp_length_p);
 
   int scratch_i;  // index into scratch_cp
   {
@@ -1339,9 +1317,9 @@
     }
   }
 
-  RC_TRACE_WITH_THREAD(0x00020000, THREAD,
+  log_debug(redefine, class, constantpool)
     ("after pass 1a: merge_cp_len=%d, scratch_i=%d, index_map_len=%d",
-    *merge_cp_length_p, scratch_i, _index_map_count));
+     *merge_cp_length_p, scratch_i, _index_map_count);
 
   if (scratch_i < scratch_cp->length()) {
     // Pass 1b:
@@ -1377,9 +1355,9 @@
         CHECK_0);
     }
 
-    RC_TRACE_WITH_THREAD(0x00020000, THREAD,
+    log_debug(redefine, class, constantpool)
       ("after pass 1b: merge_cp_len=%d, scratch_i=%d, index_map_len=%d",
-      *merge_cp_length_p, scratch_i, _index_map_count));
+       *merge_cp_length_p, scratch_i, _index_map_count);
   }
   finalize_operands_merge(*merge_cp_p, THREAD);
 
@@ -1468,8 +1446,7 @@
     return JVMTI_ERROR_INTERNAL;
   }
 
-  RC_TRACE_WITH_THREAD(0x00010000, THREAD,
-    ("merge_cp_len=%d, index_map_len=%d", merge_cp_length, _index_map_count));
+  log_info(redefine, class, constantpool)("merge_cp_len=%d, index_map_len=%d", merge_cp_length, _index_map_count);
 
   if (_index_map_count == 0) {
     // there is nothing to map between the new and merged constant pools
@@ -1508,15 +1485,14 @@
       cp_cleaner.add_scratch_cp(scratch_cp());
     }
   } else {
-    if (RC_TRACE_ENABLED(0x00040000)) {
+    if (log_is_enabled(Trace, redefine, class, constantpool)) {
       // don't want to loop unless we are tracing
       int count = 0;
       for (int i = 1; i < _index_map_p->length(); i++) {
         int value = _index_map_p->at(i);
 
         if (value != -1) {
-          RC_TRACE_WITH_THREAD(0x00040000, THREAD,
-            ("index_map[%d]: old=%d new=%d", count, i, value));
+          log_trace(redefine, class, constantpool)("index_map[%d]: old=%d new=%d", count, i, value);
           count++;
         }
       }
@@ -1653,9 +1629,7 @@
     }
     if (HAS_PENDING_EXCEPTION) {
       Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
-      // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
-      RC_TRACE_WITH_THREAD(0x00000002, THREAD,
-        ("rewrite_cp_refs_in_method exception: '%s'", ex_name->as_C_string()));
+      log_info(redefine, class, load, exceptions)("rewrite_cp_refs_in_method exception: '%s'", ex_name->as_C_string());
       // Need to clear pending exception here as the super caller sets
       // the JVMTI_ERROR_INTERNAL if the returned value is false.
       CLEAR_PENDING_EXCEPTION;
@@ -1715,14 +1689,12 @@
           if (!StressLdcRewrite && new_index <= max_jubyte) {
             // The new value can still use ldc instead of ldc_w
             // unless we are trying to stress ldc -> ldc_w rewriting
-            RC_TRACE_WITH_THREAD(0x00080000, THREAD,
-              ("%s@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c),
-              p2i(bcp), cp_index, new_index));
+            log_trace(redefine, class, constantpool)
+              ("%s@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c), p2i(bcp), cp_index, new_index);
             *(bcp + 1) = new_index;
           } else {
-            RC_TRACE_WITH_THREAD(0x00080000, THREAD,
-              ("%s->ldc_w@" INTPTR_FORMAT " old=%d, new=%d",
-              Bytecodes::name(c), p2i(bcp), cp_index, new_index));
+            log_trace(redefine, class, constantpool)
+              ("%s->ldc_w@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c), p2i(bcp), cp_index, new_index);
             // the new value needs ldc_w instead of ldc
             u_char inst_buffer[4]; // max instruction size is 4 bytes
             bcp = (address)inst_buffer;
@@ -1781,9 +1753,8 @@
         int new_index = find_new_index(cp_index);
         if (new_index != 0) {
           // the original index is mapped so update w/ new value
-          RC_TRACE_WITH_THREAD(0x00080000, THREAD,
-            ("%s@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c),
-            p2i(bcp), cp_index, new_index));
+          log_trace(redefine, class, constantpool)
+            ("%s@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c),p2i(bcp), cp_index, new_index);
           // Rewriter::rewrite_method() uses put_native_u2() in this
           // situation because it is reusing the constant pool index
           // location for a native index into the ConstantPoolCache.
@@ -1823,8 +1794,7 @@
     return true;
   }
 
-  RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-    ("class_annotations length=%d", class_annotations->length()));
+  log_debug(redefine, class, annotation)("class_annotations length=%d", class_annotations->length());
 
   int byte_i = 0;  // byte index into class_annotations
   return rewrite_cp_refs_in_annotations_typeArray(class_annotations, byte_i,
@@ -1846,8 +1816,7 @@
 
   if ((byte_i_ref + 2) > annotations_typeArray->length()) {
     // not enough room for num_annotations field
-    RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-      ("length() is too small for num_annotations field"));
+    log_debug(redefine, class, annotation)("length() is too small for num_annotations field");
     return false;
   }
 
@@ -1855,15 +1824,13 @@
                          annotations_typeArray->adr_at(byte_i_ref));
   byte_i_ref += 2;
 
-  RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-    ("num_annotations=%d", num_annotations));
+  log_debug(redefine, class, annotation)("num_annotations=%d", num_annotations);
 
   int calc_num_annotations = 0;
   for (; calc_num_annotations < num_annotations; calc_num_annotations++) {
     if (!rewrite_cp_refs_in_annotation_struct(annotations_typeArray,
            byte_i_ref, THREAD)) {
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("bad annotation_struct at %d", calc_num_annotations));
+      log_debug(redefine, class, annotation)("bad annotation_struct at %d", calc_num_annotations);
       // propagate failure back to caller
       return false;
     }
@@ -1891,8 +1858,7 @@
        AnnotationArray* annotations_typeArray, int &byte_i_ref, TRAPS) {
   if ((byte_i_ref + 2 + 2) > annotations_typeArray->length()) {
     // not enough room for smallest annotation_struct
-    RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-      ("length() is too small for annotation_struct"));
+    log_debug(redefine, class, annotation)("length() is too small for annotation_struct");
     return false;
   }
 
@@ -1903,9 +1869,8 @@
                                  annotations_typeArray->adr_at(byte_i_ref));
   byte_i_ref += 2;
 
-  RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-    ("type_index=%d  num_element_value_pairs=%d", type_index,
-    num_element_value_pairs));
+  log_debug(redefine, class, annotation)
+    ("type_index=%d  num_element_value_pairs=%d", type_index, num_element_value_pairs);
 
   int calc_num_element_value_pairs = 0;
   for (; calc_num_element_value_pairs < num_element_value_pairs;
@@ -1913,8 +1878,7 @@
     if ((byte_i_ref + 2) > annotations_typeArray->length()) {
       // not enough room for another element_name_index, let alone
       // the rest of another component
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("length() is too small for element_name_index"));
+      log_debug(redefine, class, annotation)("length() is too small for element_name_index");
       return false;
     }
 
@@ -1922,13 +1886,11 @@
                               annotations_typeArray, byte_i_ref,
                               "element_name_index", THREAD);
 
-    RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-      ("element_name_index=%d", element_name_index));
+    log_debug(redefine, class, annotation)("element_name_index=%d", element_name_index);
 
     if (!rewrite_cp_refs_in_element_value(annotations_typeArray,
            byte_i_ref, THREAD)) {
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("bad element_value at %d", calc_num_element_value_pairs));
+      log_debug(redefine, class, annotation)("bad element_value at %d", calc_num_element_value_pairs);
       // propagate failure back to caller
       return false;
     }
@@ -1953,7 +1915,7 @@
   u2 old_cp_index = Bytes::get_Java_u2(cp_index_addr);
   u2 new_cp_index = find_new_index(old_cp_index);
   if (new_cp_index != 0) {
-    RC_TRACE_WITH_THREAD(0x02000000, THREAD, ("mapped old %s=%d", trace_mesg, old_cp_index));
+    log_debug(redefine, class, annotation)("mapped old %s=%d", trace_mesg, old_cp_index);
     Bytes::put_Java_u2(cp_index_addr, new_cp_index);
     old_cp_index = new_cp_index;
   }
@@ -1988,14 +1950,13 @@
 
   if ((byte_i_ref + 1) > annotations_typeArray->length()) {
     // not enough room for a tag let alone the rest of an element_value
-    RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-      ("length() is too small for a tag"));
+    log_debug(redefine, class, annotation)("length() is too small for a tag");
     return false;
   }
 
   u1 tag = annotations_typeArray->at(byte_i_ref);
   byte_i_ref++;
-  RC_TRACE_WITH_THREAD(0x02000000, THREAD, ("tag='%c'", tag));
+  log_debug(redefine, class, annotation)("tag='%c'", tag);
 
   switch (tag) {
     // These BaseType tag values are from Table 4.2 in VM spec:
@@ -2017,8 +1978,7 @@
 
       if ((byte_i_ref + 2) > annotations_typeArray->length()) {
         // not enough room for a const_value_index
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("length() is too small for a const_value_index"));
+        log_debug(redefine, class, annotation)("length() is too small for a const_value_index");
         return false;
       }
 
@@ -2026,8 +1986,7 @@
                                annotations_typeArray, byte_i_ref,
                                "const_value_index", THREAD);
 
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("const_value_index=%d", const_value_index));
+      log_debug(redefine, class, annotation)("const_value_index=%d", const_value_index);
     } break;
 
     case 'e':
@@ -2036,8 +1995,7 @@
 
       if ((byte_i_ref + 4) > annotations_typeArray->length()) {
         // not enough room for a enum_const_value
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("length() is too small for a enum_const_value"));
+        log_debug(redefine, class, annotation)("length() is too small for a enum_const_value");
         return false;
       }
 
@@ -2049,9 +2007,8 @@
                               annotations_typeArray, byte_i_ref,
                               "const_name_index", THREAD);
 
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("type_name_index=%d  const_name_index=%d", type_name_index,
-        const_name_index));
+      log_debug(redefine, class, annotation)
+        ("type_name_index=%d  const_name_index=%d", type_name_index, const_name_index);
     } break;
 
     case 'c':
@@ -2060,8 +2017,7 @@
 
       if ((byte_i_ref + 2) > annotations_typeArray->length()) {
         // not enough room for a class_info_index
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("length() is too small for a class_info_index"));
+        log_debug(redefine, class, annotation)("length() is too small for a class_info_index");
         return false;
       }
 
@@ -2069,8 +2025,7 @@
                               annotations_typeArray, byte_i_ref,
                               "class_info_index", THREAD);
 
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("class_info_index=%d", class_info_index));
+      log_debug(redefine, class, annotation)("class_info_index=%d", class_info_index);
     } break;
 
     case '@':
@@ -2087,8 +2042,7 @@
     {
       if ((byte_i_ref + 2) > annotations_typeArray->length()) {
         // not enough room for a num_values field
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("length() is too small for a num_values field"));
+        log_debug(redefine, class, annotation)("length() is too small for a num_values field");
         return false;
       }
 
@@ -2097,14 +2051,13 @@
       u2 num_values = Bytes::get_Java_u2((address)
                         annotations_typeArray->adr_at(byte_i_ref));
       byte_i_ref += 2;
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD, ("num_values=%d", num_values));
+      log_debug(redefine, class, annotation)("num_values=%d", num_values);
 
       int calc_num_values = 0;
       for (; calc_num_values < num_values; calc_num_values++) {
         if (!rewrite_cp_refs_in_element_value(
                annotations_typeArray, byte_i_ref, THREAD)) {
-          RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-            ("bad nested element_value at %d", calc_num_values));
+          log_debug(redefine, class, annotation)("bad nested element_value at %d", calc_num_values);
           // propagate failure back to caller
           return false;
         }
@@ -2113,7 +2066,7 @@
     } break;
 
     default:
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD, ("bad tag=0x%x", tag));
+      log_debug(redefine, class, annotation)("bad tag=0x%x", tag);
       return false;
   } // end decode tag field
 
@@ -2132,8 +2085,7 @@
     return true;
   }
 
-  RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-    ("fields_annotations length=%d", fields_annotations->length()));
+  log_debug(redefine, class, annotation)("fields_annotations length=%d", fields_annotations->length());
 
   for (int i = 0; i < fields_annotations->length(); i++) {
     AnnotationArray* field_annotations = fields_annotations->at(i);
@@ -2145,8 +2097,7 @@
     int byte_i = 0;  // byte index into field_annotations
     if (!rewrite_cp_refs_in_annotations_typeArray(field_annotations, byte_i,
            THREAD)) {
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("bad field_annotations at %d", i));
+      log_debug(redefine, class, annotation)("bad field_annotations at %d", i);
       // propagate failure back to caller
       return false;
     }
@@ -2172,8 +2123,7 @@
     int byte_i = 0;  // byte index into method_annotations
     if (!rewrite_cp_refs_in_annotations_typeArray(method_annotations, byte_i,
            THREAD)) {
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("bad method_annotations at %d", i));
+      log_debug(redefine, class, annotation)("bad method_annotations at %d", i);
       // propagate failure back to caller
       return false;
     }
@@ -2210,8 +2160,7 @@
 
     if (method_parameter_annotations->length() < 1) {
       // not enough room for a num_parameters field
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("length() is too small for a num_parameters field at %d", i));
+      log_debug(redefine, class, annotation)("length() is too small for a num_parameters field at %d", i);
       return false;
     }
 
@@ -2220,15 +2169,13 @@
     u1 num_parameters = method_parameter_annotations->at(byte_i);
     byte_i++;
 
-    RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-      ("num_parameters=%d", num_parameters));
+    log_debug(redefine, class, annotation)("num_parameters=%d", num_parameters);
 
     int calc_num_parameters = 0;
     for (; calc_num_parameters < num_parameters; calc_num_parameters++) {
       if (!rewrite_cp_refs_in_annotations_typeArray(
              method_parameter_annotations, byte_i, THREAD)) {
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("bad method_parameter_annotations at %d", calc_num_parameters));
+        log_debug(redefine, class, annotation)("bad method_parameter_annotations at %d", calc_num_parameters);
         // propagate failure back to caller
         return false;
       }
@@ -2264,8 +2211,7 @@
 
     if (!rewrite_cp_refs_in_element_value(
            method_default_annotations, byte_i, THREAD)) {
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("bad default element_value at %d", i));
+      log_debug(redefine, class, annotation)("bad default element_value at %d", i);
       // propagate failure back to caller
       return false;
     }
@@ -2285,8 +2231,7 @@
     return true;
   }
 
-  RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-    ("class_type_annotations length=%d", class_type_annotations->length()));
+  log_debug(redefine, class, annotation)("class_type_annotations length=%d", class_type_annotations->length());
 
   int byte_i = 0;  // byte index into class_type_annotations
   return rewrite_cp_refs_in_type_annotations_typeArray(class_type_annotations,
@@ -2304,8 +2249,7 @@
     return true;
   }
 
-  RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-    ("fields_type_annotations length=%d", fields_type_annotations->length()));
+  log_debug(redefine, class, annotation)("fields_type_annotations length=%d", fields_type_annotations->length());
 
   for (int i = 0; i < fields_type_annotations->length(); i++) {
     AnnotationArray* field_type_annotations = fields_type_annotations->at(i);
@@ -2317,8 +2261,7 @@
     int byte_i = 0;  // byte index into field_type_annotations
     if (!rewrite_cp_refs_in_type_annotations_typeArray(field_type_annotations,
            byte_i, "field_info", THREAD)) {
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("bad field_type_annotations at %d", i));
+      log_debug(redefine, class, annotation)("bad field_type_annotations at %d", i);
       // propagate failure back to caller
       return false;
     }
@@ -2341,14 +2284,12 @@
       continue;
     }
 
-    RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("methods type_annotations length=%d", method_type_annotations->length()));
+    log_debug(redefine, class, annotation)("methods type_annotations length=%d", method_type_annotations->length());
 
     int byte_i = 0;  // byte index into method_type_annotations
     if (!rewrite_cp_refs_in_type_annotations_typeArray(method_type_annotations,
            byte_i, "method_info", THREAD)) {
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("bad method_type_annotations at %d", i));
+      log_debug(redefine, class, annotation)("bad method_type_annotations at %d", i);
       // propagate failure back to caller
       return false;
     }
@@ -2374,8 +2315,7 @@
 
   if ((byte_i_ref + 2) > type_annotations_typeArray->length()) {
     // not enough room for num_annotations field
-    RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-      ("length() is too small for num_annotations field"));
+    log_debug(redefine, class, annotation)("length() is too small for num_annotations field");
     return false;
   }
 
@@ -2383,15 +2323,13 @@
                          type_annotations_typeArray->adr_at(byte_i_ref));
   byte_i_ref += 2;
 
-  RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-    ("num_type_annotations=%d", num_annotations));
+  log_debug(redefine, class, annotation)("num_type_annotations=%d", num_annotations);
 
   int calc_num_annotations = 0;
   for (; calc_num_annotations < num_annotations; calc_num_annotations++) {
     if (!rewrite_cp_refs_in_type_annotation_struct(type_annotations_typeArray,
            byte_i_ref, location_mesg, THREAD)) {
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("bad type_annotation_struct at %d", calc_num_annotations));
+      log_debug(redefine, class, annotation)("bad type_annotation_struct at %d", calc_num_annotations);
       // propagate failure back to caller
       return false;
     }
@@ -2399,10 +2337,9 @@
   assert(num_annotations == calc_num_annotations, "sanity check");
 
   if (byte_i_ref != type_annotations_typeArray->length()) {
-    RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-      ("read wrong amount of bytes at end of processing "
-       "type_annotations_typeArray (%d of %d bytes were read)",
-       byte_i_ref, type_annotations_typeArray->length()));
+    log_debug(redefine, class, annotation)
+      ("read wrong amount of bytes at end of processing type_annotations_typeArray (%d of %d bytes were read)",
+       byte_i_ref, type_annotations_typeArray->length());
     return false;
   }
 
@@ -2479,15 +2416,14 @@
 
   if ((byte_i_ref + 1) > type_annotations_typeArray->length()) {
     // not enough room for a target_type let alone the rest of a type_annotation
-    RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-      ("length() is too small for a target_type"));
+    log_debug(redefine, class, annotation)("length() is too small for a target_type");
     return false;
   }
 
   u1 target_type = type_annotations_typeArray->at(byte_i_ref);
   byte_i_ref += 1;
-  RC_TRACE_WITH_THREAD(0x02000000, THREAD, ("target_type=0x%.2x", target_type));
-  RC_TRACE_WITH_THREAD(0x02000000, THREAD, ("location=%s", location_mesg));
+  log_debug(redefine, class, annotation)("target_type=0x%.2x", target_type);
+  log_debug(redefine, class, annotation)("location=%s", location_mesg);
 
   // Skip over target_info
   switch (target_type) {
@@ -2505,17 +2441,14 @@
       // }
       //
       if ((byte_i_ref + 1) > type_annotations_typeArray->length()) {
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("length() is too small for a type_parameter_target"));
+        log_debug(redefine, class, annotation)("length() is too small for a type_parameter_target");
         return false;
       }
 
       u1 type_parameter_index = type_annotations_typeArray->at(byte_i_ref);
       byte_i_ref += 1;
 
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("type_parameter_target: type_parameter_index=%d",
-         type_parameter_index));
+      log_debug(redefine, class, annotation)("type_parameter_target: type_parameter_index=%d", type_parameter_index);
     } break;
 
     case 0x10:
@@ -2531,8 +2464,7 @@
       // }
       //
       if ((byte_i_ref + 2) > type_annotations_typeArray->length()) {
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("length() is too small for a supertype_target"));
+        log_debug(redefine, class, annotation)("length() is too small for a supertype_target");
         return false;
       }
 
@@ -2540,8 +2472,7 @@
                              type_annotations_typeArray->adr_at(byte_i_ref));
       byte_i_ref += 2;
 
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("supertype_target: supertype_index=%d", supertype_index));
+      log_debug(redefine, class, annotation)("supertype_target: supertype_index=%d", supertype_index);
     } break;
 
     case 0x11:
@@ -2559,8 +2490,7 @@
       // }
       //
       if ((byte_i_ref + 2) > type_annotations_typeArray->length()) {
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("length() is too small for a type_parameter_bound_target"));
+        log_debug(redefine, class, annotation)("length() is too small for a type_parameter_bound_target");
         return false;
       }
 
@@ -2569,9 +2499,8 @@
       u1 bound_index = type_annotations_typeArray->at(byte_i_ref);
       byte_i_ref += 1;
 
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("type_parameter_bound_target: type_parameter_index=%d, bound_index=%d",
-         type_parameter_index, bound_index));
+      log_debug(redefine, class, annotation)
+        ("type_parameter_bound_target: type_parameter_index=%d, bound_index=%d", type_parameter_index, bound_index);
     } break;
 
     case 0x13:
@@ -2589,8 +2518,7 @@
       // empty_target {
       // }
       //
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("empty_target"));
+      log_debug(redefine, class, annotation)("empty_target");
     } break;
 
     case 0x16:
@@ -2604,17 +2532,15 @@
       // }
       //
       if ((byte_i_ref + 1) > type_annotations_typeArray->length()) {
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("length() is too small for a formal_parameter_target"));
+        log_debug(redefine, class, annotation)("length() is too small for a formal_parameter_target");
         return false;
       }
 
       u1 formal_parameter_index = type_annotations_typeArray->at(byte_i_ref);
       byte_i_ref += 1;
 
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("formal_parameter_target: formal_parameter_index=%d",
-         formal_parameter_index));
+      log_debug(redefine, class, annotation)
+        ("formal_parameter_target: formal_parameter_index=%d", formal_parameter_index);
     } break;
 
     case 0x17:
@@ -2628,8 +2554,7 @@
       // }
       //
       if ((byte_i_ref + 2) > type_annotations_typeArray->length()) {
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("length() is too small for a throws_target"));
+        log_debug(redefine, class, annotation)("length() is too small for a throws_target");
         return false;
       }
 
@@ -2637,8 +2562,7 @@
                                type_annotations_typeArray->adr_at(byte_i_ref));
       byte_i_ref += 2;
 
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("throws_target: throws_type_index=%d", throws_type_index));
+      log_debug(redefine, class, annotation)("throws_target: throws_type_index=%d", throws_type_index);
     } break;
 
     case 0x40:
@@ -2661,8 +2585,7 @@
       //
       if ((byte_i_ref + 2) > type_annotations_typeArray->length()) {
         // not enough room for a table_length let alone the rest of a localvar_target
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("length() is too small for a localvar_target table_length"));
+        log_debug(redefine, class, annotation)("length() is too small for a localvar_target table_length");
         return false;
       }
 
@@ -2670,16 +2593,14 @@
                           type_annotations_typeArray->adr_at(byte_i_ref));
       byte_i_ref += 2;
 
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("localvar_target: table_length=%d", table_length));
+      log_debug(redefine, class, annotation)("localvar_target: table_length=%d", table_length);
 
       int table_struct_size = 2 + 2 + 2; // 3 u2 variables per table entry
       int table_size = table_length * table_struct_size;
 
       if ((byte_i_ref + table_size) > type_annotations_typeArray->length()) {
         // not enough room for a table
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("length() is too small for a table array of length %d", table_length));
+        log_debug(redefine, class, annotation)("length() is too small for a table array of length %d", table_length);
         return false;
       }
 
@@ -2698,8 +2619,7 @@
       // }
       //
       if ((byte_i_ref + 2) > type_annotations_typeArray->length()) {
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("length() is too small for a catch_target"));
+        log_debug(redefine, class, annotation)("length() is too small for a catch_target");
         return false;
       }
 
@@ -2707,8 +2627,7 @@
                                    type_annotations_typeArray->adr_at(byte_i_ref));
       byte_i_ref += 2;
 
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("catch_target: exception_table_index=%d", exception_table_index));
+      log_debug(redefine, class, annotation)("catch_target: exception_table_index=%d", exception_table_index);
     } break;
 
     case 0x43:
@@ -2731,8 +2650,7 @@
       // }
       //
       if ((byte_i_ref + 2) > type_annotations_typeArray->length()) {
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("length() is too small for a offset_target"));
+        log_debug(redefine, class, annotation)("length() is too small for a offset_target");
         return false;
       }
 
@@ -2740,8 +2658,7 @@
                     type_annotations_typeArray->adr_at(byte_i_ref));
       byte_i_ref += 2;
 
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("offset_target: offset=%d", offset));
+      log_debug(redefine, class, annotation)("offset_target: offset=%d", offset);
     } break;
 
     case 0x47:
@@ -2769,8 +2686,7 @@
       // }
       //
       if ((byte_i_ref + 3) > type_annotations_typeArray->length()) {
-        RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-          ("length() is too small for a type_argument_target"));
+        log_debug(redefine, class, annotation)("length() is too small for a type_argument_target");
         return false;
       }
 
@@ -2780,14 +2696,12 @@
       u1 type_argument_index = type_annotations_typeArray->at(byte_i_ref);
       byte_i_ref += 1;
 
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("type_argument_target: offset=%d, type_argument_index=%d",
-         offset, type_argument_index));
+      log_debug(redefine, class, annotation)
+        ("type_argument_target: offset=%d, type_argument_index=%d", offset, type_argument_index);
     } break;
 
     default:
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("unknown target_type"));
+      log_debug(redefine, class, annotation)("unknown target_type");
 #ifdef ASSERT
       ShouldNotReachHere();
 #endif
@@ -2814,24 +2728,21 @@
 
   if ((byte_i_ref + 1) > type_annotations_typeArray->length()) {
     // not enough room for a path_length let alone the rest of the type_path
-    RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-      ("length() is too small for a type_path"));
+    log_debug(redefine, class, annotation)("length() is too small for a type_path");
     return false;
   }
 
   u1 path_length = type_annotations_typeArray->at(byte_i_ref);
   byte_i_ref += 1;
 
-  RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-    ("type_path: path_length=%d", path_length));
+  log_debug(redefine, class, annotation)("type_path: path_length=%d", path_length);
 
   int calc_path_length = 0;
   for (; calc_path_length < path_length; calc_path_length++) {
     if ((byte_i_ref + 1 + 1) > type_annotations_typeArray->length()) {
       // not enough room for a path
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("length() is too small for path entry %d of %d",
-         calc_path_length, path_length));
+      log_debug(redefine, class, annotation)
+        ("length() is too small for path entry %d of %d", calc_path_length, path_length);
       return false;
     }
 
@@ -2840,14 +2751,13 @@
     u1 type_argument_index = type_annotations_typeArray->at(byte_i_ref);
     byte_i_ref += 1;
 
-    RC_TRACE_WITH_THREAD(0x02000000, THREAD,
+    log_debug(redefine, class, annotation)
       ("type_path: path[%d]: type_path_kind=%d, type_argument_index=%d",
-       calc_path_length, type_path_kind, type_argument_index));
+       calc_path_length, type_path_kind, type_argument_index);
 
     if (type_path_kind > 3 || (type_path_kind != 3 && type_argument_index != 0)) {
       // not enough room for a path
-      RC_TRACE_WITH_THREAD(0x02000000, THREAD,
-        ("inconsistent type_path values"));
+      log_debug(redefine, class, annotation)("inconsistent type_path values");
       return false;
     }
   }
@@ -2883,8 +2793,7 @@
   u2 number_of_entries = Bytes::get_Java_u2(stackmap_p);
   stackmap_p += 2;
 
-  RC_TRACE_WITH_THREAD(0x04000000, THREAD,
-    ("number_of_entries=%u", number_of_entries));
+  log_debug(redefine, class, stackmap)("number_of_entries=%u", number_of_entries);
 
   // walk through each stack_map_frame
   u2 calc_number_of_entries = 0;
@@ -3084,16 +2993,14 @@
     u2 cpool_index = Bytes::get_Java_u2(stackmap_p_ref);
     u2 new_cp_index = find_new_index(cpool_index);
     if (new_cp_index != 0) {
-      RC_TRACE_WITH_THREAD(0x04000000, THREAD,
-        ("mapped old cpool_index=%d", cpool_index));
+      log_debug(redefine, class, stackmap)("mapped old cpool_index=%d", cpool_index);
       Bytes::put_Java_u2(stackmap_p_ref, new_cp_index);
       cpool_index = new_cp_index;
     }
     stackmap_p_ref += 2;
 
-    RC_TRACE_WITH_THREAD(0x04000000, THREAD,
-      ("frame_i=%u, frame_type=%u, cpool_index=%d", frame_i,
-      frame_type, cpool_index));