changeset 13537:0558ee756220

Merge
author lana
date Thu, 21 Jan 2016 10:17:21 -0800
parents 8a709c82d16c d354886acd3f
children 234ae9640837 3b8b58b67559
files src/java.base/share/classes/java/lang/invoke/DontInline.java src/java.base/share/classes/java/lang/invoke/ForceInline.java src/java.base/share/classes/java/lang/invoke/Stable.java src/java.base/share/classes/sun/invoke/anon/AnonymousClassLoader.java src/java.base/share/classes/sun/invoke/anon/ConstantPoolParser.java src/java.base/share/classes/sun/invoke/anon/ConstantPoolPatch.java src/java.base/share/classes/sun/invoke/anon/ConstantPoolVisitor.java src/java.base/share/classes/sun/invoke/anon/InvalidConstantPoolFormatException.java src/java.base/share/classes/sun/misc/ClassFileTransformer.java test/sun/invoke/anon/ConstantPoolPatch/OptimalMapSize.java
diffstat 358 files changed, 6632 insertions(+), 5517 deletions(-) [+]
line wrap: on
line diff
--- a/make/CompileDemos.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/CompileDemos.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -38,7 +38,8 @@
 include ZipArchive.gmk
 
 # Prepare the find cache.
-$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src))
+$(eval $(call FillCacheFind, $(wildcard $(JDK_TOPDIR)/src/demo \
+    $(JDK_TOPDIR)/src/*/demo)))
 
 # Append demo goals to this variable.
 TARGETS =
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/CompileTools.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -0,0 +1,83 @@
+#
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# 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
+include JavaCompilation.gmk
+include SetupJavaCompilers.gmk
+
+################################################################################
+
+JIMAGE_PKGS := \
+    jdk/internal/jimage \
+    jdk/internal/jrtfs \
+    #
+
+$(eval $(call SetupJavaCompilation,BUILD_INTERIM_JIMAGE, \
+    SETUP := GENERATE_OLDBYTECODE, \
+    SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \
+    INCLUDES := $(JIMAGE_PKGS), \
+    BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes))
+
+TARGETS += $(BUILD_INTERIM_JIMAGE)
+
+# Because of the explicit INCLUDES in the compilation setup above, the service provider
+# file will not be copied unless META-INF/services would also be added to the INCLUDES.
+# Adding META-INF/services would include all files in that directory when only the one
+# is needed, which is why this explicit copy is defined instead.
+$(eval $(call SetupCopyFiles,COPY_JIMAGE_SERVICE_PROVIDER, \
+    SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \
+    DEST := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes, \
+    FILES := META-INF/services/java.nio.file.spi.FileSystemProvider))
+
+TARGETS += $(COPY_JIMAGE_SERVICE_PROVIDER)
+
+################################################################################
+
+$(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \
+    SETUP := GENERATE_OLDBYTECODE, \
+    ADD_JAVAC_FLAGS := -Xbootclasspath/p:$(call PathList, \
+        $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes \
+        $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes), \
+    SRC := $(JDK_TOPDIR)/make/src/classes $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes, \
+    BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
+    COPY := boot.modules ext.modules))
+
+$(BUILD_TOOLS_JDK): $(BUILD_INTERIM_JIMAGE) $(COPY_JIMAGE_SERVICE_PROVIDER)
+
+TARGETS += $(BUILD_TOOLS_JDK)
+
+$(eval $(call SetupCopyFiles,COPY_NIMBUS_TEMPLATES, \
+    SRC := $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus, \
+    DEST := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes/build/tools/generatenimbus/resources, \
+    FILES := $(wildcard $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus/*.template)))
+
+TARGETS += $(COPY_NIMBUS_TEMPLATES)
+
+################################################################################
+
+all: $(TARGETS)
--- a/make/CopySamples.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/CopySamples.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -28,41 +28,38 @@
 include $(SPEC)
 include MakeBase.gmk
 
+################################################################################
+
 SAMPLE_TARGET_DIR := $(SUPPORT_OUTPUTDIR)/sample/image
 SAMPLE_SOURCE_DIR := $(JDK_TOPDIR)/src/sample/share
-SAMPLE_CLOSED_SOURCE_DIR := $(JDK_TOPDIR)/src/closed/sample/share
 SAMPLE_SOLARIS_SOURCE_DIR := $(JDK_TOPDIR)/src/sample/solaris
 
 # Exclude the vm directory
-SAMPLE_FIND_FILTER := -name vm -prune -o
+$(eval $(call SetupCopyFiles, COPY_SHARE_SAMPLES, \
+    SRC := $(SAMPLE_SOURCE_DIR), \
+    DEST := $(SAMPLE_TARGET_DIR), \
+    FILES := $(filter-out $(SAMPLE_SOURCE_DIR)/vm/%, \
+        $(call CacheFind, $(SAMPLE_SOURCE_DIR))), \
+))
 
-SAMPLE_SOURCE := $(shell $(FIND) $(SAMPLE_SOURCE_DIR) $(SAMPLE_FIND_FILTER) -type f -print)
-SAMPLE_TARGET := $(subst $(SAMPLE_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_SOURCE))
+TARGETS += $(COPY_SHARE_SAMPLES)
 
-ifndef OPENJDK
-# Exclude Main.java in EbayClient dir
-  SAMPLE_CLOSED_SOURCE := $(shell $(FIND) $(SAMPLE_CLOSED_SOURCE_DIR) -type f -print | $(GREP) -v EbayClient/Main.java)
-  SAMPLE_CLOSED_TARGET := $(subst $(SAMPLE_CLOSED_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_CLOSED_SOURCE))
-  SAMPLE_TARGET += $(SAMPLE_CLOSED_TARGET)
+ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris macosx))
+  $(eval $(call SetupCopyFiles, COPY_SOLARIS_SAMPLES, \
+      SRC := $(SAMPLE_SOLARIS_SOURCE_DIR), \
+      DEST := $(SAMPLE_TARGET_DIR), \
+      FILES := $(call CacheFind, $(SAMPLE_SOLARIS_SOURCE_DIR)), \
+  ))
+
+  TARGETS += $(COPY_SOLARIS_SAMPLES)
 endif
 
-ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris macosx))
-  SAMPLE_SOLARIS_SOURCE := $(shell $(FIND) $(SAMPLE_SOLARIS_SOURCE_DIR) -type f -print)
-  SAMPLE_SOLARIS_TARGET := $(subst $(SAMPLE_SOLARIS_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_SOLARIS_SOURCE))
-  SAMPLE_TARGET += $(SAMPLE_SOLARIS_TARGET)
-endif
+################################################################################
 
-$(SAMPLE_TARGET_DIR)/dtrace/%: $(SAMPLE_SOLARIS_SOURCE_DIR)/dtrace/%
-	$(call install-file)
+$(eval $(call IncludeCustomExtension, jdk, CopySamples.gmk))
 
-$(SAMPLE_TARGET_DIR)/webservices/%: $(SAMPLE_CLOSED_SOURCE_DIR)/webservices/%
-	$(call install-file)
+################################################################################
 
-$(SAMPLE_TARGET_DIR)/%: $(SAMPLE_SOURCE_DIR)/%
-	$(call install-file)
+all: $(TARGETS)
 
-COPY_FILES += $(SAMPLE_TARGET)
-
-all: $(COPY_FILES)
-
-.PHONY: all
+.PHONY: all default
--- a/make/Import.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/Import.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -48,7 +48,7 @@
 ifneq ($(STATIC_BUILD), true)
   JSIG_IMPORT = jsig.*
 else
-  JSIG_IMPORT = 
+  JSIG_IMPORT =
 endif
 
 HOTSPOT_BASE_IMPORT_FILES := \
--- a/make/Tools.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/Tools.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -26,31 +26,14 @@
 ifndef _TOOLS_GMK
 _TOOLS_GMK := 1
 
-default: all
-
-include $(SPEC)
-include MakeBase.gmk
 include JavaCompilation.gmk
-include NativeCompilation.gmk
-include SetupJavaCompilers.gmk
 
 ################################################################################
-
-$(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \
-    SETUP := GENERATE_OLDBYTECODE, \
-    ADD_JAVAC_FLAGS := -Xbootclasspath/p:$(call PathList, \
-        $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes \
-        $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes), \
-    SRC := $(JDK_TOPDIR)/make/src/classes $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes, \
-    BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
-    COPY := boot.modules ext.modules))
-
-$(eval $(call SetupCopyFiles,COPY_NIMBUS_TEMPLATES, \
-    SRC := $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus, \
-    DEST := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes/build/tools/generatenimbus/resources, \
-    FILES := $(wildcard $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus/*.template)))
-
-BUILD_TOOLS_JDK += $(COPY_NIMBUS_TEMPLATES)
+# To avoid reevaluating the compilation setup for the tools each time this file
+# is included, the actual compilation is handled by CompileTools.gmk. The
+# following trick is used to be able to declare a dependency on the built tools.
+BUILD_TOOLS_JDK := $(call SetupJavaCompilationCompileTarget, \
+    BUILD_TOOLS_JDK, $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes)
 
 ################################################################################
 
@@ -135,34 +118,4 @@
     -cp $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes $(JDK_OUTPUTDIR)) \
     build.tools.module.ImageBuilder
 
-##########################################################################################
-
-JIMAGE_PKGS := \
-    jdk/internal/jimage \
-    jdk/internal/jrtfs \
-    #
-
-$(eval $(call SetupJavaCompilation,BUILD_INTERIM_JIMAGE, \
-    SETUP := GENERATE_OLDBYTECODE, \
-    SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \
-    INCLUDES := $(JIMAGE_PKGS), \
-    BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes))
-
-# Because of the explicit INCLUDES in the compilation setup above, the service provider
-# file will not be copied unless META-INF/services would also be added to the INCLUDES.
-# Adding META-INF/services would include all files in that directory when only the one
-# is needed, which is why this explicit copy is defined instead.
-$(eval $(call SetupCopyFiles,COPY_JIMAGE_SERVICE_PROVIDER, \
-    SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \
-    DEST := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes, \
-    FILES := META-INF/services/java.nio.file.spi.FileSystemProvider))
-
-##########################################################################################
-
-$(BUILD_TOOLS_JDK): $(BUILD_INTERIM_JIMAGE) $(COPY_JIMAGE_SERVICE_PROVIDER)
-
-java-tools: $(BUILD_TOOLS_JDK)
-
-all: java-tools
-
 endif # _TOOLS_GMK
--- a/make/copy/Copy-java.base.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/copy/Copy-java.base.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -187,27 +187,31 @@
 ifeq ($(CACERTS_FILE), )
   CACERTS_FILE := $(JDK_TOPDIR)/src/java.base/share/conf/security/cacerts
 endif
+
 CACERTS_DST := $(LIB_DST_DIR)/security/cacerts
 
 $(CACERTS_DST): $(CACERTS_FILE)
+	$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%, %, $@))
 	$(call install-file)
 
 TARGETS += $(CACERTS_DST)
 
 ################################################################################
 
-$(CONF_DST_DIR)/net.properties: $(JDK_TOPDIR)/src/java.base/share/conf/net.properties
-	$(ECHO) $(LOG_INFO) Copying $(@F)
-	$(call install-file)
+$(eval $(call SetupCopyFiles, COPY_NET_PROPERTIES, \
+    FILES := $(JDK_TOPDIR)/src/java.base/share/conf/net.properties, \
+    DEST := $(CONF_DST_DIR), \
+))
 
-TARGETS += $(CONF_DST_DIR)/net.properties
+TARGETS += $(COPY_NET_PROPERTIES)
 
 ifeq ($(OPENJDK_TARGET_OS), solaris)
-  $(CONF_DST_DIR)/sdp/sdp.conf.template: $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/sdp/sdp.conf.template
-	$(ECHO) $(LOG_INFO) Copying $(@F)
-	$(call install-file)
+  $(eval $(call SetupCopyFiles, COPY_SDP_CONF, \
+      FILES := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/sdp/sdp.conf.template, \
+      DEST := $(CONF_DST_DIR)/sdp, \
+  ))
 
-  TARGETS += $(CONF_DST_DIR)/sdp/sdp.conf.template
+  TARGETS += $(COPY_SDP_CONF)
 endif
 
 ################################################################################
--- a/make/data/blacklistedcertsconverter/blacklisted.certs.pem	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/data/blacklistedcertsconverter/blacklisted.certs.pem	Thu Jan 21 10:17:21 2016 -0800
@@ -725,3 +725,26 @@
 DBabJH1vJ9Gd+KwxMCmBZ6pQPl28JDimhJhI2LNqU349uADQVV0HJosddN/ARyyI
 LSIQO7BnNVKVG9Iujf33bvPNeg0qNz5qw+rKKq97Pqeum+L5oKU=
 -----END CERTIFICATE-----
+
+// Subject: CN=eDellRoot
+// Issuer: CN=eDellRoot
+// Serial Number:
+//     6b:c5:7b:95:18:93:aa:97:4b:62:4a:c0:88:fc:3b:b6
+-----BEGIN CERTIFICATE-----
+MIIC8zCCAd+gAwIBAgIQa8V7lRiTqpdLYkrAiPw7tjAJBgUrDgMCHQUAMBQxEjAQ
+BgNVBAMTCWVEZWxsUm9vdDAeFw0xNTA0MDcxMDIzMjdaFw0zOTEyMzEyMzU5NTla
+MBQxEjAQBgNVBAMTCWVEZWxsUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
+AQoCggEBAL3RJg1uzVuEX0Hw4XWGzs6oI9W+o7HZdVdBMMVb4Gzb4uZjCTNjbPx4
+b8LNFL1uArUt+5VVMQDsOTY3Lg/Xe/UNukY2b+0llUOzzBYYpbsFcco4n6SsTvDh
+Ni5t+kPo7c23ZrYBPmOu82eEJ6cavs/t39u+wFOkXXwvRCiHA/lWyNWNEPh17+bC
+EP3q5N+JrV+6Ho3zQPEv5QUJYdmXsMmD2CMQojeQUj68J91P5w5BKjurG0xjivzh
+Soie9ym7VRwLFjWScRuw/9XV6CLqTyL5xrqiiDp1uTOuqNj3uxyts9ocbsoJXuxj
+5iEYkSM1nvLupEv+lgy9WqzIEFMm1l8CAwEAAaNJMEcwRQYDVR0BBD4wPIAQYA/f
+EzPwmaRcZuSaa/VZ1KEWMBQxEjAQBgNVBAMTCWVEZWxsUm9vdIIQa8V7lRiTqpdL
+YkrAiPw7tjAJBgUrDgMCHQUAA4IBAQArfdcScsezj8ooJ92UwwnPgg36noOgiUs5
+XzPLP4h0JpUYQVKB9hY1WTDwRUfTKGh7oNOowd027a/rVSb/TNeoiJIvMKn4gbvV
+CWAiHhO8u2u0RkHCDVsa7e0i4ncpueWsihjn6jBrY8T+7eDYwiFT/F03A8NJ7mK5
+lZA8SFd5CTDy3EBUU5UwzXUc5HoIRUxXSPycu3aIBWawg3sCdKiAoikScPAWj0bM
+0vmsP/8QSlTOBqO+QFQ6R82BtTvBNU3qbVICV4QObsxib++FAFL56NApPqskg7Vz
+LfNIAjKabHUcjbuZkmg6jr4BfYW7+oQDHCsYgADjjKGdKz/8U/fP
+-----END CERTIFICATE-----
--- a/make/gendata/GendataBreakIterator.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gendata/GendataBreakIterator.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -68,8 +68,8 @@
 $(BIFILES): $(BASE_DATA_PKG_DIR)/_the.bifiles
 $(BASE_DATA_PKG_DIR)/_the.bifiles: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES)
 $(BASE_DATA_PKG_DIR)/_the.bifiles: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR)
-	$(ECHO) $(LOG_INFO) "Generating BreakIteratorData"
-	$(MKDIR) -p $(@D)
+	$(call LogInfo, Generating BreakIteratorData)
+	$(call MakeDir, $(@D))
 	$(RM) $(BIFILES)
 	$(TOOL_GENERATEBREAKITERATORDATA) \
 	    -o $(@D) \
@@ -79,8 +79,8 @@
 $(BIFILES_TH): $(LD_DATA_PKG_DIR)/_the.bifiles_th
 $(LD_DATA_PKG_DIR)/_the.bifiles_th: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES)
 $(LD_DATA_PKG_DIR)/_the.bifiles_th: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR)
-	$(ECHO) $(LOG_INFO) "Generating BreakIteratorData_th"
-	$(MKDIR) -p $(@D)/th
+	$(call LogInfo, Generating BreakIteratorData_th)
+	$(call MakeDir, $(@D)/th)
 	$(RM) $(BIFILES_TH)
 	$(TOOL_GENERATEBREAKITERATORDATA) \
 	    -o $(@D) \
--- a/make/gendata/GendataHtml32dtd.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gendata/GendataHtml32dtd.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -27,7 +27,7 @@
 
 HTML32DTD = $(JDK_OUTPUTDIR)/modules/java.desktop/javax/swing/text/html/parser/html32.bdtd
 $(HTML32DTD): $(BUILD_TOOLS_JDK)
-	$(ECHO) "Generating HTML DTD file"
+	$(call LogInfo, Generating HTML DTD file)
 	$(MKDIR) -p $(@D)
 	$(RM) $@
 	($(TOOL_DTDBUILDER) $(LOG_INFO) html32 > $@) || exit 1
--- a/make/gendata/GendataPolicyJars.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gendata/GendataPolicyJars.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -87,8 +87,7 @@
 
 $(US_EXPORT_POLICY_JAR_LIMITED): \
     $(US_EXPORT_POLICY_JAR_UNLIMITED)
-	$(ECHO) $(LOG_INFO) \
-	    Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+	$(call LogInfo, Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@))
 	$(install-file)
 
 TARGETS += $(US_EXPORT_POLICY_JAR_LIMITED) $(US_EXPORT_POLICY_JAR_UNLIMITED)
@@ -99,7 +98,7 @@
 else
   $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_LIMITED)
 	$(install-file)
-endif 
+endif
 
 ifndef OPENJDK
   ifneq ($(UNLIMITED_CRYPTO), true)
--- a/make/gensrc/Gensrc-jdk.charsets.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gensrc/Gensrc-jdk.charsets.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -46,30 +46,34 @@
     $(wildcard $(CHARSET_DATA_DIR)/$(CHARSET_STANDARD_OS)) \
     $(CHARSET_TEMPLATES) $(CHARSET_EXTENDED_JAVA_TEMPLATES) \
     $(BUILD_TOOLS_JDK)
-	$(MKDIR) -p $(@D)
+	$(call LogInfo, Generating jdk.charsets extcs)
+	$(call MakeDir, $(@D))
 	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) \
 	    extcs charsets  $(CHARSET_STANDARD_OS) \
 	    $(CHARSET_EXTENDED_JAVA_TEMPLATES) \
 	    $(CHARSET_EXTENDED_JAVA_DIR) \
 	    $(CHARSET_COPYRIGHT_HEADER) \
-	    $(LOG_INFO)
+	    $(LOG_DEBUG)
 	$(TOUCH) '$@'
 
 $(CHARSET_DONE_CS)-hkscs: $(CHARSET_COPYRIGHT_HEADER)/HKSCS.java \
     $(BUILD_TOOLS_JDK)
-	$(MKDIR) -p $(@D)
+	$(call LogInfo, Generating jdk.charsets hkscs)
+	$(call MakeDir, $(@D))
 	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) hkscs '$<'
 	$(TOUCH) '$@'
 
 $(CHARSET_DONE_CS)-euctw: $(CHARSET_COPYRIGHT_HEADER)/EUC_TW.java \
     $(BUILD_TOOLS_JDK)
-	$(MKDIR) -p $(@D)
+	$(call LogInfo, Generating jdk.charsets euctw)
+	$(call MakeDir, $(@D))
 	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) euctw '$<'
 	$(TOUCH) '$@'
 
 $(CHARSET_GENSRC_JAVA_DIR_CS)/sjis0213.dat: $(CHARSET_DATA_DIR)/sjis0213.map \
     $(BUILD_TOOLS_JDK)
-	$(MKDIR) -p $(@D)
+	$(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%, %, $@))
+	$(call MakeDir, $(@D))
 	$(TOOL_CHARSETMAPPING) '$<' '$@' sjis0213
 
 GENSRC_JDK_CHARSETS += \
@@ -86,4 +90,3 @@
 all: jdk.charsets
 
 .PHONY: all jdk.charsets
-
--- a/make/gensrc/Gensrc-jdk.jdi.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gensrc/Gensrc-jdk.jdi.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -40,19 +40,18 @@
 
 # Touch the target of this rule at the end to avoid triggering false rebuilds
 $(JAVA_FILE): $(JDWP_SPEC_FILE) $(BUILD_TOOLS_JDK) $(HEADER_FILE)
-	$(MKDIR) -p $(@D)
-	$(MKDIR) -p $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent
+	$(call LogInfo, Creating JDWP.java and JDWPCommands.h from jdwp.spec)
+	$(call MakeDir, $(@D) $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent)
 	$(RM) $@ $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h
-	$(ECHO) $(LOG_INFO) Creating JDWP.java and JDWPCommands.h from jdwp.spec
 	$(TOOL_JDWPGEN) $< -jdi $@ -include \
 	    $(SUPPORT_OUTPUTDIR)/headers/jdk.jdwp.agent/JDWPCommands.h
 	$(TOUCH) $@
 
 $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/jdwp-protocol.html: $(JDWP_SPEC_FILE) \
     $(BUILD_TOOLS_JDK)
-	$(MKDIR) -p $(@D)
+	$(call LogInfo, Creating $(@F) from jdwp.spec)
+	$(call MakeDir, $(@D))
 	$(RM) $@
-	$(ECHO) $(LOG_INFO) Creating $(@F) from jdwp.spec
 	$(TOOL_JDWPGEN) $< -doc $@
 
 GENSRC_JDWP := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/com/sun/tools/jdi/JDWP.java \
@@ -63,14 +62,14 @@
 ################################################################################
 
 define process-provider
-	$(MKDIR) -p $(@D)
+	$(call MakeDir, $(@D))
 	$(CAT) $^ | $(SED) -e "s/^#\[$(OPENJDK_TARGET_OS)\]//" > $@
 endef
 
 # Filter com.sun.jdi.connect.Connector
 $(SUPPORT_OUTPUTDIR)/gensrc/jdk.jdi/META-INF/services/com.sun.jdi.connect.Connector: \
     $(JDK_TOPDIR)/src/jdk.jdi/share/classes/META-INF/services/com.sun.jdi.connect.Connector \
-    $(HOTSPOT_TOPDIR)/agent/src/share/classes/META-INF/services/com.sun.jdi.connect.Connector
+    $(HOTSPOT_TOPDIR)/src/jdk.hotspot.agent/share/classes/META-INF/services/com.sun.jdi.connect.Connector
 	$(process-provider)
 
 # Copy the same service file into jdk.hotspot.agent so that they are kept the same.
--- a/make/gensrc/GensrcBuffer.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gensrc/GensrcBuffer.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -23,7 +23,7 @@
 # questions.
 #
 
-GENSRC_BUFFER := 
+GENSRC_BUFFER :=
 
 GENSRC_BUFFER_DST := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/nio
 
@@ -31,9 +31,9 @@
 
 ###
 
-$(GENSRC_BUFFER_DST)/_the.buffer.dir: 
-	$(ECHO) "Generating buffer classes"
-	$(MKDIR) -p $(@D)
+$(GENSRC_BUFFER_DST)/_the.buffer.dir:
+	$(call LogInfo, Generating buffer classes)
+	$(call MakeDir, $(@D))
 	$(TOUCH) $@
 
 define fixRw
--- a/make/gensrc/GensrcCharacterData.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gensrc/GensrcCharacterData.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -35,8 +35,8 @@
 define SetupCharacterData
   $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/$1.java: \
       $(CHARACTERDATA)/$1.java.template
-	$(MKDIR) -p $$(@D)
-	$(ECHO) $(LOG_INFO) Generating $1.java
+	$$(call LogInfo, Generating $1.java)
+	$$(call MakeDir, $$(@D))
 	$(TOOL_GENERATECHARACTER) $2 \
 	    -template $(CHARACTERDATA)/$1.java.template \
 	    -spec $(UNICODEDATA)/UnicodeData.txt \
@@ -56,7 +56,7 @@
 
 # Copy two Java files that need no preprocessing.
 $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/%.java: $(CHARACTERDATA)/%.java.template
-	$(ECHO) $(LOG_INFO) Generating $(@F)
+	$(call LogInfo, Generating $(@F))
 	$(call install-file)
 
 GENSRC_CHARACTERDATA += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/CharacterDataUndefined.java \
--- a/make/gensrc/GensrcCharsetMapping.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gensrc/GensrcCharsetMapping.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -44,13 +44,13 @@
     $(wildcard $(CHARSET_DATA_DIR)/$(CHARSET_STANDARD_OS)) \
     $(CHARSET_TEMPLATES) $(CHARSET_STANDARD_JAVA_TEMPLATES) \
     $(BUILD_TOOLS_JDK)
-	$(MKDIR) -p $(@D)
+	$(call LogInfo, Generating java.base charset mapping)
+	$(call MakeDir, $(@D))
 	$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_BASE) \
 	    stdcs charsets $(CHARSET_STANDARD_OS) \
 	    $(CHARSET_STANDARD_JAVA_TEMPLATES) $(CHARSET_EXTSRC_DIR) \
 	    $(CHARSET_COPYRIGHT_HEADER) \
-            $(LOG_INFO)
+            $(LOG_DEBUG)
 	$(TOUCH) '$@'
 
 GENSRC_JAVA_BASE += $(CHARSET_DONE_BASE)-stdcs
-
--- a/make/gensrc/GensrcExceptions.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gensrc/GensrcExceptions.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -32,21 +32,12 @@
 
 GENSRC_EXCEPTIONS_SRC_DIRS := . charset channels
 
-###
-
-$(GENSRC_EXCEPTIONS_DST)/_the.exceptions.dir:
-	$(ECHO) "Generating exceptions classes"
-	$(MKDIR) -p $(@D)
-	$(TOUCH) $@
-
-
-###
-
 $(GENSRC_EXCEPTIONS_DST)/_the.%.marker: $(GENSRC_EXCEPTIONS_SRC)/%/exceptions \
-    $(GENSRC_EXCEPTIONS_CMD) \
-    $(GENSRC_EXCEPTIONS_DST)/_the.exceptions.dir
-	$(MKDIR) -p $(@D)/$*
-	SCRIPTS="$(JDK_TOPDIR)/make/scripts" NAWK="$(NAWK)" SH="$(SH)" $(SH) $(GENSRC_EXCEPTIONS_CMD) $< $(@D)/$* $(LOG_INFO)
+    $(GENSRC_EXCEPTIONS_CMD)
+	$(call LogInfo, Generating exceptions java.nio $*)
+	$(call MakeDir, $(@D)/$*)
+	SCRIPTS="$(JDK_TOPDIR)/make/scripts" NAWK="$(NAWK)" SH="$(SH)" $(SH) \
+	    $(GENSRC_EXCEPTIONS_CMD) $< $(@D)/$* $(LOG_DEBUG)
 	$(TOUCH) $@
 
 GENSRC_EXCEPTIONS += $(foreach D,$(GENSRC_EXCEPTIONS_SRC_DIRS),$(GENSRC_EXCEPTIONS_DST)/_the.$(D).marker)
--- a/make/gensrc/GensrcIcons.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gensrc/GensrcIcons.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -65,8 +65,8 @@
 ################################################################################
 
 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir:
-	$(ECHO) Generating icon classes
-	$(MKDIR) -p $(GENSRC_AWT_ICONS_DST)
+	$(call LogInfo, Generating icon classes)
+	$(call MakeDir, $(GENSRC_AWT_ICONS_DST))
 	$(TOUCH) $@
 
 ################################################################################
@@ -121,8 +121,9 @@
   endif
 
   $(GENSRC_OSX_ICONS): $(GENSRC_OSX_ICONS_SRC) $(BUILD_TOOLS_JDK)
+	$(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%, %, $@))
+	$(call MakeDir, $(@D))
 	$(RM) $@ $@.tmp
-	$(MKDIR) -p $(dir $@)
 	$(ECHO) "static unsigned char sAWTIconData[] = { " >> $@.tmp
 	$(CAT) $< | $(TOOL_OSX_TOBIN) >> $@.tmp
 	$(ECHO) "};" >> $@.tmp
--- a/make/gensrc/GensrcLocaleData.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gensrc/GensrcLocaleData.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -28,8 +28,9 @@
 # into LocaleDataMetaInfo.java
 
 # First go look for all locale files
-LOCALE_FILES := $(shell $(FIND) $(JDK_TOPDIR)/src/java.base/share/classes \
-    $(JDK_TOPDIR)/src/jdk.localedata/share/classes \
+LOCALE_FILES := $(shell $(FIND) \
+    $(JDK_TOPDIR)/src/$(MODULE)/share/classes/sun/text/resources \
+    $(JDK_TOPDIR)/src/$(MODULE)/share/classes/sun/util/resources \
     -name "FormatData_*.java" -o -name "FormatData_*.properties" -o \
     -name "CollationData_*.java" -o -name "CollationData_*.properties" -o \
     -name "TimeZoneNames_*.java" -o -name "TimeZoneNames_*.properties" -o \
@@ -42,17 +43,21 @@
 LOCALE_RESOURCES := $(sort $(subst .properties,,$(subst .java,,$(notdir $(LOCALE_FILES)))))
 
 # Include the list of resources found during the previous compile.
--include $(SUPPORT_OUTPUTDIR)/gensrc/_the.locale_resources
+-include $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the.locale_resources
 
 MISSING_RESOURCES := $(filter-out $(LOCALE_RESOURCES), $(PREV_LOCALE_RESOURCES))
 NEW_RESOURCES := $(filter-out $(PREV_LOCALE_RESOURCES), $(LOCALE_RESOURCES))
 
 ifneq (, $(MISSING_RESOURCES)$(NEW_RESOURCES))
   # There is a difference in the number of supported resources. Trigger a regeneration.
-  $(shell $(RM) $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/BaseLocaleDataMetaInfo.java \
-    $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/provider/NonBaseLocaleDataMetaInfo.java \
-    $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/cldr/CLDRBaseLocaleDataMetaInfo.java \
-    $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo_jdk_localedata.java)
+  ifeq ($(MODULE), java.base)
+    $(shell $(RM) $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/BaseLocaleDataMetaInfo.java \
+        $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/cldr/CLDRBaseLocaleDataMetaInfo.java)
+  endif
+  ifeq ($(MODULE), jdk.localedata)
+    $(shell $(RM) $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/provider/NonBaseLocaleDataMetaInfo.java \
+        $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo_jdk_localedata.java)
+  endif
 endif
 
 # The base locales
@@ -121,18 +126,18 @@
 
 $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/BaseLocaleDataMetaInfo.java: \
     $(JDK_TOPDIR)/src/java.base/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template
+	$(call LogInfo, Creating sun/util/locale/provider/BaseLocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources)
 	$(MKDIR) -p $(@D)
-	$(ECHO) Creating sun/util/locale/provider/BaseLocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources.
 	$(PRINTF) "PREV_LOCALE_RESOURCES:=$(LOCALE_RESOURCES)" \
-	    > $(SUPPORT_OUTPUTDIR)/gensrc/_the.locale_resources
+	    > $(SUPPORT_OUTPUTDIR)/gensrc/java.base/_the.locale_resources
 	$(SED) $(SED_BASEARGS) $< > $@
 
 $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/provider/NonBaseLocaleDataMetaInfo.java: \
     $(JDK_TOPDIR)/src/java.base/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template
+	$(call LogInfo, Creating sun/util/resources/provider/NonBaseLocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources)
 	$(MKDIR) -p $(@D)
-	$(ECHO) Creating sun/util/resources/provider/NonBaseLocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources.
 	$(PRINTF) "PREV_LOCALE_RESOURCES:=$(LOCALE_RESOURCES)" \
-	    > $(SUPPORT_OUTPUTDIR)/gensrc/_the.locale_resources
+	    > $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/_the.locale_resources
 	$(SED) $(SED_NONBASEARGS) $< > $@
 
 GENSRC_BASELOCALEDATA := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/BaseLocaleDataMetaInfo.java
--- a/make/gensrc/GensrcMisc.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gensrc/GensrcMisc.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -50,7 +50,7 @@
 SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOR_SRC)/$(GENSRC_SOR_SRC_FILE) | \
     $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
 
-$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE, \
+$(eval $(call SetupNativeCompilation, BUILD_GENSRC_SOR_EXE, \
     SRC := $(GENSRC_SOR_SRC), \
     INCLUDE_FILES := $(GENSRC_SOR_SRC_FILE), \
     TOOLCHAIN := TOOLCHAIN_BUILD, \
@@ -86,7 +86,7 @@
   UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \
       $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
 
-  $(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE, \
+  $(eval $(call SetupNativeCompilation, BUILD_GENSRC_UC_EXE, \
       SRC := $(GENSRC_UC_SRC), \
       INCLUDE_FILES := $(GENSRC_UC_SRC_FILE), \
       TOOLCHAIN := TOOLCHAIN_BUILD, \
@@ -124,7 +124,7 @@
   SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \
       $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
 
-  $(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE, \
+  $(eval $(call SetupNativeCompilation, BUILD_GENSRC_SOL_EXE, \
       SRC := $(GENSRC_SOL_SRC), \
       INCLUDE_FILES := $(GENSRC_SOL_SRC_FILE), \
       TOOLCHAIN := TOOLCHAIN_BUILD, \
--- a/make/gensrc/GensrcProperties.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gensrc/GensrcProperties.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -75,7 +75,7 @@
 
   # Convert .../src/<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties
   # to .../support/gensrc/<module>/com/sun/tools/javac/resources/javac_zh_CN.java
-  # Strip away prefix and suffix, leaving for example only: 
+  # Strip away prefix and suffix, leaving for example only:
   # "<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN"
   $1_JAVAS := $$(patsubst $$($1_MODULE_PATH_ROOT)/%, \
       $(SUPPORT_OUTPUTDIR)/gensrc/%, \
--- a/make/gensrc/GensrcSwing.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gensrc/GensrcSwing.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -31,12 +31,11 @@
 NIMBUS_SKIN_FILE = $(JDK_TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus/skin.laf
 
 $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated_nimbus: $(NIMBUS_SKIN_FILE) $(BUILD_TOOLS_JDK)
+	$(call LogInfo, Generating Nimbus source files)
 	$(MKDIR) -p $(@D)
-	$(ECHO) "Generating Nimbus source files"
-	$(TOOL_GENERATENIMBUS) $(LOG_INFO) \
+	$(TOOL_GENERATENIMBUS) $(LOG_DEBUG) \
 	    -skinFile $(NIMBUS_SKIN_FILE) -buildDir $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop \
 	    -packagePrefix $(NIMBUS_PACKAGE).nimbus -lafName Nimbus
-	$(ECHO) $(LOG_INFO) "Finished generating Nimbus source files"
 	$(TOUCH) $@
 
 GENSRC_SWING_NIMBUS := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated_nimbus
--- a/make/gensrc/GensrcX11Wrappers.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/gensrc/GensrcX11Wrappers.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -63,14 +63,14 @@
 # Copy only the sizes.* files that are actually needed. WrapperGenerator picks up any it finds from the
 # file prefix it is given so those not needed need to be hidden.
 $(GENSRC_X11WRAPPERS_TMP)/sizes.%: $(GENSRC_SIZER_DIR)/sizes.%
-	$(MKDIR) -p $(@D)
+	$(call MakeDir, $(@D))
 	$(RM) '$@'
 	$(SORT) $< > $@
 
 # Run the tool on the offset files copied from the source repository to generate several Java classes
 # used in awt.
 $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated.x11: $(GENSRC_X11_SIZES_USED) $(BUILD_TOOLS_JDK)
-	$(MKDIR) -p $(GENSRC_X11WRAPPERS_DST)
+	$(call MakeDir, $(GENSRC_X11WRAPPERS_DST))
 	$(TOOL_WRAPPERGENERATOR) $(GENSRC_X11WRAPPERS_DST) $(GENSRC_SIZER_DIR)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizes
 	$(TOUCH) $@
 
@@ -82,8 +82,8 @@
 
   # Generate the C code for the program that will output the offset file.
   $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c: $(GENSRC_SIZER_DIR)/xlibtypes.txt $(BUILD_TOOLS_JDK)
-	$(ECHO) "Generating X11 wrapper ($*-bit version)"
-	$(MKDIR) -p $(@D)
+	$(call LogInfo, Generating X11 wrapper ($*-bit version))
+	$(call MakeDir, $(@D))
 	$(TOOL_WRAPPERGENERATOR) $(@D) $(GENSRC_SIZER_DIR)/xlibtypes.txt "sizer" $*
 
   # use -m32/-m64 only if the compiler supports it
@@ -103,7 +103,7 @@
 
   # Compile the C code into an executable.
   $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c
-	$(MKDIR) -p $(@D)
+	$(call MakeDir, $(@D))
 	(cd $(@D) && $(CC) $(MEMORY_MODEL_FLAG) -o $@ $< \
 	    $(X_CFLAGS) \
 	    $(X_LIBS) \
@@ -114,9 +114,9 @@
   # Run the executable create the offset file and check that it is identical
   # to the offset file in the source code repository.
   $(GENSRC_X11WRAPPERS_TMP)/sizes.%.verification: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe
-	$(MKDIR) -p $(@D)
+	$(call LogInfo, Verifying X11 wrapper sizes)
+	$(call MakeDir, $(@D))
 	$(GENSRC_X11WRAPPERS_TMP)/sizer.$*.exe | $(SORT) > $@.tmp
-	$(ECHO) Verifying $(GENSRC_X11WRAPPERS_TMP)/sizes.$*.verification.tmp to $(GENSRC_X11WRAPPERS_TMP)/sizes.$*
 	$(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizes.$*.verification.tmp $(GENSRC_X11WRAPPERS_TMP)/sizes.$*
 	mv $@.tmp $@
 
--- a/make/launcher/Launcher-java.base.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/launcher/Launcher-java.base.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -130,7 +130,6 @@
       LDFLAGS := $(LDFLAGS_JDKEXE), \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jexec_obj, \
       OUTPUT_DIR := $(BUILD_JEXEC_DST_DIR), \
-      DEBUG_SYMBOLS := true, \
       PROGRAM := jexec))
 
   TARGETS += $(BUILD_JEXEC)
--- a/make/launcher/Launcher-jdk.accessibility.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/launcher/Launcher-jdk.accessibility.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -45,7 +45,6 @@
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jabswitch, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
       PROGRAM := jabswitch, \
-      DEBUG_SYMBOLS := true, \
       VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRC)/AccessBridgeStatusWindow.RC, \
       RC_FLAGS := $(RC_FLAGS) \
           -D "JDK_FNAME=jabswitch.exe" \
@@ -79,7 +78,6 @@
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccessinspector$1, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
       PROGRAM := jaccessinspector$1, \
-      DEBUG_SYMBOLS := true, \
       VERSIONINFO_RESOURCE := $(TOPDIR)/jaccessinspector/jaccessinspectorWindow.rc, \
       RC_FLAGS := $$(RC_FLAGS) \
           -D "JDK_FNAME=jaccessinspector$1.exe" \
@@ -107,7 +105,6 @@
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccesswalker$1, \
       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
       PROGRAM := jaccesswalker$1, \
-      DEBUG_SYMBOLS := true, \
       VERSIONINFO_RESOURCE := $(TOPDIR)/jaccesswalker/jaccesswalkerWindow.rc, \
       RC_FLAGS := $$(RC_FLAGS) \
           -D "JDK_FNAME=jaccesswalker$1.exe" \
--- a/make/launcher/Launcher-jdk.pack200.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/launcher/Launcher-jdk.pack200.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -100,7 +100,6 @@
         -D "JDK_FNAME=unpack200.exe" \
         -D "JDK_INTERNAL_NAME=unpack200" \
         -D "JDK_FTYPE=0x1L", \
-    DEBUG_SYMBOLS := true, \
     MANIFEST := $(JDK_TOPDIR)/src/jdk.pack200/windows/native/unpack200/unpack200_proto.exe.manifest, \
     MANIFEST_VERSION := $(VERSION_NUMBER_FOUR_POSITIONS), \
 ))
--- a/make/launcher/LauncherCommon.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/launcher/LauncherCommon.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -25,15 +25,6 @@
 
 include NativeCompilation.gmk
 
-# SetupNativeCompilation now supports debug symbols on macosx for hotspot.
-# Disable it here for the jdk binaries until we decide to enable them.
-ifeq ($(OPENJDK_TARGET_OS), macosx)
-  ENABLE_DEBUG_SYMBOLS := false
-endif
-
-# Prepare the find cache.
-$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src/java.base/share/native/launcher))
-
 ifeq ($(OPENJDK_TARGET_OS), macosx)
   ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN)
 else
@@ -124,7 +115,7 @@
       $1_LDFLAGS += -exported_symbols_list \
               $(SUPPORT_OUTPUTDIR)/build-static/exported.symbols
       $1_LIBS += \
-          $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs/java.base -name "*.a") \
+          $$(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs/java.base -name "*.a") \
           $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/libdt_socket.a \
           $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/libjdwp.a \
           $(SUPPORT_OUTPUTDIR)/native/java.base/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) \
@@ -174,8 +165,7 @@
   endif
 
   $$(eval $$(call SetupNativeCompilation, BUILD_LAUNCHER_$1, \
-      SRC := $(LAUNCHER_SRC), \
-      INCLUDE_FILES := main.c, \
+      EXTRA_FILES := $(LAUNCHER_SRC)/main.c, \
       OPTIMIZATION := $$($1_OPTIMIZATION), \
       CFLAGS := $$($1_CFLAGS) \
           $(LAUNCHER_CFLAGS) \
@@ -204,7 +194,6 @@
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$1_objs, \
       OUTPUT_DIR := $$($1_OUTPUT_DIR), \
       PROGRAM := $1, \
-      DEBUG_SYMBOLS := true, \
       VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
       RC_FLAGS := $$(RC_FLAGS) \
           -D "JDK_FNAME=$1$(EXE_SUFFIX)" \
--- a/make/lib/Awt2dLibraries.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Awt2dLibraries.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -69,7 +69,7 @@
         -D "JDK_INTERNAL_NAME=mlib_image" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libmlib_image, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 $(BUILD_LIBMLIB_IMAGE): $(call FindLib, java.base, java)
 
@@ -134,7 +134,7 @@
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LIBS := -ljava -ljvm -lc $(BUILD_LIBMLIB_LDLIBS), \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libmlib_image_v, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   $(BUILD_LIBMLIB_IMAGE_V): $(call FindLib, java.base, java)
 
@@ -279,7 +279,7 @@
         -D "JDK_INTERNAL_NAME=awt" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 $(BUILD_LIBAWT): $(call FindLib, java.base, java)
 
@@ -369,7 +369,7 @@
             -D "JDK_INTERNAL_NAME=xawt" \
             -D "JDK_FTYPE=0x2L", \
         OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_xawt, \
-        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+    ))
 
     $(BUILD_LIBAWT_XAWT): $(call FindLib, java.base, java)
 
@@ -433,7 +433,7 @@
         -D "JDK_INTERNAL_NAME=lcms" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/liblcms, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 TARGETS += $(BUILD_LIBLCMS)
 
@@ -509,7 +509,7 @@
         -D "JDK_FTYPE=0x2L", \
     REORDER := $(BUILD_LIBJAVAJPEG_REORDER), \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjavajpeg, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 $(BUILD_LIBJAVAJPEG): $(call FindLib, java.base, java)
 
@@ -578,7 +578,7 @@
         LIBS_linux := -lm $(LIBDL), \
         LIBS_solaris := -lm $(LIBDL) $(LIBCXX) -lc, \
         OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_headless, \
-        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+    ))
 
     $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
 
@@ -700,7 +700,7 @@
         -D "JDK_INTERNAL_NAME=fontmanager" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfontmanager, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
 
@@ -745,12 +745,13 @@
           -D "JDK_INTERNAL_NAME=jawt" \
           -D "JDK_FTYPE=0x2L", \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   $(BUILD_LIBJAWT): $(BUILD_LIBAWT)
 
   $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT)
-	$(ECHO) Copying $(@F)
+	$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%, %, $@))
+	$(call MakeDir, $(@D))
 	$(CP) $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@
 
   TARGETS += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
@@ -804,7 +805,7 @@
       LIBS_solaris := $(X_LIBS) -lXrender, \
       LIBS_macosx := -framework Cocoa, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   ifndef BUILD_HEADLESS_ONLY
     $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
@@ -926,7 +927,7 @@
           -D "JDK_INTERNAL_NAME=splashscreen" \
           -D "JDK_FTYPE=0x2L", \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsplashscreen, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   TARGETS += $(BUILD_LIBSPLASHSCREEN)
 
@@ -1002,7 +1003,7 @@
           -framework OpenGL \
           -framework QuartzCore -ljava, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_lwawt, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   TARGETS += $(BUILD_LIBAWT_LWAWT)
 
@@ -1044,7 +1045,7 @@
           -framework JavaRuntimeSupport \
           -ljava -ljvm, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxui, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   TARGETS += $(BUILD_LIBOSXUI)
 
--- a/make/lib/CoreLibraries.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/CoreLibraries.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -25,6 +25,10 @@
 
 WIN_VERIFY_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libverify/verify.lib
 
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, jdk, lib/CoreLibraries.gmk))
+
+
 ##########################################################################################
 # libfdlibm is statically linked with libjava below and not delivered into the
 # product on its own.
@@ -51,7 +55,7 @@
       DISABLED_WARNINGS_microsoft := 4146 4244 4018, \
       ARFLAGS := $(ARFLAGS), \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
 else
 
@@ -64,7 +68,7 @@
       CFLAGS := $(CFLAGS_JDKLIB) $(LIBFDLIBM_CFLAGS), \
       LDFLAGS := -nostdlib -r -arch x86_64, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   BUILD_LIBFDLIBM := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
   $(BUILD_LIBFDLIBM): $(BUILD_LIBFDLIBM_MAC)
@@ -82,7 +86,7 @@
 
 LIBVERIFY_OPTIMIZATION := HIGH
 ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
-  ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
+  ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
     LIBVERIFY_OPTIMIZATION := LOW
   endif
 endif
@@ -106,7 +110,7 @@
         -D "JDK_FTYPE=0x2L", \
     REORDER := $(BUILD_LIBVERIFY_REORDER), \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libverify, \
-    DEBUG_SYMBOLS := true))
+))
 
 TARGETS += $(BUILD_LIBVERIFY)
 
@@ -119,6 +123,9 @@
     -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
     -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
 
+# Make it possible to override this variable
+LIBJAVA_MAPFILE ?= $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers
+
 ifeq ($(OPENJDK_TARGET_OS), macosx)
   BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
   BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c
@@ -146,7 +153,7 @@
     System.c_CFLAGS := $(VERSION_CFLAGS), \
     jdk_util.c_CFLAGS := $(VERSION_CFLAGS), \
     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
-    MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava/mapfile-vers, \
+    MAPFILE := $(LIBJAVA_MAPFILE), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_macosx := -L$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/, \
@@ -171,7 +178,7 @@
         -D "JDK_FTYPE=0x2L", \
     REORDER := $(LIBJAVA_REORDER), \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 TARGETS += $(BUILD_LIBJAVA)
 
@@ -228,8 +235,7 @@
         -D "JDK_INTERNAL_NAME=zip" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libzip, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
-
+))
 
 $(BUILD_LIBZIP): $(BUILD_LIBJAVA)
 
@@ -273,7 +279,7 @@
         -D "JDK_INTERNAL_NAME=jimage" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjimage, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 $(BUILD_LIBJIMAGE): $(BUILD_LIBJAVA)
 
@@ -389,7 +395,7 @@
         -D "JDK_INTERNAL_NAME=jli" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 TARGETS += $(BUILD_LIBJLI)
 
@@ -407,7 +413,7 @@
       CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
       ARFLAGS := $(ARFLAGS), \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   TARGETS += $(BUILD_LIBJLI_STATIC)
 
@@ -426,7 +432,7 @@
       CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
       LDFLAGS := -nostdlib -r, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjli_static, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   ifeq ($(STATIC_BUILD), true)
     TARGETS += $(BUILD_LIBJLI_STATIC)
--- a/make/lib/Lib-java.base.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-java.base.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -49,7 +49,7 @@
   JAVA_BASE_EXPORT_SYMBOL_FILE := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/java.base.symbols
 
   $(JAVA_BASE_EXPORT_SYMBOL_FILE): $(JAVA_BASE_EXPORT_SYMBOLS_SRC)
-	$(ECHO) $(LOG_INFO) "Generating java.base.symbols file"
+	$(call LogInfo, Generating java.base.symbols file)
 	$(CAT) $^ > $@
 
   # The individual symbol files is generated when the respective lib is built
--- a/make/lib/Lib-java.instrument.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-java.instrument.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -84,7 +84,7 @@
         -D "JDK_INTERNAL_NAME=instrument" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libinstrument, \
-    DEBUG_SYMBOLS := true))
+))
 
 ifneq (, $(findstring $(OPENJDK_TARGET_OS), macosx windows aix))
   $(BUILD_LIBINSTRUMENT): $(SUPPORT_OUTPUTDIR)/native/java.base/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX)
--- a/make/lib/Lib-java.management.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-java.management.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -40,7 +40,7 @@
 
 LIBMANAGEMENT_OPTIMIZATION := HIGH
 ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
-  ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
+  ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
     LIBMANAGEMENT_OPTIMIZATION := LOW
   endif
 endif
@@ -64,7 +64,7 @@
         -D "JDK_INTERNAL_NAME=management" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libmanagement, \
-    DEBUG_SYMBOLS := true))
+))
 
 $(BUILD_LIBMANAGEMENT): $(call FindLib, java.base, java)
 
--- a/make/lib/Lib-java.prefs.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-java.prefs.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -55,7 +55,7 @@
         -D "JDK_INTERNAL_NAME=prefs" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libprefs, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 $(BUILD_LIBPREFS): $(call FindLib, java.base, java)
 
--- a/make/lib/Lib-java.security.jgss.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-java.security.jgss.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -46,7 +46,7 @@
       LIBS := $(LIBDL), \
       LIBS_solaris := -lc, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libj2gss, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   TARGETS += $(BUILD_LIBJ2GSS)
 endif
@@ -92,7 +92,7 @@
             -D "JDK_INTERNAL_NAME=$(BUILD_LIBKRB5_NAME)" \
             -D "JDK_FTYPE=0x2L", \
         OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libkrb5, \
-        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+    ))
 
     TARGETS += $(BUILD_LIBKRB5)
   endif
--- a/make/lib/Lib-java.smartcardio.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-java.smartcardio.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -52,7 +52,7 @@
         -D "JDK_INTERNAL_NAME=j2pcsc" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libj2pcsc, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 TARGETS += $(BUILD_LIBJ2PCSC)
 
--- a/make/lib/Lib-jdk.accessibility.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-jdk.accessibility.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -61,7 +61,7 @@
             -D "JDK_INTERNAL_NAME=javaaccessbridge$1" \
             -D "JDK_FTYPE=0x02L", \
         OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjavaaccessbridge$1, \
-        DEBUG_SYMBOLS := true)
+    )
 
     $$(BUILD_JAVAACCESSBRIDGE$1): $(SUPPORT_OUTPUTDIR)/native/java.desktop/libjawt/jawt.lib
 
@@ -91,7 +91,7 @@
             -D "JDK_INTERNAL_NAME=windowsaccessbridge$1" \
             -D "JDK_FTYPE=0x02L", \
         OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libwindowsaccessbridge$1, \
-        DEBUG_SYMBOLS := true)
+    )
 
     TARGETS += $$(BUILD_WINDOWSACCESSBRIDGE$1)
 
@@ -113,7 +113,7 @@
             -D "JDK_INTERNAL_NAME=jabsysinfo" \
             -D "JDK_FTYPE=0x02L", \
         OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/lib/libjabsysinfo, \
-        DEBUG_SYMBOLS := true)
+    )
 
     TARGETS += $$(BUILD_ACCESSBRIDGESYSINFO)
 
--- a/make/lib/Lib-jdk.attach.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-jdk.attach.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -56,7 +56,7 @@
     LIBS_solaris := -ldoor, \
     LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib psapi.lib, \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libattach, \
-    DEBUG_SYMBOLS := true))
+))
 
 $(BUILD_LIBATTACH): $(call FindLib, java.base, java)
 
--- a/make/lib/Lib-jdk.crypto.ec.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-jdk.crypto.ec.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -68,7 +68,7 @@
           -D "JDK_INTERNAL_NAME=sunec" \
           -D "JDK_FTYPE=0x2L", \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsunec, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   TARGETS += $(BUILD_LIBSUNEC)
 endif
--- a/make/lib/Lib-jdk.crypto.mscapi.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-jdk.crypto.mscapi.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -47,7 +47,7 @@
           -D "JDK_INTERNAL_NAME=sunmscapi" \
           -D "JDK_FTYPE=0x2L", \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsunmscapi, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   TARGETS += $(BUILD_LIBSUNMSCAPI)
 endif
--- a/make/lib/Lib-jdk.crypto.pkcs11.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-jdk.crypto.pkcs11.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -51,7 +51,7 @@
         -D "JDK_INTERNAL_NAME=j2pkcs11" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libj2pkcs11, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 TARGETS += $(BUILD_LIBJ2PKCS11)
 
--- a/make/lib/Lib-jdk.crypto.ucrypto.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-jdk.crypto.ucrypto.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -44,7 +44,7 @@
       LIBS := $(LIBDL), \
       LIBS_solaris := -lc, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libj2ucrypto, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   $(BUILD_LIBJ2UCRYPTO): $(BUILD_LIBJAVA)
 
--- a/make/lib/Lib-jdk.deploy.osx.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-jdk.deploy.osx.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -57,7 +57,7 @@
           -framework SystemConfiguration \
           $(JDKLIB_LIBS), \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosx, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   TARGETS += $(BUILD_LIBOSX)
 
--- a/make/lib/Lib-jdk.internal.le.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-jdk.internal.le.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -51,7 +51,7 @@
           -D "JDK_INTERNAL_NAME=le" \
           -D "JDK_FTYPE=0x2L", \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/lible, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   TARGETS += $(BUILD_LIBLE)
 
--- a/make/lib/Lib-jdk.jdi.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-jdk.jdi.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -55,7 +55,7 @@
           -D "JDK_INTERNAL_NAME=dt_shmem" \
           -D "JDK_FTYPE=0x2L", \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libdt_shmem, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   TARGETS += $(BUILD_LIBDT_SHMEM)
 
--- a/make/lib/Lib-jdk.jdwp.agent.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-jdk.jdwp.agent.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -56,7 +56,7 @@
         -D "JDK_INTERNAL_NAME=dt_socket" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libdt_socket, \
-    DEBUG_SYMBOLS := true))
+))
 
 $(BUILD_LIBDT_SOCKET): $(call FindLib, java.base, java)
 
@@ -95,7 +95,7 @@
         -D "JDK_INTERNAL_NAME=jdwp" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjdwp, \
-    DEBUG_SYMBOLS := true))
+))
 
 $(BUILD_LIBJDWP): $(call FindLib, java.base, java)
 
@@ -111,7 +111,7 @@
   JDK_JDWP_AGENT_EXPORT_SYMBOL_FILE := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/jdk.jdwp.agent.symbols
 
   $(JDK_JDWP_AGENT_EXPORT_SYMBOL_FILE): $(JDK_JDWP_AGENT_EXPORT_SYMBOLS_SRC)
-	$(ECHO) $(LOG_INFO) "Generating jdk.jdwp.agent symbols file"
+	$(call LogInfo, Generating jdk.jdwp.agent symbols file)
 	$(CAT) $^ > $@
 
   # The individual symbol files is generated when the respective lib is built
--- a/make/lib/Lib-jdk.management.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-jdk.management.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -48,7 +48,7 @@
 
 LIBMANAGEMENT_EXT_OPTIMIZATION := HIGH
 ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
-  ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
+  ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
     LIBMANAGEMENT_EXT_OPTIMIZATION := LOW
   endif
 endif
@@ -73,7 +73,7 @@
         -D "JDK_INTERNAL_NAME=management_ext" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libmanagement_ext, \
-    DEBUG_SYMBOLS := true))
+))
 
 $(BUILD_LIBMANAGEMENT_EXT): $(call FindLib, java.base, java)
 
--- a/make/lib/Lib-jdk.pack200.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-jdk.pack200.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -52,7 +52,7 @@
         -D "JDK_FNAME=unpack.dll" \
         -D "JDK_INTERNAL_NAME=unpack" \
         -D "JDK_FTYPE=0x2L", \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 $(BUILD_LIBUNPACK): $(call FindLib, java.base, java)
 
--- a/make/lib/Lib-jdk.sctp.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-jdk.sctp.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -53,7 +53,7 @@
         LIBS_linux := -lpthread $(LIBDL), \
         LIBS_solaris := -lsocket -lc, \
         OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsctp, \
-        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+    ))
 
     TARGETS += $(BUILD_LIBSCTP)
 
--- a/make/lib/Lib-jdk.security.auth.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/Lib-jdk.security.auth.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -55,7 +55,7 @@
         -D "JDK_INTERNAL_NAME=$(LIBJAAS_NAME)" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjaas, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 $(BUILD_LIBJAAS): $(call FindLib, java.base, java)
 
--- a/make/lib/LibCommon.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/LibCommon.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -23,40 +23,24 @@
 # questions.
 #
 
-include $(SPEC)
-include MakeBase.gmk
 include NativeCompilation.gmk
 
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, jdk, lib/LibCommon.gmk))
+
+################################################################################
+
 GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
 
 # Absolute paths to lib files on windows for use in LDFLAGS. Should figure out a more
 # elegant solution to this.
 WIN_JAVA_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib
 
-ifdef OPENJDK
-  # Build everything with debugging on OpenJDK
-  DEBUG_ALL_BINARIES := true
-else
-  # Use this variable to set DEBUG_SYMBOLS true on windows for all libraries, but
-  # not on other platforms.
-  ifeq ($(OPENJDK_TARGET_OS), windows)
-    DEBUG_ALL_BINARIES := true
-  else
-    DEBUG_ALL_BINARIES := false
-  endif
-endif
-
-# SetupNativeCompilation now supports debug symbols on macosx for hotspot.
-# Disable it here for the jdk libraries until we decide to enable them.
-ifeq ($(OPENJDK_TARGET_OS), macosx)
-  ENABLE_DEBUG_SYMBOLS := false
-endif
-
 ################################################################################
 # Find the default set of src dirs for a native library.
 # Param 1 - module name
 # Param 2 - library name
-FindSrcDirsForLib = \
+FindSrcDirsForLib += \
   $(call uniq, $(wildcard \
       $(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \
       $(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/lib$(strip $2) \
@@ -87,3 +71,5 @@
 else
   ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
 endif
+
+###############################################################################
--- a/make/lib/NetworkingLibraries.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/NetworkingLibraries.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -52,7 +52,7 @@
         -D "JDK_INTERNAL_NAME=net" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 $(BUILD_LIBNET): $(BUILD_LIBJAVA)
 
--- a/make/lib/NioLibraries.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/NioLibraries.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -91,7 +91,7 @@
         -D "JDK_INTERNAL_NAME=nio" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnio, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 TARGETS += $(BUILD_LIBNIO)
 
--- a/make/lib/PlatformLibraries.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/PlatformLibraries.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -54,7 +54,7 @@
           -framework IOSurface \
           -framework QuartzCore, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxapp, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   TARGETS += $(BUILD_LIBOSXAPP)
 
--- a/make/lib/SecurityLibraries.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/SecurityLibraries.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -54,7 +54,7 @@
             -framework Security \
             $(JDKLIB_LIBS), \
         OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxsecurity, \
-        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+    ))
 
     $(BUILD_LIBOSXSECURITY): $(BUILD_LIBJAVA)
 
--- a/make/lib/SoundLibraries.gmk	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/lib/SoundLibraries.gmk	Thu Jan 21 10:17:21 2016 -0800
@@ -138,7 +138,7 @@
         -D "JDK_INTERNAL_NAME=jsound" \
         -D "JDK_FTYPE=0x2L", \
     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjsound, \
-    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+))
 
 $(BUILD_LIBJSOUND): $(BUILD_LIBJAVA)
 
@@ -173,7 +173,7 @@
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LIBS := $(ALSA_LIBS) -ljava -ljvm, \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjsoundalsa, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   $(BUILD_LIBJSOUNDALSA): $(BUILD_LIBJAVA)
 
@@ -204,7 +204,7 @@
           -D "JDK_INTERNAL_NAME=jsoundds" \
           -D "JDK_FTYPE=0x2L", \
       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjsoundds, \
-      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+  ))
 
   $(BUILD_LIBJSOUNDDS): $(BUILD_LIBJAVA)
 
--- a/make/src/classes/build/tools/spp/Spp.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/src/classes/build/tools/spp/Spp.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -32,9 +32,10 @@
  * Spp: A simple regex-based stream preprocessor based on Mark Reinhold's
  *      sed-based spp.sh
  *
- * Usage: java build.tools.spp.Spp [-be] [-Kkey] -Dvar=value ... <in >out
+ * Usage: java build.tools.spp.Spp [-be] [-nel] [-Kkey] -Dvar=value ... <in >out
  *
- * Source-file constructs
+ * If -nel is declared then empty lines will not be substituted for lines of
+ * text in the template that do not appear in the output.
  *
  *   Meaningful only at beginning of line, works with any number of keys:
  *
@@ -64,9 +65,10 @@
 
 public class Spp {
     public static void main(String args[]) throws Exception {
-        Map<String, String> vars = new HashMap<String, String>();
-        Set<String> keys = new HashSet<String>();
+        Map<String, String> vars = new HashMap<>();
+        Set<String> keys = new HashSet<>();
         boolean be = false;
+        boolean el = true;
 
         for (String arg:args) {
             if (arg.startsWith("-D")) {
@@ -76,8 +78,10 @@
                 keys.add(arg.substring(2));
             } else if ("-be".equals(arg)) {
                 be = true;
+            } else if ("-nel".equals(arg)) {
+                el = false;
             } else {
-                System.err.println("Usage: java build.tools.spp.Spp [-be] [-Kkey] -Dvar=value ... <in >out");
+                System.err.println("Usage: java build.tools.spp.Spp [-be] [-nel] [-Kkey] -Dvar=value ... <in >out");
                 System.exit(-1);
             }
         }
@@ -85,7 +89,7 @@
         StringBuffer out = new StringBuffer();
         new Spp().spp(new Scanner(System.in),
                       out, "",
-                      keys, vars, be,
+                      keys, vars, be, el,
                       false);
         System.out.print(out.toString());
     }
@@ -93,7 +97,7 @@
     static final String LNSEP = System.getProperty("line.separator");
     static final String KEY = "([a-zA-Z0-9]+)";
     static final String VAR = "([a-zA-Z0-9_\\-]+)";
-    static final String TEXT = "([a-zA-Z0-9&;,.<>/#() \\$]+)"; // $ -- hack embedded $var$
+    static final String TEXT = "([a-zA-Z0-9&;,.<>/#() \\?\\[\\]\\$]+)"; // $ -- hack embedded $var$
 
     static final int GN_NOT = 1;
     static final int GN_KEY = 2;
@@ -101,11 +105,11 @@
     static final int GN_NO  = 5;
     static final int GN_VAR = 6;
 
-    Matcher ifkey = Pattern.compile("^#if\\[(!)?" + KEY + "\\]").matcher("");
-    Matcher elsekey = Pattern.compile("^#else\\[(!)?" + KEY + "\\]").matcher("");
-    Matcher endkey = Pattern.compile("^#end\\[(!)?" + KEY + "\\]").matcher("");
-    Matcher  vardef = Pattern.compile("\\{#if\\[(!)?" + KEY + "\\]\\?" + TEXT + "(:"+ TEXT + ")?\\}|\\$" + VAR + "\\$").matcher("");
-    Matcher  vardef2 = Pattern.compile("\\$" + VAR + "\\$").matcher("");
+    final Matcher   ifkey = Pattern.compile("^#if\\[(!)?" + KEY + "\\]").matcher("");
+    final Matcher elsekey = Pattern.compile("^#else\\[(!)?" + KEY + "\\]").matcher("");
+    final Matcher  endkey = Pattern.compile("^#end\\[(!)?" + KEY + "\\]").matcher("");
+    final Matcher  vardef = Pattern.compile("\\{#if\\[(!)?" + KEY + "\\]\\?" + TEXT + "(:"+ TEXT + ")?\\}|\\$" + VAR + "\\$").matcher("");
+    final Matcher vardef2 = Pattern.compile("\\$" + VAR + "\\$").matcher("");
 
     void append(StringBuffer buf, String ln,
                 Set<String> keys, Map<String, String> vars) {
@@ -135,7 +139,7 @@
     // return true if #end[key], #end or EOF reached
     boolean spp(Scanner in, StringBuffer buf, String key,
                 Set<String> keys, Map<String, String> vars,
-                boolean be, boolean skip) {
+                boolean be, boolean el, boolean skip) {
         while (in.hasNextLine()) {
             String ln = in.nextLine();
             if (be) {
@@ -154,9 +158,9 @@
                 boolean test = keys.contains(k);
                 if (ifkey.group(GN_NOT) != null)
                     test = !test;
-                buf.append(LNSEP);
-                if (!spp(in, buf, k, keys, vars, be, skip || !test)) {
-                    spp(in, buf, k, keys, vars, be, skip || test);
+                if (el) buf.append(LNSEP);
+                if (!spp(in, buf, k, keys, vars, be, el, skip || !test)) {
+                    spp(in, buf, k, keys, vars, be, el, skip || test);
                 }
                 continue;
             }
@@ -164,14 +168,14 @@
                 if (!key.equals(elsekey.group(GN_KEY))) {
                     throw new Error("Mis-matched #if-else-end at line <" + ln + ">");
                 }
-                buf.append(LNSEP);
+                if (el) buf.append(LNSEP);
                 return false;
             }
             if (endkey.reset(ln).find()) {
                 if (!key.equals(endkey.group(GN_KEY))) {
                     throw new Error("Mis-matched #if-else-end at line <" + ln + ">");
                 }
-                buf.append(LNSEP);
+                if (el) buf.append(LNSEP);
                 return true;
             }
             if (ln.startsWith("#warn")) {
@@ -181,8 +185,9 @@
             }
             if (!skip) {
                 append(buf, ln, keys, vars);
+                if (!el) buf.append(LNSEP);
             }
-            buf.append(LNSEP);
+            if (el) buf.append(LNSEP);
         }
         return true;
     }
--- a/make/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/make/src/classes/build/tools/tzdb/TzdbZoneRulesProvider.java	Thu Jan 21 10:17:21 2016 -0800
@@ -60,7 +60,7 @@
  * @author Stephen Colebourne
  * @author Michael Nascimento Santos
  *
- * @since   1.9
+ * @since   9
  */
 
 class TzdbZoneRulesProvider {
--- a/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java	Thu Jan 21 10:17:21 2016 -0800
@@ -26,7 +26,9 @@
 package com.sun.crypto.provider;
 
 import java.security.InvalidKeyException;
+import java.util.Objects;
 
+import jdk.internal.HotSpotIntrinsicCandidate;
 
 /**
  * This class represents ciphers in counter (CTR) mode.
@@ -138,7 +140,7 @@
      * <code>cipherOffset</code>.
      *
      * @param in the buffer with the input data to be encrypted
-     * @param inOffset the offset in <code>plain</code>
+     * @param inOff the offset in <code>plain</code>
      * @param len the length of the input data
      * @param out the buffer for the result
      * @param outOff the offset in <code>cipher</code>
@@ -170,6 +172,15 @@
      * are encrypted on demand.
      */
     private int crypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
+
+        cryptBlockCheck(in, inOff, len);
+        cryptBlockCheck(out, outOff, len);
+        return implCrypt(in, inOff, len, out, outOff);
+    }
+
+    // Implementation of crpyt() method. Possibly replaced with a compiler intrinsic.
+    @HotSpotIntrinsicCandidate
+    private int implCrypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
         int result = len;
         while (len-- > 0) {
             if (used >= blockSize) {
@@ -181,4 +192,23 @@
         }
         return result;
     }
+
+    // Used to perform all checks required by the Java semantics
+    // (i.e., null checks and bounds checks) on the input parameters to crypt().
+    // Normally, the Java Runtime performs these checks, however, as crypt() is
+    // possibly replaced with compiler intrinsic, the JDK performs the
+    // required checks instead.
+    // Does not check accesses to class-internal (private) arrays.
+    private static void cryptBlockCheck(byte[] array, int offset, int len) {
+        Objects.requireNonNull(array);
+
+        if (offset < 0 || len < 0 || offset >= array.length) {
+            throw new ArrayIndexOutOfBoundsException(offset);
+        }
+
+        int largestIndex = offset + len - 1;
+        if (largestIndex < 0 || largestIndex >= array.length) {
+            throw new ArrayIndexOutOfBoundsException(largestIndex);
+        }
+    }
 }
--- a/src/java.base/share/classes/com/sun/crypto/provider/PBES2Core.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/com/sun/crypto/provider/PBES2Core.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -263,7 +263,7 @@
             passwdChars[i] = (char) (passwdBytes[i] & 0x7f);
 
         PBEKeySpec pbeSpec =
-            new PBEKeySpec(passwdChars, salt, iCount, blkSize * 8);
+            new PBEKeySpec(passwdChars, salt, iCount, keyLength);
             // password char[] was cloned in PBEKeySpec constructor,
             // so we can zero it out here
         java.util.Arrays.fill(passwdChars, ' ');
--- a/src/java.base/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java	Thu Jan 21 10:17:21 2016 -0800
@@ -76,11 +76,14 @@
                 "TlsRsaPremasterSecretGenerator must be initialized");
         }
 
