diff --git a/.hgtags b/.hgtags
index 5618d206183..74caecd3098 100644
--- a/.hgtags
+++ b/.hgtags
@@ -361,3 +361,5 @@ c84d0cce090e161d736de69e941830adf8c2f87a jdk-9+114
84aba7335005a3a47751dcf1f37935f97df9f99a jdk-9+116
82b8d12a553f5617737c238cec060281d52e351c jdk-9+117
7c04fcb12bd4a31570a238e663fa846dfa5ec3b8 jdk-9+118
+caf97b37ebec84288c112d21d3a60cb628cba1e8 jdk-9+119
+9330543436402b8f3bd070524846a464d8143557 jdk-9+120
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index 08fd371176c..cdd21c19b18 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -361,3 +361,5 @@ f900d5afd9c83a0df8f36161c27c5e4c86a66f4c jdk-9+111
6743a8e0cab7b5f6f4a0575f6664892f0ab740af jdk-9+116
e882bcdbdac436523f3d5681611d3118a3804ea7 jdk-9+117
047f95de8f918d8ff5e8cd2636a2abb5c3c8adb8 jdk-9+118
+3463a3f14f0f0e8a68f29ac6405454f2fa2f598a jdk-9+119
+647e0142a5a52749db572b5e6638d561def6479e jdk-9+120
diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4
index f295a46d3c4..6a64c47b964 100644
--- a/common/autoconf/basics.m4
+++ b/common/autoconf/basics.m4
@@ -484,6 +484,8 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
BASIC_REQUIRE_PROGS(FILE, file)
BASIC_REQUIRE_PROGS(FIND, find)
BASIC_REQUIRE_PROGS(HEAD, head)
+ BASIC_REQUIRE_PROGS(GUNZIP, gunzip)
+ BASIC_REQUIRE_PROGS(GZIP, pigz gzip)
BASIC_REQUIRE_PROGS(LN, ln)
BASIC_REQUIRE_PROGS(LS, ls)
BASIC_REQUIRE_PROGS(MKDIR, mkdir)
@@ -496,7 +498,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
BASIC_REQUIRE_PROGS(SH, sh)
BASIC_REQUIRE_PROGS(SORT, sort)
BASIC_REQUIRE_PROGS(TAIL, tail)
- BASIC_REQUIRE_PROGS(TAR, tar)
+ BASIC_REQUIRE_PROGS(TAR, gtar tar)
BASIC_REQUIRE_PROGS(TEE, tee)
BASIC_REQUIRE_PROGS(TOUCH, touch)
BASIC_REQUIRE_PROGS(TR, tr)
@@ -839,8 +841,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
# The spec.gmk file contains all variables for the make system.
AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
- # The hotspot-spec.gmk file contains legacy variables for the hotspot make system.
- AC_CONFIG_FILES([$OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in])
# The bootcycle-spec.gmk file contains support for boot cycle builds.
AC_CONFIG_FILES([$OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
# The buildjdk-spec.gmk file contains support for building a buildjdk when cross compiling.
@@ -1009,11 +1009,36 @@ AC_DEFUN([BASIC_CHECK_FIND_DELETE],
AC_SUBST(FIND_DELETE)
])
+AC_DEFUN([BASIC_CHECK_TAR],
+[
+ # Test which kind of tar was found
+ if test "x$($TAR --version | $GREP "GNU tar")" != "x"; then
+ TAR_TYPE="gnu"
+ elif test "x$($TAR -v | $GREP "bsdtar")" != "x"; then
+ TAR_TYPE="bsd"
+ elif test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
+ TAR_TYPE="solaris"
+ fi
+ AC_MSG_CHECKING([what type of tar was found])
+ AC_MSG_RESULT([$TAR_TYPE])
+
+ if test "x$TAR_TYPE" = "xgnu"; then
+ TAR_INCLUDE_PARAM="T"
+ TAR_SUPPORTS_TRANSFORM="true"
+ else
+ TAR_INCLUDE_PARAM="I"
+ TAR_SUPPORTS_TRANSFORM="false"
+ fi
+ AC_SUBST(TAR_INCLUDE_PARAM)
+ AC_SUBST(TAR_SUPPORTS_TRANSFORM)
+])
+
AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
[
BASIC_CHECK_GNU_MAKE
BASIC_CHECK_FIND_DELETE
+ BASIC_CHECK_TAR
# These tools might not be installed by default,
# need hint on how to install them.
diff --git a/common/autoconf/buildjdk-spec.gmk.in b/common/autoconf/buildjdk-spec.gmk.in
index 818f21eed95..c4b7d9051cc 100644
--- a/common/autoconf/buildjdk-spec.gmk.in
+++ b/common/autoconf/buildjdk-spec.gmk.in
@@ -134,8 +134,9 @@ ifeq ($(JVM_INTERPRETER), cpp)
endif
HOTSPOT_MAKE_ARGS := product docs export_product
-# Control wether Hotspot runs Queens test after building
-TEST_IN_BUILD := false
+
+# Control wether Hotspot builds gtest tests
+BUILD_GTEST := false
USE_PRECOMPILED_HEADER := @USE_PRECOMPILED_HEADER@
diff --git a/common/autoconf/compare.sh.in b/common/autoconf/compare.sh.in
index 67a69ff73bd..f7e2003ca32 100644
--- a/common/autoconf/compare.sh.in
+++ b/common/autoconf/compare.sh.in
@@ -48,6 +48,7 @@ export EXPR="@EXPR@"
export FILE="@FILE@"
export FIND="@FIND@"
export GREP="@GREP@"
+export GUNZIP="@GUNZIP@"
export LDD="@LDD@"
export LN="@LN@"
export MKDIR="@MKDIR@"
@@ -63,10 +64,11 @@ export SED="@SED@"
export SORT="@SORT@"
export STAT="@STAT@"
export STRIP="@STRIP@ @STRIPFLAGS@"
+export TAR="@TAR@"
export TEE="@TEE@"
export UNIQ="@UNIQ@"
export UNPACK200="@FIXPATH@ @BOOT_JDK@/bin/unpack200"
-export UNARCHIVE="@UNZIP@ -q"
+export UNARCHIVE="@UNZIP@ -q -o"
export SRC_ROOT="@TOPDIR@"
export OUTPUT_ROOT="@OUTPUT_ROOT@"
diff --git a/common/autoconf/configure.ac b/common/autoconf/configure.ac
index 291851f8d10..bb5491ba0b4 100644
--- a/common/autoconf/configure.ac
+++ b/common/autoconf/configure.ac
@@ -207,6 +207,7 @@ JDKOPT_SETUP_CODE_COVERAGE
# Need toolchain to setup dtrace
HOTSPOT_SETUP_DTRACE
HOTSPOT_SETUP_JVM_FEATURES
+HOTSPOT_ENABLE_DISABLE_GTEST
###############################################################################
#
@@ -226,9 +227,9 @@ LIB_SETUP_LIBRARIES
#
###############################################################################
-HOTSPOT_SETUP_LEGACY_BUILD
JDKOPT_DETECT_INTREE_EC
JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
+JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST
###############################################################################
#
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index f40198f8da3..e4c2dab06f9 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -650,23 +650,10 @@ TEST_JOBS
JOBS
MEMORY_SIZE
NUM_CORES
+ENABLE_GENERATE_CLASSLIST
BUILD_FAILURE_HANDLER
ENABLE_INTREE_EC
-JVM_VARIANT_CORE
-JVM_VARIANT_ZEROSHARK
-JVM_VARIANT_ZERO
-JVM_VARIANT_HOTSPOT
-JVM_VARIANT_MINIMAL1
-JVM_VARIANT_CLIENT
-JVM_VARIANT_SERVER
-JVM_VARIANTS_COMMA
-TEST_IN_BUILD
-HOTSPOT_MAKE_ARGS
-MACOSX_UNIVERSAL
-DEBUG_CLASSFILES
-FASTDEBUG
-VARIANT
-USE_NEW_HOTSPOT_BUILD
+STLPORT_LIB
LIBZIP_CAN_USE_MMAP
LIBDL
LIBM
@@ -702,6 +689,7 @@ LIBCXX
STATIC_CXX_SETTING
FIXPATH_DETACH_FLAG
FIXPATH
+BUILD_GTEST
VALID_JVM_FEATURES
JVM_FEATURES_custom
JVM_FEATURES_zeroshark
@@ -963,6 +951,8 @@ OTOOL
LDD
ZIP
UNZIP
+TAR_SUPPORTS_TRANSFORM
+TAR_INCLUDE_PARAM
FIND_DELETE
OUTPUT_SYNC
OUTPUT_SYNC_SUPPORTED
@@ -995,6 +985,9 @@ HOTSPOT_BUILD_CPU_ARCH
HOTSPOT_BUILD_CPU
HOTSPOT_BUILD_OS_TYPE
HOTSPOT_BUILD_OS
+OPENJDK_BUILD_BUNDLE_PLATFORM
+OPENJDK_BUILD_CPU_BUNDLE
+OPENJDK_BUILD_OS_BUNDLE
OPENJDK_BUILD_OS_EXPORT_DIR
OPENJDK_BUILD_CPU_JLI_CFLAGS
OPENJDK_BUILD_CPU_OSARCH
@@ -1009,6 +1002,9 @@ HOTSPOT_TARGET_OS_TYPE
HOTSPOT_TARGET_OS
DEFINE_CROSS_COMPILE_ARCH
LP64
+OPENJDK_TARGET_BUNDLE_PLATFORM
+OPENJDK_TARGET_CPU_BUNDLE
+OPENJDK_TARGET_OS_BUNDLE
OPENJDK_TARGET_OS_EXPORT_DIR
OPENJDK_TARGET_CPU_JLI_CFLAGS
OPENJDK_TARGET_CPU_OSARCH
@@ -1078,6 +1074,8 @@ MKTEMP
MKDIR
LS
LN
+GZIP
+GUNZIP
HEAD
FIND
FILE
@@ -1202,6 +1200,7 @@ enable_native_coverage
enable_dtrace
with_jvm_features
with_jvm_interpreter
+enable_hotspot_gtest
with_stdc__lib
with_msvcr_dll
with_msvcp_dll
@@ -1227,9 +1226,8 @@ with_lcms
with_dxsdk
with_dxsdk_lib
with_dxsdk_include
-enable_new_hotspot_build
-enable_hotspot_test_in_build
enable_jtreg_failure_handler
+enable_generate_classlist
with_num_cores
with_memory_size
with_jobs
@@ -1262,6 +1260,8 @@ EXPR
FILE
FIND
HEAD
+GUNZIP
+GZIP
LN
LS
MKDIR
@@ -1996,21 +1996,21 @@ Optional Features:
--enable-dtrace[=yes/no/auto]
enable dtrace. Default is auto, where dtrace is
enabled if all dependencies are present.
+ --disable-hotspot-gtest Disables building of the Hotspot unit tests
--disable-freetype-bundling
disable bundling of the freetype library with the
build result [enabled on Windows or when using
--with-freetype, disabled otherwise]
- --disable-new-hotspot-build
- disable the new hotspot build system (use the old)
- [enabled]
- --enable-hotspot-test-in-build
- run the Queens test after Hotspot build [disabled]
--enable-jtreg-failure-handler
forces build of the jtreg failure handler to be
enabled, missing dependencies become fatal errors.
Default is auto, where the failure handler is built
if all dependencies are present and otherwise just
disabled.
+ --disable-generate-classlist
+ forces enabling or disabling of the generation of a
+ CDS classlist at build time. Default is to generate
+ it when either the server or client JVMs are built.
--enable-sjavac use sjavac to do fast incremental compiles
[disabled]
--disable-javac-server disable javac server [enabled]
@@ -2205,6 +2205,8 @@ Some influential environment variables:
FILE Override default value for FILE
FIND Override default value for FIND
HEAD Override default value for HEAD
+ GUNZIP Override default value for GUNZIP
+ GZIP Override default value for GZIP
LN Override default value for LN
LS Override default value for LS
MKDIR Override default value for MKDIR
@@ -3707,6 +3709,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
# Check if build directory is on local disk. If not possible to determine,
# we prefer to claim it's local.
# Argument 1: directory to test
@@ -4303,9 +4307,8 @@ VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom"
#
-###############################################################################
-# Support for old hotspot build. Remove once new hotspot build has proven
-# to work satisfactory.
+################################################################################
+# Check if gtest should be built
#
@@ -4394,6 +4397,12 @@ VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom"
#
+################################################################################
+#
+# Enable or disable generation of the classlist at build time
+#
+
+
#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -4732,6 +4741,13 @@ VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom"
################################################################################
+################################################################################
+# libstlport.so.1 is needed for running gtest on Solaris. Find it to
+# redistribute it in the test image.
+################################################################################
+
+
+
#
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -5076,7 +5092,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1462970869
+DATE_WHEN_GENERATED=1464173584
###############################################################################
#
@@ -8401,6 +8417,414 @@ $as_echo "$tool_specified" >&6; }
+ # Publish this variable in the help.
+
+
+ if [ -z "${GUNZIP+x}" ]; then
+ # The variable is not set by user, try to locate tool using the code snippet
+ for ac_prog in gunzip
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GUNZIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GUNZIP in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GUNZIP="$GUNZIP" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GUNZIP="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+GUNZIP=$ac_cv_path_GUNZIP
+if test -n "$GUNZIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUNZIP" >&5
+$as_echo "$GUNZIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$GUNZIP" && break
+done
+
+ else
+ # The variable is set, but is it from the command line or the environment?
+
+ # Try to remove the string !GUNZIP! from our list.
+ try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!GUNZIP!/}
+ if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then
+ # If it failed, the variable was not from the command line. Ignore it,
+ # but warn the user (except for BASH, which is always set by the calling BASH).
+ if test "xGUNZIP" != xBASH; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of GUNZIP from the environment. Use command line variables instead." >&5
+$as_echo "$as_me: WARNING: Ignoring value of GUNZIP from the environment. Use command line variables instead." >&2;}
+ fi
+ # Try to locate tool using the code snippet
+ for ac_prog in gunzip
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GUNZIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GUNZIP in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GUNZIP="$GUNZIP" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GUNZIP="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+GUNZIP=$ac_cv_path_GUNZIP
+if test -n "$GUNZIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUNZIP" >&5
+$as_echo "$GUNZIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$GUNZIP" && break
+done
+
+ else
+ # If it succeeded, then it was overridden by the user. We will use it
+ # for the tool.
+
+ # First remove it from the list of overridden variables, so we can test
+ # for unknown variables in the end.
+ CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
+
+ # Check if we try to supply an empty value
+ if test "x$GUNZIP" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool GUNZIP= (no value)" >&5
+$as_echo "$as_me: Setting user supplied tool GUNZIP= (no value)" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GUNZIP" >&5
+$as_echo_n "checking for GUNZIP... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
+$as_echo "disabled" >&6; }
+ else
+ # Check if the provided tool contains a complete path.
+ tool_specified="$GUNZIP"
+ tool_basename="${tool_specified##*/}"
+ if test "x$tool_basename" = "x$tool_specified"; then
+ # A command without a complete path is provided, search $PATH.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool GUNZIP=$tool_basename" >&5
+$as_echo "$as_me: Will search for user supplied tool GUNZIP=$tool_basename" >&6;}
+ # Extract the first word of "$tool_basename", so it can be a program name with args.
+set dummy $tool_basename; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GUNZIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GUNZIP in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GUNZIP="$GUNZIP" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GUNZIP="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+GUNZIP=$ac_cv_path_GUNZIP
+if test -n "$GUNZIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUNZIP" >&5
+$as_echo "$GUNZIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test "x$GUNZIP" = x; then
+ as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5
+ fi
+ else
+ # Otherwise we believe it is a complete path. Use it as it is.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool GUNZIP=$tool_specified" >&5
+$as_echo "$as_me: Will use user supplied tool GUNZIP=$tool_specified" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GUNZIP" >&5
+$as_echo_n "checking for GUNZIP... " >&6; }
+ if test ! -x "$tool_specified"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+ as_fn_error $? "User supplied tool GUNZIP=$tool_specified does not exist or is not executable" "$LINENO" 5
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5
+$as_echo "$tool_specified" >&6; }
+ fi
+ fi
+ fi
+
+ fi
+
+
+
+ if test "x$GUNZIP" = x; then
+ as_fn_error $? "Could not find required tool for GUNZIP" "$LINENO" 5
+ fi
+
+
+
+
+
+ # Publish this variable in the help.
+
+
+ if [ -z "${GZIP+x}" ]; then
+ # The variable is not set by user, try to locate tool using the code snippet
+ for ac_prog in pigz gzip
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GZIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GZIP in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+GZIP=$ac_cv_path_GZIP
+if test -n "$GZIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5
+$as_echo "$GZIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$GZIP" && break
+done
+
+ else
+ # The variable is set, but is it from the command line or the environment?
+
+ # Try to remove the string !GZIP! from our list.
+ try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!GZIP!/}
+ if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then
+ # If it failed, the variable was not from the command line. Ignore it,
+ # but warn the user (except for BASH, which is always set by the calling BASH).
+ if test "xGZIP" != xBASH; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of GZIP from the environment. Use command line variables instead." >&5
+$as_echo "$as_me: WARNING: Ignoring value of GZIP from the environment. Use command line variables instead." >&2;}
+ fi
+ # Try to locate tool using the code snippet
+ for ac_prog in pigz gzip
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GZIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GZIP in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+GZIP=$ac_cv_path_GZIP
+if test -n "$GZIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5
+$as_echo "$GZIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$GZIP" && break
+done
+
+ else
+ # If it succeeded, then it was overridden by the user. We will use it
+ # for the tool.
+
+ # First remove it from the list of overridden variables, so we can test
+ # for unknown variables in the end.
+ CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
+
+ # Check if we try to supply an empty value
+ if test "x$GZIP" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool GZIP= (no value)" >&5
+$as_echo "$as_me: Setting user supplied tool GZIP= (no value)" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GZIP" >&5
+$as_echo_n "checking for GZIP... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
+$as_echo "disabled" >&6; }
+ else
+ # Check if the provided tool contains a complete path.
+ tool_specified="$GZIP"
+ tool_basename="${tool_specified##*/}"
+ if test "x$tool_basename" = "x$tool_specified"; then
+ # A command without a complete path is provided, search $PATH.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool GZIP=$tool_basename" >&5
+$as_echo "$as_me: Will search for user supplied tool GZIP=$tool_basename" >&6;}
+ # Extract the first word of "$tool_basename", so it can be a program name with args.
+set dummy $tool_basename; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GZIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GZIP in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+GZIP=$ac_cv_path_GZIP
+if test -n "$GZIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5
+$as_echo "$GZIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test "x$GZIP" = x; then
+ as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5
+ fi
+ else
+ # Otherwise we believe it is a complete path. Use it as it is.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool GZIP=$tool_specified" >&5
+$as_echo "$as_me: Will use user supplied tool GZIP=$tool_specified" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GZIP" >&5
+$as_echo_n "checking for GZIP... " >&6; }
+ if test ! -x "$tool_specified"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+ as_fn_error $? "User supplied tool GZIP=$tool_specified does not exist or is not executable" "$LINENO" 5
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5
+$as_echo "$tool_specified" >&6; }
+ fi
+ fi
+ fi
+
+ fi
+
+
+
+ if test "x$GZIP" = x; then
+ as_fn_error $? "Could not find required tool for GZIP" "$LINENO" 5
+ fi
+
+
+
+
+
# Publish this variable in the help.
@@ -10854,7 +11278,7 @@ $as_echo "$tool_specified" >&6; }
if [ -z "${TAR+x}" ]; then
# The variable is not set by user, try to locate tool using the code snippet
- for ac_prog in tar
+ for ac_prog in gtar tar
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -10912,7 +11336,7 @@ done
$as_echo "$as_me: WARNING: Ignoring value of TAR from the environment. Use command line variables instead." >&2;}
fi
# Try to locate tool using the code snippet
- for ac_prog in tar
+ for ac_prog in gtar tar
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -15428,6 +15852,23 @@ $as_echo "$COMPILE_TYPE" >&6; }
fi
+ # The new version string in JDK 9 also defined new naming of OS and ARCH for bundles
+ # Macosx is osx and x86_64 is x64
+ if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+ OPENJDK_TARGET_OS_BUNDLE="osx"
+ else
+ OPENJDK_TARGET_OS_BUNDLE="$OPENJDK_TARGET_OS"
+ fi
+ if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
+ OPENJDK_TARGET_CPU_BUNDLE="x64"
+ else
+ OPENJDK_TARGET_CPU_BUNDLE="$OPENJDK_TARGET_CPU"
+ fi
+ OPENJDK_TARGET_BUNDLE_PLATFORM="${OPENJDK_TARGET_OS_BUNDLE}-${OPENJDK_TARGET_CPU_BUNDLE}"
+
+
+
+
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
A_LP64="LP64:="
# -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in
@@ -15584,6 +16025,23 @@ $as_echo "$COMPILE_TYPE" >&6; }
fi
+ # The new version string in JDK 9 also defined new naming of OS and ARCH for bundles
+ # Macosx is osx and x86_64 is x64
+ if test "x$OPENJDK_BUILD_OS" = xmacosx; then
+ OPENJDK_BUILD_OS_BUNDLE="osx"
+ else
+ OPENJDK_BUILD_OS_BUNDLE="$OPENJDK_TARGET_OS"
+ fi
+ if test "x$OPENJDK_BUILD_CPU" = xx86_64; then
+ OPENJDK_BUILD_CPU_BUNDLE="x64"
+ else
+ OPENJDK_BUILD_CPU_BUNDLE="$OPENJDK_BUILD_CPU"
+ fi
+ OPENJDK_BUILD_BUNDLE_PLATFORM="${OPENJDK_BUILD_OS_BUNDLE}-${OPENJDK_BUILD_CPU_BUNDLE}"
+
+
+
+
if test "x$OPENJDK_BUILD_CPU_BITS" = x64; then
A_LP64="LP64:="
# -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in
@@ -16297,7 +16755,10 @@ $as_echo "$JVM_VARIANTS" >&6; }
# Check that the selected variants are valid
# grep filter function inspired by a comment to http://stackoverflow.com/a/1617326
- INVALID_VARIANTS=`$GREP -Fvx "${VALID_JVM_VARIANTS// /$'\n'}" <<< "${JVM_VARIANTS// /$'\n'}"`
+ # Notice that the original variant failes on SLES 10 and 11
+ NEEDLE=${VALID_JVM_VARIANTS// /$'\n'}
+ STACK=${JVM_VARIANTS// /$'\n'}
+ INVALID_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
if test "x$INVALID_VARIANTS" != x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Unknown variant(s) specified: $INVALID_VARIANTS" >&5
$as_echo "$as_me: Unknown variant(s) specified: $INVALID_VARIANTS" >&6;}
@@ -16306,7 +16767,9 @@ $as_echo "$as_me: Unknown variant(s) specified: $INVALID_VARIANTS" >&6;}
# All "special" variants share the same output directory ("server")
VALID_MULTIPLE_JVM_VARIANTS="server client minimal"
- INVALID_MULTIPLE_VARIANTS=`$GREP -Fvx "${VALID_MULTIPLE_JVM_VARIANTS// /$'\n'}" <<< "${JVM_VARIANTS// /$'\n'}"`
+ NEEDLE=${VALID_MULTIPLE_JVM_VARIANTS// /$'\n'}
+ STACK=${JVM_VARIANTS// /$'\n'}
+ INVALID_MULTIPLE_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
if test "x$INVALID_MULTIPLE_VARIANTS" != x && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xtrue; then
as_fn_error $? "You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS." "$LINENO" 5
fi
@@ -17016,9 +17479,6 @@ $as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is inval
# The spec.gmk file contains all variables for the make system.
ac_config_files="$ac_config_files $OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in"
- # The hotspot-spec.gmk file contains legacy variables for the hotspot make system.
- ac_config_files="$ac_config_files $OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in"
-
# The bootcycle-spec.gmk file contains support for boot cycle builds.
ac_config_files="$ac_config_files $OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in"
@@ -20699,6 +21159,30 @@ $as_echo "yes" >&6; }
+ # Test which kind of tar was found
+ if test "x$($TAR --version | $GREP "GNU tar")" != "x"; then
+ TAR_TYPE="gnu"
+ elif test "x$($TAR -v | $GREP "bsdtar")" != "x"; then
+ TAR_TYPE="bsd"
+ elif test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
+ TAR_TYPE="solaris"
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking what type of tar was found" >&5
+$as_echo_n "checking what type of tar was found... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR_TYPE" >&5
+$as_echo "$TAR_TYPE" >&6; }
+
+ if test "x$TAR_TYPE" = "xgnu"; then
+ TAR_INCLUDE_PARAM="T"
+ TAR_SUPPORTS_TRANSFORM="true"
+ else
+ TAR_INCLUDE_PARAM="I"
+ TAR_SUPPORTS_TRANSFORM="false"
+ fi
+
+
+
+
# These tools might not be installed by default,
# need hint on how to install them.
@@ -23790,9 +24274,6 @@ fi
if test "x$OPENJDK_TARGET_OS" = xaix ; then
INCLUDE_SA=false
fi
- if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
- INCLUDE_SA=false
- fi
# Compress jars
@@ -52948,6 +53429,49 @@ fi
+ # Check whether --enable-hotspot-gtest was given.
+if test "${enable_hotspot_gtest+set}" = set; then :
+ enableval=$enable_hotspot_gtest;
+fi
+
+
+ if test -e "$HOTSPOT_TOPDIR/test/native"; then
+ GTEST_DIR_EXISTS="true"
+ else
+ GTEST_DIR_EXISTS="false"
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Hotspot gtest unit tests should be built" >&5
+$as_echo_n "checking if Hotspot gtest unit tests should be built... " >&6; }
+ if test "x$enable_hotspot_gtest" = "xyes"; then
+ if test "x$GTEST_DIR_EXISTS" = "xtrue"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5
+$as_echo "yes, forced" >&6; }
+ BUILD_GTEST="true"
+ else
+ as_fn_error $? "Cannot build gtest without the test source" "$LINENO" 5
+ fi
+ elif test "x$enable_hotspot_gtest" = "xno"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5
+$as_echo "no, forced" >&6; }
+ BUILD_GTEST="false"
+ elif test "x$enable_hotspot_gtest" = "x"; then
+ if test "x$GTEST_DIR_EXISTS" = "xtrue"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ BUILD_GTEST="true"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ BUILD_GTEST="false"
+ fi
+ else
+ as_fn_error $? "--enable-gtest must be either yes or no" "$LINENO" 5
+ fi
+
+
+
+
###############################################################################
#
# Check dependencies for external and internal libraries.
@@ -64076,6 +64600,157 @@ fi
+ if test "$OPENJDK_TARGET_OS" = "solaris"; then
+ # Find the root of the Solaris Studio installation from the compiler path
+ SOLARIS_STUDIO_DIR="$(dirname $CC)/.."
+ STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4$OPENJDK_TARGET_CPU_ISADIR/libstlport.so.1"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libstlport.so.1" >&5
+$as_echo_n "checking for libstlport.so.1... " >&6; }
+ if test -f "$STLPORT_LIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, $STLPORT_LIB" >&5
+$as_echo "yes, $STLPORT_LIB" >&6; }
+
+ # Only process if variable expands to non-empty
+
+ if test "x$STLPORT_LIB" != x; then
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+
+ # Input might be given as Windows format, start by converting to
+ # unix format.
+ path="$STLPORT_LIB"
+ new_path=`$CYGPATH -u "$path"`
+
+ # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
+ # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
+ # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
+ # "foo.exe" is OK but "foo" is an error.
+ #
+ # This test is therefore slightly more accurate than "test -f" to check for file precense.
+ # It is also a way to make sure we got the proper file name for the real test later on.
+ test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
+ if test "x$test_shortpath" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STLPORT_LIB, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of STLPORT_LIB, which resolves as \"$path\", is invalid." >&6;}
+ as_fn_error $? "Cannot locate the the path of STLPORT_LIB" "$LINENO" 5
+ fi
+
+ # Call helper function which possibly converts this using DOS-style short mode.
+ # If so, the updated path is stored in $new_path.
+
+ input_path="$new_path"
+ # Check if we need to convert this using DOS-style short mode. If the path
+ # contains just simple characters, use it. Otherwise (spaces, weird characters),
+ # take no chances and rewrite it.
+ # Note: m4 eats our [], so we need to use [ and ] instead.
+ has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
+ if test "x$has_forbidden_chars" != x; then
+ # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+ shortmode_path=`$CYGPATH -s -m -a "$input_path"`
+ path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
+ if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
+ # Going to short mode and back again did indeed matter. Since short mode is
+ # case insensitive, let's make it lowercase to improve readability.
+ shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ # Now convert it back to Unix-style (cygpath)
+ input_path=`$CYGPATH -u "$shortmode_path"`
+ new_path="$input_path"
+ fi
+ fi
+
+ test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
+ if test "x$test_cygdrive_prefix" = x; then
+ # As a simple fix, exclude /usr/bin since it's not a real path.
+ if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
+ # The path is in a Cygwin special directory (e.g. /home). We need this converted to
+ # a path prefixed by /cygdrive for fixpath to work.
+ new_path="$CYGWIN_ROOT_PATH$input_path"
+ fi
+ fi
+
+
+ if test "x$path" != "x$new_path"; then
+ STLPORT_LIB="$new_path"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STLPORT_LIB to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting STLPORT_LIB to \"$new_path\"" >&6;}
+ fi
+
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+
+ path="$STLPORT_LIB"
+ has_colon=`$ECHO $path | $GREP ^.:`
+ new_path="$path"
+ if test "x$has_colon" = x; then
+ # Not in mixed or Windows style, start by that.
+ new_path=`cmd //c echo $path`
+ fi
+
+
+ input_path="$new_path"
+ # Check if we need to convert this using DOS-style short mode. If the path
+ # contains just simple characters, use it. Otherwise (spaces, weird characters),
+ # take no chances and rewrite it.
+ # Note: m4 eats our [], so we need to use [ and ] instead.
+ has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
+ if test "x$has_forbidden_chars" != x; then
+ # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+ new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ fi
+
+
+ windows_path="$new_path"
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+ unix_path=`$CYGPATH -u "$windows_path"`
+ new_path="$unix_path"
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+ unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+ new_path="$unix_path"
+ fi
+
+ if test "x$path" != "x$new_path"; then
+ STLPORT_LIB="$new_path"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STLPORT_LIB to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting STLPORT_LIB to \"$new_path\"" >&6;}
+ fi
+
+ # Save the first 10 bytes of this path to the storage, so fixpath can work.
+ all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
+
+ else
+ # We're on a unix platform. Hooray! :)
+ path="$STLPORT_LIB"
+ has_space=`$ECHO "$path" | $GREP " "`
+ if test "x$has_space" != x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STLPORT_LIB, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of STLPORT_LIB, which resolves as \"$path\", is invalid." >&6;}
+ as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+ fi
+
+ # Use eval to expand a potential ~
+ eval path="$path"
+ if test ! -f "$path" && test ! -d "$path"; then
+ as_fn_error $? "The path of STLPORT_LIB, which resolves as \"$path\", is not found." "$LINENO" 5
+ fi
+
+ if test -d "$path"; then
+ STLPORT_LIB="`cd "$path"; $THEPWDCMD -L`"
+ else
+ dir="`$DIRNAME "$path"`"
+ base="`$BASENAME "$path"`"
+ STLPORT_LIB="`cd "$dir"; $THEPWDCMD -L`/$base"
+ fi
+ fi
+ fi
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, not found at $STLPORT_LIB" >&5
+$as_echo "no, not found at $STLPORT_LIB" >&6; }
+ as_fn_error $? "Failed to find libstlport.so.1, cannot build Hotspot gtests" "$LINENO" 5
+ fi
+
+ fi
+
+
+
@@ -64094,144 +64769,6 @@ fi
###############################################################################
- # Check whether --enable-new-hotspot-build was given.
-if test "${enable_new_hotspot_build+set}" = set; then :
- enableval=$enable_new_hotspot_build;
-fi
-
-
- if test "x$enable_new_hotspot_build" = "x" || test "x$enable_new_hotspot_build" = "xyes"; then
- USE_NEW_HOTSPOT_BUILD=true
- else
- USE_NEW_HOTSPOT_BUILD=false
- fi
-
-
- case $HOTSPOT_DEBUG_LEVEL in
- product )
- VARIANT="OPT"
- FASTDEBUG="false"
- DEBUG_CLASSFILES="false"
- ;;
- fastdebug )
- VARIANT="DBG"
- FASTDEBUG="true"
- DEBUG_CLASSFILES="true"
- ;;
- debug )
- VARIANT="DBG"
- FASTDEBUG="false"
- DEBUG_CLASSFILES="true"
- ;;
- optimized )
- VARIANT="OPT"
- FASTDEBUG="false"
- DEBUG_CLASSFILES="false"
- ;;
- esac
-
-
-
-
- if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
- MACOSX_UNIVERSAL="true"
- fi
-
-
-
- # Make sure JVM_VARIANTS_COMMA use minimal1 for backwards compatibility
- JVM_VARIANTS_COMMA=`$ECHO ,$JVM_VARIANTS_OPT, | $SED -e 's/,minimal,/,minimal1,/'`
-
- JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
- JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
- JVM_VARIANT_MINIMAL1=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,minimal1\?,/!s/.*/false/g' -e '/,minimal1\?,/s/.*/true/g'`
- JVM_VARIANT_CORE=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,core,/!s/.*/false/g' -e '/,core,/s/.*/true/g'`
- JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
- JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
- JVM_VARIANT_CUSTOM=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,custom,/!s/.*/false/g' -e '/,custom,/s/.*/true/g'`
-
- #####
- # Generate the legacy makefile targets for hotspot.
- HOTSPOT_TARGET=""
-
- if test "x$JVM_VARIANT_SERVER" = xtrue; then
- HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} "
- fi
-
- if test "x$JVM_VARIANT_CLIENT" = xtrue; then
- HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
- fi
-
- if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
- HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
- fi
-
- if test "x$JVM_VARIANT_ZERO" = xtrue; then
- HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
- fi
-
- if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
- HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
- fi
-
- if test "x$JVM_VARIANT_CORE" = xtrue; then
- HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}core "
- fi
-
- HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_DEBUG_LEVEL"
-
- # On Macosx universal binaries are produced, but they only contain
- # 64 bit intel. This invalidates control of which jvms are built
- # from configure, but only server is valid anyway. Fix this
- # when hotspot makefiles are rewritten.
- if test "x$MACOSX_UNIVERSAL" = xtrue; then
- HOTSPOT_TARGET=universal_${HOTSPOT_DEBUG_LEVEL}
- fi
-
- HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
-
-
- # Control wether Hotspot runs Queens test after build.
- # Check whether --enable-hotspot-test-in-build was given.
-if test "${enable_hotspot_test_in_build+set}" = set; then :
- enableval=$enable_hotspot_test_in_build;
-else
- enable_hotspot_test_in_build=no
-fi
-
- if test "x$enable_hotspot_test_in_build" = "xyes"; then
- TEST_IN_BUILD=true
- else
- TEST_IN_BUILD=false
- fi
-
-
- if test "x$USE_NEW_HOTSPOT_BUILD" = xfalse; then
- if test "x$JVM_VARIANT_CLIENT" = xtrue; then
- if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
- as_fn_error $? "You cannot build a client JVM for a 64-bit machine." "$LINENO" 5
- fi
- fi
- if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
- if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
- as_fn_error $? "You cannot build a minimal JVM for a 64-bit machine." "$LINENO" 5
- fi
- fi
- if test "x$JVM_VARIANT_CUSTOM" = xtrue; then
- as_fn_error $? "You cannot build a custom JVM using the old hotspot build system." "$LINENO" 5
- fi
- fi
-
-
-
-
-
-
-
-
-
-
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if elliptic curve crypto implementation is present" >&5
$as_echo_n "checking if elliptic curve crypto implementation is present... " >&6; }
@@ -64287,6 +64824,51 @@ $as_echo "yes, jtreg present" >&6; }
+ # Check whether --enable-generate-classlist was given.
+if test "${enable_generate_classlist+set}" = set; then :
+ enableval=$enable_generate_classlist;
+fi
+
+
+ # Check if it's likely that it's possible to generate the classlist. Depending
+ # on exact jvm configuration it could be possible anyway.
+ if [[ " $JVM_VARIANTS " =~ " server " ]] || [[ " $JVM_VARIANTS " =~ " client " ]] ; then
+ ENABLE_GENERATE_CLASSLIST_POSSIBLE="true"
+ else
+ ENABLE_GENERATE_CLASSLIST_POSSIBLE="false"
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the CDS classlist generation should be enabled" >&5
+$as_echo_n "checking if the CDS classlist generation should be enabled... " >&6; }
+ if test "x$enable_generate_classlist" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5
+$as_echo "yes, forced" >&6; }
+ ENABLE_GENERATE_CLASSLIST="true"
+ if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xfalse"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS" >&5
+$as_echo "$as_me: WARNING: Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS" >&2;}
+ fi
+ elif test "x$enable_generate_classlist" = "xno"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5
+$as_echo "no, forced" >&6; }
+ ENABLE_GENERATE_CLASSLIST="false"
+ elif test "x$enable_generate_classlist" = "x"; then
+ if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xtrue"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ ENABLE_GENERATE_CLASSLIST="true"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ENABLE_GENERATE_CLASSLIST="false"
+ fi
+ else
+ as_fn_error $? "Invalid value for --enable-generate-classlist: $enable_generate_classlist" "$LINENO" 5
+ fi
+
+
+
+
###############################################################################
#
# Configure parts of the build that only affect the build performance,
@@ -65977,7 +66559,9 @@ $as_echo_n "checking JVM features for JVM variant '$variant'... " >&6; }
JVM_FEATURES_TO_TEST=${!features_var_name}
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $JVM_FEATURES_TO_TEST" >&5
$as_echo "$JVM_FEATURES_TO_TEST" >&6; }
- INVALID_FEATURES=`$GREP -Fvx "${VALID_JVM_FEATURES// /$'\n'}" <<< "${JVM_FEATURES_TO_TEST// /$'\n'}"`
+ NEEDLE=${VALID_JVM_FEATURES// /$'\n'}
+ STACK=${JVM_FEATURES_TO_TEST// /$'\n'}
+ INVALID_FEATURES=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
if test "x$INVALID_FEATURES" != x; then
as_fn_error $? "Invalid JVM feature(s): $INVALID_FEATURES" "$LINENO" 5
fi
@@ -66697,7 +67281,6 @@ for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"$OUTPUT_ROOT/spec.gmk") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in" ;;
- "$OUTPUT_ROOT/hotspot-spec.gmk") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in" ;;
"$OUTPUT_ROOT/bootcycle-spec.gmk") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in" ;;
"$OUTPUT_ROOT/buildjdk-spec.gmk") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.in" ;;
"$OUTPUT_ROOT/compare.sh") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in" ;;
diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in
deleted file mode 100644
index 50d790876a6..00000000000
--- a/common/autoconf/hotspot-spec.gmk.in
+++ /dev/null
@@ -1,158 +0,0 @@
-#
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. 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.
-#
-
-
-# Chaining of spec files
-HOTSPOT_SPEC:=$(dir $(SPEC))hotspot-spec.gmk
-override SPEC=$(HOTSPOT_SPEC)
-# Now include the base spec.gmk file
-include $(BASE_SPEC)
-
-# Additional legacy variables defined for Hotspot
-
-@SET_OPENJDK@
-@HOTSPOT_SET_WARNINGS_AS_ERRORS@
-
-# Legacy defines controlled by the SUPPORT_HEADLESS and SUPPORT_HEADFUL options.
-@BUILD_HEADLESS@
-
-JVM_VARIANTS:=@JVM_VARIANTS_COMMA@
-
-JVM_VARIANT_SERVER:=@JVM_VARIANT_SERVER@
-JVM_VARIANT_CLIENT:=@JVM_VARIANT_CLIENT@
-JVM_VARIANT_MINIMAL1:=@JVM_VARIANT_MINIMAL1@
-JVM_VARIANT_CORE:=@JVM_VARIANT_CORE@
-JVM_VARIANT_ZERO:=@JVM_VARIANT_ZERO@
-JVM_VARIANT_ZEROSHARK:=@JVM_VARIANT_ZEROSHARK@
-JVM_VARIANT_CUSTOM:=@JVM_VARIANT_HOTSPOT@
-
-# Legacy setting: OPT or DBG
-VARIANT:=@VARIANT@
-# Legacy setting: true or false
-FASTDEBUG:=@FASTDEBUG@
-# Legacy setting: debugging the class files?
-DEBUG_CLASSFILES:=@DEBUG_CLASSFILES@
-
-ALT_CUPS_HEADERS_PATH:=$(patsubst -I%,%,$(filter -I%,@CUPS_CFLAGS@))
-
-# The HOSTCC/HOSTCXX is Hotspot terminology for the BUILD_CC/BUILD_CXX, i.e. the
-# compiler that produces code that can be run on the build platform.
-HOSTCC:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CC@ $(BUILD_SYSROOT_CFLAGS)
-HOSTCXX:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CXX@ $(BUILD_SYSROOT_CFLAGS)
-
-####################################################
-#
-# Legacy Hotspot support
-
-# If cross compiling, then define CROSS_COMPILE_ARCH:=cpu_name here.
-@DEFINE_CROSS_COMPILE_ARCH@
-
-# Old name for OPENJDK_TARGET_OS (aix,bsd,hpux,linux,macosx,solaris,windows etc)
-PLATFORM=$(OPENJDK_TARGET_OS)
-# 32 or 64 bit
-ARCH_DATA_MODEL=$(OPENJDK_TARGET_CPU_BITS)
-
-ALT_BOOTDIR=$(BOOT_JDK)
-# Can be /sparcv9 or /amd64 on Solaris
-ISA_DIR=$(OPENJDK_TARGET_CPU_ISADIR)
-# Yet another name for arch used for an extra subdir below the jvm lib.
-# Uses i386 and amd64, instead of x86 and x86_64.
-LIBARCH=$(OPENJDK_TARGET_CPU_LEGACY_LIB)
-# Set the cpu architecture
-ARCH=$(OPENJDK_TARGET_CPU_ARCH)
-# Legacy setting for building for a 64 bit machine.
-# If yes then this expands to _LP64:=1
-@LP64@
-
-# Legacy settings for zero
-ZERO_ENDIANNESS=$(OPENJDK_TARGET_CPU_ENDIAN)
-ZERO_LIBARCH=$(OPENJDK_TARGET_CPU_LEGACY_LIB)
-ZERO_ARCHDEF=@ZERO_ARCHDEF@
-ZERO_ARCHFLAG=@ZERO_ARCHFLAG@
-LIBFFI_CFLAGS=@LIBFFI_CFLAGS@
-LIBFFI_LIBS=@LIBFFI_LIBS@
-
-# Legacy settings for zeroshark
-LLVM_CFLAGS=@LLVM_CFLAGS@
-LLVM_LIBS=@LLVM_LIBS@
-LLVM_LDFLAGS=@LLVM_LDFLAGS@
-
-ALT_OUTPUTDIR=$(HOTSPOT_OUTPUTDIR)
-ALT_EXPORT_PATH=$(HOTSPOT_DIST)
-
-ifeq ($(HOTSPOT_TARGET_CPU), zero)
- CC_INTERP=true
-endif
-
-HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@ @STATIC_CXX_SETTING@
-# Control wether Hotspot runs Queens test after building
-TEST_IN_BUILD=@TEST_IN_BUILD@
-
-USE_CLANG := @USE_CLANG@
-
-# For hotspot, override compiler/tools definition to not include FIXPATH prefix.
-# Hotspot has its own handling on the Windows path situation.
-CXX:=@CCACHE@ @ICECC@ @HOTSPOT_CXX@
-LD:=@HOTSPOT_LD@
-MT:=@HOTSPOT_MT@
-RC:=@HOTSPOT_RC@
-
-EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(CFLAGS_CCACHE) $(NO_NULL_POINTER_CHECK_FLAG) \
- $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG)
-EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@ $(CFLAGS_CCACHE)
-EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@
-
-USE_PRECOMPILED_HEADER=@USE_PRECOMPILED_HEADER@
-
-# Hotspot expects the variable FULL_DEBUG_SYMBOLS=1/0 to control debug symbols
-# creation.
-ifeq ($(COPY_DEBUG_SYMBOLS), true)
- FULL_DEBUG_SYMBOLS=1
- # Ensure hotspot uses the objcopy that configure located
- ALT_OBJCOPY:=$(OBJCOPY)
-else
- FULL_DEBUG_SYMBOLS=0
-endif
-
-# Hotspot expects the variable ZIP_DEBUGINFO_FILES=1/0 and not true/false.
-ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
- ZIP_DEBUGINFO_FILES:=1
-else
- ZIP_DEBUGINFO_FILES:=0
-endif
-
-DEBUG_BINARIES := @DEBUG_BINARIES@
-STRIP_POLICY := @STRIP_POLICY@
-
-ifeq ($(OPENJDK_TARGET_OS), windows)
- # On Windows, the Visual Studio toolchain needs the LIB and INCLUDE
- # environment variables (in Windows path style).
- export INCLUDE:=@VS_INCLUDE@
- export LIB:=@VS_LIB@
-endif
-
-# Sneak this in via the spec.gmk file, since we don't want to mess around too much with the Hotspot make files.
-# This is needed to get the LOG setting to work properly.
-include $(SRC_ROOT)/make/common/MakeBase.gmk
diff --git a/common/autoconf/hotspot.m4 b/common/autoconf/hotspot.m4
index 4fffa86983d..18b6ec0aa21 100644
--- a/common/autoconf/hotspot.m4
+++ b/common/autoconf/hotspot.m4
@@ -93,7 +93,10 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
# Check that the selected variants are valid
# grep filter function inspired by a comment to http://stackoverflow.com/a/1617326
- INVALID_VARIANTS=`$GREP -Fvx "${VALID_JVM_VARIANTS// /$'\n'}" <<< "${JVM_VARIANTS// /$'\n'}"`
+ # Notice that the original variant failes on SLES 10 and 11
+ NEEDLE=${VALID_JVM_VARIANTS// /$'\n'}
+ STACK=${JVM_VARIANTS// /$'\n'}
+ INVALID_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
if test "x$INVALID_VARIANTS" != x; then
AC_MSG_NOTICE([Unknown variant(s) specified: $INVALID_VARIANTS])
AC_MSG_ERROR([The available JVM variants are: $VALID_JVM_VARIANTS])
@@ -101,7 +104,9 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
# All "special" variants share the same output directory ("server")
VALID_MULTIPLE_JVM_VARIANTS="server client minimal"
- INVALID_MULTIPLE_VARIANTS=`$GREP -Fvx "${VALID_MULTIPLE_JVM_VARIANTS// /$'\n'}" <<< "${JVM_VARIANTS// /$'\n'}"`
+ NEEDLE=${VALID_MULTIPLE_JVM_VARIANTS// /$'\n'}
+ STACK=${JVM_VARIANTS// /$'\n'}
+ INVALID_MULTIPLE_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
if test "x$INVALID_MULTIPLE_VARIANTS" != x && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xtrue; then
AC_MSG_ERROR([You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS.])
fi
@@ -293,146 +298,51 @@ AC_DEFUN_ONCE([HOTSPOT_VALIDATE_JVM_FEATURES],
features_var_name=JVM_FEATURES_$variant
JVM_FEATURES_TO_TEST=${!features_var_name}
AC_MSG_RESULT([$JVM_FEATURES_TO_TEST])
- INVALID_FEATURES=`$GREP -Fvx "${VALID_JVM_FEATURES// /$'\n'}" <<< "${JVM_FEATURES_TO_TEST// /$'\n'}"`
+ NEEDLE=${VALID_JVM_FEATURES// /$'\n'}
+ STACK=${JVM_FEATURES_TO_TEST// /$'\n'}
+ INVALID_FEATURES=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
if test "x$INVALID_FEATURES" != x; then
AC_MSG_ERROR([Invalid JVM feature(s): $INVALID_FEATURES])
fi
done
])
-###############################################################################
-# Support for old hotspot build. Remove once new hotspot build has proven
-# to work satisfactory.
+################################################################################
+# Check if gtest should be built
#
-AC_DEFUN_ONCE([HOTSPOT_SETUP_LEGACY_BUILD],
+AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_GTEST],
[
- AC_ARG_ENABLE(new-hotspot-build, [AS_HELP_STRING([--disable-new-hotspot-build],
- [disable the new hotspot build system (use the old) @<:@enabled@:>@])])
+ AC_ARG_ENABLE([hotspot-gtest], [AS_HELP_STRING([--disable-hotspot-gtest],
+ [Disables building of the Hotspot unit tests])])
- if test "x$enable_new_hotspot_build" = "x" || test "x$enable_new_hotspot_build" = "xyes"; then
- USE_NEW_HOTSPOT_BUILD=true
- else
- USE_NEW_HOTSPOT_BUILD=false
- fi
- AC_SUBST(USE_NEW_HOTSPOT_BUILD)
-
- case $HOTSPOT_DEBUG_LEVEL in
- product )
- VARIANT="OPT"
- FASTDEBUG="false"
- DEBUG_CLASSFILES="false"
- ;;
- fastdebug )
- VARIANT="DBG"
- FASTDEBUG="true"
- DEBUG_CLASSFILES="true"
- ;;
- debug )
- VARIANT="DBG"
- FASTDEBUG="false"
- DEBUG_CLASSFILES="true"
- ;;
- optimized )
- VARIANT="OPT"
- FASTDEBUG="false"
- DEBUG_CLASSFILES="false"
- ;;
- esac
- AC_SUBST(VARIANT)
- AC_SUBST(FASTDEBUG)
- AC_SUBST(DEBUG_CLASSFILES)
-
- if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
- MACOSX_UNIVERSAL="true"
- fi
-
- AC_SUBST(MACOSX_UNIVERSAL)
-
- # Make sure JVM_VARIANTS_COMMA use minimal1 for backwards compatibility
- JVM_VARIANTS_COMMA=`$ECHO ,$JVM_VARIANTS_OPT, | $SED -e 's/,minimal,/,minimal1,/'`
-
- JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
- JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
- JVM_VARIANT_MINIMAL1=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,minimal1\?,/!s/.*/false/g' -e '/,minimal1\?,/s/.*/true/g'`
- JVM_VARIANT_CORE=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,core,/!s/.*/false/g' -e '/,core,/s/.*/true/g'`
- JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
- JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
- JVM_VARIANT_CUSTOM=`$ECHO "$JVM_VARIANTS_COMMA" | $SED -e '/,custom,/!s/.*/false/g' -e '/,custom,/s/.*/true/g'`
-
- #####
- # Generate the legacy makefile targets for hotspot.
- HOTSPOT_TARGET=""
-
- if test "x$JVM_VARIANT_SERVER" = xtrue; then
- HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} "
- fi
-
- if test "x$JVM_VARIANT_CLIENT" = xtrue; then
- HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
- fi
-
- if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
- HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
- fi
-
- if test "x$JVM_VARIANT_ZERO" = xtrue; then
- HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
- fi
-
- if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
- HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
- fi
-
- if test "x$JVM_VARIANT_CORE" = xtrue; then
- HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}core "
- fi
-
- HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_DEBUG_LEVEL"
-
- # On Macosx universal binaries are produced, but they only contain
- # 64 bit intel. This invalidates control of which jvms are built
- # from configure, but only server is valid anyway. Fix this
- # when hotspot makefiles are rewritten.
- if test "x$MACOSX_UNIVERSAL" = xtrue; then
- HOTSPOT_TARGET=universal_${HOTSPOT_DEBUG_LEVEL}
- fi
-
- HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
- AC_SUBST(HOTSPOT_MAKE_ARGS)
-
- # Control wether Hotspot runs Queens test after build.
- AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build],
- [run the Queens test after Hotspot build @<:@disabled@:>@])],,
- [enable_hotspot_test_in_build=no])
- if test "x$enable_hotspot_test_in_build" = "xyes"; then
- TEST_IN_BUILD=true
+ if test -e "$HOTSPOT_TOPDIR/test/native"; then
+ GTEST_DIR_EXISTS="true"
else
- TEST_IN_BUILD=false
- fi
- AC_SUBST(TEST_IN_BUILD)
-
- if test "x$USE_NEW_HOTSPOT_BUILD" = xfalse; then
- if test "x$JVM_VARIANT_CLIENT" = xtrue; then
- if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
- AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.])
- fi
- fi
- if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
- if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
- AC_MSG_ERROR([You cannot build a minimal JVM for a 64-bit machine.])
- fi
- fi
- if test "x$JVM_VARIANT_CUSTOM" = xtrue; then
- AC_MSG_ERROR([You cannot build a custom JVM using the old hotspot build system.])
- fi
+ GTEST_DIR_EXISTS="false"
fi
- AC_SUBST(JVM_VARIANTS_COMMA)
- AC_SUBST(JVM_VARIANT_SERVER)
- AC_SUBST(JVM_VARIANT_CLIENT)
- AC_SUBST(JVM_VARIANT_MINIMAL1)
- AC_SUBST(JVM_VARIANT_HOTSPOT)
- AC_SUBST(JVM_VARIANT_ZERO)
- AC_SUBST(JVM_VARIANT_ZEROSHARK)
- AC_SUBST(JVM_VARIANT_CORE)
+ AC_MSG_CHECKING([if Hotspot gtest unit tests should be built])
+ if test "x$enable_hotspot_gtest" = "xyes"; then
+ if test "x$GTEST_DIR_EXISTS" = "xtrue"; then
+ AC_MSG_RESULT([yes, forced])
+ BUILD_GTEST="true"
+ else
+ AC_MSG_ERROR([Cannot build gtest without the test source])
+ fi
+ elif test "x$enable_hotspot_gtest" = "xno"; then
+ AC_MSG_RESULT([no, forced])
+ BUILD_GTEST="false"
+ elif test "x$enable_hotspot_gtest" = "x"; then
+ if test "x$GTEST_DIR_EXISTS" = "xtrue"; then
+ AC_MSG_RESULT([yes])
+ BUILD_GTEST="true"
+ else
+ AC_MSG_RESULT([no])
+ BUILD_GTEST="false"
+ fi
+ else
+ AC_MSG_ERROR([--enable-gtest must be either yes or no])
+ fi
+
+ AC_SUBST(BUILD_GTEST)
])
diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4
index e34e4d927dd..4ae07928262 100644
--- a/common/autoconf/jdk-options.m4
+++ b/common/autoconf/jdk-options.m4
@@ -209,9 +209,6 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
if test "x$OPENJDK_TARGET_OS" = xaix ; then
INCLUDE_SA=false
fi
- if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
- INCLUDE_SA=false
- fi
AC_SUBST(INCLUDE_SA)
# Compress jars
@@ -494,3 +491,46 @@ AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
AC_SUBST(BUILD_FAILURE_HANDLER)
])
+
+################################################################################
+#
+# Enable or disable generation of the classlist at build time
+#
+AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST],
+[
+ AC_ARG_ENABLE([generate-classlist], [AS_HELP_STRING([--disable-generate-classlist],
+ [forces enabling or disabling of the generation of a CDS classlist at build time.
+ Default is to generate it when either the server or client JVMs are built.])])
+
+ # Check if it's likely that it's possible to generate the classlist. Depending
+ # on exact jvm configuration it could be possible anyway.
+ if HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client); then
+ ENABLE_GENERATE_CLASSLIST_POSSIBLE="true"
+ else
+ ENABLE_GENERATE_CLASSLIST_POSSIBLE="false"
+ fi
+
+ AC_MSG_CHECKING([if the CDS classlist generation should be enabled])
+ if test "x$enable_generate_classlist" = "xyes"; then
+ AC_MSG_RESULT([yes, forced])
+ ENABLE_GENERATE_CLASSLIST="true"
+ if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xfalse"; then
+ AC_MSG_WARN([Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS])
+ fi
+ elif test "x$enable_generate_classlist" = "xno"; then
+ AC_MSG_RESULT([no, forced])
+ ENABLE_GENERATE_CLASSLIST="false"
+ elif test "x$enable_generate_classlist" = "x"; then
+ if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xtrue"; then
+ AC_MSG_RESULT([yes])
+ ENABLE_GENERATE_CLASSLIST="true"
+ else
+ AC_MSG_RESULT([no])
+ ENABLE_GENERATE_CLASSLIST="false"
+ fi
+ else
+ AC_MSG_ERROR([Invalid value for --enable-generate-classlist: $enable_generate_classlist])
+ fi
+
+ AC_SUBST([ENABLE_GENERATE_CLASSLIST])
+])
diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4
index e1e91d678d6..4238a17fe82 100644
--- a/common/autoconf/libraries.m4
+++ b/common/autoconf/libraries.m4
@@ -95,6 +95,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
LIB_SETUP_LLVM
LIB_SETUP_BUNDLED_LIBS
LIB_SETUP_MISC_LIBS
+ LIB_SETUP_SOLARIS_STLPORT
])
################################################################################
@@ -189,3 +190,26 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
LIBZIP_CAN_USE_MMAP=true
AC_SUBST(LIBZIP_CAN_USE_MMAP)
])
+
+################################################################################
+# libstlport.so.1 is needed for running gtest on Solaris. Find it to
+# redistribute it in the test image.
+################################################################################
+AC_DEFUN_ONCE([LIB_SETUP_SOLARIS_STLPORT],
+[
+ if test "$OPENJDK_TARGET_OS" = "solaris"; then
+ # Find the root of the Solaris Studio installation from the compiler path
+ SOLARIS_STUDIO_DIR="$(dirname $CC)/.."
+ STLPORT_LIB="$SOLARIS_STUDIO_DIR/lib/stlport4$OPENJDK_TARGET_CPU_ISADIR/libstlport.so.1"
+ AC_MSG_CHECKING([for libstlport.so.1])
+ if test -f "$STLPORT_LIB"; then
+ AC_MSG_RESULT([yes, $STLPORT_LIB])
+ BASIC_FIXUP_PATH([STLPORT_LIB])
+ else
+ AC_MSG_RESULT([no, not found at $STLPORT_LIB])
+ AC_MSG_ERROR([Failed to find libstlport.so.1, cannot build Hotspot gtests])
+ fi
+ AC_SUBST(STLPORT_LIB)
+ fi
+])
+
diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4
index 2e99c452694..2fbac1d0dd3 100644
--- a/common/autoconf/platform.m4
+++ b/common/autoconf/platform.m4
@@ -366,6 +366,23 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
fi
AC_SUBST(OPENJDK_$1_OS_EXPORT_DIR)
+ # The new version string in JDK 9 also defined new naming of OS and ARCH for bundles
+ # Macosx is osx and x86_64 is x64
+ if test "x$OPENJDK_$1_OS" = xmacosx; then
+ OPENJDK_$1_OS_BUNDLE="osx"
+ else
+ OPENJDK_$1_OS_BUNDLE="$OPENJDK_TARGET_OS"
+ fi
+ if test "x$OPENJDK_$1_CPU" = xx86_64; then
+ OPENJDK_$1_CPU_BUNDLE="x64"
+ else
+ OPENJDK_$1_CPU_BUNDLE="$OPENJDK_$1_CPU"
+ fi
+ OPENJDK_$1_BUNDLE_PLATFORM="${OPENJDK_$1_OS_BUNDLE}-${OPENJDK_$1_CPU_BUNDLE}"
+ AC_SUBST(OPENJDK_$1_OS_BUNDLE)
+ AC_SUBST(OPENJDK_$1_CPU_BUNDLE)
+ AC_SUBST(OPENJDK_$1_BUNDLE_PLATFORM)
+
if test "x$OPENJDK_$1_CPU_BITS" = x64; then
A_LP64="LP64:="
# -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index 467cc304b20..a58639f2b8a 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -89,6 +89,10 @@ HOTSPOT_TARGET_CPU := @HOTSPOT_TARGET_CPU@
HOTSPOT_TARGET_CPU_ARCH := @HOTSPOT_TARGET_CPU_ARCH@
HOTSPOT_TARGET_CPU_DEFINE := @HOTSPOT_TARGET_CPU_DEFINE@
+OPENJDK_TARGET_CPU_BUNDLE:=@OPENJDK_TARGET_CPU_BUNDLE@
+OPENJDK_TARGET_OS_BUNDLE:=@OPENJDK_TARGET_OS_BUNDLE@
+OPENJDK_TARGET_BUNDLE_PLATFORM:=@OPENJDK_TARGET_BUNDLE_PLATFORM@
+
# We are building on this build system.
# When not cross-compiling, it is the same as the target.
OPENJDK_BUILD_OS:=@OPENJDK_BUILD_OS@
@@ -232,6 +236,9 @@ JVM_FEATURES_custom := @JVM_FEATURES_custom@
VALID_JVM_FEATURES := @VALID_JVM_FEATURES@
VALID_JVM_VARIANTS := @VALID_JVM_VARIANTS@
+# Control wether Hotspot builds gtest tests
+BUILD_GTEST := @BUILD_GTEST@
+
# Control use of precompiled header in hotspot libjvm build
USE_PRECOMPILED_HEADER := @USE_PRECOMPILED_HEADER@
@@ -265,6 +272,7 @@ BUILDTOOLS_OUTPUTDIR=$(BUILD_OUTPUT)/buildtools
HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot
JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk
IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
+BUNDLES_OUTPUTDIR=$(BUILD_OUTPUT)/bundles
TESTMAKE_OUTPUTDIR=$(BUILD_OUTPUT)/test-make
MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/make-support
# This does not get overridden in a bootcycle build
@@ -277,6 +285,8 @@ BUILD_HOTSPOT=@BUILD_HOTSPOT@
BUILD_FAILURE_HANDLER := @BUILD_FAILURE_HANDLER@
+ENABLE_GENERATE_CLASSLIST := @ENABLE_GENERATE_CLASSLIST@
+
# The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
# it in sync.
BOOT_JDK:=@BOOT_JDK@
@@ -629,6 +639,7 @@ ECHO:=@ECHO@
EGREP:=@EGREP@
FGREP:=@FGREP@
GREP:=@GREP@
+GZIP:=@GZIP@
HEAD:=@HEAD@
LS:=@LS@
LN:=@LN@
@@ -676,6 +687,9 @@ XCODEBUILD=@XCODEBUILD@
DTRACE := @DTRACE@
FIXPATH:=@FIXPATH@
+TAR_INCLUDE_PARAM:=@TAR_INCLUDE_PARAM@
+TAR_SUPPORTS_TRANSFORM:=@TAR_SUPPORTS_TRANSFORM@
+
# Build setup
ENABLE_JFR=@ENABLE_JFR@
ENABLE_INTREE_EC=@ENABLE_INTREE_EC@
@@ -685,6 +699,7 @@ USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@
MSVCR_DLL:=@MSVCR_DLL@
MSVCP_DLL:=@MSVCP_DLL@
+STLPORT_LIB:=@STLPORT_LIB@
####################################################
#
@@ -781,11 +796,46 @@ SYMBOLS_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(SYMBOLS_IMAGE_SUBDIR)
# Interim image
INTERIM_IMAGE_DIR := $(SUPPORT_OUTPUTDIR)/interim-image
+# Docs image
+DOCS_IMAGE_SUBDIR := docs
+DOCS_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/$(DOCS_IMAGE_SUBDIR)
+
# Macosx bundles directory definitions
-JDK_MACOSX_BUNDLE_SUBDIR=jdk-bundle/jdk-$(VERSION_NUMBER).jdk/Contents
-JRE_MACOSX_BUNDLE_SUBDIR=jre-bundle/jre-$(VERSION_NUMBER).jre/Contents
+JDK_MACOSX_BUNDLE_SUBDIR=jdk-bundle
+JRE_MACOSX_BUNDLE_SUBDIR=jre-bundle
JDK_MACOSX_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_MACOSX_BUNDLE_SUBDIR)
JRE_MACOSX_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_MACOSX_BUNDLE_SUBDIR)
+JDK_MACOSX_CONTENTS_SUBDIR=jdk-$(VERSION_NUMBER).jdk/Contents
+JRE_MACOSX_CONTENTS_SUBDIR=jre-$(VERSION_NUMBER).jre/Contents
+JDK_MACOSX_CONTENTS_DIR=$(JDK_MACOSX_BUNDLE_DIR)/$(JDK_MACOSX_CONTENTS_SUBDIR)
+JRE_MACOSX_CONTENTS_DIR=$(JRE_MACOSX_BUNDLE_DIR)/$(JRE_MACOSX_CONTENTS_SUBDIR)
+
+# Bundle names
+BASE_NAME := $(VERSION_SHORT)+$(VERSION_BUILD)_$(OPENJDK_TARGET_BUNDLE_PLATFORM)
+ifeq ($(DEBUG_LEVEL), fastdebug)
+ DEBUG_PART := -debug
+else ifneq ($(DEBUG_LEVEL), release)
+ DEBUG_PART := -$(DEBUG_LEVEL)
+endif
+JDK_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART).tar.gz
+JRE_BUNDLE_NAME := jre-$(BASE_NAME)_bin$(DEBUG_PART).tar.gz
+JDK_SYMBOLS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
+JRE_SYMBOLS_BUNDLE_NAME := jre-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
+ifeq ($(OPENJDK_TARGET_OS), windows)
+ DEMOS_BUNDLE_NAME := jdk-$(BASE_NAME)_demo$(DEBUG_PART).zip
+else
+ DEMOS_BUNDLE_NAME := jdk-$(BASE_NAME)_demo$(DEBUG_PART).tar.gz
+endif
+TEST_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-tests$(DEBUG_PART).tar.gz
+DOCS_BUNDLE_NAME := jdk-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
+
+JDK_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_BUNDLE_NAME)
+JRE_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JRE_BUNDLE_NAME)
+JDK_SYMBOLS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_SYMBOLS_BUNDLE_NAME)
+JRE_SYMBOLS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JRE_SYMBOLS_BUNDLE_NAME)
+DEMOS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(DEMOS_BUNDLE_NAME)
+TEST_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(TEST_BUNDLE_NAME)
+DOCS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(DOCS_BUNDLE_NAME)
# This macro is called to allow inclusion of closed source counterparts.
# Unless overridden in closed sources, it expands to nothing.
diff --git a/common/bin/compare.sh b/common/bin/compare.sh
index db73426481d..0126b9c23ce 100644
--- a/common/bin/compare.sh
+++ b/common/bin/compare.sh
@@ -274,14 +274,19 @@ compare_file_types() {
$MKDIR -p $WORK_DIR
+ FILE_TYPES_FILTER="$SED \
+ -e 's/BuildID[^,]*//' \
+ -e 's/last modified: .*//' \
+ "
+
echo -n File types...
found=""
for f in `cd $OTHER_DIR && $FIND . ! -type d`
do
if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi
if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
- OF=`cd ${OTHER_DIR} && $FILE -h $f | $SED 's/BuildID[^,]*//g'`
- TF=`cd ${THIS_DIR} && $FILE -h $f | $SED 's/BuildID[^,]*//g'`
+ OF=$(cd ${OTHER_DIR} && $FILE -h $f | eval $FILE_TYPES_FILTER)
+ TF=$(cd ${THIS_DIR} && $FILE -h $f | eval $FILE_TYPES_FILTER)
if [ "$OF" != "$TF" ]
then
if [ "`echo $OF | $GREP -c 'Zip archive data'`" -gt 0 ] \
@@ -320,7 +325,7 @@ compare_general_files() {
! -name "*.obj" ! -name "*.o" ! -name "JavaControlPanelHelper" \
! -name "JavaUpdater" ! -name "JavaWSApplicationStub" \
! -name "jspawnhelper" ! -name "JavawsLauncher" ! -name "*.a" \
- ! -name "finish_installation" ! -name "Sparkle" \
+ ! -name "finish_installation" ! -name "Sparkle" ! -name "*.tar.gz" \
| $GREP -v "./bin/" | $SORT | $FILTER)
echo Other files with binary differences...
@@ -423,6 +428,10 @@ compare_zip_file() {
then
(cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
(cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
+ elif [ "$TYPE" = "gz" ]
+ then
+ (cd $THIS_UNZIPDIR && $GUNZIP -c $THIS_ZIP | $TAR xf -)
+ (cd $OTHER_UNZIPDIR && $GUNZIP -c $OTHER_ZIP | $TAR xf -)
else
(cd $THIS_UNZIPDIR && $JIMAGE extract $THIS_ZIP)
(cd $OTHER_UNZIPDIR && $JIMAGE extract $OTHER_ZIP)
@@ -526,10 +535,11 @@ compare_all_zip_files() {
OTHER_DIR=$2
WORK_DIR=$3
- ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" | $SORT | $FILTER )
+ ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" -o -name "*.tar.gz" \
+ | $SORT | $FILTER )
if [ -n "$ZIPS" ]; then
- echo Zip files...
+ echo Zip/tar.gz files...
return_value=0
for f in $ZIPS; do
@@ -913,7 +923,7 @@ compare_bin_file() {
FULLDUMP_MSG=" "
DIFF_FULLDUMP=
if [[ "$KNOWN_FULLDUMP_DIFF $ACCEPTED_FULLDUMP_DIFF" = *"$BIN_FILE"* ]]; then
- FULLDUMP_MSG=" ! "
+ FULLDUMP_MSG=" ! "
fi
fi
fi
diff --git a/common/bin/idea.sh b/common/bin/idea.sh
index 911d309c070..2cd6f92bbb9 100644
--- a/common/bin/idea.sh
+++ b/common/bin/idea.sh
@@ -155,6 +155,14 @@ addBuildDir() {
printf "%s\n" "$mn" >> $IDEA_ANT
}
+JTREG_HOME=" "
+
+addJtregHome() {
+ DIR=`dirname $SPEC`
+ mn="`echo "$JTREG_HOME" | sed -e s@"\(.*\)####\(.*\)"@"\1$JT_HOME\2"@`"
+ printf "%s\n" "$mn" >> $IDEA_ANT
+}
+
### Generate ant.xml
rm -f $IDEA_ANT
@@ -162,6 +170,8 @@ while IFS= read -r line
do
if echo "$line" | egrep "^ .* /dev/null ; then
addModuleName
+ elif echo "$line" | egrep "^ .* /dev/null ; then
+ addJtregHome
elif echo "$line" | egrep "^ .* /dev/null ; then
addBuildDir
else
diff --git a/common/conf/jib-profiles.js b/common/conf/jib-profiles.js
index 2b7164741b1..2d752fd1074 100644
--- a/common/conf/jib-profiles.js
+++ b/common/conf/jib-profiles.js
@@ -215,11 +215,11 @@ var getJibProfilesCommon = function (input) {
var common = {};
common.dependencies = ["boot_jdk", "gnumake", "jtreg"],
- common.default_make_targets = ["product-images", "test-image"],
+ common.default_make_targets = ["product-bundles", "test-bundles"],
common.default_make_targets_debug = common.default_make_targets;
common.default_make_targets_slowdebug = common.default_make_targets;
common.configure_args = ["--enable-jtreg-failure-handler"],
- common.configure_args_32bit = ["--with-target-bits=32", "--with-jvm-variants=client,server"],
+ common.configure_args_32bit = ["--with-target-bits=32"],
common.configure_args_debug = ["--enable-debug"],
common.configure_args_slowdebug = ["--with-debug-level=slowdebug"],
common.organization = "jpg.infra.builddeps"
@@ -245,7 +245,7 @@ var getJibProfilesProfiles = function (input, common) {
target_cpu: "x64",
dependencies: concat(common.dependencies, "devkit"),
configure_args: concat(common.configure_args, "--with-zlib=system"),
- default_make_targets: concat(common.default_make_targets, "docs-image")
+ default_make_targets: concat(common.default_make_targets, "docs-bundles")
},
"linux-x86": {
@@ -254,7 +254,7 @@ var getJibProfilesProfiles = function (input, common) {
build_cpu: "x64",
dependencies: concat(common.dependencies, "devkit"),
configure_args: concat(common.configure_args, common.configure_args_32bit,
- "--with-zlib=system"),
+ "--with-jvm-variants=minimal,client,server", "--with-zlib=system"),
default_make_targets: common.default_make_targets
},
@@ -295,7 +295,8 @@ var getJibProfilesProfiles = function (input, common) {
target_cpu: "x86",
build_cpu: "x64",
dependencies: concat(common.dependencies, "devkit", "freetype"),
- configure_args: concat(common.configure_args, common.configure_args_32bit),
+ configure_args: concat(common.configure_args,
+ "--with-jvm-variants=client,server", common.configure_args_32bit),
default_make_targets: common.default_make_targets
}
};
diff --git a/corba/.hgtags b/corba/.hgtags
index feea5f070eb..284ccf7a0d8 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -361,3 +361,5 @@ cc30faa2da498c478e89ab062ff160653ca1b170 jdk-9+113
7dfa7377a5e601b8f740741a9a80e04c72dd04d6 jdk-9+116
7a1b36bf2fe55a9a7732489ccdd326c910329a7e jdk-9+117
8c2c2d17f7ce92a31c9ccb44a122ec62f5a85ace jdk-9+118
+daf533920b1266603b5cbdab31908d2a931c5361 jdk-9+119
+5943b791e131e79b969d4cea053aecda34801723 jdk-9+120
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index 754ebb60e4b..c500fce7e12 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -522,3 +522,4 @@ b64432bae5271735fd53300b2005b713e98ef411 jdk-9+114
88170d3642905b9e6cac03e8efcc976885a7e6da jdk-9+117
9b1075cac08dc836ec32e7b368415cbe3aceaf8c jdk-9+118
15f3fe264872766bcb205696198f0c1502420e17 jdk-9+119
+0be6f4f5d18671184e62583668cb1d783dffa128 jdk-9+120
diff --git a/hotspot/LICENSE b/hotspot/LICENSE
index b40a0f457d7..8b400c7ab81 100644
--- a/hotspot/LICENSE
+++ b/hotspot/LICENSE
@@ -3,7 +3,7 @@ The GNU General Public License (GPL)
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
@@ -287,8 +287,8 @@ pointer to where the full notice is found.
more details.
You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc., 59
- Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp
index 002f5133234..813580542e1 100644
--- a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp
+++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. 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
@@ -1547,6 +1547,10 @@ class Assembler : public AbstractAssembler {
inline void ld( Register d, int si16, Register s1);
inline void ldu( Register d, int si16, Register s1);
+ // For convenience. Load pointer into d from b+s1.
+ inline void ld_ptr(Register d, int b, Register s1);
+ DEBUG_ONLY(inline void ld_ptr(Register d, ByteSize b, Register s1);)
+
// PPC 1, section 3.3.3 Fixed-Point Store Instructions
inline void stwx( Register d, Register s1, Register s2);
inline void stw( Register d, int si16, Register s1);
@@ -2215,7 +2219,8 @@ class Assembler : public AbstractAssembler {
void add( Register d, RegisterOrConstant roc, Register s1);
void subf(Register d, RegisterOrConstant roc, Register s1);
void cmpd(ConditionRegister d, RegisterOrConstant roc, Register s1);
-
+ // Load pointer d from s1+roc.
+ void ld_ptr(Register d, RegisterOrConstant roc, Register s1 = noreg) { ld(d, roc, s1); }
// Emit several instructions to load a 64 bit constant. This issues a fixed
// instruction pattern so that the constant can be patched later on.
diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp
index 220e3a727c8..ca126170157 100644
--- a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp
+++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. 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
@@ -328,6 +328,9 @@ inline void Assembler::ld( Register d, int si16, Register s1) { emit_int32(
inline void Assembler::ldx( Register d, Register s1, Register s2) { emit_int32(LDX_OPCODE | rt(d) | ra0mem(s1) | rb(s2));}
inline void Assembler::ldu( Register d, int si16, Register s1) { assert(d != s1, "according to ibm manual"); emit_int32(LDU_OPCODE | rt(d) | ds(si16) | rta0mem(s1));}
+inline void Assembler::ld_ptr(Register d, int b, Register s1) { ld(d, b, s1); }
+DEBUG_ONLY(inline void Assembler::ld_ptr(Register d, ByteSize b, Register s1) { ld(d, in_bytes(b), s1); })
+
// PPC 1, section 3.3.3 Fixed-Point Store Instructions
inline void Assembler::stwx( Register d, Register s1, Register s2) { emit_int32(STWX_OPCODE | rs(d) | ra0mem(s1) | rb(s2));}
inline void Assembler::stw( Register d, int si16, Register s1) { emit_int32(STW_OPCODE | rs(d) | d1(si16) | ra0mem(s1));}
diff --git a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp
index 559f68709bf..afc000317a3 100644
--- a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. 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
@@ -1242,7 +1242,7 @@ void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type,
void LIR_Assembler::return_op(LIR_Opr result) {
- const Register return_pc = R11;
+ const Register return_pc = R31; // Must survive C-call to enable_stack_reserved_zone().
const Register polling_page = R12;
// Pop the stack before the safepoint code.
@@ -1265,6 +1265,10 @@ void LIR_Assembler::return_op(LIR_Opr result) {
// Move return pc to LR.
__ mtlr(return_pc);
+ if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) {
+ __ reserved_stack_check(return_pc);
+ }
+
// We need to mark the code position where the load from the safepoint
// polling page was emitted as relocInfo::poll_return_type here.
__ relocate(relocInfo::poll_return_type);
diff --git a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
index f8fe437547d..941a65fa041 100644
--- a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
+++ b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -52,4 +52,6 @@ const bool CCallingConventionRequiresIntsAsLongs = true;
#define INCLUDE_RTM_OPT 1
#endif
+#define SUPPORT_RESERVED_STACK_AREA
+
#endif // CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
diff --git a/hotspot/src/cpu/ppc/vm/globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/globals_ppc.hpp
index b69e4058507..a442f17f4b8 100644
--- a/hotspot/src/cpu/ppc/vm/globals_ppc.hpp
+++ b/hotspot/src/cpu/ppc/vm/globals_ppc.hpp
@@ -43,7 +43,7 @@ define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap NULLs pas
#define DEFAULT_STACK_YELLOW_PAGES (6)
#define DEFAULT_STACK_RED_PAGES (1)
#define DEFAULT_STACK_SHADOW_PAGES (6 DEBUG_ONLY(+2))
-#define DEFAULT_STACK_RESERVED_PAGES (0)
+#define DEFAULT_STACK_RESERVED_PAGES (1)
#define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES
#define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES
diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
index cedc1e08c1c..d3c60b74944 100644
--- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
+++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. 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
@@ -480,6 +480,7 @@ void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass, Register
void InterpreterMacroAssembler::generate_stack_overflow_check_with_compare_and_throw(Register Rmem_frame_size, Register Rscratch1) {
Label done;
+ BLOCK_COMMENT("stack_overflow_check_with_compare_and_throw {");
sub(Rmem_frame_size, R1_SP, Rmem_frame_size);
ld(Rscratch1, thread_(stack_overflow_limit));
cmpld(CCR0/*is_stack_overflow*/, Rmem_frame_size, Rscratch1);
@@ -501,6 +502,7 @@ void InterpreterMacroAssembler::generate_stack_overflow_check_with_compare_and_t
align(32, 12);
bind(done);
+ BLOCK_COMMENT("} stack_overflow_check_with_compare_and_throw");
}
// Separate these two to allow for delay slot in middle.
@@ -805,16 +807,41 @@ void InterpreterMacroAssembler::narrow(Register result) {
void InterpreterMacroAssembler::remove_activation(TosState state,
bool throw_monitor_exception,
bool install_monitor_exception) {
+ BLOCK_COMMENT("remove_activation {");
unlock_if_synchronized_method(state, throw_monitor_exception, install_monitor_exception);
// Save result (push state before jvmti call and pop it afterwards) and notify jvmti.
notify_method_exit(false, state, NotifyJVMTI, true);
+ BLOCK_COMMENT("reserved_stack_check:");
+ if (StackReservedPages > 0) {
+ // Test if reserved zone needs to be enabled.
+ Label no_reserved_zone_enabling;
+
+ // Compare frame pointers. There is no good stack pointer, as with stack
+ // frame compression we can get different SPs when we do calls. A subsequent
+ // call could have a smaller SP, so that this compare succeeds for an
+ // inner call of the method annotated with ReservedStack.
+ ld_ptr(R0, JavaThread::reserved_stack_activation_offset(), R16_thread);
+ ld_ptr(R11_scratch1, _abi(callers_sp), R1_SP); // Load frame pointer.
+ cmpld(CCR0, R11_scratch1, R0);
+ blt_predict_taken(CCR0, no_reserved_zone_enabling);
+
+ // Enable reserved zone again, throw stack overflow exception.
+ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), R16_thread);
+ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_delayed_StackOverflowError));
+
+ should_not_reach_here();
+
+ bind(no_reserved_zone_enabling);
+ }
+
verify_oop(R17_tos, state);
verify_thread();
merge_frames(/*top_frame_sp*/ R21_sender_SP, /*return_pc*/ R0, R11_scratch1, R12_scratch2);
mtlr(R0);
+ BLOCK_COMMENT("} remove_activation");
}
// Lock object
diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
index b8ad532bc3c..d0b0fa8dbda 100644
--- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp
@@ -1400,6 +1400,28 @@ address MacroAssembler::get_stack_bang_address(int instruction, void *ucontext)
#endif
}
+void MacroAssembler::reserved_stack_check(Register return_pc) {
+ // Test if reserved zone needs to be enabled.
+ Label no_reserved_zone_enabling;
+
+ ld_ptr(R0, JavaThread::reserved_stack_activation_offset(), R16_thread);
+ cmpld(CCR0, R1_SP, R0);
+ blt_predict_taken(CCR0, no_reserved_zone_enabling);
+
+ // Enable reserved zone again, throw stack overflow exception.
+ push_frame_reg_args(0, R0);
+ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), R16_thread);
+ pop_frame();
+ mtlr(return_pc);
+ load_const_optimized(R0, StubRoutines::throw_delayed_StackOverflowError_entry());
+ mtctr(R0);
+ bctr();
+
+ should_not_reach_here();
+
+ bind(no_reserved_zone_enabling);
+}
+
// CmpxchgX sets condition register to cmpX(current, compare).
void MacroAssembler::cmpxchgw(ConditionRegister flag, Register dest_current_value,
Register compare_value, Register exchange_value,
diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp
index 0f39e4a3003..003c27b4333 100644
--- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp
+++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp
@@ -411,6 +411,10 @@ class MacroAssembler: public Assembler {
// stdux, return the banged address. Otherwise, return 0.
static address get_stack_bang_address(int instruction, void* ucontext);
+ // Check for reserved stack access in method being exited. If the reserved
+ // stack area was accessed, protect it again and throw StackOverflowError.
+ void reserved_stack_check(Register return_pc);
+
// Atomics
// CmpxchgX sets condition register to cmpX(current, compare).
// (flag == ne) => (dest_current_value != compare_value), (!swapped)
diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad
index d8c36a34f5d..a62eef493b4 100644
--- a/hotspot/src/cpu/ppc/vm/ppc.ad
+++ b/hotspot/src/cpu/ppc/vm/ppc.ad
@@ -1432,7 +1432,7 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
const bool method_needs_polling = do_polling() && C->is_method_compilation();
const bool method_is_frameless = false /* TODO: PPC port C->is_frameless_method()*/;
- const Register return_pc = R11;
+ const Register return_pc = R31; // Must survive C-call to enable_stack_reserved_zone().
const Register polling_page = R12;
if (!method_is_frameless) {
@@ -1456,6 +1456,10 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
__ addi(R1_SP, R1_SP, (int)framesize);
}
+ if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
+ __ reserved_stack_check(return_pc);
+ }
+
if (method_needs_polling) {
// We need to mark the code position where the load from the safepoint
// polling page was emitted as relocInfo::poll_return_type here.
diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
index 7ae89abd38f..e845d2872ed 100644
--- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
@@ -3123,6 +3123,9 @@ class StubGenerator: public StubCodeGenerator {
StubRoutines::_throw_StackOverflowError_entry =
generate_throw_exception("StackOverflowError throw_exception",
CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError), false);
+ StubRoutines::_throw_delayed_StackOverflowError_entry =
+ generate_throw_exception("delayed StackOverflowError throw_exception",
+ CAST_FROM_FN_PTR(address, SharedRuntime::throw_delayed_StackOverflowError), false);
// CRC32 Intrinsics.
if (UseCRC32Intrinsics) {
diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
index 386990690a7..11690a1ddf7 100644
--- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2015 SAP SE. All rights reserved.
+ * Copyright (c) 2015, 2016 SAP SE. 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
@@ -562,10 +562,16 @@ address TemplateInterpreterGenerator::generate_Reference_get_entry(void) {
return NULL;
}
-// Actually we should never reach here since we do stack overflow checks before pushing any frame.
address TemplateInterpreterGenerator::generate_StackOverflowError_handler() {
address entry = __ pc();
- __ unimplemented("generate_StackOverflowError_handler");
+
+ // Expression stack must be empty before entering the VM if an
+ // exception happened.
+ __ empty_expression_stack();
+ // Throw exception.
+ __ call_VM(noreg,
+ CAST_FROM_FN_PTR(address,
+ InterpreterRuntime::throw_StackOverflowError));
return entry;
}
@@ -944,7 +950,7 @@ void TemplateInterpreterGenerator::lock_method(Register Rflags, Register Rscratc
// The top most frame needs an abi space of 112 bytes. This space is needed,
// since we call to c. The c function may spill their arguments to the caller
// frame. When we call to java, we don't need these spill slots. In order to save
-// space on the stack, we resize the caller. However, java local reside in
+// space on the stack, we resize the caller. However, java locals reside in
// the caller frame and the frame has to be increased. The frame_size for the
// current frame was calculated based on max_stack as size for the expression
// stack. At the call, just a part of the expression stack might be used.
@@ -1007,7 +1013,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call, Regist
// parent_frame_resize = (locals-parameters) - (ESP-SP-ABI48) Rounded to frame alignment size.
// Enlarge by locals-parameters (not in case of native_call), shrink by ESP-SP-ABI48.
- {
+ if (!native_call) {
// --------------------------------------------------------------------------
// Stack overflow check
@@ -1047,7 +1053,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call, Regist
__ addi(R26_monitor, R1_SP, - frame::ijava_state_size);
__ addi(R15_esp, R26_monitor, - Interpreter::stackElementSize);
- // Get mirror and store it in the frame as GC root for this Method*
+ // Get mirror and store it in the frame as GC root for this Method*.
__ load_mirror(R12_scratch2, R19_method);
// Store values.
@@ -1133,6 +1139,29 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
return entry;
}
+void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) {
+ // Quick & dirty stack overflow checking: bang the stack & handle trap.
+ // Note that we do the banging after the frame is setup, since the exception
+ // handling code expects to find a valid interpreter frame on the stack.
+ // Doing the banging earlier fails if the caller frame is not an interpreter
+ // frame.
+ // (Also, the exception throwing code expects to unlock any synchronized
+ // method receiever, so do the banging after locking the receiver.)
+
+ // Bang each page in the shadow zone. We can't assume it's been done for
+ // an interpreter frame with greater than a page of locals, so each page
+ // needs to be checked. Only true for non-native.
+ if (UseStackBanging) {
+ const int page_size = os::vm_page_size();
+ const int n_shadow_pages = ((int)JavaThread::stack_shadow_zone_size()) / page_size;
+ const int start_page = native_call ? n_shadow_pages : 1;
+ BLOCK_COMMENT("bang_stack_shadow_pages:");
+ for (int pages = start_page; pages <= n_shadow_pages; pages++) {
+ __ bang_stack_with_offset(pages*page_size);
+ }
+ }
+}
+
// Interpreter stub for calling a native method. (asm interpreter)
// This sets up a somewhat different looking stack for calling the
// native method than the typical interpreter frame setup.
@@ -1156,7 +1185,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// This is not a full-blown interpreter frame, but in particular, the
// following registers are valid after this:
// - R19_method
- // - R18_local (points to start of argumuments to native function)
+ // - R18_local (points to start of arguments to native function)
//
// abstract stack (grows up)
// [ IJava (caller of JNI callee) ] <-- ASP
@@ -1207,6 +1236,11 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
generate_counter_incr(&invocation_counter_overflow, NULL, NULL);
BIND(continue_after_compile);
+ }
+
+ bang_stack_shadow_pages(true);
+
+ if (inc_counter) {
// Reset the _do_not_unlock_if_synchronized flag.
if (synchronized) {
__ li(R0, 0);
@@ -1595,6 +1629,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
Register Rsize_of_parameters = R4_ARG2, // Written by generate_fixed_frame.
Rsize_of_locals = R5_ARG3; // Written by generate_fixed_frame.
+ // Does also a stack check to assure this frame fits on the stack.
generate_fixed_frame(false, Rsize_of_parameters, Rsize_of_locals);
// --------------------------------------------------------------------------
@@ -1651,7 +1686,11 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
}
__ bind(profile_method_continue);
+ }
+ bang_stack_shadow_pages(false);
+
+ if (inc_counter || ProfileInterpreter) {
// Reset the _do_not_unlock_if_synchronized flag.
if (synchronized) {
__ li(R0, 0);
diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java
index 5374a5a40e6..916cb445387 100644
--- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java
+++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java
@@ -1712,7 +1712,8 @@ public class CommandProcessor {
// called after debuggee attach
private void postAttach() {
// create JavaScript engine and start it
- jsengine = new JSJavaScriptEngine() {
+ try {
+ jsengine = new JSJavaScriptEngine() {
private ObjectReader reader = new ObjectReader();
private JSJavaFactory factory = new JSJavaFactoryImpl();
public ObjectReader getObjectReader() {
@@ -1735,17 +1736,24 @@ public class CommandProcessor {
return err;
}
};
- try {
- jsengine.defineFunction(this,
+ try {
+ jsengine.defineFunction(this,
this.getClass().getMethod("registerCommand",
new Class[] {
String.class, String.class, String.class
}));
- } catch (NoSuchMethodException exp) {
- // should not happen, see below...!!
- exp.printStackTrace();
+ } catch (NoSuchMethodException exp) {
+ // should not happen, see below...!!
+ exp.printStackTrace();
+ }
+ jsengine.start();
+ }
+ catch (Exception ex) {
+ System.out.println("Warning! JS Engine can't start, some commands will not be available.");
+ if (verboseExceptions) {
+ ex.printStackTrace(out);
+ }
}
- jsengine.start();
}
public void registerCommand(String cmd, String usage, final String func) {
diff --git a/hotspot/src/os/aix/vm/os_aix.hpp b/hotspot/src/os/aix/vm/os_aix.hpp
index cc4337070c8..db8c38aca5e 100644
--- a/hotspot/src/os/aix/vm/os_aix.hpp
+++ b/hotspot/src/os/aix/vm/os_aix.hpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013, 2015 SAP SE. All rights reserved.
+ * Copyright (c) 2013, 2016 SAP SE. 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
@@ -128,6 +128,8 @@ class Aix {
// Set PC into context. Needed for continuation after signal.
static void ucontext_set_pc(ucontext_t* uc, address pc);
+ static bool get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr);
+
// This boolean allows users to forward their own non-matching signals
// to JVM_handle_aix_signal, harmlessly.
static bool signal_handlers_are_installed;
diff --git a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp
index 211a2dc3323..84ae1ab1dc5 100644
--- a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp
+++ b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2014 SAP SE. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. 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
@@ -24,7 +24,7 @@
*/
// no precompiled headers
-#include "assembler_ppc.inline.hpp"
+#include "asm/assembler.inline.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/vmSymbols.hpp"
@@ -145,6 +145,41 @@ frame os::fetch_frame_from_context(const void* ucVoid) {
return fr;
}
+bool os::Aix::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr) {
+ address pc = (address) os::Aix::ucontext_get_pc(uc);
+ if (Interpreter::contains(pc)) {
+ // Interpreter performs stack banging after the fixed frame header has
+ // been generated while the compilers perform it before. To maintain
+ // semantic consistency between interpreted and compiled frames, the
+ // method returns the Java sender of the current frame.
+ *fr = os::fetch_frame_from_context(uc);
+ if (!fr->is_first_java_frame()) {
+ assert(fr->safe_for_sender(thread), "Safety check");
+ *fr = fr->java_sender();
+ }
+ } else {
+ // More complex code with compiled code.
+ assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above");
+ CodeBlob* cb = CodeCache::find_blob(pc);
+ if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) {
+ // Not sure where the pc points to, fallback to default
+ // stack overflow handling. In compiled code, we bang before
+ // the frame is complete.
+ return false;
+ } else {
+ intptr_t* sp = os::Aix::ucontext_get_sp(uc);
+ *fr = frame(sp, (address)*sp);
+ if (!fr->is_java_frame()) {
+ assert(fr->safe_for_sender(thread), "Safety check");
+ assert(!fr->is_first_frame(), "Safety check");
+ *fr = fr->java_sender();
+ }
+ }
+ }
+ assert(fr->is_java_frame(), "Safety check");
+ return true;
+}
+
frame os::get_sender_for_C_frame(frame* fr) {
if (*fr->sp() == NULL) {
// fr is the last C frame
@@ -246,14 +281,32 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
// to continue with yellow zone disabled, but that doesn't buy us much and prevents
// hs_err_pid files.
if (thread->in_stack_yellow_reserved_zone(addr)) {
- thread->disable_stack_yellow_reserved_zone();
if (thread->thread_state() == _thread_in_Java) {
+ if (thread->in_stack_reserved_zone(addr)) {
+ frame fr;
+ if (os::Aix::get_frame_at_stack_banging_point(thread, uc, &fr)) {
+ assert(fr.is_java_frame(), "Must be a Javac frame");
+ frame activation =
+ SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr);
+ if (activation.sp() != NULL) {
+ thread->disable_stack_reserved_zone();
+ if (activation.is_interpreted_frame()) {
+ thread->set_reserved_stack_activation((address)activation.fp());
+ } else {
+ thread->set_reserved_stack_activation((address)activation.unextended_sp());
+ }
+ return 1;
+ }
+ }
+ }
// Throw a stack overflow exception.
// Guard pages will be reenabled while unwinding the stack.
+ thread->disable_stack_yellow_reserved_zone();
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW);
goto run_stub;
} else {
// Thread was in the vm or native code. Return and try to finish.
+ thread->disable_stack_yellow_reserved_zone();
return 1;
}
} else if (thread->in_stack_red_zone(addr)) {
diff --git a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
index 8cd04dce290..18cd557741d 100644
--- a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
+++ b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
+ * Copyright (c) 2012, 2016 SAP SE. 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
@@ -24,7 +24,7 @@
*/
// no precompiled headers
-#include "assembler_ppc.inline.hpp"
+#include "asm/assembler.inline.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/vmSymbols.hpp"
@@ -157,6 +157,42 @@ frame os::fetch_frame_from_context(const void* ucVoid) {
return frame(sp, epc.pc());
}
+bool os::Linux::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr) {
+ address pc = (address) os::Linux::ucontext_get_pc(uc);
+ if (Interpreter::contains(pc)) {
+ // Interpreter performs stack banging after the fixed frame header has
+ // been generated while the compilers perform it before. To maintain
+ // semantic consistency between interpreted and compiled frames, the
+ // method returns the Java sender of the current frame.
+ *fr = os::fetch_frame_from_context(uc);
+ if (!fr->is_first_java_frame()) {
+ assert(fr->safe_for_sender(thread), "Safety check");
+ *fr = fr->java_sender();
+ }
+ } else {
+ // More complex code with compiled code.
+ assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above");
+ CodeBlob* cb = CodeCache::find_blob(pc);
+ if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) {
+ // Not sure where the pc points to, fallback to default
+ // stack overflow handling. In compiled code, we bang before
+ // the frame is complete.
+ return false;
+ } else {
+ intptr_t* fp = os::Linux::ucontext_get_fp(uc);
+ intptr_t* sp = os::Linux::ucontext_get_sp(uc);
+ *fr = frame(sp, (address)*sp);
+ if (!fr->is_java_frame()) {
+ assert(fr->safe_for_sender(thread), "Safety check");
+ assert(!fr->is_first_frame(), "Safety check");
+ *fr = fr->java_sender();
+ }
+ }
+ }
+ assert(fr->is_java_frame(), "Safety check");
+ return true;
+}
+
frame os::get_sender_for_C_frame(frame* fr) {
if (*fr->sp() == 0) {
// fr is the last C frame
@@ -243,13 +279,31 @@ JVM_handle_linux_signal(int sig,
if (thread->on_local_stack(addr)) {
// stack overflow
if (thread->in_stack_yellow_reserved_zone(addr)) {
- thread->disable_stack_yellow_reserved_zone();
if (thread->thread_state() == _thread_in_Java) {
+ if (thread->in_stack_reserved_zone(addr)) {
+ frame fr;
+ if (os::Linux::get_frame_at_stack_banging_point(thread, uc, &fr)) {
+ assert(fr.is_java_frame(), "Must be a Javac frame");
+ frame activation =
+ SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr);
+ if (activation.sp() != NULL) {
+ thread->disable_stack_reserved_zone();
+ if (activation.is_interpreted_frame()) {
+ thread->set_reserved_stack_activation((address)activation.fp());
+ } else {
+ thread->set_reserved_stack_activation((address)activation.unextended_sp());
+ }
+ return 1;
+ }
+ }
+ }
// Throw a stack overflow exception.
// Guard pages will be reenabled while unwinding the stack.
+ thread->disable_stack_yellow_reserved_zone();
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW);
} else {
// Thread was in the vm or native code. Return and try to finish.
+ thread->disable_stack_yellow_reserved_zone();
return 1;
}
} else if (thread->in_stack_red_zone(addr)) {
diff --git a/hotspot/src/share/vm/ci/ciEnv.cpp b/hotspot/src/share/vm/ci/ciEnv.cpp
index 001c7fd13ea..7bb8f759ffe 100644
--- a/hotspot/src/share/vm/ci/ciEnv.cpp
+++ b/hotspot/src/share/vm/ci/ciEnv.cpp
@@ -704,13 +704,14 @@ Method* ciEnv::lookup_method(InstanceKlass* accessor,
InstanceKlass* holder,
Symbol* name,
Symbol* sig,
- Bytecodes::Code bc) {
+ Bytecodes::Code bc,
+ constantTag tag) {
EXCEPTION_CONTEXT;
KlassHandle h_accessor(THREAD, accessor);
KlassHandle h_holder(THREAD, holder);
LinkResolver::check_klass_accessability(h_accessor, h_holder, KILL_COMPILE_ON_FATAL_(NULL));
methodHandle dest_method;
- LinkInfo link_info(h_holder, name, sig, h_accessor, /*check_access*/true);
+ LinkInfo link_info(h_holder, name, sig, h_accessor, LinkInfo::needs_access_check, tag);
switch (bc) {
case Bytecodes::_invokestatic:
dest_method =
@@ -796,7 +797,9 @@ ciMethod* ciEnv::get_method_by_index_impl(const constantPoolHandle& cpool,
if (holder_is_accessible) { // Our declared holder is loaded.
InstanceKlass* lookup = declared_holder->get_instanceKlass();
- Method* m = lookup_method(accessor->get_instanceKlass(), lookup, name_sym, sig_sym, bc);
+ constantTag tag = cpool->tag_ref_at(index);
+ assert(accessor->get_instanceKlass() == cpool->pool_holder(), "not the pool holder?");
+ Method* m = lookup_method(accessor->get_instanceKlass(), lookup, name_sym, sig_sym, bc, tag);
if (m != NULL &&
(bc == Bytecodes::_invokestatic
? m->method_holder()->is_not_initialized()
diff --git a/hotspot/src/share/vm/ci/ciEnv.hpp b/hotspot/src/share/vm/ci/ciEnv.hpp
index cd7138d33b2..e5a99e1a96a 100644
--- a/hotspot/src/share/vm/ci/ciEnv.hpp
+++ b/hotspot/src/share/vm/ci/ciEnv.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -156,7 +156,8 @@ private:
InstanceKlass* holder,
Symbol* name,
Symbol* sig,
- Bytecodes::Code bc);
+ Bytecodes::Code bc,
+ constantTag tag);
// Get a ciObject from the object factory. Ensures uniqueness
// of ciObjects.
diff --git a/hotspot/src/share/vm/ci/ciMethod.cpp b/hotspot/src/share/vm/ci/ciMethod.cpp
index 8294024ac9e..2a4484850bb 100644
--- a/hotspot/src/share/vm/ci/ciMethod.cpp
+++ b/hotspot/src/share/vm/ci/ciMethod.cpp
@@ -789,7 +789,8 @@ ciMethod* ciMethod::resolve_invoke(ciKlass* caller, ciKlass* exact_receiver, boo
Symbol* h_name = name()->get_symbol();
Symbol* h_signature = signature()->get_symbol();
- LinkInfo link_info(h_resolved, h_name, h_signature, caller_klass, check_access);
+ LinkInfo link_info(h_resolved, h_name, h_signature, caller_klass,
+ check_access ? LinkInfo::needs_access_check : LinkInfo::skip_access_check);
methodHandle m;
// Only do exact lookup if receiver klass has been linked. Otherwise,
// the vtable has not been setup, and the LinkResolver will fail.
diff --git a/hotspot/src/share/vm/classfile/classLoader.cpp b/hotspot/src/share/vm/classfile/classLoader.cpp
index d77aef277eb..12858cccf28 100644
--- a/hotspot/src/share/vm/classfile/classLoader.cpp
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp
@@ -657,7 +657,7 @@ void ClassLoader::setup_xpatch_entries() {
int num_of_entries = xpatch_args->length();
// Set up the boot loader's xpatch_entries list
- _xpatch_entries = new (ResourceObj::C_HEAP, mtInternal) GrowableArray(num_of_entries, true);
+ _xpatch_entries = new (ResourceObj::C_HEAP, mtModule) GrowableArray(num_of_entries, true);
for (int i = 0; i < num_of_entries; i++) {
const char* module_name = (xpatch_args->at(i))->module_name();
@@ -1069,9 +1069,9 @@ void ClassLoader::initialize_module_loader_map(JImageFile* jimage) {
char* begin_ptr = char_buf;
char* end_ptr = strchr(begin_ptr, '\n');
bool process_boot_modules = false;
- _boot_modules_array = new (ResourceObj::C_HEAP, mtInternal)
+ _boot_modules_array = new (ResourceObj::C_HEAP, mtModule)
GrowableArray(INITIAL_BOOT_MODULES_ARRAY_SIZE, true);
- _platform_modules_array = new (ResourceObj::C_HEAP, mtInternal)
+ _platform_modules_array = new (ResourceObj::C_HEAP, mtModule)
GrowableArray(INITIAL_PLATFORM_MODULES_ARRAY_SIZE, true);
while (end_ptr != NULL && (end_ptr - char_buf) < buflen) {
// Allocate a buffer from the C heap to be appended to the _boot_modules_array
diff --git a/hotspot/src/share/vm/classfile/classLoaderData.cpp b/hotspot/src/share/vm/classfile/classLoaderData.cpp
index a9829a0393e..7635879a49a 100644
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp
@@ -67,6 +67,7 @@
#include "runtime/javaCalls.hpp"
#include "runtime/jniHandles.hpp"
#include "runtime/mutex.hpp"
+#include "runtime/orderAccess.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/synchronizer.hpp"
#include "utilities/growableArray.hpp"
@@ -76,6 +77,11 @@
#include "trace/tracing.hpp"
#endif
+// helper function to avoid in-line casts
+template static T* load_ptr_acquire(T* volatile *p) {
+ return static_cast(OrderAccess::load_ptr_acquire(p));
+}
+
ClassLoaderData * ClassLoaderData::_the_null_class_loader_data = NULL;
ClassLoaderData::ClassLoaderData(Handle h_class_loader, bool is_anonymous, Dependencies dependencies) :
@@ -147,20 +153,23 @@ void ClassLoaderData::Dependencies::oops_do(OopClosure* f) {
}
void ClassLoaderData::classes_do(KlassClosure* klass_closure) {
- for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
+ // Lock-free access requires load_ptr_acquire
+ for (Klass* k = load_ptr_acquire(&_klasses); k != NULL; k = k->next_link()) {
klass_closure->do_klass(k);
assert(k != k->next_link(), "no loops!");
}
}
void ClassLoaderData::classes_do(void f(Klass * const)) {
+ assert_locked_or_safepoint(_metaspace_lock);
for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
f(k);
}
}
void ClassLoaderData::methods_do(void f(Method*)) {
- for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
+ // Lock-free access requires load_ptr_acquire
+ for (Klass* k = load_ptr_acquire(&_klasses); k != NULL; k = k->next_link()) {
if (k->is_instance_klass()) {
InstanceKlass::cast(k)->methods_do(f);
}
@@ -179,7 +188,8 @@ void ClassLoaderData::loaded_classes_do(KlassClosure* klass_closure) {
}
void ClassLoaderData::classes_do(void f(InstanceKlass*)) {
- for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
+ // Lock-free access requires load_ptr_acquire
+ for (Klass* k = load_ptr_acquire(&_klasses); k != NULL; k = k->next_link()) {
if (k->is_instance_klass()) {
f(InstanceKlass::cast(k));
}
@@ -188,6 +198,7 @@ void ClassLoaderData::classes_do(void f(InstanceKlass*)) {
}
void ClassLoaderData::modules_do(void f(ModuleEntry*)) {
+ assert_locked_or_safepoint(Module_lock);
if (_modules != NULL) {
for (int i = 0; i < _modules->table_size(); i++) {
for (ModuleEntry* entry = _modules->bucket(i);
@@ -200,9 +211,11 @@ void ClassLoaderData::modules_do(void f(ModuleEntry*)) {
}
void ClassLoaderData::packages_do(void f(PackageEntry*)) {
- if (_packages != NULL) {
- for (int i = 0; i < _packages->table_size(); i++) {
- for (PackageEntry* entry = _packages->bucket(i);
+ // Lock-free access requires load_ptr_acquire
+ PackageEntryTable* packages = load_ptr_acquire(&_packages);
+ if (packages != NULL) {
+ for (int i = 0; i < packages->table_size(); i++) {
+ for (PackageEntry* entry = packages->bucket(i);
entry != NULL;
entry = entry->next()) {
f(entry);
@@ -325,10 +338,9 @@ void ClassLoaderData::add_class(Klass* k, bool publicize /* true */) {
MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
Klass* old_value = _klasses;
k->set_next_link(old_value);
- // Make sure linked class is stable, since the class list is walked without a lock
- OrderAccess::storestore();
- // link the new item into the list
- _klasses = k;
+ // Link the new item into the list, making sure the linked class is stable
+ // since the list can be walked without a lock
+ OrderAccess::release_store_ptr(&_klasses, k);
}
if (publicize && k->class_loader_data() != NULL) {
@@ -343,11 +355,10 @@ void ClassLoaderData::add_class(Klass* k, bool publicize /* true */) {
}
}
-// This is called by InstanceKlass::deallocate_contents() to remove the
-// scratch_class for redefine classes. We need a lock because there it may not
-// be called at a safepoint if there's an error.
+// Remove a klass from the _klasses list for scratch_class during redefinition
+// or parsed class in the case of an error.
void ClassLoaderData::remove_class(Klass* scratch_class) {
- MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
+ assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
Klass* prev = NULL;
for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
if (k == scratch_class) {
@@ -390,42 +401,46 @@ void ClassLoaderData::unload() {
PackageEntryTable* ClassLoaderData::packages() {
// Lazily create the package entry table at first request.
- if (_packages == NULL) {
+ // Lock-free access requires load_ptr_acquire.
+ PackageEntryTable* packages = load_ptr_acquire(&_packages);
+ if (packages == NULL) {
MutexLockerEx m1(metaspace_lock(), Mutex::_no_safepoint_check_flag);
// Check if _packages got allocated while we were waiting for this lock.
- if (_packages == NULL) {
- _packages = new PackageEntryTable(PackageEntryTable::_packagetable_entry_size);
+ if ((packages = _packages) == NULL) {
+ packages = new PackageEntryTable(PackageEntryTable::_packagetable_entry_size);
+ // Ensure _packages is stable, since it is examined without a lock
+ OrderAccess::release_store_ptr(&_packages, packages);
}
}
- return _packages;
+ return packages;
}
ModuleEntryTable* ClassLoaderData::modules() {
// Lazily create the module entry table at first request.
- if (_modules == NULL) {
+ // Lock-free access requires load_ptr_acquire.
+ ModuleEntryTable* modules = load_ptr_acquire(&_modules);
+ if (modules == NULL) {
MutexLocker m1(Module_lock);
- // Check again if _modules has been allocated while we were getting this lock.
- if (_modules != NULL) {
- return _modules;
- }
+ // Check if _modules got allocated while we were waiting for this lock.
+ if ((modules = _modules) == NULL) {
+ modules = new ModuleEntryTable(ModuleEntryTable::_moduletable_entry_size);
+ // Each loader has one unnamed module entry. Create it before
+ // any classes, loaded by this loader, are defined in case
+ // they end up being defined in loader's unnamed module.
+ modules->create_unnamed_module(this);
- ModuleEntryTable* temp_table = new ModuleEntryTable(ModuleEntryTable::_moduletable_entry_size);
- // Each loader has one unnamed module entry. Create it before
- // any classes, loaded by this loader, are defined in case
- // they end up being defined in loader's unnamed module.
- temp_table->create_unnamed_module(this);
-
- {
- MutexLockerEx m1(metaspace_lock(), Mutex::_no_safepoint_check_flag);
- // Ensure _modules is stable, since it is examined without a lock
- OrderAccess::storestore();
- _modules = temp_table;
+ {
+ MutexLockerEx m1(metaspace_lock(), Mutex::_no_safepoint_check_flag);
+ // Ensure _modules is stable, since it is examined without a lock
+ OrderAccess::release_store_ptr(&_modules, modules);
+ }
}
}
- return _modules;
+ return modules;
}
oop ClassLoaderData::keep_alive_object() const {
+ assert_locked_or_safepoint(_metaspace_lock);
assert(!keep_alive(), "Don't use with CLDs that are artificially kept alive");
return is_anonymous() ? _klasses->java_mirror() : class_loader();
}
@@ -499,30 +514,33 @@ Metaspace* ClassLoaderData::metaspace_non_null() {
// to create smaller arena for Reflection class loaders also.
// The reason for the delayed allocation is because some class loaders are
// simply for delegating with no metadata of their own.
- if (_metaspace == NULL) {
- MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
- // Check again if metaspace has been allocated while we were getting this lock.
- if (_metaspace != NULL) {
- return _metaspace;
- }
- if (this == the_null_class_loader_data()) {
- assert (class_loader() == NULL, "Must be");
- set_metaspace(new Metaspace(_metaspace_lock, Metaspace::BootMetaspaceType));
- } else if (is_anonymous()) {
- if (class_loader() != NULL) {
- log_trace(class, loader, data)("is_anonymous: %s", class_loader()->klass()->internal_name());
+ // Lock-free access requires load_ptr_acquire.
+ Metaspace* metaspace = load_ptr_acquire(&_metaspace);
+ if (metaspace == NULL) {
+ MutexLockerEx ml(_metaspace_lock, Mutex::_no_safepoint_check_flag);
+ // Check if _metaspace got allocated while we were waiting for this lock.
+ if ((metaspace = _metaspace) == NULL) {
+ if (this == the_null_class_loader_data()) {
+ assert (class_loader() == NULL, "Must be");
+ metaspace = new Metaspace(_metaspace_lock, Metaspace::BootMetaspaceType);
+ } else if (is_anonymous()) {
+ if (class_loader() != NULL) {
+ log_trace(class, loader, data)("is_anonymous: %s", class_loader()->klass()->internal_name());
+ }
+ metaspace = new Metaspace(_metaspace_lock, Metaspace::AnonymousMetaspaceType);
+ } else if (class_loader()->is_a(SystemDictionary::reflect_DelegatingClassLoader_klass())) {
+ if (class_loader() != NULL) {
+ log_trace(class, loader, data)("is_reflection: %s", class_loader()->klass()->internal_name());
+ }
+ metaspace = new Metaspace(_metaspace_lock, Metaspace::ReflectionMetaspaceType);
+ } else {
+ metaspace = new Metaspace(_metaspace_lock, Metaspace::StandardMetaspaceType);
}
- set_metaspace(new Metaspace(_metaspace_lock, Metaspace::AnonymousMetaspaceType));
- } else if (class_loader()->is_a(SystemDictionary::reflect_DelegatingClassLoader_klass())) {
- if (class_loader() != NULL) {
- log_trace(class, loader, data)("is_reflection: %s", class_loader()->klass()->internal_name());
- }
- set_metaspace(new Metaspace(_metaspace_lock, Metaspace::ReflectionMetaspaceType));
- } else {
- set_metaspace(new Metaspace(_metaspace_lock, Metaspace::StandardMetaspaceType));
+ // Ensure _metaspace is stable, since it is examined without a lock
+ OrderAccess::release_store_ptr(&_metaspace, metaspace);
}
}
- return _metaspace;
+ return metaspace;
}
JNIHandleBlock* ClassLoaderData::handles() const { return _handles; }
@@ -638,6 +656,7 @@ void ClassLoaderData::dump(outputStream * const out) {
#endif // PRODUCT
void ClassLoaderData::verify() {
+ assert_locked_or_safepoint(_metaspace_lock);
oop cl = class_loader();
guarantee(this == class_loader_data(cl) || is_anonymous(), "Must be the same");
@@ -656,7 +675,8 @@ void ClassLoaderData::verify() {
}
bool ClassLoaderData::contains_klass(Klass* klass) {
- for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
+ // Lock-free access requires load_ptr_acquire
+ for (Klass* k = load_ptr_acquire(&_klasses); k != NULL; k = k->next_link()) {
if (k == klass) return true;
}
return false;
@@ -1046,6 +1066,7 @@ ClassLoaderDataGraphKlassIteratorAtomic::ClassLoaderDataGraphKlassIteratorAtomic
// Find the first klass in the CLDG.
while (cld != NULL) {
+ assert_locked_or_safepoint(cld->metaspace_lock());
klass = cld->_klasses;
if (klass != NULL) {
_next_klass = klass;
@@ -1063,6 +1084,7 @@ Klass* ClassLoaderDataGraphKlassIteratorAtomic::next_klass_in_cldg(Klass* klass)
// No more klasses in the current CLD. Time to find a new CLD.
ClassLoaderData* cld = klass->class_loader_data();
+ assert_locked_or_safepoint(cld->metaspace_lock());
while (next == NULL) {
cld = cld->next();
if (cld == NULL) {
diff --git a/hotspot/src/share/vm/classfile/classLoaderData.hpp b/hotspot/src/share/vm/classfile/classLoaderData.hpp
index b1a136a77c1..9fc9839b7cf 100644
--- a/hotspot/src/share/vm/classfile/classLoaderData.hpp
+++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp
@@ -171,8 +171,8 @@ class ClassLoaderData : public CHeapObj {
Dependencies _dependencies; // holds dependencies from this class loader
// data to others.
- Metaspace * _metaspace; // Meta-space where meta-data defined by the
- // classes in the class loader are allocated.
+ Metaspace * volatile _metaspace; // Meta-space where meta-data defined by the
+ // classes in the class loader are allocated.
Mutex* _metaspace_lock; // Locks the metaspace for allocations and setup.
bool _unloading; // true if this class loader goes away
bool _is_anonymous; // if this CLD is for an anonymous class
@@ -186,9 +186,9 @@ class ClassLoaderData : public CHeapObj {
JNIHandleBlock* _handles; // Handles to constant pool arrays, Modules, etc, which
// have the same life cycle of the corresponding ClassLoader.
- Klass* _klasses; // The classes defined by the class loader.
- PackageEntryTable* _packages; // The packages defined by the class loader.
- ModuleEntryTable* _modules; // The modules defined by the class loader.
+ Klass* volatile _klasses; // The classes defined by the class loader.
+ PackageEntryTable* volatile _packages; // The packages defined by the class loader.
+ ModuleEntryTable* volatile _modules; // The modules defined by the class loader.
// These method IDs are created for the class loader and set to NULL when the
// class loader is unloaded. They are rarely freed, only for redefine classes
@@ -216,8 +216,6 @@ class ClassLoaderData : public CHeapObj {
ClassLoaderData(Handle h_class_loader, bool is_anonymous, Dependencies dependencies);
~ClassLoaderData();
- void set_metaspace(Metaspace* m) { _metaspace = m; }
-
JNIHandleBlock* handles() const;
void set_handles(JNIHandleBlock* handles);
diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp
index b99c918996d..4c24c7349c0 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp
@@ -848,7 +848,7 @@ void java_lang_Class::create_mirror(KlassHandle k, Handle class_loader,
if (!ModuleEntryTable::javabase_defined()) {
if (fixup_module_field_list() == NULL) {
GrowableArray* list =
- new (ResourceObj::C_HEAP, mtClass) GrowableArray(500, true);
+ new (ResourceObj::C_HEAP, mtModule) GrowableArray(500, true);
set_fixup_module_field_list(list);
}
k->class_loader_data()->inc_keep_alive();
diff --git a/hotspot/src/share/vm/classfile/moduleEntry.cpp b/hotspot/src/share/vm/classfile/moduleEntry.cpp
index f26b95ab690..6d31b8210b6 100644
--- a/hotspot/src/share/vm/classfile/moduleEntry.cpp
+++ b/hotspot/src/share/vm/classfile/moduleEntry.cpp
@@ -113,7 +113,7 @@ void ModuleEntry::add_read(ModuleEntry* m) {
} else {
if (_reads == NULL) {
// Lazily create a module's reads list
- _reads = new (ResourceObj::C_HEAP, mtClass)GrowableArray(MODULE_READS_SIZE, true);
+ _reads = new (ResourceObj::C_HEAP, mtModule)GrowableArray(MODULE_READS_SIZE, true);
}
_reads->append_if_missing(m);
}
@@ -159,7 +159,7 @@ void ModuleEntry::delete_reads() {
}
ModuleEntryTable::ModuleEntryTable(int table_size)
- : Hashtable(table_size, sizeof(ModuleEntry)), _unnamed_module(NULL)
+ : Hashtable(table_size, sizeof(ModuleEntry)), _unnamed_module(NULL)
{
}
@@ -228,7 +228,7 @@ ModuleEntry* ModuleEntryTable::new_entry(unsigned int hash, Handle module_handle
Symbol* version, Symbol* location,
ClassLoaderData* loader_data) {
assert_locked_or_safepoint(Module_lock);
- ModuleEntry* entry = (ModuleEntry*) NEW_C_HEAP_ARRAY(char, entry_size(), mtClass);
+ ModuleEntry* entry = (ModuleEntry*) NEW_C_HEAP_ARRAY(char, entry_size(), mtModule);
// Initialize everything BasicHashtable would
entry->set_next(NULL);
@@ -259,7 +259,7 @@ ModuleEntry* ModuleEntryTable::new_entry(unsigned int hash, Handle module_handle
void ModuleEntryTable::add_entry(int index, ModuleEntry* new_entry) {
assert_locked_or_safepoint(Module_lock);
- Hashtable::add_entry(index, (HashtableEntry*)new_entry);
+ Hashtable::add_entry(index, (HashtableEntry*)new_entry);
}
ModuleEntry* ModuleEntryTable::locked_create_entry_or_null(Handle module_handle,
diff --git a/hotspot/src/share/vm/classfile/moduleEntry.hpp b/hotspot/src/share/vm/classfile/moduleEntry.hpp
index 87accbeab41..9b68c01d424 100644
--- a/hotspot/src/share/vm/classfile/moduleEntry.hpp
+++ b/hotspot/src/share/vm/classfile/moduleEntry.hpp
@@ -49,7 +49,7 @@ class ModuleClosure;
//
// The Mutex Module_lock is shared between ModuleEntry and PackageEntry, to lock either
// data structure.
-class ModuleEntry : public HashtableEntry {
+class ModuleEntry : public HashtableEntry {
private:
jobject _module; // java.lang.reflect.Module
jobject _pd; // java.security.ProtectionDomain, cached
@@ -127,10 +127,10 @@ public:
}
ModuleEntry* next() const {
- return (ModuleEntry*)HashtableEntry::next();
+ return (ModuleEntry*)HashtableEntry::next();
}
ModuleEntry** next_addr() {
- return (ModuleEntry**)HashtableEntry::next_addr();
+ return (ModuleEntry**)HashtableEntry::next_addr();
}
// iteration support for readability
@@ -166,7 +166,7 @@ class ModuleClosure: public StackObj {
//
// The ModuleEntryTable's lookup is lock free.
//
-class ModuleEntryTable : public Hashtable {
+class ModuleEntryTable : public Hashtable {
friend class VMStructs;
public:
enum Constants {
@@ -181,10 +181,10 @@ private:
Symbol* location, ClassLoaderData* class_loader);
void add_entry(int index, ModuleEntry* new_entry);
- int entry_size() const { return BasicHashtable::entry_size(); }
+ int entry_size() const { return BasicHashtable::entry_size(); }
ModuleEntry** bucket_addr(int i) {
- return (ModuleEntry**)Hashtable::bucket_addr(i);
+ return (ModuleEntry**)Hashtable::bucket_addr(i);
}
static unsigned int compute_hash(Symbol* name) { return ((name == NULL) ? 0 : (unsigned int)(name->identity_hash())); }
@@ -195,7 +195,7 @@ public:
~ModuleEntryTable();
ModuleEntry* bucket(int i) {
- return (ModuleEntry*)Hashtable::bucket(i);
+ return (ModuleEntry*)Hashtable::bucket(i);
}
// Create module in loader's module entry table, if already exists then
diff --git a/hotspot/src/share/vm/classfile/modules.cpp b/hotspot/src/share/vm/classfile/modules.cpp
index 7c510bc9315..313310047b3 100644
--- a/hotspot/src/share/vm/classfile/modules.cpp
+++ b/hotspot/src/share/vm/classfile/modules.cpp
@@ -145,7 +145,7 @@ static void add_to_exploded_build_list(char *module_name, TRAPS) {
const char* home = Arguments::get_java_home();
size_t len = strlen(home) + module_len + 32;
- char* path = NEW_C_HEAP_ARRAY(char, len, mtInternal);
+ char* path = NEW_C_HEAP_ARRAY(char, len, mtModule);
jio_snprintf(path, len, "%s%cmodules%c%s", home, file_sep, file_sep, module_name);
struct stat st;
// See if exploded module path exists
@@ -237,35 +237,40 @@ static void define_javabase_module(jobject module, jstring version,
// Ensure java.base's ModuleEntry has been created
assert(ModuleEntryTable::javabase_module() != NULL, "No ModuleEntry for java.base");
+ bool duplicate_javabase = false;
{
MutexLocker m1(Module_lock, THREAD);
if (ModuleEntryTable::javabase_defined()) {
- THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
- "Module java.base is already defined");
- }
+ duplicate_javabase = true;
+ } else {
- // Verify that all java.base packages created during bootstrapping are in
- // pkg_list. If any are not in pkg_list, than a non-java.base class was
- // loaded erroneously pre java.base module definition.
- package_table->verify_javabase_packages(pkg_list);
+ // Verify that all java.base packages created during bootstrapping are in
+ // pkg_list. If any are not in pkg_list, than a non-java.base class was
+ // loaded erroneously pre java.base module definition.
+ package_table->verify_javabase_packages(pkg_list);
- // loop through and add any new packages for java.base
- PackageEntry* pkg;
- for (int x = 0; x < pkg_list->length(); x++) {
- // Some of java.base's packages were added early in bootstrapping, ignore duplicates.
- if (package_table->lookup_only(pkg_list->at(x)) == NULL) {
- pkg = package_table->locked_create_entry_or_null(pkg_list->at(x), ModuleEntryTable::javabase_module());
- assert(pkg != NULL, "Unable to create a java.base package entry");
+ // loop through and add any new packages for java.base
+ PackageEntry* pkg;
+ for (int x = 0; x < pkg_list->length(); x++) {
+ // Some of java.base's packages were added early in bootstrapping, ignore duplicates.
+ if (package_table->lookup_only(pkg_list->at(x)) == NULL) {
+ pkg = package_table->locked_create_entry_or_null(pkg_list->at(x), ModuleEntryTable::javabase_module());
+ assert(pkg != NULL, "Unable to create a java.base package entry");
+ }
+ // Unable to have a GrowableArray of TempNewSymbol. Must decrement the refcount of
+ // the Symbol* that was created above for each package. The refcount was incremented
+ // by SymbolTable::new_symbol and as well by the PackageEntry creation.
+ pkg_list->at(x)->decrement_refcount();
}
- // Unable to have a GrowableArray of TempNewSymbol. Must decrement the refcount of
- // the Symbol* that was created above for each package. The refcount was incremented
- // by SymbolTable::new_symbol and as well by the PackageEntry creation.
- pkg_list->at(x)->decrement_refcount();
- }
- // Finish defining java.base's ModuleEntry
- ModuleEntryTable::finalize_javabase(module_handle, version_symbol, location_symbol);
+ // Finish defining java.base's ModuleEntry
+ ModuleEntryTable::finalize_javabase(module_handle, version_symbol, location_symbol);
+ }
+ }
+ if (duplicate_javabase) {
+ THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
+ "Module java.base is already defined");
}
log_debug(modules)("define_javabase_module(): Definition of module: java.base,"
diff --git a/hotspot/src/share/vm/classfile/packageEntry.cpp b/hotspot/src/share/vm/classfile/packageEntry.cpp
index ec6d4d08428..b7d18756fe1 100644
--- a/hotspot/src/share/vm/classfile/packageEntry.cpp
+++ b/hotspot/src/share/vm/classfile/packageEntry.cpp
@@ -34,15 +34,13 @@
#include "utilities/hashtable.inline.hpp"
#include "utilities/ostream.hpp"
-// Return true if this package is exported to m.
+// Returns true if this package specifies m as a qualified export, including through an unnamed export
bool PackageEntry::is_qexported_to(ModuleEntry* m) const {
assert(m != NULL, "No module to lookup in this package's qualified exports list");
MutexLocker m1(Module_lock);
- if (!_is_exported) {
- return false;
- } else if (_is_exported_allUnnamed && !m->is_named()) {
+ if (is_exported_allUnnamed() && !m->is_named()) {
return true;
- } else if (_qualified_exports == NULL) {
+ } else if (!has_qual_exports_list()) {
return false;
} else {
return _qualified_exports->contains(m);
@@ -52,17 +50,16 @@ bool PackageEntry::is_qexported_to(ModuleEntry* m) const {
// Add a module to the package's qualified export list.
void PackageEntry::add_qexport(ModuleEntry* m) {
assert_locked_or_safepoint(Module_lock);
- assert(_is_exported == true, "Adding a qualified export to a package that is not exported");
- if (_qualified_exports == NULL) {
+ if (!has_qual_exports_list()) {
// Lazily create a package's qualified exports list.
// Initial size is small, do not anticipate export lists to be large.
_qualified_exports =
- new (ResourceObj::C_HEAP, mtClass) GrowableArray(QUAL_EXP_SIZE, true);
+ new (ResourceObj::C_HEAP, mtModule) GrowableArray(QUAL_EXP_SIZE, true);
}
_qualified_exports->append_if_missing(m);
}
-// Set the package's exported state based on the value of the ModuleEntry.
+// Set the package's exported states based on the value of the ModuleEntry.
void PackageEntry::set_exported(ModuleEntry* m) {
MutexLocker m1(Module_lock);
if (is_unqual_exported()) {
@@ -73,7 +70,7 @@ void PackageEntry::set_exported(ModuleEntry* m) {
if (m == NULL) {
// NULL indicates the package is being unqualifiedly exported
- if (_is_exported && _qualified_exports != NULL) {
+ if (has_qual_exports_list()) {
// Legit to transition a package from being qualifiedly exported
// to unqualified. Clean up the qualified lists at the next
// safepoint.
@@ -85,11 +82,17 @@ void PackageEntry::set_exported(ModuleEntry* m) {
} else {
// Add the exported module
- _is_exported = true;
add_qexport(m);
}
}
+void PackageEntry::set_is_exported_allUnnamed() {
+ MutexLocker m1(Module_lock);
+ if (!is_unqual_exported()) {
+ _is_exported_allUnnamed = true;
+ }
+}
+
// Remove dead module entries within the package's exported list.
void PackageEntry::purge_qualified_exports() {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
@@ -124,7 +127,7 @@ void PackageEntry::delete_qualified_exports() {
}
PackageEntryTable::PackageEntryTable(int table_size)
- : Hashtable(table_size, sizeof(PackageEntry))
+ : Hashtable(table_size, sizeof(PackageEntry))
{
}
@@ -155,7 +158,7 @@ PackageEntryTable::~PackageEntryTable() {
PackageEntry* PackageEntryTable::new_entry(unsigned int hash, Symbol* name, ModuleEntry* module) {
assert_locked_or_safepoint(Module_lock);
- PackageEntry* entry = (PackageEntry*) NEW_C_HEAP_ARRAY(char, entry_size(), mtClass);
+ PackageEntry* entry = (PackageEntry*) NEW_C_HEAP_ARRAY(char, entry_size(), mtModule);
// Initialize everything BasicHashtable would
entry->set_next(NULL);
@@ -170,7 +173,7 @@ PackageEntry* PackageEntryTable::new_entry(unsigned int hash, Symbol* name, Modu
if (!module->is_named()) {
// Set the exported state to true because all packages
// within the unnamed module are unqualifiedly exported
- entry->set_exported(true);
+ entry->set_unqual_exported();
}
entry->set_module(module);
return entry;
@@ -178,7 +181,7 @@ PackageEntry* PackageEntryTable::new_entry(unsigned int hash, Symbol* name, Modu
void PackageEntryTable::add_entry(int index, PackageEntry* new_entry) {
assert_locked_or_safepoint(Module_lock);
- Hashtable::add_entry(index, (HashtableEntry*)new_entry);
+ Hashtable::add_entry(index, (HashtableEntry*)new_entry);
}
// Create package in loader's package entry table and return the entry.
@@ -248,6 +251,20 @@ void PackageEntryTable::verify_javabase_packages(GrowableArray *pkg_lis
}
+// iteration of qualified exports
+void PackageEntry::package_exports_do(ModuleClosure* const f) {
+ assert_locked_or_safepoint(Module_lock);
+ assert(f != NULL, "invariant");
+
+ if (has_qual_exports_list()) {
+ int qe_len = _qualified_exports->length();
+
+ for (int i = 0; i < qe_len; ++i) {
+ f->do_module(_qualified_exports->at(i));
+ }
+ }
+}
+
// Remove dead entries from all packages' exported list
void PackageEntryTable::purge_all_package_exports() {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
@@ -281,10 +298,10 @@ void PackageEntryTable::print(outputStream* st) {
void PackageEntry::print(outputStream* st) {
ResourceMark rm;
st->print_cr("package entry "PTR_FORMAT" name %s module %s classpath_index "
- INT32_FORMAT " is_exported %d is_exported_allUnnamed %d " "next "PTR_FORMAT,
+ INT32_FORMAT " is_exported_unqualified %d is_exported_allUnnamed %d " "next "PTR_FORMAT,
p2i(this), name()->as_C_string(),
(module()->is_named() ? module()->name()->as_C_string() : UNNAMED_MODULE),
- _classpath_index, _is_exported, _is_exported_allUnnamed, p2i(next()));
+ _classpath_index, _is_exported_unqualified, _is_exported_allUnnamed, p2i(next()));
}
void PackageEntryTable::verify() {
@@ -305,17 +322,3 @@ void PackageEntryTable::verify() {
void PackageEntry::verify() {
guarantee(name() != NULL, "A package entry must have a corresponding symbol name.");
}
-
-// iteration of qualified exports
-void PackageEntry::package_exports_do(ModuleClosure* const f) {
- assert_locked_or_safepoint(Module_lock);
- assert(f != NULL, "invariant");
-
- if (is_qual_exported()) {
- int qe_len = _qualified_exports->length();
-
- for (int i = 0; i < qe_len; ++i) {
- f->do_module(_qualified_exports->at(i));
- }
- }
-}
diff --git a/hotspot/src/share/vm/classfile/packageEntry.hpp b/hotspot/src/share/vm/classfile/packageEntry.hpp
index 00b7b9d160f..7e19908af07 100644
--- a/hotspot/src/share/vm/classfile/packageEntry.hpp
+++ b/hotspot/src/share/vm/classfile/packageEntry.hpp
@@ -34,20 +34,36 @@
// A PackageEntry basically represents a Java package. It contains:
// - Symbol* containing the package's name.
// - ModuleEntry* for this package's containing module.
-// - a flag indicating if package is exported, either qualifiedly or
-// unqualifiedly.
+// - a flag indicating if package is exported unqualifiedly
// - a flag indicating if this package is exported to all unnamed modules.
// - a growable array containing other module entries that this
// package is exported to.
//
-// Packages that are:
-// - not exported: _qualified_exports = NULL && _is_exported is false
-// - qualified exports: (_qualified_exports != NULL || _is_exported_allUnnamed is true) && _is_exported is true
-// - unqualified exports: (_qualified_exports = NULL && _is_exported_allUnnamed is false) && _is_exported is true
+// Packages can be exported in the following 3 ways:
+// - not exported: the package has not been explicitly qualified to a
+// particular module nor has it been specified to be
+// unqualifiedly exported to all modules. If all states
+// of exportedness are false, the package is considered
+// not exported.
+// - qualified exports: the package has been explicitly qualified to at least
+// one particular module or has been qualifiedly exported
+// to all unnamed modules.
+// Note: _is_exported_allUnnamed is a form of a qualified
+// export. It is equivalent to the package being
+// explicitly exported to all current and future unnamed modules.
+// - unqualified exports: the package is exported to all modules.
+//
+// A package can transition from:
+// - being not exported, to being exported either in a qualified or unqualified manner
+// - being qualifiedly exported, to unqualifiedly exported. Its exported scope is widened.
+//
+// A package cannot transition from:
+// - being unqualifiedly exported, to exported qualifiedly to a specific module.
+// This transition attempt is silently ignored in set_exported.
//
// The Mutex Module_lock is shared between ModuleEntry and PackageEntry, to lock either
// data structure.
-class PackageEntry : public HashtableEntry {
+class PackageEntry : public HashtableEntry {
private:
ModuleEntry* _module;
// Used to indicate for packages with classes loaded by the boot loader that
@@ -55,7 +71,7 @@ private:
// loaded by the boot loader from -Xbootclasspath/a in an unnamed module, it
// indicates from which class path entry.
s2 _classpath_index;
- bool _is_exported;
+ bool _is_exported_unqualified;
bool _is_exported_allUnnamed;
GrowableArray* _exported_pending_delete; // transitioned from qualified to unqualified, delete at safepoint
GrowableArray* _qualified_exports;
@@ -68,7 +84,7 @@ public:
void init() {
_module = NULL;
_classpath_index = -1;
- _is_exported = false;
+ _is_exported_unqualified = false;
_is_exported_allUnnamed = false;
_exported_pending_delete = NULL;
_qualified_exports = NULL;
@@ -83,34 +99,41 @@ public:
void set_module(ModuleEntry* m) { _module = m; }
// package's export state
- bool is_exported() const { return _is_exported; } // qualifiedly or unqualifiedly exported
+ bool is_exported() const { // qualifiedly or unqualifiedly exported
+ return (is_unqual_exported() || has_qual_exports_list() || is_exported_allUnnamed());
+ }
+ // Returns true if the package has any explicit qualified exports or is exported to all unnamed
bool is_qual_exported() const {
- return (_is_exported && (_qualified_exports != NULL || _is_exported_allUnnamed));
+ return (has_qual_exports_list() || is_exported_allUnnamed());
+ }
+ // Returns true if there are any explicit qualified exports
+ bool has_qual_exports_list() const {
+ assert(!(_qualified_exports != NULL && _is_exported_unqualified),
+ "_qualified_exports set at same time as _is_exported_unqualified");
+ return (_qualified_exports != NULL);
+ }
+ bool is_exported_allUnnamed() const {
+ assert(!(_is_exported_allUnnamed && _is_exported_unqualified),
+ "_is_exported_allUnnamed set at same time as _is_exported_unqualified");
+ return _is_exported_allUnnamed;
}
bool is_unqual_exported() const {
- return (_is_exported && (_qualified_exports == NULL && !_is_exported_allUnnamed));
+ assert(!(_qualified_exports != NULL && _is_exported_unqualified),
+ "_qualified_exports set at same time as _is_exported_unqualified");
+ assert(!(_is_exported_allUnnamed && _is_exported_unqualified),
+ "_is_exported_allUnnamed set at same time as _is_exported_unqualified");
+ return _is_exported_unqualified;
}
void set_unqual_exported() {
- _is_exported = true;
+ _is_exported_unqualified = true;
_is_exported_allUnnamed = false;
_qualified_exports = NULL;
}
bool exported_pending_delete() const { return (_exported_pending_delete != NULL); }
- void set_exported(bool e) { _is_exported = e; }
void set_exported(ModuleEntry* m);
- void set_is_exported_allUnnamed() {
- if (!is_unqual_exported()) {
- _is_exported_allUnnamed = true;
- _is_exported = true;
- }
- }
- bool is_exported_allUnnamed() const {
- assert(_is_exported || !_is_exported_allUnnamed,
- "is_allUnnamed set without is_exported being set");
- return _is_exported_allUnnamed;
- }
+ void set_is_exported_allUnnamed();
void set_classpath_index(s2 classpath_index) {
_classpath_index = classpath_index;
@@ -122,18 +145,18 @@ public:
// returns true if the package is defined in the unnamed module
bool in_unnamed_module() const { return !_module->is_named(); }
- // returns true if the package specifies m as a qualified export
+ // returns true if the package specifies m as a qualified export, including through an unnamed export
bool is_qexported_to(ModuleEntry* m) const;
// add the module to the package's qualified exports
void add_qexport(ModuleEntry* m);
PackageEntry* next() const {
- return (PackageEntry*)HashtableEntry::next();
+ return (PackageEntry*)HashtableEntry::next();
}
PackageEntry** next_addr() {
- return (PackageEntry**)HashtableEntry::next_addr();
+ return (PackageEntry**)HashtableEntry::next_addr();
}
// iteration of qualified exports
@@ -153,7 +176,7 @@ public:
// by a particular class loader. Each package is represented as a PackageEntry node.
// The PackageEntryTable's lookup is lock free.
//
-class PackageEntryTable : public Hashtable {
+class PackageEntryTable : public Hashtable {
friend class VMStructs;
public:
enum Constants {
@@ -164,10 +187,10 @@ private:
PackageEntry* new_entry(unsigned int hash, Symbol* name, ModuleEntry* module);
void add_entry(int index, PackageEntry* new_entry);
- int entry_size() const { return BasicHashtable::entry_size(); }
+ int entry_size() const { return BasicHashtable::entry_size(); }
PackageEntry** bucket_addr(int i) {
- return (PackageEntry**)Hashtable::bucket_addr(i);
+ return (PackageEntry**)Hashtable::bucket_addr(i);
}
static unsigned int compute_hash(Symbol* name) { return (unsigned int)(name->identity_hash()); }
@@ -178,7 +201,7 @@ public:
~PackageEntryTable();
PackageEntry* bucket(int i) {
- return (PackageEntry*)Hashtable::bucket(i);
+ return (PackageEntry*)Hashtable::bucket(i);
}
// Create package in loader's package entry table and return the entry.
diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp
index 7dcd740f8a5..28b79768fa5 100644
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp
@@ -1336,9 +1336,12 @@ instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik,
return nh;
}
- // Found the class, now load the superclass and interfaces. If they
- // are shared, add them to the main system dictionary and reset
- // their hierarchy references (supers, subs, and interfaces).
+ // Resolve the superclass and interfaces. They must be the same
+ // as in dump time, because the layout of depends on
+ // the specific layout of ik->super() and ik->local_interfaces().
+ //
+ // If unexpected superclass or interfaces are found, we cannot
+ // load from the shared archive.
if (ik->super() != NULL) {
Symbol* cn = ik->super()->name();
@@ -1348,6 +1351,8 @@ instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik,
// The dynamically resolved super class is not the same as the one we used during dump time,
// so we cannot use ik.
return nh;
+ } else {
+ assert(s->is_shared(), "must be");
}
}
@@ -1366,6 +1371,8 @@ instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik,
// The dynamically resolved interface class is not the same as the one we used during dump time,
// so we cannot use ik.
return nh;
+ } else {
+ assert(i->is_shared(), "must be");
}
}
diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp
index ca637011c4d..3626d881736 100644
--- a/hotspot/src/share/vm/classfile/systemDictionary.hpp
+++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp
@@ -420,9 +420,9 @@ public:
// Initialization
static void initialize(TRAPS);
- // Fast access to commonly used classes (preloaded)
+ // Checked fast access to commonly used classes - mostly preloaded
static InstanceKlass* check_klass(InstanceKlass* k) {
- assert(k != NULL, "preloaded klass not initialized");
+ assert(k != NULL, "klass not loaded");
return k;
}
diff --git a/hotspot/src/share/vm/interpreter/bytecodes.hpp b/hotspot/src/share/vm/interpreter/bytecodes.hpp
index 86e88d4b516..11290f2bf76 100644
--- a/hotspot/src/share/vm/interpreter/bytecodes.hpp
+++ b/hotspot/src/share/vm/interpreter/bytecodes.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, 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
@@ -386,15 +386,16 @@ class Bytecodes: AllStatic {
static Code non_breakpoint_code_at(const Method* method, address bcp);
// Bytecode attributes
- static bool is_defined (int code) { return 0 <= code && code < number_of_codes && flags(code, false) != 0; }
+ static bool is_valid (int code) { return 0 <= code && code < number_of_codes; }
+ static bool is_defined (int code) { return is_valid(code) && flags(code, false) != 0; }
static bool wide_is_defined(int code) { return is_defined(code) && flags(code, true) != 0; }
static const char* name (Code code) { check(code); return _name [code]; }
static BasicType result_type (Code code) { check(code); return _result_type [code]; }
static int depth (Code code) { check(code); return _depth [code]; }
// Note: Length functions must return <=0 for invalid bytecodes.
// Calling check(code) in length functions would throw an unwanted assert.
- static int length_for (Code code) { /*no check*/ return _lengths [code] & 0xF; }
- static int wide_length_for(Code code) { /*no check*/ return _lengths [code] >> 4; }
+ static int length_for (Code code) { return is_valid(code) ? _lengths[code] & 0xF : -1; }
+ static int wide_length_for(Code code) { return is_valid(code) ? _lengths[code] >> 4 : -1; }
static bool can_trap (Code code) { check(code); return has_all_flags(code, _bc_can_trap, false); }
static Code java_code (Code code) { check(code); return _java_code [code]; }
static bool can_rewrite (Code code) { check(code); return has_all_flags(code, _bc_can_rewrite, false); }
diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp
index 0544e1ca476..f0337146a82 100644
--- a/hotspot/src/share/vm/interpreter/linkResolver.cpp
+++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp
@@ -231,6 +231,7 @@ LinkInfo::LinkInfo(const constantPoolHandle& pool, int index, TRAPS) {
// Get name, signature, and static klass
_name = pool->name_ref_at(index);
_signature = pool->signature_ref_at(index);
+ _tag = pool->tag_ref_at(index);
_current_klass = KlassHandle(THREAD, pool->pool_holder());
// Coming from the constant pool always checks access
@@ -573,7 +574,7 @@ methodHandle LinkResolver::resolve_method_statically(Bytecodes::Code code,
Symbol* method_signature = pool->signature_ref_at(index);
KlassHandle current_klass(THREAD, pool->pool_holder());
LinkInfo link_info(resolved_klass, method_name, method_signature, current_klass);
- return resolve_method(link_info, /*require_methodref*/false, THREAD);
+ return resolve_method(link_info, code, THREAD);
}
LinkInfo link_info(pool, index, CHECK_NULL);
@@ -591,9 +592,9 @@ methodHandle LinkResolver::resolve_method_statically(Bytecodes::Code code,
if (code == Bytecodes::_invokeinterface) {
return resolve_interface_method(link_info, code, THREAD);
} else if (code == Bytecodes::_invokevirtual) {
- return resolve_method(link_info, /*require_methodref*/true, THREAD);
+ return resolve_method(link_info, code, THREAD);
} else if (!resolved_klass->is_interface()) {
- return resolve_method(link_info, /*require_methodref*/false, THREAD);
+ return resolve_method(link_info, code, THREAD);
} else {
return resolve_interface_method(link_info, code, THREAD);
}
@@ -663,13 +664,13 @@ void LinkResolver::check_field_loader_constraints(Symbol* field, Symbol* sig,
}
methodHandle LinkResolver::resolve_method(const LinkInfo& link_info,
- bool require_methodref, TRAPS) {
+ Bytecodes::Code code, TRAPS) {
Handle nested_exception;
KlassHandle resolved_klass = link_info.resolved_klass();
- // 1. check if methodref required, that resolved_klass is not interfacemethodref
- if (require_methodref && resolved_klass->is_interface()) {
+ // 1. For invokevirtual, cannot call an interface method
+ if (code == Bytecodes::_invokevirtual && resolved_klass->is_interface()) {
ResourceMark rm(THREAD);
char buf[200];
jio_snprintf(buf, sizeof(buf), "Found interface %s, but class was expected",
@@ -677,11 +678,20 @@ methodHandle LinkResolver::resolve_method(const LinkInfo& link_info,
THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
}
- // 2. lookup method in resolved klass and its super klasses
+ // 2. check constant pool tag for called method - must be JVM_CONSTANT_Methodref
+ if (!link_info.tag().is_invalid() && !link_info.tag().is_method()) {
+ ResourceMark rm(THREAD);
+ char buf[200];
+ jio_snprintf(buf, sizeof(buf), "Method %s must be Methodref constant", link_info.method_string());
+ THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
+ }
+
+
+ // 3. lookup method in resolved klass and its super klasses
methodHandle resolved_method = lookup_method_in_klasses(link_info, true, false, CHECK_NULL);
+ // 4. lookup method in all the interfaces implemented by the resolved klass
if (resolved_method.is_null() && !resolved_klass->is_array_klass()) { // not found in the class hierarchy
- // 3. lookup method in all the interfaces implemented by the resolved klass
resolved_method = lookup_method_in_interfaces(link_info, CHECK_NULL);
if (resolved_method.is_null()) {
@@ -694,8 +704,8 @@ methodHandle LinkResolver::resolve_method(const LinkInfo& link_info,
}
}
+ // 5. method lookup failed
if (resolved_method.is_null()) {
- // 4. method lookup failed
ResourceMark rm(THREAD);
THROW_MSG_CAUSE_(vmSymbols::java_lang_NoSuchMethodError(),
Method::name_and_sig_as_C_string(resolved_klass(),
@@ -704,7 +714,7 @@ methodHandle LinkResolver::resolve_method(const LinkInfo& link_info,
nested_exception, NULL);
}
- // 5. access checks, access checking may be turned off when calling from within the VM.
+ // 6. access checks, access checking may be turned off when calling from within the VM.
KlassHandle current_klass = link_info.current_klass();
if (link_info.check_access()) {
assert(current_klass.not_null() , "current_klass should not be null");
@@ -766,6 +776,14 @@ methodHandle LinkResolver::resolve_interface_method(const LinkInfo& link_info, B
THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
}
+ // check constant pool tag for called method - must be JVM_CONSTANT_InterfaceMethodref
+ if (!link_info.tag().is_invalid() && !link_info.tag().is_interface_method()) {
+ ResourceMark rm(THREAD);
+ char buf[200];
+ jio_snprintf(buf, sizeof(buf), "Method %s must be InterfaceMethodref constant", link_info.method_string());
+ THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
+ }
+
// lookup method in this interface or its super, java.lang.Object
// JDK8: also look for static methods
methodHandle resolved_method = lookup_method_in_klasses(link_info, false, true, CHECK_NULL);
@@ -948,19 +966,18 @@ void LinkResolver::resolve_static_call(CallInfo& result,
methodHandle resolved_method = linktime_resolve_static_method(link_info, CHECK);
// The resolved class can change as a result of this resolution.
- KlassHandle resolved_klass = KlassHandle(THREAD, resolved_method->method_holder());
+ KlassHandle resolved_klass(THREAD, resolved_method->method_holder());
- Method* save_resolved_method = resolved_method();
// Initialize klass (this should only happen if everything is ok)
if (initialize_class && resolved_klass->should_be_initialized()) {
resolved_klass->initialize(CHECK);
- // Use updated LinkInfo (to reresolve with resolved_klass as method_holder?)
+ // Use updated LinkInfo to reresolve with resolved method holder
LinkInfo new_info(resolved_klass, link_info.name(), link_info.signature(),
- link_info.current_klass(), link_info.check_access());
+ link_info.current_klass(),
+ link_info.check_access() ? LinkInfo::needs_access_check : LinkInfo::skip_access_check);
resolved_method = linktime_resolve_static_method(new_info, CHECK);
}
- assert(save_resolved_method == resolved_method(), "does this change?");
// setup result
result.set_static(resolved_klass, resolved_method, CHECK);
}
@@ -971,7 +988,7 @@ methodHandle LinkResolver::linktime_resolve_static_method(const LinkInfo& link_i
KlassHandle resolved_klass = link_info.resolved_klass();
methodHandle resolved_method;
if (!resolved_klass->is_interface()) {
- resolved_method = resolve_method(link_info, /*require_methodref*/false, CHECK_NULL);
+ resolved_method = resolve_method(link_info, Bytecodes::_invokestatic, CHECK_NULL);
} else {
resolved_method = resolve_interface_method(link_info, Bytecodes::_invokestatic, CHECK_NULL);
}
@@ -1014,7 +1031,7 @@ methodHandle LinkResolver::linktime_resolve_special_method(const LinkInfo& link_
methodHandle resolved_method;
if (!resolved_klass->is_interface()) {
- resolved_method = resolve_method(link_info, /*require_methodref*/false, CHECK_NULL);
+ resolved_method = resolve_method(link_info, Bytecodes::_invokespecial, CHECK_NULL);
} else {
resolved_method = resolve_interface_method(link_info, Bytecodes::_invokespecial, CHECK_NULL);
}
@@ -1164,7 +1181,7 @@ void LinkResolver::resolve_virtual_call(CallInfo& result, Handle recv, KlassHand
methodHandle LinkResolver::linktime_resolve_virtual_method(const LinkInfo& link_info,
TRAPS) {
// normal method resolution
- methodHandle resolved_method = resolve_method(link_info, /*require_methodref*/true, CHECK_NULL);
+ methodHandle resolved_method = resolve_method(link_info, Bytecodes::_invokevirtual, CHECK_NULL);
assert(resolved_method->name() != vmSymbols::object_initializer_name(), "should have been checked in verifier");
assert(resolved_method->name() != vmSymbols::class_initializer_name (), "should have been checked in verifier");
@@ -1173,6 +1190,7 @@ methodHandle LinkResolver::linktime_resolve_virtual_method(const LinkInfo& link_
KlassHandle resolved_klass = link_info.resolved_klass();
KlassHandle current_klass = link_info.current_klass();
+ // This is impossible, if resolve_klass is an interface, we've thrown icce in resolve_method
if (resolved_klass->is_interface() && resolved_method->is_private()) {
ResourceMark rm(THREAD);
char buf[200];
@@ -1482,7 +1500,7 @@ void LinkResolver::resolve_invoke(CallInfo& result, Handle& recv,
KlassHandle defc = attached_method->method_holder();
Symbol* name = attached_method->name();
Symbol* type = attached_method->signature();
- LinkInfo link_info(defc, name, type, KlassHandle(), /*check_access=*/false);
+ LinkInfo link_info(defc, name, type);
switch(byte) {
case Bytecodes::_invokevirtual:
resolve_virtual_call(result, recv, recv->klass(), link_info,
diff --git a/hotspot/src/share/vm/interpreter/linkResolver.hpp b/hotspot/src/share/vm/interpreter/linkResolver.hpp
index b319be9b3b6..263365b56bf 100644
--- a/hotspot/src/share/vm/interpreter/linkResolver.hpp
+++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, 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
@@ -137,20 +137,35 @@ class LinkInfo : public StackObj {
KlassHandle _resolved_klass; // class that the constant pool entry points to
KlassHandle _current_klass; // class that owns the constant pool
bool _check_access;
+ constantTag _tag;
public:
+ enum AccessCheck {
+ needs_access_check,
+ skip_access_check
+ };
+
LinkInfo(const constantPoolHandle& pool, int index, TRAPS);
+
// Condensed information from other call sites within the vm.
- LinkInfo(KlassHandle resolved_klass, Symbol* name, Symbol* signature,
- KlassHandle current_klass, bool check_access = true) :
+ LinkInfo(KlassHandle resolved_klass, Symbol* name, Symbol* signature, KlassHandle current_klass,
+ AccessCheck check_access = needs_access_check,
+ constantTag tag = JVM_CONSTANT_Invalid) :
_resolved_klass(resolved_klass),
_name(name), _signature(signature), _current_klass(current_klass),
- _check_access(check_access) {}
+ _check_access(check_access == needs_access_check), _tag(tag) {}
+
+ // Case where we just find the method and don't check access against the current class
+ LinkInfo(KlassHandle resolved_klass, Symbol*name, Symbol* signature) :
+ _resolved_klass(resolved_klass),
+ _name(name), _signature(signature), _current_klass(NULL),
+ _check_access(false), _tag(JVM_CONSTANT_Invalid) {}
// accessors
Symbol* name() const { return _name; }
Symbol* signature() const { return _signature; }
KlassHandle resolved_klass() const { return _resolved_klass; }
KlassHandle current_klass() const { return _current_klass; }
+ constantTag tag() const { return _tag; }
bool check_access() const { return _check_access; }
char* method_string() const;
@@ -192,7 +207,7 @@ class LinkResolver: AllStatic {
KlassHandle sel_klass, TRAPS);
static methodHandle resolve_interface_method(const LinkInfo& link_info, Bytecodes::Code code, TRAPS);
- static methodHandle resolve_method (const LinkInfo& link_info, bool require_methodref, TRAPS);
+ static methodHandle resolve_method (const LinkInfo& link_info, Bytecodes::Code code, TRAPS);
static methodHandle linktime_resolve_static_method (const LinkInfo& link_info, TRAPS);
static methodHandle linktime_resolve_special_method (const LinkInfo& link_info, TRAPS);
diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp
index bc56b370358..63387feb6fb 100644
--- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp
+++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp
@@ -661,8 +661,7 @@ C2V_VMENTRY(jobject, resolveMethod, (JNIEnv *, jobject, jobject receiver_jvmci_t
Symbol* h_name = method->name();
Symbol* h_signature = method->signature();
- bool check_access = true;
- LinkInfo link_info(h_resolved, h_name, h_signature, caller_klass, check_access);
+ LinkInfo link_info(h_resolved, h_name, h_signature, caller_klass);
methodHandle m;
// Only do exact lookup if receiver klass has been linked. Otherwise,
// the vtable has not been setup, and the LinkResolver will fail.
diff --git a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp
index 502b2f7c011..994220ff006 100644
--- a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp
+++ b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp
@@ -286,11 +286,12 @@ methodHandle JVMCIEnv::lookup_method(instanceKlassHandle h_accessor,
instanceKlassHandle h_holder,
Symbol* name,
Symbol* sig,
- Bytecodes::Code bc) {
+ Bytecodes::Code bc,
+ constantTag tag) {
JVMCI_EXCEPTION_CONTEXT;
LinkResolver::check_klass_accessability(h_accessor, h_holder, KILL_COMPILE_ON_FATAL_(NULL));
methodHandle dest_method;
- LinkInfo link_info(h_holder, name, sig, h_accessor, /*check_access*/true);
+ LinkInfo link_info(h_holder, name, sig, h_accessor, LinkInfo::needs_access_check, tag);
switch (bc) {
case Bytecodes::_invokestatic:
dest_method =
@@ -363,7 +364,8 @@ methodHandle JVMCIEnv::get_method_by_index_impl(const constantPoolHandle& cpool,
if (holder_is_accessible) { // Our declared holder is loaded.
instanceKlassHandle lookup = get_instance_klass_for_declared_method_holder(holder);
- methodHandle m = lookup_method(accessor, lookup, name_sym, sig_sym, bc);
+ constantTag tag = cpool->tag_ref_at(index);
+ methodHandle m = lookup_method(accessor, lookup, name_sym, sig_sym, bc, tag);
if (!m.is_null() &&
(bc == Bytecodes::_invokestatic
? InstanceKlass::cast(m->method_holder())->is_not_initialized()
diff --git a/hotspot/src/share/vm/jvmci/jvmciEnv.hpp b/hotspot/src/share/vm/jvmci/jvmciEnv.hpp
index 833074326bf..2c884494db8 100644
--- a/hotspot/src/share/vm/jvmci/jvmciEnv.hpp
+++ b/hotspot/src/share/vm/jvmci/jvmciEnv.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -130,7 +130,8 @@ private:
instanceKlassHandle holder,
Symbol* name,
Symbol* sig,
- Bytecodes::Code bc);
+ Bytecodes::Code bc,
+ constantTag tag);
private:
diff --git a/hotspot/src/share/vm/logging/logConfiguration.cpp b/hotspot/src/share/vm/logging/logConfiguration.cpp
index f09b3b56596..922d4b53c06 100644
--- a/hotspot/src/share/vm/logging/logConfiguration.cpp
+++ b/hotspot/src/share/vm/logging/logConfiguration.cpp
@@ -415,7 +415,9 @@ void LogConfiguration::describe_available(outputStream* out){
void LogConfiguration::describe_current_configuration(outputStream* out){
out->print_cr("Log output configuration:");
for (size_t i = 0; i < _n_outputs; i++) {
- out->print("#" SIZE_FORMAT ": %s %s ", i, _outputs[i]->name(), _outputs[i]->config_string());
+ out->print("#" SIZE_FORMAT ": %s ", i, _outputs[i]->name());
+ out->print_raw(_outputs[i]->config_string());
+ out->print(" ");
char delimiter[2] = {0};
for (size_t d = 0; d < LogDecorators::Count; d++) {
LogDecorators::Decorator decorator = static_cast(d);
diff --git a/hotspot/src/share/vm/memory/allocation.hpp b/hotspot/src/share/vm/memory/allocation.hpp
index ec0e53977d6..5d9e7c830f6 100644
--- a/hotspot/src/share/vm/memory/allocation.hpp
+++ b/hotspot/src/share/vm/memory/allocation.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, 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
@@ -144,8 +144,9 @@ enum MemoryType {
mtTracing = 0x0E, // memory used for Tracing
mtLogging = 0x0F, // memory for logging
mtArguments = 0x10, // memory for argument processing
- mtNone = 0x11, // undefined
- mt_number_of_types = 0x12 // number of memory types (mtDontTrack
+ mtModule = 0x11, // memory for module processing
+ mtNone = 0x12, // undefined
+ mt_number_of_types = 0x13 // number of memory types (mtDontTrack
// is not included as validate type)
};
diff --git a/hotspot/src/share/vm/memory/metaspaceShared.cpp b/hotspot/src/share/vm/memory/metaspaceShared.cpp
index b975e9e1327..02f025a9630 100644
--- a/hotspot/src/share/vm/memory/metaspaceShared.cpp
+++ b/hotspot/src/share/vm/memory/metaspaceShared.cpp
@@ -191,7 +191,12 @@ static void rewrite_nofast_bytecode(Method* method) {
case Bytecodes::_getfield: *bcs.bcp() = Bytecodes::_nofast_getfield; break;
case Bytecodes::_putfield: *bcs.bcp() = Bytecodes::_nofast_putfield; break;
case Bytecodes::_aload_0: *bcs.bcp() = Bytecodes::_nofast_aload_0; break;
- case Bytecodes::_iload: *bcs.bcp() = Bytecodes::_nofast_iload; break;
+ case Bytecodes::_iload: {
+ if (!bcs.is_wide()) {
+ *bcs.bcp() = Bytecodes::_nofast_iload;
+ }
+ break;
+ }
default: break;
}
}
diff --git a/hotspot/src/share/vm/oops/constantPool.cpp b/hotspot/src/share/vm/oops/constantPool.cpp
index a291dc5d3f8..29110089d3b 100644
--- a/hotspot/src/share/vm/oops/constantPool.cpp
+++ b/hotspot/src/share/vm/oops/constantPool.cpp
@@ -417,6 +417,19 @@ int ConstantPool::impl_name_and_type_ref_index_at(int which, bool uncached) {
return extract_high_short_from_int(ref_index);
}
+constantTag ConstantPool::impl_tag_ref_at(int which, bool uncached) {
+ int pool_index = which;
+ if (!uncached && cache() != NULL) {
+ if (ConstantPool::is_invokedynamic_index(which)) {
+ // Invokedynamic index is index into resolved_references
+ pool_index = invokedynamic_cp_cache_entry_at(which)->constant_pool_index();
+ } else {
+ // change byte-ordering and go via cache
+ pool_index = remap_instruction_operand_from_cache(which);
+ }
+ }
+ return tag_at(pool_index);
+}
int ConstantPool::impl_klass_ref_index_at(int which, bool uncached) {
guarantee(!ConstantPool::is_invokedynamic_index(which),
@@ -672,6 +685,7 @@ oop ConstantPool::resolve_constant_at_impl(const constantPoolHandle& this_cp, in
int callee_index = this_cp->method_handle_klass_index_at(index);
Symbol* name = this_cp->method_handle_name_ref_at(index);
Symbol* signature = this_cp->method_handle_signature_ref_at(index);
+ constantTag m_tag = this_cp->tag_at(this_cp->method_handle_index_at(index));
{ ResourceMark rm(THREAD);
log_debug(class, resolve)("resolve JVM_CONSTANT_MethodHandle:%d [%d/%d/%d] %s.%s",
ref_kind, index, this_cp->method_handle_index_at(index),
@@ -681,6 +695,15 @@ oop ConstantPool::resolve_constant_at_impl(const constantPoolHandle& this_cp, in
{ Klass* k = klass_at_impl(this_cp, callee_index, true, CHECK_NULL);
callee = KlassHandle(THREAD, k);
}
+ if ((callee->is_interface() && m_tag.is_method()) ||
+ (!callee->is_interface() && m_tag.is_interface_method())) {
+ ResourceMark rm(THREAD);
+ char buf[200];
+ jio_snprintf(buf, sizeof(buf), "Inconsistent constant data for %s.%s%s at index %d",
+ callee->name()->as_C_string(), name->as_C_string(), signature->as_C_string(), index);
+ THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
+ }
+
KlassHandle klass(THREAD, this_cp->pool_holder());
Handle value = SystemDictionary::link_method_handle_constant(klass, ref_kind,
callee, name, signature,
diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp
index 75bca62917b..38a71f525d2 100644
--- a/hotspot/src/share/vm/oops/constantPool.hpp
+++ b/hotspot/src/share/vm/oops/constantPool.hpp
@@ -643,6 +643,8 @@ class ConstantPool : public Metadata {
int remap_instruction_operand_from_cache(int operand); // operand must be biased by CPCACHE_INDEX_TAG
+ constantTag tag_ref_at(int cp_cache_index) { return impl_tag_ref_at(cp_cache_index, false); }
+
// Lookup for entries consisting of (name_index, signature_index)
int name_ref_index_at(int which_nt); // == low-order jshort of name_and_type_at(which_nt)
int signature_ref_index_at(int which_nt); // == high-order jshort of name_and_type_at(which_nt)
@@ -763,6 +765,7 @@ class ConstantPool : public Metadata {
Symbol* impl_signature_ref_at(int which, bool uncached);
int impl_klass_ref_index_at(int which, bool uncached);
int impl_name_and_type_ref_index_at(int which, bool uncached);
+ constantTag impl_tag_ref_at(int which, bool uncached);
// Used while constructing constant pool (only by ClassFileParser)
jint klass_index_at(int which) {
diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp
index 074fc0039d0..02161471b01 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp
@@ -1104,21 +1104,21 @@ void InstanceKlass::call_class_initializer_impl(instanceKlassHandle this_k, TRAP
void InstanceKlass::mask_for(const methodHandle& method, int bci,
InterpreterOopMap* entry_for) {
- // Dirty read, then double-check under a lock.
- if (_oop_map_cache == NULL) {
- // Otherwise, allocate a new one.
+ // Lazily create the _oop_map_cache at first request
+ // Lock-free access requires load_ptr_acquire.
+ OopMapCache* oop_map_cache =
+ static_cast(OrderAccess::load_ptr_acquire(&_oop_map_cache));
+ if (oop_map_cache == NULL) {
MutexLocker x(OopMapCacheAlloc_lock);
- // First time use. Allocate a cache in C heap
- if (_oop_map_cache == NULL) {
- // Release stores from OopMapCache constructor before assignment
- // to _oop_map_cache. C++ compilers on ppc do not emit the
- // required memory barrier only because of the volatile
- // qualifier of _oop_map_cache.
- OrderAccess::release_store_ptr(&_oop_map_cache, new OopMapCache());
+ // Check if _oop_map_cache was allocated while we were waiting for this lock
+ if ((oop_map_cache = _oop_map_cache) == NULL) {
+ oop_map_cache = new OopMapCache();
+ // Ensure _oop_map_cache is stable, since it is examined without a lock
+ OrderAccess::release_store_ptr(&_oop_map_cache, oop_map_cache);
}
}
- // _oop_map_cache is constant after init; lookup below does is own locking.
- _oop_map_cache->lookup(method, bci, entry_for);
+ // _oop_map_cache is constant after init; lookup below does its own locking.
+ oop_map_cache->lookup(method, bci, entry_for);
}
diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp
index 7b1782a2904..d21c0fa30e4 100644
--- a/hotspot/src/share/vm/prims/methodHandles.cpp
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp
@@ -713,12 +713,16 @@ Handle MethodHandles::resolve_MemberName(Handle mname, KlassHandle caller, TRAPS
TempNewSymbol type = lookup_signature(type_str(), (mh_invoke_id != vmIntrinsics::_none), CHECK_(empty));
if (type == NULL) return empty; // no such signature exists in the VM
+ LinkInfo::AccessCheck access_check = caller.not_null() ?
+ LinkInfo::needs_access_check :
+ LinkInfo::skip_access_check;
+
// Time to do the lookup.
switch (flags & ALL_KINDS) {
case IS_METHOD:
{
CallInfo result;
- LinkInfo link_info(defc, name, type, caller, caller.not_null());
+ LinkInfo link_info(defc, name, type, caller, access_check);
{
assert(!HAS_PENDING_EXCEPTION, "");
if (ref_kind == JVM_REF_invokeStatic) {
@@ -755,7 +759,7 @@ Handle MethodHandles::resolve_MemberName(Handle mname, KlassHandle caller, TRAPS
case IS_CONSTRUCTOR:
{
CallInfo result;
- LinkInfo link_info(defc, name, type, caller, caller.not_null());
+ LinkInfo link_info(defc, name, type, caller, access_check);
{
assert(!HAS_PENDING_EXCEPTION, "");
if (name == vmSymbols::object_initializer_name()) {
@@ -776,7 +780,7 @@ Handle MethodHandles::resolve_MemberName(Handle mname, KlassHandle caller, TRAPS
fieldDescriptor result; // find_field initializes fd if found
{
assert(!HAS_PENDING_EXCEPTION, "");
- LinkInfo link_info(defc, name, type, caller, /*check_access*/false);
+ LinkInfo link_info(defc, name, type, caller, LinkInfo::skip_access_check);
LinkResolver::resolve_field(result, link_info, Bytecodes::_nop, false, THREAD);
if (HAS_PENDING_EXCEPTION) {
return empty;
diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp
index 71116760c07..e129fbafc41 100644
--- a/hotspot/src/share/vm/prims/unsafe.cpp
+++ b/hotspot/src/share/vm/prims/unsafe.cpp
@@ -356,19 +356,6 @@ UNSAFE_ENTRY(jobject, Unsafe_GetUncompressedObject(JNIEnv *env, jobject unsafe,
return JNIHandles::make_local(env, v);
} UNSAFE_END
-UNSAFE_ENTRY(jclass, Unsafe_GetJavaMirror(JNIEnv *env, jobject unsafe, jlong metaspace_klass)) {
- Klass* klass = (Klass*) (address) metaspace_klass;
-
- return (jclass) JNIHandles::make_local(klass->java_mirror());
-} UNSAFE_END
-
-UNSAFE_ENTRY(jlong, Unsafe_GetKlassPointer(JNIEnv *env, jobject unsafe, jobject obj)) {
- oop o = JNIHandles::resolve(obj);
- jlong klass = (jlong) (address) o->klass();
-
- return klass;
-} UNSAFE_END
-
#ifndef SUPPORTS_NATIVE_CX8
// VM_Version::supports_cx8() is a surrogate for 'supports atomic long memory ops'.
@@ -1152,8 +1139,6 @@ static JNINativeMethod jdk_internal_misc_Unsafe_methods[] = {
{CC "putObjectVolatile",CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_PutObjectVolatile)},
{CC "getUncompressedObject", CC "(" ADR ")" OBJ, FN_PTR(Unsafe_GetUncompressedObject)},
- {CC "getJavaMirror", CC "(" ADR ")" CLS, FN_PTR(Unsafe_GetJavaMirror)},
- {CC "getKlassPointer", CC "(" OBJ ")" ADR, FN_PTR(Unsafe_GetKlassPointer)},
DECLARE_GETPUTOOP(Boolean, Z),
DECLARE_GETPUTOOP(Byte, B),
diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp
index dc354b40ffb..a55fd6340c6 100644
--- a/hotspot/src/share/vm/prims/whitebox.cpp
+++ b/hotspot/src/share/vm/prims/whitebox.cpp
@@ -278,6 +278,49 @@ WB_ENTRY(jint, WB_StressVirtualSpaceResize(JNIEnv* env, jobject o,
(size_t) magnitude, (size_t) iterations);
WB_END
+static const jint serial_code = 1;
+static const jint parallel_code = 2;
+static const jint cms_code = 4;
+static const jint g1_code = 8;
+
+WB_ENTRY(jint, WB_CurrentGC(JNIEnv* env, jobject o, jobject obj))
+ if (UseSerialGC) {
+ return serial_code;
+ } else if (UseParallelGC || UseParallelOldGC) {
+ return parallel_code;
+ } if (UseConcMarkSweepGC) {
+ return cms_code;
+ } else if (UseG1GC) {
+ return g1_code;
+ }
+ ShouldNotReachHere();
+ return 0;
+WB_END
+
+WB_ENTRY(jint, WB_AllSupportedGC(JNIEnv* env, jobject o, jobject obj))
+#if INCLUDE_ALL_GCS
+ return serial_code | parallel_code | cms_code | g1_code;
+#else
+ return serial_code;
+#endif // INCLUDE_ALL_GCS
+WB_END
+
+WB_ENTRY(jboolean, WB_GCSelectedByErgo(JNIEnv* env, jobject o, jobject obj))
+ if (UseSerialGC) {
+ return FLAG_IS_ERGO(UseSerialGC);
+ } else if (UseParallelGC) {
+ return FLAG_IS_ERGO(UseParallelGC);
+ } else if (UseParallelOldGC) {
+ return FLAG_IS_ERGO(UseParallelOldGC);
+ } else if (UseConcMarkSweepGC) {
+ return FLAG_IS_ERGO(UseConcMarkSweepGC);
+ } else if (UseG1GC) {
+ return FLAG_IS_ERGO(UseG1GC);
+ }
+ ShouldNotReachHere();
+ return false;
+WB_END
+
WB_ENTRY(jboolean, WB_isObjectInOldGen(JNIEnv* env, jobject o, jobject obj))
oop p = JNIHandles::resolve(obj);
#if INCLUDE_ALL_GCS
@@ -1833,7 +1876,10 @@ static JNINativeMethod methods[] = {
{CC"clearInlineCaches0", CC"(Z)V", (void*)&WB_ClearInlineCaches },
{CC"addCompilerDirective", CC"(Ljava/lang/String;)I",
(void*)&WB_AddCompilerDirective },
- {CC"removeCompilerDirective", CC"(I)V", (void*)&WB_RemoveCompilerDirective },
+ {CC"removeCompilerDirective", CC"(I)V", (void*)&WB_RemoveCompilerDirective },
+ {CC"currentGC", CC"()I", (void*)&WB_CurrentGC},
+ {CC"allSupportedGC", CC"()I", (void*)&WB_AllSupportedGC},
+ {CC"gcSelectedByErgo", CC"()Z", (void*)&WB_GCSelectedByErgo},
};
#undef CC
diff --git a/hotspot/src/share/vm/runtime/javaCalls.cpp b/hotspot/src/share/vm/runtime/javaCalls.cpp
index 686a2c566ab..34a0787eaac 100644
--- a/hotspot/src/share/vm/runtime/javaCalls.cpp
+++ b/hotspot/src/share/vm/runtime/javaCalls.cpp
@@ -183,7 +183,7 @@ void JavaCalls::call_virtual(JavaValue* result, KlassHandle spec_klass, Symbol*
CallInfo callinfo;
Handle receiver = args->receiver();
KlassHandle recvrKlass(THREAD, receiver.is_null() ? (Klass*)NULL : receiver->klass());
- LinkInfo link_info(spec_klass, name, signature, KlassHandle(), /*check_access*/false);
+ LinkInfo link_info(spec_klass, name, signature);
LinkResolver::resolve_virtual_call(
callinfo, receiver, recvrKlass, link_info, true, CHECK);
methodHandle method = callinfo.selected_method();
@@ -220,7 +220,7 @@ void JavaCalls::call_virtual(JavaValue* result, Handle receiver, KlassHandle spe
void JavaCalls::call_special(JavaValue* result, KlassHandle klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) {
CallInfo callinfo;
- LinkInfo link_info(klass, name, signature, KlassHandle(), /*check_access*/false);
+ LinkInfo link_info(klass, name, signature);
LinkResolver::resolve_special_call(callinfo, link_info, CHECK);
methodHandle method = callinfo.selected_method();
assert(method.not_null(), "should have thrown exception");
@@ -255,7 +255,7 @@ void JavaCalls::call_special(JavaValue* result, Handle receiver, KlassHandle kla
void JavaCalls::call_static(JavaValue* result, KlassHandle klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) {
CallInfo callinfo;
- LinkInfo link_info(klass, name, signature, KlassHandle(), /*check_access*/false);
+ LinkInfo link_info(klass, name, signature);
LinkResolver::resolve_static_call(callinfo, link_info, true, CHECK);
methodHandle method = callinfo.selected_method();
assert(method.not_null(), "should have thrown exception");
diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp
index ec103436269..8acc60b24b2 100644
--- a/hotspot/src/share/vm/runtime/os.cpp
+++ b/hotspot/src/share/vm/runtime/os.cpp
@@ -1336,12 +1336,10 @@ bool os::stack_shadow_pages_available(Thread *thread, const methodHandle& method
const int framesize_in_bytes =
Interpreter::size_top_interpreter_activation(method()) * wordSize;
- assert((thread->stack_base() - thread->stack_size()) +
- (JavaThread::stack_guard_zone_size() +
- JavaThread::stack_shadow_zone_size() + framesize_in_bytes) ==
- ((JavaThread*)thread)->stack_overflow_limit() + framesize_in_bytes, "sanity");
+ address limit = ((JavaThread*)thread)->stack_end() +
+ (JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size());
- return (sp > ((JavaThread*)thread)->stack_overflow_limit() + framesize_in_bytes);
+ return sp > (limit + framesize_in_bytes);
}
size_t os::page_size_for_region(size_t region_size, size_t min_pages, bool must_be_aligned) {
diff --git a/hotspot/src/share/vm/runtime/reflection.cpp b/hotspot/src/share/vm/runtime/reflection.cpp
index f81deb6a374..867c831a165 100644
--- a/hotspot/src/share/vm/runtime/reflection.cpp
+++ b/hotspot/src/share/vm/runtime/reflection.cpp
@@ -998,7 +998,7 @@ static methodHandle resolve_interface_call(instanceKlassHandle klass,
Symbol* signature = method->signature();
Symbol* name = method->name();
LinkResolver::resolve_interface_call(info, receiver, recv_klass,
- LinkInfo(klass, name, signature, KlassHandle(), false),
+ LinkInfo(klass, name, signature),
true,
CHECK_(methodHandle()));
return info.selected_method();
diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp
index a2e5a6e848b..46828d4cab2 100644
--- a/hotspot/src/share/vm/runtime/thread.hpp
+++ b/hotspot/src/share/vm/runtime/thread.hpp
@@ -1371,10 +1371,10 @@ class JavaThread: public Thread {
// | reserved pages |
// | |
// -- <-- stack_reserved_zone_base() --- ---
- // /|\ shadow
+ // /|\ shadow <-- stack_overflow_limit() (somewhere in here)
// | zone
// \|/ size
- // some untouched memory --- <-- stack_overflow_limit()
+ // some untouched memory ---
//
//
// --
@@ -1522,9 +1522,8 @@ class JavaThread: public Thread {
address stack_overflow_limit() { return _stack_overflow_limit; }
void set_stack_overflow_limit() {
- _stack_overflow_limit = stack_end() +
- (JavaThread::stack_guard_zone_size() +
- JavaThread::stack_shadow_zone_size());
+ _stack_overflow_limit =
+ stack_end() + MAX2(JavaThread::stack_guard_zone_size(), JavaThread::stack_shadow_zone_size());
}
// Misc. accessors/mutators
diff --git a/hotspot/src/share/vm/runtime/vm_operations.cpp b/hotspot/src/share/vm/runtime/vm_operations.cpp
index 3ac2816775a..26a8cbe647b 100644
--- a/hotspot/src/share/vm/runtime/vm_operations.cpp
+++ b/hotspot/src/share/vm/runtime/vm_operations.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, 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
@@ -201,10 +201,12 @@ void VM_Verify::doit() {
}
bool VM_PrintThreads::doit_prologue() {
- assert(Thread::current()->is_Java_thread(), "just checking");
-
// Make sure AbstractOwnableSynchronizer is loaded
- java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(JavaThread::current());
+ JavaThread* jt = JavaThread::current();
+ java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(jt);
+ if (jt->has_pending_exception()) {
+ return false;
+ }
// Get Heap_lock if concurrent locks will be dumped
if (_print_concurrent_locks) {
@@ -240,11 +242,13 @@ VM_FindDeadlocks::~VM_FindDeadlocks() {
}
bool VM_FindDeadlocks::doit_prologue() {
- assert(Thread::current()->is_Java_thread(), "just checking");
-
- // Load AbstractOwnableSynchronizer class
if (_concurrent_locks) {
- java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(JavaThread::current());
+ // Make sure AbstractOwnableSynchronizer is loaded
+ JavaThread* jt = JavaThread::current();
+ java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(jt);
+ if (jt->has_pending_exception()) {
+ return false;
+ }
}
return true;
@@ -298,10 +302,12 @@ VM_ThreadDump::VM_ThreadDump(ThreadDumpResult* result,
}
bool VM_ThreadDump::doit_prologue() {
- assert(Thread::current()->is_Java_thread(), "just checking");
-
- // Load AbstractOwnableSynchronizer class before taking thread snapshots
- java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(JavaThread::current());
+ // Make sure AbstractOwnableSynchronizer is loaded
+ JavaThread* jt = JavaThread::current();
+ java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(jt);
+ if (jt->has_pending_exception()) {
+ return false;
+ }
if (_with_locked_synchronizers) {
// Acquire Heap_lock to dump concurrent locks
diff --git a/hotspot/src/share/vm/services/nmtCommon.cpp b/hotspot/src/share/vm/services/nmtCommon.cpp
index 8633bbe301e..c1ec5c6971e 100644
--- a/hotspot/src/share/vm/services/nmtCommon.cpp
+++ b/hotspot/src/share/vm/services/nmtCommon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -42,6 +42,7 @@ const char* NMTUtil::_memory_type_names[] = {
"Tracing",
"Logging",
"Arguments",
+ "Module",
"Unknown"
};
diff --git a/hotspot/src/share/vm/services/virtualMemoryTracker.cpp b/hotspot/src/share/vm/services/virtualMemoryTracker.cpp
index 16f249b82e9..964af28bf5b 100644
--- a/hotspot/src/share/vm/services/virtualMemoryTracker.cpp
+++ b/hotspot/src/share/vm/services/virtualMemoryTracker.cpp
@@ -23,7 +23,10 @@
*/
#include "precompiled.hpp"
+#include "runtime/atomic.inline.hpp"
+#include "runtime/os.hpp"
#include "runtime/threadCritical.hpp"
+#include "services/memTracker.hpp"
#include "services/virtualMemoryTracker.hpp"
size_t VirtualMemorySummary::_snapshot[CALC_OBJ_SIZE_IN_TYPE(VirtualMemorySnapshot, size_t)];
@@ -52,46 +55,41 @@ bool ReservedMemoryRegion::add_committed_region(address addr, size_t size, const
if (all_committed()) return true;
CommittedMemoryRegion committed_rgn(addr, size, stack);
- LinkedListNode* node = _committed_regions.find_node(committed_rgn);
- if (node != NULL) {
+ LinkedListNode* node = _committed_regions.head();
+
+ while (node != NULL) {
CommittedMemoryRegion* rgn = node->data();
if (rgn->same_region(addr, size)) {
return true;
}
if (rgn->adjacent_to(addr, size)) {
- // check if the next region covers this committed region,
- // the regions may not be merged due to different call stacks
- LinkedListNode* next =
- node->next();
- if (next != NULL && next->data()->contain_region(addr, size)) {
- if (next->data()->same_region(addr, size)) {
- next->data()->set_call_stack(stack);
- }
- return true;
- }
- if (rgn->call_stack()->equals(stack)) {
+ // special case to expand prior region if there is no next region
+ LinkedListNode* next = node->next();
+ if (next == NULL && rgn->call_stack()->equals(stack)) {
VirtualMemorySummary::record_uncommitted_memory(rgn->size(), flag());
// the two adjacent regions have the same call stack, merge them
rgn->expand_region(addr, size);
VirtualMemorySummary::record_committed_memory(rgn->size(), flag());
return true;
}
- VirtualMemorySummary::record_committed_memory(size, flag());
- if (rgn->base() > addr) {
- return _committed_regions.insert_before(committed_rgn, node) != NULL;
- } else {
- return _committed_regions.insert_after(committed_rgn, node) != NULL;
}
+
+ if (rgn->overlap_region(addr, size)) {
+ // Clear a space for this region in the case it overlaps with any regions.
+ remove_uncommitted_region(addr, size);
+ break; // commit below
}
- assert(rgn->contain_region(addr, size), "Must cover this region");
- return true;
- } else {
+ if (rgn->end() >= addr + size){
+ break;
+ }
+ node = node->next();
+ }
+
// New committed region
VirtualMemorySummary::record_committed_memory(size, flag());
return add_committed_region(committed_rgn);
}
-}
void ReservedMemoryRegion::set_all_committed(bool b) {
if (all_committed() != b) {
@@ -175,48 +173,52 @@ bool ReservedMemoryRegion::remove_uncommitted_region(address addr, size_t sz) {
}
}
} else {
- // we have to walk whole list to remove the committed regions in
- // specified range
- LinkedListNode* head =
- _committed_regions.head();
- LinkedListNode* prev = NULL;
- VirtualMemoryRegion uncommitted_rgn(addr, sz);
+ CommittedMemoryRegion del_rgn(addr, sz, *call_stack());
+ address end = addr + sz;
- while (head != NULL && !uncommitted_rgn.is_empty()) {
- CommittedMemoryRegion* crgn = head->data();
- // this committed region overlaps to region to uncommit
- if (crgn->overlap_region(uncommitted_rgn.base(), uncommitted_rgn.size())) {
- if (crgn->same_region(uncommitted_rgn.base(), uncommitted_rgn.size())) {
- // find matched region, remove the node will do
- VirtualMemorySummary::record_uncommitted_memory(uncommitted_rgn.size(), flag());
+ LinkedListNode* head = _committed_regions.head();
+ LinkedListNode* prev = NULL;
+ CommittedMemoryRegion* crgn;
+
+ while (head != NULL) {
+ crgn = head->data();
+
+ if (crgn->same_region(addr, sz)) {
+ VirtualMemorySummary::record_uncommitted_memory(crgn->size(), flag());
_committed_regions.remove_after(prev);
return true;
- } else if (crgn->contain_region(uncommitted_rgn.base(), uncommitted_rgn.size())) {
- // this committed region contains whole uncommitted region
- VirtualMemorySummary::record_uncommitted_memory(uncommitted_rgn.size(), flag());
- return remove_uncommitted_region(head, uncommitted_rgn.base(), uncommitted_rgn.size());
- } else if (uncommitted_rgn.contain_region(crgn->base(), crgn->size())) {
- // this committed region has been uncommitted
- size_t exclude_size = crgn->end() - uncommitted_rgn.base();
- uncommitted_rgn.exclude_region(uncommitted_rgn.base(), exclude_size);
+ }
+
+ // del_rgn contains crgn
+ if (del_rgn.contain_region(crgn->base(), crgn->size())) {
VirtualMemorySummary::record_uncommitted_memory(crgn->size(), flag());
- LinkedListNode* tmp = head;
head = head->next();
_committed_regions.remove_after(prev);
- continue;
- } else if (crgn->contain_address(uncommitted_rgn.base())) {
- size_t toUncommitted = crgn->end() - uncommitted_rgn.base();
- crgn->exclude_region(uncommitted_rgn.base(), toUncommitted);
- uncommitted_rgn.exclude_region(uncommitted_rgn.base(), toUncommitted);
- VirtualMemorySummary::record_uncommitted_memory(toUncommitted, flag());
- } else if (uncommitted_rgn.contain_address(crgn->base())) {
- size_t toUncommitted = uncommitted_rgn.end() - crgn->base();
- crgn->exclude_region(crgn->base(), toUncommitted);
- uncommitted_rgn.exclude_region(uncommitted_rgn.end() - toUncommitted,
- toUncommitted);
- VirtualMemorySummary::record_uncommitted_memory(toUncommitted, flag());
+ continue; // don't update head or prev
}
+
+ // Found addr in the current crgn. There are 2 subcases:
+ if (crgn->contain_address(addr)) {
+
+ // (1) Found addr+size in current crgn as well. (del_rgn is contained in crgn)
+ if (crgn->contain_address(end - 1)) {
+ VirtualMemorySummary::record_uncommitted_memory(sz, flag());
+ return remove_uncommitted_region(head, addr, sz); // done!
+ } else {
+ // (2) Did not find del_rgn's end in crgn.
+ size_t size = crgn->end() - del_rgn.base();
+ crgn->exclude_region(addr, size);
+ VirtualMemorySummary::record_uncommitted_memory(size, flag());
}
+
+ } else if (crgn->contain_address(end - 1)) {
+ // Found del_rgn's end, but not its base addr.
+ size_t size = del_rgn.end() - crgn->base();
+ crgn->exclude_region(crgn->base(), size);
+ VirtualMemorySummary::record_uncommitted_memory(size, flag());
+ return true; // should be done if the list is sorted properly!
+ }
+
prev = head;
head = head->next();
}
@@ -386,7 +388,8 @@ bool VirtualMemoryTracker::add_committed_region(address addr, size_t size,
assert(reserved_rgn != NULL, "No reserved region");
assert(reserved_rgn->contain_region(addr, size), "Not completely contained");
- return reserved_rgn->add_committed_region(addr, size, stack);
+ bool result = reserved_rgn->add_committed_region(addr, size, stack);
+ return result;
}
bool VirtualMemoryTracker::remove_uncommitted_region(address addr, size_t size) {
@@ -398,7 +401,8 @@ bool VirtualMemoryTracker::remove_uncommitted_region(address addr, size_t size)
ReservedMemoryRegion* reserved_rgn = _reserved_regions->find(rgn);
assert(reserved_rgn != NULL, "No reserved region");
assert(reserved_rgn->contain_region(addr, size), "Not completely contained");
- return reserved_rgn->remove_uncommitted_region(addr, size);
+ bool result = reserved_rgn->remove_uncommitted_region(addr, size);
+ return result;
}
bool VirtualMemoryTracker::remove_released_region(address addr, size_t size) {
@@ -488,5 +492,3 @@ bool VirtualMemoryTracker::transition(NMT_TrackingLevel from, NMT_TrackingLevel
return true;
}
-
-
diff --git a/hotspot/src/share/vm/services/virtualMemoryTracker.hpp b/hotspot/src/share/vm/services/virtualMemoryTracker.hpp
index d2f8abdcaeb..02d21bd53bb 100644
--- a/hotspot/src/share/vm/services/virtualMemoryTracker.hpp
+++ b/hotspot/src/share/vm/services/virtualMemoryTracker.hpp
@@ -261,8 +261,7 @@ class CommittedMemoryRegion : public VirtualMemoryRegion {
VirtualMemoryRegion(addr, size), _stack(stack) { }
inline int compare(const CommittedMemoryRegion& rgn) const {
- if (overlap_region(rgn.base(), rgn.size()) ||
- adjacent_to (rgn.base(), rgn.size())) {
+ if (overlap_region(rgn.base(), rgn.size())) {
return 0;
} else {
if (base() == rgn.base()) {
diff --git a/hotspot/src/share/vm/services/writeableFlags.cpp b/hotspot/src/share/vm/services/writeableFlags.cpp
index 3541fddaece..fab21ba346c 100644
--- a/hotspot/src/share/vm/services/writeableFlags.cpp
+++ b/hotspot/src/share/vm/services/writeableFlags.cpp
@@ -93,12 +93,12 @@ static void print_flag_error_message_if_needed(Flag::Error error, const char* na
// set a boolean global flag
Flag::Error WriteableFlags::set_bool_flag(const char* name, const char* arg, Flag::Flags origin, FormatBuffer<80>& err_msg) {
- int value = true;
-
- if (sscanf(arg, "%d", &value)) {
- return set_bool_flag(name, value != 0, origin, err_msg);
+ if ((strcasecmp(arg, "true") == 0) || (*arg == '1' && *(arg + 1) == 0)) {
+ return set_bool_flag(name, true, origin, err_msg);
+ } else if ((strcasecmp(arg, "false") == 0) || (*arg == '0' && *(arg + 1) == 0)) {
+ return set_bool_flag(name, false, origin, err_msg);
}
- err_msg.print("flag value must be a boolean (1 or 0)");
+ err_msg.print("flag value must be a boolean (1/0 or true/false)");
return Flag::WRONG_FORMAT;
}
diff --git a/hotspot/src/share/vm/utilities/hashtable.cpp b/hotspot/src/share/vm/utilities/hashtable.cpp
index 8af6156ed45..2d4bd0b83e4 100644
--- a/hotspot/src/share/vm/utilities/hashtable.cpp
+++ b/hotspot/src/share/vm/utilities/hashtable.cpp
@@ -383,6 +383,7 @@ template class BasicHashtable;
template class BasicHashtable;
template class BasicHashtable;
template class BasicHashtable;
+template class BasicHashtable;
#if INCLUDE_TRACE
template class Hashtable;
template class HashtableEntry;
diff --git a/hotspot/src/share/vm/utilities/linkedlist.hpp b/hotspot/src/share/vm/utilities/linkedlist.hpp
index a76c15cca0e..33e416e0e26 100644
--- a/hotspot/src/share/vm/utilities/linkedlist.hpp
+++ b/hotspot/src/share/vm/utilities/linkedlist.hpp
@@ -259,6 +259,11 @@ template * node) {
LinkedListNode* p = this->head();
+ if (p == node) {
+ this->set_head(p->next());
+ delete_node(node);
+ return true;
+ }
while (p != NULL && p->next() != node) {
p = p->next();
}
diff --git a/hotspot/test/Makefile b/hotspot/test/Makefile
index c967434425f..2f2f810f37b 100644
--- a/hotspot/test/Makefile
+++ b/hotspot/test/Makefile
@@ -306,7 +306,10 @@ ifdef TESTDIRS
endif
ifdef CONCURRENCY
- EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
+ JTREG_BASIC_OPTIONS += -concurrency:$(CONCURRENCY)
+endif
+ifdef EXTRA_JTREG_OPTIONS
+ JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
endif
# Default JTREG to run
@@ -326,8 +329,6 @@ JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION)
# Multiply by 4 the timeout factor
JTREG_TIMEOUT_OPTION = -timeoutFactor:4
JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
-# Add any extra options
-JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
# Set other vm and test options
JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_OPTIONS:%=-vmoption:%) $(JAVA_VM_ARGS:%=-vmoption:%)
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java
index 28463d71e75..c9826c857e3 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java
@@ -138,17 +138,6 @@ public class GetConstantPoolTest {
return CompilerToVMHelper.getConstantPool(cpInst, ptr);
}
},
- OBJECT_TYPE_BASE {
- @Override
- ConstantPool getConstantPool() {
- HotSpotResolvedObjectType type
- = HotSpotResolvedObjectType.fromObjectClass(
- OBJECT_TYPE_BASE.getClass());
- long ptrToClass = UNSAFE.getKlassPointer(OBJECT_TYPE_BASE);
- return CompilerToVMHelper.getConstantPool(type,
- getPtrToCpAddress() - ptrToClass);
- }
- },
;
abstract ConstantPool getConstantPool();
}
diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java
index 1dde0850aad..a648caaac67 100644
--- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java
+++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java
@@ -24,6 +24,7 @@
/*
* @test
* @bug 8136421
+ * @ignore 8158860
* @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
* @library / /testlibrary /test/lib
* @library ../common/patches
@@ -149,25 +150,12 @@ public class GetResolvedJavaTypeTest {
ptr, COMPRESSED);
}
},
- OBJECT_TYPE_BASE {
- @Override
- HotSpotResolvedObjectType getResolvedJavaType() {
- HotSpotResolvedObjectType type
- = HotSpotResolvedObjectType.fromObjectClass(
- OBJECT_TYPE_BASE.getClass());
- long ptrToClass = UNSAFE.getKlassPointer(OBJECT_TYPE_BASE);
- return CompilerToVMHelper.getResolvedJavaType(type,
- getPtrToKlass() - ptrToClass, COMPRESSED);
- }
- },
;
abstract HotSpotResolvedObjectType getResolvedJavaType();
}
private static final Unsafe UNSAFE = Utils.getUnsafe();
private static final WhiteBox WB = WhiteBox.getWhiteBox();
- private static final long PTR = UNSAFE.getKlassPointer(
- new GetResolvedJavaTypeTest());
private static final Class TEST_CLASS = GetResolvedJavaTypeTest.class;
/* a compressed parameter for tested method is set to false because
unsafe.getKlassPointer always returns uncompressed pointer */
diff --git a/hotspot/test/gc/TestSmallHeap.java b/hotspot/test/gc/TestSmallHeap.java
index 9c0dba31fc0..a58fa8c4e28 100644
--- a/hotspot/test/gc/TestSmallHeap.java
+++ b/hotspot/test/gc/TestSmallHeap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -23,22 +23,15 @@
/**
* @test TestSmallHeap
- * @bug 8067438
+ * @bug 8067438 8152239
* @requires vm.gc=="null"
- * @requires (vm.opt.AggressiveOpts=="null") | (vm.opt.AggressiveOpts=="false")
- * @requires vm.compMode != "Xcomp"
- * @requires vm.opt.UseCompressedOops != false
* @summary Verify that starting the VM with a small heap works
- * @library /testlibrary /test/lib
+ * @library /testlibrary /test/lib /test/lib/share/classes
* @modules java.base/jdk.internal.misc
* @modules java.management/sun.management
- * @ignore 8076621
* @build TestSmallHeap
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx2m -XX:+UseParallelGC TestSmallHeap
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx2m -XX:+UseSerialGC TestSmallHeap
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx2m -XX:+UseG1GC TestSmallHeap
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx2m -XX:+UseConcMarkSweepGC TestSmallHeap
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI TestSmallHeap
*/
/* Note: It would be nice to verify the minimal supported heap size (2m) here,
@@ -60,23 +53,55 @@
* So, the expected heap size is page_size * 512.
*/
-import jdk.test.lib.*;
-import com.sun.management.HotSpotDiagnosticMXBean;
-import java.lang.management.ManagementFactory;
-import static jdk.test.lib.Asserts.*;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.process.OutputAnalyzer;
+import jdk.test.lib.process.ProcessTools;
+
+import java.util.LinkedList;
import sun.hotspot.WhiteBox;
public class TestSmallHeap {
- public static void main(String[] args) {
+ public static void main(String[] args) throws Exception {
+ // Do all work in the VM driving the test, the VM
+ // with the small heap size should do as little as
+ // possible to avoid hitting an OOME.
WhiteBox wb = WhiteBox.getWhiteBox();
int pageSize = wb.getVMPageSize();
int heapBytesPerCard = 512;
long expectedMaxHeap = pageSize * heapBytesPerCard;
- String maxHeap
- = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class)
- .getVMOption("MaxHeapSize").getValue();
- assertEQ(Long.parseLong(maxHeap), expectedMaxHeap);
+
+ verifySmallHeapSize("-XX:+UseParallelGC", expectedMaxHeap);
+ verifySmallHeapSize("-XX:+UseSerialGC", expectedMaxHeap);
+ verifySmallHeapSize("-XX:+UseG1GC", expectedMaxHeap);
+ verifySmallHeapSize("-XX:+UseConcMarkSweepGC", expectedMaxHeap);
+ }
+
+ private static void verifySmallHeapSize(String gc, long expectedMaxHeap) throws Exception {
+ LinkedList vmOptions = new LinkedList<>();
+ vmOptions.add(gc);
+ vmOptions.add("-Xmx2m");
+ vmOptions.add("-XX:+PrintFlagsFinal");
+ vmOptions.add(VerifyHeapSize.class.getName());
+
+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(vmOptions.toArray(new String[0]));
+ OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
+ analyzer.shouldHaveExitValue(0);
+
+ long maxHeapSize = Long.parseLong(analyzer.firstMatch("MaxHeapSize.+=\\s+(\\d+)",1));
+ long actualHeapSize = Long.parseLong(analyzer.firstMatch(VerifyHeapSize.actualMsg + "(\\d+)",1));
+ Asserts.assertEQ(maxHeapSize, expectedMaxHeap);
+ Asserts.assertLessThanOrEqual(actualHeapSize, maxHeapSize);
+ }
+}
+
+class VerifyHeapSize {
+ public static final String actualMsg = "Actual heap size: ";
+
+ public static void main(String args[]) {
+ // Avoid string concatenation
+ System.out.print(actualMsg);
+ System.out.println(Runtime.getRuntime().maxMemory());
}
}
diff --git a/hotspot/test/gc/g1/ihop/TestIHOPErgo.java b/hotspot/test/gc/g1/ihop/TestIHOPErgo.java
index 95609b84d4d..f77d4584fa9 100644
--- a/hotspot/test/gc/g1/ihop/TestIHOPErgo.java
+++ b/hotspot/test/gc/g1/ihop/TestIHOPErgo.java
@@ -28,6 +28,7 @@
* @requires vm.gc=="G1" | vm.gc=="null"
* @requires vm.opt.FlightRecorder != true
* @requires vm.opt.ExplicitGCInvokesConcurrent != true
+ * @requires vm.opt.MaxGCPauseMillis == "null"
* @library /testlibrary /test/lib /
* @modules java.base/jdk.internal.misc
* @modules java.management
diff --git a/hotspot/test/gc/g1/mixedgc/TestLogging.java b/hotspot/test/gc/g1/mixedgc/TestLogging.java
index f99fdbd21a4..0e232a6f174 100644
--- a/hotspot/test/gc/g1/mixedgc/TestLogging.java
+++ b/hotspot/test/gc/g1/mixedgc/TestLogging.java
@@ -25,6 +25,7 @@
* @test TestLogging
* @summary Check that a mixed GC is reflected in the gc logs
* @requires vm.gc=="G1" | vm.gc=="null"
+ * @requires vm.opt.MaxGCPauseMillis == "null"
* @library /testlibrary /test/lib
* @modules java.base/jdk.internal.misc
* @modules java.management
diff --git a/hotspot/test/gc/g1/plab/TestPLABPromotion.java b/hotspot/test/gc/g1/plab/TestPLABPromotion.java
index 3664897ea83..cefff072c32 100644
--- a/hotspot/test/gc/g1/plab/TestPLABPromotion.java
+++ b/hotspot/test/gc/g1/plab/TestPLABPromotion.java
@@ -122,10 +122,7 @@ public class TestPLABPromotion {
List options = PLABUtils.prepareOptions(testCase.toOptions());
options.add(AppPLABPromotion.class.getName());
OutputAnalyzer out = ProcessTools.executeTestJvm(options.toArray(new String[options.size()]));
- if (out.getExitValue() != 0) {
- System.out.println(out.getOutput());
- throw new RuntimeException("Expect exit code 0.");
- }
+ PLABUtils.commonCheck(out);
output = out.getOutput();
checkResults(testCase);
}
diff --git a/hotspot/test/gc/g1/plab/TestPLABResize.java b/hotspot/test/gc/g1/plab/TestPLABResize.java
index f3ac2aad802..039ef53e8ed 100644
--- a/hotspot/test/gc/g1/plab/TestPLABResize.java
+++ b/hotspot/test/gc/g1/plab/TestPLABResize.java
@@ -94,10 +94,7 @@ public class TestPLABResize {
List options = PLABUtils.prepareOptions(testCase.toOptions());
options.add(AppPLABResize.class.getName());
OutputAnalyzer out = ProcessTools.executeTestJvm(options.toArray(new String[options.size()]));
- if (out.getExitValue() != 0) {
- System.out.println(out.getOutput());
- throw new RuntimeException("Exit code is not 0");
- }
+ PLABUtils.commonCheck(out);
checkResults(out.getOutput(), testCase);
}
}
@@ -124,6 +121,11 @@ public class TestPLABResize {
// The test case does 3 rounds of allocations. The second round of N allocations and GC's
// has a decreasing size of allocations so that iterations N to 2*N -1 will be of decreasing size.
// The third round with iterations 2*N to 3*N -1 has increasing sizes of allocation.
+ if ( plabSizes.size() != testCase.iterations * 3 ) {
+ System.out.println(output);
+ throw new RuntimeException ("Expects for " + testCase.iterations * 3 + " PLAB entries in log, found " + plabSizes.size());
+ }
+
long startDesiredPLABSize = plabSizes.get(testCase.getIterations());
long endDesiredPLABSize = plabSizes.get(testCase.getIterations() * 2 - 1);
diff --git a/hotspot/test/gc/g1/plab/lib/LogParser.java b/hotspot/test/gc/g1/plab/lib/LogParser.java
index 8b70c20573f..f4e9735e63b 100644
--- a/hotspot/test/gc/g1/plab/lib/LogParser.java
+++ b/hotspot/test/gc/g1/plab/lib/LogParser.java
@@ -169,7 +169,12 @@ final public class LogParser {
* @return
**/
public PlabInfo getSpecifiedStats(long specifiedGcId, LogParser.ReportType type, List fieldsName) {
- return getSpecifiedStats(Arrays.asList(specifiedGcId), type, fieldsName, true).get(specifiedGcId);
+ PlabInfo info = getSpecifiedStats(Arrays.asList(specifiedGcId), type, fieldsName, true).get(specifiedGcId);
+ if (info == null) {
+ System.out.println(log);
+ throw new RuntimeException("Cannot find PLAB statistics in log ( GC_ID=" + specifiedGcId + " type=" + type + " )");
+ }
+ return info;
}
/**
diff --git a/hotspot/test/gc/g1/plab/lib/PLABUtils.java b/hotspot/test/gc/g1/plab/lib/PLABUtils.java
index ee13f0a2fa2..096441c14cb 100644
--- a/hotspot/test/gc/g1/plab/lib/PLABUtils.java
+++ b/hotspot/test/gc/g1/plab/lib/PLABUtils.java
@@ -26,6 +26,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import jdk.test.lib.OutputAnalyzer;
import jdk.test.lib.Utils;
/**
@@ -50,7 +51,7 @@ public class PLABUtils {
* GC logging options list.
*/
private final static String G1_PLAB_LOGGING_OPTIONS[] = {
- "-Xlog:gc=debug,gc+plab=debug"
+ "-Xlog:gc=debug,gc+plab=debug,gc+heap=debug"
};
/**
@@ -81,4 +82,18 @@ public class PLABUtils {
executionOtions.addAll(options);
return executionOtions;
}
+
+ /**
+ * Common check for test PLAB application's results.
+ * @param out OutputAnalyzer for checking
+ * @throws RuntimeException
+ */
+ public static void commonCheck(OutputAnalyzer out) throws RuntimeException {
+ if (out.getExitValue() != 0) {
+ System.out.println(out.getOutput());
+ throw new RuntimeException("Exit code is not 0");
+ }
+ // Test expects only WhiteBox initiated GC.
+ out.shouldNotContain("Pause Young (G1 Evacuation Pause)");
+ }
}
diff --git a/hotspot/test/gc/stress/TestMultiThreadStressRSet.java b/hotspot/test/gc/stress/TestMultiThreadStressRSet.java
index 5a69888a502..336b0614bd7 100644
--- a/hotspot/test/gc/stress/TestMultiThreadStressRSet.java
+++ b/hotspot/test/gc/stress/TestMultiThreadStressRSet.java
@@ -33,6 +33,7 @@ import sun.hotspot.WhiteBox;
* @key stress
* @requires vm.gc=="G1" | vm.gc=="null"
* @requires os.maxMemory > 2G
+ * @requires vm.opt.MaxGCPauseMillis == "null"
*
* @summary Stress G1 Remembered Set using multiple threads
* @modules java.base/jdk.internal.misc
diff --git a/hotspot/test/gc/stress/TestStressRSetCoarsening.java b/hotspot/test/gc/stress/TestStressRSetCoarsening.java
index 7ab74a4d2d1..a0d581b0656 100644
--- a/hotspot/test/gc/stress/TestStressRSetCoarsening.java
+++ b/hotspot/test/gc/stress/TestStressRSetCoarsening.java
@@ -30,6 +30,7 @@ import sun.hotspot.WhiteBox;
* @bug 8146984 8147087
* @requires vm.gc=="G1" | vm.gc=="null"
* @requires os.maxMemory > 3G
+ * @requires vm.opt.MaxGCPauseMillis == "null"
*
* @summary Stress G1 Remembered Set by creating a lot of cross region links
* @modules java.base/jdk.internal.misc
@@ -102,7 +103,7 @@ public class TestStressRSetCoarsening {
private static final WhiteBox WB = WhiteBox.getWhiteBox();
- public final Object[][] storage;
+ public final ObjStorage storage;
/**
* Number of objects per region. This is a test parameter.
@@ -161,6 +162,8 @@ public class TestStressRSetCoarsening {
long totalFree = rt.maxMemory() - used;
regionCount = (int) ((totalFree / regionSize) * heapFractionToAllocate);
long toAllocate = regionCount * regionSize;
+ long freeMemoryLimit = totalFree - toAllocate;
+
System.out.println("%% Test parameters");
System.out.println("%% Objects per region : " + K);
System.out.println("%% Heap fraction to allocate : " + (int) (heapFractionToAllocate * 100) + "%");
@@ -212,9 +215,15 @@ public class TestStressRSetCoarsening {
" (sizeOf(new Object[" + N + "])");
System.out.println("%% Reference size : " + refSize);
- storage = new Object[regionCount * K][];
- for (int i = 0; i < storage.length; i++) {
- storage[i] = new Object[N];
+ // Maximum number of objects to allocate is regionCount * K.
+ storage = new ObjStorage(regionCount * K);
+
+ // Add objects as long as there is space in the storage
+ // and we haven't used more memory than planned.
+ while (!storage.isFull() && (rt.maxMemory() - used) > freeMemoryLimit) {
+ storage.addArray(new Object[N]);
+ // Update used memory
+ used = rt.totalMemory() - rt.freeMemory();
}
}
@@ -255,7 +264,7 @@ public class TestStressRSetCoarsening {
// The celebrity will be referred from all other regions.
// If the number of references after should be less than they
// were before, select NULL.
- Object celebrity = cur > pre ? storage[to * K] : null;
+ Object celebrity = cur > pre ? storage.getArrayAt(to * K) : null;
for (int from = 0; from < regionCount; from++) {
if (to == from) {
continue; // no need to refer to itself
@@ -263,7 +272,8 @@ public class TestStressRSetCoarsening {
int step = cur > pre ? +1 : -1;
for (int rn = pre; rn != cur; rn += step) {
- storage[getY(to, from, rn)][getX(to, from, rn)] = celebrity;
+ Object[] rnArray = storage.getArrayAt(getY(to, from, rn));
+ rnArray[getX(to, from, rn)] = celebrity;
if (System.currentTimeMillis() > finishAt) {
throw new TimeoutException();
}
@@ -290,14 +300,15 @@ public class TestStressRSetCoarsening {
continue; // no need to refer to itself
}
for (int rn = 0; rn <= cur; rn++) {
- storage[getY(to, from, rn)][getX(to, from, rn)] = null;
+ Object[] rnArray = storage.getArrayAt(getY(to, from, rn));
+ rnArray[getX(to, from, rn)] = null;
}
}
// 'Refresh' storage elements for the region 'to'
// After that loop all 'old' objects in the region 'to'
// should become unreachable.
for (int k = 0; k < K; k++) {
- storage[(to * K + k) % storage.length] = new Object[N];
+ storage.setArrayAt(to * K + k, new Object[N]);
}
}
}
@@ -340,3 +351,36 @@ public class TestStressRSetCoarsening {
}
}
+//Helper class to encapsulate the object array storage.
+class ObjStorage {
+ public final Object[][] storage;
+ public int usedCount;
+
+ ObjStorage(int size) {
+ storage = new Object[size][];
+ usedCount = 0;
+ }
+
+ public boolean isFull() {
+ return usedCount >= storage.length;
+ }
+
+ public void addArray(Object[] objects) {
+ if (isFull()) {
+ throw new IllegalStateException("Storage full maximum number of allowed elements: " + usedCount);
+ }
+ storage[usedCount++] = objects;
+ }
+
+ // Limit by usedCount since memory limits can cause the storage
+ // to have unused slots in the end.
+ public void setArrayAt(int i, Object[] objects) {
+ storage[i % usedCount] = objects;
+ }
+
+ // Limit by usedCount since memory limits can cause the storage
+ // to have unused slots in the end.
+ public Object[] getArrayAt(int i) {
+ return storage[i % usedCount];
+ }
+}
diff --git a/hotspot/test/native/GTestWrapper.java b/hotspot/test/native/GTestWrapper.java
new file mode 100644
index 00000000000..cedf63e4aa4
--- /dev/null
+++ b/hotspot/test/native/GTestWrapper.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/* @test
+ * @summary a jtreg wrapper for gtest tests
+ * @library /test/lib/share/classes
+ * @modules java.base/jdk.internal.misc
+ * @run main/native GTestWrapper
+ */
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Stream;
+import java.util.stream.Collectors;
+
+import java.nio.file.Paths;
+import java.nio.file.Path;
+
+import jdk.test.lib.Platform;
+import jdk.test.lib.Utils;
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.process.OutputAnalyzer;
+
+public class GTestWrapper {
+ public static void main(String[] args) throws Throwable {
+ // gtestLauncher is located in /hotspot/gtest//
+ // nativePath points either to /hotspot/jtreg/native or to /hotspot/gtest
+ Path nativePath = Paths.get(System.getProperty("test.nativepath"));
+ String jvmVariantDir = getJVMVariantSubDir();
+ // let's assume it's /hotspot/gtest
+ Path path = nativePath.resolve(jvmVariantDir);
+ if (!path.toFile().exists()) {
+ // maybe it is /hotspot/jtreg/native
+ path = nativePath.getParent()
+ .getParent()
+ .resolve("gtest")
+ .resolve(jvmVariantDir);
+ }
+ if (!path.toFile().exists()) {
+ throw new Error("TESTBUG: the library has not been found in " + nativePath);
+ }
+ path = path.resolve("gtestLauncher" + (Platform.isWindows() ? ".exe" : ""));
+ ProcessTools.executeCommand(new String[] {
+ path.toString(),
+ "-jdk",
+ System.getProperty("test.jdk")
+ }).shouldHaveExitValue(0);
+ }
+
+ private static String getJVMVariantSubDir() {
+ if (Platform.isServer()) {
+ return "server";
+ } else if (Platform.isClient()) {
+ return "client";
+ } else if (Platform.isMinimal()) {
+ return "minimal";
+ } else {
+ throw new Error("TESTBUG: unsuppported vm variant");
+ }
+ }
+}
diff --git a/hotspot/test/runtime/ConstantPool/BadMethodHandles.java b/hotspot/test/runtime/ConstantPool/BadMethodHandles.java
new file mode 100644
index 00000000000..6345166e022
--- /dev/null
+++ b/hotspot/test/runtime/ConstantPool/BadMethodHandles.java
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8087223
+ * @summary Adding constantTag to keep method call consistent with it.
+ * @library /testlibrary
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ * java.base/jdk.internal.misc
+ * java.management
+ * @compile -XDignore.symbol.file BadMethodHandles.java
+ * @run main/othervm BadMethodHandles
+ */
+
+import jdk.internal.org.objectweb.asm.*;
+import java.io.FileOutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import static jdk.internal.org.objectweb.asm.Opcodes.*;
+
+public class BadMethodHandles {
+
+ static byte[] dumpBadInterfaceMethodref() {
+ ClassWriter cw = new ClassWriter(0);
+ cw.visit(52, ACC_PUBLIC | ACC_SUPER, "BadInterfaceMethodref", null, "java/lang/Object", null);
+ Handle handle1 =
+ new Handle(Opcodes.H_INVOKEINTERFACE, "BadInterfaceMethodref", "m", "()V");
+ Handle handle2 =
+ new Handle(Opcodes.H_INVOKEINTERFACE, "BadInterfaceMethodref", "staticM", "()V");
+
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V", false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "m", "()V", null, null);
+ mv.visitCode();
+ mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;");
+ mv.visitLdcInsn("hello from m");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false/*intf*/);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(3, 1);
+ mv.visitEnd();
+ }
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "staticM", "()V", null, null);
+ mv.visitCode();
+ mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;");
+ mv.visitLdcInsn("hello from staticM");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false/*intf*/);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(3, 1);
+ mv.visitEnd();
+ }
+
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "runm", "()V", null, null);
+ mv.visitCode();
+ // REF_invokeStatic
+ mv.visitLdcInsn(handle1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandle", "invoke", "()V", false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "runStaticM", "()V", null, null);
+ mv.visitCode();
+ // REF_invokeStatic
+ mv.visitLdcInsn(handle2);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandle", "invoke", "()V", false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+
+ cw.visitEnd();
+ return cw.toByteArray();
+ }
+
+ static byte[] dumpIBad() {
+ ClassWriter cw = new ClassWriter(0);
+ cw.visit(52, ACC_PUBLIC | ACC_ABSTRACT | ACC_INTERFACE, "IBad", null, "java/lang/Object", null);
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "m", "()V", null, null);
+ mv.visitCode();
+ mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;");
+ mv.visitLdcInsn("hello from m");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false/*intf*/);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(3, 1);
+ mv.visitEnd();
+ }
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "staticM", "()V", null, null);
+ mv.visitCode();
+ mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;");
+ mv.visitLdcInsn("hello from staticM");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/String;)V", false/*intf*/);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(3, 1);
+ mv.visitEnd();
+ }
+ cw.visitEnd();
+ return cw.toByteArray();
+ }
+
+ static byte[] dumpBadMethodref() {
+ ClassWriter cw = new ClassWriter(0);
+ cw.visit(52, ACC_PUBLIC | ACC_SUPER, "BadMethodref", null, "java/lang/Object", new String[]{"IBad"});
+ Handle handle1 =
+ new Handle(Opcodes.H_INVOKEINTERFACE, "BadMethodref", "m", "()V");
+ Handle handle2 =
+ new Handle(Opcodes.H_INVOKEINTERFACE, "BadMethodref", "staticM", "()V");
+
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V", false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "runm", "()V", null, null);
+ mv.visitCode();
+ // REF_invokeStatic
+ mv.visitLdcInsn(handle1);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandle", "invoke", "()V", false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "runStaticM", "()V", null, null);
+ mv.visitCode();
+ // REF_invokeStatic
+ mv.visitLdcInsn(handle2);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandle", "invoke", "()V", false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+
+ cw.visitEnd();
+ return cw.toByteArray();
+ }
+ static class CL extends ClassLoader {
+ @Override
+ protected Class> findClass(String name) throws ClassNotFoundException {
+ byte[] classBytes = null;
+ switch (name) {
+ case "BadInterfaceMethodref": classBytes = dumpBadInterfaceMethodref(); break;
+ case "BadMethodref" : classBytes = dumpBadMethodref(); break;
+ case "IBad" : classBytes = dumpIBad(); break;
+ default : throw new ClassNotFoundException(name);
+ }
+ return defineClass(name, classBytes, 0, classBytes.length);
+ }
+ }
+
+ public static void main(String[] args) throws Throwable {
+ try (FileOutputStream fos = new FileOutputStream("BadInterfaceMethodref.class")) {
+ fos.write(dumpBadInterfaceMethodref());
+ }
+ try (FileOutputStream fos = new FileOutputStream("IBad.class")) {
+ fos.write(dumpIBad());
+ }
+ try (FileOutputStream fos = new FileOutputStream("BadMethodref.class")) {
+ fos.write(dumpBadMethodref());
+ }
+
+ Class> cls = (new CL()).loadClass("BadInterfaceMethodref");
+ String[] methods = {"runm", "runStaticM"};
+ System.out.println("Test BadInterfaceMethodref:");
+ int success = 0;
+ for (String name : methods) {
+ try {
+ System.out.printf("invoke %s: \n", name);
+ cls.getMethod(name).invoke(cls.newInstance());
+ System.out.println("FAILED - ICCE should be thrown");
+ } catch (Throwable e) {
+ if (e instanceof InvocationTargetException && e.getCause() != null &&
+ e.getCause() instanceof IncompatibleClassChangeError) {
+ System.out.println("PASSED - expected ICCE thrown");
+ success++;
+ continue;
+ } else {
+ System.out.println("FAILED with wrong exception" + e);
+ throw e;
+ }
+ }
+ }
+ if (success != methods.length) {
+ throw new Exception("BadInterfaceMethodRef Failed to catch IncompatibleClassChangeError");
+ }
+ System.out.println("Test BadMethodref:");
+ cls = (new CL()).loadClass("BadMethodref");
+ success = 0;
+ for (String name : methods) {
+ try {
+ System.out.printf("invoke %s: \n", name);
+ cls.getMethod(name).invoke(cls.newInstance());
+ System.out.println("FAILED - ICCE should be thrown");
+ } catch (Throwable e) {
+ if (e instanceof InvocationTargetException && e.getCause() != null &&
+ e.getCause() instanceof IncompatibleClassChangeError) {
+ System.out.println("PASSED - expected ICCE thrown");
+ success++;
+ continue;
+ } else {
+ System.out.println("FAILED with wrong exception" + e);
+ throw e;
+ }
+ }
+ }
+ if (success != methods.length) {
+ throw new Exception("BadMethodRef Failed to catch IncompatibleClassChangeError");
+ }
+
+ }
+}
diff --git a/hotspot/test/runtime/ConstantPool/IntfMethod.java b/hotspot/test/runtime/ConstantPool/IntfMethod.java
new file mode 100644
index 00000000000..9602ff59979
--- /dev/null
+++ b/hotspot/test/runtime/ConstantPool/IntfMethod.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * $bug 8087223
+ * @summary Adding constantTag to keep method call consistent with it.
+ * @library /testlibrary
+ * @modules java.base/jdk.internal.org.objectweb.asm
+ * java.base/jdk.internal.misc
+ * java.management
+ * @compile -XDignore.symbol.file IntfMethod.java
+ * @run main/othervm IntfMethod
+ * @run main/othervm -Xint IntfMethod
+ * @run main/othervm -Xcomp IntfMethod
+ */
+
+
+import jdk.internal.org.objectweb.asm.*;
+import java.io.FileOutputStream;
+import java.lang.reflect.InvocationTargetException;
+import static jdk.internal.org.objectweb.asm.Opcodes.*;
+
+public class IntfMethod {
+ static byte[] dumpC() {
+ ClassWriter cw = new ClassWriter(0);
+ cw.visit(52, ACC_PUBLIC | ACC_SUPER, "C", null, "java/lang/Object", new String[]{"I"});
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V", false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "testSpecialIntf", "()V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKESPECIAL, "I", "f1", "()V", /*itf=*/false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "testStaticIntf", "()V", null, null);
+ mv.visitCode();
+ mv.visitMethodInsn(INVOKESTATIC, "I", "f2", "()V", /*itf=*/false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "testSpecialClass", "()V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKESPECIAL, "C", "f1", "()V", /*itf=*/true);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "f2", "()V", null, null);
+ mv.visitCode();
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(0, 1);
+ mv.visitEnd();
+ }
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "testStaticClass", "()V", null, null);
+ mv.visitCode();
+ mv.visitMethodInsn(INVOKESTATIC, "C", "f2", "()V", /*itf=*/true);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+ cw.visitEnd();
+ return cw.toByteArray();
+ }
+
+ static byte[] dumpI() {
+ ClassWriter cw = new ClassWriter(0);
+ cw.visit(52, ACC_PUBLIC | ACC_ABSTRACT | ACC_INTERFACE, "I", null, "java/lang/Object", null);
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "f1", "()V", null, null);
+ mv.visitCode();
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(0, 1);
+ mv.visitEnd();
+ }
+ {
+ MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "f2", "()V", null, null);
+ mv.visitCode();
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(0, 1);
+ mv.visitEnd();
+ }
+ cw.visitEnd();
+ return cw.toByteArray();
+ }
+
+ static class CL extends ClassLoader {
+ @Override
+ protected Class> findClass(String name) throws ClassNotFoundException {
+ byte[] classFile;
+ switch (name) {
+ case "I": classFile = dumpI(); break;
+ case "C": classFile = dumpC(); break;
+ default:
+ throw new ClassNotFoundException(name);
+ }
+ return defineClass(name, classFile, 0, classFile.length);
+ }
+ }
+
+ public static void main(String[] args) throws Throwable {
+ Class> cls = (new CL()).loadClass("C");
+ try (FileOutputStream fos = new FileOutputStream("I.class")) { fos.write(dumpI()); }
+ try (FileOutputStream fos = new FileOutputStream("C.class")) { fos.write(dumpC()); }
+
+ int success = 0;
+ for (String name : new String[] { "testSpecialIntf", "testStaticIntf", "testSpecialClass", "testStaticClass"}) {
+ System.out.printf("%s: ", name);
+ try {
+ cls.getMethod(name).invoke(cls.newInstance());
+ System.out.println("FAILED - ICCE not thrown");
+ } catch (Throwable e) {
+ if (e instanceof InvocationTargetException &&
+ e.getCause() != null && e.getCause() instanceof IncompatibleClassChangeError) {
+ System.out.println("PASSED - expected ICCE thrown");
+ success++;
+ continue;
+ }
+ }
+ }
+ if (success != 4) throw new Exception("Failed to catch ICCE");
+ }
+}
diff --git a/hotspot/test/runtime/NMT/CommitOverlappingRegions.java b/hotspot/test/runtime/NMT/CommitOverlappingRegions.java
new file mode 100644
index 00000000000..212a9930fd3
--- /dev/null
+++ b/hotspot/test/runtime/NMT/CommitOverlappingRegions.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary Test commits of overlapping regions of memory.
+ * @key nmt jcmd
+ * @library /testlibrary /test/lib
+ * @modules java.base/jdk.internal.misc
+ * java.management
+ * @build CommitOverlappingRegions
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail CommitOverlappingRegions
+ */
+
+import jdk.test.lib.*;
+import sun.hotspot.WhiteBox;
+
+public class CommitOverlappingRegions {
+ public static WhiteBox wb = WhiteBox.getWhiteBox();
+ public static void main(String args[]) throws Exception {
+ OutputAnalyzer output;
+ long size = 32 * 1024;
+ long addr = wb.NMTReserveMemory(8*size);
+
+ String pid = Long.toString(ProcessTools.getProcessId());
+ ProcessBuilder pb = new ProcessBuilder();
+
+ pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "detail"});
+ System.out.println("Address is " + Long.toHexString(addr));
+
+ // Start: . . . . . . . .
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("Test (reserved=256KB, committed=0KB)");
+
+ // Committing: * * * . . . . .
+ // Region: * * * . . . . .
+ // Expected Total: 3 x 32KB = 96KB
+ wb.NMTCommitMemory(addr + 0*size, 3*size);
+
+ // Committing: . . . . * * * .
+ // Region: * * * . * * * .
+ // Expected Total: 6 x 32KB = 192KB
+ wb.NMTCommitMemory(addr + 4*size, 3*size);
+
+ // Check output after first 2 commits.
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("Test (reserved=256KB, committed=192KB)");
+
+ // Committing: . . * * * . . .
+ // Region: * * * * * * * .
+ // Expected Total: 7 x 32KB = 224KB
+ wb.NMTCommitMemory(addr + 2*size, 3*size);
+
+ // Check output after overlapping commit.
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("Test (reserved=256KB, committed=224KB)");
+
+ // Uncommitting: * * * * * * * *
+ // Region: . . . . . . . .
+ // Expected Total: 0 x 32KB = 0KB
+ wb.NMTUncommitMemory(addr + 0*size, 8*size);
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("Test (reserved=256KB, committed=0KB)");
+
+ // Committing: * * . . . . . .
+ // Region: * * . . . . . .
+ // Expected Total: 2 x 32KB = 64KB
+ wb.NMTCommitMemory(addr + 0*size, 2*size);
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("Test (reserved=256KB, committed=64KB)");
+
+ // Committing: . * * * . . . .
+ // Region: * * * * . . . .
+ // Expected Total: 4 x 32KB = 128KB
+ wb.NMTCommitMemory(addr + 1*size, 3*size);
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("Test (reserved=256KB, committed=128KB)");
+
+ // Uncommitting: * * * . . . . .
+ // Region: . . . * . . . .
+ // Expected Total: 1 x 32KB = 32KB
+ wb.NMTUncommitMemory(addr + 0*size, 3*size);
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("Test (reserved=256KB, committed=32KB)");
+
+ // Committing: . . . * * . . .
+ // Region: . . . * * . . .
+ // Expected Total: 2 x 32KB = 64KB
+ wb.NMTCommitMemory(addr + 3*size, 2*size);
+ System.out.println("Address is " + Long.toHexString(addr + 3*size));
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("Test (reserved=256KB, committed=64KB)");
+
+ // Committing: . . . . * * . .
+ // Region: . . . * * * . .
+ // Expected Total: 3 x 32KB = 96KB
+ wb.NMTCommitMemory(addr + 4*size, 2*size);
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("Test (reserved=256KB, committed=96KB)");
+
+ // Committing: . . . . . * * .
+ // Region: . . . * * * * .
+ // Expected Total: 4 x 32KB = 128KB
+ wb.NMTCommitMemory(addr + 5*size, 2*size);
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("Test (reserved=256KB, committed=128KB)");
+
+ // Committing: . . . . . . * *
+ // Region: . . . * * * * *
+ // Expected Total: 5 x 32KB = 160KB
+ wb.NMTCommitMemory(addr + 6*size, 2*size);
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("Test (reserved=256KB, committed=160KB)");
+
+ // Uncommitting: * * * * * * * *
+ // Region: . . . . . . . .
+ // Expected Total: 0 x 32KB = 32KB
+ wb.NMTUncommitMemory(addr + 0*size, 8*size);
+ output = new OutputAnalyzer(pb.start());
+ output.shouldContain("Test (reserved=256KB, committed=0KB)");
+ }
+}
diff --git a/hotspot/test/runtime/NMT/PrintNMTStatistics.java b/hotspot/test/runtime/NMT/PrintNMTStatistics.java
index 413ade55e80..11138ec0d48 100644
--- a/hotspot/test/runtime/NMT/PrintNMTStatistics.java
+++ b/hotspot/test/runtime/NMT/PrintNMTStatistics.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,6 +48,9 @@ public class PrintNMTStatistics {
output_detail.shouldNotContain("error");
output_detail.shouldHaveExitValue(0);
+ // Make sure memory reserved for Module processing is recorded.
+ output_detail.shouldContain(" Module (reserved=");
+
ProcessBuilder pb1 = ProcessTools.createJavaProcessBuilder(
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+PrintNMTStatistics",
diff --git a/hotspot/test/runtime/ReservedStack/ReservedStackTest.java b/hotspot/test/runtime/ReservedStack/ReservedStackTest.java
index 3c60d4709ce..a608077dfe1 100644
--- a/hotspot/test/runtime/ReservedStack/ReservedStackTest.java
+++ b/hotspot/test/runtime/ReservedStack/ReservedStackTest.java
@@ -27,6 +27,7 @@
* @modules java.base/jdk.internal.misc
* @modules java.base/jdk.internal.vm.annotation
* @build jdk.test.lib.*
+ * @run main/othervm -Xint ReservedStackTest
* @run main/othervm -XX:-Inline -XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread ReservedStackTest
*/
@@ -196,9 +197,12 @@ public class ReservedStackTest {
System.out.println("Test started execution at frame = " + (counter - deframe));
String result = test.getResult();
// The feature is not fully implemented on all platforms,
- // corruptions are still possible
- boolean supportedPlatform = Platform.isSolaris() || Platform.isOSX()
- || (Platform.isLinux() && (Platform.isX86() || Platform.isX64()));
+ // corruptions are still possible.
+ boolean supportedPlatform =
+ Platform.isAix() ||
+ (Platform.isLinux() && (Platform.isPPC() || Platform.isX64() || Platform.isX86())) ||
+ Platform.isOSX() ||
+ Platform.isSolaris();
if (supportedPlatform && !result.contains("PASSED")) {
System.out.println(result);
throw new Error(result);
diff --git a/hotspot/test/runtime/ReservedStack/ReservedStackTestCompiler.java b/hotspot/test/runtime/ReservedStack/ReservedStackTestCompiler.java
new file mode 100644
index 00000000000..fa7ba474612
--- /dev/null
+++ b/hotspot/test/runtime/ReservedStack/ReservedStackTestCompiler.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test ReservedStackTestCompiler
+ * @summary Run ReservedStackTest with dedicated compilers C1 and C2.
+ * @requires vm.flavor == "server"
+ * @library /testlibrary
+ * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.vm.annotation
+ * @build jdk.test.lib.* ReservedStackTest
+ * @run main/othervm -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-Inline -XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread ReservedStackTest
+ * @run main/othervm -XX:-TieredCompilation -XX:-Inline -XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread ReservedStackTest
+ */
+
+// Intentionally left blank. Just runs ReservedStackTest with @requires annotation.
diff --git a/hotspot/test/runtime/SelectionResolution/classes/selectionresolution/Clazz.java b/hotspot/test/runtime/SelectionResolution/classes/selectionresolution/Clazz.java
index 42b96b6b0d4..1b6e8afc803 100644
--- a/hotspot/test/runtime/SelectionResolution/classes/selectionresolution/Clazz.java
+++ b/hotspot/test/runtime/SelectionResolution/classes/selectionresolution/Clazz.java
@@ -72,6 +72,6 @@ class Clazz extends ClassConstruct {
public Clazz(String name, String extending, int access, int classFileVersion, int index, String... implementing) {
super(name, extending == null ? "java/lang/Object" : extending, access + ACC_SUPER, classFileVersion, index, implementing);
// Add the default constructor
- addMethod("", "()V", ACC_PUBLIC).makeConstructor(extending);
+ addMethod("", "()V", ACC_PUBLIC).makeConstructor(extending, false);
}
}
diff --git a/hotspot/test/runtime/SelectionResolution/classes/selectionresolution/Method.java b/hotspot/test/runtime/SelectionResolution/classes/selectionresolution/Method.java
index c09ce0fcc7d..428475dfd8a 100644
--- a/hotspot/test/runtime/SelectionResolution/classes/selectionresolution/Method.java
+++ b/hotspot/test/runtime/SelectionResolution/classes/selectionresolution/Method.java
@@ -59,14 +59,12 @@ class Method {
private final String ownerClassName;
private final ClassVisitor cv;
private final MethodVisitor mv;
- private final boolean isInterface;
private final ClassBuilder.ExecutionMode execMode;
public Method(ClassConstruct ownerClass, ClassVisitor cv, String name, String descriptor, int access,
ClassBuilder.ExecutionMode execMode) {
this.ownerClassName = ownerClass.getName();
this.ownerClass = ownerClass;
- this.isInterface = ownerClass.isInterface();
this.execMode = execMode;
this.cv = cv;
mv = cv.visitMethod(access, name, descriptor, null, null);
@@ -91,12 +89,12 @@ class Method {
public void makeSuperCallMethod(int invokeInstruction, String className) {
mv.visitVarInsn(ALOAD, 0);
- makeCall(invokeInstruction, className);
+ makeCall(invokeInstruction, className, false);
mv.visitInsn(POP);
done();
}
- public void defaultInvoke(int instr, String className, String objectRef) {
+ public void defaultInvoke(int instr, String className, String objectRef, boolean isInterface) {
switch (instr) {
case INVOKEVIRTUAL:
defaultInvokeVirtual(className, objectRef);
@@ -105,10 +103,10 @@ class Method {
defaultInvokeInterface(className, objectRef);
break;
case INVOKESTATIC:
- defaultInvokeStatic(className);
+ defaultInvokeStatic(className, isInterface);
break;
case INVOKESPECIAL:
- defaultInvokeSpecial(className, objectRef);
+ defaultInvokeSpecial(className, objectRef, isInterface);
break;
default:
break;
@@ -118,30 +116,26 @@ class Method {
mv.visitEnd();
}
- public void defaultInvokeVirtual(String className, String objectRef) {
+ private void defaultInvokeVirtual(String className, String objectRef) {
String objectRefPackageName = objectRef.substring(0, objectRef.lastIndexOf("/"));
makeNewObject(objectRef, objectRefPackageName);
makeCall(INVOKEVIRTUAL, className, false);
}
- public void defaultInvokeInterface(String className, String objectRef) {
+ private void defaultInvokeInterface(String className, String objectRef) {
String objectRefPackageName = objectRef.substring(0, objectRef.lastIndexOf("/"));
makeNewObject(objectRef, objectRefPackageName);
makeCall(INVOKEINTERFACE, className, true);
}
- public void defaultInvokeSpecial(String className, String objectRef) {
+ private void defaultInvokeSpecial(String className, String objectRef, boolean isInterface) {
String objectRefPackageName = objectRef.substring(0, objectRef.lastIndexOf("/"));
makeNewObject(objectRef, objectRefPackageName);
- makeCall(INVOKESPECIAL, className, false);
+ makeCall(INVOKESPECIAL, className, isInterface);
}
- public void defaultInvokeStatic(String className) {
- makeCall(INVOKESTATIC, className);
- }
-
- private Method makeCall(int invokeInstruction, String className) {
- return makeCall(invokeInstruction, className, isInterface);
+ private void defaultInvokeStatic(String className, boolean isInterface) {
+ makeCall(INVOKESTATIC, className, isInterface);
}
private Method makeCall(int invokeInstruction, String className, boolean isInterface) {
@@ -219,7 +213,7 @@ class Method {
String className = objectRef.substring(objectRef.lastIndexOf("/") + 1);
makeStaticCall( objectRefPackageName + "/Helper",
"get" + className,
- "()L" + objectRef + ";");
+ "()L" + objectRef + ";", false);
mv.visitVarInsn(ASTORE, 1);
mv.visitVarInsn(ALOAD, 1);
}
@@ -236,12 +230,12 @@ class Method {
mv.visitEnd();
}
- public Method makeStaticCall(String classname, String method, String descriptor) {
+ public Method makeStaticCall(String classname, String method, String descriptor, boolean isInterface) {
mv.visitMethodInsn(INVOKESTATIC, classname, method, descriptor, isInterface);
return this;
}
- public void makeConstructor(String extending) {
+ public void makeConstructor(String extending, boolean isInterface) {
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKESPECIAL, extending == null ? "java/lang/Object" : extending, "", "()V", isInterface);
mv.visitInsn(RETURN);
diff --git a/hotspot/test/runtime/SelectionResolution/classes/selectionresolution/TestBuilder.java b/hotspot/test/runtime/SelectionResolution/classes/selectionresolution/TestBuilder.java
index a24a91fe0a2..894d053e0cc 100644
--- a/hotspot/test/runtime/SelectionResolution/classes/selectionresolution/TestBuilder.java
+++ b/hotspot/test/runtime/SelectionResolution/classes/selectionresolution/TestBuilder.java
@@ -53,9 +53,10 @@ class TestBuilder extends Builder {
Method m = clazz.addMethod("test", "()Ljava/lang/Integer;", ACC_PUBLIC + ACC_STATIC, execMode);
m.defaultInvoke(getInvokeInstruction(testcase.invoke),
getName(testcase.methodref),
- getName(testcase.objectref));
+ getName(testcase.objectref),
+ testcase.hier.isInterface(testcase.methodref));
- mainMethod.makeStaticCall(clazz.getName(), "test", "()Ljava/lang/Integer;").done();
+ mainMethod.makeStaticCall(clazz.getName(), "test", "()Ljava/lang/Integer;", false).done();
}
private static int getInvokeInstruction(SelectionResolutionTestCase.InvokeInstruction instr) {
diff --git a/hotspot/test/runtime/modules/AccessCheck/CheckRead.java b/hotspot/test/runtime/modules/AccessCheck/CheckRead.java
index bfe8a0fc823..71435b1718f 100644
--- a/hotspot/test/runtime/modules/AccessCheck/CheckRead.java
+++ b/hotspot/test/runtime/modules/AccessCheck/CheckRead.java
@@ -103,7 +103,7 @@ public class CheckRead {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java
index 10196ded9fe..3342d8f9073 100644
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java
+++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java
@@ -103,7 +103,7 @@ public class DiffCL_CheckRead {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java
index 5310abc1974..3d2bb9eda86 100644
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java
+++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java
@@ -105,7 +105,7 @@ public class DiffCL_ExpQualOther {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java
index 71359b019dc..5854c4530ea 100644
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java
+++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java
@@ -91,7 +91,7 @@ public class DiffCL_ExpQualToM1 {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java
index 4d8db6bf1b8..57490768b2f 100644
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java
+++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java
@@ -92,7 +92,7 @@ public class DiffCL_ExpUnqual {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java
index fafb2aeb738..9b1bd9613cc 100644
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java
+++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java
@@ -91,7 +91,7 @@ public class DiffCL_PkgNotExp {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java
index d3c746fde31..09488b60327 100644
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java
+++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java
@@ -92,7 +92,7 @@ public class DiffCL_Umod {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
MyDiffClassLoader.loader2 = new MyDiffClassLoader();
@@ -141,7 +141,7 @@ public class DiffCL_Umod {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
MyDiffClassLoader.loader2 = new MyDiffClassLoader();
@@ -190,7 +190,7 @@ public class DiffCL_Umod {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
MyDiffClassLoader.loader2 = new MyDiffClassLoader();
diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java
index 8c9629b16b8..3ce98422ec6 100644
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java
+++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java
@@ -87,7 +87,7 @@ public class DiffCL_UmodUpkg {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
MyDiffClassLoader.loader2 = new MyDiffClassLoader();
@@ -136,7 +136,7 @@ public class DiffCL_UmodUpkg {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MyDiffClassLoader.loader1 = new MyDiffClassLoader();
MyDiffClassLoader.loader2 = new MyDiffClassLoader();
diff --git a/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java
index c9003ad2cd5..5cf5132ece9 100644
--- a/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java
+++ b/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java
@@ -105,7 +105,7 @@ public class ExpQualOther {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java b/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java
index 755ffe15133..4a7822fb4d7 100644
--- a/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java
+++ b/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java
@@ -81,7 +81,7 @@ public class ExpQualToM1 {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to the same class loader for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java
index 7f1c1d918a1..67e69ea42e0 100644
--- a/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java
+++ b/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java
@@ -81,7 +81,7 @@ public class ExpUnqual {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to the same class loader for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java b/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java
index 97133f3ebaa..3762f13b696 100644
--- a/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java
+++ b/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java
@@ -93,7 +93,7 @@ public class ExportAllUnnamed {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java
index 04fbbead02d..0b044974fa8 100644
--- a/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java
+++ b/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java
@@ -91,7 +91,7 @@ public class PkgNotExp {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to the same class loader for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod.java b/hotspot/test/runtime/modules/AccessCheck/Umod.java
index 4610da62954..c61bcf45896 100644
--- a/hotspot/test/runtime/modules/AccessCheck/Umod.java
+++ b/hotspot/test/runtime/modules/AccessCheck/Umod.java
@@ -92,7 +92,7 @@ public class Umod {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map module m1 to class loader.
// class c2 will be loaded in an unnamed module/loader.
@@ -138,7 +138,7 @@ public class Umod {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MySameClassLoader loader = new MySameClassLoader();
// map module m1 to class loader.
@@ -184,7 +184,7 @@ public class Umod {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MySameClassLoader loader = new MySameClassLoader();
// map module m1 to class loader.
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java
index d9e578c750b..cde2644146d 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java
@@ -92,7 +92,7 @@ public class UmodDiffCL_ExpQualOther {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java
index c17e07f959e..93b2f14428a 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java
@@ -92,7 +92,7 @@ public class UmodDiffCL_ExpUnqual {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java
index fd5e090c011..aca576bd721 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java
@@ -91,7 +91,7 @@ public class UmodDiffCL_PkgNotExp {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java b/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java
index 102236618e1..36035e9c4d2 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java
@@ -87,7 +87,7 @@ public class UmodUPkg {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map module m1 to class loader.
// class c4 will be loaded in an unnamed module/loader.
@@ -133,7 +133,7 @@ public class UmodUPkg {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
MySameClassLoader loader = new MySameClassLoader();
// map module m1 to class loader.
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java
index 15a0e0105bf..ed81b24fc7f 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java
@@ -92,7 +92,7 @@ public class UmodUpkgDiffCL_ExpQualOther {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java
index 30ae3fb18c2..11d42b74673 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java
@@ -91,7 +91,7 @@ public class UmodUpkgDiffCL_NotExp {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java
index e7a51e3438a..8ea1cdd1daa 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java
@@ -101,7 +101,7 @@ public class UmodUpkg_ExpQualOther {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java
index 5bab4fc8bc9..ebf9b5e8a2a 100644
--- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java
+++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java
@@ -89,7 +89,7 @@ public class UmodUpkg_NotExp {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to the same class loader for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java
index 3f827e93c3c..3c58cdb1a34 100644
--- a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java
+++ b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java
@@ -101,7 +101,7 @@ public class Umod_ExpQualOther {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java
index fe3c88526d7..6f8f83f0e59 100644
--- a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java
+++ b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java
@@ -91,7 +91,7 @@ public class Umod_ExpUnqual {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to differing class loaders for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java
index d1b2a223f63..90c071cb345 100644
--- a/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java
+++ b/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java
@@ -89,7 +89,7 @@ public class Umod_PkgNotExp {
// Resolves "m1"
Configuration cf = Layer.boot()
.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of("m1"));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of("m1"));
// map each module to the same class loader for this test
Map map = new HashMap<>();
diff --git a/hotspot/test/serviceability/dcmd/vm/SetVMFlagTest.java b/hotspot/test/serviceability/dcmd/vm/SetVMFlagTest.java
index 9132aece076..663a7bc6a2f 100644
--- a/hotspot/test/serviceability/dcmd/vm/SetVMFlagTest.java
+++ b/hotspot/test/serviceability/dcmd/vm/SetVMFlagTest.java
@@ -56,6 +56,25 @@ public class SetVMFlagTest {
run(new JMXExecutor());
}
+ private void setMutableFlagInternal(CommandExecutor executor, String flag,
+ boolean val, boolean isNumeric) {
+ String strFlagVal;
+ if (isNumeric) {
+ strFlagVal = val ? "1" : "0";
+ } else {
+ strFlagVal = val ? "true" : "false";
+ }
+
+ OutputAnalyzer out = executor.execute("VM.set_flag " + flag + " " + strFlagVal);
+ out.stderrShouldBeEmpty();
+
+ out = getAllFlags(executor);
+
+ String newFlagVal = out.firstMatch(MANAGEABLE_PATTERN.replace("(\\S+)", flag), 1);
+
+ assertNotEquals(newFlagVal, val ? "1" : "0");
+ }
+
private void setMutableFlag(CommandExecutor executor) {
OutputAnalyzer out = getAllFlags(executor);
String flagName = out.firstMatch(MANAGEABLE_PATTERN, 1);
@@ -69,15 +88,8 @@ public class SetVMFlagTest {
}
Boolean blnVal = Boolean.parseBoolean(flagVal);
-
- out = executor.execute("VM.set_flag " + flagName + " " + (blnVal ? 0 : 1));
- out.stderrShouldBeEmpty();
-
- out = getAllFlags(executor);
-
- String newFlagVal = out.firstMatch(MANAGEABLE_PATTERN.replace("(\\S+)", flagName), 1);
-
- assertNotEquals(newFlagVal, flagVal);
+ setMutableFlagInternal(executor, flagName, !blnVal, true);
+ setMutableFlagInternal(executor, flagName, blnVal, false);
}
private void setMutableFlagWithInvalidValue(CommandExecutor executor) {
@@ -95,7 +107,7 @@ public class SetVMFlagTest {
// a boolean flag accepts only 0/1 as its value
out = executor.execute("VM.set_flag " + flagName + " unexpected_value");
out.stderrShouldBeEmpty();
- out.stdoutShouldContain("flag value must be a boolean (1 or 0)");
+ out.stdoutShouldContain("flag value must be a boolean (1/0 or true/false)");
out = getAllFlags(executor);
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index 3bef243c570..e447d080f2b 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -361,3 +361,5 @@ bdbf2342b21bd8ecad1b4e6499a0dfb314952bd7 jdk-9+103
9d71d20e614777cd23c1a43b38b5c08a9094d27a jdk-9+116
46b57560cd06ebcdd21489250628ff5f9d9d8916 jdk-9+117
a8aa25fc6c5fda0ed7a93b8ffee62da326a752fc jdk-9+118
+f92e8518bb34a9628b11e662bf7308561a55eb3b jdk-9+119
+ecbe72546137cd29cb73d4dcc81cc099e847d543 jdk-9+120
diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
index 5563a90c7ec..0750429a33b 100644
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
@@ -427,7 +427,7 @@ public final class TemplatesImpl implements Templates, Serializable {
Layer bootLayer = Layer.boot();
Configuration cf = bootLayer.configuration()
- .resolveRequires(finder, ModuleFinder.empty(), Set.of(mn));
+ .resolveRequires(finder, ModuleFinder.of(), Set.of(mn));
PrivilegedAction pa = () -> bootLayer.defineModules(cf, name -> loader);
Layer layer = AccessController.doPrivileged(pa);
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogResolverImpl.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogResolverImpl.java
index 131d87e354f..08e7f417256 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogResolverImpl.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogResolverImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -56,7 +56,7 @@ final class CatalogResolverImpl implements CatalogResolver {
publicId = Normalizer.normalizePublicId(Normalizer.decodeURN(Util.getNotNullOrEmpty(publicId)));
//check whether systemId is an urn
- if (systemId != null && systemId.startsWith("urn:publicid:")) {
+ if (systemId != null && systemId.startsWith(Util.URN)) {
systemId = Normalizer.decodeURN(systemId);
if (publicId != null && !publicId.equals(systemId)) {
systemId = null;
@@ -67,7 +67,7 @@ final class CatalogResolverImpl implements CatalogResolver {
}
CatalogImpl c = (CatalogImpl)catalog;
- String resolvedSystemId = resolve(c, publicId, systemId);
+ String resolvedSystemId = Util.resolve(c, publicId, systemId);
if (resolvedSystemId != null) {
return new InputSource(resolvedSystemId);
@@ -86,55 +86,4 @@ final class CatalogResolverImpl implements CatalogResolver {
return null;
}
- /**
- * Resolves the publicId or systemId using public or system entries in the catalog.
- *
- * The resolution follows the following rules determined by the prefer setting:
- *
- * prefer "system": attempts to resolve with a system entry;
- * attempts to resolve with a public entry when only
- * publicId is specified.
- *
- * prefer "public": attempts to resolve with a system entry;
- * attempts to resolve with a public entry if no matching
- * system entry is found.
- * @param catalog the catalog
- * @param publicId the publicId
- * @param systemId the systemId
- * @return the resolved systemId if a match is found, null otherwise
- */
- String resolve(CatalogImpl catalog, String publicId, String systemId) {
- String resolvedSystemId = null;
-
- //search the current catalog
- catalog.reset();
- if (systemId != null) {
- /*
- If a system identifier is specified, it is used no matter how
- prefer is set.
- */
- resolvedSystemId = catalog.matchSystem(systemId);
- }
-
- if (resolvedSystemId == null && publicId != null) {
- resolvedSystemId = catalog.matchPublic(publicId);
- }
-
- //mark the catalog as having been searched before trying alternatives
- catalog.markAsSearched();
-
- //search alternative catalogs
- if (resolvedSystemId == null) {
- Iterator iter = catalog.catalogs().iterator();
- while (iter.hasNext()) {
- resolvedSystemId = resolve((CatalogImpl)iter.next(), publicId, systemId);
- if (resolvedSystemId != null) {
- break;
- }
-
- }
- }
-
- return resolvedSystemId;
- }
}
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogUriResolverImpl.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogUriResolverImpl.java
index e7cb9bcf1a7..497aacf18fd 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogUriResolverImpl.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogUriResolverImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -65,18 +65,30 @@ final class CatalogUriResolverImpl implements CatalogUriResolver {
if (href == null) return null;
+ String result = null;
CatalogImpl c = (CatalogImpl)catalog;
String uri = Normalizer.normalizeURI(href);
- String result;
-
- //remove fragment if any.
- int hashPos = uri.indexOf("#");
- if (hashPos >= 0) {
- uri = uri.substring(0, hashPos);
+ //check whether uri is an urn
+ if (uri != null && uri.startsWith(Util.URN)) {
+ String publicId = Normalizer.decodeURN(uri);
+ if (publicId != null) {
+ result = Util.resolve(c, publicId, null);
+ }
}
- //search the current catalog
- result = resolve(c, uri);
+ //if no match with a public id, continue search for an URI
+ if (result == null) {
+ //remove fragment if any.
+ int hashPos = uri.indexOf("#");
+ if (hashPos >= 0) {
+ uri = uri.substring(0, hashPos);
+ }
+
+ //search the current catalog
+ result = resolve(c, uri);
+ }
+
+ //Report error or return the URI as is when no match is found
if (result == null) {
GroupEntry.ResolveType resolveType = c.getResolve();
switch (resolveType) {
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/GroupEntry.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/GroupEntry.java
index 0ebf25e4207..2c1a59c360c 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/GroupEntry.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/GroupEntry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -298,6 +298,9 @@ class GroupEntry extends BaseEntry {
case PUBLIC:
match = ((PublicEntry) entry).match(publicId);
break;
+ case URI:
+ match = ((UriEntry) entry).match(publicId);
+ break;
case GROUP:
match = ((GroupEntry) entry).matchPublic(publicId);
break;
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/Normalizer.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/Normalizer.java
index 6beb4a8287d..d5b19930c01 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/Normalizer.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/Normalizer.java
@@ -100,7 +100,7 @@ class Normalizer {
} catch (UnsupportedEncodingException ex) {
CatalogMessages.reportRunTimeError(CatalogMessages.ERR_OTHER, ex);
}
- return "urn:publicid:" + urn;
+ return Util.URN + urn;
}
/**
@@ -114,7 +114,7 @@ class Normalizer {
static String decodeURN(String urn) {
String publicId;
- if (urn != null && urn.startsWith("urn:publicid:")) {
+ if (urn != null && urn.startsWith(Util.URN)) {
publicId = urn.substring(13);
} else {
return urn;
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/UriEntry.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/UriEntry.java
index 498b7ae4ce1..0c1aa295c9c 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/UriEntry.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/UriEntry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -52,7 +52,11 @@ final class UriEntry extends BaseEntry {
*/
public void setName(String name) {
CatalogMessages.reportNPEOnNull("name", name);
- this.name = Normalizer.normalizeURI(name);
+ if (name.startsWith(Util.PUBLICID_PREFIX) || name.startsWith(Util.PUBLICID_PREFIX_ALT)) {
+ this.name = Normalizer.normalizePublicId(name);
+ } else {
+ this.name = Normalizer.normalizeURI(name);
+ }
}
/**
@@ -72,6 +76,7 @@ final class UriEntry extends BaseEntry {
public String getName() {
return name;
}
+
/**
* Get the uri attribute.
* @return The uri attribute value.
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/Util.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/Util.java
index f0fd1fdbf33..b164f674dbd 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/Util.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/Util.java
@@ -31,6 +31,7 @@ import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
+import java.util.Iterator;
import jdk.xml.internal.SecuritySupport;
/**
@@ -38,6 +39,61 @@ import jdk.xml.internal.SecuritySupport;
* @since 9
*/
class Util {
+ final static String URN = "urn:publicid:";
+ final static String PUBLICID_PREFIX = "-//";
+ final static String PUBLICID_PREFIX_ALT = "+//";
+
+ /**
+ * Finds an entry in the catalog that matches with the publicId or systemId.
+ *
+ * The resolution follows the following rules determined by the prefer setting:
+ *
+ * prefer "system": attempts to resolve with a system entry;
+ * attempts to resolve with a public entry when only
+ * publicId is specified.
+ *
+ * prefer "public": attempts to resolve with a system entry;
+ * attempts to resolve with a public entry if no matching
+ * system entry is found.
+ * @param catalog the catalog
+ * @param publicId the publicId
+ * @param systemId the systemId
+ * @return the resolved systemId if a match is found, null otherwise
+ */
+ static String resolve(CatalogImpl catalog, String publicId, String systemId) {
+ String resolvedSystemId = null;
+
+ //search the current catalog
+ catalog.reset();
+ if (systemId != null) {
+ /*
+ If a system identifier is specified, it is used no matter how
+ prefer is set.
+ */
+ resolvedSystemId = catalog.matchSystem(systemId);
+ }
+
+ if (resolvedSystemId == null && publicId != null) {
+ resolvedSystemId = catalog.matchPublic(publicId);
+ }
+
+ //mark the catalog as having been searched before trying alternatives
+ catalog.markAsSearched();
+
+ //search alternative catalogs
+ if (resolvedSystemId == null) {
+ Iterator iter = catalog.catalogs().iterator();
+ while (iter.hasNext()) {
+ resolvedSystemId = resolve((CatalogImpl)iter.next(), publicId, systemId);
+ if (resolvedSystemId != null) {
+ break;
+ }
+
+ }
+ }
+
+ return resolvedSystemId;
+ }
/**
* Resolves the specified file path to an absolute systemId. If it is
diff --git a/jaxp/src/java.xml/share/classes/org/w3c/dom/package.html b/jaxp/src/java.xml/share/classes/org/w3c/dom/package.html
index a95de6c6ea7..673366bf326 100644
--- a/jaxp/src/java.xml/share/classes/org/w3c/dom/package.html
+++ b/jaxp/src/java.xml/share/classes/org/w3c/dom/package.html
@@ -4,9 +4,9 @@
Provides the interfaces for the Document Object Model (DOM). Supports the
-Document Object Model Level 2 Core APIi,
-Document Object Model (DOM) Level 3 Core,
-and Document Object Model (DOM) Level 3 Load and Save.
+Document Object Model (DOM) Level 2 Core Specification,
+Document Object Model (DOM) Level 3 Core Specification,
+and Document Object Model (DOM) Level 3 Load and Save Specification.
@since 1.4
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSS2Properties.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSS2Properties.java
index d22de1d5182..56c63fa06d8 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSS2Properties.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSS2Properties.java
@@ -92,7 +92,7 @@ import org.w3c.dom.DOMException;
* property with a value of "menu", querying for the values of the component
* longhand properties should return the empty string.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSS2Properties {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSCharsetRule.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSCharsetRule.java
index 10a64ab98ed..1241cacdf5f 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSCharsetRule.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSCharsetRule.java
@@ -59,7 +59,7 @@ import org.w3c.dom.DOMException;
* header, has priority (see CSS document representation) but this is not
* reflected in the CSSCharsetRule.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSSCharsetRule extends CSSRule {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSFontFaceRule.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSFontFaceRule.java
index b4f6892c8a9..1a7e1a1c20c 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSFontFaceRule.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSFontFaceRule.java
@@ -46,7 +46,7 @@ package org.w3c.dom.css;
* a CSS style sheet. The @font-face rule is used to hold a set
* of font descriptions.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSSFontFaceRule extends CSSRule {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSImportRule.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSImportRule.java
index a9d321a91a2..e81d9a0f583 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSImportRule.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSImportRule.java
@@ -48,7 +48,7 @@ import org.w3c.dom.stylesheets.MediaList;
* a CSS style sheet. The @import rule is used to import style
* rules from other style sheets.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSSImportRule extends CSSRule {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSMediaRule.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSMediaRule.java
index bf153d92321..b102a8a57b8 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSMediaRule.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSMediaRule.java
@@ -49,7 +49,7 @@ import org.w3c.dom.stylesheets.MediaList;
* style sheet. A @media rule can be used to delimit style
* rules for specific media types.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSSMediaRule extends CSSRule {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSPageRule.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSPageRule.java
index 773b7463ce5..fc73252dcb5 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSPageRule.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSPageRule.java
@@ -48,7 +48,7 @@ import org.w3c.dom.DOMException;
* CSS style sheet. The @page rule is used to specify the
* dimensions, orientation, margins, etc. of a page box for paged media.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSSPageRule extends CSSRule {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSPrimitiveValue.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSPrimitiveValue.java
index 3078d724cbf..2646a032d66 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSPrimitiveValue.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSPrimitiveValue.java
@@ -61,7 +61,7 @@ import org.w3c.dom.DOMException;
* the range 0-255, a color percentage value can be converted to a number;
* (see also the RGBColor interface).
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSSPrimitiveValue extends CSSValue {
// UnitTypes
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSRule.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSRule.java
index f81d0d509f4..338f490eb77 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSRule.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSRule.java
@@ -50,7 +50,7 @@ import org.w3c.dom.DOMException;
* sheet, even if the rule is not recognized by the parser. Unrecognized
* rules are represented using the CSSUnknownRule interface.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSSRule {
// RuleType
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSRuleList.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSRuleList.java
index 33840ef3314..dd6f033bfd4 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSRuleList.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSRuleList.java
@@ -47,7 +47,7 @@ package org.w3c.dom.css;
*
The items in the CSSRuleList are accessible via an
* integral index, starting from 0.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSSRuleList {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSStyleDeclaration.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSStyleDeclaration.java
index de63268f838..c6bd17f9b2d 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSStyleDeclaration.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSStyleDeclaration.java
@@ -60,7 +60,7 @@ import org.w3c.dom.DOMException;
* interface. The CSS Object Model doesn't provide an access to the
* specified or actual values of the CSS cascade.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSSStyleDeclaration {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSStyleRule.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSStyleRule.java
index e165cd18928..5e0e92dcd86 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSStyleRule.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSStyleRule.java
@@ -47,7 +47,7 @@ import org.w3c.dom.DOMException;
* The CSSStyleRule interface represents a single rule set in a
* CSS style sheet.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSSStyleRule extends CSSRule {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSStyleSheet.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSStyleSheet.java
index d3cf723367e..2c021dc6c45 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSStyleSheet.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSStyleSheet.java
@@ -49,7 +49,7 @@ import org.w3c.dom.stylesheets.StyleSheet;
* represent a CSS style sheet i.e., a style sheet whose content type is
* "text/css".
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSSStyleSheet extends StyleSheet {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSUnknownRule.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSUnknownRule.java
index 0b1d87be9c3..8b7b3f6d29e 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSUnknownRule.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSUnknownRule.java
@@ -45,7 +45,7 @@ package org.w3c.dom.css;
* The CSSUnknownRule interface represents an at-rule not
* supported by this user agent.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSSUnknownRule extends CSSRule {
}
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSValue.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSValue.java
index ae4effa0fa2..54aa703ffe9 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSValue.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSValue.java
@@ -48,7 +48,7 @@ import org.w3c.dom.DOMException;
* value. A CSSValue object only occurs in a context of a CSS
* property.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSSValue {
// UnitTypes
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSValueList.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSValueList.java
index 1567399d734..db62e1c7c9e 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSValueList.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/CSSValueList.java
@@ -50,7 +50,7 @@ package org.w3c.dom.css;
*
The items in the CSSValueList are accessible via an
* integral index, starting from 0.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface CSSValueList extends CSSValue {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/Counter.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/Counter.java
index 44a299307c7..9da6a1980b4 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/Counter.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/Counter.java
@@ -46,7 +46,7 @@ package org.w3c.dom.css;
* counters function value. This interface reflects the values in the
* underlying style property.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface Counter {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/DOMImplementationCSS.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/DOMImplementationCSS.java
index 2aeb37e3ede..b047fcb0f55 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/DOMImplementationCSS.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/DOMImplementationCSS.java
@@ -49,7 +49,7 @@ import org.w3c.dom.DOMException;
* outside the context of a document. There is no way to associate the new
* CSSStyleSheet with a document in DOM Level 2.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface DOMImplementationCSS extends DOMImplementation {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/DocumentCSS.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/DocumentCSS.java
index 47399a77716..f68b9e2d458 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/DocumentCSS.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/DocumentCSS.java
@@ -62,7 +62,7 @@ import org.w3c.dom.stylesheets.DocumentStyle;
* interface can be obtained by using binding-specific casting methods on an
* instance of the Document interface.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface DocumentCSS extends DocumentStyle {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/ElementCSSInlineStyle.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/ElementCSSInlineStyle.java
index c7e70539f1e..2822d91df9b 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/ElementCSSInlineStyle.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/ElementCSSInlineStyle.java
@@ -50,7 +50,7 @@ package org.w3c.dom.css;
* binding-specific casting methods on an instance of the Element interface
* when the element supports inline CSS style informations.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface ElementCSSInlineStyle {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/RGBColor.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/RGBColor.java
index 7d374581264..00bb4514c25 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/RGBColor.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/RGBColor.java
@@ -55,7 +55,7 @@ package org.w3c.dom.css;
*
A color percentage value can always be converted to a number and vice
* versa.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface RGBColor {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/Rect.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/Rect.java
index b9e69563002..e8e0a73db15 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/Rect.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/Rect.java
@@ -47,7 +47,7 @@ package org.w3c.dom.css;
* modifications made to the CSSPrimitiveValue objects modify
* the style property.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface Rect {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/ViewCSS.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/ViewCSS.java
index 38b22b30d40..caf705c9e61 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/ViewCSS.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/css/ViewCSS.java
@@ -55,7 +55,7 @@ import org.w3c.dom.views.AbstractView;
* CSSStyleDeclaration and CSSValue related to
* this declaration are no longer valid.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface ViewCSS extends AbstractView {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLAnchorElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLAnchorElement.java
index 8e4f6e797ce..9eb9f85c167 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLAnchorElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLAnchorElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* The anchor element. See the A element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLAnchorElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLAppletElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLAppletElement.java
index d1593195640..21ab47b9789 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLAppletElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLAppletElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* An embedded Java applet. See the APPLET element definition in HTML 4.0.
* This element is deprecated in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLAppletElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLAreaElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLAreaElement.java
index f51cc31b0f4..743d3991a18 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLAreaElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLAreaElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* Client-side image map area definition. See the AREA element definition in
* HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLAreaElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBRElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBRElement.java
index f35212f90b6..3745d48ec6b 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBRElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBRElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Force a line break. See the BR element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLBRElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBaseElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBaseElement.java
index 69f518b08dd..473b492e66d 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBaseElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBaseElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Document base URI. See the BASE element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLBaseElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBaseFontElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBaseFontElement.java
index 68ed6114faf..327ef9d6e4d 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBaseFontElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBaseFontElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* Base font. See the BASEFONT element definition in HTML 4.0. This element
* is deprecated in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLBaseFontElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBodyElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBodyElement.java
index d0f2e450fc6..ad14b86d9fc 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBodyElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLBodyElement.java
@@ -46,6 +46,8 @@ package org.w3c.dom.html;
* even if the tags are not present in the source document. See the BODY
* element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLBodyElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLButtonElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLButtonElement.java
index 8d45dbf7760..578b68605fb 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLButtonElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLButtonElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Push button. See the BUTTON element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLButtonElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLCollection.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLCollection.java
index 1c87fd9624c..f59ae97a804 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLCollection.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLCollection.java
@@ -50,6 +50,8 @@ import org.w3c.dom.Node;
* to be live meaning that they are automatically updated when the
* underlying document is changed.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLCollection {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDListElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDListElement.java
index 8e0dad949e8..3b7475817e7 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDListElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDListElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Definition list. See the DL element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLDListElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDOMImplementation.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDOMImplementation.java
index 4d155416166..698f097de97 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDOMImplementation.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDOMImplementation.java
@@ -47,7 +47,8 @@ import org.w3c.dom.DOMImplementation;
* The HTMLDOMImplementation interface extends the
* DOMImplementation interface with a method for creating an
* HTML document instance.
- * @since DOM Level 2
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLDOMImplementation extends DOMImplementation {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDirectoryElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDirectoryElement.java
index 0fb33900004..19fbc96b023 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDirectoryElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDirectoryElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* Directory list. See the DIR element definition in HTML 4.0. This element
* is deprecated in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLDirectoryElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDivElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDivElement.java
index ee1b727ebce..f204f284a2e 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDivElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDivElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Generic block container. See the DIV element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLDivElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDocument.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDocument.java
index 5116fc539b1..06e6eb7c6ae 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDocument.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLDocument.java
@@ -55,6 +55,8 @@ import org.w3c.dom.NodeList;
* getElementById is inherited from the Document
* interface where it was moved.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLDocument extends Document {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLElement.java
index b5b178a6c94..cc0727ee570 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLElement.java
@@ -53,6 +53,8 @@ import org.w3c.dom.Element;
* of an HTML element is accessible through the
* ElementCSSInlineStyle interface which is defined in the .
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLElement extends Element {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFieldSetElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFieldSetElement.java
index cb2c0bd4090..0c650d1d970 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFieldSetElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFieldSetElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* Organizes form controls into logical groups. See the FIELDSET element
* definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLFieldSetElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFontElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFontElement.java
index c8fc157837f..b9a0c7b919c 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFontElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFontElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* Local change to font. See the FONT element definition in HTML 4.0. This
* element is deprecated in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLFontElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFormElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFormElement.java
index 42e2edd2944..0c00bd27334 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFormElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFormElement.java
@@ -47,6 +47,8 @@ package org.w3c.dom.html;
* as well as the attributes of the form element. See the FORM element
* definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLFormElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFrameElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFrameElement.java
index 5ffa4252484..92891a90c32 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFrameElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFrameElement.java
@@ -46,6 +46,8 @@ import org.w3c.dom.Document;
/**
* Create a frame. See the FRAME element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLFrameElement extends HTMLElement {
/**
@@ -107,7 +109,7 @@ public interface HTMLFrameElement extends HTMLElement {
/**
* The document this frame contains, if there is any and it is available,
* or null otherwise.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Document getContentDocument();
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFrameSetElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFrameSetElement.java
index fb6f7e988aa..60112d7ada8 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFrameSetElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLFrameSetElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Create a grid of frames. See the FRAMESET element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLFrameSetElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHRElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHRElement.java
index 334c04ded25..c0fbfda600e 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHRElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHRElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Create a horizontal rule. See the HR element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLHRElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHeadElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHeadElement.java
index 8894d32555b..319e6a58741 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHeadElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHeadElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Document head information. See the HEAD element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLHeadElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHeadingElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHeadingElement.java
index 0cd4efebb11..f46bf5b0a95 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHeadingElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHeadingElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* For the H1 to H6 elements. See the H1 element
* definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLHeadingElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHtmlElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHtmlElement.java
index a2fa379dd4f..75a6cfa80f1 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHtmlElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLHtmlElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Root of an HTML document. See the HTML element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLHtmlElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLIFrameElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLIFrameElement.java
index 08c198869d8..7a7ffd64d99 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLIFrameElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLIFrameElement.java
@@ -46,6 +46,8 @@ import org.w3c.dom.Document;
/**
* Inline subwindows. See the IFRAME element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLIFrameElement extends HTMLElement {
/**
@@ -120,7 +122,7 @@ public interface HTMLIFrameElement extends HTMLElement {
/**
* The document this frame contains, if there is any and it is available,
* or null otherwise.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Document getContentDocument();
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLImageElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLImageElement.java
index 7fced61b712..238464de945 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLImageElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLImageElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Embedded image. See the IMG element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLImageElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLInputElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLInputElement.java
index b58d8b8fe40..15d6d035184 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLInputElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLInputElement.java
@@ -48,6 +48,8 @@ package org.w3c.dom.html;
* be masked to prevent unauthorized use. See the INPUT element definition
* in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLInputElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLIsIndexElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLIsIndexElement.java
index 111edde09a5..2766c9ee8ec 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLIsIndexElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLIsIndexElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* This element is used for single-line text input. See the ISINDEX element
* definition in HTML 4.0. This element is deprecated in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLIsIndexElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLIElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLIElement.java
index f4113f1bbca..e368c51797c 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLIElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLIElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* List item. See the LI element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLLIElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLabelElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLabelElement.java
index d3fd6bea44f..d9bc78a5d15 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLabelElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLabelElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Form field label text. See the LABEL element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLLabelElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLegendElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLegendElement.java
index ffe0816295c..f9b54902d83 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLegendElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLegendElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* Provides a caption for a FIELDSET grouping. See the LEGEND
* element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLLegendElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLinkElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLinkElement.java
index cc03164243f..0824d0c823a 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLinkElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLLinkElement.java
@@ -47,6 +47,8 @@ package org.w3c.dom.html;
* See the LINK element definition in HTML 4.0 (see also the
* LinkStyle interface in the module).
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLLinkElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLMapElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLMapElement.java
index f2b42224186..cb834e64872 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLMapElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLMapElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Client-side image map. See the MAP element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLMapElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLMenuElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLMenuElement.java
index b5798796e3c..cd7ea2b2108 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLMenuElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLMenuElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* Menu list. See the MENU element definition in HTML 4.0. This element is
* deprecated in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLMenuElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLMetaElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLMetaElement.java
index 38920e452c3..4b6e2538448 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLMetaElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLMetaElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* This contains generic meta-information about the document. See the META
* element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLMetaElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLModElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLModElement.java
index cfd96a1090b..17e36db665d 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLModElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLModElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* Notice of modification to part of a document. See the INS and DEL
* element definitions in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLModElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLOListElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLOListElement.java
index 728e760faef..9599c48182a 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLOListElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLOListElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Ordered list. See the OL element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLOListElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLObjectElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLObjectElement.java
index 972091bfe9f..2e1e631dfa2 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLObjectElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLObjectElement.java
@@ -49,6 +49,8 @@ import org.w3c.dom.Document;
* read-only once the underlying object is instantiated. See the OBJECT
* element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLObjectElement extends HTMLElement {
/**
@@ -181,7 +183,7 @@ public interface HTMLObjectElement extends HTMLElement {
/**
* The document this object contains, if there is any and it is
* available, or null otherwise.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Document getContentDocument();
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLOptGroupElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLOptGroupElement.java
index edddf36c7ad..de00e8ca038 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLOptGroupElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLOptGroupElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* Group options together in logical subdivisions. See the OPTGROUP element
* definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLOptGroupElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLOptionElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLOptionElement.java
index 273658837e8..22e348bdfdf 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLOptionElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLOptionElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* A selectable choice. See the OPTION element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLOptionElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLParagraphElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLParagraphElement.java
index a7dc5d6bcdb..c5e43b4d8f6 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLParagraphElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLParagraphElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Paragraphs. See the P element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLParagraphElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLParamElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLParamElement.java
index 6b18476212c..b7b86648dd3 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLParamElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLParamElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* Parameters fed to the OBJECT element. See the PARAM element
* definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLParamElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLPreElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLPreElement.java
index 40b199f5341..a8bce79253f 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLPreElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLPreElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Preformatted text. See the PRE element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLPreElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLQuoteElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLQuoteElement.java
index 61abf1f6d08..db0b10de891 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLQuoteElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLQuoteElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* For the Q and BLOCKQUOTE elements. See the Q
* element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLQuoteElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLScriptElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLScriptElement.java
index 5004a41c07a..9931a02817d 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLScriptElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLScriptElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Script statements. See the SCRIPT element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLScriptElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLSelectElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLSelectElement.java
index 9611cca1d24..85d6c21ea1d 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLSelectElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLSelectElement.java
@@ -48,6 +48,8 @@ import org.w3c.dom.DOMException;
* options can be directly accessed through the select element as a
* collection. See the SELECT element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLSelectElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLStyleElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLStyleElement.java
index d811e854b4e..5e7b99fb38f 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLStyleElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLStyleElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* Style information. See the STYLE element definition in HTML 4.0, the
* module and the LinkStyle interface in the module.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLStyleElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableCaptionElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableCaptionElement.java
index b800137a3c1..f2126d36091 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableCaptionElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableCaptionElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Table caption See the CAPTION element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLTableCaptionElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableCellElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableCellElement.java
index b7debbf70ab..53b41023e50 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableCellElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableCellElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* The object used to represent the TH and TD
* elements. See the TD element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLTableCellElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableColElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableColElement.java
index d7ece0ff308..fcf413f5270 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableColElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableColElement.java
@@ -45,6 +45,8 @@ package org.w3c.dom.html;
* Regroups the COL and COLGROUP elements. See the
* COL element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLTableColElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableElement.java
index f57d51cdfaa..d73421aba5c 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableElement.java
@@ -52,6 +52,8 @@ import org.w3c.dom.DOMException;
* existing THead or TFoot element. See the TABLE element definition in HTML
* 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLTableElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableRowElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableRowElement.java
index a24ff429264..fed6b205b2c 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableRowElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableRowElement.java
@@ -46,6 +46,8 @@ import org.w3c.dom.DOMException;
/**
* A row in a table. See the TR element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLTableRowElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableSectionElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableSectionElement.java
index f6c3cfa17d3..e68156d35eb 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableSectionElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTableSectionElement.java
@@ -47,6 +47,8 @@ import org.w3c.dom.DOMException;
* The THEAD , TFOOT , and TBODY
* elements.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLTableSectionElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTextAreaElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTextAreaElement.java
index 1546a7dacf6..85afebaaa21 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTextAreaElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTextAreaElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Multi-line text field. See the TEXTAREA element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLTextAreaElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTitleElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTitleElement.java
index 9b3c1cb61da..166f783c0ea 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTitleElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLTitleElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* The document title. See the TITLE element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLTitleElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLUListElement.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLUListElement.java
index cd4386afa1e..b58342ed1dc 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLUListElement.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/html/HTMLUListElement.java
@@ -44,6 +44,8 @@ package org.w3c.dom.html;
/**
* Unordered list. See the UL element definition in HTML 4.0.
*
See also the Document Object Model (DOM) Level 2 Specification.
+ *
+ * @since 1.4, DOM Level 2
*/
public interface HTMLUListElement extends HTMLElement {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/DocumentStyle.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/DocumentStyle.java
index 2be39e75e6a..2c8ce7059d7 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/DocumentStyle.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/DocumentStyle.java
@@ -48,7 +48,7 @@ package org.w3c.dom.stylesheets;
* obtained by using binding-specific casting methods on an instance of the
* Document interface.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface DocumentStyle {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/LinkStyle.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/LinkStyle.java
index 9bd7b68d554..496bc641f9f 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/LinkStyle.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/LinkStyle.java
@@ -49,7 +49,7 @@ package org.w3c.dom.stylesheets;
* linking node (HTMLLinkElement, HTMLStyleElement
* or ProcessingInstruction in DOM Level 2).
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface LinkStyle {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/MediaList.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/MediaList.java
index 1a82767d78d..ba571664492 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/MediaList.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/MediaList.java
@@ -51,7 +51,7 @@ import org.w3c.dom.DOMException;
*
The items in the MediaList are accessible via an integral
* index, starting from 0.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface MediaList {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/StyleSheet.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/StyleSheet.java
index 617c68e0f3b..40df3088818 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/StyleSheet.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/StyleSheet.java
@@ -51,7 +51,7 @@ import org.w3c.dom.Node;
* an inline STYLE element. In XML, this interface represents an external
* style sheet, included via a style sheet processing instruction.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface StyleSheet {
/**
diff --git a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/StyleSheetList.java b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/StyleSheetList.java
index 6cd52541169..468f0c1815d 100644
--- a/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/StyleSheetList.java
+++ b/jaxp/src/jdk.xml.dom/share/classes/org/w3c/dom/stylesheets/StyleSheetList.java
@@ -47,7 +47,7 @@ package org.w3c.dom.stylesheets;
*
The items in the StyleSheetList are accessible via an
* integral index, starting from 0.
*
See also the Document Object Model (DOM) Level 2 Style Specification.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public interface StyleSheetList {
/**
diff --git a/jaxp/test/Makefile b/jaxp/test/Makefile
index bf94d252889..63f19044ef9 100644
--- a/jaxp/test/Makefile
+++ b/jaxp/test/Makefile
@@ -265,7 +265,10 @@ jaxp_%:
# ------------------------------------------------------------------
ifdef CONCURRENCY
- EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
+ JTREG_BASIC_OPTIONS += -concurrency:$(CONCURRENCY)
+endif
+ifdef EXTRA_JTREG_OPTIONS
+ JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
endif
# Default JTREG to run
@@ -290,8 +293,6 @@ JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION)
# Set the max memory for jtreg control vm
JTREG_MEMORY_OPTION = -J-Xmx512m
JTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION)
-# Add any extra options
-JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS)
# Set other vm and test options
JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%)
# Set the GC options for test vms
diff --git a/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/LayerModularXMLParserTest.java b/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/LayerModularXMLParserTest.java
index 3e157679b9e..74f051ac04d 100644
--- a/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/LayerModularXMLParserTest.java
+++ b/jaxp/test/javax/xml/jaxp/module/ServiceProviderTest/LayerModularXMLParserTest.java
@@ -21,7 +21,6 @@
* questions.
*/
-import static java.lang.module.ModuleFinder.empty;
import static org.testng.Assert.assertSame;
import static org.testng.Assert.assertTrue;
@@ -97,7 +96,7 @@ public class LayerModularXMLParserTest {
public void testOneLayer() throws Exception {
ModuleFinder finder1 = ModuleFinder.of(MOD_DIR1);
Configuration cf1 = Layer.boot().configuration()
- .resolveRequiresAndUses(finder1, empty(), Set.of("test"));
+ .resolveRequiresAndUses(finder1, ModuleFinder.of(), Set.of("test"));
ClassLoader scl = ClassLoader.getSystemClassLoader();
Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, scl);
ClassLoader cl1 = layer1.findLoader("test");
@@ -127,12 +126,12 @@ public class LayerModularXMLParserTest {
public void testTwoLayer() throws Exception {
ModuleFinder finder1 = ModuleFinder.of(MOD_DIR1);
Configuration cf1 = Layer.boot().configuration()
- .resolveRequiresAndUses(finder1, empty(), Set.of("test"));
+ .resolveRequiresAndUses(finder1, ModuleFinder.of(), Set.of("test"));
ClassLoader scl = ClassLoader.getSystemClassLoader();
Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, scl);
ModuleFinder finder2 = ModuleFinder.of(MOD_DIR2);
- Configuration cf2 = cf1.resolveRequiresAndUses(finder2, empty(), Set.of("test"));
+ Configuration cf2 = cf1.resolveRequiresAndUses(finder2, ModuleFinder.of(), Set.of("test"));
Layer layer2 = layer1.defineModulesWithOneLoader(cf2, layer1.findLoader("test"));
ClassLoader cl2 = layer2.findLoader("test");
@@ -161,12 +160,12 @@ public class LayerModularXMLParserTest {
public void testTwoLayerWithDuplicate() throws Exception {
ModuleFinder finder1 = ModuleFinder.of(MOD_DIR1, MOD_DIR2);
Configuration cf1 = Layer.boot().configuration()
- .resolveRequiresAndUses(finder1, empty(), Set.of("test"));
+ .resolveRequiresAndUses(finder1, ModuleFinder.of(), Set.of("test"));
ClassLoader scl = ClassLoader.getSystemClassLoader();
Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, scl);
ModuleFinder finder2 = ModuleFinder.of(MOD_DIR2);
- Configuration cf2 = cf1.resolveRequiresAndUses(finder2, empty(), Set.of("test"));
+ Configuration cf2 = cf1.resolveRequiresAndUses(finder2, ModuleFinder.of(), Set.of("test"));
Layer layer2 = layer1.defineModulesWithOneLoader(cf2, layer1.findLoader("test"));
ClassLoader cl2 = layer2.findLoader("test");
diff --git a/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java b/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java
index 01bf4f63e89..dc5e8816bfd 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java
@@ -34,6 +34,7 @@ import javax.xml.catalog.CatalogUriResolver;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Source;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
@@ -67,6 +68,24 @@ public class CatalogTest {
}
}
+ /*
+ * @bug 8156845
+ * Verifies that an URI reference with a urn:publicid is correctly resolved
+ * with an uri entry with a publicId.
+ *
+ * @param expectedFile is not used in this test, it's kept since we're
+ * copying the JCK test and its dataProvider. This test may be reused for
+ * other cases in that test.
+ */
+ @Test(dataProvider = "resolveUri")
+ public void testMatch1(String cFile, String href, String expectedFile, String expectedUri, String msg) {
+ String catalogFile = getClass().getResource(cFile).getFile();
+ CatalogUriResolver cur = CatalogManager.catalogUriResolver(CatalogFeatures.defaults(), catalogFile);
+ Source source = cur.resolve(href, null);
+ Assert.assertNotNull(source, "Source returned is null");
+ Assert.assertEquals(expectedUri, source.getSystemId(), msg);
+ }
+
/*
* @bug 8154220
* Verifies that the file input is validated properly. Valid input includes
@@ -329,6 +348,21 @@ public class CatalogTest {
}
}
+
+ /*
+ DataProvider: used to verify CatalogUriResolver's resolve function.
+ Data columns:
+ catalog, uri or publicId, expectedFile, expectedUri, msg
+
+ This DataProvider is copied from JCK ResolveTests' dataMatch1
+ */
+ @DataProvider(name = "resolveUri")
+ Object[][] getDataForUriResolver() {
+ return new Object[][]{
+ {"uri.xml", "urn:publicid:-:Acme,+Inc.:DTD+Book+Version+1.0", null, "http://local/base/dtd/book.dtd", "Uri in publicId namespace is incorrectly unwrapped"},
+ };
+ }
+
/*
DataProvider: used to verify hierarchical catalogs. Refer to JCK test
hierarchyOfCatFiles2.
diff --git a/jaxp/test/javax/xml/jaxp/unittest/catalog/uri.xml b/jaxp/test/javax/xml/jaxp/unittest/catalog/uri.xml
new file mode 100644
index 00000000000..f092ae85df2
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/catalog/uri.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index 4d92200f4dc..b7d3abb35f7 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -364,3 +364,5 @@ b314bb02182b9ca94708a91f312c377f5435f740 jdk-9+114
529f0bf896e58525614d863e283ad155531941cb jdk-9+116
58265b39fc74b932bda4d4f4649c530a89f55c4e jdk-9+117
6ba73d04589ccc0705a5d8ae5111b63632b6ad20 jdk-9+118
+331a825f849afd2e5126c93c88e55bd9ef0c6b8f jdk-9+119
+ecd0d6a71c7ccf93584ba4dacdd4fa8455efd741 jdk-9+120
diff --git a/jdk/.hgtags b/jdk/.hgtags
index 2b6d80debed..7ac8e6be416 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -361,3 +361,5 @@ bb8379287f3736f38c52b2d1418784e2592461d1 jdk-9+114
baeb5edb38939cdb78ae0ac6f4fd368465cbf188 jdk-9+116
4da0f73ce03aaf245b92cc040cc0ab0e3fa54dc2 jdk-9+117
e1eba5cfa5cc8c66d524396a05323dc93568730a jdk-9+118
+bad3f8a33db271a6143ba6eac0c8bd5bbd942417 jdk-9+119
+b9a518bf72516954e57ac2f6e3ef21e13008f1cd jdk-9+120
diff --git a/jdk/make/Import.gmk b/jdk/make/Import.gmk
index d479b095514..29e4ce0f19e 100644
--- a/jdk/make/Import.gmk
+++ b/jdk/make/Import.gmk
@@ -112,7 +112,7 @@ $(BASE_INSTALL_LIBRARIES_HERE)/server/%$(SHARED_LIBRARY_SUFFIX): $(BASE_INSTALL_
$(LN) -s ../$(@F) $@
ifeq ($(OPENJDK_TARGET_OS), macosx)
- $(BASE_INSTALL_LIBRARIES_HERE)/server/%.dSYM : $(BASE_INSTALL_LIBRARIES_HERE)/%.dSYM
+ $(BASE_INSTALL_LIBRARIES_HERE)/server/%.dSYM:
$(MKDIR) -p $(@D)
$(RM) $@
$(LN) -s ../$(@F) $@
diff --git a/jdk/make/data/currency/CurrencyData.properties b/jdk/make/data/currency/CurrencyData.properties
index 808d01d6958..0288b04390b 100644
--- a/jdk/make/data/currency/CurrencyData.properties
+++ b/jdk/make/data/currency/CurrencyData.properties
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 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
@@ -26,7 +26,8 @@
# Version of the currency data format.
# 1: initial
# 2: Change in minor unit (allowing 4-9 digits)
-formatVersion=2
+# 3: Change in the order of special case and other currency entries
+formatVersion=3
# Version of the currency code information in this class.
# It is a serial number that accompanies with each amendment.
diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk
index 73b452f43f6..b4c6f5e20a3 100644
--- a/jdk/make/lib/Awt2dLibraries.gmk
+++ b/jdk/make/lib/Awt2dLibraries.gmk
@@ -96,10 +96,7 @@ ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
mlib_c_ImageAffine_BL.c \
mlib_c_ImageAffine_BL_S16.c \
mlib_c_ImageAffine_BL_U16.c \
- mlib_c_ImageAffineIndex_BC.c \
- mlib_c_ImageAffineIndex_BL.c \
mlib_c_ImageAffine_NN.c \
- mlib_c_ImageBlendTable.c \
mlib_c_ImageConvClearEdge.c \
mlib_c_ImageConvCopyEdge.c \
mlib_c_ImageConv_f.c \
@@ -107,14 +104,6 @@ ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
mlib_c_ImageCopy.c \
mlib_c_ImageLookUp.c \
mlib_c_ImageLookUp_f.c \
- mlib_v_ImageChannelExtract.c \
- mlib_v_ImageChannelExtract_f.c \
- mlib_v_ImageChannelInsert_34.c \
- mlib_v_ImageChannelInsert.c \
- mlib_v_ImageConvIndex3_8_16nw.c \
- mlib_v_ImageConvIndex3_8_8nw.c \
- mlib_v_ImageCopy.c \
- mlib_v_ImageCopy_blk.s \
#
LIBMLIB_IMAGE_V_CFLAGS += $(filter-out -DMLIB_NO_LIBSUNMATH, $(BUILD_LIBMLIB_CFLAGS))
diff --git a/jdk/make/mapfiles/libjava/mapfile-vers b/jdk/make/mapfiles/libjava/mapfile-vers
index 693f5a87fb8..8bd1118c1ff 100644
--- a/jdk/make/mapfiles/libjava/mapfile-vers
+++ b/jdk/make/mapfiles/libjava/mapfile-vers
@@ -267,6 +267,7 @@ SUNWprivate_1.1 {
Java_jdk_internal_misc_VM_geteuid;
Java_jdk_internal_misc_VM_getgid;
Java_jdk_internal_misc_VM_getegid;
+ Java_jdk_internal_misc_VM_getRuntimeArguments;
Java_jdk_internal_misc_VM_initialize;
Java_java_lang_reflect_Module_defineModule0;
diff --git a/jdk/make/src/classes/build/tools/cldrconverter/CLDRConverter.java b/jdk/make/src/classes/build/tools/cldrconverter/CLDRConverter.java
index f15834202b0..b72ac9225b1 100644
--- a/jdk/make/src/classes/build/tools/cldrconverter/CLDRConverter.java
+++ b/jdk/make/src/classes/build/tools/cldrconverter/CLDRConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -584,7 +584,9 @@ public class CLDRConverter {
String[] data = (String[])e[1];
if (map.get(TIMEZONE_ID_PREFIX + tzid) == null &&
- handlerMetaZones.get(tzid) == null) {
+ handlerMetaZones.get(tzid) == null ||
+ handlerMetaZones.get(tzid) != null &&
+ map.get(METAZONE_ID_PREFIX + handlerMetaZones.get(tzid)) == null) {
// First, check the CLDR meta key
Optional> cldrMeta =
handlerMetaZones.getData().entrySet().stream()
diff --git a/jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java b/jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java
index cc125638c96..ae861c5abe5 100644
--- a/jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java
+++ b/jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -121,7 +121,7 @@ public class GenerateCurrencyData {
private static final int maxOtherCurrencies = 128;
private static int otherCurrenciesCount = 0;
- private static StringBuffer otherCurrencies = new StringBuffer();
+ private static String[] otherCurrencies = new String[maxOtherCurrencies];
private static int[] otherCurrenciesDefaultFractionDigits = new int[maxOtherCurrencies];
private static int[] otherCurrenciesNumericCode= new int[maxOtherCurrencies];
@@ -318,10 +318,7 @@ public class GenerateCurrencyData {
if (otherCurrenciesCount == maxOtherCurrencies) {
throw new RuntimeException("too many other currencies");
}
- if (otherCurrencies.length() > 0) {
- otherCurrencies.append('-');
- }
- otherCurrencies.append(currencyCode);
+ otherCurrencies[otherCurrenciesCount] = currencyCode;
otherCurrenciesDefaultFractionDigits[otherCurrenciesCount] = getDefaultFractionDigits(currencyCode);
otherCurrenciesNumericCode[otherCurrenciesCount] = getNumericCode(currencyCode);
otherCurrenciesCount++;
@@ -350,35 +347,41 @@ public class GenerateCurrencyData {
out.writeInt(Integer.parseInt(dataVersion));
writeIntArray(mainTable, mainTable.length);
out.writeInt(specialCaseCount);
- writeLongArray(specialCaseCutOverTimes, specialCaseCount);
- writeStringArray(specialCaseOldCurrencies, specialCaseCount);
- writeStringArray(specialCaseNewCurrencies, specialCaseCount);
- writeIntArray(specialCaseOldCurrenciesDefaultFractionDigits, specialCaseCount);
- writeIntArray(specialCaseNewCurrenciesDefaultFractionDigits, specialCaseCount);
- writeIntArray(specialCaseOldCurrenciesNumericCode, specialCaseCount);
- writeIntArray(specialCaseNewCurrenciesNumericCode, specialCaseCount);
+ writeSpecialCaseEntries();
out.writeInt(otherCurrenciesCount);
- out.writeUTF(otherCurrencies.toString());
- writeIntArray(otherCurrenciesDefaultFractionDigits, otherCurrenciesCount);
- writeIntArray(otherCurrenciesNumericCode, otherCurrenciesCount);
+ writeOtherCurrencies();
}
private static void writeIntArray(int[] ia, int count) throws IOException {
- for (int i = 0; i < count; i ++) {
+ for (int i = 0; i < count; i++) {
out.writeInt(ia[i]);
}
}
- private static void writeLongArray(long[] la, int count) throws IOException {
- for (int i = 0; i < count; i ++) {
- out.writeLong(la[i]);
+ private static void writeSpecialCaseEntries() throws IOException {
+ for (int index = 0; index < specialCaseCount; index++) {
+ out.writeLong(specialCaseCutOverTimes[index]);
+ String str = (specialCaseOldCurrencies[index] != null)
+ ? specialCaseOldCurrencies[index] : "";
+ out.writeUTF(str);
+ str = (specialCaseNewCurrencies[index] != null)
+ ? specialCaseNewCurrencies[index] : "";
+ out.writeUTF(str);
+ out.writeInt(specialCaseOldCurrenciesDefaultFractionDigits[index]);
+ out.writeInt(specialCaseNewCurrenciesDefaultFractionDigits[index]);
+ out.writeInt(specialCaseOldCurrenciesNumericCode[index]);
+ out.writeInt(specialCaseNewCurrenciesNumericCode[index]);
}
}
- private static void writeStringArray(String[] sa, int count) throws IOException {
- for (int i = 0; i < count; i ++) {
- String str = (sa[i] != null) ? sa[i] : "";
+ private static void writeOtherCurrencies() throws IOException {
+ for (int index = 0; index < otherCurrenciesCount; index++) {
+ String str = (otherCurrencies[index] != null)
+ ? otherCurrencies[index] : "";
out.writeUTF(str);
+ out.writeInt(otherCurrenciesDefaultFractionDigits[index]);
+ out.writeInt(otherCurrenciesNumericCode[index]);
}
}
+
}
diff --git a/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java b/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java
index da774751e1c..04badbd7f3d 100644
--- a/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java
+++ b/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java
@@ -82,14 +82,14 @@ public class GenGraphs {
mods.add(name);
Configuration cf = Configuration.empty()
.resolveRequires(finder,
- ModuleFinder.empty(),
+ ModuleFinder.of(),
Set.of(name));
genGraphs.genDotFile(dir, name, cf);
}
Configuration cf = Configuration.empty()
.resolveRequires(finder,
- ModuleFinder.empty(),
+ ModuleFinder.of(),
mods);
genGraphs.genDotFile(dir, "jdk", cf);
diff --git a/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java b/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java
index c1b15d39219..f274afdc709 100644
--- a/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java
+++ b/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java
@@ -292,7 +292,7 @@ public class ModuleSummary {
static Configuration resolve(Set roots) {
return Configuration.empty()
.resolveRequires(ModuleFinder.ofSystem(),
- ModuleFinder.empty(),
+ ModuleFinder.of(),
roots);
}
diff --git a/jdk/src/demo/share/jvmti/index.html b/jdk/src/demo/share/jvmti/index.html
index 25440a104d9..5791b8b046f 100644
--- a/jdk/src/demo/share/jvmti/index.html
+++ b/jdk/src/demo/share/jvmti/index.html
@@ -415,7 +415,7 @@ Additional information can also be found by doing a search on "jvmti" at
Various technical articles are also available through this website.
And don't forget the
Java Tutorials at
-http://java.sun.com/docs/books/tutorial
+http://docs.oracle.com/javase/tutorial
for getting a quick start on all the various interfaces.
Comments and Feedback
diff --git a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java
index fee0b800f2d..50dc8020b25 100644
--- a/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java
+++ b/jdk/src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -43,9 +43,10 @@ class Constants {
1.0 to 1.3.X 45,3
1.4 to 1.4.X 46,0
1.5 to 1.5.X 49,0
- 1.6 to 1.5.x 50,0
- 1.7 to 1.6.x 51,0
- 1.8 to 1.7.x 52,0
+ 1.6 to 1.6.X 50,0
+ 1.7 to 1.7.X 51,0
+ 1.8 to 1.8.X 52,0
+ 1.9 to 1.9.X 53,0
*/
public static final Package.Version JAVA_MIN_CLASS_VERSION =
@@ -63,6 +64,9 @@ class Constants {
public static final Package.Version JAVA8_MAX_CLASS_VERSION =
Package.Version.of(52, 00);
+ public static final Package.Version JAVA9_MAX_CLASS_VERSION =
+ Package.Version.of(53, 00);
+
public static final int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
public static final Package.Version JAVA5_PACKAGE_VERSION =
@@ -79,7 +83,7 @@ class Constants {
// upper limit, should point to the latest class version
public static final Package.Version JAVA_MAX_CLASS_VERSION =
- JAVA8_MAX_CLASS_VERSION;
+ JAVA9_MAX_CLASS_VERSION;
// upper limit should point to the latest package version, for version info!.
public static final Package.Version MAX_PACKAGE_VERSION =
diff --git a/jdk/src/java.base/share/classes/java/io/BufferedWriter.java b/jdk/src/java.base/share/classes/java/io/BufferedWriter.java
index 28e170fe800..3d8e1ee1b19 100644
--- a/jdk/src/java.base/share/classes/java/io/BufferedWriter.java
+++ b/jdk/src/java.base/share/classes/java/io/BufferedWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -153,13 +153,18 @@ public class BufferedWriter extends Writer {
* needed. If the requested length is at least as large as the buffer,
* however, then this method will flush the buffer and write the characters
* directly to the underlying stream. Thus redundant
- * BufferedWriters will not copy data unnecessarily.
+ * {@code BufferedWriter}s will not copy data unnecessarily.
*
* @param cbuf A character array
* @param off Offset from which to start reading characters
* @param len Number of characters to write
*
- * @exception IOException If an I/O error occurs
+ * @throws IndexOutOfBoundsException
+ * If {@code off} is negative, or {@code len} is negative,
+ * or {@code off + len} is negative or greater than the length
+ * of the given array
+ *
+ * @throws IOException If an I/O error occurs
*/
public void write(char cbuf[], int off, int len) throws IOException {
synchronized (lock) {
@@ -195,17 +200,24 @@ public class BufferedWriter extends Writer {
/**
* Writes a portion of a String.
*
- *
If the value of the {@code len} parameter is negative then no
- * characters are written. This is contrary to the specification of this
- * method in the {@linkplain java.io.Writer#write(java.lang.String,int,int)
- * superclass}, which requires that an {@link IndexOutOfBoundsException} be
- * thrown.
+ * @implSpec
+ * While the specification of this method in the
+ * {@linkplain java.io.Writer#write(java.lang.String,int,int) superclass}
+ * recommends that an {@link IndexOutOfBoundsException} be thrown
+ * if {@code len} is negative or {@code off + len} is negative,
+ * the implementation in this class does not throw such an exception in
+ * these cases but instead simply writes no characters.
*
* @param s String to be written
* @param off Offset from which to start reading characters
* @param len Number of characters to be written
*
- * @exception IOException If an I/O error occurs
+ * @throws IndexOutOfBoundsException
+ * If {@code off} is negative,
+ * or {@code off + len} is greater than the length
+ * of the given string
+ *
+ * @throws IOException If an I/O error occurs
*/
public void write(String s, int off, int len) throws IOException {
synchronized (lock) {
diff --git a/jdk/src/java.base/share/classes/java/io/CharArrayWriter.java b/jdk/src/java.base/share/classes/java/io/CharArrayWriter.java
index ed27bbae314..773b59614d9 100644
--- a/jdk/src/java.base/share/classes/java/io/CharArrayWriter.java
+++ b/jdk/src/java.base/share/classes/java/io/CharArrayWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -91,6 +91,11 @@ class CharArrayWriter extends Writer {
* @param c the data to be written
* @param off the start offset in the data
* @param len the number of chars that are written
+ *
+ * @throws IndexOutOfBoundsException
+ * If {@code off} is negative, or {@code len} is negative,
+ * or {@code off + len} is negative or greater than the length
+ * of the given array
*/
public void write(char c[], int off, int len) {
if ((off < 0) || (off > c.length) || (len < 0) ||
@@ -114,6 +119,11 @@ class CharArrayWriter extends Writer {
* @param str String to be written from
* @param off Offset from which to start reading characters
* @param len Number of characters to be written
+ *
+ * @throws IndexOutOfBoundsException
+ * If {@code off} is negative, or {@code len} is negative,
+ * or {@code off + len} is negative or greater than the length
+ * of the given string
*/
public void write(String str, int off, int len) {
synchronized (lock) {
diff --git a/jdk/src/java.base/share/classes/java/io/FilterWriter.java b/jdk/src/java.base/share/classes/java/io/FilterWriter.java
index 303c674e0c0..8272b3cc8bf 100644
--- a/jdk/src/java.base/share/classes/java/io/FilterWriter.java
+++ b/jdk/src/java.base/share/classes/java/io/FilterWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -72,7 +72,12 @@ public abstract class FilterWriter extends Writer {
* @param off Offset from which to start reading characters
* @param len Number of characters to be written
*
- * @exception IOException If an I/O error occurs
+ * @throws IndexOutOfBoundsException
+ * If the values of the {@code off} and {@code len} parameters
+ * cause the corresponding method of the underlying {@code Writer}
+ * to throw an {@code IndexOutOfBoundsException}
+ *
+ * @throws IOException If an I/O error occurs
*/
public void write(char cbuf[], int off, int len) throws IOException {
out.write(cbuf, off, len);
@@ -85,7 +90,12 @@ public abstract class FilterWriter extends Writer {
* @param off Offset from which to start reading characters
* @param len Number of characters to be written
*
- * @exception IOException If an I/O error occurs
+ * @throws IndexOutOfBoundsException
+ * If the values of the {@code off} and {@code len} parameters
+ * cause the corresponding method of the underlying {@code Writer}
+ * to throw an {@code IndexOutOfBoundsException}
+ *
+ * @throws IOException If an I/O error occurs
*/
public void write(String str, int off, int len) throws IOException {
out.write(str, off, len);
diff --git a/jdk/src/java.base/share/classes/java/io/OutputStreamWriter.java b/jdk/src/java.base/share/classes/java/io/OutputStreamWriter.java
index 0d597e6bef4..4fdb148baaf 100644
--- a/jdk/src/java.base/share/classes/java/io/OutputStreamWriter.java
+++ b/jdk/src/java.base/share/classes/java/io/OutputStreamWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -202,7 +202,12 @@ public class OutputStreamWriter extends Writer {
* @param off Offset from which to start writing characters
* @param len Number of characters to write
*
- * @exception IOException If an I/O error occurs
+ * @throws IndexOutOfBoundsException
+ * If {@code off} is negative, or {@code len} is negative,
+ * or {@code off + len} is negative or greater than the length
+ * of the given array
+ *
+ * @throws IOException If an I/O error occurs
*/
public void write(char cbuf[], int off, int len) throws IOException {
se.write(cbuf, off, len);
@@ -215,7 +220,12 @@ public class OutputStreamWriter extends Writer {
* @param off Offset from which to start writing characters
* @param len Number of characters to write
*
- * @exception IOException If an I/O error occurs
+ * @throws IndexOutOfBoundsException
+ * If {@code off} is negative, or {@code len} is negative,
+ * or {@code off + len} is negative or greater than the length
+ * of the given string
+ *
+ * @throws IOException If an I/O error occurs
*/
public void write(String str, int off, int len) throws IOException {
se.write(str, off, len);
diff --git a/jdk/src/java.base/share/classes/java/io/PipedWriter.java b/jdk/src/java.base/share/classes/java/io/PipedWriter.java
index 02201fbec1a..a4534b8604c 100644
--- a/jdk/src/java.base/share/classes/java/io/PipedWriter.java
+++ b/jdk/src/java.base/share/classes/java/io/PipedWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -125,19 +125,25 @@ public class PipedWriter extends Writer {
}
/**
- * Writes len characters from the specified character array
- * starting at offset off to this piped output stream.
+ * Writes {@code len} characters from the specified character array
+ * starting at offset {@code off} to this piped output stream.
* This method blocks until all the characters are written to the output
* stream.
* If a thread was reading data characters from the connected piped input
* stream, but the thread is no longer alive, then an
- * IOException is thrown.
+ * {@code IOException} is thrown.
*
* @param cbuf the data.
* @param off the start offset in the data.
* @param len the number of characters to write.
- * @exception IOException if the pipe is
- * broken,
+ *
+ * @throws IndexOutOfBoundsException
+ * If {@code off} is negative, or {@code len} is negative,
+ * or {@code off + len} is negative or greater than the length
+ * of the given array
+ *
+ * @throws IOException if the pipe is
+ * broken,
* {@link #connect(java.io.PipedReader) unconnected}, closed
* or an I/O error occurs.
*/
diff --git a/jdk/src/java.base/share/classes/java/io/PrintWriter.java b/jdk/src/java.base/share/classes/java/io/PrintWriter.java
index 662f930ef90..d516b8ef404 100644
--- a/jdk/src/java.base/share/classes/java/io/PrintWriter.java
+++ b/jdk/src/java.base/share/classes/java/io/PrintWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -410,6 +410,11 @@ public class PrintWriter extends Writer {
* @param buf Array of characters
* @param off Offset from which to start writing characters
* @param len Number of characters to write
+ *
+ * @throws IndexOutOfBoundsException
+ * If the values of the {@code off} and {@code len} parameters
+ * cause the corresponding method of the underlying {@code Writer}
+ * to throw an {@code IndexOutOfBoundsException}
*/
public void write(char buf[], int off, int len) {
try {
@@ -440,6 +445,11 @@ public class PrintWriter extends Writer {
* @param s A String
* @param off Offset from which to start writing characters
* @param len Number of characters to write
+ *
+ * @throws IndexOutOfBoundsException
+ * If the values of the {@code off} and {@code len} parameters
+ * cause the corresponding method of the underlying {@code Writer}
+ * to throw an {@code IndexOutOfBoundsException}
*/
public void write(String s, int off, int len) {
try {
diff --git a/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java b/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java
index 1a8344df88b..3806675cdca 100644
--- a/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java
+++ b/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java
@@ -27,6 +27,8 @@ package java.io;
import java.nio.channels.FileChannel;
import java.util.concurrent.atomic.AtomicBoolean;
+import jdk.internal.misc.JavaIORandomAccessFileAccess;
+import jdk.internal.misc.SharedSecrets;
import sun.nio.ch.FileChannelImpl;
@@ -75,6 +77,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
private static final int O_RDWR = 2;
private static final int O_SYNC = 4;
private static final int O_DSYNC = 8;
+ private static final int O_TEMPORARY = 16;
/**
* Creates a random access file stream to read from, and optionally
@@ -202,6 +205,12 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
*/
public RandomAccessFile(File file, String mode)
throws FileNotFoundException
+ {
+ this(file, mode, false);
+ }
+
+ private RandomAccessFile(File file, String mode, boolean openAndDelete)
+ throws FileNotFoundException
{
String name = (file != null ? file.getPath() : null);
int imode = -1;
@@ -219,6 +228,8 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
imode = -1;
}
}
+ if (openAndDelete)
+ imode |= O_TEMPORARY;
if (imode < 0)
throw new IllegalArgumentException("Illegal mode \"" + mode
+ "\" must be one of "
@@ -1165,5 +1176,15 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
static {
initIDs();
+ SharedSecrets.setJavaIORandomAccessFileAccess(new JavaIORandomAccessFileAccess()
+ {
+ // This is for j.u.z.ZipFile.OPEN_DELETE. The O_TEMPORARY flag
+ // is only implemented/supported on windows.
+ public RandomAccessFile openAndDelete(File file, String mode)
+ throws IOException
+ {
+ return new RandomAccessFile(file, mode, true);
+ }
+ });
}
}
diff --git a/jdk/src/java.base/share/classes/java/io/StringWriter.java b/jdk/src/java.base/share/classes/java/io/StringWriter.java
index 5d1babc3127..15022b353a8 100644
--- a/jdk/src/java.base/share/classes/java/io/StringWriter.java
+++ b/jdk/src/java.base/share/classes/java/io/StringWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -83,6 +83,11 @@ public class StringWriter extends Writer {
* @param cbuf Array of characters
* @param off Offset from which to start writing characters
* @param len Number of characters to write
+ *
+ * @throws IndexOutOfBoundsException
+ * If {@code off} is negative, or {@code len} is negative,
+ * or {@code off + len} is negative or greater than the length
+ * of the given array
*/
public void write(char cbuf[], int off, int len) {
if ((off < 0) || (off > cbuf.length) || (len < 0) ||
@@ -107,6 +112,11 @@ public class StringWriter extends Writer {
* @param str String to be written
* @param off Offset from which to start writing characters
* @param len Number of characters to write
+ *
+ * @throws IndexOutOfBoundsException
+ * If {@code off} is negative, or {@code len} is negative,
+ * or {@code off + len} is negative or greater than the length
+ * of the given string
*/
public void write(String str, int off, int len) {
buf.append(str, off, off + len);
diff --git a/jdk/src/java.base/share/classes/java/io/Writer.java b/jdk/src/java.base/share/classes/java/io/Writer.java
index 5ad5e554fb3..17e8de3ef8a 100644
--- a/jdk/src/java.base/share/classes/java/io/Writer.java
+++ b/jdk/src/java.base/share/classes/java/io/Writer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -32,12 +32,11 @@ package java.io;
* Most subclasses, however, will override some of the methods defined here in
* order to provide higher efficiency, additional functionality, or both.
*
- * @see Writer
* @see BufferedWriter
* @see CharArrayWriter
* @see FilterWriter
* @see OutputStreamWriter
- * @see FileWriter
+ * @see FileWriter
* @see PipedWriter
* @see PrintWriter
* @see StringWriter
@@ -139,6 +138,12 @@ public abstract class Writer implements Appendable, Closeable, Flushable {
* @param len
* Number of characters to write
*
+ * @throws IndexOutOfBoundsException
+ * Implementations should throw this exception
+ * if {@code off} is negative, or {@code len} is negative,
+ * or {@code off + len} is negative or greater than the length
+ * of the given array
+ *
* @throws IOException
* If an I/O error occurs
*/
@@ -160,6 +165,11 @@ public abstract class Writer implements Appendable, Closeable, Flushable {
/**
* Writes a portion of a string.
*
+ * @implSpec
+ * The implementation in this class throws an
+ * {@code IndexOutOfBoundsException} for the indicated conditions;
+ * overriding methods may choose to do otherwise.
+ *
* @param str
* A String
*
@@ -170,8 +180,9 @@ public abstract class Writer implements Appendable, Closeable, Flushable {
* Number of characters to write
*
* @throws IndexOutOfBoundsException
- * If {@code off} is negative, or {@code len} is negative,
- * or {@code off+len} is negative or greater than the length
+ * Implementations should throw this exception
+ * if {@code off} is negative, or {@code len} is negative,
+ * or {@code off + len} is negative or greater than the length
* of the given string
*
* @throws IOException
diff --git a/jdk/src/java.base/share/classes/java/lang/Boolean.java b/jdk/src/java.base/share/classes/java/lang/Boolean.java
index eeda751719c..af7bad17a64 100644
--- a/jdk/src/java.base/share/classes/java/lang/Boolean.java
+++ b/jdk/src/java.base/share/classes/java/lang/Boolean.java
@@ -117,7 +117,9 @@ public final class Boolean implements java.io.Serializable,
* Parses the string argument as a boolean. The {@code boolean}
* returned represents the value {@code true} if the string argument
* is not {@code null} and is equal, ignoring case, to the string
- * {@code "true"}.
+ * {@code "true"}.
+ * Otherwise, a false value is returned, including for a null
+ * argument.
* Example: {@code Boolean.parseBoolean("True")} returns {@code true}.
* Example: {@code Boolean.parseBoolean("yes")} returns {@code false}.
*
@@ -165,6 +167,8 @@ public final class Boolean implements java.io.Serializable,
* specified string. The {@code Boolean} returned represents a
* true value if the string argument is not {@code null}
* and is equal, ignoring case, to the string {@code "true"}.
+ * Otherwise, a false value is returned, including for a null
+ * argument.
*
* @param s a string.
* @return the {@code Boolean} value represented by the string.
@@ -241,14 +245,12 @@ public final class Boolean implements java.io.Serializable,
/**
* Returns {@code true} if and only if the system property named
- * by the argument exists and is equal to the string {@code
- * "true"}. (Beginning with version 1.0.2 of the Java™
- * platform, the test of this string is case insensitive.) A
- * system property is accessible through {@code getProperty}, a
- * method defined by the {@code System} class.
- *
- * If there is no property with the specified name, or if the specified
- * name is empty or null, then {@code false} is returned.
+ * by the argument exists and is equal to, ignoring case, the
+ * string {@code "true"}.
+ * A system property is accessible through {@code getProperty}, a
+ * method defined by the {@code System} class.
If there is no
+ * property with the specified name, or if the specified name is
+ * empty or null, then {@code false} is returned.
*
* @param name the system property name.
* @return the {@code boolean} value of the system property.
diff --git a/jdk/src/java.base/share/classes/java/lang/Math.java b/jdk/src/java.base/share/classes/java/lang/Math.java
index 4244d40a3b9..aa678b875ec 100644
--- a/jdk/src/java.base/share/classes/java/lang/Math.java
+++ b/jdk/src/java.base/share/classes/java/lang/Math.java
@@ -95,7 +95,7 @@ import jdk.internal.HotSpotIntrinsicCandidate;
* {@code subtractExact}, {@code multiplyExact}, and {@code toIntExact}
* throw an {@code ArithmeticException} when the results overflow.
* For other arithmetic operations such as divide, absolute value,
- * increment, decrement, and negation overflow occurs only with
+ * increment by one, decrement by one, and negation, overflow occurs only with
* a specific minimum or maximum value and should be checked against
* the minimum or maximum as appropriate.
*
@@ -861,7 +861,7 @@ public final class Math {
public static int subtractExact(int x, int y) {
int r = x - y;
// HD 2-12 Overflow iff the arguments have different signs and
- // the sign of the result is different than the sign of x
+ // the sign of the result is different from the sign of x
if (((x ^ y) & (x ^ r)) < 0) {
throw new ArithmeticException("integer overflow");
}
@@ -882,7 +882,7 @@ public final class Math {
public static long subtractExact(long x, long y) {
long r = x - y;
// HD 2-12 Overflow iff the arguments have different signs and
- // the sign of the result is different than the sign of x
+ // the sign of the result is different from the sign of x
if (((x ^ y) & (x ^ r)) < 0) {
throw new ArithmeticException("long overflow");
}
@@ -908,6 +908,20 @@ public final class Math {
return (int)r;
}
+ /**
+ * Returns the product of the arguments, throwing an exception if the result
+ * overflows a {@code long}.
+ *
+ * @param x the first value
+ * @param y the second value
+ * @return the result
+ * @throws ArithmeticException if the result overflows a long
+ * @since 9
+ */
+ public static long multiplyExact(long x, int y) {
+ return multiplyExact(x, (long)y);
+ }
+
/**
* Returns the product of the arguments,
* throwing an exception if the result overflows a {@code long}.
@@ -1059,18 +1073,65 @@ public final class Math {
return (int)value;
}
+ /**
+ * Returns the exact mathematical product of the arguments.
+ *
+ * @param x the first value
+ * @param y the second value
+ * @return the result
+ */
+ public static long multiplyFull(int x, int y) {
+ return (long)x * (long)y;
+ }
+
+ /**
+ * Returns as a {@code long} the most significant 64 bits of the 128-bit
+ * product of two 64-bit factors.
+ *
+ * @param x the first value
+ * @param y the second value
+ * @return the result
+ */
+ public static long multiplyHigh(long x, long y) {
+ if (x < 0 || y < 0) {
+ // Use technique from section 8-2 of Henry S. Warren, Jr.,
+ // Hacker's Delight (2nd ed.) (Addison Wesley, 2013), 173-174.
+ long x1 = x >> 32;
+ long x2 = x & 0xFFFFFFFFL;
+ long y1 = y >> 32;
+ long y2 = y & 0xFFFFFFFFL;
+ long z2 = x2 * y2;
+ long t = x1 * y2 + (z2 >>> 32);
+ long z1 = t & 0xFFFFFFFFL;
+ long z0 = t >> 32;
+ z1 += x2 * y1;
+ return x1 * y1 + z0 + (z1 >> 32);
+ } else {
+ // Use Karatsuba technique with two base 2^32 digits.
+ long x1 = x >>> 32;
+ long y1 = y >>> 32;
+ long x2 = x & 0xFFFFFFFFL;
+ long y2 = y & 0xFFFFFFFFL;
+ long A = x1 * y1;
+ long B = x2 * y2;
+ long C = (x1 + x2) * (y1 + y2);
+ long K = C - A - B;
+ return (((B >>> 32) + K) >>> 32) + A;
+ }
+ }
+
/**
* Returns the largest (closest to positive infinity)
* {@code int} value that is less than or equal to the algebraic quotient.
* There is one special case, if the dividend is the
* {@linkplain Integer#MIN_VALUE Integer.MIN_VALUE} and the divisor is {@code -1},
* then integer overflow occurs and
- * the result is equal to the {@code Integer.MIN_VALUE}.
+ * the result is equal to {@code Integer.MIN_VALUE}.
*
* Normal integer division operates under the round to zero rounding mode
* (truncation). This operation instead acts under the round toward
* negative infinity (floor) rounding mode.
- * The floor rounding mode gives different results than truncation
+ * The floor rounding mode gives different results from truncation
* when the exact result is negative.
*
*
If the signs of the arguments are the same, the results of
@@ -1108,12 +1169,41 @@ public final class Math {
* There is one special case, if the dividend is the
* {@linkplain Long#MIN_VALUE Long.MIN_VALUE} and the divisor is {@code -1},
* then integer overflow occurs and
- * the result is equal to the {@code Long.MIN_VALUE}.
+ * the result is equal to {@code Long.MIN_VALUE}.
*
* Normal integer division operates under the round to zero rounding mode
* (truncation). This operation instead acts under the round toward
* negative infinity (floor) rounding mode.
- * The floor rounding mode gives different results than truncation
+ * The floor rounding mode gives different results from truncation
+ * when the exact result is negative.
+ *
+ * For examples, see {@link #floorDiv(int, int)}.
+ *
+ * @param x the dividend
+ * @param y the divisor
+ * @return the largest (closest to positive infinity)
+ * {@code int} value that is less than or equal to the algebraic quotient.
+ * @throws ArithmeticException if the divisor {@code y} is zero
+ * @see #floorMod(long, int)
+ * @see #floor(double)
+ * @since 9
+ */
+ public static long floorDiv(long x, int y) {
+ return floorDiv(x, (long)y);
+ }
+
+ /**
+ * Returns the largest (closest to positive infinity)
+ * {@code long} value that is less than or equal to the algebraic quotient.
+ * There is one special case, if the dividend is the
+ * {@linkplain Long#MIN_VALUE Long.MIN_VALUE} and the divisor is {@code -1},
+ * then integer overflow occurs and
+ * the result is equal to {@code Long.MIN_VALUE}.
+ *
+ * Normal integer division operates under the round to zero rounding mode
+ * (truncation). This operation instead acts under the round toward
+ * negative infinity (floor) rounding mode.
+ * The floor rounding mode gives different results from truncation
* when the exact result is negative.
*
* For examples, see {@link #floorDiv(int, int)}.
@@ -1181,8 +1271,34 @@ public final class Math {
* @since 1.8
*/
public static int floorMod(int x, int y) {
- int r = x - floorDiv(x, y) * y;
- return r;
+ return x - floorDiv(x, y) * y;
+ }
+
+ /**
+ * Returns the floor modulus of the {@code long} and {@int} arguments.
+ *
+ * The floor modulus is {@code x - (floorDiv(x, y) * y)},
+ * has the same sign as the divisor {@code y}, and
+ * is in the range of {@code -abs(y) < r < +abs(y)}.
+ *
+ *
+ * The relationship between {@code floorDiv} and {@code floorMod} is such that:
+ *
+ * For examples, see {@link #floorMod(int, int)}.
+ *
+ * @param x the dividend
+ * @param y the divisor
+ * @return the floor modulus {@code x - (floorDiv(x, y) * y)}
+ * @throws ArithmeticException if the divisor {@code y} is zero
+ * @see #floorDiv(long, int)
+ * @since 9
+ */
+ public static int floorMod(long x, int y) {
+ // Result cannot overflow the range of int.
+ return (int)(x - floorDiv(x, y) * y);
}
/**
diff --git a/jdk/src/java.base/share/classes/java/lang/Runtime.java b/jdk/src/java.base/share/classes/java/lang/Runtime.java
index 3c73d5b61a3..1533130017b 100644
--- a/jdk/src/java.base/share/classes/java/lang/Runtime.java
+++ b/jdk/src/java.base/share/classes/java/lang/Runtime.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -26,9 +26,21 @@
package java.lang;
import java.io.*;
+import java.math.BigInteger;
+import java.util.AbstractList;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+import java.util.RandomAccess;
import java.util.StringTokenizer;
import jdk.internal.reflect.CallerSensitive;
import jdk.internal.reflect.Reflection;
+import sun.security.action.GetPropertyAction;
/**
* Every Java application has a single instance of class
@@ -46,6 +58,8 @@ import jdk.internal.reflect.Reflection;
public class Runtime {
private static final Runtime currentRuntime = new Runtime();
+ private static Version version;
+
/**
* Returns the runtime object associated with the current Java application.
* Most of the methods of class {@code Runtime} are instance
@@ -917,4 +931,591 @@ public class Runtime {
return out;
}
+ /**
+ * Returns the version of the Java Runtime Environment as a {@link
+ * Runtime.Version}.
+ *
+ * @return the {@link Runtime.Version} of the Java Runtime Environment
+ *
+ * @since 9
+ */
+ public static Version version() {
+ if (version == null) {
+ version = Version.parse(
+ GetPropertyAction.privilegedGetProperty("java.runtime.version"));
+ }
+ return version;
+ }
+
+ /**
+ * A representation of a version string for an implemenation of the
+ * Java SE Platform. A version string contains a version number
+ * optionally followed by pre-release and build information.
+ *
+ *
A version number, {@code $VNUM}, is a non-empty sequence
+ * of elements separated by period characters (U+002E). An element is
+ * either zero, or a unsigned integer numeral without leading zeros. The
+ * final element in a version number must not be zero. The format is:
+ *
+ *
+ *
+ * ^[1-9][0-9]*(((\.0)*\.[1-9][0-9]*)*)*$
+ *
+ *
+ *
The sequence may be of arbitrary length but the first three
+ * elements are assigned specific meanings, as follows:
+ *
+ *
+ * $MAJOR.$MINOR.$SECURITY
+ *
+ *
+ *
+ *
+ *
{@code $MAJOR} --- The major version
+ * number, incremented for a major release that contains significant new
+ * features as specified in a new edition of the Java SE Platform
+ * Specification, e.g., JSR 337 for
+ * Java SE 8. Features may be removed in a major release, given
+ * advance notice at least one major release ahead of time, and
+ * incompatible changes may be made when justified. The {@code $MAJOR}
+ * version number of JDK 8 is {@code 8}; the {@code $MAJOR} version
+ * number of JDK 9 is {@code 9}. When {@code $MAJOR} is incremented,
+ * all subsequent elements are removed.
+ *
+ *
{@code $MINOR} --- The minor version
+ * number, incremented for a minor update release that may contain
+ * compatible bug fixes, revisions to standard APIs mandated by a
+ * Maintenance Release
+ * of the relevant Platform Specification, and implementation features
+ * outside the scope of that Specification such as new JDK-specific APIs,
+ * additional service providers, new garbage collectors, and ports to new
+ * hardware architectures.
+ *
+ *
{@code $SECURITY} --- The security
+ * level, incremented for a security update release that contains critical
+ * fixes including those necessary to improve security. {@code $SECURITY}
+ * is not reset when {@code $MINOR} is incremented. A
+ * higher value of {@code $SECURITY} for a given {@code $MAJOR} value,
+ * therefore, always indicates a more secure release, regardless of the
+ * value of {@code $MINOR}.
+ *
+ *
+ *
+ *
The fourth and later elements of a version number are free for use
+ * by downstream consumers of this code base. Such a consumer may,
+ * e.g., use the fourth element to identify patch releases which
+ * contain a small number of critical non-security fixes in addition to
+ * the security fixes in the corresponding security release.
+ *
+ *
The version number does not include trailing zero elements;
+ * i.e., {@code $SECURITY} is omitted if it has the value zero,
+ * and {@code $MINOR} is omitted if both {@code $MINOR} and {@code
+ * $SECURITY} have the value zero.
+ *
+ *
The sequence of numerals in a version number is compared to another
+ * such sequence in numerical, pointwise fashion; e.g., {@code
+ * 9.9.1} is less than {@code 9.10.3}. If one sequence is shorter than
+ * another then the missing elements of the shorter sequence are
+ * considered to be less than the corresponding elements of the longer
+ * sequence; e.g., {@code 9.1.2} is less than {@code 9.1.2.1}.
+ *
A version string, {@code $VSTR}, consists of a version
+ * number {@code $VNUM}, as described above, optionally followed by
+ * pre-release and build information, in the format
+ *
+ *
+ * $VNUM(-$PRE)?(\+($BUILD)?(-$OPT)?)?
+ *
+ *
+ *
where:
+ *
+ *
+ *
+ *
{@code $PRE}, matching {@code ([a-zA-Z0-9]+)}
+ * --- A pre-release identifier. Typically {@code ea}, for a
+ * potentially unstable early-access release under active development,
+ * or {@code internal}, for an internal developer build.
+ *
+ *
{@code $BUILD}, matching {@code
+ * (0|[1-9][0-9]*)} --- The build number, incremented for each promoted
+ * build. {@code $BUILD} is reset to {@code 1} when any portion of {@code
+ * $VNUM} is incremented.
+ *
+ *
{@code $OPT}, matching {@code
+ * ([-a-zA-Z0-9\.]+)} --- Additional build information, if desired. In
+ * the case of an {@code internal} build this will often contain the date
+ * and time of the build.
+ *
+ *
+ *
+ *
A version number {@code 10-ea} matches {@code $VNUM = "10"} and
+ * {@code $PRE = "ea"}. The version number {@code 10+-ea} matches
+ * {@code $VNUM = "10"} and {@code $OPT = "ea"}.
+ *
+ *
When comparing two version strings, the value of {@code $OPT}, if
+ * present, may or may not be significant depending on the chosen
+ * comparison method. The comparison methods {@link #compareTo(Version)
+ * compareTo()} and {@link #compareToIgnoreOpt(Version)
+ * compareToIgnoreOpt()} should be used consistently with the
+ * corresponding methods {@link #equals(Object) equals()} and {@link
+ * #equalsIgnoreOpt(Object) equalsIgnoreOpt()}.
+ *
+ *
A short version string, {@code $SVSTR}, often useful in
+ * less formal contexts, is a version number optionally followed by a
+ * pre-release identifier:
+ *
+ *
+ * $VNUM(-$PRE)?
+ *
+ *
+ * @since 9
+ */
+ public static class Version
+ implements Comparable
+ {
+ private final List version;
+ private final Optional pre;
+ private final Optional build;
+ private final Optional optional;
+
+
+ // $VNUM(-$PRE)?(\+($BUILD)?(\-$OPT)?)?
+ // RE limits the format of version strings
+ // ([1-9][0-9]*(?:(?:\.0)*\.[1-9][0-9]*)*)(?:-([a-zA-Z0-9]+))?(?:(\+)(0|[1-9][0-9]*)?)?(?:-([-a-zA-Z0-9.]+))?
+
+ private static final String VNUM
+ = "(?[1-9][0-9]*(?:(?:\\.0)*\\.[1-9][0-9]*)*)";
+ private static final String VNUM_GROUP = "VNUM";
+
+ private static final String PRE = "(?:-(?
[a-zA-Z0-9]+))?";
+ private static final String PRE_GROUP = "PRE";
+
+ private static final String BUILD
+ = "(?:(?\\+)(?0|[1-9][0-9]*)?)?";
+ private static final String PLUS_GROUP = "PLUS";
+ private static final String BUILD_GROUP = "BUILD";
+
+ private static final String OPT = "(?:-(?[-a-zA-Z0-9.]+))?";
+ private static final String OPT_GROUP = "OPT";
+
+ private static final String VSTR_FORMAT
+ = "^" + VNUM + PRE + BUILD + OPT + "$";
+ private static final Pattern VSTR_PATTERN = Pattern.compile(VSTR_FORMAT);
+
+ /**
+ * Constructs a valid version string containing
+ * a version number followed by pre-release and
+ * build information.
+ *
+ * @param s
+ * A string to be interpreted as a version
+ *
+ * @throws IllegalArgumentException
+ * If the given string cannot be interpreted as a valid
+ * version
+ *
+ * @throws NullPointerException
+ * If {@code s} is {@code null}
+ *
+ * @throws NumberFormatException
+ * If an element of the version number or the build number
+ * cannot be represented as an {@link Integer}
+ */
+ private Version(String s) {
+ if (s == null)
+ throw new NullPointerException();
+
+ Matcher m = VSTR_PATTERN.matcher(s);
+ if (!m.matches())
+ throw new IllegalArgumentException("Invalid version string: '"
+ + s + "'");
+
+ // $VNUM is a dot-separated list of integers of arbitrary length
+ List list = new ArrayList<>();
+ for (String i : m.group(VNUM_GROUP).split("\\."))
+ list.add(Integer.parseInt(i));
+ version = Collections.unmodifiableList(list);
+
+ pre = Optional.ofNullable(m.group(PRE_GROUP));
+
+ String b = m.group(BUILD_GROUP);
+ // $BUILD is an integer
+ build = (b == null)
+ ? Optional.empty()
+ : Optional.ofNullable(Integer.parseInt(b));
+
+ optional = Optional.ofNullable(m.group(OPT_GROUP));
+
+ // empty '+'
+ if ((m.group(PLUS_GROUP) != null) && !build.isPresent()) {
+ if (optional.isPresent()) {
+ if (pre.isPresent())
+ throw new IllegalArgumentException("'+' found with"
+ + " pre-release and optional components:'" + s
+ + "'");
+ } else {
+ throw new IllegalArgumentException("'+' found with neither"
+ + " build or optional components: '" + s + "'");
+ }
+ }
+ }
+
+ /**
+ * Parses the given string as a valid
+ * version string containing a
+ * version number followed by pre-release and
+ * build information.
+ *
+ * @param s
+ * A string to interpret as a version
+ *
+ * @throws IllegalArgumentException
+ * If the given string cannot be interpreted as a valid
+ * version
+ *
+ * @throws NullPointerException
+ * If the given string is {@code null}
+ *
+ * @throws NumberFormatException
+ * If an element of the version number or the build number
+ * cannot be represented as an {@link Integer}
+ *
+ * @return The Version of the given string
+ */
+ public static Version parse(String s) {
+ return new Version(s);
+ }
+
+ /**
+ * Returns the major version number.
+ *
+ * @return The major version number
+ */
+ public int major() {
+ return version.get(0);
+ }
+
+ /**
+ * Returns the minor version number or zero if it
+ * was not set.
+ *
+ * @return The minor version number or zero if it was not set
+ */
+ public int minor() {
+ return (version.size() > 1 ? version.get(1) : 0);
+ }
+
+ /**
+ * Returns the security version number or zero
+ * if it was not set.
+ *
+ * @return The security version number or zero if it was not set
+ */
+ public int security() {
+ return (version.size() > 2 ? version.get(2) : 0);
+ }
+
+ /**
+ * Returns an unmodifiable {@link java.util.List List} of the
+ * integer numerals contained in the version
+ * number. The {@code List} always contains at least one
+ * element corresponding to the major version
+ * number.
+ *
+ * @return An unmodifiable list of the integer numerals
+ * contained in the version number
+ */
+ public List version() {
+ return version;
+ }
+
+ /**
+ * Returns the optional pre-release information.
+ *
+ * @return The optional pre-release information as a String
+ */
+ public Optional pre() {
+ return pre;
+ }
+
+ /**
+ * Returns the build number.
+ *
+ * @return The optional build number.
+ */
+ public Optional build() {
+ return build;
+ }
+
+ /**
+ * Returns optional additional identifying build
+ * information.
+ *
+ * @return Additional build information as a String
+ */
+ public Optional optional() {
+ return optional;
+ }
+
+ /**
+ * Compares this version to another.
+ *
+ *
Each of the components in the version is
+ * compared in the follow order of precedence: version numbers,
+ * pre-release identifiers, build numbers, optional build information.
+ *
+ *
+ *
Comparison begins by examining the sequence of version numbers.
+ * If one sequence is shorter than another, then the missing elements
+ * of the shorter sequence are considered to be less than the
+ * corresponding elements of the longer sequence.
+ *
+ *
A version with a pre-release identifier is always considered to
+ * be less than a version without one. Pre-release identifiers are
+ * compared numerically when they consist only of digits, and
+ * lexicographically otherwise. Numeric identifiers are considered to
+ * be less than non-numeric identifiers.
+ *
+ *
A version without a build number is always less than one with a
+ * build number; otherwise build numbers are compared numerically.
+ *
+ *
The optional build information is compared lexicographically.
+ * During this comparison, a version with optional build information is
+ * considered to be greater than a version without one.
+ *
+ *
A version is not comparable to any other type of object.
+ *
+ * @param ob
+ * The object to be compared
+ *
+ * @return A negative integer, zero, or a positive integer if this
+ * {@code Version} is less than, equal to, or greater than the
+ * given {@code Version}
+ *
+ * @throws NullPointerException
+ * If the given object is {@code null}
+ */
+ @Override
+ public int compareTo(Version ob) {
+ return compare(ob, false);
+ }
+
+ /**
+ * Compares this version to another disregarding optional build
+ * information.
+ *
+ *
Two versions are compared by examining the version string as
+ * described in {@link #compareTo(Version)} with the exception that the
+ * optional build information is always ignored.
+ *
+ *
A version is not comparable to any other type of object.
+ *
+ * @param ob
+ * The object to be compared
+ *
+ * @return A negative integer, zero, or a positive integer if this
+ * {@code Version} is less than, equal to, or greater than the
+ * given {@code Version}
+ *
+ * @throws NullPointerException
+ * If the given object is {@code null}
+ */
+ public int compareToIgnoreOpt(Version ob) {
+ return compare(ob, true);
+ }
+
+ private int compare(Version ob, boolean ignoreOpt) {
+ if (ob == null)
+ throw new NullPointerException("Invalid argument");
+
+ int ret = compareVersion(ob);
+ if (ret != 0)
+ return ret;
+
+ ret = comparePre(ob);
+ if (ret != 0)
+ return ret;
+
+ ret = compareBuild(ob);
+ if (ret != 0)
+ return ret;
+
+ if (!ignoreOpt)
+ return compareOpt(ob);
+
+ return 0;
+ }
+
+ private int compareVersion(Version ob) {
+ int size = version.size();
+ int oSize = ob.version().size();
+ int min = Math.min(size, oSize);
+ for (int i = 0; i < min; i++) {
+ Integer val = version.get(i);
+ Integer oVal = ob.version().get(i);
+ if (val != oVal)
+ return val - oVal;
+ }
+ if (size != oSize)
+ return size - oSize;
+ return 0;
+ }
+
+ private int comparePre(Version ob) {
+ Optional oPre = ob.pre();
+ if (!pre.isPresent()) {
+ if (oPre.isPresent())
+ return 1;
+ } else {
+ if (!oPre.isPresent())
+ return -1;
+ String val = pre.get();
+ String oVal = oPre.get();
+ if (val.matches("\\d+")) {
+ return (oVal.matches("\\d+")
+ ? (new BigInteger(val)).compareTo(new BigInteger(oVal))
+ : -1);
+ } else {
+ return (oVal.matches("\\d+")
+ ? 1
+ : val.compareTo(oVal));
+ }
+ }
+ return 0;
+ }
+
+ private int compareBuild(Version ob) {
+ Optional oBuild = ob.build();
+ if (oBuild.isPresent()) {
+ return (build.isPresent()
+ ? build.get().compareTo(oBuild.get())
+ : 1);
+ } else if (build.isPresent()) {
+ return -1;
+ }
+ return 0;
+ }
+
+ private int compareOpt(Version ob) {
+ Optional oOpt = ob.optional();
+ if (!optional.isPresent()) {
+ if (oOpt.isPresent())
+ return -1;
+ } else {
+ if (!oOpt.isPresent())
+ return 1;
+ return optional.get().compareTo(oOpt.get());
+ }
+ return 0;
+ }
+
+ /**
+ * Returns a string representation of this version.
+ *
+ * @return The version string
+ */
+ @Override
+ public String toString() {
+ StringBuilder sb
+ = new StringBuilder(version.stream()
+ .map(Object::toString)
+ .collect(Collectors.joining(".")));
+
+ pre.ifPresent(v -> sb.append("-").append(v));
+
+ if (build.isPresent()) {
+ sb.append("+").append(build.get());
+ if (optional.isPresent())
+ sb.append("-").append(optional.get());
+ } else {
+ if (optional.isPresent()) {
+ sb.append(pre.isPresent() ? "-" : "+-");
+ sb.append(optional.get());
+ }
+ }
+
+ return sb.toString();
+ }
+
+ /**
+ * Determines whether this {@code Version} is equal to another object.
+ *
+ *
Two {@code Version}s are equal if and only if they represent the
+ * same version string.
+ *
+ *
This method satisfies the general contract of the {@link
+ * Object#equals(Object) Object.equals} method.
+ *
+ * @param ob
+ * The object to which this {@code Version} is to be compared
+ *
+ * @return {@code true} if, and only if, the given object is a {@code
+ * Version} that is identical to this {@code Version}
+ *
+ */
+ @Override
+ public boolean equals(Object ob) {
+ boolean ret = equalsIgnoreOpt(ob);
+ if (!ret)
+ return false;
+
+ Version that = (Version)ob;
+ return (this.optional().equals(that.optional()));
+ }
+
+ /**
+ * Determines whether this {@code Version} is equal to another
+ * disregarding optional build information.
+ *
+ *
Two {@code Version}s are equal if and only if they represent the
+ * same version string disregarding the optional build information.
+ *
+ * @param ob
+ * The object to which this {@code Version} is to be compared
+ *
+ * @return {@code true} if, and only if, the given object is a {@code
+ * Version} that is identical to this {@code Version}
+ * ignoring the optinal build information
+ *
+ */
+ public boolean equalsIgnoreOpt(Object ob) {
+ if (this == ob)
+ return true;
+ if (!(ob instanceof Version))
+ return false;
+
+ Version that = (Version)ob;
+ return (this.version().equals(that.version())
+ && this.pre().equals(that.pre())
+ && this.build().equals(that.build()));
+ }
+
+ /**
+ * Returns the hash code of this version.
+ *
+ *
This method satisfies the general contract of the {@link
+ * Object#hashCode Object.hashCode} method.
+ *
+ * @return The hashcode of this version
+ */
+ @Override
+ public int hashCode() {
+ int h = 1;
+ int p = 17;
+
+ h = p * h + version.hashCode();
+ h = p * h + pre.hashCode();
+ h = p * h + build.hashCode();
+ h = p * h + optional.hashCode();
+
+ return h;
+ }
+ }
+
}
diff --git a/jdk/src/java.base/share/classes/java/lang/StackWalker.java b/jdk/src/java.base/share/classes/java/lang/StackWalker.java
index aef9c729a92..247cd467a83 100644
--- a/jdk/src/java.base/share/classes/java/lang/StackWalker.java
+++ b/jdk/src/java.base/share/classes/java/lang/StackWalker.java
@@ -306,8 +306,9 @@ public final class StackWalker {
return DEFAULT_WALKER;
}
- checkPermission(options);
- return new StackWalker(toEnumSet(options));
+ EnumSet