-        if (random == null) {
-            random = new SecureRandom();
+        byte[] b = spec.getEncodedSecret();
+        if (b == null) {
+            if (random == null) {
+                random = new SecureRandom();
+            }
+            b = new byte[48];
+            random.nextBytes(b);
         }
-        byte[] b = new byte[48];
-        random.nextBytes(b);
         b[0] = (byte)spec.getMajorVersion();
         b[1] = (byte)spec.getMinorVersion();
 
--- a/src/java.base/share/classes/java/io/InputStream.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/io/InputStream.java	Thu Jan 21 10:17:21 2016 -0800
@@ -228,7 +228,7 @@
      *         allocated. For example, if an array larger than {@code 2GB} would
      *         be required to store the bytes.
      *
-     * @since 1.9
+     * @since 9
      */
     public byte[] readAllBytes() throws IOException {
         byte[] buf = new byte[DEFAULT_BUFFER_SIZE];
@@ -298,7 +298,7 @@
      * @throws IndexOutOfBoundsException If {@code off} is negative, {@code len}
      *         is negative, or {@code len} is greater than {@code b.length - off}
      *
-     * @since 1.9
+     * @since 9
      */
     public int readNBytes(byte[] b, int off, int len) throws IOException {
         Objects.requireNonNull(b);
@@ -514,7 +514,7 @@
      * @throws IOException if an I/O error occurs when reading or writing
      * @throws NullPointerException if {@code out} is {@code null}
      *
-     * @since 1.9
+     * @since 9
      */
     public long transferTo(OutputStream out) throws IOException {
         Objects.requireNonNull(out, "out");
--- a/src/java.base/share/classes/java/lang/AbstractStringBuilder.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/AbstractStringBuilder.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1526,7 +1526,7 @@
 
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public IntStream chars() {
@@ -1543,7 +1543,7 @@
 
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public IntStream codePoints() {
--- a/src/java.base/share/classes/java/lang/Character.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/Character.java	Thu Jan 21 10:17:21 2016 -0800
@@ -493,25 +493,25 @@
 
     /**
      * Weak bidirectional character type "LRI" in the Unicode specification.
-     * @since 1.9
+     * @since 9
      */
     public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_ISOLATE = 19;
 
     /**
      * Weak bidirectional character type "RLI" in the Unicode specification.
-     * @since 1.9
+     * @since 9
      */
     public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ISOLATE = 20;
 
     /**
      * Weak bidirectional character type "FSI" in the Unicode specification.
-     * @since 1.9
+     * @since 9
      */
     public static final byte DIRECTIONALITY_FIRST_STRONG_ISOLATE = 21;
 
     /**
      * Weak bidirectional character type "PDI" in the Unicode specification.
-     * @since 1.9
+     * @since 9
      */
     public static final byte DIRECTIONALITY_POP_DIRECTIONAL_ISOLATE = 22;
 
@@ -2590,7 +2590,7 @@
         /**
          * Constant for the "Combining Diacritical Marks Extended" Unicode
          * character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock COMBINING_DIACRITICAL_MARKS_EXTENDED =
             new UnicodeBlock("COMBINING_DIACRITICAL_MARKS_EXTENDED",
@@ -2599,7 +2599,7 @@
 
         /**
          * Constant for the "Myanmar Extended-B" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock MYANMAR_EXTENDED_B =
             new UnicodeBlock("MYANMAR_EXTENDED_B",
@@ -2608,7 +2608,7 @@
 
         /**
          * Constant for the "Latin Extended-E" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock LATIN_EXTENDED_E =
             new UnicodeBlock("LATIN_EXTENDED_E",
@@ -2617,7 +2617,7 @@
 
         /**
          * Constant for the "Coptic Epact Numbers" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock COPTIC_EPACT_NUMBERS =
             new UnicodeBlock("COPTIC_EPACT_NUMBERS",
@@ -2626,7 +2626,7 @@
 
         /**
          * Constant for the "Old Permic" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock OLD_PERMIC =
             new UnicodeBlock("OLD_PERMIC",
@@ -2635,14 +2635,14 @@
 
         /**
          * Constant for the "Elbasan" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock ELBASAN =
             new UnicodeBlock("ELBASAN");
 
         /**
          * Constant for the "Caucasian Albanian" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock CAUCASIAN_ALBANIAN =
             new UnicodeBlock("CAUCASIAN_ALBANIAN",
@@ -2651,7 +2651,7 @@
 
         /**
          * Constant for the "Linear A" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock LINEAR_A =
             new UnicodeBlock("LINEAR_A",
@@ -2660,21 +2660,21 @@
 
         /**
          * Constant for the "Palmyrene" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock PALMYRENE =
             new UnicodeBlock("PALMYRENE");
 
         /**
          * Constant for the "Nabataean" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock NABATAEAN =
             new UnicodeBlock("NABATAEAN");
 
         /**
          * Constant for the "Old North Arabian" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock OLD_NORTH_ARABIAN =
             new UnicodeBlock("OLD_NORTH_ARABIAN",
@@ -2683,14 +2683,14 @@
 
         /**
          * Constant for the "Manichaean" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock MANICHAEAN =
             new UnicodeBlock("MANICHAEAN");
 
         /**
          * Constant for the "Psalter Pahlavi" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock PSALTER_PAHLAVI =
             new UnicodeBlock("PSALTER_PAHLAVI",
@@ -2699,14 +2699,14 @@
 
         /**
          * Constant for the "Mahajani" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock MAHAJANI =
             new UnicodeBlock("MAHAJANI");
 
         /**
          * Constant for the "Sinhala Archaic Numbers" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock SINHALA_ARCHAIC_NUMBERS =
             new UnicodeBlock("SINHALA_ARCHAIC_NUMBERS",
@@ -2715,49 +2715,49 @@
 
         /**
          * Constant for the "Khojki" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock KHOJKI =
             new UnicodeBlock("KHOJKI");
 
         /**
          * Constant for the "Khudawadi" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock KHUDAWADI =
             new UnicodeBlock("KHUDAWADI");
 
         /**
          * Constant for the "Grantha" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock GRANTHA =
             new UnicodeBlock("GRANTHA");
 
         /**
          * Constant for the "Tirhuta" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock TIRHUTA =
             new UnicodeBlock("TIRHUTA");
 
         /**
          * Constant for the "Siddham" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock SIDDHAM =
             new UnicodeBlock("SIDDHAM");
 
         /**
          * Constant for the "Modi" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock MODI =
             new UnicodeBlock("MODI");
 
         /**
          * Constant for the "Warang Citi" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock WARANG_CITI =
             new UnicodeBlock("WARANG_CITI",
@@ -2766,7 +2766,7 @@
 
         /**
          * Constant for the "Pau Cin Hau" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock PAU_CIN_HAU =
             new UnicodeBlock("PAU_CIN_HAU",
@@ -2775,14 +2775,14 @@
 
         /**
          * Constant for the "Mro" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock MRO =
             new UnicodeBlock("MRO");
 
         /**
          * Constant for the "Bassa Vah" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock BASSA_VAH =
             new UnicodeBlock("BASSA_VAH",
@@ -2791,7 +2791,7 @@
 
         /**
          * Constant for the "Pahawh Hmong" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock PAHAWH_HMONG =
             new UnicodeBlock("PAHAWH_HMONG",
@@ -2800,14 +2800,14 @@
 
         /**
          * Constant for the "Duployan" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock DUPLOYAN =
             new UnicodeBlock("DUPLOYAN");
 
         /**
          * Constant for the "Shorthand Format Controls" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock SHORTHAND_FORMAT_CONTROLS =
             new UnicodeBlock("SHORTHAND_FORMAT_CONTROLS",
@@ -2816,7 +2816,7 @@
 
         /**
          * Constant for the "Mende Kikakui" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock MENDE_KIKAKUI =
             new UnicodeBlock("MENDE_KIKAKUI",
@@ -2825,7 +2825,7 @@
 
         /**
          * Constant for the "Ornamental Dingbats" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock ORNAMENTAL_DINGBATS =
             new UnicodeBlock("ORNAMENTAL_DINGBATS",
@@ -2834,7 +2834,7 @@
 
         /**
          * Constant for the "Geometric Shapes Extended" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock GEOMETRIC_SHAPES_EXTENDED =
             new UnicodeBlock("GEOMETRIC_SHAPES_EXTENDED",
@@ -2843,7 +2843,7 @@
 
         /**
          * Constant for the "Supplemental Arrows-C" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock SUPPLEMENTAL_ARROWS_C =
             new UnicodeBlock("SUPPLEMENTAL_ARROWS_C",
@@ -2852,7 +2852,7 @@
 
         /**
          * Constant for the "Cherokee Supplement" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock CHEROKEE_SUPPLEMENT =
             new UnicodeBlock("CHEROKEE_SUPPLEMENT",
@@ -2861,14 +2861,14 @@
 
         /**
          * Constant for the "Hatran" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock HATRAN =
             new UnicodeBlock("HATRAN");
 
         /**
          * Constant for the "Old Hungarian" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock OLD_HUNGARIAN =
             new UnicodeBlock("OLD_HUNGARIAN",
@@ -2877,21 +2877,21 @@
 
         /**
          * Constant for the "Multani" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock MULTANI =
             new UnicodeBlock("MULTANI");
 
         /**
          * Constant for the "Ahom" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock AHOM =
             new UnicodeBlock("AHOM");
 
         /**
          * Constant for the "Early Dynastic Cuneiform" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock EARLY_DYNASTIC_CUNEIFORM =
             new UnicodeBlock("EARLY_DYNASTIC_CUNEIFORM",
@@ -2900,7 +2900,7 @@
 
         /**
          * Constant for the "Anatolian Hieroglyphs" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock ANATOLIAN_HIEROGLYPHS =
             new UnicodeBlock("ANATOLIAN_HIEROGLYPHS",
@@ -2909,7 +2909,7 @@
 
         /**
          * Constant for the "Sutton SignWriting" Unicode character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock SUTTON_SIGNWRITING =
             new UnicodeBlock("SUTTON_SIGNWRITING",
@@ -2919,7 +2919,7 @@
         /**
          * Constant for the "Supplemental Symbols and Pictographs" Unicode
          * character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS =
             new UnicodeBlock("SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS",
@@ -2929,7 +2929,7 @@
         /**
          * Constant for the "CJK Unified Ideographs Extension E" Unicode
          * character block.
-         * @since 1.9
+         * @since 9
          */
         public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E =
             new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E",
@@ -4189,175 +4189,175 @@
 
         /**
          * Unicode script "Caucasian Albanian".
-         * @since 1.9
+         * @since 9
          */
         CAUCASIAN_ALBANIAN,
 
         /**
          * Unicode script "Bassa Vah".
-         * @since 1.9
+         * @since 9
          */
         BASSA_VAH,
 
         /**
          * Unicode script "Duployan".
-         * @since 1.9
+         * @since 9
          */
         DUPLOYAN,
 
         /**
          * Unicode script "Elbasan".
-         * @since 1.9
+         * @since 9
          */
         ELBASAN,
 
         /**
          * Unicode script "Grantha".
-         * @since 1.9
+         * @since 9
          */
         GRANTHA,
 
         /**
          * Unicode script "Pahawh Hmong".
-         * @since 1.9
+         * @since 9
          */
         PAHAWH_HMONG,
 
         /**
          * Unicode script "Khojki".
-         * @since 1.9
+         * @since 9
          */
         KHOJKI,
 
         /**
          * Unicode script "Linear A".
-         * @since 1.9
+         * @since 9
          */
         LINEAR_A,
 
         /**
          * Unicode script "Mahajani".
-         * @since 1.9
+         * @since 9
          */
         MAHAJANI,
 
         /**
          * Unicode script "Manichaean".
-         * @since 1.9
+         * @since 9
          */
         MANICHAEAN,
 
         /**
          * Unicode script "Mende Kikakui".
-         * @since 1.9
+         * @since 9
          */
         MENDE_KIKAKUI,
 
         /**
          * Unicode script "Modi".
-         * @since 1.9
+         * @since 9
          */
         MODI,
 
         /**
          * Unicode script "Mro".
-         * @since 1.9
+         * @since 9
          */
         MRO,
 
         /**
          * Unicode script "Old North Arabian".
-         * @since 1.9
+         * @since 9
          */
         OLD_NORTH_ARABIAN,
 
         /**
          * Unicode script "Nabataean".
-         * @since 1.9
+         * @since 9
          */
         NABATAEAN,
 
         /**
          * Unicode script "Palmyrene".
-         * @since 1.9
+         * @since 9
          */
         PALMYRENE,
 
         /**
          * Unicode script "Pau Cin Hau".
-         * @since 1.9
+         * @since 9
          */
         PAU_CIN_HAU,
 
         /**
          * Unicode script "Old Permic".
-         * @since 1.9
+         * @since 9
          */
         OLD_PERMIC,
 
         /**
          * Unicode script "Psalter Pahlavi".
-         * @since 1.9
+         * @since 9
          */
         PSALTER_PAHLAVI,
 
         /**
          * Unicode script "Siddham".
-         * @since 1.9
+         * @since 9
          */
         SIDDHAM,
 
         /**
          * Unicode script "Khudawadi".
-         * @since 1.9
+         * @since 9
          */
         KHUDAWADI,
 
         /**
          * Unicode script "Tirhuta".
-         * @since 1.9
+         * @since 9
          */
         TIRHUTA,
 
         /**
          * Unicode script "Warang Citi".
-         * @since 1.9
+         * @since 9
          */
         WARANG_CITI,
 
          /**
          * Unicode script "Ahom".
-         * @since 1.9
+         * @since 9
          */
         AHOM,
 
         /**
          * Unicode script "Anatolian Hieroglyphs".
-         * @since 1.9
+         * @since 9
          */
         ANATOLIAN_HIEROGLYPHS,
 
         /**
          * Unicode script "Hatran".
-         * @since 1.9
+         * @since 9
          */
         HATRAN,
 
         /**
          * Unicode script "Multani".
-         * @since 1.9
+         * @since 9
          */
         MULTANI,
 
         /**
          * Unicode script "Old Hungarian".
-         * @since 1.9
+         * @since 9
          */
         OLD_HUNGARIAN,
 
         /**
          * Unicode script "SignWriting".
-         * @since 1.9
+         * @since 9
          */
         SIGNWRITING,
 
--- a/src/java.base/share/classes/java/lang/Integer.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/Integer.java	Thu Jan 21 10:17:21 2016 -0800
@@ -716,7 +716,7 @@
      *             {@code radix}, or if {@code radix} is either smaller than
      *             {@link java.lang.Character#MIN_RADIX} or larger than
      *             {@link java.lang.Character#MAX_RADIX}.
-     * @since  1.9
+     * @since  9
      */
     public static int parseInt(CharSequence s, int beginIndex, int endIndex, int radix)
                 throws NumberFormatException {
@@ -899,7 +899,7 @@
      *             {@code radix}, or if {@code radix} is either smaller than
      *             {@link java.lang.Character#MIN_RADIX} or larger than
      *             {@link java.lang.Character#MAX_RADIX}.
-     * @since  1.9
+     * @since  9
      */
     public static int parseUnsignedInt(CharSequence s, int beginIndex, int endIndex, int radix)
                 throws NumberFormatException {
--- a/src/java.base/share/classes/java/lang/Long.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/Long.java	Thu Jan 21 10:17:21 2016 -0800
@@ -747,7 +747,7 @@
      *             {@code radix}, or if {@code radix} is either smaller than
      *             {@link java.lang.Character#MIN_RADIX} or larger than
      *             {@link java.lang.Character#MAX_RADIX}.
-     * @since  1.9
+     * @since  9
      */
     public static long parseLong(CharSequence s, int beginIndex, int endIndex, int radix)
                 throws NumberFormatException {
@@ -993,7 +993,7 @@
      *             {@code radix}, or if {@code radix} is either smaller than
      *             {@link java.lang.Character#MIN_RADIX} or larger than
      *             {@link java.lang.Character#MAX_RADIX}.
-     * @since  1.9
+     * @since  9
      */
     public static long parseUnsignedLong(CharSequence s, int beginIndex, int endIndex, int radix)
                 throws NumberFormatException {
--- a/src/java.base/share/classes/java/lang/Process.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/Process.java	Thu Jan 21 10:17:21 2016 -0800
@@ -304,7 +304,7 @@
      *         otherwise, {@link #destroy} forcibly terminates the process
      * @throws UnsupportedOperationException if the Process implementation
      *         does not support this operation
-     * @since 1.9
+     * @since 9
      */
     public boolean supportsNormalTermination() {
         throw new UnsupportedOperationException(this.getClass()
@@ -340,7 +340,7 @@
      * @return the native process id of the process
      * @throws UnsupportedOperationException if the Process implementation
      *         does not support this operation
-     * @since 1.9
+     * @since 9
      */
     public long getPid() {
         return toHandle().getPid();
@@ -409,7 +409,7 @@
      *
      * @return a new {@code CompletableFuture<Process>} for the Process
      *
-     * @since 1.9
+     * @since 9
      */
     public CompletableFuture<Process> onExit() {
         return CompletableFuture.supplyAsync(this::waitForInternal);
@@ -471,7 +471,7 @@
      *         does not support this operation
      * @throws SecurityException if a security manager has been installed and
      *         it denies RuntimePermission("manageProcess")
-     * @since 1.9
+     * @since 9
      */
     public ProcessHandle toHandle() {
         throw new UnsupportedOperationException(this.getClass()
@@ -491,7 +491,7 @@
      * @return a snapshot of information about the process, always non-null
      * @throws UnsupportedOperationException if the Process implementation
      *         does not support this operation
-     * @since 1.9
+     * @since 9
      */
     public ProcessHandle.Info info() {
         return toHandle().info();
@@ -516,7 +516,7 @@
      *         does not support this operation
      * @throws SecurityException if a security manager has been installed and
      *         it denies RuntimePermission("manageProcess")
-     * @since 1.9
+     * @since 9
      */
     public Stream<ProcessHandle> children() {
         return toHandle().children();
@@ -542,7 +542,7 @@
      *         does not support this operation
      * @throws SecurityException if a security manager has been installed and
      *         it denies RuntimePermission("manageProcess")
-     * @since 1.9
+     * @since 9
      */
     public Stream<ProcessHandle> descendants() {
         return toHandle().descendants();
--- a/src/java.base/share/classes/java/lang/ProcessHandle.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/ProcessHandle.java	Thu Jan 21 10:17:21 2016 -0800
@@ -89,7 +89,7 @@
  * {@link #compareTo(ProcessHandle) compareTo} methods to compare ProcessHandles.
  *
  * @see Process
- * @since 1.9
+ * @since 9
  */
 public interface ProcessHandle extends Comparable<ProcessHandle> {
 
@@ -215,7 +215,7 @@
      * by the operating system privileges of the process making the request.
      * The return types are {@code Optional<T>} allowing explicit tests
      * and actions if the value is available.
-     * @since 1.9
+     * @since 9
      */
     public interface Info {
         /**
--- a/src/java.base/share/classes/java/lang/ProcessHandleImpl.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/ProcessHandleImpl.java	Thu Jan 21 10:17:21 2016 -0800
@@ -50,7 +50,7 @@
  * ProcessHandleImpl is the implementation of ProcessHandle.
  *
  * @see Process
- * @since 1.9
+ * @since 9
  */
 final class ProcessHandleImpl implements ProcessHandle {
     /**
@@ -338,7 +338,7 @@
      *
      * @return {@code true} if the process represented by this
      * {@code ProcessHandle} object has not yet terminated.
-     * @since 1.9
+     * @since 9
      */
     @Override
     public boolean isAlive() {
--- a/src/java.base/share/classes/java/lang/StackWalker.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/StackWalker.java	Thu Jan 21 10:17:21 2016 -0800
@@ -81,7 +81,7 @@
  * will cause a {@link NullPointerException NullPointerException}
  * to be thrown.
  *
- * @since 1.9
+ * @since 9
  */
 public final class StackWalker {
     /**
@@ -92,7 +92,7 @@
      * by the {@linkplain Option stack walking options} of a {@linkplain
      * StackWalker stack walker}.
      *
-     * @since 1.9
+     * @since 9
      * @jvms 2.6
      */
     public static interface StackFrame {
@@ -185,7 +185,7 @@
      * Stack walker option to configure the {@linkplain StackFrame stack frame}
      * information obtained by a {@code StackWalker}.
      *
-     * @since 1.9
+     * @since 9
      */
     public enum Option {
         /**
--- a/src/java.base/share/classes/java/lang/String.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/String.java	Thu Jan 21 10:17:21 2016 -0800
@@ -2674,7 +2674,7 @@
      * point</a> is passed through uninterpreted.
      *
      * @return an IntStream of char values from this sequence
-     * @since 1.9
+     * @since 9
      */
     @Override
     public IntStream chars() {
@@ -2694,7 +2694,7 @@
      * {@code int} values which are then passed to the stream.
      *
      * @return an IntStream of Unicode code points from this sequence
-     * @since 1.9
+     * @since 9
      */
     @Override
     public IntStream codePoints() {
--- a/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java	Thu Jan 21 10:17:21 2016 -0800
@@ -25,25 +25,25 @@
 
 package java.lang.invoke;
 
-import static jdk.internal.org.objectweb.asm.Opcodes.*;
-import static java.lang.invoke.LambdaForm.*;
-import static java.lang.invoke.LambdaForm.BasicType.*;
-import static java.lang.invoke.MethodHandleStatics.*;
+import jdk.internal.vm.annotation.Stable;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.FieldVisitor;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import sun.invoke.util.ValueConversions;
+import sun.invoke.util.Wrapper;
 
 import java.lang.invoke.LambdaForm.NamedFunction;
 import java.lang.invoke.MethodHandles.Lookup;
 import java.lang.reflect.Field;
 import java.util.Arrays;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 import java.util.function.Function;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ConcurrentHashMap;
 
-import jdk.internal.org.objectweb.asm.FieldVisitor;
-import sun.invoke.util.ValueConversions;
-import sun.invoke.util.Wrapper;
-
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.MethodVisitor;
+import static java.lang.invoke.LambdaForm.BasicType;
+import static java.lang.invoke.LambdaForm.BasicType.*;
+import static java.lang.invoke.MethodHandleStatics.*;
+import static jdk.internal.org.objectweb.asm.Opcodes.*;
 
 /**
  * The flavor of method handle which emulates an invoke instruction
@@ -459,7 +459,7 @@
         static final String BMH_SIG  = "L"+BMH+";";
         static final String SPECIES_DATA     = "java/lang/invoke/BoundMethodHandle$SpeciesData";
         static final String SPECIES_DATA_SIG = "L"+SPECIES_DATA+";";
-        static final String STABLE_SIG       = "Ljava/lang/invoke/Stable;";
+        static final String STABLE_SIG       = "Ljdk/internal/vm/annotation/Stable;";
 
         static final String SPECIES_PREFIX_NAME = "Species_";
         static final String SPECIES_PREFIX_PATH = BMH + "$" + SPECIES_PREFIX_NAME;
--- a/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java	Thu Jan 21 10:17:21 2016 -0800
@@ -26,19 +26,23 @@
 package java.lang.invoke;
 
 import jdk.internal.misc.Unsafe;
+import jdk.internal.vm.annotation.ForceInline;
+import sun.invoke.util.ValueConversions;
+import sun.invoke.util.VerifyAccess;
+import sun.invoke.util.VerifyType;
+import sun.invoke.util.Wrapper;
+
+import java.lang.ref.WeakReference;
+import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.util.Arrays;
-import sun.invoke.util.VerifyAccess;
+import java.util.Objects;
+
+import static java.lang.invoke.LambdaForm.*;
 import static java.lang.invoke.MethodHandleNatives.Constants.*;
-import static java.lang.invoke.LambdaForm.*;
+import static java.lang.invoke.MethodHandleStatics.UNSAFE;
+import static java.lang.invoke.MethodHandleStatics.newInternalError;
 import static java.lang.invoke.MethodTypeForm.*;
-import static java.lang.invoke.MethodHandleStatics.*;
-import java.lang.ref.WeakReference;
-import java.lang.reflect.Field;
-import java.util.Objects;
-import sun.invoke.util.ValueConversions;
-import sun.invoke.util.VerifyType;
-import sun.invoke.util.Wrapper;
 
 /**
  * The flavor of method handle which implements a constant reference
--- a/src/java.base/share/classes/java/lang/invoke/DontInline.java	Thu Jan 21 09:46:03 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  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.
- */
-
-package java.lang.invoke;
-
-import java.lang.annotation.*;
-
-/**
- * Internal marker for some methods in the JSR 292 implementation.
- */
-/*non-public*/
-@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
-@Retention(RetentionPolicy.RUNTIME)
-@interface DontInline {
-}
--- a/src/java.base/share/classes/java/lang/invoke/ForceInline.java	Thu Jan 21 09:46:03 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  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.
- */
-
-package java.lang.invoke;
-
-import java.lang.annotation.*;
-
-/**
- * Internal marker for some methods in the JSR 292 implementation.
- */
-/*non-public*/
-@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
-@Retention(RetentionPolicy.RUNTIME)
-@interface ForceInline {
-}
--- a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Thu Jan 21 10:17:21 2016 -0800
@@ -625,9 +625,9 @@
 
         if (lambdaForm.forceInline) {
             // Force inlining of this invoker method.
-            mv.visitAnnotation("Ljava/lang/invoke/ForceInline;", true);
+            mv.visitAnnotation("Ljdk/internal/vm/annotation/ForceInline;", true);
         } else {
-            mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true);
+            mv.visitAnnotation("Ljdk/internal/vm/annotation/DontInline;", true);
         }
 
         if (lambdaForm.customized != null) {
@@ -1309,7 +1309,7 @@
         mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
 
         // Don't inline the interpreter entry.
-        mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true);
+        mv.visitAnnotation("Ljdk/internal/vm/annotation/DontInline;", true);
 
         // create parameter array
         emitIconstInsn(invokerType.parameterCount());
@@ -1368,7 +1368,7 @@
         mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
 
         // Force inlining of this invoker method.
-        mv.visitAnnotation("Ljava/lang/invoke/ForceInline;", true);
+        mv.visitAnnotation("Ljdk/internal/vm/annotation/ForceInline;", true);
 
         // Load receiver
         emitAloadInsn(0);
--- a/src/java.base/share/classes/java/lang/invoke/Invokers.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/Invokers.java	Thu Jan 21 10:17:21 2016 -0800
@@ -25,6 +25,10 @@
 
 package java.lang.invoke;
 
+import jdk.internal.vm.annotation.DontInline;
+import jdk.internal.vm.annotation.ForceInline;
+import jdk.internal.vm.annotation.Stable;
+
 import java.lang.reflect.Array;
 import java.util.Arrays;
 
--- a/src/java.base/share/classes/java/lang/invoke/LambdaForm.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/LambdaForm.java	Thu Jan 21 10:17:21 2016 -0800
@@ -25,18 +25,24 @@
 
 package java.lang.invoke;
 
-import java.lang.annotation.*;
+import jdk.internal.vm.annotation.DontInline;
+import jdk.internal.vm.annotation.Stable;
+import sun.invoke.util.Wrapper;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.reflect.Field;
 import java.lang.reflect.Method;
-import java.util.List;
 import java.util.Arrays;
 import java.util.HashMap;
-
-import sun.invoke.util.Wrapper;
-import java.lang.reflect.Field;
+import java.util.List;
 
 import static java.lang.invoke.LambdaForm.BasicType.*;
-import static java.lang.invoke.MethodHandleStatics.*;
-import static java.lang.invoke.MethodHandleNatives.Constants.*;
+import static java.lang.invoke.MethodHandleNatives.Constants.REF_invokeStatic;
+import static java.lang.invoke.MethodHandleStatics.debugEnabled;
+import static java.lang.invoke.MethodHandleStatics.newInternalError;
 
 /**
  * The symbolic, non-executable form of a method handle's invocation semantics.
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Thu Jan 21 10:17:21 2016 -0800
@@ -33,6 +33,7 @@
 import java.util.List;
 import java.util.function.Function;
 
+import jdk.internal.vm.annotation.Stable;
 import sun.invoke.empty.Empty;
 import sun.invoke.util.ValueConversions;
 import sun.invoke.util.VerifyType;
@@ -1487,7 +1488,7 @@
     }
 
     private static final int LEFT_ARGS = FILL_ARRAYS_COUNT - 1;
-    private static final @Stable MethodHandle[] FILL_ARRAY_TO_RIGHT = new MethodHandle[MAX_ARITY+1];
+    private static final @Stable MethodHandle[] FILL_ARRAY_TO_RIGHT = new MethodHandle[MAX_ARITY + 1];
     /** fill_array_to_right(N).invoke(a, argL..arg[N-1])
      *  fills a[L]..a[N-1] with corresponding arguments,
      *  and then returns a.  The value L is a global constant (LEFT_ARGS).
--- a/src/java.base/share/classes/java/lang/invoke/MethodType.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/MethodType.java	Thu Jan 21 10:17:21 2016 -0800
@@ -25,6 +25,7 @@
 
 package java.lang.invoke;
 
+import jdk.internal.vm.annotation.Stable;
 import sun.invoke.util.Wrapper;
 import java.lang.ref.WeakReference;
 import java.lang.ref.Reference;
--- a/src/java.base/share/classes/java/lang/invoke/MethodTypeForm.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/invoke/MethodTypeForm.java	Thu Jan 21 10:17:21 2016 -0800
@@ -25,6 +25,7 @@
 
 package java.lang.invoke;
 
+import jdk.internal.vm.annotation.Stable;
 import sun.invoke.util.Wrapper;
 import java.lang.ref.SoftReference;
 import static java.lang.invoke.MethodHandleStatics.*;
--- a/src/java.base/share/classes/java/lang/invoke/Stable.java	Thu Jan 21 09:46:03 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +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.  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.
- */
-
-package java.lang.invoke;
-
-import java.lang.annotation.*;
-
-/**
- * A field may be annotated as stable if all of its component variables
- * changes value at most once.
- * A field's value counts as its component value.
- * If the field is typed as an array, then all the non-null components
- * of the array, of depth up to the rank of the field's array type,
- * also count as component values.
- * By extension, any variable (either array or field) which has annotated
- * as stable is called a stable variable, and its non-null or non-zero
- * value is called a stable value.
- * <p>
- * Since all fields begin with a default value of null for references
- * (resp., zero for primitives), it follows that this annotation indicates
- * that the first non-null (resp., non-zero) value stored in the field
- * will never be changed.
- * <p>
- * If the field is not of an array type, there are no array elements,
- * then the value indicated as stable is simply the value of the field.
- * If the dynamic type of the field value is an array but the static type
- * is not, the components of the array are <em>not</em> regarded as stable.
- * <p>
- * If the field is an array type, then both the field value and
- * all the components of the field value (if the field value is non-null)
- * are indicated to be stable.
- * If the field type is an array type with rank {@code N > 1},
- * then each component of the field value (if the field value is non-null),
- * is regarded as a stable array of rank {@code N-1}.
- * <p>
- * Fields which are declared {@code final} may also be annotated as stable.
- * Since final fields already behave as stable values, such an annotation
- * indicates no additional information, unless the type of the field is
- * an array type.
- * <p>
- * It is (currently) undefined what happens if a field annotated as stable
- * is given a third value.  In practice, if the JVM relies on this annotation
- * to promote a field reference to a constant, it may be that the Java memory
- * model would appear to be broken, if such a constant (the second value of the field)
- * is used as the value of the field even after the field value has changed.
- */
-/* package-private */
-@Target(ElementType.FIELD)
-@Retention(RetentionPolicy.RUNTIME)
-@interface Stable {
-}
--- a/src/java.base/share/classes/java/lang/ref/PhantomReference.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/ref/PhantomReference.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -29,23 +29,20 @@
 /**
  * Phantom reference objects, which are enqueued after the collector
  * determines that their referents may otherwise be reclaimed.  Phantom
- * references are most often used for scheduling pre-mortem cleanup actions in
- * a more flexible way than is possible with the Java finalization mechanism.
+ * references are most often used to schedule post-mortem cleanup actions.
  *
- * <p> If the garbage collector determines at a certain point in time that the
- * referent of a phantom reference is <a
- * href="package-summary.html#reachability">phantom reachable</a>, then at that
- * time or at some later time it will enqueue the reference.
+ * <p> Suppose the garbage collector determines at a certain point in time
+ * that an object is <a href="package-summary.html#reachability">
+ * phantom reachable</a>.  At that time it will atomically clear
+ * all phantom references to that object and all phantom references to
+ * any other phantom-reachable objects from which that object is reachable.
+ * At the same time or at some later time it will enqueue those newly-cleared
+ * phantom references that are registered with reference queues.
  *
  * <p> In order to ensure that a reclaimable object remains so, the referent of
  * a phantom reference may not be retrieved: The {@code get} method of a
  * phantom reference always returns {@code null}.
  *
- * <p> Unlike soft and weak references, phantom references are not
- * automatically cleared by the garbage collector as they are enqueued.  An
- * object that is reachable via phantom references will remain so until all
- * such references are cleared or themselves become unreachable.
- *
  * @author   Mark Reinhold
  * @since    1.2
  */
@@ -69,8 +66,8 @@
      *
      * <p> It is possible to create a phantom reference with a {@code null}
      * queue, but such a reference is completely useless: Its {@code get}
-     * method will always return null and, since it does not have a queue, it
-     * will never be enqueued.
+     * method will always return {@code null} and, since it does not have a queue,
+     * it will never be enqueued.
      *
      * @param referent the object the new phantom reference will refer to
      * @param q the queue with which the reference is to be registered,
--- a/src/java.base/share/classes/java/lang/ref/Reference.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/ref/Reference.java	Thu Jan 21 10:17:21 2016 -0800
@@ -25,6 +25,7 @@
 
 package java.lang.ref;
 
+import jdk.internal.vm.annotation.DontInline;
 import sun.misc.Cleaner;
 import jdk.internal.HotSpotIntrinsicCandidate;
 import jdk.internal.misc.JavaLangRefAccess;
@@ -310,4 +311,120 @@
         this.queue = (queue == null) ? ReferenceQueue.NULL : queue;
     }
 
+    /**
+     * Ensures that the object referenced by the given reference remains
+     * <a href="package-summary.html#reachability"><em>strongly reachable</em></a>,
+     * regardless of any prior actions of the program that might otherwise cause
+     * the object to become unreachable; thus, the referenced object is not
+     * reclaimable by garbage collection at least until after the invocation of
+     * this method.  Invocation of this method does not itself initiate garbage
+     * collection or finalization.
+     *
+     * <p> This method establishes an ordering for
+     * <a href="package-summary.html#reachability"><em>strong reachability</em></a>
+     * with respect to garbage collection.  It controls relations that are
+     * otherwise only implicit in a program -- the reachability conditions
+     * triggering garbage collection.  This method is designed for use in
+     * uncommon situations of premature finalization where using
+     * {@code synchronized} blocks or methods, or using other synchronization
+     * facilities are not possible or do not provide the desired control.  This
+     * method is applicable only when reclamation may have visible effects,
+     * which is possible for objects with finalizers (See
+     * <a href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-12.html#jls-12.6">
+     * Section 12.6 17 of <cite>The Java&trade; Language Specification</cite></a>)
+     * that are implemented in ways that rely on ordering control for correctness.
+     *
+     * @apiNote
+     * Finalization may occur whenever the virtual machine detects that no
+     * reference to an object will ever be stored in the heap: The garbage
+     * collector may reclaim an object even if the fields of that object are
+     * still in use, so long as the object has otherwise become unreachable.
+     * This may have surprising and undesirable effects in cases such as the
+     * following example in which the bookkeeping associated with a class is
+     * managed through array indices.  Here, method {@code action} uses a
+     * {@code reachabilityFence} to ensure that the {@code Resource} object is
+     * not reclaimed before bookkeeping on an associated
+     * {@code ExternalResource} has been performed; in particular here, to
+     * ensure that the array slot holding the {@code ExternalResource} is not
+     * nulled out in method {@link Object#finalize}, which may otherwise run
+     * concurrently.
+     *
+     * <pre> {@code
+     * class Resource {
+     *   private static ExternalResource[] externalResourceArray = ...
+     *
+     *   int myIndex;
+     *   Resource(...) {
+     *     myIndex = ...
+     *     externalResourceArray[myIndex] = ...;
+     *     ...
+     *   }
+     *   protected void finalize() {
+     *     externalResourceArray[myIndex] = null;
+     *     ...
+     *   }
+     *   public void action() {
+     *     try {
+     *       // ...
+     *       int i = myIndex;
+     *       Resource.update(externalResourceArray[i]);
+     *     } finally {
+     *       Reference.reachabilityFence(this);
+     *     }
+     *   }
+     *   private static void update(ExternalResource ext) {
+     *     ext.status = ...;
+     *   }
+     * }}</pre>
+     *
+     * Here, the invocation of {@code reachabilityFence} is nonintuitively
+     * placed <em>after</em> the call to {@code update}, to ensure that the
+     * array slot is not nulled out by {@link Object#finalize} before the
+     * update, even if the call to {@code action} was the last use of this
+     * object.  This might be the case if, for example a usage in a user program
+     * had the form {@code new Resource().action();} which retains no other
+     * reference to this {@code Resource}.  While probably overkill here,
+     * {@code reachabilityFence} is placed in a {@code finally} block to ensure
+     * that it is invoked across all paths in the method.  In a method with more
+     * complex control paths, you might need further precautions to ensure that
+     * {@code reachabilityFence} is encountered along all of them.
+     *
+     * <p> It is sometimes possible to better encapsulate use of
+     * {@code reachabilityFence}.  Continuing the above example, if it were
+     * acceptable for the call to method {@code update} to proceed even if the
+     * finalizer had already executed (nulling out slot), then you could
+     * localize use of {@code reachabilityFence}:
+     *
+     * <pre> {@code
+     * public void action2() {
+     *   // ...
+     *   Resource.update(getExternalResource());
+     * }
+     * private ExternalResource getExternalResource() {
+     *   ExternalResource ext = externalResourceArray[myIndex];
+     *   Reference.reachabilityFence(this);
+     *   return ext;
+     * }}</pre>
+     *
+     * <p> Method {@code reachabilityFence} is not required in constructions
+     * that themselves ensure reachability.  For example, because objects that
+     * are locked cannot, in general, be reclaimed, it would suffice if all
+     * accesses of the object, in all methods of class {@code Resource}
+     * (including {@code finalize}) were enclosed in {@code synchronized (this)}
+     * blocks.  (Further, such blocks must not include infinite loops, or
+     * themselves be unreachable, which fall into the corner case exceptions to
+     * the "in general" disclaimer.)  However, method {@code reachabilityFence}
+     * remains a better option in cases where this approach is not as efficient,
+     * desirable, or possible; for example because it would encounter deadlock.
+     *
+     * @param ref the reference. If {@code null}, this method has no effect.
+     * @since 9
+     */
+    @DontInline
+    public static void reachabilityFence(Object ref) {
+        // Does nothing, because this method is annotated with @DontInline
+        // HotSpot needs to retain the ref and not GC it before a call to this
+        // method
+    }
+
 }
--- a/src/java.base/share/classes/java/lang/ref/package-info.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/ref/package-info.java	Thu Jan 21 10:17:21 2016 -0800
@@ -66,9 +66,9 @@
  * object with a <em>reference queue</em> at the time the reference
  * object is created.  Some time after the garbage collector
  * determines that the reachability of the referent has changed to the
- * value corresponding to the type of the reference, it will add the
- * reference to the associated queue.  At this point, the reference is
- * considered to be <em>enqueued</em>.  The program may remove
+ * value corresponding to the type of the reference, it will clear the
+ * reference and add it to the associated queue.  At this point, the
+ * reference is considered to be <em>enqueued</em>.  The program may remove
  * references from a queue either by polling or by blocking until a
  * reference becomes available.  Reference queues are implemented by
  * the {@link java.lang.ref.ReferenceQueue} class.
@@ -94,16 +94,6 @@
  * structure, this check will add little overhead to the hashtable
  * access methods.
  *
- * <h3>Automatically-cleared references</h3>
- *
- * Soft and weak references are automatically cleared by the collector
- * before being added to the queues with which they are registered, if
- * any.  Therefore soft and weak references need not be registered
- * with a queue in order to be useful, while phantom references do.
- * An object that is reachable via phantom references will remain so
- * until all such references are cleared or themselves become
- * unreachable.
- *
  * <a name="reachability"></a>
  * <h3>Reachability</h3>
  *
--- a/src/java.base/share/classes/java/lang/reflect/AnnotatedArrayType.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/reflect/AnnotatedArrayType.java	Thu Jan 21 10:17:21 2016 -0800
@@ -53,7 +53,7 @@
      *
      * @return {@code null}
      *
-     * @since 1.9
+     * @since 9
      */
     @Override
     AnnotatedType getAnnotatedOwnerType();
--- a/src/java.base/share/classes/java/lang/reflect/AnnotatedParameterizedType.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/reflect/AnnotatedParameterizedType.java	Thu Jan 21 10:17:21 2016 -0800
@@ -59,7 +59,7 @@
      *     refers to a parameterized type that cannot be instantiated
      *     for any reason
      *
-     * @since 1.9
+     * @since 9
      */
     @Override
     AnnotatedType getAnnotatedOwnerType();
--- a/src/java.base/share/classes/java/lang/reflect/AnnotatedType.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/reflect/AnnotatedType.java	Thu Jan 21 10:17:21 2016 -0800
@@ -60,7 +60,7 @@
      *     refers to a parameterized type that cannot be instantiated
      *     for any reason
      *
-     * @since 1.9
+     * @since 9
      */
     default AnnotatedType getAnnotatedOwnerType() {
         return null;
--- a/src/java.base/share/classes/java/lang/reflect/AnnotatedTypeVariable.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/reflect/AnnotatedTypeVariable.java	Thu Jan 21 10:17:21 2016 -0800
@@ -54,7 +54,7 @@
      *
      * @return {@code null}
      *
-     * @since 1.9
+     * @since 9
      */
     @Override
     AnnotatedType getAnnotatedOwnerType();
--- a/src/java.base/share/classes/java/lang/reflect/AnnotatedWildcardType.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/lang/reflect/AnnotatedWildcardType.java	Thu Jan 21 10:17:21 2016 -0800
@@ -65,7 +65,7 @@
      *
      * @return {@code null}
      *
-     * @since 1.9
+     * @since 9
      */
     @Override
     AnnotatedType getAnnotatedOwnerType();
--- a/src/java.base/share/classes/java/math/BigInteger.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/math/BigInteger.java	Thu Jan 21 10:17:21 2016 -0800
@@ -297,7 +297,7 @@
      * @throws IndexOutOfBoundsException if the provided array offset and
      *         length would cause an index into the byte array to be
      *         negative or greater than or equal to the array length.
-     * @since 1.9
+     * @since 9
      */
     public BigInteger(byte[] val, int off, int len) {
         if (val.length == 0) {
@@ -385,7 +385,7 @@
      * @throws IndexOutOfBoundsException if the provided array offset and
      *         length would cause an index into the byte array to be
      *         negative or greater than or equal to the array length.
-     * @since 1.9
+     * @since 9
      */
     public BigInteger(int signum, byte[] magnitude, int off, int len) {
         if (signum < -1 || signum > 1) {
@@ -2424,7 +2424,7 @@
      *         {@code (i * sqrt(-val))} where <i>i</i> is the
      *         <i>imaginary unit</i> and is equal to
      *         {@code sqrt(-1)}.)
-     * @since  1.9
+     * @since  9
      */
     public BigInteger sqrt() {
         if (this.signum < 0) {
@@ -2447,7 +2447,7 @@
      *         <i>imaginary unit</i> and is equal to
      *         {@code sqrt(-1)}.)
      * @see #sqrt()
-     * @since  1.9
+     * @since  9
      */
     public BigInteger[] sqrtAndRemainder() {
         BigInteger s = sqrt();
--- a/src/java.base/share/classes/java/math/MutableBigInteger.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/math/MutableBigInteger.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1878,7 +1878,7 @@
      * @throws ArithmeticException if the value returned by {@code bitLength()}
      * overflows the range of {@code int}.
      * @return the integer square root of {@code this}
-     * @since 1.9
+     * @since 9
      */
     MutableBigInteger sqrt() {
         // Special cases.
--- a/src/java.base/share/classes/java/net/DatagramSocket.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/net/DatagramSocket.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1338,7 +1338,7 @@
      *
      * @throws NullPointerException if name is {@code null}
      *
-     * @since 1.9
+     * @since 9
      */
     public <T> DatagramSocket setOption(SocketOption<T> name, T value)
         throws IOException
@@ -1368,7 +1368,7 @@
      *         {@link java.net.StandardSocketOptions StandardSocketOptions}
      *         do not require any security permission.
      *
-     * @since 1.9
+     * @since 9
      */
     public <T> T getOption(SocketOption<T> name) throws IOException {
         return getImpl().getOption(name);
@@ -1386,7 +1386,7 @@
      * @return A set of the socket options supported by this socket. This set
      *        may be empty if the socket's DatagramSocketImpl cannot be created.
      *
-     * @since 1.9
+     * @since 9
      */
     public Set<SocketOption<?>> supportedOptions() {
         synchronized(DatagramSocket.class) {
--- a/src/java.base/share/classes/java/net/DatagramSocketImpl.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/net/DatagramSocketImpl.java	Thu Jan 21 10:17:21 2016 -0800
@@ -278,7 +278,7 @@
      *
      * @throws NullPointerException if name is {@code null}
      * @throws IOException if an I/O problem occurs while attempting to set the option
-     * @since 1.9
+     * @since 9
      */
     protected <T> void setOption(SocketOption<T> name, T value) throws IOException {
         if (name == StandardSocketOptions.SO_SNDBUF) {
@@ -319,7 +319,7 @@
      * @throws NullPointerException if name is {@code null}
      * @throws IOException if an I/O problem occurs while attempting to set the option
      *
-     * @since 1.9
+     * @since 9
      */
     @SuppressWarnings("unchecked")
     protected <T> T getOption(SocketOption<T> name) throws IOException {
--- a/src/java.base/share/classes/java/net/NetworkInterface.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/net/NetworkInterface.java	Thu Jan 21 10:17:21 2016 -0800
@@ -130,7 +130,7 @@
      *
      * @return a Stream object with all or a subset of the InetAddresses
      * bound to this network interface
-     * @since 1.9
+     * @since 9
      */
     public Stream<InetAddress> inetAddresses() {
         return streamFromArray(getCheckedInetAddresses());
@@ -208,7 +208,7 @@
      *
      * @return a Stream object with all of the subinterfaces
      * of this network interface
-     * @since 1.9
+     * @since 9
      */
     public Stream<NetworkInterface> subInterfaces() {
         return streamFromArray(childs);
@@ -362,7 +362,7 @@
      *
      * @return a Stream of NetworkInterfaces found on this machine
      * @exception  SocketException  if an I/O error occurs.
-     * @since 1.9
+     * @since 9
      */
     public static Stream<NetworkInterface> networkInterfaces()
         throws SocketException {
--- a/src/java.base/share/classes/java/net/ServerSocket.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/net/ServerSocket.java	Thu Jan 21 10:17:21 2016 -0800
@@ -946,7 +946,7 @@
      *         {@link java.net.StandardSocketOptions StandardSocketOptions}
      *         do not require any security permission.
      *
-     * @since 1.9
+     * @since 9
      */
     public <T> ServerSocket setOption(SocketOption<T> name, T value)
         throws IOException
@@ -976,7 +976,7 @@
      *         {@link java.net.StandardSocketOptions StandardSocketOptions}
      *         do not require any security permission.
      *
-     * @since 1.9
+     * @since 9
      */
     public <T> T getOption(SocketOption<T> name) throws IOException {
         return getImpl().getOption(name);
@@ -994,7 +994,7 @@
      * @return A set of the socket options supported by this socket. This set
      *         may be empty if the socket's SocketImpl cannot be created.
      *
-     * @since 1.9
+     * @since 9
      */
     public Set<SocketOption<?>> supportedOptions() {
         synchronized (ServerSocket.class) {
--- a/src/java.base/share/classes/java/net/Socket.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/net/Socket.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1756,7 +1756,7 @@
      *         {@link java.net.StandardSocketOptions StandardSocketOptions}
      *         do not require any security permission.
      *
-     * @since 1.9
+     * @since 9
      */
     public <T> Socket setOption(SocketOption<T> name, T value) throws IOException {
         getImpl().setOption(name, value);
@@ -1784,7 +1784,7 @@
      *         {@link java.net.StandardSocketOptions StandardSocketOptions}
      *         do not require any security permission.
      *
-     * @since 1.9
+     * @since 9
      */
     @SuppressWarnings("unchecked")
     public <T> T getOption(SocketOption<T> name) throws IOException {
@@ -1803,7 +1803,7 @@
      * @return A set of the socket options supported by this socket. This set
      *         may be empty if the socket's SocketImpl cannot be created.
      *
-     * @since 1.9
+     * @since 9
      */
     public Set<SocketOption<?>> supportedOptions() {
         synchronized (Socket.class) {
--- a/src/java.base/share/classes/java/net/SocketImpl.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/net/SocketImpl.java	Thu Jan 21 10:17:21 2016 -0800
@@ -373,7 +373,7 @@
      *
      * @throws IOException if an I/O error occurs, or if the socket is closed.
      *
-     * @since 1.9
+     * @since 9
      */
     protected <T> void setOption(SocketOption<T> name, T value) throws IOException {
         if (name == StandardSocketOptions.SO_KEEPALIVE &&
@@ -412,7 +412,7 @@
      *
      * @throws IOException if an I/O error occurs, or if the socket is closed.
      *
-     * @since 1.9
+     * @since 9
      */
     @SuppressWarnings("unchecked")
     protected <T> T getOption(SocketOption<T> name) throws IOException {
--- a/src/java.base/share/classes/java/net/URL.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/net/URL.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -31,6 +31,10 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Hashtable;
+import java.io.InvalidObjectException;
+import java.io.ObjectStreamException;
+import java.io.ObjectStreamField;
+import java.io.ObjectInputStream.GetField;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.ServiceConfigurationError;
@@ -142,6 +146,7 @@
  */
 public final class URL implements java.io.Serializable {
 
+    static final String BUILTIN_HANDLERS_PREFIX = "sun.net.www.protocol";
     static final long serialVersionUID = -7627629688361524110L;
 
     /**
@@ -226,6 +231,8 @@
      */
     private int hashCode = -1;
 
+    private transient UrlDeserializedState tempState;
+
     /**
      * Creates a {@code URL} object from the specified
      * {@code protocol}, {@code host}, {@code port}
@@ -1354,6 +1361,31 @@
     }
 
     /**
+     * @serialField    protocol String
+     *
+     * @serialField    host String
+     *
+     * @serialField    port int
+     *
+     * @serialField    authority String
+     *
+     * @serialField    file String
+     *
+     * @serialField    ref String
+     *
+     * @serialField    hashCode int
+     *
+     */
+    private static final ObjectStreamField[] serialPersistentFields = {
+        new ObjectStreamField("protocol", String.class),
+        new ObjectStreamField("host", String.class),
+        new ObjectStreamField("port", int.class),
+        new ObjectStreamField("authority", String.class),
+        new ObjectStreamField("file", String.class),
+        new ObjectStreamField("ref", String.class),
+        new ObjectStreamField("hashCode", int.class), };
+
+    /**
      * WriteObject is called to save the state of the URL to an
      * ObjectOutputStream. The handler is not saved since it is
      * specific to this system.
@@ -1375,16 +1407,67 @@
      * stream handler.
      */
     private synchronized void readObject(java.io.ObjectInputStream s)
-         throws IOException, ClassNotFoundException
-    {
-        s.defaultReadObject();  // read the fields
-        if ((handler = getURLStreamHandler(protocol)) == null) {
+            throws IOException, ClassNotFoundException {
+        GetField gf = s.readFields();
+        String protocol = (String)gf.get("protocol", null);
+        if (getURLStreamHandler(protocol) == null) {
             throw new IOException("unknown protocol: " + protocol);
         }
+        String host = (String)gf.get("host", null);
+        int port = gf.get("port", -1);
+        String authority = (String)gf.get("authority", null);
+        String file = (String)gf.get("file", null);
+        String ref = (String)gf.get("ref", null);
+        int hashCode = gf.get("hashCode", -1);
+        if (authority == null
+                && ((host != null && host.length() > 0) || port != -1)) {
+            if (host == null)
+                host = "";
+            authority = (port == -1) ? host : host + ":" + port;
+        }
+        tempState = new UrlDeserializedState(protocol, host, port, authority,
+               file, ref, hashCode);
+    }
+
+    /**
+     * Replaces the de-serialized object with an URL object.
+     *
+     * @return a newly created object from deserialized data
+     *
+     * @throws ObjectStreamException if a new object replacing this
+     * object could not be created
+     */
+
+   private Object readResolve() throws ObjectStreamException {
+
+        URLStreamHandler handler = null;
+        // already been checked in readObject
+        handler = getURLStreamHandler(tempState.getProtocol());
+
+        URL replacementURL = null;
+        if (isBuiltinStreamHandler(handler.getClass().getName())) {
+            replacementURL = fabricateNewURL();
+        } else {
+            replacementURL = setDeserializedFields(handler);
+        }
+        return replacementURL;
+    }
+
+    private URL setDeserializedFields(URLStreamHandler handler) {
+        URL replacementURL;
+        String userInfo = null;
+        String protocol = tempState.getProtocol();
+        String host = tempState.getHost();
+        int port = tempState.getPort();
+        String authority = tempState.getAuthority();
+        String file = tempState.getFile();
+        String ref = tempState.getRef();
+        int hashCode = tempState.getHashCode();
+
 
         // Construct authority part
-        if (authority == null &&
-            ((host != null && host.length() > 0) || port != -1)) {
+        if (authority == null
+            && ((host != null && host.length() > 0) || port != -1)) {
             if (host == null)
                 host = "";
             authority = (port == -1) ? host : host + ":" + port;
@@ -1403,8 +1486,8 @@
         }
 
         // Construct path and query part
-        path = null;
-        query = null;
+        String path = null;
+        String query = null;
         if (file != null) {
             // Fix: only do this if hierarchical?
             int q = file.lastIndexOf('?');
@@ -1414,6 +1497,67 @@
             } else
                 path = file;
         }
+
+        if (port == -1) {
+            port = 0;
+        }
+        // Set the object fields.
+        this.protocol = protocol;
+        this.host = host;
+        this.port = port;
+        this.file = file;
+        this.authority = authority;
+        this.ref = ref;
+        this.hashCode = hashCode;
+        this.handler = handler;
+        this.query = query;
+        this.path = path;
+        this.userInfo = userInfo;
+        replacementURL = this;
+        return replacementURL;
+    }
+
+    private URL fabricateNewURL()
+                throws InvalidObjectException {
+        // create URL string from deserialized object
+        URL replacementURL = null;
+        String urlString = tempState.reconstituteUrlString();
+
+        try {
+            replacementURL = new URL(urlString);
+        } catch (MalformedURLException mEx) {
+            resetState();
+            InvalidObjectException invoEx = new InvalidObjectException(
+                    "Malformed URL:  " + urlString);
+            invoEx.initCause(mEx);
+            throw invoEx;
+        }
+        replacementURL.setSerializedHashCode(tempState.getHashCode());
+        resetState();
+        return replacementURL;
+    }
+
+    private boolean isBuiltinStreamHandler(String handlerClassName) {
+        return (handlerClassName.startsWith(BUILTIN_HANDLERS_PREFIX));
+    }
+
+    private void resetState() {
+        this.protocol = null;
+        this.host = null;
+        this.port = -1;
+        this.file = null;
+        this.authority = null;
+        this.ref = null;
+        this.hashCode = -1;
+        this.handler = null;
+        this.query = null;
+        this.path = null;
+        this.userInfo = null;
+        this.tempState = null;
+    }
+
+    private void setSerializedHashCode(int hc) {
+        this.hashCode = hc;
     }
 }
 
@@ -1445,3 +1589,82 @@
         return ref;
     }
 }
+
+final class UrlDeserializedState {
+    private final String protocol;
+    private final String host;
+    private final int port;
+    private final String authority;
+    private final String file;
+    private final String ref;
+    private final int hashCode;
+
+    public UrlDeserializedState(String protocol,
+                                String host, int port,
+                                String authority, String file,
+                                String ref, int hashCode) {
+        this.protocol = protocol;
+        this.host = host;
+        this.port = port;
+        this.authority = authority;
+        this.file = file;
+        this.ref = ref;
+        this.hashCode = hashCode;
+    }
+
+    String getProtocol() {
+        return protocol;
+    }
+
+    String getHost() {
+        return host;
+    }
+
+    String getAuthority () {
+        return authority;
+    }
+
+    int getPort() {
+        return port;
+    }
+
+    String getFile () {
+        return file;
+    }
+
+    String getRef () {
+        return ref;
+    }
+
+    int getHashCode () {
+        return hashCode;
+    }
+
+    String reconstituteUrlString() {
+
+        // pre-compute length of StringBuffer
+        int len = protocol.length() + 1;
+        if (authority != null && authority.length() > 0)
+            len += 2 + authority.length();
+        if (file != null) {
+            len += file.length();
+        }
+        if (ref != null)
+            len += 1 + ref.length();
+        StringBuilder result = new StringBuilder(len);
+        result.append(protocol);
+        result.append(":");
+        if (authority != null && authority.length() > 0) {
+            result.append("//");
+            result.append(authority);
+        }
+        if (file != null) {
+            result.append(file);
+        }
+        if (ref != null) {
+            result.append("#");
+            result.append(ref);
+        }
+        return result.toString();
+    }
+}
--- a/src/java.base/share/classes/java/net/spi/URLStreamHandlerProvider.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/net/spi/URLStreamHandlerProvider.java	Thu Jan 21 10:17:21 2016 -0800
@@ -44,7 +44,7 @@
  * <p> URL stream handler providers are located at runtime, as specified in the
  * {@linkplain java.net.URL#URL(String,String,int,String) URL constructor}.
  *
- * @since 1.9
+ * @since 9
  */
 public abstract class URLStreamHandlerProvider
     implements URLStreamHandlerFactory
--- a/src/java.base/share/classes/java/net/spi/package-info.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/net/spi/package-info.java	Thu Jan 21 10:17:21 2016 -0800
@@ -29,7 +29,7 @@
  * <p> Only developers who are defining new URL stream handler providers
  * should need to make direct use of this package.
  *
- * @since 1.9
+ * @since 9
  */
 
 package java.net.spi;
--- a/src/java.base/share/classes/java/nio/MappedByteBuffer.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/nio/MappedByteBuffer.java	Thu Jan 21 10:17:21 2016 -0800
@@ -213,7 +213,7 @@
 
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public final MappedByteBuffer position(int newPosition) {
@@ -223,7 +223,7 @@
 
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public final MappedByteBuffer limit(int newLimit) {
@@ -233,7 +233,7 @@
 
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public final MappedByteBuffer mark() {
@@ -243,7 +243,7 @@
 
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public final MappedByteBuffer reset() {
@@ -253,7 +253,7 @@
 
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public final MappedByteBuffer clear() {
@@ -263,7 +263,7 @@
 
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public final MappedByteBuffer flip() {
@@ -273,7 +273,7 @@
 
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public final MappedByteBuffer rewind() {
--- a/src/java.base/share/classes/java/nio/X-Buffer.java.template	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/nio/X-Buffer.java.template	Thu Jan 21 10:17:21 2016 -0800
@@ -1064,7 +1064,7 @@
 
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public
@@ -1078,7 +1078,7 @@
     
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public
@@ -1092,7 +1092,7 @@
     
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public 
@@ -1106,7 +1106,7 @@
 
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public 
@@ -1120,7 +1120,7 @@
 
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public 
@@ -1134,7 +1134,7 @@
 
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public 
@@ -1148,7 +1148,7 @@
 
     /**
      * {@inheritDoc}
-     * @since 1.9
+     * @since 9
      */
     @Override
     public 
--- a/src/java.base/share/classes/java/security/KeyStore.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/security/KeyStore.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1666,7 +1666,7 @@
      *
      * @see Provider
      *
-     * @since 1.9
+     * @since 9
      */
     public static final KeyStore getInstance(File file, char[] password)
         throws KeyStoreException, IOException, NoSuchAlgorithmException,
@@ -1722,7 +1722,7 @@
      *
      * @see Provider
      *
-     * @since 1.9
+     * @since 9
      */
     public static final KeyStore getInstance(File file,
         LoadStoreParameter param) throws KeyStoreException, IOException,
@@ -2006,7 +2006,7 @@
          *   of either PasswordProtection or CallbackHandlerProtection; or
          *   if file does not exist or does not refer to a normal file
          *
-         * @since 1.9
+         * @since 9
          */
         public static Builder newInstance(File file,
             ProtectionParameter protection) {
--- a/src/java.base/share/classes/java/security/PermissionCollection.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/security/PermissionCollection.java	Thu Jan 21 10:17:21 2016 -0800
@@ -144,7 +144,7 @@
      * the enumeration returned from a call to {@link #elements()}.
      *
      * @return a stream of all the Permissions.
-     * @since 1.9
+     * @since 9
      */
     public Stream<Permission> elementsAsStream() {
         int characteristics = isReadOnly()
--- a/src/java.base/share/classes/java/security/cert/URICertStoreParameters.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/security/cert/URICertStoreParameters.java	Thu Jan 21 10:17:21 2016 -0800
@@ -43,7 +43,7 @@
  * provide the necessary locking. Multiple threads each manipulating
  * separate objects need not synchronize.
  *
- * @since       1.9
+ * @since       9
  * @see         CertStore
  * @see         java.net.URI
  */
--- a/src/java.base/share/classes/java/security/spec/EncodedKeySpec.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/security/spec/EncodedKeySpec.java	Thu Jan 21 10:17:21 2016 -0800
@@ -74,7 +74,7 @@
      * or {@code algorithm} is null.
      * @throws IllegalArgumentException if {@code algorithm} is
      * the empty string {@code ""}
-     * @since 1.9
+     * @since 9
      */
     protected EncodedKeySpec(byte[] encodedKey, String algorithm) {
         if (algorithm == null) {
@@ -93,7 +93,7 @@
      * Returns the name of the algorithm of the encoded key.
      *
      * @return the name of the algorithm, or null if not specified
-     * @since 1.9
+     * @since 9
      */
     public String getAlgorithm() {
         return algorithmName;
--- a/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/security/spec/PKCS8EncodedKeySpec.java	Thu Jan 21 10:17:21 2016 -0800
@@ -92,7 +92,7 @@
      * or {@code algorithm} is null.
      * @throws IllegalArgumentException if {@code algorithm} is
      * the empty string {@code ""}
-     * @since 1.9
+     * @since 9
      */
     public PKCS8EncodedKeySpec(byte[] encodedKey, String algorithm) {
         super(encodedKey, algorithm);
--- a/src/java.base/share/classes/java/security/spec/X509EncodedKeySpec.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/security/spec/X509EncodedKeySpec.java	Thu Jan 21 10:17:21 2016 -0800
@@ -82,7 +82,7 @@
      * or {@code algorithm} is null.
      * @throws IllegalArgumentException if {@code algorithm} is
      * the empty string {@code ""}
-     * @since 1.9
+     * @since 9
      */
     public X509EncodedKeySpec(byte[] encodedKey, String algorithm) {
         super(encodedKey, algorithm);
--- a/src/java.base/share/classes/java/util/Arrays.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/Arrays.java	Thu Jan 21 10:17:21 2016 -0800
@@ -110,7 +110,7 @@
      * Checks that {@code fromIndex} and {@code toIndex} are in
      * the range and throws an exception if they aren't.
      */
-    private static void rangeCheck(int arrayLength, int fromIndex, int toIndex) {
+    static void rangeCheck(int arrayLength, int fromIndex, int toIndex) {
         if (fromIndex > toIndex) {
             throw new IllegalArgumentException(
                     "fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")");
@@ -2579,11 +2579,7 @@
         if (a2.length != length)
             return false;
 
-        for (int i=0; i<length; i++)
-            if (a[i] != a2[i])
-                return false;
-
-        return true;
+        return ArraysSupport.mismatch(a, a2, length) < 0;
     }
 
     /**
@@ -2628,11 +2624,9 @@
         if (aLength != bLength)
             return false;
 
-        for (int i = 0; i < aLength; i++)
-            if (a[aFromIndex++] != b[bFromIndex++])
-                return false;
-
-        return true;
+        return ArraysSupport.mismatch(a, aFromIndex,
+                                      b, bFromIndex,
+                                      aLength) < 0;
     }
 
     /**
@@ -2657,11 +2651,7 @@
         if (a2.length != length)
             return false;
 
-        for (int i=0; i<length; i++)
-            if (a[i] != a2[i])
-                return false;
-
-        return true;
+        return ArraysSupport.mismatch(a, a2, length) < 0;
     }
 
     /**
@@ -2706,11 +2696,9 @@
         if (aLength != bLength)
             return false;
 
-        for (int i = 0; i < aLength; i++)
-            if (a[aFromIndex++] != b[bFromIndex++])
-                return false;
-
-        return true;
+        return ArraysSupport.mismatch(a, aFromIndex,
+                                      b, bFromIndex,
+                                      aLength) < 0;
     }
 
     /**
@@ -2735,11 +2723,7 @@
         if (a2.length != length)
             return false;
 
-        for (int i=0; i<length; i++)
-            if (a[i] != a2[i])
-                return false;
-
-        return true;
+        return ArraysSupport.mismatch(a, a2, length) < 0;
     }
 
     /**
@@ -2784,11 +2768,9 @@
         if (aLength != bLength)
             return false;
 
-        for (int i = 0; i < aLength; i++)
-            if (a[aFromIndex++] != b[bFromIndex++])
-                return false;
-
-        return true;
+        return ArraysSupport.mismatch(a, aFromIndex,
+                                      b, bFromIndex,
+                                      aLength) < 0;
     }
 
     /**
@@ -2814,11 +2796,7 @@
         if (a2.length != length)
             return false;
 
-        for (int i=0; i<length; i++)
-            if (a[i] != a2[i])
-                return false;
-
-        return true;
+        return ArraysSupport.mismatch(a, a2, length) < 0;
     }
 
     /**
@@ -2863,11 +2841,9 @@
         if (aLength != bLength)
             return false;
 
-        for (int i = 0; i < aLength; i++)
-            if (a[aFromIndex++] != b[bFromIndex++])
-                return false;
-
-        return true;
+        return ArraysSupport.mismatch(a, aFromIndex,
+                                      b, bFromIndex,
+                                      aLength) < 0;
     }
 
     /**
@@ -2893,11 +2869,7 @@
         if (a2.length != length)
             return false;
 
-        for (int i=0; i<length; i++)
-            if (a[i] != a2[i])
-                return false;
-
-        return true;
+        return ArraysSupport.mismatch(a, a2, length) < 0;
     }
 
     /**
@@ -2942,11 +2914,9 @@
         if (aLength != bLength)
             return false;
 
-        for (int i = 0; i < aLength; i++)
-            if (a[aFromIndex++] != b[bFromIndex++])
-                return false;
-
-        return true;
+        return ArraysSupport.mismatch(a, aFromIndex,
+                                      b, bFromIndex,
+                                      aLength) < 0;
     }
 
     /**
@@ -2971,11 +2941,7 @@
         if (a2.length != length)
             return false;
 
-        for (int i=0; i<length; i++)
-            if (a[i] != a2[i])
-                return false;
-
-        return true;
+        return ArraysSupport.mismatch(a, a2, length) < 0;
     }
 
     /**
@@ -3020,11 +2986,9 @@
         if (aLength != bLength)
             return false;
 
-        for (int i = 0; i < aLength; i++)
-            if (a[aFromIndex++] != b[bFromIndex++])
-                return false;
-
-        return true;
+        return ArraysSupport.mismatch(a, aFromIndex,
+                                      b, bFromIndex,
+                                      aLength) < 0;
     }
 
     /**
@@ -3055,14 +3019,7 @@
         if (a2.length != length)
             return false;
 
-        for (int i=0; i<length; i++) {
-            double v1 = a[i], v2 = a2[i];
-            if (Double.doubleToRawLongBits(v1) != Double.doubleToRawLongBits(v2))
-                if (!Double.isNaN(v1) || !Double.isNaN(v2))
-                    return false;
-        }
-
-        return true;
+        return ArraysSupport.mismatch(a, a2, length) < 0;
     }
 
     /**
@@ -3113,14 +3070,8 @@
         if (aLength != bLength)
             return false;
 
-        for (int i = 0; i < aLength; i++) {
-            Double va = a[aFromIndex++], vb = b[bFromIndex++];
-            if (Double.doubleToRawLongBits(va) != Double.doubleToRawLongBits(vb))
-                if (!Double.isNaN(va) || !Double.isNaN(vb))
-                    return false;
-        }
-
-        return true;
+        return ArraysSupport.mismatch(a, aFromIndex,
+                                      b, bFromIndex, aLength) < 0;
     }
 
     /**
@@ -3151,14 +3102,7 @@
         if (a2.length != length)
             return false;
 
-        for (int i=0; i<length; i++) {
-            float v1 = a[i], v2 = a2[i];
-            if (Float.floatToRawIntBits(v1) != Float.floatToRawIntBits(v2))
-                if (!Float.isNaN(v1) || !Float.isNaN(v2))
-                    return false;
-        }
-
-        return true;
+        return ArraysSupport.mismatch(a, a2, length) < 0;
     }
 
     /**
@@ -3209,14 +3153,8 @@
         if (aLength != bLength)
             return false;
 
-        for (int i = 0; i < aLength; i++) {
-            float va = a[aFromIndex++], vb = b[bFromIndex++];
-            if (Float.floatToRawIntBits(va) != Float.floatToRawIntBits(vb))
-                if (!Float.isNaN(va) || !Float.isNaN(vb))
-                    return false;
-        }
-
-        return true;
+        return ArraysSupport.mismatch(a, aFromIndex,
+                                      b, bFromIndex, aLength) < 0;
     }
 
     /**
@@ -5804,9 +5742,10 @@
         if (a == null || b == null)
             return a == null ? -1 : 1;
 
-        int length = Math.min(a.length, b.length);
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return Boolean.compare(a[i], b[i]);
+        int i = ArraysSupport.mismatch(a, b,
+                                       Math.min(a.length, b.length));
+        if (i >= 0) {
+            return Boolean.compare(a[i], b[i]);
         }
 
         return a.length - b.length;
@@ -5880,11 +5819,11 @@
 
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
-        int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            boolean va = a[aFromIndex++];
-            boolean vb = b[bFromIndex++];
-            if (va != vb) return Boolean.compare(va, vb);
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       Math.min(aLength, bLength));
+        if (i >= 0) {
+            return Boolean.compare(a[aFromIndex + i], b[bFromIndex + i]);
         }
 
         return aLength - bLength;
@@ -5939,9 +5878,10 @@
         if (a == null || b == null)
             return a == null ? -1 : 1;
 
-        int length = Math.min(a.length, b.length);
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return Byte.compare(a[i], b[i]);
+        int i = ArraysSupport.mismatch(a, b,
+                                       Math.min(a.length, b.length));
+        if (i >= 0) {
+            return Byte.compare(a[i], b[i]);
         }
 
         return a.length - b.length;
@@ -6014,11 +5954,11 @@
 
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
-        int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            byte va = a[aFromIndex++];
-            byte vb = b[bFromIndex++];
-            if (va != vb) return Byte.compare(va, vb);
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       Math.min(aLength, bLength));
+        if (i >= 0) {
+            return Byte.compare(a[aFromIndex + i], b[bFromIndex + i]);
         }
 
         return aLength - bLength;
@@ -6066,9 +6006,10 @@
         if (a == null || b == null)
             return a == null ? -1 : 1;
 
-        int length = Math.min(a.length, b.length);
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return Byte.compareUnsigned(a[i], b[i]);
+        int i = ArraysSupport.mismatch(a, b,
+                                       Math.min(a.length, b.length));
+        if (i >= 0) {
+            return Byte.compareUnsigned(a[i], b[i]);
         }
 
         return a.length - b.length;
@@ -6133,11 +6074,11 @@
 
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
-        int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            byte va = a[aFromIndex++];
-            byte vb = b[bFromIndex++];
-            if (va != vb) return Byte.compareUnsigned(va, vb);
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       Math.min(aLength, bLength));
+        if (i >= 0) {
+            return Byte.compareUnsigned(a[aFromIndex + i], b[bFromIndex + i]);
         }
 
         return aLength - bLength;
@@ -6192,9 +6133,10 @@
         if (a == null || b == null)
             return a == null ? -1 : 1;
 
-        int length = Math.min(a.length, b.length);
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return Short.compare(a[i], b[i]);
+        int i = ArraysSupport.mismatch(a, b,
+                                       Math.min(a.length, b.length));
+        if (i >= 0) {
+            return Short.compare(a[i], b[i]);
         }
 
         return a.length - b.length;
@@ -6267,11 +6209,11 @@
 
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
-        int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            short va = a[aFromIndex++];
-            short vb = b[bFromIndex++];
-            if (va != vb) return Short.compare(va, vb);
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       Math.min(aLength, bLength));
+        if (i >= 0) {
+            return Short.compare(a[aFromIndex + i], b[bFromIndex + i]);
         }
 
         return aLength - bLength;
@@ -6319,9 +6261,10 @@
         if (a == null || b == null)
             return a == null ? -1 : 1;
 
-        int length = Math.min(a.length, b.length);
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return Short.compareUnsigned(a[i], b[i]);
+        int i = ArraysSupport.mismatch(a, b,
+                                       Math.min(a.length, b.length));
+        if (i >= 0) {
+            return Short.compareUnsigned(a[i], b[i]);
         }
 
         return a.length - b.length;
@@ -6385,11 +6328,11 @@
 
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
-        int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            short va = a[aFromIndex++];
-            short vb = b[bFromIndex++];
-            if (va != vb) return Short.compareUnsigned(va, vb);
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       Math.min(aLength, bLength));
+        if (i >= 0) {
+            return Short.compareUnsigned(a[aFromIndex + i], b[bFromIndex + i]);
         }
 
         return aLength - bLength;
@@ -6444,9 +6387,10 @@
         if (a == null || b == null)
             return a == null ? -1 : 1;
 
-        int length = Math.min(a.length, b.length);
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return Character.compare(a[i], b[i]);
+        int i = ArraysSupport.mismatch(a, b,
+                                       Math.min(a.length, b.length));
+        if (i >= 0) {
+            return Character.compare(a[i], b[i]);
         }
 
         return a.length - b.length;
@@ -6519,11 +6463,11 @@
 
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
-        int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            char va = a[aFromIndex++];
-            char vb = b[bFromIndex++];
-            if (va != vb) return Character.compare(va, vb);
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       Math.min(aLength, bLength));
+        if (i >= 0) {
+            return Character.compare(a[aFromIndex + i], b[bFromIndex + i]);
         }
 
         return aLength - bLength;
@@ -6578,9 +6522,10 @@
         if (a == null || b == null)
             return a == null ? -1 : 1;
 
-        int length = Math.min(a.length, b.length);
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return Integer.compare(a[i], b[i]);
+        int i = ArraysSupport.mismatch(a, b,
+                                       Math.min(a.length, b.length));
+        if (i >= 0) {
+            return Integer.compare(a[i], b[i]);
         }
 
         return a.length - b.length;
@@ -6653,11 +6598,11 @@
 
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
-        int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            int va = a[aFromIndex++];
-            int vb = b[bFromIndex++];
-            if (va != vb) return Integer.compare(va, vb);
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       Math.min(aLength, bLength));
+        if (i >= 0) {
+            return Integer.compare(a[aFromIndex + i], b[bFromIndex + i]);
         }
 
         return aLength - bLength;
@@ -6705,9 +6650,10 @@
         if (a == null || b == null)
             return a == null ? -1 : 1;
 
-        int length = Math.min(a.length, b.length);
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return Integer.compareUnsigned(a[i], b[i]);
+        int i = ArraysSupport.mismatch(a, b,
+                                       Math.min(a.length, b.length));
+        if (i >= 0) {
+            return Integer.compareUnsigned(a[i], b[i]);
         }
 
         return a.length - b.length;
@@ -6771,11 +6717,11 @@
 
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
-        int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            int va = a[aFromIndex++];
-            int vb = b[bFromIndex++];
-            if (va != vb) return Integer.compareUnsigned(va, vb);
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       Math.min(aLength, bLength));
+        if (i >= 0) {
+            return Integer.compareUnsigned(a[aFromIndex + i], b[bFromIndex + i]);
         }
 
         return aLength - bLength;
@@ -6830,9 +6776,10 @@
         if (a == null || b == null)
             return a == null ? -1 : 1;
 
-        int length = Math.min(a.length, b.length);
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return Long.compare(a[i], b[i]);
+        int i = ArraysSupport.mismatch(a, b,
+                                       Math.min(a.length, b.length));
+        if (i >= 0) {
+            return Long.compare(a[i], b[i]);
         }
 
         return a.length - b.length;
@@ -6905,11 +6852,11 @@
 
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
-        int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            long va = a[aFromIndex++];
-            long vb = b[bFromIndex++];
-            if (va != vb) return Long.compare(va, vb);
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       Math.min(aLength, bLength));
+        if (i >= 0) {
+            return Long.compare(a[aFromIndex + i], b[bFromIndex + i]);
         }
 
         return aLength - bLength;
@@ -6957,9 +6904,10 @@
         if (a == null || b == null)
             return a == null ? -1 : 1;
 
-        int length = Math.min(a.length, b.length);
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return Long.compareUnsigned(a[i], b[i]);
+        int i = ArraysSupport.mismatch(a, b,
+                                       Math.min(a.length, b.length));
+        if (i >= 0) {
+            return Long.compareUnsigned(a[i], b[i]);
         }
 
         return a.length - b.length;
@@ -7023,11 +6971,11 @@
 
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
-        int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            long va = a[aFromIndex++];
-            long vb = b[bFromIndex++];
-            if (va != vb) return Long.compareUnsigned(va, vb);
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       Math.min(aLength, bLength));
+        if (i >= 0) {
+            return Long.compareUnsigned(a[aFromIndex + i], b[bFromIndex + i]);
         }
 
         return aLength - bLength;
@@ -7082,13 +7030,10 @@
         if (a == null || b == null)
             return a == null ? -1 : 1;
 
-        int length = Math.min(a.length, b.length);
-        for (int i = 0; i < length; i++) {
-            float va = a[i], vb = b[i];
-            if (Float.floatToRawIntBits(va) != Float.floatToRawIntBits(vb)) {
-                int c = Float.compare(va, vb);
-                if (c != 0) return c;
-            }
+        int i = ArraysSupport.mismatch(a, b,
+                                       Math.min(a.length, b.length));
+        if (i >= 0) {
+            return Float.compare(a[i], b[i]);
         }
 
         return a.length - b.length;
@@ -7161,13 +7106,11 @@
 
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
-        int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            float va = a[aFromIndex++], vb = b[bFromIndex++];
-            if (Float.floatToRawIntBits(va) != Float.floatToRawIntBits(vb)) {
-                int c = Float.compare(va, vb);
-                if (c != 0) return c;
-            }
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       Math.min(aLength, bLength));
+        if (i >= 0) {
+            return Float.compare(a[aFromIndex + i], b[bFromIndex + i]);
         }
 
         return aLength - bLength;
@@ -7222,13 +7165,10 @@
         if (a == null || b == null)
             return a == null ? -1 : 1;
 
-        int length = Math.min(a.length, b.length);
-        for (int i = 0; i < length; i++) {
-            double va = a[i], vb = b[i];
-            if (Double.doubleToRawLongBits(va) != Double.doubleToRawLongBits(vb)) {
-                int c = Double.compare(va, vb);
-                if (c != 0) return c;
-            }
+        int i = ArraysSupport.mismatch(a, b,
+                                       Math.min(a.length, b.length));
+        if (i >= 0) {
+            return Double.compare(a[i], b[i]);
         }
 
         return a.length - b.length;
@@ -7301,13 +7241,11 @@
 
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
-        int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            double va = a[aFromIndex++], vb = b[bFromIndex++];
-            if (Double.doubleToRawLongBits(va) != Double.doubleToRawLongBits(vb)) {
-                int c = Double.compare(va, vb);
-                if (c != 0) return c;
-            }
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       Math.min(aLength, bLength));
+        if (i >= 0) {
+            return Double.compare(a[aFromIndex + i], b[bFromIndex + i]);
         }
 
         return aLength - bLength;
@@ -7673,11 +7611,8 @@
         if (a == b)
             return -1;
 
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return i;
-        }
-
-        return a.length != b.length ? length : -1;
+        int i = ArraysSupport.mismatch(a, b, length);
+        return (i < 0 && a.length != b.length) ? length : i;
     }
 
     /**
@@ -7749,11 +7684,10 @@
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
         int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            if (a[aFromIndex++] != b[bFromIndex++]) return i;
-        }
-
-        return aLength != bLength ? length : -1;
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       length);
+        return (i < 0 && aLength != bLength) ? length : i;
     }
 
     // Mismatch byte
@@ -7804,11 +7738,8 @@
         if (a == b)
             return -1;
 
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return i;
-        }
-
-        return a.length != b.length ? length : -1;
+        int i = ArraysSupport.mismatch(a, b, length);
+        return (i < 0 && a.length != b.length) ? length : i;
     }
 
     /**
@@ -7880,11 +7811,10 @@
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
         int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            if (a[aFromIndex++] != b[bFromIndex++]) return i;
-        }
-
-        return aLength != bLength ? length : -1;
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       length);
+        return (i < 0 && aLength != bLength) ? length : i;
     }
 
     // Mismatch char
@@ -7935,11 +7865,8 @@
         if (a == b)
             return -1;
 
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return i;
-        }
-
-        return a.length != b.length ? length : -1;
+        int i = ArraysSupport.mismatch(a, b, length);
+        return (i < 0 && a.length != b.length) ? length : i;
     }
 
     /**
@@ -8011,11 +7938,10 @@
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
         int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            if (a[aFromIndex++] != b[bFromIndex++]) return i;
-        }
-
-        return aLength != bLength ? length : -1;
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       length);
+        return (i < 0 && aLength != bLength) ? length : i;
     }
 
     // Mismatch short
@@ -8066,11 +7992,8 @@
         if (a == b)
             return -1;
 
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return i;
-        }
-
-        return a.length != b.length ? length : -1;
+        int i = ArraysSupport.mismatch(a, b, length);
+        return (i < 0 && a.length != b.length) ? length : i;
     }
 
     /**
@@ -8142,11 +8065,10 @@
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
         int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            if (a[aFromIndex++] != b[bFromIndex++]) return i;
-        }
-
-        return aLength != bLength ? length : -1;
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       length);
+        return (i < 0 && aLength != bLength) ? length : i;
     }
 
     // Mismatch int
@@ -8197,11 +8119,8 @@
         if (a == b)
             return -1;
 
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return i;
-        }
-
-        return a.length != b.length ? length : -1;
+        int i = ArraysSupport.mismatch(a, b, length);
+        return (i < 0 && a.length != b.length) ? length : i;
     }
 
     /**
@@ -8273,11 +8192,10 @@
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
         int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            if (a[aFromIndex++] != b[bFromIndex++]) return i;
-        }
-
-        return aLength != bLength ? length : -1;
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       length);
+        return (i < 0 && aLength != bLength) ? length : i;
     }
 
     // Mismatch long
@@ -8328,11 +8246,8 @@
         if (a == b)
             return -1;
 
-        for (int i = 0; i < length; i++) {
-            if (a[i] != b[i]) return i;
-        }
-
-        return a.length != b.length ? length : -1;
+        int i = ArraysSupport.mismatch(a, b, length);
+        return (i < 0 && a.length != b.length) ? length : i;
     }
 
     /**
@@ -8404,11 +8319,10 @@
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
         int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            if (a[aFromIndex++] != b[bFromIndex++]) return i;
-        }
-
-        return aLength != bLength ? length : -1;
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       length);
+        return (i < 0 && aLength != bLength) ? length : i;
     }
 
     // Mismatch float
@@ -8459,14 +8373,8 @@
         if (a == b)
             return -1;
 
-        for (int i = 0; i < length; i++) {
-            float va = a[i], vb = b[i];
-            if (Float.floatToRawIntBits(va) != Float.floatToRawIntBits(vb))
-                if (!Float.isNaN(va) || !Float.isNaN(vb))
-                    return i;
-        }
-
-        return a.length != b.length ? length : -1;
+        int i = ArraysSupport.mismatch(a, b, length);
+        return (i < 0 && a.length != b.length) ? length : i;
     }
 
     /**
@@ -8538,14 +8446,10 @@
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
         int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            float va = a[aFromIndex++], vb = b[bFromIndex++];
-            if (Float.floatToRawIntBits(va) != Float.floatToRawIntBits(vb))
-                if (!Float.isNaN(va) || !Float.isNaN(vb))
-                    return i;
-        }
-
-        return aLength != bLength ? length : -1;
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       length);
+        return (i < 0 && aLength != bLength) ? length : i;
     }
 
     // Mismatch double
@@ -8596,14 +8500,8 @@
         if (a == b)
             return -1;
 
-        for (int i = 0; i < length; i++) {
-            double va = a[i], vb = b[i];
-            if (Double.doubleToRawLongBits(va) != Double.doubleToRawLongBits(vb))
-                if (!Double.isNaN(va) || !Double.isNaN(vb))
-                    return i;
-        }
-
-        return a.length != b.length ? length : -1;
+        int i = ArraysSupport.mismatch(a, b, length);
+        return (i < 0 && a.length != b.length) ? length : i;
     }
 
     /**
@@ -8675,14 +8573,10 @@
         int aLength = aToIndex - aFromIndex;
         int bLength = bToIndex - bFromIndex;
         int length = Math.min(aLength, bLength);
-        for (int i = 0; i < length; i++) {
-            double va = a[aFromIndex++], vb = b[bFromIndex++];
-            if (Double.doubleToRawLongBits(va) != Double.doubleToRawLongBits(vb))
-                if (!Double.isNaN(va) || !Double.isNaN(vb))
-                    return i;
-        }
-
-        return aLength != bLength ? length : -1;
+        int i = ArraysSupport.mismatch(a, aFromIndex,
+                                       b, bFromIndex,
+                                       length);
+        return (i < 0 && aLength != bLength) ? length : i;
     }
 
     // Mismatch objects
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/java/util/ArraysSupport.java	Thu Jan 21 10:17:21 2016 -0800
@@ -0,0 +1,545 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  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.
+ */
+package java.util;
+
+import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.misc.Unsafe;
+
+/**
+ * Utility methods to find a mismatch between two primitive arrays.
+ *
+ * <p>Array equality and lexicographical comparison can be built on top of
+ * array mismatch functionality.
+ *
+ * <p>The mismatch method implementation, {@link #vectorizedMismatch}, leverages
+ * vector-based techniques to access and compare the contents of two arrays.
+ * The Java implementation uses {@code Unsafe.getLongUnaligned} to access the
+ * content of an array, thus access is supported on platforms that do not
+ * support unaligned access.  For a byte[] array, 8 bytes (64 bits) can be
+ * accessed and compared as a unit rather than individually, which increases
+ * the performance when the method is compiled by the HotSpot VM.  On supported
+ * platforms the mismatch implementation is intrinsified to leverage SIMD
+ * instructions.  So for a byte[] array, 16 bytes (128 bits), 32 bytes
+ * (256 bits), and perhaps in the future even 64 bytes (512 bits), platform
+ * permitting, can be accessed and compared as a unit, which further increases
+ * the performance over the Java implementation.
+ *
+ * <p>None of the mismatch methods perform array bounds checks.  It is the
+ * responsibility of the caller (direct or otherwise) to perform such checks
+ * before calling this method.
+ */
+class ArraysSupport {
+    static final Unsafe U = Unsafe.getUnsafe();
+
+    private static final boolean BIG_ENDIAN = U.isBigEndian();
+
+    private static final int LOG2_ARRAY_BOOLEAN_INDEX_SCALE = exactLog2(Unsafe.ARRAY_BOOLEAN_INDEX_SCALE);
+    private static final int LOG2_ARRAY_BYTE_INDEX_SCALE = exactLog2(Unsafe.ARRAY_BYTE_INDEX_SCALE);
+    private static final int LOG2_ARRAY_CHAR_INDEX_SCALE = exactLog2(Unsafe.ARRAY_CHAR_INDEX_SCALE);
+    private static final int LOG2_ARRAY_SHORT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_SHORT_INDEX_SCALE);
+    private static final int LOG2_ARRAY_INT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_INT_INDEX_SCALE);
+    private static final int LOG2_ARRAY_LONG_INDEX_SCALE = exactLog2(Unsafe.ARRAY_LONG_INDEX_SCALE);
+    private static final int LOG2_ARRAY_FLOAT_INDEX_SCALE = exactLog2(Unsafe.ARRAY_FLOAT_INDEX_SCALE);
+    private static final int LOG2_ARRAY_DOUBLE_INDEX_SCALE = exactLog2(Unsafe.ARRAY_DOUBLE_INDEX_SCALE);
+
+    private static final int LOG2_BYTE_BIT_SIZE = exactLog2(Byte.SIZE);
+
+    private static int exactLog2(int scale) {
+        if ((scale & (scale - 1)) != 0)
+            throw new Error("data type scale not a power of two");
+        return Integer.numberOfTrailingZeros(scale);
+    }
+
+    private ArraysSupport() {}
+
+    /**
+     * Find the relative index of the first mismatching pair of elements in two
+     * primitive arrays of the same component type.  Pairs of elements will be
+     * tested in order relative to given offsets into both arrays.
+     *
+     * <p>This method does not perform type checks or bounds checks.  It is the
+     * responsibility of the caller to perform such checks before calling this
+     * method.
+     *
+     * <p>The given offsets, in bytes, need not be aligned according to the
+     * given log<sub>2</sub> size the array elements.  More specifically, an
+     * offset modulus the size need not be zero.
+     *
+     * @param a the first array to be tested for mismatch, or {@code null} for
+     * direct memory access
+     * @param aOffset the relative offset, in bytes, from the base address of
+     * the first array to test from, otherwise if the first array is
+     * {@code null}, an absolute address pointing to the first element to test.
+     * @param b the second array to be tested for mismatch, or {@code null} for
+     * direct memory access
+     * @param bOffset the relative offset, in bytes, from the base address of
+     * the second array to test from, otherwise if the second array is
+     * {@code null}, an absolute address pointing to the first element to test.
+     * @param length the number of array elements to test
+     * @param log2ArrayIndexScale log<sub>2</sub> of the array index scale, that
+     * corresponds to the size, in bytes, of an array element.
+     * @return if a mismatch is found a relative index, between 0 (inclusive)
+     * and {@code length} (exclusive), of the first mismatching pair of elements
+     * in the two arrays.  Otherwise, if a mismatch is not found the bitwise
+     * compliment of the number of remaining pairs of elements to be checked in
+     * the tail of the two arrays.
+     */
+    @HotSpotIntrinsicCandidate
+    static int vectorizedMismatch(Object a, long aOffset,
+                                  Object b, long bOffset,
+                                  int length,
+                                  int log2ArrayIndexScale) {
+        // assert a.getClass().isArray();
+        // assert b.getClass().isArray();
+        // assert 0 <= length <= sizeOf(a)
+        // assert 0 <= length <= sizeOf(b)
+        // assert 0 <= log2ArrayIndexScale <= 3
+
+        int log2ValuesPerWidth = LOG2_ARRAY_LONG_INDEX_SCALE - log2ArrayIndexScale;
+        int wi = 0;
+        for (; wi < length >> log2ValuesPerWidth; wi++) {
+            long bi = ((long) wi) << LOG2_ARRAY_LONG_INDEX_SCALE;
+            long av = U.getLongUnaligned(a, aOffset + bi);
+            long bv = U.getLongUnaligned(b, bOffset + bi);
+            if (av != bv) {
+                long x = av ^ bv;
+                int o = BIG_ENDIAN
+                        ? Long.numberOfLeadingZeros(x) >> (LOG2_BYTE_BIT_SIZE + log2ArrayIndexScale)
+                        : Long.numberOfTrailingZeros(x) >> (LOG2_BYTE_BIT_SIZE + log2ArrayIndexScale);
+                return (wi << log2ValuesPerWidth) + o;
+            }
+        }
+
+        // Calculate the tail of remaining elements to check
+        int tail = length - (wi << log2ValuesPerWidth);
+
+        if (log2ArrayIndexScale < LOG2_ARRAY_INT_INDEX_SCALE) {
+            int wordTail = 1 << (LOG2_ARRAY_INT_INDEX_SCALE - log2ArrayIndexScale);
+            // Handle 4 bytes or 2 chars in the tail using int width
+            if (tail >= wordTail) {
+                long bi = ((long) wi) << LOG2_ARRAY_LONG_INDEX_SCALE;
+                int av = U.getIntUnaligned(a, aOffset + bi);
+                int bv = U.getIntUnaligned(b, bOffset + bi);
+                if (av != bv) {
+                    int x = av ^ bv;
+                    int o = BIG_ENDIAN
+                            ? Integer.numberOfLeadingZeros(x) >> (LOG2_BYTE_BIT_SIZE + log2ArrayIndexScale)
+                            : Integer.numberOfTrailingZeros(x) >> (LOG2_BYTE_BIT_SIZE + log2ArrayIndexScale);
+                    return (wi << log2ValuesPerWidth) + o;
+                }
+                tail -= wordTail;
+            }
+            return ~tail;
+        }
+        else {
+            return ~tail;
+        }
+    }
+
+    // Booleans
+    // Each boolean element takes up one byte
+
+    static int mismatch(boolean[] a,
+                        boolean[] b,
+                        int length) {
+        int i = 0;
+        if (length > 7) {
+            i = vectorizedMismatch(
+                    a, Unsafe.ARRAY_BOOLEAN_BASE_OFFSET,
+                    b, Unsafe.ARRAY_BOOLEAN_BASE_OFFSET,
+                    length, LOG2_ARRAY_BOOLEAN_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[i] != b[i])
+                return i;
+        }
+        return -1;
+    }
+
+    static int mismatch(boolean[] a, int aFromIndex,
+                        boolean[] b, int bFromIndex,
+                        int length) {
+        int i = 0;
+        if (length > 7) {
+            int aOffset = Unsafe.ARRAY_BOOLEAN_BASE_OFFSET + aFromIndex;
+            int bOffset = Unsafe.ARRAY_BOOLEAN_BASE_OFFSET + bFromIndex;
+            i = vectorizedMismatch(
+                    a, aOffset,
+                    b, bOffset,
+                    length, LOG2_ARRAY_BOOLEAN_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[aFromIndex + i] != b[bFromIndex + i])
+                return i;
+        }
+        return -1;
+    }
+
+
+    // Bytes
+
+    /**
+     * Find the index of a mismatch between two arrays.
+     *
+     * <p>This method does not perform bounds checks. It is the responsibility
+     * of the caller to perform such bounds checks before calling this method.
+     *
+     * @param a the first array to be tested for a mismatch
+     * @param b the second array to be tested for a mismatch
+     * @param length the number of bytes from each array to check
+     * @return the index of a mismatch between the two arrays, otherwise -1 if
+     * no mismatch.  The index will be within the range of (inclusive) 0 to
+     * (exclusive) the smaller of the two array lengths.
+     */
+    static int mismatch(byte[] a,
+                        byte[] b,
+                        int length) {
+        // ISSUE: defer to index receiving methods if performance is good
+        // assert length <= a.length
+        // assert length <= b.length
+
+        int i = 0;
+        if (length > 7) {
+            i = vectorizedMismatch(
+                    a, Unsafe.ARRAY_BYTE_BASE_OFFSET,
+                    b, Unsafe.ARRAY_BYTE_BASE_OFFSET,
+                    length, LOG2_ARRAY_BYTE_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            // Align to tail
+            i = length - ~i;
+//            assert i >= 0 && i <= 7;
+        }
+        // Tail < 8 bytes
+        for (; i < length; i++) {
+            if (a[i] != b[i])
+                return i;
+        }
+        return -1;
+    }
+
+    /**
+     * Find the relative index of a mismatch between two arrays starting from
+     * given indexes.
+     *
+     * <p>This method does not perform bounds checks. It is the responsibility
+     * of the caller to perform such bounds checks before calling this method.
+     *
+     * @param a the first array to be tested for a mismatch
+     * @param aFromIndex the index of the first element (inclusive) in the first
+     * array to be compared
+     * @param b the second array to be tested for a mismatch
+     * @param bFromIndex the index of the first element (inclusive) in the
+     * second array to be compared
+     * @param length the number of bytes from each array to check
+     * @return the relative index of a mismatch between the two arrays,
+     * otherwise -1 if no mismatch.  The index will be within the range of
+     * (inclusive) 0 to (exclusive) the smaller of the two array bounds.
+     */
+    static int mismatch(byte[] a, int aFromIndex,
+                        byte[] b, int bFromIndex,
+                        int length) {
+        // assert 0 <= aFromIndex < a.length
+        // assert 0 <= aFromIndex + length <= a.length
+        // assert 0 <= bFromIndex < b.length
+        // assert 0 <= bFromIndex + length <= b.length
+        // assert length >= 0
+
+        int i = 0;
+        if (length > 7) {
+            int aOffset = Unsafe.ARRAY_BYTE_BASE_OFFSET + aFromIndex;
+            int bOffset = Unsafe.ARRAY_BYTE_BASE_OFFSET + bFromIndex;
+            i = vectorizedMismatch(
+                    a, aOffset,
+                    b, bOffset,
+                    length, LOG2_ARRAY_BYTE_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[aFromIndex + i] != b[bFromIndex + i])
+                return i;
+        }
+        return -1;
+    }
+
+
+    // Chars
+
+    static int mismatch(char[] a,
+                        char[] b,
+                        int length) {
+        int i = 0;
+        if (length > 3) {
+            i = vectorizedMismatch(
+                    a, Unsafe.ARRAY_CHAR_BASE_OFFSET,
+                    b, Unsafe.ARRAY_CHAR_BASE_OFFSET,
+                    length, LOG2_ARRAY_CHAR_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[i] != b[i])
+                return i;
+        }
+        return -1;
+    }
+
+    static int mismatch(char[] a, int aFromIndex,
+                        char[] b, int bFromIndex,
+                        int length) {
+        int i = 0;
+        if (length > 3) {
+            int aOffset = Unsafe.ARRAY_CHAR_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_CHAR_INDEX_SCALE);
+            int bOffset = Unsafe.ARRAY_CHAR_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_CHAR_INDEX_SCALE);
+            i = vectorizedMismatch(
+                    a, aOffset,
+                    b, bOffset,
+                    length, LOG2_ARRAY_CHAR_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[aFromIndex + i] != b[bFromIndex + i])
+                return i;
+        }
+        return -1;
+    }
+
+
+    // Shorts
+
+    static int mismatch(short[] a,
+                        short[] b,
+                        int length) {
+        int i = 0;
+        if (length > 3) {
+            i = vectorizedMismatch(
+                    a, Unsafe.ARRAY_SHORT_BASE_OFFSET,
+                    b, Unsafe.ARRAY_SHORT_BASE_OFFSET,
+                    length, LOG2_ARRAY_SHORT_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[i] != b[i])
+                return i;
+        }
+        return -1;
+    }
+
+    static int mismatch(short[] a, int aFromIndex,
+                        short[] b, int bFromIndex,
+                        int length) {
+        int i = 0;
+        if (length > 3) {
+            int aOffset = Unsafe.ARRAY_SHORT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_SHORT_INDEX_SCALE);
+            int bOffset = Unsafe.ARRAY_SHORT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_SHORT_INDEX_SCALE);
+            i = vectorizedMismatch(
+                    a, aOffset,
+                    b, bOffset,
+                    length, LOG2_ARRAY_SHORT_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[aFromIndex + i] != b[bFromIndex + i])
+                return i;
+        }
+        return -1;
+    }
+
+
+    // Ints
+
+    static int mismatch(int[] a,
+                        int[] b,
+                        int length) {
+        int i = 0;
+        if (length > 1) {
+            i = vectorizedMismatch(
+                    a, Unsafe.ARRAY_INT_BASE_OFFSET,
+                    b, Unsafe.ARRAY_INT_BASE_OFFSET,
+                    length, LOG2_ARRAY_INT_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[i] != b[i])
+                return i;
+        }
+        return -1;
+    }
+
+    static int mismatch(int[] a, int aFromIndex,
+                        int[] b, int bFromIndex,
+                        int length) {
+        int i = 0;
+        if (length > 1) {
+            int aOffset = Unsafe.ARRAY_INT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_INT_INDEX_SCALE);
+            int bOffset = Unsafe.ARRAY_INT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_INT_INDEX_SCALE);
+            i = vectorizedMismatch(
+                    a, aOffset,
+                    b, bOffset,
+                    length, LOG2_ARRAY_INT_INDEX_SCALE);
+            if (i >= 0)
+                return i;
+            i = length - ~i;
+        }
+        for (; i < length; i++) {
+            if (a[aFromIndex + i] != b[bFromIndex + i])
+                return i;
+        }
+        return -1;
+    }
+
+
+    // Floats
+
+    static int mismatch(float[] a,
+                        float[] b,
+                        int length) {
+        return mismatch(a, 0, b, 0, length);
+    }
+
+    static int mismatch(float[] a, int aFromIndex,
+                        float[] b, int bFromIndex,
+                        int length) {
+        int i = 0;
+        if (length > 1) {
+            int aOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE);
+            int bOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE);
+            i = vectorizedMismatch(
+                    a, aOffset,
+                    b, bOffset,
+                    length, LOG2_ARRAY_FLOAT_INDEX_SCALE);
+            // Mismatched
+            if (i >= 0) {
+                // Check if mismatch is not associated with two NaN values
+                if (!Float.isNaN(a[aFromIndex + i]) || !Float.isNaN(b[bFromIndex + i]))
+                    return i;
+
+                // Mismatch on two different NaN values that are normalized to match
+                // Fall back to slow mechanism
+                // ISSUE: Consider looping over vectorizedMismatch adjusting ranges
+                // However, requires that returned value be relative to input ranges
+                i++;
+            }
+            // Matched
+            else {
+                i = length - ~i;
+            }
+        }
+        for (; i < length; i++) {
+            if (Float.floatToIntBits(a[aFromIndex + i]) != Float.floatToIntBits(b[bFromIndex + i]))
+                return i;
+        }
+        return -1;
+    }
+
+    // 64 bit sizes
+
+    // Long
+
+    static int mismatch(long[] a,
+                        long[] b,
+                        int length) {
+        if (length == 0) {
+            return -1;
+        }
+        int i = vectorizedMismatch(
+                a, Unsafe.ARRAY_LONG_BASE_OFFSET,
+                b, Unsafe.ARRAY_LONG_BASE_OFFSET,
+                length, LOG2_ARRAY_LONG_INDEX_SCALE);
+        return i >= 0 ? i : -1;
+    }
+
+    static int mismatch(long[] a, int aFromIndex,
+                        long[] b, int bFromIndex,
+                        int length) {
+        if (length == 0) {
+            return -1;
+        }
+        int aOffset = Unsafe.ARRAY_LONG_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_LONG_INDEX_SCALE);
+        int bOffset = Unsafe.ARRAY_LONG_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_LONG_INDEX_SCALE);
+        int i = vectorizedMismatch(
+                a, aOffset,
+                b, bOffset,
+                length, LOG2_ARRAY_LONG_INDEX_SCALE);
+        return i >= 0 ? i : -1;
+    }
+
+
+    // Double
+
+    static int mismatch(double[] a,
+                        double[] b,
+                        int length) {
+        return mismatch(a, 0, b, 0, length);
+    }
+
+    static int mismatch(double[] a, int aFromIndex,
+                        double[] b, int bFromIndex,
+                        int length) {
+        if (length == 0) {
+            return -1;
+        }
+        int aOffset = Unsafe.ARRAY_DOUBLE_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_DOUBLE_INDEX_SCALE);
+        int bOffset = Unsafe.ARRAY_DOUBLE_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_DOUBLE_INDEX_SCALE);
+        int i = vectorizedMismatch(
+                a, aOffset,
+                b, bOffset,
+                length, LOG2_ARRAY_DOUBLE_INDEX_SCALE);
+        if (i >= 0) {
+            // Check if mismatch is not associated with two NaN values
+            if (!Double.isNaN(a[aFromIndex + i]) || !Double.isNaN(b[bFromIndex + i]))
+                return i;
+
+            // Mismatch on two different NaN values that are normalized to match
+            // Fall back to slow mechanism
+            // ISSUE: Consider looping over vectorizedMismatch adjusting ranges
+            // However, requires that returned value be relative to input ranges
+            i++;
+            for (; i < length; i++) {
+                if (Double.doubleToLongBits(a[aFromIndex + i]) != Double.doubleToLongBits(b[bFromIndex + i]))
+                    return i;
+            }
+        }
+
+        return -1;
+    }
+}
--- a/src/java.base/share/classes/java/util/Enumeration.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/Enumeration.java	Thu Jan 21 10:17:21 2016 -0800
@@ -112,7 +112,7 @@
      *
      * @return an Iterator representing the remaining elements of this Enumeration
      *
-     * @since 1.9
+     * @since 9
      */
     default Iterator<E> asIterator() {
         return new Iterator<>() {
--- a/src/java.base/share/classes/java/util/Scanner.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/Scanner.java	Thu Jan 21 10:17:21 2016 -0800
@@ -2684,7 +2684,7 @@
      *
      * @return a sequential stream of token strings
      * @throws IllegalStateException if this scanner is closed
-     * @since 1.9
+     * @since 9
      */
     public Stream<String> tokens() {
         ensureOpen();
@@ -2770,7 +2770,7 @@
      * @return a sequential stream of match results
      * @throws NullPointerException if pattern is null
      * @throws IllegalStateException if this scanner is closed
-     * @since 1.9
+     * @since 9
      */
     public Stream<MatchResult> findAll(Pattern pattern) {
         Objects.requireNonNull(pattern);
@@ -2792,7 +2792,7 @@
      * @throws NullPointerException if patString is null
      * @throws IllegalStateException if this scanner is closed
      * @throws PatternSyntaxException if the regular expression's syntax is invalid
-     * @since 1.9
+     * @since 9
      * @see java.util.regex.Pattern
      */
     public Stream<MatchResult> findAll(String patString) {
--- a/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java	Thu Jan 21 10:17:21 2016 -0800
@@ -2429,7 +2429,7 @@
      *
      * @param <U> the type of the value
      * @return a new CompletableFuture
-     * @since 1.9
+     * @since 9
      */
     public <U> CompletableFuture<U> newIncompleteFuture() {
         return new CompletableFuture<U>();
@@ -2444,7 +2444,7 @@
      * an Executor that provides at least one independent thread.
      *
      * @return the executor
-     * @since 1.9
+     * @since 9
      */
     public Executor defaultExecutor() {
         return ASYNC_POOL;
@@ -2462,7 +2462,7 @@
      * arrange dependent actions.
      *
      * @return the new CompletableFuture
-     * @since 1.9
+     * @since 9
      */
     public CompletableFuture<T> copy() {
         return uniCopyStage();
@@ -2479,7 +2479,7 @@
      * cause.
      *
      * @return the new CompletionStage
-     * @since 1.9
+     * @since 9
      */
     public CompletionStage<T> minimalCompletionStage() {
         return uniAsMinimalStage();
@@ -2494,7 +2494,7 @@
      * to complete this CompletableFuture
      * @param executor the executor to use for asynchronous execution
      * @return this CompletableFuture
-     * @since 1.9
+     * @since 9
      */
     public CompletableFuture<T> completeAsync(Supplier<? extends T> supplier,
                                               Executor executor) {
@@ -2512,7 +2512,7 @@
      * @param supplier a function returning the value to be used
      * to complete this CompletableFuture
      * @return this CompletableFuture
-     * @since 1.9
+     * @since 9
      */
     public CompletableFuture<T> completeAsync(Supplier<? extends T> supplier) {
         return completeAsync(supplier, defaultExecutor());
@@ -2528,7 +2528,7 @@
      * @param unit a {@code TimeUnit} determining how to interpret the
      *        {@code timeout} parameter
      * @return this CompletableFuture
-     * @since 1.9
+     * @since 9
      */
     public CompletableFuture<T> orTimeout(long timeout, TimeUnit unit) {
         if (unit == null)
@@ -2549,7 +2549,7 @@
      * @param unit a {@code TimeUnit} determining how to interpret the
      *        {@code timeout} parameter
      * @return this CompletableFuture
-     * @since 1.9
+     * @since 9
      */
     public CompletableFuture<T> completeOnTimeout(T value, long timeout,
                                                   TimeUnit unit) {
@@ -2573,7 +2573,7 @@
      *        {@code delay} parameter
      * @param executor the base executor
      * @return the new delayed executor
-     * @since 1.9
+     * @since 9
      */
     public static Executor delayedExecutor(long delay, TimeUnit unit,
                                            Executor executor) {
@@ -2592,7 +2592,7 @@
      * @param unit a {@code TimeUnit} determining how to interpret the
      *        {@code delay} parameter
      * @return the new delayed executor
-     * @since 1.9
+     * @since 9
      */
     public static Executor delayedExecutor(long delay, TimeUnit unit) {
         if (unit == null)
@@ -2608,7 +2608,7 @@
      * @param value the value
      * @param <U> the type of the value
      * @return the completed CompletionStage
-     * @since 1.9
+     * @since 9
      */
     public static <U> CompletionStage<U> completedStage(U value) {
         return new MinimalStage<U>((value == null) ? NIL : value);
@@ -2621,7 +2621,7 @@
      * @param ex the exception
      * @param <U> the type of the value
      * @return the exceptionally completed CompletableFuture
-     * @since 1.9
+     * @since 9
      */
     public static <U> CompletableFuture<U> failedFuture(Throwable ex) {
         if (ex == null) throw new NullPointerException();
@@ -2636,7 +2636,7 @@
      * @param ex the exception
      * @param <U> the type of the value
      * @return the exceptionally completed CompletionStage
-     * @since 1.9
+     * @since 9
      */
     public static <U> CompletionStage<U> failedStage(Throwable ex) {
         if (ex == null) throw new NullPointerException();
--- a/src/java.base/share/classes/java/util/concurrent/Flow.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/concurrent/Flow.java	Thu Jan 21 10:17:21 2016 -0800
@@ -161,7 +161,7 @@
  * }}</pre>
  *
  * @author Doug Lea
- * @since 1.9
+ * @since 9
  */
 public final class Flow {
 
--- a/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1301,7 +1301,7 @@
      * support extensions, and is unlikely to be useful otherwise.
      *
      * @return a task, or {@code null} if none are available
-     * @since 1.9
+     * @since 9
      */
     protected static ForkJoinTask<?> pollSubmission() {
         Thread t;
--- a/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java	Thu Jan 21 10:17:21 2016 -0800
@@ -154,7 +154,7 @@
  *
  * @param <T> the published item type
  * @author Doug Lea
- * @since 1.9
+ * @since 9
  */
 public class SubmissionPublisher<T> implements Flow.Publisher<T>,
                                                AutoCloseable {
--- a/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java	Thu Jan 21 10:17:21 2016 -0800
@@ -39,6 +39,7 @@
 import java.util.Collection;
 import java.util.Date;
 import java.util.concurrent.TimeUnit;
+import jdk.internal.vm.annotation.ReservedStackAccess;
 
 /**
  * Provides a framework for implementing blocking locks and related
@@ -886,6 +887,7 @@
      * @param arg the acquire argument
      * @return {@code true} if interrupted while waiting
      */
+    @ReservedStackAccess
     final boolean acquireQueued(final Node node, int arg) {
         try {
             boolean interrupted = false;
@@ -1218,6 +1220,7 @@
      *        {@link #tryAcquire} but is otherwise uninterpreted and
      *        can represent anything you like.
      */
+    @ReservedStackAccess
     public final void acquire(int arg) {
         if (!tryAcquire(arg) &&
             acquireQueued(addWaiter(Node.EXCLUSIVE), arg))
@@ -1281,6 +1284,7 @@
      *        can represent anything you like.
      * @return the value returned from {@link #tryRelease}
      */
+    @ReservedStackAccess
     public final boolean release(int arg) {
         if (tryRelease(arg)) {
             Node h = head;
@@ -1361,6 +1365,7 @@
      *        and can represent anything you like.
      * @return the value returned from {@link #tryReleaseShared}
      */
+    @ReservedStackAccess
     public final boolean releaseShared(int arg) {
         if (tryReleaseShared(arg)) {
             doReleaseShared();
--- a/src/java.base/share/classes/java/util/concurrent/locks/ReentrantLock.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/concurrent/locks/ReentrantLock.java	Thu Jan 21 10:17:21 2016 -0800
@@ -37,6 +37,7 @@
 
 import java.util.Collection;
 import java.util.concurrent.TimeUnit;
+import jdk.internal.vm.annotation.ReservedStackAccess;
 
 /**
  * A reentrant mutual exclusion {@link Lock} with the same basic
@@ -127,6 +128,7 @@
          * Performs non-fair tryLock.  tryAcquire is implemented in
          * subclasses, but both need nonfair try for trylock method.
          */
+        @ReservedStackAccess
         final boolean nonfairTryAcquire(int acquires) {
             final Thread current = Thread.currentThread();
             int c = getState();
@@ -146,6 +148,7 @@
             return false;
         }
 
+        @ReservedStackAccess
         protected final boolean tryRelease(int releases) {
             int c = getState() - releases;
             if (Thread.currentThread() != getExclusiveOwnerThread())
@@ -203,6 +206,7 @@
          * Performs lock.  Try immediate barge, backing up to normal
          * acquire on failure.
          */
+        @ReservedStackAccess
         final void lock() {
             if (compareAndSetState(0, 1))
                 setExclusiveOwnerThread(Thread.currentThread());
@@ -229,6 +233,7 @@
          * Fair version of tryAcquire.  Don't grant access unless
          * recursive call or no waiters or is first.
          */
+        @ReservedStackAccess
         protected final boolean tryAcquire(int acquires) {
             final Thread current = Thread.currentThread();
             int c = getState();
--- a/src/java.base/share/classes/java/util/regex/Matcher.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/regex/Matcher.java	Thu Jan 21 10:17:21 2016 -0800
@@ -974,7 +974,7 @@
      * @throws  IndexOutOfBoundsException
      *          If the replacement string refers to a capturing group
      *          that does not exist in the pattern
-     * @since 1.9
+     * @since 9
      */
     public Matcher appendReplacement(StringBuilder sb, String replacement) {
         // If no match, return error
@@ -1117,7 +1117,7 @@
      *
      * @return  The target string builder
      *
-     * @since 1.9
+     * @since 9
      */
     public StringBuilder appendTail(StringBuilder sb) {
         sb.append(text, lastAppendPosition, getTextLength());
@@ -1229,7 +1229,7 @@
      * @throws ConcurrentModificationException if it is detected, on a
      *         best-effort basis, that the replacer function modified this
      *         matcher's state
-     * @since 1.9
+     * @since 9
      */
     public String replaceAll(Function<MatchResult, String> replacer) {
         Objects.requireNonNull(replacer);
@@ -1273,7 +1273,7 @@
      * modification is detected.
      *
      * @return a sequential stream of match results.
-     * @since 1.9
+     * @since 9
      */
     public Stream<MatchResult> results() {
         class MatchResultIterator implements Iterator<MatchResult> {
@@ -1451,7 +1451,7 @@
      * @throws ConcurrentModificationException if it is detected, on a
      *         best-effort basis, that the replacer function modified this
      *         matcher's state
-     * @since 1.9
+     * @since 9
      */
     public String replaceFirst(Function<MatchResult, String> replacer) {
         Objects.requireNonNull(replacer);
--- a/src/java.base/share/classes/java/util/stream/DoubleStream.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/stream/DoubleStream.java	Thu Jan 21 10:17:21 2016 -0800
@@ -329,7 +329,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
-     * @since 1.9
+     * @since 9
      */
     default DoubleStream takeWhile(DoublePredicate predicate) {
         Objects.requireNonNull(predicate);
@@ -396,7 +396,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
-     * @since 1.9
+     * @since 9
      */
     default DoubleStream dropWhile(DoublePredicate predicate) {
         Objects.requireNonNull(predicate);
--- a/src/java.base/share/classes/java/util/stream/IntStream.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/stream/IntStream.java	Thu Jan 21 10:17:21 2016 -0800
@@ -326,7 +326,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
-     * @since 1.9
+     * @since 9
      */
     default IntStream takeWhile(IntPredicate predicate) {
         Objects.requireNonNull(predicate);
@@ -392,7 +392,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
-     * @since 1.9
+     * @since 9
      */
     default IntStream dropWhile(IntPredicate predicate) {
         Objects.requireNonNull(predicate);
--- a/src/java.base/share/classes/java/util/stream/LongStream.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/stream/LongStream.java	Thu Jan 21 10:17:21 2016 -0800
@@ -327,7 +327,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
-     * @since 1.9
+     * @since 9
      */
     default LongStream takeWhile(LongPredicate predicate) {
         Objects.requireNonNull(predicate);
@@ -394,7 +394,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
-     * @since 1.9
+     * @since 9
      */
     default LongStream dropWhile(LongPredicate predicate) {
         Objects.requireNonNull(predicate);
--- a/src/java.base/share/classes/java/util/stream/Stream.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/stream/Stream.java	Thu Jan 21 10:17:21 2016 -0800
@@ -533,7 +533,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
-     * @since 1.9
+     * @since 9
      */
     default Stream<T> takeWhile(Predicate<? super T> predicate) {
         Objects.requireNonNull(predicate);
@@ -599,7 +599,7 @@
      *                  predicate to apply to elements to determine the longest
      *                  prefix of elements.
      * @return the new stream
-     * @since 1.9
+     * @since 9
      */
     default Stream<T> dropWhile(Predicate<? super T> predicate) {
         Objects.requireNonNull(predicate);
@@ -1146,7 +1146,7 @@
      * @param <T> the type of stream elements
      * @return a stream with a single element if the specified element
      *         is non-null, otherwise an empty stream
-     * @since 1.9
+     * @since 9
      */
     public static<T> Stream<T> ofNullable(T t) {
         return t == null ? Stream.empty()
--- a/src/java.base/share/classes/java/util/stream/WhileOps.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/stream/WhileOps.java	Thu Jan 21 10:17:21 2016 -0800
@@ -43,7 +43,7 @@
  * Factory for instances of a takeWhile and dropWhile operations
  * that produce subsequences of their input stream.
  *
- * @since 1.9
+ * @since 9
  */
 final class WhileOps {
 
--- a/src/java.base/share/classes/java/util/zip/CRC32C.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/zip/CRC32C.java	Thu Jan 21 10:17:21 2016 -0800
@@ -44,7 +44,7 @@
  * {@link NullPointerException} to be thrown.
  * </p>
  *
- * @since 1.9
+ * @since 9
  */
 public final class CRC32C implements Checksum {
 
--- a/src/java.base/share/classes/java/util/zip/Checksum.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/zip/Checksum.java	Thu Jan 21 10:17:21 2016 -0800
@@ -51,7 +51,7 @@
      * @throws NullPointerException
      *         if {@code b} is {@code null}
      *
-     * @since 1.9
+     * @since 9
      */
     default public void update(byte[] b) {
         update(b, 0, b.length);
@@ -99,7 +99,7 @@
      * @throws NullPointerException
      *         if {@code buffer} is {@code null}
      *
-     * @since 1.9
+     * @since 9
      */
     default public void update(ByteBuffer buffer) {
         int pos = buffer.position();
--- a/src/java.base/share/classes/java/util/zip/ZipEntry.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/java/util/zip/ZipEntry.java	Thu Jan 21 10:17:21 2016 -0800
@@ -220,7 +220,7 @@
      *         The last modification time of the entry in local date-time
      *
      * @see #getTimeLocal()
-     * @since 1.9
+     * @since 9
      */
     public void setTimeLocal(LocalDateTime time) {
         int year = time.getYear() - 1980;
@@ -259,7 +259,7 @@
      * @return  The last modification time of the entry in local date-time
      *
      * @see #setTimeLocal(LocalDateTime)
-     * @since 1.9
+     * @since 9
      */
     public LocalDateTime getTimeLocal() {
         if (mtime != null) {
--- a/src/java.base/share/classes/jdk/internal/HotSpotIntrinsicCandidate.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/jdk/internal/HotSpotIntrinsicCandidate.java	Thu Jan 21 10:17:21 2016 -0800
@@ -117,7 +117,7 @@
  * and that (2) for all methods of that class annotated with
  * {@code @HotSpotIntrinsicCandidate} there is an intrinsic in the list.
  *
- * @since 1.9
+ * @since 9
  */
 @Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
 @Retention(RetentionPolicy.RUNTIME)
--- a/src/java.base/share/classes/jdk/internal/logger/package-info.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/jdk/internal/logger/package-info.java	Thu Jan 21 10:17:21 2016 -0800
@@ -63,6 +63,6 @@
  * @see sun.util.logging.PlatformLogger.Bridge
  * @see sun.util.logging.internal
  *
- * @since 1.9
+ * @since 9
  */
 package jdk.internal.logger;
--- a/src/java.base/share/classes/jdk/internal/misc/Unsafe.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/jdk/internal/misc/Unsafe.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1081,7 +1081,7 @@
      * @return the value fetched from the indicated object
      * @throws RuntimeException No defined exceptions are thrown, not even
      *         {@link NullPointerException}
-     * @since 1.9
+     * @since 9
      */
     @HotSpotIntrinsicCandidate
     public final long getLongUnaligned(Object o, long offset) {
@@ -1115,7 +1115,7 @@
      * @param offset The offset in bytes from the start of the object
      * @param bigEndian The endianness of the value
      * @return the value fetched from the indicated object
-     * @since 1.9
+     * @since 9
      */
     public final long getLongUnaligned(Object o, long offset, boolean bigEndian) {
         return convEndian(bigEndian, getLongUnaligned(o, offset));
@@ -1193,7 +1193,7 @@
      * @param x the value to store
      * @throws RuntimeException No defined exceptions are thrown, not even
      *         {@link NullPointerException}
-     * @since 1.9
+     * @since 9
      */
     @HotSpotIntrinsicCandidate
     public final void putLongUnaligned(Object o, long offset, long x) {
@@ -1231,7 +1231,7 @@
      * @param bigEndian The endianness of the value
      * @throws RuntimeException No defined exceptions are thrown, not even
      *         {@link NullPointerException}
-     * @since 1.9
+     * @since 9
      */
     public final void putLongUnaligned(Object o, long offset, long x, boolean bigEndian) {
         putLongUnaligned(o, offset, convEndian(bigEndian, x));
--- a/src/java.base/share/classes/jdk/internal/ref/PhantomCleanable.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/jdk/internal/ref/PhantomCleanable.java	Thu Jan 21 10:17:21 2016 -0800
@@ -26,6 +26,7 @@
 package jdk.internal.ref;
 
 import java.lang.ref.Cleaner;
+import java.lang.ref.Reference;
 import java.lang.ref.PhantomReference;
 import java.util.Objects;
 
@@ -66,9 +67,9 @@
         this.list = CleanerImpl.getCleanerImpl(cleaner).phantomCleanableList;
         insert();
 
-        // TODO: Replace getClass() with ReachabilityFence when it is available
-        cleaner.getClass();
-        referent.getClass();
+        // Ensure referent and cleaner remain accessible
+        Reference.reachabilityFence(referent);
+        Reference.reachabilityFence(cleaner);
     }
 
     /**
--- a/src/java.base/share/classes/jdk/internal/ref/SoftCleanable.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/jdk/internal/ref/SoftCleanable.java	Thu Jan 21 10:17:21 2016 -0800
@@ -26,6 +26,7 @@
 package jdk.internal.ref;
 
 import java.lang.ref.Cleaner;
+import java.lang.ref.Reference;
 import java.lang.ref.SoftReference;
 import java.util.Objects;
 
@@ -66,9 +67,9 @@
         list = CleanerImpl.getCleanerImpl(cleaner).softCleanableList;
         insert();
 
-        // TODO: Replace getClass() with ReachabilityFence when it is available
-        cleaner.getClass();
-        referent.getClass();
+        // Ensure referent and cleaner remain accessible
+        Reference.reachabilityFence(referent);
+        Reference.reachabilityFence(cleaner);
     }
 
     /**
--- a/src/java.base/share/classes/jdk/internal/ref/WeakCleanable.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/jdk/internal/ref/WeakCleanable.java	Thu Jan 21 10:17:21 2016 -0800
@@ -26,6 +26,7 @@
  */
 
 import java.lang.ref.Cleaner;
+import java.lang.ref.Reference;
 import java.lang.ref.WeakReference;
 import java.util.Objects;
 
@@ -66,9 +67,10 @@
         list = CleanerImpl.getCleanerImpl(cleaner).weakCleanableList;
         insert();
 
-        // TODO: Replace getClass() with ReachabilityFence when it is available
-        cleaner.getClass();
-        referent.getClass();
+        // Ensure referent and cleaner remain accessible
+        Reference.reachabilityFence(referent);
+        Reference.reachabilityFence(cleaner);
+
     }
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/vm/annotation/DontInline.java	Thu Jan 21 10:17:21 2016 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  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.
+ */
+
+package jdk.internal.vm.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * A method or constructor may be annotated as "don't inline" if the inlining of
+ * this method should not be performed by the HotSpot VM.
+ * <p>
+ * This annotation must be used sparingly.  It is useful when the only
+ * reasonable alternative is to bind the name of a specific method or
+ * constructor into the HotSpot VM for special handling by the inlining policy.
+ * This annotation must not be relied on as an alternative to avoid tuning the
+ * VM's inlining policy.  In a few cases, it may act as a temporary workaround
+ * until the profiling and inlining performed by the HotSpot VM is sufficiently
+ * improved.
+ *
+ * @implNote
+ * This annotation only takes effect for methods or constructors of classes
+ * loaded by the boot loader.  Annotations on methods or constructors of classes
+ * loaded outside of the boot loader are ignored.
+ */
+@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface DontInline {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/vm/annotation/ForceInline.java	Thu Jan 21 10:17:21 2016 -0800
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  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.
+ */
+
+package jdk.internal.vm.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * A method or constructor may be annotated as "force inline" if the standard
+ * inlining metrics are to be ignored when the HotSpot VM inlines the method
+ * or constructor.
+ * <p>
+ * This annotation must be used sparingly.  It is useful when the only
+ * reasonable alternative is to bind the name of a specific method or
+ * constructor into the HotSpot VM for special handling by the inlining policy.
+ * This annotation must not be relied on as an alternative to avoid tuning the
+ * VM's inlining policy.  In a few cases, it may act as a temporary workaround
+ * until the profiling and inlining performed by the HotSpot VM is sufficiently
+ * improved.
+ *
+ * @implNote
+ * This annotation only takes effect for methods or constructors of classes
+ * loaded by the boot loader.  Annotations on methods or constructors of classes
+ * loaded outside of the boot loader are ignored.
+ */
+@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ForceInline {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/vm/annotation/ReservedStackAccess.java	Thu Jan 21 10:17:21 2016 -0800
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  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.
+ */
+
+package jdk.internal.vm.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * <p>An annotation expressing that a method is especially sensitive
+ * to stack overflows. This is a hint the JVM can use to grant access to
+ * extra stack space when executing this code if such feature is supported
+ * by the JVM. The JVM is free to ignore this annotation.
+ *
+ * A possible way for the JVM to improve the execution context for methods
+ * with this annotation is to reserve part of the thread's execution stack
+ * for them. Access to this section of the stack would be denied by default
+ * but could be granted if the JVM detects a possible stack overflow and
+ * the thread's call stack includes at least one annotated method. Even if
+ * access to this reserved area has been granted, the JVM might decide to
+ * throw a delayed StackOverflowError when the thread exits the annotated
+ * method.
+ *
+ * @since 1.9
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
+public @interface ReservedStackAccess { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java	Thu Jan 21 10:17:21 2016 -0800
@@ -0,0 +1,90 @@
+/*
+ * 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.  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.
+ */
+
+package jdk.internal.vm.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * A field may be annotated as stable if all of its component variables
+ * changes value at most once.
+ * A field's value counts as its component value.
+ * If the field is typed as an array, then all the non-null components
+ * of the array, of depth up to the rank of the field's array type,
+ * also count as component values.
+ * By extension, any variable (either array or field) which has annotated
+ * as stable is called a stable variable, and its non-null or non-zero
+ * value is called a stable value.
+ * <p>
+ * Since all fields begin with a default value of null for references
+ * (resp., zero for primitives), it follows that this annotation indicates
+ * that the first non-null (resp., non-zero) value stored in the field
+ * will never be changed.
+ * <p>
+ * If the field is not of an array type, there are no array elements,
+ * then the value indicated as stable is simply the value of the field.
+ * If the dynamic type of the field value is an array but the static type
+ * is not, the components of the array are <em>not</em> regarded as stable.
+ * <p>
+ * If the field is an array type, then both the field value and
+ * all the components of the field value (if the field value is non-null)
+ * are indicated to be stable.
+ * If the field type is an array type with rank {@code N > 1},
+ * then each component of the field value (if the field value is non-null),
+ * is regarded as a stable array of rank {@code N-1}.
+ * <p>
+ * Fields which are declared {@code final} may also be annotated as stable.
+ * Since final fields already behave as stable values, such an annotation
+ * conveys no additional information regarding change of the field's value, but
+ * still conveys information regarding change of additional components values if
+ * the type of the field is an array type (as described above).
+ * <p>
+ * The HotSpot VM relies on this annotation to promote a non-null (resp.,
+ * non-zero) component value to a constant, thereby enabling superior
+ * optimizations of code depending on such a value (such as constant folding).
+ * More specifically, the HotSpot VM will process non-null stable fields (final
+ * or otherwise) in a similar manner to static final fields with respect to
+ * promoting the field's value to a constant.  Thus, placing aside the
+ * differences for null/non-null values and arrays, a final stable field is
+ * treated as if it is really final from both the Java language and the HotSpot
+ * VM.
+ * <p>
+ * It is (currently) undefined what happens if a field annotated as stable
+ * is given a third value (by explicitly updating a stable field, a component of
+ * a stable array, or a final stable field via reflection or other means).
+ * Since the HotSpot VM promotes a non-null component value to constant, it may
+ * be that the Java memory model would appear to be broken, if such a constant
+ * (the second value of the field) is used as the value of the field even after
+ * the field value has changed (to a third value).
+ *
+ * @implNote
+ * This annotation only takes effect for fields of classes loaded by the boot
+ * loader.  Annoations on fields of classes loaded outside of the boot loader
+ * are ignored.
+ */
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Stable {
+}
--- a/src/java.base/share/classes/sun/invoke/anon/AnonymousClassLoader.java	Thu Jan 21 09:46:03 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,234 +0,0 @@
-/*
- * Copyright (c) 2008, 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.  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.
- */
-
-package sun.invoke.anon;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-/**
- * Anonymous class loader.  Will load any valid classfile, producing
- * a {@link Class} metaobject, without installing that class in the
- * system dictionary.  Therefore, {@link Class#forName(String)} will never
- * produce a reference to an anonymous class.
- * <p>
- * The access permissions of the anonymous class are borrowed from
- * a <em>host class</em>.  The new class behaves as if it were an
- * inner class of the host class.  It can access the host's private
- * members, if the creator of the class loader has permission to
- * do so (or to create accessible reflective objects).
- * <p>
- * When the anonymous class is loaded, elements of its constant pool
- * can be patched to new values.  This provides a hook to pre-resolve
- * named classes in the constant pool to other classes, including
- * anonymous ones.  Also, string constants can be pre-resolved to
- * any reference.  (The verifier treats non-string, non-class reference
- * constants as plain objects.)
- *  <p>
- * Why include the patching function?  It makes some use cases much easier.
- * Second, the constant pool needed some internal patching anyway,
- * to anonymize the loaded class itself.  Finally, if you are going
- * to use this seriously, you'll want to build anonymous classes
- * on top of pre-existing anonymous classes, and that requires patching.
- *
- * <p>%%% TO-DO:
- * <ul>
- * <li>needs better documentation</li>
- * <li>needs more security work (for safe delegation)</li>
- * <li>needs a clearer story about error processing</li>
- * <li>patch member references also (use ';' as delimiter char)</li>
- * <li>patch method references to (conforming) method handles</li>
- * </ul>
- *
- * @author jrose
- * @author Remi Forax
- * @see <a href="http://blogs.sun.com/jrose/entry/anonymous_classes_in_the_vm">
- *      http://blogs.sun.com/jrose/entry/anonymous_classes_in_the_vm</a>
- */
-
-public class AnonymousClassLoader {
-    final Class<?> hostClass;
-
-    // Privileged constructor.
-    private AnonymousClassLoader(Class<?> hostClass) {
-        this.hostClass = hostClass;
-    }
-
-    public static AnonymousClassLoader make(jdk.internal.misc.Unsafe unsafe, Class<?> hostClass) {
-        if (unsafe == null)  throw new NullPointerException();
-        return new AnonymousClassLoader(hostClass);
-    }
-
-    public Class<?> loadClass(byte[] classFile) {
-        if (defineAnonymousClass == null) {
-            // no JVM support; try to fake an approximation
-            try {
-                return fakeLoadClass(new ConstantPoolParser(classFile).createPatch());
-            } catch (InvalidConstantPoolFormatException ee) {
-                throw new IllegalArgumentException(ee);
-            }
-        }
-        return loadClass(classFile, null);
-    }
-
-    public Class<?> loadClass(ConstantPoolPatch classPatch) {
-        if (defineAnonymousClass == null) {
-            // no JVM support; try to fake an approximation
-            return fakeLoadClass(classPatch);
-        }
-        Object[] patches = classPatch.patchArray;
-        // Convert class names (this late in the game)
-        // to use slash '/' instead of dot '.'.
-        // Java likes dots, but the JVM likes slashes.
-        for (int i = 0; i < patches.length; i++) {
-            Object value = patches[i];
-            if (value != null) {
-                byte tag = classPatch.getTag(i);
-                switch (tag) {
-                case ConstantPoolVisitor.CONSTANT_Class:
-                    if (value instanceof String) {
-                        if (patches == classPatch.patchArray)
-                            patches = patches.clone();
-                        patches[i] = ((String)value).replace('.', '/');
-                    }
-                    break;
-                case ConstantPoolVisitor.CONSTANT_Fieldref:
-                case ConstantPoolVisitor.CONSTANT_Methodref:
-                case ConstantPoolVisitor.CONSTANT_InterfaceMethodref:
-                case ConstantPoolVisitor.CONSTANT_NameAndType:
-                    // When/if the JVM supports these patches,
-                    // we'll probably need to reformat them also.
-                    // Meanwhile, let the class loader create the error.
-                    break;
-                }
-            }
-        }
-        return loadClass(classPatch.outer.classFile, classPatch.patchArray);
-    }
-
-    private Class<?> loadClass(byte[] classFile, Object[] patchArray) {
-        try {
-            return (Class<?>)
-                defineAnonymousClass.invoke(unsafe,
-                                            hostClass, classFile, patchArray);
-        } catch (Exception ex) {
-            throwReflectedException(ex);
-            throw new RuntimeException("error loading into "+hostClass, ex);
-        }
-    }
-
-    private static void throwReflectedException(Exception ex) {
-        if (ex instanceof InvocationTargetException) {
-            Throwable tex = ((InvocationTargetException)ex).getTargetException();
-            if (tex instanceof Error)
-                throw (Error) tex;
-            ex = (Exception) tex;
-        }
-        if (ex instanceof RuntimeException) {
-            throw (RuntimeException) ex;
-        }
-    }
-
-    private Class<?> fakeLoadClass(ConstantPoolPatch classPatch) {
-        // Implementation:
-        // 1. Make up a new name nobody has used yet.
-        // 2. Inspect the tail-header of the class to find the this_class index.
-        // 3. Patch the CONSTANT_Class for this_class to the new name.
-        // 4. Add other CP entries required by (e.g.) string patches.
-        // 5. Flatten Class constants down to their names, making sure that
-        //    the host class loader can pick them up again accurately.
-        // 6. Generate the edited class file bytes.
-        //
-        // Potential limitations:
-        // * The class won't be truly anonymous, and may interfere with others.
-        // * Flattened class constants might not work, because of loader issues.
-        // * Pseudo-string constants will not flatten down to real strings.
-        // * Method handles will (of course) fail to flatten to linkage strings.
-        if (true)  throw new UnsupportedOperationException("NYI");
-        Object[] cpArray;
-        try {
-            cpArray = classPatch.getOriginalCP();
-        } catch (InvalidConstantPoolFormatException ex) {
-            throw new RuntimeException(ex);
-        }
-        int thisClassIndex = classPatch.getParser().getThisClassIndex();
-        String thisClassName = (String) cpArray[thisClassIndex];
-        synchronized (AnonymousClassLoader.class) {
-            thisClassName = thisClassName+"\\|"+(++fakeNameCounter);
-        }
-        classPatch.putUTF8(thisClassIndex, thisClassName);
-        byte[] classFile = null;
-        return unsafe.defineClass(null, classFile, 0, classFile.length,
-                                  hostClass.getClassLoader(),
-                                  hostClass.getProtectionDomain());
-    }
-    private static int fakeNameCounter = 99999;
-
-    // ignore two warnings on this line:
-    private static jdk.internal.misc.Unsafe unsafe = jdk.internal.misc.Unsafe.getUnsafe();
-    // preceding line requires that this class be on the boot class path
-
-    private static final Method defineAnonymousClass;
-    static {
-        Method dac = null;
-        Class<? extends jdk.internal.misc.Unsafe> unsafeClass = unsafe.getClass();
-        try {
-            dac = unsafeClass.getMethod("defineAnonymousClass",
-                                        Class.class,
-                                        byte[].class,
-                                        Object[].class);
-        } catch (Exception ee) {
-            dac = null;
-        }
-        defineAnonymousClass = dac;
-    }
-
-    private static void noJVMSupport() {
-        throw new UnsupportedOperationException("no JVM support for anonymous classes");
-    }
-
-
-    private static native Class<?> loadClassInternal(Class<?> hostClass,
-                                                     byte[] classFile,
-                                                     Object[] patchArray);
-
-    public static byte[] readClassFile(Class<?> templateClass) throws IOException {
-        String templateName = templateClass.getName();
-        int lastDot = templateName.lastIndexOf('.');
-        java.net.URL url = templateClass.getResource(templateName.substring(lastDot+1)+".class");
-        java.net.URLConnection connection = url.openConnection();
-        int contentLength = connection.getContentLength();
-        if (contentLength < 0)
-            throw new IOException("invalid content length "+contentLength);
-
-        byte[] b = connection.getInputStream().readAllBytes();
-        if (b.length != contentLength)
-            throw new EOFException("Expected:" + contentLength + ", read:" + b.length);
-
-        return b;
-    }
-}
--- a/src/java.base/share/classes/sun/invoke/anon/ConstantPoolParser.java	Thu Jan 21 09:46:03 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,368 +0,0 @@
-/*
- * Copyright (c) 2008, 2011, 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.
- */
-
-package sun.invoke.anon;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.BufferUnderflowException;
-import java.nio.ByteBuffer;
-
-import static sun.invoke.anon.ConstantPoolVisitor.*;
-
-/** A constant pool parser.
- */
-public class ConstantPoolParser {
-    final byte[] classFile;
-    final byte[] tags;
-    final char[] firstHeader;  // maghi, maglo, minor, major, cplen
-
-    // these are filled in on first parse:
-    int endOffset;
-    char[] secondHeader;       // flags, this_class, super_class, intlen
-
-    // used to decode UTF8 array
-    private char[] charArray = new char[80];
-
-    /** Creates a constant pool parser.
-     * @param classFile an array of bytes containing a class.
-     * @throws InvalidConstantPoolFormatException if the header of the class has errors.
-     */
-    public ConstantPoolParser(byte[] classFile) throws InvalidConstantPoolFormatException {
-        this.classFile = classFile;
-        this.firstHeader = parseHeader(classFile);
-        this.tags = new byte[firstHeader[4]];
-    }
-
-    /** Create a constant pool parser by loading the bytecodes of the
-     *  class taken as argument.
-     *
-     * @param templateClass the class to parse.
-     *
-     * @throws IOException raised if an I/O occurs when loading
-     *  the bytecode of the template class.
-     * @throws InvalidConstantPoolFormatException if the header of the class has errors.
-     *
-     * @see #ConstantPoolParser(byte[])
-     * @see AnonymousClassLoader#readClassFile(Class)
-     */
-    public ConstantPoolParser(Class<?> templateClass) throws IOException, InvalidConstantPoolFormatException {
-        this(AnonymousClassLoader.readClassFile(templateClass));
-    }
-
-    /** Creates an empty patch to patch the class file
-     *  used by the current parser.
-     * @return a new class patch.
-     */
-    public ConstantPoolPatch createPatch() {
-        return new ConstantPoolPatch(this);
-    }
-
-    /** Report the tag of the indicated CP entry.
-     * @param index
-     * @return one of {@link ConstantPoolVisitor#CONSTANT_Utf8}, etc.
-     */
-    public byte getTag(int index) {
-        getEndOffset();  // trigger an exception if we haven't parsed yet
-        return tags[index];
-    }
-
-    /** Report the length of the constant pool. */
-    public int getLength() {
-        return firstHeader[4];
-    }
-
-    /** Report the offset, within the class file, of the start of the constant pool. */
-    public int getStartOffset() {
-        return firstHeader.length * 2;
-    }
-
-    /** Report the offset, within the class file, of the end of the constant pool. */
-    public int getEndOffset() {
-        if (endOffset == 0)
-            throw new IllegalStateException("class file has not yet been parsed");
-        return endOffset;
-    }
-
-    /** Report the CP index of this class's own name. */
-    public int getThisClassIndex() {
-        getEndOffset();   // provoke exception if not yet parsed
-        return secondHeader[1];
-    }
-
-    /** Report the total size of the class file. */
-    public int getTailLength() {
-        return classFile.length - getEndOffset();
-    }
-
-    /** Write the head (header plus constant pool)
-     *  of the class file to the indicated stream.
-     */
-    public void writeHead(OutputStream out) throws IOException {
-        out.write(classFile, 0, getEndOffset());
-    }
-
-    /** Write the head (header plus constant pool)
-     *  of the class file to the indicated stream,
-     *  incorporating the non-null entries of the given array
-     *  as patches.
-     */
-    void writePatchedHead(OutputStream out, Object[] patchArray) {
-        // this will be useful to partially emulate the class loader on old JVMs
-        throw new UnsupportedOperationException("Not yet implemented");
-    }
-
-    /** Write the tail (everything after the constant pool)
-     *  of the class file to the indicated stream.
-     */
-    public void writeTail(OutputStream out) throws IOException {
-        out.write(classFile, getEndOffset(), getTailLength());
-    }
-
-    private static char[] parseHeader(byte[] classFile) throws InvalidConstantPoolFormatException {
-        char[] result = new char[5];
-        ByteBuffer buffer = ByteBuffer.wrap(classFile);
-        for (int i = 0; i < result.length; i++)
-            result[i] = (char) getUnsignedShort(buffer);
-        int magic = result[0] << 16 | result[1] << 0;
-        if (magic != 0xCAFEBABE)
-            throw new InvalidConstantPoolFormatException("invalid magic number "+magic);
-        // skip major, minor version
-        int len = result[4];
-        if (len < 1)
-            throw new InvalidConstantPoolFormatException("constant pool length < 1");
-        return result;
-    }
-
-    /** Parse the constant pool of the class
-     *  calling a method visit* each time a constant pool entry is parsed.
-     *
-     *  The order of the calls to visit* is not guaranteed to be the same
-     *  than the order of the constant pool entry in the bytecode array.
-     *
-     * @param visitor
-     * @throws InvalidConstantPoolFormatException
-     */
-    public void parse(ConstantPoolVisitor visitor) throws InvalidConstantPoolFormatException {
-        ByteBuffer buffer = ByteBuffer.wrap(classFile);
-        buffer.position(getStartOffset()); //skip header
-
-        Object[] values = new Object[getLength()];
-        try {
-            parseConstantPool(buffer, values, visitor);
-        } catch(BufferUnderflowException e) {
-            throw new InvalidConstantPoolFormatException(e);
-        }
-        if (endOffset == 0) {
-            endOffset = buffer.position();
-            secondHeader = new char[4];
-            for (int i = 0; i < secondHeader.length; i++) {
-                secondHeader[i] = (char) getUnsignedShort(buffer);
-            }
-        }
-        resolveConstantPool(values, visitor);
-    }
-
-    private char[] getCharArray(int utfLength) {
-        if (utfLength <= charArray.length)
-            return charArray;
-        return charArray = new char[utfLength];
-    }
-
-    private void parseConstantPool(ByteBuffer buffer, Object[] values, ConstantPoolVisitor visitor) throws InvalidConstantPoolFormatException {
-        for (int i = 1; i < tags.length; ) {
-            byte tag = (byte) getUnsignedByte(buffer);
-            assert(tags[i] == 0 || tags[i] == tag);
-            tags[i] = tag;
-            switch (tag) {
-                case CONSTANT_Utf8:
-                    int utfLen = getUnsignedShort(buffer);
-                    String value = getUTF8(buffer, utfLen, getCharArray(utfLen));
-                    visitor.visitUTF8(i, CONSTANT_Utf8, value);
-                    tags[i] = tag;
-                    values[i++] = value;
-                    break;
-                case CONSTANT_Integer:
-                    visitor.visitConstantValue(i, tag, buffer.getInt());
-                    i++;
-                    break;
-                case CONSTANT_Float:
-                    visitor.visitConstantValue(i, tag, buffer.getFloat());
-                    i++;
-                    break;
-                case CONSTANT_Long:
-                    visitor.visitConstantValue(i, tag, buffer.getLong());
-                    i+=2;
-                    break;
-                case CONSTANT_Double:
-                    visitor.visitConstantValue(i, tag, buffer.getDouble());
-                    i+=2;
-                    break;
-
-                case CONSTANT_Class:    // fall through:
-                case CONSTANT_String:
-                    tags[i] = tag;
-                    values[i++] = new int[] { getUnsignedShort(buffer) };
-                    break;
-
-                case CONSTANT_Fieldref:           // fall through:
-                case CONSTANT_Methodref:          // fall through:
-                case CONSTANT_InterfaceMethodref: // fall through:
-                case CONSTANT_NameAndType:
-                    tags[i] = tag;
-                    values[i++] = new int[] { getUnsignedShort(buffer), getUnsignedShort(buffer) };
-                    break;
-                default:
-                    throw new AssertionError("invalid constant "+tag);
-            }
-        }
-    }
-
-    private void resolveConstantPool(Object[] values, ConstantPoolVisitor visitor) {
-        // clean out the int[] values, which are temporary
-        for (int beg = 1, end = values.length-1, beg2, end2;
-             beg <= end;
-             beg = beg2, end = end2) {
-             beg2 = end; end2 = beg-1;
-             //System.out.println("CP resolve pass: "+beg+".."+end);
-             for (int i = beg; i <= end; i++) {
-                  Object value = values[i];
-                  if (!(value instanceof int[]))
-                      continue;
-                  int[] array = (int[]) value;
-                  byte tag = tags[i];
-                  switch (tag) {
-                      case CONSTANT_String:
-                          String stringBody = (String) values[array[0]];
-                          visitor.visitConstantString(i, tag, stringBody, array[0]);
-                          values[i] = null;
-                          break;
-                      case CONSTANT_Class: {
-                          String className = (String) values[array[0]];
-                          // use the external form favored by Class.forName:
-                          className = className.replace('/', '.');
-                          visitor.visitConstantString(i, tag, className, array[0]);
-                          values[i] = className;
-                          break;
-                      }
-                      case CONSTANT_NameAndType: {
-                          String memberName = (String) values[array[0]];
-                          String signature  = (String) values[array[1]];
-                          visitor.visitDescriptor(i, tag, memberName, signature,
-                                                  array[0], array[1]);
-                          values[i] = new String[] {memberName, signature};
-                          break;
-                      }
-                      case CONSTANT_Fieldref:           // fall through:
-                      case CONSTANT_Methodref:          // fall through:
-                      case CONSTANT_InterfaceMethodref: {
-                              Object className   = values[array[0]];
-                              Object nameAndType = values[array[1]];
-                              if (!(className instanceof String) ||
-                                  !(nameAndType instanceof String[])) {
-                                   // one more pass is needed
-                                   if (beg2 > i)  beg2 = i;
-                                   if (end2 < i)  end2 = i;
-                                   continue;
-                              }
-                              String[] nameAndTypeArray = (String[]) nameAndType;
-                              visitor.visitMemberRef(i, tag,
-                                  (String)className,
-                                  nameAndTypeArray[0],
-                                  nameAndTypeArray[1],
-                                  array[0], array[1]);
-                              values[i] = null;
-                          }
-                          break;
-                      default:
-                          continue;
-                }
-            }
-        }
-    }
-
-    private static int getUnsignedByte(ByteBuffer buffer) {
-        return buffer.get() & 0xFF;
-    }
-
-    private static int getUnsignedShort(ByteBuffer buffer) {
-        int b1 = getUnsignedByte(buffer);
-        int b2 = getUnsignedByte(buffer);
-        return (b1 << 8) + (b2 << 0);
-    }
-
-    private static String getUTF8(ByteBuffer buffer, int utfLen, char[] charArray) throws InvalidConstantPoolFormatException {
-      int utfLimit = buffer.position() + utfLen;
-      int index = 0;
-      while (buffer.position() < utfLimit) {
-          int c = buffer.get() & 0xff;
-          if (c > 127) {
-              buffer.position(buffer.position() - 1);
-              return getUTF8Extended(buffer, utfLimit, charArray, index);
-          }
-          charArray[index++] = (char)c;
-      }
-      return new String(charArray, 0, index);
-    }
-
-    private static String getUTF8Extended(ByteBuffer buffer, int utfLimit, char[] charArray, int index) throws InvalidConstantPoolFormatException {
-        int c, c2, c3;
-        while (buffer.position() < utfLimit) {
-            c = buffer.get() & 0xff;
-            switch (c >> 4) {
-                case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
-                    /* 0xxxxxxx*/
-                    charArray[index++] = (char)c;
-                    break;
-                case 12: case 13:
-                    /* 110x xxxx   10xx xxxx*/
-                    c2 = buffer.get();
-                    if ((c2 & 0xC0) != 0x80)
-                        throw new InvalidConstantPoolFormatException(
-                            "malformed input around byte " + buffer.position());
-                     charArray[index++] = (char)(((c  & 0x1F) << 6) |
-                                                  (c2 & 0x3F));
-                    break;
-                case 14:
-                    /* 1110 xxxx  10xx xxxx  10xx xxxx */
-                    c2 = buffer.get();
-                    c3 = buffer.get();
-                    if (((c2 & 0xC0) != 0x80) || ((c3 & 0xC0) != 0x80))
-                       throw new InvalidConstantPoolFormatException(
-                          "malformed input around byte " + (buffer.position()));
-                    charArray[index++] = (char)(((c  & 0x0F) << 12) |
-                                                ((c2 & 0x3F) << 6)  |
-                                                ((c3 & 0x3F) << 0));
-                    break;
-                default:
-                    /* 10xx xxxx,  1111 xxxx */
-                    throw new InvalidConstantPoolFormatException(
-                        "malformed input around byte " + buffer.position());
-            }
-        }
-        // The number of chars produced may be less than utflen
-        return new String(charArray, 0, index);
-    }
-}
--- a/src/java.base/share/classes/sun/invoke/anon/ConstantPoolPatch.java	Thu Jan 21 09:46:03 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,503 +0,0 @@
-/*
- * Copyright (c) 2008, 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.  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.
- */
-
-package sun.invoke.anon;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.IdentityHashMap;
-import java.util.Map;
-
-import static sun.invoke.anon.ConstantPoolVisitor.*;
-
-/** A class and its patched constant pool.
- *
- *  This class allow to modify (patch) a constant pool
- *  by changing the value of its entry.
- *  Entry are referenced using index that can be get
- *  by parsing the constant pool using
- *  {@link ConstantPoolParser#parse(ConstantPoolVisitor)}.
- *
- * @see ConstantPoolVisitor
- * @see ConstantPoolParser#createPatch()
- */
-public class ConstantPoolPatch {
-    final ConstantPoolParser outer;
-    final Object[] patchArray;
-
-    ConstantPoolPatch(ConstantPoolParser outer) {
-        this.outer      = outer;
-        this.patchArray = new Object[outer.getLength()];
-    }
-
-    /** Create a {@link ConstantPoolParser} and
-     *  a {@link ConstantPoolPatch} in one step.
-     *  Equivalent to {@code new ConstantPoolParser(classFile).createPatch()}.
-     *
-     * @param classFile an array of bytes containing a class.
-     * @see #ConstantPoolParser(Class)
-     */
-    public ConstantPoolPatch(byte[] classFile) throws InvalidConstantPoolFormatException {
-        this(new ConstantPoolParser(classFile));
-    }
-
-    /** Create a {@link ConstantPoolParser} and
-     *  a {@link ConstantPoolPatch} in one step.
-     *  Equivalent to {@code new ConstantPoolParser(templateClass).createPatch()}.
-     *
-     * @param templateClass the class to parse.
-     * @see #ConstantPoolParser(Class)
-     */
-    public ConstantPoolPatch(Class<?> templateClass) throws IOException, InvalidConstantPoolFormatException {
-        this(new ConstantPoolParser(templateClass));
-    }
-
-
-    /** Creates a patch from an existing patch.
-     *  All changes are copied from that patch.
-     * @param patch a patch
-     *
-     * @see ConstantPoolParser#createPatch()
-     */
-    public ConstantPoolPatch(ConstantPoolPatch patch) {
-        outer      = patch.outer;
-        patchArray = patch.patchArray.clone();
-    }
-
-    /** Which parser built this patch? */
-    public ConstantPoolParser getParser() {
-        return outer;
-    }
-
-    /** Report the tag at the given index in the constant pool. */
-    public byte getTag(int index) {
-        return outer.getTag(index);
-    }
-
-    /** Report the current patch at the given index of the constant pool.
-     *  Null means no patch will be made.
-     *  To observe the unpatched entry at the given index, use
-     *  {@link #getParser()}{@code .}@link ConstantPoolParser#parse(ConstantPoolVisitor)}
-     */
-    public Object getPatch(int index) {
-        Object value = patchArray[index];
-        if (value == null)  return null;
-        switch (getTag(index)) {
-        case CONSTANT_Fieldref:
-        case CONSTANT_Methodref:
-        case CONSTANT_InterfaceMethodref:
-            if (value instanceof String)
-                value = stripSemis(2, (String) value);
-            break;
-        case CONSTANT_NameAndType:
-            if (value instanceof String)
-                value = stripSemis(1, (String) value);
-            break;
-        }
-        return value;
-    }
-
-    /** Clear all patches. */
-    public void clear() {
-        Arrays.fill(patchArray, null);
-    }
-
-    /** Clear one patch. */
-    public void clear(int index) {
-        patchArray[index] = null;
-    }
-
-    /** Produce the patches as an array. */
-    public Object[] getPatches() {
-        return patchArray.clone();
-    }
-
-    /** Produce the original constant pool as an array. */
-    public Object[] getOriginalCP() throws InvalidConstantPoolFormatException {
-        return getOriginalCP(0, patchArray.length, -1);
-    }
-
-    /** Walk the constant pool, applying patches using the given map.
-     *
-     * @param utf8Map Utf8 strings to modify, if encountered
-     * @param classMap Classes (or their names) to modify, if encountered
-     * @param valueMap Constant values to modify, if encountered
-     * @param deleteUsedEntries if true, delete map entries that are used
-     */
-    public void putPatches(final Map<String,String> utf8Map,
-                           final Map<String,Object> classMap,
-                           final Map<Object,Object> valueMap,
-                           boolean deleteUsedEntries) throws InvalidConstantPoolFormatException {
-        final HashSet<String> usedUtf8Keys;
-        final HashSet<String> usedClassKeys;
-        final HashSet<Object> usedValueKeys;
-        if (deleteUsedEntries) {
-            usedUtf8Keys  = (utf8Map  == null) ? null : new HashSet<String>();
-            usedClassKeys = (classMap == null) ? null : new HashSet<String>();
-            usedValueKeys = (valueMap == null) ? null : new HashSet<Object>();
-        } else {
-            usedUtf8Keys = null;
-            usedClassKeys = null;
-            usedValueKeys = null;
-        }
-
-        outer.parse(new ConstantPoolVisitor() {
-
-            @Override
-            public void visitUTF8(int index, byte tag, String utf8) {
-                putUTF8(index, utf8Map.get(utf8));
-                if (usedUtf8Keys != null)  usedUtf8Keys.add(utf8);
-            }
-
-            @Override
-            public void visitConstantValue(int index, byte tag, Object value) {
-                putConstantValue(index, tag, valueMap.get(value));
-                if (usedValueKeys != null)  usedValueKeys.add(value);
-            }
-
-            @Override
-            public void visitConstantString(int index, byte tag, String name, int nameIndex) {
-                if (tag == CONSTANT_Class) {
-                    putConstantValue(index, tag, classMap.get(name));
-                    if (usedClassKeys != null)  usedClassKeys.add(name);
-                } else {
-                    assert(tag == CONSTANT_String);
-                    visitConstantValue(index, tag, name);
-                }
-            }
-        });
-        if (usedUtf8Keys != null)   utf8Map.keySet().removeAll(usedUtf8Keys);
-        if (usedClassKeys != null)  classMap.keySet().removeAll(usedClassKeys);
-        if (usedValueKeys != null)  valueMap.keySet().removeAll(usedValueKeys);
-    }
-
-    Object[] getOriginalCP(final int startIndex,
-                           final int endIndex,
-                           final int tagMask) throws InvalidConstantPoolFormatException {
-        final Object[] cpArray = new Object[endIndex - startIndex];
-        outer.parse(new ConstantPoolVisitor() {
-
-            void show(int index, byte tag, Object value) {
-                if (index < startIndex || index >= endIndex)  return;
-                if (((1 << tag) & tagMask) == 0)  return;
-                cpArray[index - startIndex] = value;
-            }
-
-            @Override
-            public void visitUTF8(int index, byte tag, String utf8) {
-                show(index, tag, utf8);
-            }
-
-            @Override
-            public void visitConstantValue(int index, byte tag, Object value) {
-                assert(tag != CONSTANT_String);
-                show(index, tag, value);
-            }
-
-            @Override
-            public void visitConstantString(int index, byte tag,
-                                            String value, int j) {
-                show(index, tag, value);
-            }
-
-            @Override
-            public void visitMemberRef(int index, byte tag,
-                    String className, String memberName,
-                    String signature,
-                    int j, int k) {
-                show(index, tag, new String[]{ className, memberName, signature });
-            }
-
-            @Override
-            public void visitDescriptor(int index, byte tag,
-                    String memberName, String signature,
-                    int j, int k) {
-                show(index, tag, new String[]{ memberName, signature });
-            }
-        });
-        return cpArray;
-    }
-
-    /** Write the head (header plus constant pool)
-     *  of the patched class file to the indicated stream.
-     */
-    void writeHead(OutputStream out) throws IOException {
-        outer.writePatchedHead(out, patchArray);
-    }
-
-    /** Write the tail (everything after the constant pool)
-     *  of the patched class file to the indicated stream.
-     */
-    void writeTail(OutputStream out) throws IOException {
-        outer.writeTail(out);
-    }
-
-    private void checkConstantTag(byte tag, Object value) {
-        if (value == null)
-            throw new IllegalArgumentException(
-                    "invalid null constant value");
-        if (classForTag(tag) != value.getClass())
-            throw new IllegalArgumentException(
-                    "invalid constant value"
-                    + (tag == CONSTANT_None ? ""
-                        : " for tag "+tagName(tag))
-                    + " of class "+value.getClass());
-    }
-
-    private void checkTag(int index, byte putTag) {
-        byte tag = outer.tags[index];
-        if (tag != putTag)
-            throw new IllegalArgumentException(
-                "invalid put operation"
-                + " for " + tagName(putTag)
-                + " at index " + index + " found " + tagName(tag));
-    }
-
-    private void checkTagMask(int index, int tagBitMask) {
-        byte tag = outer.tags[index];
-        int tagBit = ((tag & 0x1F) == tag) ? (1 << tag) : 0;
-        if ((tagBit & tagBitMask) == 0)
-            throw new IllegalArgumentException(
-                "invalid put operation"
-                + " at index " + index + " found " + tagName(tag));
-    }
-
-    private static void checkMemberName(String memberName) {
-        if (memberName.indexOf(';') >= 0)
-            throw new IllegalArgumentException("memberName " + memberName + " contains a ';'");
-    }
-
-    /** Set the entry of the constant pool indexed by index to
-     *  a new string.
-     *
-     * @param index an index to a constant pool entry containing a
-     *        {@link ConstantPoolVisitor#CONSTANT_Utf8} value.
-     * @param utf8 a string
-     *
-     * @see ConstantPoolVisitor#visitUTF8(int, byte, String)
-     */
-    public void putUTF8(int index, String utf8) {
-        if (utf8 == null) { clear(index); return; }
-        checkTag(index, CONSTANT_Utf8);
-        patchArray[index] = utf8;
-    }
-
-    /** Set the entry of the constant pool indexed by index to
-     *  a new value, depending on its dynamic type.
-     *
-     * @param index an index to a constant pool entry containing a
-     *        one of the following structures:
-     *        {@link ConstantPoolVisitor#CONSTANT_Integer},
-     *        {@link ConstantPoolVisitor#CONSTANT_Float},
-     *        {@link ConstantPoolVisitor#CONSTANT_Long},
-     *        {@link ConstantPoolVisitor#CONSTANT_Double},
-     *        {@link ConstantPoolVisitor#CONSTANT_String}, or
-     *        {@link ConstantPoolVisitor#CONSTANT_Class}
-     * @param value a boxed int, float, long or double; or a string or class object
-     * @throws IllegalArgumentException if the type of the constant does not
-     *         match the constant pool entry type,
-     *         as reported by {@link #getTag(int)}
-     *
-     * @see #putConstantValue(int, byte, Object)
-     * @see ConstantPoolVisitor#visitConstantValue(int, byte, Object)
-     * @see ConstantPoolVisitor#visitConstantString(int, byte, String, int)
-     */
-    public void putConstantValue(int index, Object value) {
-        if (value == null) { clear(index); return; }
-        byte tag = tagForConstant(value.getClass());
-        checkConstantTag(tag, value);
-        checkTag(index, tag);
-        patchArray[index] = value;
-    }
-
-    /** Set the entry of the constant pool indexed by index to
-     *  a new value.
-     *
-     * @param index an index to a constant pool entry matching the given tag
-     * @param tag one of the following values:
-     *        {@link ConstantPoolVisitor#CONSTANT_Integer},
-     *        {@link ConstantPoolVisitor#CONSTANT_Float},
-     *        {@link ConstantPoolVisitor#CONSTANT_Long},
-     *        {@link ConstantPoolVisitor#CONSTANT_Double},
-     *        {@link ConstantPoolVisitor#CONSTANT_String}, or
-     *        {@link ConstantPoolVisitor#CONSTANT_Class}
-     * @param value a boxed number, string, or class object
-     * @throws IllegalArgumentException if the type of the constant does not
-     *         match the constant pool entry type, or if a class name contains
-     *         '/' or ';'
-     *
-     * @see #putConstantValue(int, Object)
-     * @see ConstantPoolVisitor#visitConstantValue(int, byte, Object)
-     * @see ConstantPoolVisitor#visitConstantString(int, byte, String, int)
-     */
-    public void putConstantValue(int index, byte tag, Object value) {
-        if (value == null) { clear(index); return; }
-        checkTag(index, tag);
-        if (tag == CONSTANT_Class && value instanceof String) {
-            checkClassName((String) value);
-        } else if (tag == CONSTANT_String) {
-            // the JVM accepts any object as a patch for a string
-        } else {
-            // make sure the incoming value is the right type
-            checkConstantTag(tag, value);
-        }
-        checkTag(index, tag);
-        patchArray[index] = value;
-    }
-
-    /** Set the entry of the constant pool indexed by index to
-     *  a new {@link ConstantPoolVisitor#CONSTANT_NameAndType} value.
-     *
-     * @param index an index to a constant pool entry containing a
-     *        {@link ConstantPoolVisitor#CONSTANT_NameAndType} value.
-     * @param memberName a memberName
-     * @param signature a signature
-     * @throws IllegalArgumentException if memberName contains the character ';'
-     *
-     * @see ConstantPoolVisitor#visitDescriptor(int, byte, String, String, int, int)
-     */
-    public void putDescriptor(int index, String memberName, String signature) {
-        checkTag(index, CONSTANT_NameAndType);
-        checkMemberName(memberName);
-        patchArray[index] = addSemis(memberName, signature);
-    }
-
-    /** Set the entry of the constant pool indexed by index to
-     *  a new {@link ConstantPoolVisitor#CONSTANT_Fieldref},
-     *  {@link ConstantPoolVisitor#CONSTANT_Methodref}, or
-     *  {@link ConstantPoolVisitor#CONSTANT_InterfaceMethodref} value.
-     *
-     * @param index an index to a constant pool entry containing a member reference
-     * @param className a class name
-     * @param memberName a field or method name
-     * @param signature a field or method signature
-     * @throws IllegalArgumentException if memberName contains the character ';'
-     *             or signature is not a correct signature
-     *
-     * @see ConstantPoolVisitor#visitMemberRef(int, byte, String, String, String, int, int)
-     */
-    public void putMemberRef(int index, byte tag,
-                    String className, String memberName, String signature) {
-        checkTagMask(tag, CONSTANT_MemberRef_MASK);
-        checkTag(index, tag);
-        checkClassName(className);
-        checkMemberName(memberName);
-        if (signature.startsWith("(") == (tag == CONSTANT_Fieldref))
-            throw new IllegalArgumentException("bad signature: "+signature);
-        patchArray[index] = addSemis(className, memberName, signature);
-    }
-
-    private static final int CONSTANT_MemberRef_MASK =
-              CONSTANT_Fieldref
-            | CONSTANT_Methodref
-            | CONSTANT_InterfaceMethodref;
-
-    private static final Map<Class<?>, Byte> CONSTANT_VALUE_CLASS_TAG
-        = new IdentityHashMap<Class<?>, Byte>(6);
-    private static final Class<?>[] CONSTANT_VALUE_CLASS = new Class<?>[16];
-    static {
-        Object[][] values = {
-            {Integer.class, CONSTANT_Integer},
-            {Long.class, CONSTANT_Long},
-            {Float.class, CONSTANT_Float},
-            {Double.class, CONSTANT_Double},
-            {String.class, CONSTANT_String},
-            {Class.class, CONSTANT_Class}
-        };
-        for (Object[] value : values) {
-            Class<?> cls = (Class<?>)value[0];
-            Byte     tag = (Byte) value[1];
-            CONSTANT_VALUE_CLASS_TAG.put(cls, tag);
-            CONSTANT_VALUE_CLASS[(byte)tag] = cls;
-        }
-    }
-
-    static Class<?> classForTag(byte tag) {
-        if ((tag & 0xFF) >= CONSTANT_VALUE_CLASS.length)
-            return null;
-        return CONSTANT_VALUE_CLASS[tag];
-    }
-
-    static byte tagForConstant(Class<?> cls) {
-        Byte tag = CONSTANT_VALUE_CLASS_TAG.get(cls);
-        return (tag == null) ? CONSTANT_None : (byte)tag;
-    }
-
-    private static void checkClassName(String className) {
-        if (className.indexOf('/') >= 0 || className.indexOf(';') >= 0)
-            throw new IllegalArgumentException("invalid class name " + className);
-    }
-
-    static String addSemis(String name, String... names) {
-        StringBuilder buf = new StringBuilder(name.length() * 5);
-        buf.append(name);
-        for (String name2 : names) {
-            buf.append(';').append(name2);
-        }
-        String res = buf.toString();
-        assert(stripSemis(names.length, res)[0].equals(name));
-        assert(stripSemis(names.length, res)[1].equals(names[0]));
-        assert(names.length == 1 ||
-               stripSemis(names.length, res)[2].equals(names[1]));
-        return res;
-    }
-
-    static String[] stripSemis(int count, String string) {
-        String[] res = new String[count+1];
-        int pos = 0;
-        for (int i = 0; i < count; i++) {
-            int pos2 = string.indexOf(';', pos);
-            if (pos2 < 0)  pos2 = string.length();  // yuck
-            res[i] = string.substring(pos, pos2);
-            pos = pos2;
-        }
-        res[count] = string.substring(pos);
-        return res;
-    }
-
-    public String toString() {
-        StringBuilder buf = new StringBuilder(this.getClass().getName());
-        buf.append("{");
-        Object[] origCP = null;
-        for (int i = 0; i < patchArray.length; i++) {
-            if (patchArray[i] == null)  continue;
-            if (origCP != null) {
-                buf.append(", ");
-            } else {
-                try {
-                    origCP = getOriginalCP();
-                } catch (InvalidConstantPoolFormatException ee) {
-                    origCP = new Object[0];
-                }
-            }
-            Object orig = (i < origCP.length) ? origCP[i] : "?";
-            buf.append(orig).append("=").append(patchArray[i]);
-        }
-        buf.append("}");
-        return buf.toString();
-    }
-}
--- a/src/java.base/share/classes/sun/invoke/anon/ConstantPoolVisitor.java	Thu Jan 21 09:46:03 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 2008, 2011, 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.
- */
-
-package sun.invoke.anon;
-
-/**
- * A visitor called by {@link ConstantPoolParser#parse(ConstantPoolVisitor)}
- * when a constant pool entry is parsed.
- * <p>
- * A visit* method is called when a constant pool entry is parsed.
- * The first argument is always the constant pool index.
- * The second argument is always the constant pool tag,
- * even for methods like {@link #visitUTF8(int, byte, String)} which only apply to one tag.
- * String arguments refer to Utf8 or NameAndType entries declared elsewhere,
- * and are always accompanied by the indexes of those entries.
- * <p>
- * The order of the calls to the visit* methods is not necessarily related
- * to the order of the entries in the constant pool.
- * If one entry has a reference to another entry, the latter (lower-level)
- * entry will be visited first.
- * <p>
- * The following table shows the relation between constant pool entry
- * types and the corresponding visit* methods:
- *
- * <table border=1 cellpadding=5 summary="constant pool visitor methods">
- * <tr><th>Tag(s)</th><th>Method</th></tr>
- * <tr>
- *   <td>{@link #CONSTANT_Utf8}</td>
- *   <td>{@link #visitUTF8(int, byte, String)}</td>
- * </tr><tr>
- *   <td>{@link #CONSTANT_Integer}, {@link #CONSTANT_Float},
- *       {@link #CONSTANT_Long}, {@link #CONSTANT_Double}</td>
- *   <td>{@link #visitConstantValue(int, byte, Object)}</td>
- * </tr><tr>
- *   <td>{@link #CONSTANT_String}, {@link #CONSTANT_Class}</td>
- *   <td>{@link #visitConstantString(int, byte, String, int)}</td>
- * </tr><tr>
- *   <td>{@link #CONSTANT_NameAndType}</td>
- *   <td>{@link #visitDescriptor(int, byte, String, String, int, int)}</td>
- * </tr><tr>
- *   <td>{@link #CONSTANT_Fieldref},
- *       {@link #CONSTANT_Methodref},
- *       {@link #CONSTANT_InterfaceMethodref}</td>
- *   <td>{@link #visitMemberRef(int, byte, String, String, String, int, int)}</td>
- * </tr>
- * </table>
- *
- * @see ConstantPoolPatch
- * @author Remi Forax
- * @author jrose
- */
-public class ConstantPoolVisitor {
-  /** Called each time an UTF8 constant pool entry is found.
-   * @param index the constant pool index
-   * @param tag always {@link #CONSTANT_Utf8}
-   * @param utf8 string encoded in modified UTF-8 format passed as a {@code String}
-   *
-   * @see ConstantPoolPatch#putUTF8(int, String)
-   */
-  public void visitUTF8(int index, byte tag, String utf8) {
-    // do nothing
-  }
-
-  /** Called for each constant pool entry that encodes an integer,
-   *  a float, a long, or a double.
-   *  Constant strings and classes are not managed by this method but
-   *  by {@link #visitConstantString(int, byte, String, int)}.
-   *
-   * @param index the constant pool index
-   * @param tag one of {@link #CONSTANT_Integer},
-   *            {@link #CONSTANT_Float},
-   *            {@link #CONSTANT_Long},
-   *            or {@link #CONSTANT_Double}
-   * @param value encoded value
-   *
-   * @see ConstantPoolPatch#putConstantValue(int, Object)
-   */
-  public void visitConstantValue(int index, byte tag, Object value) {
-    // do nothing
-  }
-
-  /** Called for each constant pool entry that encodes a string or a class.
-   * @param index the constant pool index
-   * @param tag one of {@link #CONSTANT_String},
-   *            {@link #CONSTANT_Class},
-   * @param name string body or class name (using dot separator)
-   * @param nameIndex the index of the Utf8 string for the name
-   *
-   * @see ConstantPoolPatch#putConstantValue(int, byte, Object)
-   */
-  public void visitConstantString(int index, byte tag,
-                                  String name, int nameIndex) {
-    // do nothing
-  }
-
-  /** Called for each constant pool entry that encodes a name and type.
-   * @param index the constant pool index
-   * @param tag always {@link #CONSTANT_NameAndType}
-   * @param memberName a field or method name
-   * @param signature the member signature
-   * @param memberNameIndex index of the Utf8 string for the member name
-   * @param signatureIndex index of the Utf8 string for the signature
-   *
-   * @see ConstantPoolPatch#putDescriptor(int, String, String)
-   */
-  public void visitDescriptor(int index, byte tag,
-                              String memberName, String signature,
-                              int memberNameIndex, int signatureIndex) {
-    // do nothing
-  }
-
-  /** Called for each constant pool entry that encodes a field or method.
-   * @param index the constant pool index
-   * @param tag one of {@link #CONSTANT_Fieldref},
-   *            or {@link #CONSTANT_Methodref},
-   *            or {@link #CONSTANT_InterfaceMethodref}
-   * @param className the class name (using dot separator)
-   * @param memberName name of the field or method
-   * @param signature the field or method signature
-   * @param classNameIndex index of the Utf8 string for the class name
-   * @param descriptorIndex index of the NameAndType descriptor constant
-   *
-   * @see ConstantPoolPatch#putMemberRef(int, byte, String, String, String)
-   */
-  public void visitMemberRef(int index, byte tag,
-                             String className, String memberName, String signature,
-                             int classNameIndex, int descriptorIndex) {
-    // do nothing
-  }
-
-    public static final byte
-      CONSTANT_None = 0,
-      CONSTANT_Utf8 = 1,
-      //CONSTANT_Unicode = 2,               /* unused */
-      CONSTANT_Integer = 3,
-      CONSTANT_Float = 4,
-      CONSTANT_Long = 5,
-      CONSTANT_Double = 6,
-      CONSTANT_Class = 7,
-      CONSTANT_String = 8,
-      CONSTANT_Fieldref = 9,
-      CONSTANT_Methodref = 10,
-      CONSTANT_InterfaceMethodref = 11,
-      CONSTANT_NameAndType = 12;
-
-    private static String[] TAG_NAMES = {
-        "Empty",
-        "Utf8",
-        null, //"Unicode",
-        "Integer",
-        "Float",
-        "Long",
-        "Double",
-        "Class",
-        "String",
-        "Fieldref",
-        "Methodref",
-        "InterfaceMethodref",
-        "NameAndType"
-    };
-
-    public static String tagName(byte tag) {
-        String name = null;
-        if ((tag & 0xFF) < TAG_NAMES.length)
-            name = TAG_NAMES[tag];
-        if (name == null)
-            name = "Unknown#"+(tag&0xFF);
-        return name;
-    }
-}
--- a/src/java.base/share/classes/sun/invoke/anon/InvalidConstantPoolFormatException.java	Thu Jan 21 09:46:03 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2008, 2011, 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.
- */
-
-package sun.invoke.anon;
-
-/** Exception used when there is an error in the constant pool
- *  format.
- */
-public class InvalidConstantPoolFormatException extends Exception {
-    private static final long serialVersionUID=-6103888330523770949L;
-
-    public InvalidConstantPoolFormatException(String message,Throwable cause) {
-        super(message,cause);
-    }
-
-    public InvalidConstantPoolFormatException(String message) {
-        super(message);
-    }
-
-    public InvalidConstantPoolFormatException(Throwable cause) {
-        super(cause);
-    }
-}
--- a/src/java.base/share/classes/sun/misc/ClassFileTransformer.java	Thu Jan 21 09:46:03 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  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.
- */
-package sun.misc;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This is an abstract base class originally intended to be called by
- * {@code java.lang.ClassLoader} when {@code ClassFormatError} is
- * thrown inside {@code defineClass()}. It is no longer hooked into
- * {@code ClassLoader} and will be removed in a future release.
- *
- * @author      Stanley Man-Kit Ho
- */
-
-@Deprecated
-public abstract class ClassFileTransformer {
-
-    private static final List<ClassFileTransformer> transformers
-        = new ArrayList<ClassFileTransformer>();
-
-    /**
-     * Add the class file transformer object.
-     *
-     * @param t Class file transformer instance
-     */
-    public static void add(ClassFileTransformer t) {
-        synchronized (transformers) {
-            transformers.add(t);
-        }
-    }
-
-    /**
-     * Get the array of ClassFileTransformer object.
-     *
-     * @return ClassFileTransformer object array
-     */
-    public static ClassFileTransformer[] getTransformers() {
-        synchronized (transformers) {
-            ClassFileTransformer[] result = new ClassFileTransformer[transformers.size()];
-            return transformers.toArray(result);
-        }
-    }
-
-
-    /**
-     * Transform a byte array from one to the other.
-     *
-     * @param b Byte array
-     * @param off Offset
-     * @param len Length of byte array
-     * @return Transformed byte array
-     */
-    public abstract byte[] transform(byte[] b, int off, int len)
-        throws ClassFormatError;
-}
--- a/src/java.base/share/classes/sun/misc/Unsafe.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/misc/Unsafe.java	Thu Jan 21 10:17:21 2016 -0800
@@ -25,14 +25,13 @@
 
 package sun.misc;
 
-import java.lang.reflect.Field;
-import java.security.ProtectionDomain;
-
+import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.misc.VM;
 import sun.reflect.CallerSensitive;
 import sun.reflect.Reflection;
 
-import jdk.internal.HotSpotIntrinsicCandidate;
-import jdk.internal.misc.VM;
+import java.lang.reflect.Field;
+import java.security.ProtectionDomain;
 
 
 /**
@@ -1036,9 +1035,4 @@
     private static void throwIllegalAccessError() {
         throw new IllegalAccessError();
     }
-
-    // JVM interface methods
-    private native boolean unalignedAccess0();
-    private native boolean isBigEndian0();
-
 }
--- a/src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/net/www/protocol/http/DigestAuthentication.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -30,7 +30,6 @@
 import java.net.ProtocolException;
 import java.net.PasswordAuthentication;
 import java.util.Arrays;
-import java.util.StringTokenizer;
 import java.util.Random;
 
 import sun.net.www.HeaderParser;
@@ -146,9 +145,9 @@
 
         synchronized void setQop (String qop) {
             if (qop != null) {
-                StringTokenizer st = new StringTokenizer (qop, " ");
-                while (st.hasMoreTokens()) {
-                    if (st.nextToken().equalsIgnoreCase ("auth")) {
+                String items[] = qop.split(",");
+                for (String item : items) {
+                    if ("auth".equalsIgnoreCase(item.trim())) {
                         serverQop = true;
                         return;
                     }
@@ -163,7 +162,7 @@
         synchronized String getNonce () { return nonce;}
 
         synchronized void setNonce (String s) {
-            if (!s.equals(nonce)) {
+            if (nonce == null || !s.equals(nonce)) {
                 nonce=s;
                 NCcount = 0;
                 redoCachedHA1 = true;
--- a/src/java.base/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java	Thu Jan 21 10:17:21 2016 -0800
@@ -25,6 +25,7 @@
 
 package sun.reflect.annotation;
 
+import java.io.ObjectInputStream;
 import java.lang.annotation.*;
 import java.lang.reflect.*;
 import java.io.Serializable;
@@ -431,35 +432,72 @@
 
     private void readObject(java.io.ObjectInputStream s)
         throws java.io.IOException, ClassNotFoundException {
-        s.defaultReadObject();
+        ObjectInputStream.GetField fields = s.readFields();
+
+        @SuppressWarnings("unchecked")
+        Class<? extends Annotation> t = (Class<? extends Annotation>)fields.get("type", null);
+        @SuppressWarnings("unchecked")
+        Map<String, Object> streamVals = (Map<String, Object>)fields.get("memberValues", null);
 
         // Check to make sure that types have not evolved incompatibly
 
         AnnotationType annotationType = null;
         try {
-            annotationType = AnnotationType.getInstance(type);
+            annotationType = AnnotationType.getInstance(t);
         } catch(IllegalArgumentException e) {
             // Class is no longer an annotation type; time to punch out
             throw new java.io.InvalidObjectException("Non-annotation type in annotation serial stream");
         }
 
         Map<String, Class<?>> memberTypes = annotationType.memberTypes();
+        // consistent with runtime Map type
+        Map<String, Object> mv = new LinkedHashMap<>();
 
         // If there are annotation members without values, that
         // situation is handled by the invoke method.
-        for (Map.Entry<String, Object> memberValue : memberValues.entrySet()) {
+        for (Map.Entry<String, Object> memberValue : streamVals.entrySet()) {
             String name = memberValue.getKey();
+            Object value = null;
             Class<?> memberType = memberTypes.get(name);
             if (memberType != null) {  // i.e. member still exists
-                Object value = memberValue.getValue();
+                value = memberValue.getValue();
                 if (!(memberType.isInstance(value) ||
                       value instanceof ExceptionProxy)) {
-                    memberValue.setValue(
-                        new AnnotationTypeMismatchExceptionProxy(
+                    value = new AnnotationTypeMismatchExceptionProxy(
                             value.getClass() + "[" + value + "]").setMember(
-                                annotationType.members().get(name)));
+                                annotationType.members().get(name));
                 }
             }
+            mv.put(name, value);
+        }
+
+        UnsafeAccessor.setType(this, t);
+        UnsafeAccessor.setMemberValues(this, mv);
+    }
+
+    private static class UnsafeAccessor {
+        private static final jdk.internal.misc.Unsafe unsafe;
+        private static final long typeOffset;
+        private static final long memberValuesOffset;
+        static {
+            try {
+                unsafe = jdk.internal.misc.Unsafe.getUnsafe();
+                typeOffset = unsafe.objectFieldOffset
+                        (AnnotationInvocationHandler.class.getDeclaredField("type"));
+                memberValuesOffset = unsafe.objectFieldOffset
+                        (AnnotationInvocationHandler.class.getDeclaredField("memberValues"));
+            } catch (Exception ex) {
+                throw new ExceptionInInitializerError(ex);
+            }
+        }
+        static void setType(AnnotationInvocationHandler o,
+                            Class<? extends Annotation> type) {
+            unsafe.putObject(o, typeOffset, type);
+        }
+
+        static void setMemberValues(AnnotationInvocationHandler o,
+                                    Map<String, Object> memberValues) {
+            unsafe.putObject(o, memberValuesOffset, memberValues);
         }
     }
 }
--- a/src/java.base/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java	Thu Jan 21 10:17:21 2016 -0800
@@ -43,6 +43,8 @@
 public class TlsRsaPremasterSecretParameterSpec
         implements AlgorithmParameterSpec {
 
+    private final byte[] encodedSecret;
+
     /*
      * The TLS spec says that the version in the RSA premaster secret must
      * be the maximum version supported by the client (i.e. the version it
@@ -89,6 +91,33 @@
 
         this.clientVersion = checkVersion(clientVersion);
         this.serverVersion = checkVersion(serverVersion);
+        this.encodedSecret = null;
+    }
+
+    /**
+     * Constructs a new TlsRsaPremasterSecretParameterSpec.
+     *
+     * @param clientVersion the version of the TLS protocol by which the
+     *        client wishes to communicate during this session
+     * @param serverVersion the negotiated version of the TLS protocol which
+     *        contains the lower of that suggested by the client in the client
+     *        hello and the highest supported by the server.
+     * @param encodedSecret the encoded secret key
+     *
+     * @throws IllegalArgumentException if clientVersion or serverVersion are
+     *   negative or larger than (2^16 - 1) or if encodedSecret is not
+     *   exactly 48 bytes
+     */
+    public TlsRsaPremasterSecretParameterSpec(
+            int clientVersion, int serverVersion, byte[] encodedSecret) {
+
+        this.clientVersion = checkVersion(clientVersion);
+        this.serverVersion = checkVersion(serverVersion);
+        if (encodedSecret == null || encodedSecret.length != 48) {
+            throw new IllegalArgumentException(
+                        "Encoded secret is not exactly 48 bytes");
+        }
+        this.encodedSecret = encodedSecret.clone();
     }
 
     /**
@@ -147,4 +176,13 @@
         }
         return version;
     }
+
+    /**
+     * Returns the encoded secret.
+     *
+     * @return the encoded secret, may be null if no encoded secret.
+     */
+    public byte[] getEncodedSecret() {
+        return encodedSecret == null ? null : encodedSecret.clone();
+    }
 }
--- a/src/java.base/share/classes/sun/security/jca/JCAUtil.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/jca/JCAUtil.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -41,12 +41,6 @@
         // no instantiation
     }
 
-    // lock to use for synchronization
-    private static final Object LOCK = JCAUtil.class;
-
-    // cached SecureRandom instance
-    private static volatile SecureRandom secureRandom;
-
     // size of the temporary arrays we use. Should fit into the CPU's 1st
     // level cache and could be adjusted based on the platform
     private static final int ARRAY_SIZE = 4096;
@@ -60,26 +54,19 @@
         return Math.min(ARRAY_SIZE, totalSize);
     }
 
+    // cached SecureRandom instance
+    private static class CachedSecureRandomHolder {
+        public static SecureRandom instance = new SecureRandom();
+    }
+
     /**
-     * Get a SecureRandom instance. This method should me used by JDK
+     * Get a SecureRandom instance. This method should be used by JDK
      * internal code in favor of calling "new SecureRandom()". That needs to
      * iterate through the provider table to find the default SecureRandom
      * implementation, which is fairly inefficient.
      */
     public static SecureRandom getSecureRandom() {
-        // we use double checked locking to minimize synchronization
-        // works because we use a volatile reference
-        SecureRandom r = secureRandom;
-        if (r == null) {
-            synchronized (LOCK) {
-                r = secureRandom;
-                if (r == null) {
-                    r = new SecureRandom();
-                    secureRandom = r;
-                }
-            }
-        }
-        return r;
+        return CachedSecureRandomHolder.instance;
     }
 
 }
--- a/src/java.base/share/classes/sun/security/provider/certpath/ResponderId.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/provider/certpath/ResponderId.java	Thu Jan 21 10:17:21 2016 -0800
@@ -49,7 +49,7 @@
  * </pre>
  *
  * @see ResponderId.Type
- * @since 1.9
+ * @since 9
  */
 public final class ResponderId {
 
@@ -58,7 +58,7 @@
      * {@code ResponderId}.
      *
      * @see ResponderId
-     * @since 1.9
+     * @since 9
      */
     public static enum Type {
         /**
--- a/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java	Thu Jan 21 10:17:21 2016 -0800
@@ -333,7 +333,7 @@
                             input, serverKey,
                             clnt_random.random_bytes, svr_random.random_bytes,
                             messageLen,
-                            localSupportedSignAlgs, protocolVersion);
+                            getLocalSupportedSignAlgs(), protocolVersion);
                     handshakeState.update(dhSrvKeyExchange, resumingSession);
                     this.serverKeyExchange(dhSrvKeyExchange);
                 } catch (GeneralSecurityException e) {
@@ -348,7 +348,7 @@
                         new ECDH_ServerKeyExchange
                             (input, serverKey, clnt_random.random_bytes,
                             svr_random.random_bytes,
-                            localSupportedSignAlgs, protocolVersion);
+                            getLocalSupportedSignAlgs(), protocolVersion);
                     handshakeState.update(ecdhSrvKeyExchange, resumingSession);
                     this.serverKeyExchange(ecdhSrvKeyExchange);
                 } catch (GeneralSecurityException e) {
@@ -398,7 +398,7 @@
 
                 Collection<SignatureAndHashAlgorithm> supportedPeerSignAlgs =
                     SignatureAndHashAlgorithm.getSupportedAlgorithms(
-                                                            peerSignAlgs);
+                            algorithmConstraints, peerSignAlgs);
                 if (supportedPeerSignAlgs.isEmpty()) {
                     throw new SSLHandshakeException(
                         "No supported signature and hash algorithm in common");
@@ -1211,8 +1211,8 @@
                 if (protocolVersion.useTLS12PlusSpec()) {
                     preferableSignatureAlgorithm =
                         SignatureAndHashAlgorithm.getPreferableAlgorithm(
-                            peerSupportedSignAlgs, signingKey.getAlgorithm(),
-                            signingKey);
+                            getPeerSupportedSignAlgs(),
+                            signingKey.getAlgorithm(), signingKey);
 
                     if (preferableSignatureAlgorithm == null) {
                         throw new SSLHandshakeException(
--- a/src/java.base/share/classes/sun/security/ssl/ClientKeyExchangeService.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ClientKeyExchangeService.java	Thu Jan 21 10:17:21 2016 -0800
@@ -41,7 +41,7 @@
  * Models a service that provides support for a particular client key exchange
  * mode. Currently used to implement Kerberos-related cipher suites.
  *
- * @since 1.9
+ * @since 9
  */
 public interface ClientKeyExchangeService {
 
--- a/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1943,7 +1943,7 @@
     // the signature bytes
     private byte[] signature;
 
-    // protocol version being established using this ServerKeyExchange message
+    // protocol version being established using this CertificateVerify message
     ProtocolVersion protocolVersion;
 
     // the preferable signature algorithm used by this CertificateVerify message
@@ -1996,7 +1996,7 @@
                     preferableSignatureAlgorithm)) {
                 throw new SSLHandshakeException(
                         "Unsupported SignatureAndHashAlgorithm in " +
-                        "ServerKeyExchange message");
+                        "CertificateVerify message");
             }
         }
 
--- a/src/java.base/share/classes/sun/security/ssl/Handshaker.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/Handshaker.java	Thu Jan 21 10:17:21 2016 -0800
@@ -90,7 +90,7 @@
     AlgorithmConstraints        algorithmConstraints = null;
 
     // Local supported signature and algorithms
-    Collection<SignatureAndHashAlgorithm> localSupportedSignAlgs;
+    private Collection<SignatureAndHashAlgorithm> localSupportedSignAlgs;
 
     // Peer supported signature and algorithms
     Collection<SignatureAndHashAlgorithm> peerSupportedSignAlgs;
--- a/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -113,14 +113,34 @@
             }
         }
 
+        byte[] encoded = null;
         try {
             Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1);
-            cipher.init(Cipher.UNWRAP_MODE, privateKey,
-                    new TlsRsaPremasterSecretParameterSpec(
-                            maxVersion.v, currentVersion.v),
-                    generator);
-            preMaster = (SecretKey)cipher.unwrap(encrypted,
-                                "TlsRsaPremasterSecret", Cipher.SECRET_KEY);
+            boolean needFailover = !KeyUtil.isOracleJCEProvider(
+                    cipher.getProvider().getName());
+            if (needFailover) {
+                cipher.init(Cipher.DECRYPT_MODE, privateKey);
+                boolean failed = false;
+                try {
+                    encoded = cipher.doFinal(encrypted);
+                } catch (BadPaddingException bpe) {
+                    // Note: encoded == null
+                    failed = true;
+                }
+                encoded = KeyUtil.checkTlsPreMasterSecretKey(
+                                maxVersion.v, currentVersion.v,
+                                generator, encoded, failed);
+                preMaster = generatePreMasterSecret(
+                                maxVersion.v, currentVersion.v,
+                                encoded, generator);
+            } else {
+                cipher.init(Cipher.UNWRAP_MODE, privateKey,
+                        new TlsRsaPremasterSecretParameterSpec(
+                                maxVersion.v, currentVersion.v),
+                        generator);
+                preMaster = (SecretKey)cipher.unwrap(encrypted,
+                        "TlsRsaPremasterSecret", Cipher.SECRET_KEY);
+            }
         } catch (InvalidKeyException ibk) {
             // the message is too big to process with RSA
             throw new SSLProtocolException(
@@ -135,6 +155,35 @@
         }
     }
 
+    // generate a premaster secret with the specified version number
+    @SuppressWarnings("deprecation")
+    private static SecretKey generatePreMasterSecret(
+            int clientVersion, int serverVersion,
+            byte[] encodedSecret, SecureRandom generator) {
+
+        if (debug != null && Debug.isOn("handshake")) {
+            System.out.println("Generating a premaster secret");
+        }
+
+        try {
+            String s = ((clientVersion >= ProtocolVersion.TLS12.v) ?
+                "SunTls12RsaPremasterSecret" : "SunTlsRsaPremasterSecret");
+            KeyGenerator kg = JsseJce.getKeyGenerator(s);
+            kg.init(new TlsRsaPremasterSecretParameterSpec(
+                    clientVersion, serverVersion, encodedSecret),
+                    generator);
+            return kg.generateKey();
+        } catch (InvalidAlgorithmParameterException |
+                NoSuchAlgorithmException iae) {
+            // unlikely to happen, otherwise, must be a provider exception
+            if (debug != null && Debug.isOn("handshake")) {
+                System.out.println("RSA premaster secret generation error:");
+                iae.printStackTrace(System.out);
+            }
+            throw new RuntimeException("Could not generate premaster secret", iae);
+        }
+    }
+
     @Override
     int messageType() {
         return ht_client_key_exchange;
--- a/src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java	Thu Jan 21 10:17:21 2016 -0800
@@ -320,7 +320,7 @@
             case HandshakeMessage.ht_certificate_verify:
                 CertificateVerify cvm =
                         new CertificateVerify(input,
-                            localSupportedSignAlgs, protocolVersion);
+                            getLocalSupportedSignAlgs(), protocolVersion);
                 handshakeState.update(cvm, resumingSession);
                 this.clientCertificateVerify(cvm);
 
@@ -772,11 +772,10 @@
                     Collection<SignatureAndHashAlgorithm>
                         supportedPeerSignAlgs =
                             SignatureAndHashAlgorithm.getSupportedAlgorithms(
-                                                            peerSignAlgs);
+                                algorithmConstraints, peerSignAlgs);
                     if (supportedPeerSignAlgs.isEmpty()) {
                         throw new SSLHandshakeException(
-                            "No supported signature and hash algorithm " +
-                            "in common");
+                            "No signature and hash algorithm in common");
                     }
 
                     setPeerSupportedSignAlgs(supportedPeerSignAlgs);
@@ -1351,6 +1350,13 @@
                     supportedSignAlgs =
                         new ArrayList<SignatureAndHashAlgorithm>(1);
                     supportedSignAlgs.add(algorithm);
+
+                    supportedSignAlgs =
+                            SignatureAndHashAlgorithm.getSupportedAlgorithms(
+                                algorithmConstraints, supportedSignAlgs);
+
+                    // May be no default activated signature algorithm, but
+                    // let the following process make the final decision.
                 }
 
                 // Sets the peer supported signature algorithm to use in KM
@@ -1395,6 +1401,11 @@
                     SignatureAndHashAlgorithm.getPreferableAlgorithm(
                                         supportedSignAlgs, "RSA", privateKey);
                 if (preferableSignatureAlgorithm == null) {
+                    if ((debug != null) && Debug.isOn("handshake")) {
+                        System.out.println(
+                                "No signature and hash algorithm for cipher " +
+                                suite);
+                    }
                     return false;
                 }
             }
@@ -1413,6 +1424,11 @@
                     SignatureAndHashAlgorithm.getPreferableAlgorithm(
                                         supportedSignAlgs, "RSA", privateKey);
                 if (preferableSignatureAlgorithm == null) {
+                    if ((debug != null) && Debug.isOn("handshake")) {
+                        System.out.println(
+                                "No signature and hash algorithm for cipher " +
+                                suite);
+                    }
                     return false;
                 }
             }
@@ -1428,6 +1444,11 @@
                     SignatureAndHashAlgorithm.getPreferableAlgorithm(
                                                 supportedSignAlgs, "DSA");
                 if (preferableSignatureAlgorithm == null) {
+                    if ((debug != null) && Debug.isOn("handshake")) {
+                        System.out.println(
+                                "No signature and hash algorithm for cipher " +
+                                suite);
+                    }
                     return false;
                 }
             }
@@ -1446,6 +1467,11 @@
                     SignatureAndHashAlgorithm.getPreferableAlgorithm(
                                             supportedSignAlgs, "ECDSA");
                 if (preferableSignatureAlgorithm == null) {
+                    if ((debug != null) && Debug.isOn("handshake")) {
+                        System.out.println(
+                                "No signature and hash algorithm for cipher " +
+                                suite);
+                    }
                     return false;
                 }
             }
@@ -1487,7 +1513,8 @@
                     ClientKeyExchangeService.find(keyExchange.name);
             if (p == null) {
                 // internal error, unknown key exchange
-                throw new RuntimeException("Unrecognized cipherSuite: " + suite);
+                throw new RuntimeException(
+                        "Unrecognized cipherSuite: " + suite);
             }
             // need service creds
             if (serviceCreds == null) {
--- a/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java	Thu Jan 21 10:17:21 2016 -0800
@@ -166,10 +166,13 @@
 
     // Get supported algorithm collection from an untrusted collection
     static Collection<SignatureAndHashAlgorithm> getSupportedAlgorithms(
+            AlgorithmConstraints constraints,
             Collection<SignatureAndHashAlgorithm> algorithms ) {
         Collection<SignatureAndHashAlgorithm> supported = new ArrayList<>();
         for (SignatureAndHashAlgorithm sigAlg : algorithms) {
-            if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM) {
+            if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM &&
+                    constraints.permits(SIGNATURE_PRIMITIVE_SET,
+                                sigAlg.algorithm, null)) {
                 supported.add(sigAlg);
             }
         }
@@ -233,30 +236,42 @@
     }
 
     static SignatureAndHashAlgorithm getPreferableAlgorithm(
-        Collection<SignatureAndHashAlgorithm> algorithms,
-        String expected, PrivateKey signingKey) {
+            Collection<SignatureAndHashAlgorithm> algorithms,
+            String expected, PrivateKey signingKey) {
 
-        if (expected == null && !algorithms.isEmpty()) {
-            for (SignatureAndHashAlgorithm sigAlg : algorithms) {
-                if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM) {
-                    return sigAlg;
+        int maxDigestLength = getMaxDigestLength(signingKey);
+        for (SignatureAndHashAlgorithm algorithm : algorithms) {
+            int signValue = algorithm.id & 0xFF;
+            if ((expected == null) ||
+                    (expected.equalsIgnoreCase("rsa") &&
+                            signValue == SignatureAlgorithm.RSA.value) ||
+                    (expected.equalsIgnoreCase("dsa") &&
+                            signValue == SignatureAlgorithm.DSA.value) ||
+                    (expected.equalsIgnoreCase("ecdsa") &&
+                            signValue == SignatureAlgorithm.ECDSA.value) ||
+                    (expected.equalsIgnoreCase("ec") &&
+                            signValue == SignatureAlgorithm.ECDSA.value)) {
+
+                if (algorithm.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM &&
+                        algorithm.hash.length <= maxDigestLength) {
+
+                    return algorithm;
                 }
             }
-
-            return null;  // no supported algorithm
         }
 
-        if (expected == null ) {
-            return null;  // no expected algorithm, no supported algorithm
-        }
+        return null;
+    }
 
-        /*
-         * Need to check RSA key length to match the length of hash value
-         */
+    /*
+     * Need to check key length to match the length of hash value
+     */
+    private static int getMaxDigestLength(PrivateKey signingKey) {
         int maxDigestLength = Integer.MAX_VALUE;
+
+        // only need to check RSA algorithm at present.
         if (signingKey != null &&
-                "rsa".equalsIgnoreCase(signingKey.getAlgorithm()) &&
-                expected.equalsIgnoreCase("rsa")) {
+                "rsa".equalsIgnoreCase(signingKey.getAlgorithm())) {
             /*
              * RSA keys of 512 bits have been shown to be practically
              * breakable, it does not make much sense to use the strong
@@ -284,25 +299,7 @@
                 // preferable hash algorithm.
         }
 
-        for (SignatureAndHashAlgorithm algorithm : algorithms) {
-            int signValue = algorithm.id & 0xFF;
-            if (expected.equalsIgnoreCase("rsa") &&
-                    signValue == SignatureAlgorithm.RSA.value) {
-                if (algorithm.hash.length <= maxDigestLength) {
-                    return algorithm;
-                }
-            } else if (
-                    (expected.equalsIgnoreCase("dsa") &&
-                        signValue == SignatureAlgorithm.DSA.value) ||
-                    (expected.equalsIgnoreCase("ecdsa") &&
-                        signValue == SignatureAlgorithm.ECDSA.value) ||
-                    (expected.equalsIgnoreCase("ec") &&
-                        signValue == SignatureAlgorithm.ECDSA.value)) {
-                return algorithm;
-            }
-        }
-
-        return null;
+        return maxDigestLength;
     }
 
     static enum HashAlgorithm {
@@ -415,12 +412,14 @@
             supports(HashAlgorithm.SHA1,        SignatureAlgorithm.ECDSA,
                     "SHA1withECDSA",        --p);
 
-            supports(HashAlgorithm.SHA224,      SignatureAlgorithm.DSA,
-                    "SHA224withDSA",        --p);
-            supports(HashAlgorithm.SHA224,      SignatureAlgorithm.RSA,
-                    "SHA224withRSA",        --p);
-            supports(HashAlgorithm.SHA224,      SignatureAlgorithm.ECDSA,
-                    "SHA224withECDSA",      --p);
+            if (Security.getProvider("SunMSCAPI") == null) {
+                supports(HashAlgorithm.SHA224,      SignatureAlgorithm.DSA,
+                        "SHA224withDSA",        --p);
+                supports(HashAlgorithm.SHA224,      SignatureAlgorithm.RSA,
+                        "SHA224withRSA",        --p);
+                supports(HashAlgorithm.SHA224,      SignatureAlgorithm.ECDSA,
+                        "SHA224withECDSA",      --p);
+            }
 
             supports(HashAlgorithm.SHA256,      SignatureAlgorithm.DSA,
                     "SHA256withDSA",        --p);
--- a/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/util/KeyStoreDelegator.java	Thu Jan 21 10:17:21 2016 -0800
@@ -37,7 +37,7 @@
 /**
  * This class delegates to a primary or secondary keystore implementation.
  *
- * @since 1.9
+ * @since 9
  */
 
 public class KeyStoreDelegator extends KeyStoreSpi {
--- a/src/java.base/share/classes/sun/security/util/KeyUtil.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/util/KeyUtil.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -41,6 +41,8 @@
 import javax.crypto.spec.DHPublicKeySpec;
 import java.math.BigInteger;
 
+import sun.security.jca.JCAUtil;
+
 /**
  * A utility class to get key length, valiate keys, etc.
  */
@@ -143,8 +145,6 @@
 
     /**
      * Returns whether the specified provider is Oracle provider or not.
-     * <P>
-     * Note that this method is only apply to SunJCE and SunPKCS11 at present.
      *
      * @param  providerName
      *         the provider name
@@ -152,8 +152,11 @@
      *         {@code providerName} is Oracle provider
      */
     public static final boolean isOracleJCEProvider(String providerName) {
-        return providerName != null && (providerName.equals("SunJCE") ||
-                                        providerName.startsWith("SunPKCS11"));
+        return providerName != null &&
+                (providerName.equals("SunJCE") ||
+                    providerName.equals("SunMSCAPI") ||
+                    providerName.equals("OracleUcrypto") ||
+                    providerName.startsWith("SunPKCS11"));
     }
 
     /**
@@ -200,7 +203,7 @@
             byte[] encoded, boolean isFailOver) {
 
         if (random == null) {
-            random = new SecureRandom();
+            random = JCAUtil.getSecureRandom();
         }
         byte[] replacer = new byte[48];
         random.nextBytes(replacer);
--- a/src/java.base/share/classes/sun/security/x509/AlgorithmId.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/AlgorithmId.java	Thu Jan 21 10:17:21 2016 -0800
@@ -588,7 +588,7 @@
             }
 
             if (oidTable == null) {
-                oidTable = new HashMap<>(1);
+                oidTable = Collections.<String,ObjectIdentifier>emptyMap();
             }
             initOidTable = true;
         }
--- a/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java	Thu Jan 21 10:17:21 2016 -0800
@@ -29,6 +29,7 @@
 import java.io.OutputStream;
 
 import java.util.*;
+import java.util.Collections;
 
 import sun.security.util.DerOutputStream;
 import sun.security.util.DerValue;
@@ -255,11 +256,12 @@
      */
     public void delete(String name) throws IOException {
         if (name.equalsIgnoreCase(POINTS)) {
-            distributionPoints = new ArrayList<DistributionPoint>();
+            distributionPoints =
+                    Collections.<DistributionPoint>emptyList();
         } else {
             throw new IOException("Attribute name [" + name +
-                                "] not recognized by " +
-                                "CertAttrSet:" + extensionName + ".");
+                                  "] not recognized by " +
+                                  "CertAttrSet:" + extensionName + '.');
         }
         encodeThis();
     }
--- a/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java	Thu Jan 21 10:17:21 2016 -0800
@@ -157,11 +157,10 @@
      */
     public BigInteger get(String name) throws IOException {
         if (name.equalsIgnoreCase(NUMBER)) {
-            if (crlNumber == null) return null;
-            else return crlNumber;
+            return crlNumber;
         } else {
-          throw new IOException("Attribute name not recognized by"
-                                + " CertAttrSet:" + extensionName + ".");
+            throw new IOException("Attribute name not recognized by" +
+                                  " CertAttrSet:" + extensionName + '.');
         }
     }
 
--- a/src/java.base/share/classes/sun/security/x509/DNSName.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/DNSName.java	Thu Jan 21 10:17:21 2016 -0800
@@ -232,15 +232,15 @@
      * @throws UnsupportedOperationException if not supported for this name type
      */
     public int subtreeDepth() throws UnsupportedOperationException {
-        String subtree=name;
-        int i=1;
+        // subtree depth is always at least 1
+        int sum = 1;
 
-        /* count dots */
-        for (; subtree.lastIndexOf('.') >= 0; i++) {
-            subtree=subtree.substring(0,subtree.lastIndexOf('.'));
+        // count dots
+        for (int i = name.indexOf('.'); i >= 0; i = name.indexOf('.', i + 1)) {
+            ++sum;
         }
 
-        return i;
+        return sum;
     }
 
 }
--- a/src/java.base/share/classes/sun/security/x509/EDIPartyName.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/EDIPartyName.java	Thu Jan 21 10:17:21 2016 -0800
@@ -197,7 +197,7 @@
      */
     public int hashCode() {
         if (myhash == -1) {
-            myhash = 37 + party.hashCode();
+            myhash = 37 + (party == null ? 1 : party.hashCode());
             if (assigner != null) {
                 myhash = 37 * myhash + assigner.hashCode();
             }
--- a/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java	Thu Jan 21 10:17:21 2016 -0800
@@ -189,7 +189,7 @@
         // the list: if any subsequent entry matches or widens entry n,
         // remove entry n. If any subsequent entries narrow entry n, remove
         // the subsequent entries.
-        for (int i = 0; i < size(); i++) {
+        for (int i = 0; i < (size() - 1); i++) {
             GeneralNameInterface current = getGeneralNameInterface(i);
             boolean remove1 = false;
 
--- a/src/java.base/share/classes/sun/security/x509/IPAddressName.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/IPAddressName.java	Thu Jan 21 10:17:21 2016 -0800
@@ -197,8 +197,10 @@
 
             // append a mask corresponding to the num of prefix bits specified
             int prefixLen = Integer.parseInt(name.substring(slashNdx+1));
-            if (prefixLen > 128)
-                throw new IOException("IPv6Address prefix is longer than 128");
+            if (prefixLen < 0 || prefixLen > 128) {
+                throw new IOException("IPv6Address prefix length (" +
+                        prefixLen + ") in out of valid range [0,128]");
+            }
 
             // create new bit array initialized to zeros
             BitArray bitArray = new BitArray(MASKSIZE * 8);
@@ -317,7 +319,8 @@
         if (!(obj instanceof IPAddressName))
             return false;
 
-        byte[] other = ((IPAddressName)obj).getBytes();
+        IPAddressName otherName = (IPAddressName)obj;
+        byte[] other = otherName.address;
 
         if (other.length != address.length)
             return false;
@@ -326,12 +329,10 @@
             // Two subnet addresses
             // Mask each and compare masked values
             int maskLen = address.length/2;
-            byte[] maskedThis = new byte[maskLen];
-            byte[] maskedOther = new byte[maskLen];
             for (int i=0; i < maskLen; i++) {
-                maskedThis[i] = (byte)(address[i] & address[i+maskLen]);
-                maskedOther[i] = (byte)(other[i] & other[i+maskLen]);
-                if (maskedThis[i] != maskedOther[i]) {
+                byte maskedThis = (byte)(address[i] & address[i+maskLen]);
+                byte maskedOther = (byte)(other[i] & other[i+maskLen]);
+                if (maskedThis != maskedOther) {
                     return false;
                 }
             }
@@ -400,7 +401,8 @@
         else if (((IPAddressName)inputName).equals(this))
             constraintType = NAME_MATCH;
         else {
-            byte[] otherAddress = ((IPAddressName)inputName).getBytes();
+            IPAddressName otherName = (IPAddressName)inputName;
+            byte[] otherAddress = otherName.address;
             if (otherAddress.length == 4 && address.length == 4)
                 // Two host addresses
                 constraintType = NAME_SAME_TYPE;
--- a/src/java.base/share/classes/sun/security/x509/IssuingDistributionPointExtension.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/IssuingDistributionPointExtension.java	Thu Jan 21 10:17:21 2016 -0800
@@ -261,6 +261,7 @@
                 throw new IOException(
                     "Attribute value should be of type ReasonFlags.");
             }
+            revocationReasons = (ReasonFlags)obj;
 
         } else if (name.equalsIgnoreCase(INDIRECT_CRL)) {
             if (!(obj instanceof Boolean)) {
@@ -290,7 +291,6 @@
             }
             hasOnlyAttributeCerts = ((Boolean)obj).booleanValue();
 
-
         } else {
             throw new IOException("Attribute name [" + name +
                 "] not recognized by " +
--- a/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/KeyIdentifier.java	Thu Jan 21 10:17:21 2016 -0800
@@ -148,7 +148,7 @@
             return true;
         if (!(other instanceof KeyIdentifier))
             return false;
-        return java.util.Arrays.equals(octetString,
-                                       ((KeyIdentifier)other).getIdentifier());
+        byte[] otherString = ((KeyIdentifier)other).octetString;
+        return java.util.Arrays.equals(octetString, otherString);
     }
 }
--- a/src/java.base/share/classes/sun/security/x509/PolicyMappingsExtension.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/PolicyMappingsExtension.java	Thu Jan 21 10:17:21 2016 -0800
@@ -102,7 +102,7 @@
     public PolicyMappingsExtension() {
         extensionId = PKIXExtensions.PolicyMappings_Id;
         critical = true;
-        maps = new ArrayList<CertificatePolicyMap>();
+        maps = Collections.<CertificatePolicyMap>emptyList();
     }
 
     /**
--- a/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java	Thu Jan 21 10:17:21 2016 -0800
@@ -33,6 +33,7 @@
 import java.security.cert.CertificateNotYetValidException;
 import java.util.Date;
 import java.util.Enumeration;
+import java.util.Objects;
 
 import sun.security.util.*;
 
@@ -217,16 +218,17 @@
      */
     public void valid(Date now)
     throws CertificateNotYetValidException, CertificateExpiredException {
+        Objects.requireNonNull(now);
         /*
          * we use the internal Dates rather than the passed in Date
          * because someone could override the Date methods after()
          * and before() to do something entirely different.
          */
-        if (notBefore.after(now)) {
+        if (notBefore != null && notBefore.after(now)) {
             throw new CertificateNotYetValidException("NotBefore: " +
                                                       notBefore.toString());
         }
-        if (notAfter.before(now)) {
+        if (notAfter != null && notAfter.before(now)) {
             throw new CertificateExpiredException("NotAfter: " +
                                                   notAfter.toString());
         }
--- a/src/java.base/share/classes/sun/security/x509/RDN.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/RDN.java	Thu Jan 21 10:17:21 2016 -0800
@@ -27,6 +27,8 @@
 
 import java.io.IOException;
 import java.io.StringReader;
+import java.util.Arrays;
+import java.util.StringJoiner;
 import java.util.*;
 
 import sun.security.util.*;
@@ -436,31 +438,19 @@
                                assertion[0].toRFC2253String(oidMap);
         }
 
-        StringBuilder relname = new StringBuilder();
-        if (!canonical) {
-            for (int i = 0; i < assertion.length; i++) {
-                if (i > 0) {
-                    relname.append('+');
-                }
-                relname.append(assertion[i].toRFC2253String(oidMap));
-            }
-        } else {
+        AVA[] toOutput = assertion;
+        if (canonical) {
             // order the string type AVA's alphabetically,
             // followed by the oid type AVA's numerically
-            List<AVA> avaList = new ArrayList<>(assertion.length);
-            for (int i = 0; i < assertion.length; i++) {
-                avaList.add(assertion[i]);
-            }
-            java.util.Collections.sort(avaList, AVAComparator.getInstance());
-
-            for (int i = 0; i < avaList.size(); i++) {
-                if (i > 0) {
-                    relname.append('+');
-                }
-                relname.append(avaList.get(i).toRFC2253CanonicalString());
-            }
+            toOutput = assertion.clone();
+            Arrays.sort(toOutput, AVAComparator.getInstance());
         }
-        return relname.toString();
+        StringJoiner sj = new StringJoiner("+");
+        for (AVA ava : toOutput) {
+            sj.add(canonical ? ava.toRFC2253CanonicalString()
+                             : ava.toRFC2253String(oidMap));
+        }
+        return sj.toString();
     }
 
 }
--- a/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java	Thu Jan 21 10:17:21 2016 -0800
@@ -28,6 +28,7 @@
 import java.io.IOException;
 import java.io.OutputStream;
 
+import java.util.Collections;
 import java.util.*;
 
 import sun.security.util.DerOutputStream;
@@ -200,7 +201,8 @@
      */
     public void delete(String name) throws IOException {
         if (name.equalsIgnoreCase(DESCRIPTIONS)) {
-            accessDescriptions = new ArrayList<AccessDescription>();
+            accessDescriptions =
+                Collections.<AccessDescription>emptyList();
         } else {
             throw new IOException("Attribute name [" + name +
                                 "] not recognized by " +
--- a/src/java.base/share/classes/sun/security/x509/URIName.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/URIName.java	Thu Jan 21 10:17:21 2016 -0800
@@ -165,7 +165,7 @@
             String host = uri.getSchemeSpecificPart();
             try {
                 DNSName hostDNS;
-                if (host.charAt(0) == '.') {
+                if (host.startsWith(".")) {
                     hostDNS = new DNSName(host.substring(1));
                 } else {
                     hostDNS = new DNSName(host);
--- a/src/java.base/share/classes/sun/security/x509/X500Name.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/X500Name.java	Thu Jan 21 10:17:21 2016 -0800
@@ -347,6 +347,8 @@
             for (int i = 0; i < names.length; i++) {
                 list.addAll(names[i].avas());
             }
+            list = Collections.unmodifiableList(list);
+            allAvaList = list;
         }
         return list;
     }
@@ -365,9 +367,6 @@
      */
     public boolean isEmpty() {
         int n = names.length;
-        if (n == 0) {
-            return true;
-        }
         for (int i = 0; i < n; i++) {
             if (names[i].assertion.length != 0) {
                 return false;
@@ -1103,12 +1102,8 @@
      * and speed recognition of common X.500 attributes.
      */
     static ObjectIdentifier intern(ObjectIdentifier oid) {
-        ObjectIdentifier interned = internedOIDs.get(oid);
-        if (interned != null) {
-            return interned;
-        }
-        internedOIDs.put(oid, oid);
-        return oid;
+        ObjectIdentifier interned = internedOIDs.putIfAbsent(oid, oid);
+        return (interned == null) ? oid : interned;
     }
 
     private static final Map<ObjectIdentifier,ObjectIdentifier> internedOIDs
--- a/src/java.base/share/classes/sun/security/x509/X509AttributeName.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/X509AttributeName.java	Thu Jan 21 10:17:21 2016 -0800
@@ -47,7 +47,7 @@
      */
     public X509AttributeName(String name) {
         int i = name.indexOf(SEPARATOR);
-        if (i == (-1)) {
+        if (i < 0) {
             prefix = name;
         } else {
             prefix = name.substring(0, i);
--- a/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java	Thu Jan 21 10:17:21 2016 -0800
@@ -762,9 +762,7 @@
     public byte[] getTBSCertList() throws CRLException {
         if (tbsCertList == null)
             throw new CRLException("Uninitialized CRL");
-        byte[] dup = new byte[tbsCertList.length];
-        System.arraycopy(tbsCertList, 0, dup, 0, dup.length);
-        return dup;
+        return tbsCertList.clone();
     }
 
     /**
@@ -775,9 +773,7 @@
     public byte[] getSignature() {
         if (signature == null)
             return null;
-        byte[] dup = new byte[signature.length];
-        System.arraycopy(signature, 0, dup, 0, dup.length);
-        return dup;
+        return signature.clone();
     }
 
     /**
--- a/src/java.base/share/classes/sun/security/x509/X509CertImpl.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/classes/sun/security/x509/X509CertImpl.java	Thu Jan 21 10:17:21 2016 -0800
@@ -1001,9 +1001,7 @@
     public byte[] getSignature() {
         if (signature == null)
             return null;
-        byte[] dup = new byte[signature.length];
-        System.arraycopy(signature, 0, dup, 0, dup.length);
-        return dup;
+        return signature.clone();
     }
 
     /**
--- a/src/java.base/share/conf/security/java.security	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/conf/security/java.security	Thu Jan 21 10:17:21 2016 -0800
@@ -576,7 +576,7 @@
 #
 # Example:
 #   jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
-jdk.tls.disabledAlgorithms=SSLv3, RC4, DH keySize < 768
+jdk.tls.disabledAlgorithms=SSLv3, RC4, MD5withRSA, DH keySize < 768
 
 # Legacy algorithms for Secure Socket Layer/Transport Layer Security (SSL/TLS)
 # processing in JSSE implementation.
--- a/src/java.base/share/native/include/jvm.h	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/native/include/jvm.h	Thu Jan 21 10:17:21 2016 -0800
@@ -208,6 +208,9 @@
 JNIEXPORT void JNICALL
 JVM_SetMethodInfo(JNIEnv* env, jobject frame);
 
+JNIEXPORT jobjectArray JNICALL
+JVM_GetVmArguments(JNIEnv *env);
+
 /*
  * java.lang.Thread
  */
--- a/src/java.base/share/native/libjava/jni_util.c	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.base/share/native/libjava/jni_util.c	Thu Jan 21 10:17:21 2016 -0800
@@ -660,7 +660,8 @@
             */
                     if ((strcmp(encname, "8859_1") == 0) ||
                         (strcmp(encname, "ISO8859-1") == 0) ||
-                        (strcmp(encname, "ISO8859_1") == 0))
+                        (strcmp(encname, "ISO8859_1") == 0) ||
+                        (strcmp(encname, "ISO-8859-1") == 0))
                         fastEncoding = FAST_8859_1;
                     else if (strcmp(encname, "ISO646-US") == 0)
                         fastEncoding = FAST_646_US;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/unix/conf/ppc64le/jvm.cfg	Thu Jan 21 10:17:21 2016 -0800
@@ -0,0 +1,34 @@
+# 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.  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.
+#
+# List of JVMs that can be used as an option to java, javac, etc.
+# Order is important -- first in this list is the default JVM.
+# NOTE that this both this file and its format are UNSUPPORTED and
+# WILL GO AWAY in a future release.
+#
+# You may also select a JVM in an arbitrary location with the
+# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
+# and may not be available in a future release.
+#
+-server KNOWN
+-client IGNORE
--- a/src/java.datatransfer/share/classes/sun/datatransfer/DataFlavorUtil.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.datatransfer/share/classes/sun/datatransfer/DataFlavorUtil.java	Thu Jan 21 10:17:21 2016 -0800
@@ -55,7 +55,7 @@
 /**
  * Utility class with different datatransfer helper functions
  *
- * @since 1.9
+ * @since 9
  */
 public class DataFlavorUtil {
 
--- a/src/java.datatransfer/share/classes/sun/datatransfer/DesktopDatatransferService.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.datatransfer/share/classes/sun/datatransfer/DesktopDatatransferService.java	Thu Jan 21 10:17:21 2016 -0800
@@ -35,7 +35,7 @@
  * to enrich it's functionality
  *
  * @author Petr Pchelko
- * @since 1.9
+ * @since 9
  */
 public interface DesktopDatatransferService {
 
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java	Thu Jan 21 10:17:21 2016 -0800
@@ -235,6 +235,11 @@
         // this will not work if the user clicks on the "Preview" button
         // However if the printer is a StreamPrintService, its the right path.
         PrintService psvc = getPrintService();
+
+        if (psvc == null) {
+            throw new PrinterException("No print service found.");
+        }
+
         if (psvc instanceof StreamPrintService) {
             spoolToService(psvc, attributes);
             return;
--- a/src/java.desktop/share/classes/java/awt/RenderingHints.java	Thu Jan 21 09:46:03 2016 -0800
+++ b/src/java.desktop/share/classes/java/awt/RenderingHints.java	Thu Jan 21 10:17:21 2016 -0800
@@ -965,7 +965,7 @@
      * <li>{@link #VALUE_RESOLUTION_VARIANT_SIZE_FIT}
      * <li>{@link #VALUE_RESOLUTION_VARIANT_DPI_FIT}
      * </ul>
-     * @since 1.9
+     * @since 9
      */
     public static final Key KEY_RESOLUTION_VARIANT =
         SunHints.KEY_RESOLUTION_VARIANT;
@@ -976,7 +976,7 @@
      * of the platform
      *
      * @see #KEY_RESOLUTION_VARIANT
-     * @since 1.9
+     * @since 9
      */
     public static final Object VALUE_RESOLUTION_VARIANT_DEFAULT =
         SunHints.VALUE_RESOLUTION_VARIANT_DEFAULT;
@@ -986,7 +986,7 @@
      * is always used.
      *
      * @see #KEY_RESOLUTION_VARIANT
-     * @since 1.9
+     * @since 9
      */
     public static final Object VALUE_RESOLUTION_VARIANT_BASE =
         SunHints.VALUE_RESOLUTION_VARIANT_BASE;
@@ -997,7 +997,7 @@
      * context.
      *
      * @see #KEY_RESOLUTION_VARIANT
-     * @since 1.9
+     * @since 9
      */
     public static final Object VALUE_RESOLUTION_VARIANT_SIZE_FIT =
         SunHints.VALUE_RESOLUTION_VARIANT_SIZE_FIT;
@@ -1007,7 +1007,7 @@
      * chosen based only on the DPI of the screen.
      *