diff --git a/.hgtags b/.hgtags
index 36cbfa27702..fdaa267c3a3 100644
--- a/.hgtags
+++ b/.hgtags
@@ -261,3 +261,7 @@ efe7dbc6088691757404e0c8745f894e3ca9c022 jdk9-b09
4a09f5d30be844ac6f714bdb0f63d8c3c08b9a98 jdk9-b16
410bccbded9e9cce80f1e13ad221e37ae97a3986 jdk9-b17
c5495e25c7258ab5f96a1ae14610887d76d2be63 jdk9-b18
+2dcf544eb7ed5ac6a3f7813a32e33acea7442405 jdk9-b19
+89731ae72a761afdf4262e8b9513f302f6563f89 jdk9-b20
+28dd0c7beb3cad9cf95f17b4b5ad87eb447a4084 jdk9-b21
+9678e0db8ff6ed845d4c2ee4a3baf7f386a777e5 jdk9-b22
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index 931d3b8d4c6..f99201f034e 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -261,3 +261,7 @@ b114474fb25af4e73cb7219f7c04bd8994da03a5 jdk9-b15
cf22a728521f91a4692b433d39d730a0a1b23155 jdk9-b16
24152ee0ee1abef54a8bab04c099261dba7bcca5 jdk9-b17
65abab59f783fcf02ff8e133431c252f9e5f07d5 jdk9-b18
+75a08df650eb3126bab0c4d15241f5886162393c jdk9-b19
+ee4fd72b2ec3d92497f37163352f294aa695c6fb jdk9-b20
+9052803f4d01feda28b3d65f2b64dd457d21c7b6 jdk9-b21
+8e4bdab4c362aadde2d321f968cd503a2f779e2f jdk9-b22
diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4
index 649f8ddfc29..00ee498ed82 100644
--- a/common/autoconf/basics.m4
+++ b/common/autoconf/basics.m4
@@ -512,7 +512,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
)
AC_ARG_WITH(sysroot, [AS_HELP_STRING([--with-sysroot],
- [use this directory as sysroot)])],
+ [use this directory as sysroot])],
[SYSROOT=$with_sysroot]
)
@@ -531,6 +531,75 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
[BASIC_PREPEND_TO_PATH([EXTRA_PATH],$with_extra_path)]
)
+ if test "x$OPENJDK_BUILD_OS" = "xmacosx"; then
+ # detect if Xcode is installed by running xcodebuild -version
+ # if no Xcode installed, xcodebuild exits with 1
+ # if Xcode is installed, even if xcode-select is misconfigured, then it exits with 0
+ if /usr/bin/xcodebuild -version >/dev/null 2>&1; then
+ # We need to use xcodebuild in the toolchain dir provided by the user, this will
+ # fall back on the stub binary in /usr/bin/xcodebuild
+ AC_PATH_PROG([XCODEBUILD], [xcodebuild], [/usr/bin/xcodebuild], [$TOOLCHAIN_PATH])
+ else
+ # this should result in SYSROOT being empty, unless --with-sysroot is provided
+ # when only the command line tools are installed there are no SDKs, so headers
+ # are copied into the system frameworks
+ XCODEBUILD=
+ AC_SUBST(XCODEBUILD)
+ fi
+
+ AC_MSG_CHECKING([for sdk name])
+ AC_ARG_WITH([sdk-name], [AS_HELP_STRING([--with-sdk-name],
+ [use the platform SDK of the given name. @<:@macosx@:>@])],
+ [SDKNAME=$with_sdk_name]
+ )
+ AC_MSG_RESULT([$SDKNAME])
+
+ # if toolchain path is specified then don't rely on system headers, they may not compile
+ HAVE_SYSTEM_FRAMEWORK_HEADERS=0
+ test -z "$TOOLCHAIN_PATH" && \
+ HAVE_SYSTEM_FRAMEWORK_HEADERS=`test ! -f /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h; echo $?`
+
+ if test -z "$SYSROOT"; then
+ if test -n "$XCODEBUILD"; then
+ # if we don't have system headers, use default SDK name (last resort)
+ if test -z "$SDKNAME" -a $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then
+ SDKNAME=${SDKNAME:-macosx}
+ fi
+
+ if test -n "$SDKNAME"; then
+ # Call xcodebuild to determine SYSROOT
+ SYSROOT=`"$XCODEBUILD" -sdk $SDKNAME -version | grep '^Path: ' | sed 's/Path: //'`
+ fi
+ else
+ if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then
+ AC_MSG_ERROR([No xcodebuild tool and no system framework headers found, use --with-sysroot or --with-sdk-name to provide a path to a valid SDK])
+ fi
+ fi
+ else
+ # warn user if --with-sdk-name was also set
+ if test -n "$with_sdk_name"; then
+ AC_MSG_WARN([Both SYSROOT and --with-sdk-name are set, only SYSROOT will be used])
+ fi
+ fi
+
+ if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0 -a -z "$SYSROOT"; then
+ # If no system framework headers, then SYSROOT must be set, or we won't build
+ AC_MSG_ERROR([Unable to determine SYSROOT and no headers found in /System/Library/Frameworks. Check Xcode configuration, --with-sysroot or --with-sdk-name arguments.])
+ fi
+
+ # Perform a basic sanity test
+ if test ! -f "$SYSROOT/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then
+ if test -z "$SYSROOT"; then
+ AC_MSG_ERROR([Unable to find required framework headers, provide a path to an SDK via --with-sysroot or --with-sdk-name and be sure Xcode is installed properly])
+ else
+ AC_MSG_ERROR([Invalid SDK or SYSROOT path, dependent framework headers not found])
+ fi
+ fi
+
+ # set SDKROOT too, Xcode tools will pick it up
+ AC_SUBST(SDKROOT,$SYSROOT)
+ fi
+
# Prepend the extra path to the global path
BASIC_PREPEND_TO_PATH([PATH],$EXTRA_PATH)
diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4
index fc13f71b8aa..40f60a9c85d 100644
--- a/common/autoconf/flags.m4
+++ b/common/autoconf/flags.m4
@@ -116,21 +116,25 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
AC_SUBST(RC_FLAGS)
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
- # FIXME: likely bug, should be CCXXFLAGS_JDK? or one for C or CXX.
- CCXXFLAGS="$CCXXFLAGS -nologo"
+ # silence copyright notice and other headers.
+ COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo"
fi
if test "x$SYSROOT" != "x"; then
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
# Solaris Studio does not have a concept of sysroot. Instead we must
- # make sure the default include and lib dirs are appended to each
+ # make sure the default include and lib dirs are appended to each
# compile and link command line.
SYSROOT_CFLAGS="-I$SYSROOT/usr/include"
SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
-L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
-L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
fi
+ elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
+ # Apple only wants -isysroot , but we also need -iframework/System/Library/Frameworks
+ SYSROOT_CFLAGS="-isysroot \"$SYSROOT\" -iframework\"$SYSROOT/System/Library/Frameworks\""
+ SYSROOT_LDFLAGS=$SYSROOT_CFLAGS
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
SYSROOT_CFLAGS="--sysroot=\"$SYSROOT\""
SYSROOT_LDFLAGS="--sysroot=\"$SYSROOT\""
@@ -143,6 +147,14 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS"
LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS"
fi
+
+ # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
+ # set this here so it doesn't have to be peppered throughout the forest
+ if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+ SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
+ SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
+ fi
+
AC_SUBST(SYSROOT_CFLAGS)
AC_SUBST(SYSROOT_LDFLAGS)
])
@@ -302,6 +314,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
# Debug symbols
if test "x$TOOLCHAIN_TYPE" = xgcc; then
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
+ # reduce from default "-g2" option to save space
CFLAGS_DEBUG_SYMBOLS="-g1"
CXXFLAGS_DEBUG_SYMBOLS="-g1"
else
@@ -313,6 +326,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
CXXFLAGS_DEBUG_SYMBOLS="-g"
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
CFLAGS_DEBUG_SYMBOLS="-g -xs"
+ # FIXME: likely a bug, this disables debug symbols rather than enables them
CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
CFLAGS_DEBUG_SYMBOLS="-g"
@@ -321,6 +335,31 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS)
+ # bounds, memory and behavior checking options
+ if test "x$TOOLCHAIN_TYPE" = xgcc; then
+ case $DEBUG_LEVEL in
+ release )
+ # no adjustment
+ ;;
+ fastdebug )
+ # Add compile time bounds checks.
+ CFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1"
+ CXXFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1"
+ ;;
+ slowdebug )
+ # Add runtime bounds checks and symbol info.
+ CFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all --param ssp-buffer-size=1"
+ CXXFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all --param ssp-buffer-size=1"
+ if test "x$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" = "xtrue"; then
+ CFLAGS_DEBUG_OPTIONS="$CFLAGS_DEBUG_OPTIONS $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
+ CXXFLAGS_DEBUG_OPTIONS="$CXXFLAGS_DEBUG_OPTIONS $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
+ fi
+ ;;
+ esac
+ fi
+ AC_SUBST(CFLAGS_DEBUG_OPTIONS)
+ AC_SUBST(CXXFLAGS_DEBUG_OPTIONS)
+
# Optimization levels
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
CC_HIGHEST="$CC_HIGHEST -fns -fsimple -fsingle -xbuiltin=%all -xdepend -xrestrict -xlibmil"
@@ -330,10 +369,12 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xalias_level=basic -xregs=no%frameptr"
C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr"
C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr"
+ C_O_FLAG_DEBUG="-xregs=no%frameptr"
C_O_FLAG_NONE="-xregs=no%frameptr"
CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr"
CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr"
CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr"
+ CXX_O_FLAG_DEBUG="-xregs=no%frameptr"
CXX_O_FLAG_NONE="-xregs=no%frameptr"
if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then
C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium"
@@ -343,10 +384,12 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xalias_level=basic -xprefetch=auto,explicit -xchip=ultra"
C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
+ C_O_FLAG_DEBUG=""
C_O_FLAG_NONE=""
CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
+ C_O_FLAG_DEBUG=""
CXX_O_FLAG_NONE=""
fi
else
@@ -359,13 +402,17 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
C_O_FLAG_HIGHEST="-Os"
C_O_FLAG_HI="-Os"
C_O_FLAG_NORM="-Os"
- C_O_FLAG_NONE=""
else
C_O_FLAG_HIGHEST="-O3"
C_O_FLAG_HI="-O3"
C_O_FLAG_NORM="-O2"
- C_O_FLAG_NONE="-O0"
fi
+ if test "x$HAS_CFLAG_OPTIMIZE_DEBUG" = "xtrue"; then
+ C_O_FLAG_DEBUG="$CFLAG_OPTIMIZE_DEBUG_FLAG"
+ else
+ C_O_FLAG_DEBUG="-O0"
+ fi
+ C_O_FLAG_NONE="-O0"
elif test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
# On MacOSX we optimize for size, something
@@ -373,37 +420,63 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
C_O_FLAG_HIGHEST="-Os"
C_O_FLAG_HI="-Os"
C_O_FLAG_NORM="-Os"
- C_O_FLAG_NONE=""
else
C_O_FLAG_HIGHEST="-O3"
C_O_FLAG_HI="-O3"
C_O_FLAG_NORM="-O2"
- C_O_FLAG_NONE="-O0"
fi
+ C_O_FLAG_DEBUG="-O0"
+ C_O_FLAG_NONE="-O0"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
C_O_FLAG_HIGHEST="-O3"
C_O_FLAG_HI="-O3 -qstrict"
C_O_FLAG_NORM="-O2"
- C_O_FLAG_NONE=""
+ C_O_FLAG_DEBUG="-qnoopt"
+ C_O_FLAG_NONE="-qnoop"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
C_O_FLAG_HIGHEST="-O2"
C_O_FLAG_HI="-O1"
C_O_FLAG_NORM="-O1"
+ C_O_FLAG_DEBUG="-Od"
C_O_FLAG_NONE="-Od"
fi
CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST"
CXX_O_FLAG_HI="$C_O_FLAG_HI"
CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
+ CXX_O_FLAG_DEBUG="$C_O_FLAG_DEBUG"
CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
fi
+ # Adjust optimization flags according to debug level.
+ case $DEBUG_LEVEL in
+ release )
+ # no adjustment
+ ;;
+ fastdebug )
+ # Not quite so much optimization
+ C_O_FLAG_HI="$C_O_FLAG_NORM"
+ CXX_O_FLAG_HI="$CXX_O_FLAG_NORM"
+ ;;
+ slowdebug )
+ # Disable optimization
+ C_O_FLAG_HIGHEST="$C_O_FLAG_DEBUG"
+ C_O_FLAG_HI="$C_O_FLAG_DEBUG"
+ C_O_FLAG_NORM="$C_O_FLAG_DEBUG"
+ CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_DEBUG"
+ CXX_O_FLAG_HI="$CXX_O_FLAG_DEBUG"
+ CXX_O_FLAG_NORM="$CXX_O_FLAG_DEBUG"
+ ;;
+ esac
+
AC_SUBST(C_O_FLAG_HIGHEST)
AC_SUBST(C_O_FLAG_HI)
AC_SUBST(C_O_FLAG_NORM)
+ AC_SUBST(C_O_FLAG_DEBUG)
AC_SUBST(C_O_FLAG_NONE)
AC_SUBST(CXX_O_FLAG_HIGHEST)
AC_SUBST(CXX_O_FLAG_HI)
AC_SUBST(CXX_O_FLAG_NORM)
+ AC_SUBST(CXX_O_FLAG_DEBUG)
AC_SUBST(CXX_O_FLAG_NONE)
])
@@ -461,11 +534,12 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
# Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build.
#
- # Setup compiler/platform specific flags to CFLAGS_JDK,
- # CXXFLAGS_JDK and CCXXFLAGS_JDK (common to C and CXX?)
+ # Setup compiler/platform specific flags into
+ # CFLAGS_JDK - C Compiler flags
+ # CXXFLAGS_JDK - C++ Compiler flags
+ # COMMON_CCXXFLAGS_JDK - common to C and C++
if test "x$TOOLCHAIN_TYPE" = xgcc; then
- # these options are used for both C and C++ compiles
- CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
case $OPENJDK_TARGET_CPU_ARCH in
arm )
@@ -477,31 +551,31 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
* )
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer"
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
esac
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
- CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE"
fi
-
+
CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal"
CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
- CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
-D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
-DWIN32 -DIAL"
if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64"
else
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86"
fi
fi
@@ -509,28 +583,20 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
# Adjust flags according to debug level.
case $DEBUG_LEVEL in
- fastdebug )
- CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
- CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
- C_O_FLAG_HI="$C_O_FLAG_NORM"
- C_O_FLAG_NORM="$C_O_FLAG_NORM"
- CXX_O_FLAG_HI="$CXX_O_FLAG_NORM"
- CXX_O_FLAG_NORM="$CXX_O_FLAG_NORM"
+ fastdebug | slowdebug )
+ CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS"
+ CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS"
JAVAC_FLAGS="$JAVAC_FLAGS -g"
;;
- slowdebug )
- CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
- CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
- C_O_FLAG_HI="$C_O_FLAG_NONE"
- C_O_FLAG_NORM="$C_O_FLAG_NONE"
- CXX_O_FLAG_HI="$CXX_O_FLAG_NONE"
- CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE"
- JAVAC_FLAGS="$JAVAC_FLAGS -g"
+ release )
+ ;;
+ * )
+ AC_MSG_ERROR([Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL])
;;
esac
# Setup LP64
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK $ADD_LP64"
# Set some common defines. These works for all compilers, but assume
# -D is universally accepted.
@@ -543,74 +609,69 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
# Note: -Dmacro is the same as #define macro 1
# -Dmacro= is the same as #define macro
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN="
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN="
else
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
fi
else
# Same goes for _BIG_ENDIAN. Do we really need to set *ENDIAN on Solaris if they
# are defined in the system?
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN="
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN="
else
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN"
fi
fi
-
+
# Setup target OS define. Use OS target name but in upper case.
OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE"
# Setup target CPU
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
-
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
+
# Setup debug/release defines
if test "x$DEBUG_LEVEL" = xrelease; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DNDEBUG"
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DTRIMMED"
fi
else
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DDEBUG"
fi
# Setup release name
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"\$(RELEASE)\"'"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DRELEASE='\"\$(RELEASE)\"'"
# Set some additional per-OS defines.
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
elif test "x$OPENJDK_TARGET_OS" = xaix; then
# FIXME: PPC64 should not be here.
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DPPC64"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DPPC64"
elif test "x$OPENJDK_TARGET_OS" = xbsd; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
fi
# Additional macosx handling
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
- if test "x$TOOLCHAIN_TYPE" = xgcc; then
- # FIXME: This needs to be exported in spec.gmk due to closed legacy code.
- # FIXME: clean this up, and/or move it elsewhere.
+ # Setting these parameters makes it an error to link to macosx APIs that are
+ # newer than the given OS version and makes the linked binaries compatible
+ # even if built on a newer version of the OS.
+ # The expected format is X.Y.Z
+ MACOSX_VERSION_MIN=10.7.0
+ AC_SUBST(MACOSX_VERSION_MIN)
- # Setting these parameters makes it an error to link to macosx APIs that are
- # newer than the given OS version and makes the linked binaries compatible
- # even if built on a newer version of the OS.
- # The expected format is X.Y.Z
- MACOSX_VERSION_MIN=10.7.0
- AC_SUBST(MACOSX_VERSION_MIN)
-
- # The macro takes the version with no dots, ex: 1070
- # Let the flags variables get resolved in make for easier override on make
- # command line.
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
- LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
- fi
+ # The macro takes the version with no dots, ex: 1070
+ # Let the flags variables get resolved in make for easier override on make
+ # command line.
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
+ LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
fi
# Setup some hard coded includes
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK \
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
-I${JDK_OUTPUTDIR}/include \
-I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \
-I${JDK_TOPDIR}/src/share/javavm/export \
@@ -619,12 +680,12 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
-I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common"
# The shared libraries are compiled using the picflag.
- CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
- CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
+ CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
+ CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
# Executable flags
- CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK"
- CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK"
+ CFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK"
+ CXXFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK"
AC_SUBST(CFLAGS_JDKLIB)
AC_SUBST(CFLAGS_JDKEXE)
@@ -633,6 +694,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
# Setup LDFLAGS et al.
#
+
# Now this is odd. The JDK native libraries have to link against libjvm.so
# On 32-bit machines there is normally two distinct libjvm.so:s, client and server.
# Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
@@ -648,39 +710,93 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
fi
# TODO: make -debug optional "--disable-full-debug-symbols"
LDFLAGS_JDK="$LDFLAGS_JDK -debug"
- LDFLAGS_JDKLIB="${LDFLAGS_JDK} -dll -libpath:${JDK_OUTPUTDIR}/lib"
- LDFLAGS_JDKLIB_SUFFIX=""
+ elif test "x$TOOLCHAIN_TYPE" = xgcc; then
+ # If this is a --hash-style=gnu system, use --hash-style=both, why?
+ # We have previously set HAS_GNU_HASH if this is the case
+ if test -n "$HAS_GNU_HASH"; then
+ LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both"
+ fi
+ if test "x$OPENJDK_TARGET_OS" = xlinux; then
+ # And since we now know that the linker is gnu, then add -z defs, to forbid
+ # undefined symbols in object files.
+ LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
+ case $DEBUG_LEVEL in
+ release )
+ # tell linker to optimize libraries.
+ # Should this be supplied to the OSS linker as well?
+ LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
+ ;;
+ slowdebug )
+ if test "x$HAS_LINKER_NOW" = "xtrue"; then
+ # do relocations at load
+ LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_NOW_FLAG"
+ LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_NOW_FLAG"
+ fi
+ if test "x$HAS_LINKER_RELRO" = "xtrue"; then
+ # mark relocations read only
+ LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_RELRO_FLAG"
+ LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG"
+ fi
+ ;;
+ fastdebug )
+ if test "x$HAS_LINKER_RELRO" = "xtrue"; then
+ # mark relocations read only
+ LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_RELRO_FLAG"
+ LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG"
+ fi
+ ;;
+ * )
+ AC_MSG_ERROR([Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL])
+ ;;
+ esac
+ fi
+ elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
+ LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
+ LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
+ fi
+
+ if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
+ # If undefined behaviour detection is enabled then we need to tell linker.
+ case $DEBUG_LEVEL in
+ release | fastdebug )
+ ;;
+ slowdebug )
+ AC_MSG_WARN([$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR])
+ if test "x$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" = "xtrue"; then
+ # enable undefined behaviour checking
+ LDFLAGS_JDK="$LDFLAGS_JDK `$ECHO -n $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG | sed -e "s/[ ]*\([^ ]\+\)/ -Xlinker \1/g"`"
+ LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK `$ECHO -n $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG | sed -e "s/[ ]*\([^ ]\+\)/ -Xlinker \1/g"`"
+ fi
+ ;;
+ * )
+ AC_MSG_ERROR([Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL])
+ ;;
+ esac
+ fi
+
+ # Customize LDFLAGS for executables
+
+ LDFLAGS_JDKEXE="${LDFLAGS_JDK}"
+
+ if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
LDFLAGS_STACK_SIZE=1048576
else
LDFLAGS_STACK_SIZE=327680
fi
- LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE"
+ LDFLAGS_JDKEXE="${LDFLAGS_JDKEXE} /STACK:$LDFLAGS_STACK_SIZE"
+ elif test "x$OPENJDK_TARGET_OS" = xlinux; then
+ LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
+ fi
+
+ # Customize LDFLAGS for libs
+ LDFLAGS_JDKLIB="${LDFLAGS_JDK}"
+
+ if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${JDK_OUTPUTDIR}/lib"
+ LDFLAGS_JDKLIB_SUFFIX=""
else
- if test "x$TOOLCHAIN_TYPE" = xgcc; then
- # If this is a --hash-style=gnu system, use --hash-style=both, why?
- # We have previously set HAS_GNU_HASH if this is the case
- if test -n "$HAS_GNU_HASH"; then
- LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both "
- fi
- if test "x$OPENJDK_TARGET_OS" = xlinux; then
- # And since we now know that the linker is gnu, then add -z defs, to forbid
- # undefined symbols in object files.
- LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
- if test "x$DEBUG_LEVEL" = "xrelease"; then
- # When building release libraries, tell the linker optimize them.
- # Should this be supplied to the OSS linker as well?
- LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
- fi
- fi
- fi
-
- if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
- LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
- LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
- fi
-
- LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS} \
-L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
# On some platforms (mac) the linker warns about non existing -L dirs.
@@ -701,12 +817,8 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc"
fi
-
- LDFLAGS_JDKEXE="${LDFLAGS_JDK}"
- if test "x$OPENJDK_TARGET_OS" = xlinux; then
- LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
- fi
fi
+
AC_SUBST(LDFLAGS_JDKLIB)
AC_SUBST(LDFLAGS_JDKEXE)
AC_SUBST(LDFLAGS_JDKLIB_SUFFIX)
@@ -714,7 +826,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
AC_SUBST(LDFLAGS_CXX_JDK)
])
-
# FLAGS_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
# [RUN-IF-FALSE])
# ------------------------------------------------------------
@@ -727,7 +838,7 @@ AC_DEFUN([FLAGS_COMPILER_CHECK_ARGUMENTS],
saved_cflags="$CFLAGS"
CFLAGS="$CFLAGS $1"
AC_LANG_PUSH([C])
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
[supports=no])
AC_LANG_POP([C])
CFLAGS="$saved_cflags"
@@ -735,7 +846,7 @@ AC_DEFUN([FLAGS_COMPILER_CHECK_ARGUMENTS],
saved_cxxflags="$CXXFLAGS"
CXXFLAGS="$CXXFLAG $1"
AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
[supports=no])
AC_LANG_POP([C++])
CXXFLAGS="$saved_cxxflags"
@@ -748,6 +859,31 @@ AC_DEFUN([FLAGS_COMPILER_CHECK_ARGUMENTS],
fi
])
+# FLAGS_LINKER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
+# [RUN-IF-FALSE])
+# ------------------------------------------------------------
+# Check that the linker support an argument
+AC_DEFUN([FLAGS_LINKER_CHECK_ARGUMENTS],
+[
+ AC_MSG_CHECKING([if linker supports "$1"])
+ supports=yes
+
+ saved_ldflags="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $1"
+ AC_LANG_PUSH([C])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
+ [], [supports=no])
+ AC_LANG_POP([C])
+ LDFLAGS="$saved_ldflags"
+
+ AC_MSG_RESULT([$supports])
+ if test "x$supports" = "xyes" ; then
+ m4_ifval([$2], [$2], [:])
+ else
+ m4_ifval([$3], [$3], [:])
+ fi
+])
+
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
[
# Some Zero and Shark settings.
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 86905690fb7..2ec5ac45fb8 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -692,13 +692,17 @@ LEGACY_EXTRA_LDFLAGS
LEGACY_EXTRA_CXXFLAGS
LEGACY_EXTRA_CFLAGS
CXX_O_FLAG_NONE
+CXX_O_FLAG_DEBUG
CXX_O_FLAG_NORM
CXX_O_FLAG_HI
CXX_O_FLAG_HIGHEST
C_O_FLAG_NONE
+C_O_FLAG_DEBUG
C_O_FLAG_NORM
C_O_FLAG_HI
C_O_FLAG_HIGHEST
+CXXFLAGS_DEBUG_OPTIONS
+CFLAGS_DEBUG_OPTIONS
CXXFLAGS_DEBUG_SYMBOLS
CFLAGS_DEBUG_SYMBOLS
CXX_FLAG_DEPS
@@ -870,6 +874,8 @@ PKGHANDLER
OUTPUT_ROOT
CONF_NAME
SPEC
+SDKROOT
+XCODEBUILD
BUILD_VARIANT_RELEASE
DEBUG_CLASSFILES
FASTDEBUG
@@ -1036,6 +1042,7 @@ with_sysroot
with_tools_dir
with_toolchain_path
with_extra_path
+with_sdk_name
with_conf_name
with_builddeps_conf
with_builddeps_server
@@ -1070,7 +1077,6 @@ with_extra_cxxflags
with_extra_ldflags
enable_debug_symbols
enable_zip_debug_info
-enable_macosx_runtime_support
with_x
with_cups
with_cups_include
@@ -1081,6 +1087,7 @@ enable_freetype_bundling
with_alsa
with_alsa_include
with_alsa_lib
+with_libjpeg
with_giflib
with_lcms
with_libpng
@@ -1837,9 +1844,6 @@ Optional Features:
--disable-debug-symbols disable generation of debug symbols [enabled]
--disable-zip-debug-info
disable zipping of debug-info files [enabled]
- --enable-macosx-runtime-support
- Deprecated. Option is kept for backwards
- compatibility and is ignored
--disable-freetype-bundling
disable bundling of the freetype library with the
build result [enabled on Windows or when using
@@ -1868,12 +1872,13 @@ Optional Packages:
optimized (HotSpot build only)) [release]
--with-devkit use this devkit for compilers, tools and resources
--with-sys-root alias for --with-sysroot for backwards compatability
- --with-sysroot use this directory as sysroot)
+ --with-sysroot use this directory as sysroot
--with-tools-dir alias for --with-toolchain-path for backwards
compatibility
--with-toolchain-path prepend these directories when searching for
toolchain binaries (compilers etc)
--with-extra-path prepend these directories to the default path
+ --with-sdk-name use the platform SDK of the given name. [macosx]
--with-conf-name use this as the name of the configuration [generated
from important configuration options]
--with-builddeps-conf use this configuration file for the builddeps
@@ -1938,6 +1943,8 @@ Optional Packages:
headers under PATH/include)
--with-alsa-include specify directory for the alsa include files
--with-alsa-lib specify directory for the alsa library
+ --with-libjpeg use libjpeg from build system or OpenJDK source
+ (system, bundled) [bundled]
--with-giflib use giflib from build system or OpenJDK source
(system, bundled) [bundled]
--with-lcms use lcms2 from build system or OpenJDK source
@@ -2346,6 +2353,52 @@ fi
} # ac_fn_objc_try_compile
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES
# ---------------------------------------------------------
# Tests whether HEADER exists, giving a warning if it cannot be compiled using
@@ -3761,13 +3814,18 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
# FLAGS_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
# [RUN-IF-FALSE])
# ------------------------------------------------------------
# Check that the c and c++ compilers support an argument
+# FLAGS_LINKER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
+# [RUN-IF-FALSE])
+# ------------------------------------------------------------
+# Check that the linker support an argument
+
+
#
@@ -4253,7 +4311,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1399969244
+DATE_WHEN_GENERATED=1403557683
###############################################################################
#
@@ -13552,7 +13610,7 @@ test -n "$target_alias" &&
VAR_CPU_BITS=32
VAR_CPU_ENDIAN=big
;;
- sparcv9)
+ sparcv9|sparc64)
VAR_CPU=sparcv9
VAR_CPU_ARCH=sparc
VAR_CPU_BITS=64
@@ -13683,7 +13741,7 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; }
VAR_CPU_BITS=32
VAR_CPU_ENDIAN=big
;;
- sparcv9)
+ sparcv9|sparc64)
VAR_CPU=sparcv9
VAR_CPU_ARCH=sparc
VAR_CPU_BITS=64
@@ -14913,6 +14971,122 @@ if test "${with_extra_path+set}" = set; then :
fi
+ if test "x$OPENJDK_BUILD_OS" = "xmacosx"; then
+ # detect if Xcode is installed by running xcodebuild -version
+ # if no Xcode installed, xcodebuild exits with 1
+ # if Xcode is installed, even if xcode-select is misconfigured, then it exits with 0
+ if /usr/bin/xcodebuild -version >/dev/null 2>&1; then
+ # We need to use xcodebuild in the toolchain dir provided by the user, this will
+ # fall back on the stub binary in /usr/bin/xcodebuild
+ # Extract the first word of "xcodebuild", so it can be a program name with args.
+set dummy xcodebuild; 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_XCODEBUILD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $XCODEBUILD in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_XCODEBUILD="$XCODEBUILD" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $TOOLCHAIN_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_XCODEBUILD="$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
+
+ test -z "$ac_cv_path_XCODEBUILD" && ac_cv_path_XCODEBUILD="/usr/bin/xcodebuild"
+ ;;
+esac
+fi
+XCODEBUILD=$ac_cv_path_XCODEBUILD
+if test -n "$XCODEBUILD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XCODEBUILD" >&5
+$as_echo "$XCODEBUILD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ # this should result in SYSROOT being empty, unless --with-sysroot is provided
+ # when only the command line tools are installed there are no SDKs, so headers
+ # are copied into the system frameworks
+ XCODEBUILD=
+
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sdk name" >&5
+$as_echo_n "checking for sdk name... " >&6; }
+
+# Check whether --with-sdk-name was given.
+if test "${with_sdk_name+set}" = set; then :
+ withval=$with_sdk_name; SDKNAME=$with_sdk_name
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDKNAME" >&5
+$as_echo "$SDKNAME" >&6; }
+
+ # if toolchain path is specified then don't rely on system headers, they may not compile
+ HAVE_SYSTEM_FRAMEWORK_HEADERS=0
+ test -z "$TOOLCHAIN_PATH" && \
+ HAVE_SYSTEM_FRAMEWORK_HEADERS=`test ! -f /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h; echo $?`
+
+ if test -z "$SYSROOT"; then
+ if test -n "$XCODEBUILD"; then
+ # if we don't have system headers, use default SDK name (last resort)
+ if test -z "$SDKNAME" -a $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then
+ SDKNAME=${SDKNAME:-macosx}
+ fi
+
+ if test -n "$SDKNAME"; then
+ # Call xcodebuild to determine SYSROOT
+ SYSROOT=`"$XCODEBUILD" -sdk $SDKNAME -version | grep '^Path: ' | sed 's/Path: //'`
+ fi
+ else
+ if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then
+ as_fn_error $? "No xcodebuild tool and no system framework headers found, use --with-sysroot or --with-sdk-name to provide a path to a valid SDK" "$LINENO" 5
+ fi
+ fi
+ else
+ # warn user if --with-sdk-name was also set
+ if test -n "$with_sdk_name"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Both SYSROOT and --with-sdk-name are set, only SYSROOT will be used" >&5
+$as_echo "$as_me: WARNING: Both SYSROOT and --with-sdk-name are set, only SYSROOT will be used" >&2;}
+ fi
+ fi
+
+ if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0 -a -z "$SYSROOT"; then
+ # If no system framework headers, then SYSROOT must be set, or we won't build
+ as_fn_error $? "Unable to determine SYSROOT and no headers found in /System/Library/Frameworks. Check Xcode configuration, --with-sysroot or --with-sdk-name arguments." "$LINENO" 5
+ fi
+
+ # Perform a basic sanity test
+ if test ! -f "$SYSROOT/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then
+ if test -z "$SYSROOT"; then
+ as_fn_error $? "Unable to find required framework headers, provide a path to an SDK via --with-sysroot or --with-sdk-name and be sure Xcode is installed properly" "$LINENO" 5
+ else
+ as_fn_error $? "Invalid SDK or SYSROOT path, dependent framework headers not found" "$LINENO" 5
+ fi
+ fi
+
+ # set SDKROOT too, Xcode tools will pick it up
+ SDKROOT=$SYSROOT
+
+ fi
+
# Prepend the extra path to the global path
if test "x$EXTRA_PATH" != x; then
@@ -26541,21 +26715,28 @@ fi
VALID_TOOLCHAINS=${!toolchain_var_name}
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
- # On Mac OS X, default toolchain to clang after Xcode 5
- XCODE_VERSION_OUTPUT=`xcodebuild -version 2>&1 | $HEAD -n 1`
- $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null
- if test $? -ne 0; then
- as_fn_error $? "Failed to determine Xcode version." "$LINENO" 5
- fi
- XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \
- $SED -e 's/^Xcode \([1-9][0-9.]*\)/\1/' | \
- $CUT -f 1 -d .`
- { $as_echo "$as_me:${as_lineno-$LINENO}: Xcode major version: $XCODE_MAJOR_VERSION" >&5
+ if test -n "$XCODEBUILD"; then
+ # On Mac OS X, default toolchain to clang after Xcode 5
+ XCODE_VERSION_OUTPUT=`"$XCODEBUILD" -version 2>&1 | $HEAD -n 1`
+ $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null
+ if test $? -ne 0; then
+ as_fn_error $? "Failed to determine Xcode version." "$LINENO" 5
+ fi
+ XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \
+ $SED -e 's/^Xcode \([1-9][0-9.]*\)/\1/' | \
+ $CUT -f 1 -d .`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Xcode major version: $XCODE_MAJOR_VERSION" >&5
$as_echo "$as_me: Xcode major version: $XCODE_MAJOR_VERSION" >&6;}
- if test $XCODE_MAJOR_VERSION -ge 5; then
- DEFAULT_TOOLCHAIN="clang"
+ if test $XCODE_MAJOR_VERSION -ge 5; then
+ DEFAULT_TOOLCHAIN="clang"
+ else
+ DEFAULT_TOOLCHAIN="gcc"
+ fi
else
- DEFAULT_TOOLCHAIN="gcc"
+ # If Xcode is not installed, but the command line tools are
+ # then we can't run xcodebuild. On these systems we should
+ # default to clang
+ DEFAULT_TOOLCHAIN="clang"
fi
else
# First toolchain type in the list is the default
@@ -40264,6 +40445,8 @@ $as_echo "$as_me: Rewriting BUILD_LD to \"$new_complete\"" >&6;}
+
+
# The package path is used only on macosx?
# FIXME: clean this up, and/or move it elsewhere.
PACKAGE_PATH=/opt/local
@@ -40289,6 +40472,242 @@ $as_echo "$as_me: Rewriting BUILD_LD to \"$new_complete\"" >&6;}
# If this is a --hash-style=gnu system, use --hash-style=both, why?
HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
# This is later checked when setting flags.
+
+ # "-Og" suppported for GCC 4.8 and later
+ CFLAG_OPTIMIZE_DEBUG_FLAG="-Og"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"" >&5
+$as_echo_n "checking if compiler supports \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"... " >&6; }
+ supports=yes
+
+ saved_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS $CFLAG_OPTIMIZE_DEBUG_FLAG"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ supports=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ CFLAGS="$saved_cflags"
+
+ saved_cxxflags="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAG $CFLAG_OPTIMIZE_DEBUG_FLAG"
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+ supports=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ CXXFLAGS="$saved_cxxflags"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
+$as_echo "$supports" >&6; }
+ if test "x$supports" = "xyes" ; then
+ HAS_CFLAG_OPTIMIZE_DEBUG=true
+ else
+ HAS_CFLAG_OPTIMIZE_DEBUG=false
+ fi
+
+
+ # "-fsanitize=undefined" supported for GCC 4.9 and later
+ CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG="-fsanitize=undefined -fsanitize-recover"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG\"" >&5
+$as_echo_n "checking if compiler supports \"$CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG\"... " >&6; }
+ supports=yes
+
+ saved_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ supports=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ CFLAGS="$saved_cflags"
+
+ saved_cxxflags="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAG $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+ supports=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ CXXFLAGS="$saved_cxxflags"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
+$as_echo "$supports" >&6; }
+ if test "x$supports" = "xyes" ; then
+ HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=true
+ else
+ HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=false
+ fi
+
+
+ # "-z relro" supported in GNU binutils 2.17 and later
+ LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports \"$LINKER_RELRO_FLAG\"" >&5
+$as_echo_n "checking if linker supports \"$LINKER_RELRO_FLAG\"... " >&6; }
+ supports=yes
+
+ saved_ldflags="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $LINKER_RELRO_FLAG"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+ supports=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ LDFLAGS="$saved_ldflags"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
+$as_echo "$supports" >&6; }
+ if test "x$supports" = "xyes" ; then
+ HAS_LINKER_RELRO=true
+ else
+ HAS_LINKER_RELRO=false
+ fi
+
+
+ # "-z now" supported in GNU binutils 2.11 and later
+ LINKER_NOW_FLAG="-Xlinker -z -Xlinker now"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports \"$LINKER_NOW_FLAG\"" >&5
+$as_echo_n "checking if linker supports \"$LINKER_NOW_FLAG\"... " >&6; }
+ supports=yes
+
+ saved_ldflags="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $LINKER_NOW_FLAG"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+ supports=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ LDFLAGS="$saved_ldflags"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
+$as_echo "$supports" >&6; }
+ if test "x$supports" = "xyes" ; then
+ HAS_LINKER_NOW=true
+ else
+ HAS_LINKER_NOW=false
+ fi
+
fi
# Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed
@@ -40297,8 +40716,8 @@ $as_echo "$as_me: Rewriting BUILD_LD to \"$new_complete\"" >&6;}
if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$TOOLCHAIN_TYPE" = xgcc; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken SuSE 'ld' which only understands anonymous version tags in executables" >&5
$as_echo_n "checking for broken SuSE 'ld' which only understands anonymous version tags in executables... " >&6; }
- echo "SUNWprivate_1.1 { local: *; };" > version-script.map
- echo "int main() { }" > main.c
+ $ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map
+ $ECHO "int main() { }" > main.c
if $CXX -Xlinker -version-script=version-script.map main.c 2>&5 >&5; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
@@ -40768,8 +41187,8 @@ $as_echo "$tool_specified" >&6; }
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
- # FIXME: likely bug, should be CCXXFLAGS_JDK? or one for C or CXX.
- CCXXFLAGS="$CCXXFLAGS -nologo"
+ # silence copyright notice and other headers.
+ COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo"
fi
if test "x$SYSROOT" != "x"; then
@@ -40783,6 +41202,10 @@ $as_echo "$tool_specified" >&6; }
-L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
-L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
fi
+ elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
+ # Apple only wants -isysroot , but we also need -iframework/System/Library/Frameworks
+ SYSROOT_CFLAGS="-isysroot \"$SYSROOT\" -iframework\"$SYSROOT/System/Library/Frameworks\""
+ SYSROOT_LDFLAGS=$SYSROOT_CFLAGS
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
SYSROOT_CFLAGS="--sysroot=\"$SYSROOT\""
SYSROOT_LDFLAGS="--sysroot=\"$SYSROOT\""
@@ -40796,6 +41219,14 @@ $as_echo "$tool_specified" >&6; }
LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS"
fi
+ # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
+ # set this here so it doesn't have to be peppered throughout the forest
+ if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+ SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
+ SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
+ fi
+
+
@@ -40803,7 +41234,6 @@ $as_echo "$tool_specified" >&6; }
# Now we can test some aspects on the target using configure macros.
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
if ${ac_cv_header_stdc+:} false; then :
@@ -41488,6 +41918,7 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
# Debug symbols
if test "x$TOOLCHAIN_TYPE" = xgcc; then
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
+ # reduce from default "-g2" option to save space
CFLAGS_DEBUG_SYMBOLS="-g1"
CXXFLAGS_DEBUG_SYMBOLS="-g1"
else
@@ -41499,6 +41930,7 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
CXXFLAGS_DEBUG_SYMBOLS="-g"
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
CFLAGS_DEBUG_SYMBOLS="-g -xs"
+ # FIXME: likely a bug, this disables debug symbols rather than enables them
CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
CFLAGS_DEBUG_SYMBOLS="-g"
@@ -41507,6 +41939,31 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
+ # bounds, memory and behavior checking options
+ if test "x$TOOLCHAIN_TYPE" = xgcc; then
+ case $DEBUG_LEVEL in
+ release )
+ # no adjustment
+ ;;
+ fastdebug )
+ # Add compile time bounds checks.
+ CFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1"
+ CXXFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1"
+ ;;
+ slowdebug )
+ # Add runtime bounds checks and symbol info.
+ CFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all --param ssp-buffer-size=1"
+ CXXFLAGS_DEBUG_OPTIONS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all --param ssp-buffer-size=1"
+ if test "x$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" = "xtrue"; then
+ CFLAGS_DEBUG_OPTIONS="$CFLAGS_DEBUG_OPTIONS $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
+ CXXFLAGS_DEBUG_OPTIONS="$CXXFLAGS_DEBUG_OPTIONS $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
+ fi
+ ;;
+ esac
+ fi
+
+
+
# Optimization levels
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
CC_HIGHEST="$CC_HIGHEST -fns -fsimple -fsingle -xbuiltin=%all -xdepend -xrestrict -xlibmil"
@@ -41516,10 +41973,12 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xalias_level=basic -xregs=no%frameptr"
C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr"
C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr"
+ C_O_FLAG_DEBUG="-xregs=no%frameptr"
C_O_FLAG_NONE="-xregs=no%frameptr"
CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr"
CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr"
CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr"
+ CXX_O_FLAG_DEBUG="-xregs=no%frameptr"
CXX_O_FLAG_NONE="-xregs=no%frameptr"
if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then
C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium"
@@ -41529,10 +41988,12 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xalias_level=basic -xprefetch=auto,explicit -xchip=ultra"
C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
+ C_O_FLAG_DEBUG=""
C_O_FLAG_NONE=""
CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
+ C_O_FLAG_DEBUG=""
CXX_O_FLAG_NONE=""
fi
else
@@ -41545,13 +42006,17 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
C_O_FLAG_HIGHEST="-Os"
C_O_FLAG_HI="-Os"
C_O_FLAG_NORM="-Os"
- C_O_FLAG_NONE=""
else
C_O_FLAG_HIGHEST="-O3"
C_O_FLAG_HI="-O3"
C_O_FLAG_NORM="-O2"
- C_O_FLAG_NONE="-O0"
fi
+ if test "x$HAS_CFLAG_OPTIMIZE_DEBUG" = "xtrue"; then
+ C_O_FLAG_DEBUG="$CFLAG_OPTIMIZE_DEBUG_FLAG"
+ else
+ C_O_FLAG_DEBUG="-O0"
+ fi
+ C_O_FLAG_NONE="-O0"
elif test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
# On MacOSX we optimize for size, something
@@ -41559,30 +42024,56 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
C_O_FLAG_HIGHEST="-Os"
C_O_FLAG_HI="-Os"
C_O_FLAG_NORM="-Os"
- C_O_FLAG_NONE=""
else
C_O_FLAG_HIGHEST="-O3"
C_O_FLAG_HI="-O3"
C_O_FLAG_NORM="-O2"
- C_O_FLAG_NONE="-O0"
fi
+ C_O_FLAG_DEBUG="-O0"
+ C_O_FLAG_NONE="-O0"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
C_O_FLAG_HIGHEST="-O3"
C_O_FLAG_HI="-O3 -qstrict"
C_O_FLAG_NORM="-O2"
- C_O_FLAG_NONE=""
+ C_O_FLAG_DEBUG="-qnoopt"
+ C_O_FLAG_NONE="-qnoop"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
C_O_FLAG_HIGHEST="-O2"
C_O_FLAG_HI="-O1"
C_O_FLAG_NORM="-O1"
+ C_O_FLAG_DEBUG="-Od"
C_O_FLAG_NONE="-Od"
fi
CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST"
CXX_O_FLAG_HI="$C_O_FLAG_HI"
CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
+ CXX_O_FLAG_DEBUG="$C_O_FLAG_DEBUG"
CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
fi
+ # Adjust optimization flags according to debug level.
+ case $DEBUG_LEVEL in
+ release )
+ # no adjustment
+ ;;
+ fastdebug )
+ # Not quite so much optimization
+ C_O_FLAG_HI="$C_O_FLAG_NORM"
+ CXX_O_FLAG_HI="$CXX_O_FLAG_NORM"
+ ;;
+ slowdebug )
+ # Disable optimization
+ C_O_FLAG_HIGHEST="$C_O_FLAG_DEBUG"
+ C_O_FLAG_HI="$C_O_FLAG_DEBUG"
+ C_O_FLAG_NORM="$C_O_FLAG_DEBUG"
+ CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_DEBUG"
+ CXX_O_FLAG_HI="$CXX_O_FLAG_DEBUG"
+ CXX_O_FLAG_NORM="$CXX_O_FLAG_DEBUG"
+ ;;
+ esac
+
+
+
@@ -41660,11 +42151,12 @@ fi
# Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build.
#
- # Setup compiler/platform specific flags to CFLAGS_JDK,
- # CXXFLAGS_JDK and CCXXFLAGS_JDK (common to C and CXX?)
+ # Setup compiler/platform specific flags into
+ # CFLAGS_JDK - C Compiler flags
+ # CXXFLAGS_JDK - C++ Compiler flags
+ # COMMON_CCXXFLAGS_JDK - common to C and C++
if test "x$TOOLCHAIN_TYPE" = xgcc; then
- # these options are used for both C and C++ compiles
- CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
case $OPENJDK_TARGET_CPU_ARCH in
arm )
@@ -41676,14 +42168,14 @@ fi
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
* )
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer"
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
esac
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
- CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE"
fi
@@ -41693,14 +42185,14 @@ fi
CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
- CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
-D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
-DWIN32 -DIAL"
if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64"
else
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86"
fi
fi
@@ -41708,28 +42200,20 @@ fi
# Adjust flags according to debug level.
case $DEBUG_LEVEL in
- fastdebug )
- CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
- CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
- C_O_FLAG_HI="$C_O_FLAG_NORM"
- C_O_FLAG_NORM="$C_O_FLAG_NORM"
- CXX_O_FLAG_HI="$CXX_O_FLAG_NORM"
- CXX_O_FLAG_NORM="$CXX_O_FLAG_NORM"
+ fastdebug | slowdebug )
+ CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS"
+ CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS"
JAVAC_FLAGS="$JAVAC_FLAGS -g"
;;
- slowdebug )
- CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
- CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
- C_O_FLAG_HI="$C_O_FLAG_NONE"
- C_O_FLAG_NORM="$C_O_FLAG_NONE"
- CXX_O_FLAG_HI="$CXX_O_FLAG_NONE"
- CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE"
- JAVAC_FLAGS="$JAVAC_FLAGS -g"
+ release )
+ ;;
+ * )
+ as_fn_error $? "Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL" "$LINENO" 5
;;
esac
# Setup LP64
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK $ADD_LP64"
# Set some common defines. These works for all compilers, but assume
# -D is universally accepted.
@@ -41742,74 +42226,69 @@ fi
# Note: -Dmacro is the same as #define macro 1
# -Dmacro= is the same as #define macro
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN="
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN="
else
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
fi
else
# Same goes for _BIG_ENDIAN. Do we really need to set *ENDIAN on Solaris if they
# are defined in the system?
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN="
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN="
else
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN"
fi
fi
# Setup target OS define. Use OS target name but in upper case.
OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE"
# Setup target CPU
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
# Setup debug/release defines
if test "x$DEBUG_LEVEL" = xrelease; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DNDEBUG"
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DTRIMMED"
fi
else
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DDEBUG"
fi
# Setup release name
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"\$(RELEASE)\"'"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DRELEASE='\"\$(RELEASE)\"'"
# Set some additional per-OS defines.
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
elif test "x$OPENJDK_TARGET_OS" = xaix; then
# FIXME: PPC64 should not be here.
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DPPC64"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DPPC64"
elif test "x$OPENJDK_TARGET_OS" = xbsd; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
fi
# Additional macosx handling
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
- if test "x$TOOLCHAIN_TYPE" = xgcc; then
- # FIXME: This needs to be exported in spec.gmk due to closed legacy code.
- # FIXME: clean this up, and/or move it elsewhere.
-
- # Setting these parameters makes it an error to link to macosx APIs that are
- # newer than the given OS version and makes the linked binaries compatible
- # even if built on a newer version of the OS.
- # The expected format is X.Y.Z
- MACOSX_VERSION_MIN=10.7.0
+ # Setting these parameters makes it an error to link to macosx APIs that are
+ # newer than the given OS version and makes the linked binaries compatible
+ # even if built on a newer version of the OS.
+ # The expected format is X.Y.Z
+ MACOSX_VERSION_MIN=10.7.0
- # The macro takes the version with no dots, ex: 1070
- # Let the flags variables get resolved in make for easier override on make
- # command line.
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
- LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
- fi
+ # The macro takes the version with no dots, ex: 1070
+ # Let the flags variables get resolved in make for easier override on make
+ # command line.
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
+ LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
fi
# Setup some hard coded includes
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK \
+ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
-I${JDK_OUTPUTDIR}/include \
-I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \
-I${JDK_TOPDIR}/src/share/javavm/export \
@@ -41818,12 +42297,12 @@ fi
-I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common"
# The shared libraries are compiled using the picflag.
- CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
- CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
+ CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
+ CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
# Executable flags
- CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK"
- CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK"
+ CFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK"
+ CXXFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK"
@@ -41832,6 +42311,7 @@ fi
# Setup LDFLAGS et al.
#
+
# Now this is odd. The JDK native libraries have to link against libjvm.so
# On 32-bit machines there is normally two distinct libjvm.so:s, client and server.
# Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
@@ -41847,39 +42327,94 @@ fi
fi
# TODO: make -debug optional "--disable-full-debug-symbols"
LDFLAGS_JDK="$LDFLAGS_JDK -debug"
- LDFLAGS_JDKLIB="${LDFLAGS_JDK} -dll -libpath:${JDK_OUTPUTDIR}/lib"
- LDFLAGS_JDKLIB_SUFFIX=""
+ elif test "x$TOOLCHAIN_TYPE" = xgcc; then
+ # If this is a --hash-style=gnu system, use --hash-style=both, why?
+ # We have previously set HAS_GNU_HASH if this is the case
+ if test -n "$HAS_GNU_HASH"; then
+ LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both"
+ fi
+ if test "x$OPENJDK_TARGET_OS" = xlinux; then
+ # And since we now know that the linker is gnu, then add -z defs, to forbid
+ # undefined symbols in object files.
+ LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
+ case $DEBUG_LEVEL in
+ release )
+ # tell linker to optimize libraries.
+ # Should this be supplied to the OSS linker as well?
+ LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
+ ;;
+ slowdebug )
+ if test "x$HAS_LINKER_NOW" = "xtrue"; then
+ # do relocations at load
+ LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_NOW_FLAG"
+ LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_NOW_FLAG"
+ fi
+ if test "x$HAS_LINKER_RELRO" = "xtrue"; then
+ # mark relocations read only
+ LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_RELRO_FLAG"
+ LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG"
+ fi
+ ;;
+ fastdebug )
+ if test "x$HAS_LINKER_RELRO" = "xtrue"; then
+ # mark relocations read only
+ LDFLAGS_JDK="$LDFLAGS_JDK $LINKER_RELRO_FLAG"
+ LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG"
+ fi
+ ;;
+ * )
+ as_fn_error $? "Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL" "$LINENO" 5
+ ;;
+ esac
+ fi
+ elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
+ LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
+ LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
+ fi
+
+ if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
+ # If undefined behaviour detection is enabled then we need to tell linker.
+ case $DEBUG_LEVEL in
+ release | fastdebug )
+ ;;
+ slowdebug )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" >&5
+$as_echo "$as_me: WARNING: $HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" >&2;}
+ if test "x$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" = "xtrue"; then
+ # enable undefined behaviour checking
+ LDFLAGS_JDK="$LDFLAGS_JDK `$ECHO -n $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG | sed -e "s/ *\(^ \+\)/ -Xlinker \1/g"`"
+ LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK `$ECHO -n $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG | sed -e "s/ *\(^ \+\)/ -Xlinker \1/g"`"
+ fi
+ ;;
+ * )
+ as_fn_error $? "Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL" "$LINENO" 5
+ ;;
+ esac
+ fi
+
+ # Customize LDFLAGS for executables
+
+ LDFLAGS_JDKEXE="${LDFLAGS_JDK}"
+
+ if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
LDFLAGS_STACK_SIZE=1048576
else
LDFLAGS_STACK_SIZE=327680
fi
- LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE"
+ LDFLAGS_JDKEXE="${LDFLAGS_JDKEXE} /STACK:$LDFLAGS_STACK_SIZE"
+ elif test "x$OPENJDK_TARGET_OS" = xlinux; then
+ LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
+ fi
+
+ # Customize LDFLAGS for libs
+ LDFLAGS_JDKLIB="${LDFLAGS_JDK}"
+
+ if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${JDK_OUTPUTDIR}/lib"
+ LDFLAGS_JDKLIB_SUFFIX=""
else
- if test "x$TOOLCHAIN_TYPE" = xgcc; then
- # If this is a --hash-style=gnu system, use --hash-style=both, why?
- # We have previously set HAS_GNU_HASH if this is the case
- if test -n "$HAS_GNU_HASH"; then
- LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both "
- fi
- if test "x$OPENJDK_TARGET_OS" = xlinux; then
- # And since we now know that the linker is gnu, then add -z defs, to forbid
- # undefined symbols in object files.
- LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
- if test "x$DEBUG_LEVEL" = "xrelease"; then
- # When building release libraries, tell the linker optimize them.
- # Should this be supplied to the OSS linker as well?
- LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
- fi
- fi
- fi
-
- if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
- LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
- LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
- fi
-
- LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS} \
-L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
# On some platforms (mac) the linker warns about non existing -L dirs.
@@ -41900,11 +42435,6 @@ fi
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc"
fi
-
- LDFLAGS_JDKEXE="${LDFLAGS_JDK}"
- if test "x$OPENJDK_TARGET_OS" = xlinux; then
- LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
- fi
fi
@@ -42257,8 +42787,6 @@ $as_echo_n "checking what is not needed on MacOSX?... " >&6; }
ALSA_NOT_NEEDED=yes
PULSE_NOT_NEEDED=yes
X11_NOT_NEEDED=yes
- # If the java runtime framework is disabled, then we need X11.
- # This will be adjusted below.
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa pulse x11" >&5
$as_echo "alsa pulse x11" >&6; }
fi
@@ -42279,33 +42807,6 @@ $as_echo "alsa" >&6; }
X11_NOT_NEEDED=yes
fi
- ###############################################################################
- #
- # Check for MacOSX support for OpenJDK.
- #
-
-
- # Check whether --enable-macosx-runtime-support was given.
-if test "${enable_macosx_runtime_support+set}" = set; then :
- enableval=$enable_macosx_runtime_support;
-fi
-
- if test "x$enable_macosx_runtime_support" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --enable-macosx-runtime-support is deprecated and will be ignored." >&5
-$as_echo "$as_me: WARNING: Option --enable-macosx-runtime-support is deprecated and will be ignored." >&2;}
- fi
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mac OS X Java Framework" >&5
-$as_echo_n "checking for Mac OS X Java Framework... " >&6; }
- if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: /System/Library/Frameworks/JavaVM.framework" >&5
-$as_echo "/System/Library/Frameworks/JavaVM.framework" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
-
###############################################################################
@@ -47176,10 +47677,43 @@ done
# Check for the jpeg library
#
- USE_EXTERNAL_LIBJPEG=true
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ljpeg" >&5
-$as_echo_n "checking for main in -ljpeg... " >&6; }
-if ${ac_cv_lib_jpeg_main+:} false; then :
+
+# Check whether --with-libjpeg was given.
+if test "${with_libjpeg+set}" = set; then :
+ withval=$with_libjpeg;
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which libjpeg to use" >&5
+$as_echo_n "checking for which libjpeg to use... " >&6; }
+
+ # default is bundled
+ DEFAULT_LIBJPEG=bundled
+
+ #
+ # if user didn't specify, use DEFAULT_LIBJPEG
+ #
+ if test "x${with_libjpeg}" = "x"; then
+ with_libjpeg=${DEFAULT_LIBJPEG}
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libjpeg}" >&5
+$as_echo "${with_libjpeg}" >&6; }
+
+ if test "x${with_libjpeg}" = "xbundled"; then
+ USE_EXTERNAL_LIBJPEG=false
+ elif test "x${with_libjpeg}" = "xsystem"; then
+ ac_fn_cxx_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default"
+if test "x$ac_cv_header_jpeglib_h" = xyes; then :
+
+else
+ as_fn_error $? "--with-libjpeg=system specified, but jpeglib.h not found!" "$LINENO" 5
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_CreateDecompress in -ljpeg" >&5
+$as_echo_n "checking for jpeg_CreateDecompress in -ljpeg... " >&6; }
+if ${ac_cv_lib_jpeg_jpeg_CreateDecompress+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -47187,27 +47721,33 @@ LIBS="-ljpeg $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char jpeg_CreateDecompress ();
int
main ()
{
-return main ();
+return jpeg_CreateDecompress ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
- ac_cv_lib_jpeg_main=yes
+ ac_cv_lib_jpeg_jpeg_CreateDecompress=yes
else
- ac_cv_lib_jpeg_main=no
+ ac_cv_lib_jpeg_jpeg_CreateDecompress=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_main" >&5
-$as_echo "$ac_cv_lib_jpeg_main" >&6; }
-if test "x$ac_cv_lib_jpeg_main" = xyes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_CreateDecompress" >&5
+$as_echo "$ac_cv_lib_jpeg_jpeg_CreateDecompress" >&6; }
+if test "x$ac_cv_lib_jpeg_jpeg_CreateDecompress" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBJPEG 1
_ACEOF
@@ -47215,13 +47755,16 @@ _ACEOF
LIBS="-ljpeg $LIBS"
else
- USE_EXTERNAL_LIBJPEG=false
- { $as_echo "$as_me:${as_lineno-$LINENO}: Will use jpeg decoder bundled with the OpenJDK source" >&5
-$as_echo "$as_me: Will use jpeg decoder bundled with the OpenJDK source" >&6;}
-
+ as_fn_error $? "--with-libjpeg=system specified, but no libjpeg found" "$LINENO" 5
fi
+ USE_EXTERNAL_LIBJPEG=true
+ else
+ as_fn_error $? "Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'" "$LINENO" 5
+ fi
+
+
###############################################################################
#
diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in
index f7abdd40e0a..057d882c28e 100644
--- a/common/autoconf/hotspot-spec.gmk.in
+++ b/common/autoconf/hotspot-spec.gmk.in
@@ -69,8 +69,8 @@ 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)
-# Old name for OPENJDK_TARGET_CPU, uses i586 and amd64, instead of x86 and x86_64.
-ARCH=$(OPENJDK_TARGET_CPU_LEGACY)
+# 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@
diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4
index 6ee3221ad96..3a689ef62ee 100644
--- a/common/autoconf/libraries.m4
+++ b/common/autoconf/libraries.m4
@@ -65,8 +65,6 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT],
ALSA_NOT_NEEDED=yes
PULSE_NOT_NEEDED=yes
X11_NOT_NEEDED=yes
- # If the java runtime framework is disabled, then we need X11.
- # This will be adjusted below.
AC_MSG_RESULT([alsa pulse x11])
fi
@@ -83,20 +81,6 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT],
if test "x$SUPPORT_HEADFUL" = xno; then
X11_NOT_NEEDED=yes
fi
-
- ###############################################################################
- #
- # Check for MacOSX support for OpenJDK.
- #
-
- BASIC_DEPRECATED_ARG_ENABLE(macosx-runtime-support, macosx_runtime_support)
-
- AC_MSG_CHECKING([for Mac OS X Java Framework])
- if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then
- AC_MSG_RESULT([/System/Library/Frameworks/JavaVM.framework])
- else
- AC_MSG_RESULT([no])
- fi
])
AC_DEFUN_ONCE([LIB_SETUP_X11],
@@ -620,11 +604,36 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
# Check for the jpeg library
#
- USE_EXTERNAL_LIBJPEG=true
- AC_CHECK_LIB(jpeg, main, [],
- [ USE_EXTERNAL_LIBJPEG=false
- AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source])
- ])
+ AC_ARG_WITH(libjpeg, [AS_HELP_STRING([--with-libjpeg],
+ [use libjpeg from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
+
+ AC_MSG_CHECKING([for which libjpeg to use])
+
+ # default is bundled
+ DEFAULT_LIBJPEG=bundled
+
+ #
+ # if user didn't specify, use DEFAULT_LIBJPEG
+ #
+ if test "x${with_libjpeg}" = "x"; then
+ with_libjpeg=${DEFAULT_LIBJPEG}
+ fi
+
+ AC_MSG_RESULT(${with_libjpeg})
+
+ if test "x${with_libjpeg}" = "xbundled"; then
+ USE_EXTERNAL_LIBJPEG=false
+ elif test "x${with_libjpeg}" = "xsystem"; then
+ AC_CHECK_HEADER(jpeglib.h, [],
+ [ AC_MSG_ERROR([--with-libjpeg=system specified, but jpeglib.h not found!])])
+ AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, [],
+ [ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])])
+
+ USE_EXTERNAL_LIBJPEG=true
+ else
+ AC_MSG_ERROR([Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'])
+ fi
+
AC_SUBST(USE_EXTERNAL_LIBJPEG)
###############################################################################
diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4
index 1f06f0ce7d5..54838a3e72c 100644
--- a/common/autoconf/platform.m4
+++ b/common/autoconf/platform.m4
@@ -84,7 +84,7 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
VAR_CPU_BITS=32
VAR_CPU_ENDIAN=big
;;
- sparcv9)
+ sparcv9|sparc64)
VAR_CPU=sparcv9
VAR_CPU_ARCH=sparc
VAR_CPU_BITS=64
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index 2f6d7bd3746..bc916f636c3 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -347,6 +347,9 @@ CPP:=@FIXPATH@ @CPP@
# The linker can be gcc or ld on posix systems, or link.exe on windows systems.
LD:=@FIXPATH@ @LD@
+# Xcode SDK path
+SDKROOT:=@SDKROOT@
+
# The linker on older SuSE distros (e.g. on SLES 10) complains with:
# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
# if feeded with a version script which contains named tags.
@@ -544,7 +547,7 @@ SETFILE:=@SETFILE@
XATTR:=@XATTR@
JT_HOME:=@JT_HOME@
JTREGEXE:=@JTREGEXE@
-
+XCODEBUILD=@XCODEBUILD@
FIXPATH:=@FIXPATH@
# Where the build output is stored for your convenience.
diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4
index b7c00d4f495..f380bf446ad 100644
--- a/common/autoconf/toolchain.m4
+++ b/common/autoconf/toolchain.m4
@@ -24,11 +24,11 @@
#
########################################################################
-# This file is responsible for detecting, verifying and setting up the
-# toolchain, i.e. the compiler, linker and related utilities. It will setup
+# This file is responsible for detecting, verifying and setting up the
+# toolchain, i.e. the compiler, linker and related utilities. It will setup
# proper paths to the binaries, but it will not setup any flags.
#
-# The binaries used is determined by the toolchain type, which is the family of
+# The binaries used is determined by the toolchain type, which is the family of
# compilers and related tools that are used.
########################################################################
@@ -83,7 +83,7 @@ AC_DEFUN([TOOLCHAIN_SETUP_FILENAME_PATTERNS],
AC_SUBST(SHARED_LIBRARY)
AC_SUBST(STATIC_LIBRARY)
AC_SUBST(OBJ_SUFFIX)
- AC_SUBST(EXE_SUFFIX)
+ AC_SUBST(EXE_SUFFIX)
])
# Determine which toolchain type to use, and make sure it is valid for this
@@ -98,26 +98,33 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
VALID_TOOLCHAINS=${!toolchain_var_name}
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
- # On Mac OS X, default toolchain to clang after Xcode 5
- XCODE_VERSION_OUTPUT=`xcodebuild -version 2>&1 | $HEAD -n 1`
- $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null
- if test $? -ne 0; then
- AC_MSG_ERROR([Failed to determine Xcode version.])
- fi
- XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \
- $SED -e 's/^Xcode \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/' | \
- $CUT -f 1 -d .`
- AC_MSG_NOTICE([Xcode major version: $XCODE_MAJOR_VERSION])
- if test $XCODE_MAJOR_VERSION -ge 5; then
- DEFAULT_TOOLCHAIN="clang"
+ if test -n "$XCODEBUILD"; then
+ # On Mac OS X, default toolchain to clang after Xcode 5
+ XCODE_VERSION_OUTPUT=`"$XCODEBUILD" -version 2>&1 | $HEAD -n 1`
+ $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null
+ if test $? -ne 0; then
+ AC_MSG_ERROR([Failed to determine Xcode version.])
+ fi
+ XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \
+ $SED -e 's/^Xcode \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/' | \
+ $CUT -f 1 -d .`
+ AC_MSG_NOTICE([Xcode major version: $XCODE_MAJOR_VERSION])
+ if test $XCODE_MAJOR_VERSION -ge 5; then
+ DEFAULT_TOOLCHAIN="clang"
+ else
+ DEFAULT_TOOLCHAIN="gcc"
+ fi
else
- DEFAULT_TOOLCHAIN="gcc"
+ # If Xcode is not installed, but the command line tools are
+ # then we can't run xcodebuild. On these systems we should
+ # default to clang
+ DEFAULT_TOOLCHAIN="clang"
fi
else
# First toolchain type in the list is the default
DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *}
fi
-
+
if test "x$with_toolchain_type" = xlist; then
# List all toolchains
AC_MSG_NOTICE([The following toolchains are valid on this platform:])
@@ -126,7 +133,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
$PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION"
done
-
+
exit 0
elif test "x$with_toolchain_type" != x; then
# User override; check that it is valid
@@ -168,10 +175,10 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
AC_MSG_NOTICE([Using default toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)])
else
AC_MSG_NOTICE([Using user selected toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION). Default toolchain is $DEFAULT_TOOLCHAIN.])
- fi
+ fi
])
-# Before we start detecting the toolchain executables, we might need some
+# Before we start detecting the toolchain executables, we might need some
# special setup, e.g. additional paths etc.
AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
[
@@ -184,7 +191,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
ORG_OBJCFLAGS="$OBJCFLAGS"
# On Windows, we need to detect the visual studio installation first.
- # This will change the PATH, but we need to keep that new PATH even
+ # This will change the PATH, but we need to keep that new PATH even
# after toolchain detection is done, since the compiler (on x86) uses
# it for DLL resolution in runtime.
if test "x$OPENJDK_BUILD_OS" = "xwindows" && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
@@ -208,7 +215,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
PATH="/usr/ccs/bin:$PATH"
fi
- # Finally add TOOLCHAIN_PATH at the beginning, to allow --with-tools-dir to
+ # Finally add TOOLCHAIN_PATH at the beginning, to allow --with-tools-dir to
# override all other locations.
if test "x$TOOLCHAIN_PATH" != x; then
PATH=$TOOLCHAIN_PATH:$PATH
@@ -254,7 +261,7 @@ AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION],
AC_MSG_NOTICE([The result from running with --version was: "$ALT_VERSION_OUTPUT"])
AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.])
fi
- # Remove usage instructions (if present), and
+ # Remove usage instructions (if present), and
# collapse compiler output into a single line
COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \
$SED -e 's/ *@<:@Uu@:>@sage:.*//'`
@@ -282,7 +289,7 @@ AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION],
# There is no specific version flag, but all output starts with a version string.
# First line typically looks something like:
# Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
- COMPILER_VERSION_OUTPUT=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'`
+ COMPILER_VERSION_OUTPUT=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'`
# Check that this is likely to be Microsoft CL.EXE.
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Microsoft.*Compiler" > /dev/null
if test $? -ne 0; then
@@ -360,7 +367,7 @@ AC_DEFUN([TOOLCHAIN_FIND_COMPILER],
AC_MSG_NOTICE([Will use user supplied compiler $1=[$]$1])
if test "x`basename [$]$1`" = "x[$]$1"; then
# A command without a complete path is provided, search $PATH.
-
+
AC_PATH_PROGS(POTENTIAL_$1, [$]$1)
if test "x$POTENTIAL_$1" != x; then
$1=$POTENTIAL_$1
@@ -375,12 +382,12 @@ AC_DEFUN([TOOLCHAIN_FIND_COMPILER],
fi
else
# No user supplied value. Locate compiler ourselves.
-
+
# If we are cross compiling, assume cross compilation tools follows the
# cross compilation standard where they are prefixed with the autoconf
- # standard name for the target. For example the binary
+ # standard name for the target. For example the binary
# i686-sun-solaris2.10-gcc will cross compile for i686-sun-solaris2.10.
- # If we are not cross compiling, then the default compiler name will be
+ # If we are not cross compiling, then the default compiler name will be
# used.
$1=
@@ -450,9 +457,9 @@ AC_DEFUN([TOOLCHAIN_FIND_COMPILER],
TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME])
])
-# Detect the core components of the toolchain, i.e. the compilers (CC and CXX),
-# preprocessor (CPP and CXXCPP), the linker (LD), the assembler (AS) and the
-# archiver (AR). Verify that the compilers are correct according to the
+# Detect the core components of the toolchain, i.e. the compilers (CC and CXX),
+# preprocessor (CPP and CXXCPP), the linker (LD), the assembler (AS) and the
+# archiver (AR). Verify that the compilers are correct according to the
# toolchain type.
AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
[
@@ -529,7 +536,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
])
# Setup additional tools that is considered a part of the toolchain, but not the
-# core part. Many of these are highly platform-specific and do not exist,
+# core part. Many of these are highly platform-specific and do not exist,
# and/or are not needed on all platforms.
AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
[
@@ -551,7 +558,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,)
BASIC_FIXUP_EXECUTABLE(DUMPBIN)
fi
-
+
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
BASIC_PATH_PROGS(STRIP, strip)
BASIC_FIXUP_EXECUTABLE(STRIP)
@@ -559,7 +566,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
BASIC_FIXUP_EXECUTABLE(NM)
BASIC_PATH_PROGS(GNM, gnm)
BASIC_FIXUP_EXECUTABLE(GNM)
-
+
BASIC_PATH_PROGS(MCS, mcs)
BASIC_FIXUP_EXECUTABLE(MCS)
elif test "x$OPENJDK_TARGET_OS" != xwindows; then
@@ -592,17 +599,17 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
# Setup the build tools (i.e, the compiler and linker used to build programs
# that should be run on the build platform, not the target platform, as a build
-# helper). Since the non-cross-compile case uses the normal, target compilers
+# helper). Since the non-cross-compile case uses the normal, target compilers
# for this, we can only do this after these have been setup.
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
-[
+[
if test "x$COMPILE_TYPE" = "xcross"; then
# Now we need to find a C/C++ compiler that can build executables for the
# build platform. We can't use the AC_PROG_CC macro, since it can only be
# used once. Also, we need to do this without adding a tools dir to the
# path, otherwise we might pick up cross-compilers which don't use standard
# naming.
-
+
# FIXME: we should list the discovered compilers as an exclude pattern!
# If we do that, we can do this detection before POST_DETECTION, and still
# find the build compilers in the tools dir, if needed.
@@ -690,15 +697,39 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
# If this is a --hash-style=gnu system, use --hash-style=both, why?
HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
# This is later checked when setting flags.
+
+ # "-Og" suppported for GCC 4.8 and later
+ CFLAG_OPTIMIZE_DEBUG_FLAG="-Og"
+ FLAGS_COMPILER_CHECK_ARGUMENTS([$CFLAG_OPTIMIZE_DEBUG_FLAG],
+ [HAS_CFLAG_OPTIMIZE_DEBUG=true],
+ [HAS_CFLAG_OPTIMIZE_DEBUG=false])
+
+ # "-fsanitize=undefined" supported for GCC 4.9 and later
+ CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG="-fsanitize=undefined -fsanitize-recover"
+ FLAGS_COMPILER_CHECK_ARGUMENTS([$CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG],
+ [HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=true],
+ [HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=false])
+
+ # "-z relro" supported in GNU binutils 2.17 and later
+ LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro"
+ FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_RELRO_FLAG],
+ [HAS_LINKER_RELRO=true],
+ [HAS_LINKER_RELRO=false])
+
+ # "-z now" supported in GNU binutils 2.11 and later
+ LINKER_NOW_FLAG="-Xlinker -z -Xlinker now"
+ FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_NOW_FLAG],
+ [HAS_LINKER_NOW=true],
+ [HAS_LINKER_NOW=false])
fi
- # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed
+ # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed
# in executable.'
USING_BROKEN_SUSE_LD=no
if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$TOOLCHAIN_TYPE" = xgcc; then
AC_MSG_CHECKING([for broken SuSE 'ld' which only understands anonymous version tags in executables])
- echo "SUNWprivate_1.1 { local: *; };" > version-script.map
- echo "int main() { }" > main.c
+ $ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map
+ $ECHO "int main() { }" > main.c
if $CXX -Xlinker -version-script=version-script.map main.c 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
AC_MSG_RESULT(no)
USING_BROKEN_SUSE_LD=no
diff --git a/corba/.hgtags b/corba/.hgtags
index 66b823f5f9f..e76e0325e2d 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -261,3 +261,7 @@ e54022d0dd92106fff7f7fe670010cd7e6517ee3 jdk9-b15
422ef9d29d84f571453f015c4cb8713c3af70ee4 jdk9-b16
4c75c2ca7cf3e0618315879acf17f42c8fcd0c09 jdk9-b17
77565aaaa2bb814e94817e92d680168052a25395 jdk9-b18
+eecc1b6adc7e193d00a0641eb0963add5a4c06e8 jdk9-b19
+87f36eecb1665012d01c5cf102494e591c943ea6 jdk9-b20
+3615a4e7f0542ca7552ad6454b742c73ee211d8e jdk9-b21
+ddc07abf4307855c0dc904cc5c96cc764023a930 jdk9-b22
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java b/corba/src/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java
index 1748397d065..6908cad9a83 100644
--- a/corba/src/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java
+++ b/corba/src/share/classes/com/sun/corba/se/impl/io/OutputStreamHook.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,8 @@ import java.io.IOException;
import java.io.OutputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectOutput;
-import java.util.Hashtable;
+import java.util.Map;
+import java.util.HashMap;
import org.omg.CORBA.INTERNAL;
@@ -49,7 +50,7 @@ public abstract class OutputStreamHook extends ObjectOutputStream
*/
private class HookPutFields extends ObjectOutputStream.PutField
{
- private Hashtable fields = new Hashtable();
+ private Map fields = new HashMap<>();
/**
* Put the value of the named boolean field into the persistent field.
@@ -140,7 +141,6 @@ public abstract class OutputStreamHook extends ObjectOutputStream
public OutputStreamHook()
throws java.io.IOException {
super();
-
}
public void defaultWriteObject() throws IOException {
diff --git a/get_source.sh b/get_source.sh
index f83a3766c12..5e874d1cb51 100644
--- a/get_source.sh
+++ b/get_source.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,76 @@
# questions.
#
-# Get clones of all nested repositories
-sh ./common/bin/hgforest.sh clone "$@" || exit 1
+to_stderr() {
+ echo "$@" >&2
+}
+
+error() {
+ to_stderr "ERROR: $1"
+ exit ${2:-126}
+}
+
+warning() {
+ to_stderr "WARNING: $1"
+}
+
+version_field() {
+ # rev is typically omitted for minor and major releases
+ field=`echo ${1}.0 | cut -f ${2} -d .`
+ if expr 1 + $field >/dev/null 2> /dev/null; then
+ echo $field
+ else
+ echo -1
+ fi
+}
+
+# Version check
+
+# required
+reqdmajor=1
+reqdminor=4
+reqdrev=0
+
+# requested
+rqstmajor=2
+rqstminor=6
+rqstrev=3
+
+
+# installed
+hgwhere="`command -v hg`"
+if [ "x$hgwhere" = "x" ]; then
+ error "Could not locate Mercurial command"
+fi
+
+hgversion="`hg --version 2> /dev/null | sed -n -e 's@^Mercurial Distributed SCM (version \([^+]*\).*)\$@\1@p'`"
+if [ "x${hgversion}" = "x" ] ; then
+ error "Could not determine Mercurial version of $hgwhere"
+fi
+
+hgmajor="`version_field $hgversion 1`"
+hgminor="`version_field $hgversion 2`"
+hgrev="`version_field $hgversion 3`"
+
+if [ $hgmajor -eq -1 -o $hgminor -eq -1 -o $hgrev -eq -1 ] ; then
+ error "Could not determine Mercurial version of $hgwhere from \"$hgversion\""
+fi
+
+
+# Require
+if [ $hgmajor -lt $reqdmajor -o \( $hgmajor -eq $reqdmajor -a $hgminor -lt $reqdminor \) -o \( $hgmajor -eq $reqdmajor -a $hgminor -eq $reqdminor -a $hgrev -lt $reqdrev \) ] ; then
+ error "Mercurial version $reqdmajor.$reqdminor.$reqdrev or later is required. $hgwhere is version $hgversion"
+fi
+
+
+# Request
+if [ $hgmajor -lt $rqstmajor -o \( $hgmajor -eq $rqstmajor -a $hgminor -lt $rqstminor \) -o \( $hgmajor -eq $rqstmajor -a $hgminor -eq $rqstminor -a $hgrev -lt $rqstrev \) ] ; then
+ warning "Mercurial version $rqstmajor.$rqstminor.$rqstrev or later is recommended. $hgwhere is version $hgversion"
+fi
+
+
+# Get clones of all absent nested repositories (harmless if already exist)
+sh ./common/bin/hgforest.sh clone "$@" || exit $?
# Update all existing repositories to the latest sources
sh ./common/bin/hgforest.sh pull -u
-
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index 77d8c723248..882932d140a 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -421,3 +421,7 @@ bd333491bb6c012d7b606939406d0fa9a5ac7ffd jdk9-b14
b14e7c0b7d3ec04127f565cda1d84122e205680c jdk9-b16
14b656df31c2cb09c505921061e79977823de71a jdk9-b17
871fd128548480095e0dc3fc34c422666baeec75 jdk9-b18
+d4cffb3ae6213c66c7522ebffe0349360a45f0ef jdk9-b19
+c1af79d122ec9f715fa29312b5e91763f3a4dfc4 jdk9-b20
+17b4a5e831b398738feedb0afe75245744510153 jdk9-b21
+518d1fcc0799494f013e00e0a94a91b6f212d54f jdk9-b22
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegion.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegion.java
index 4aa7620f730..8d924973d8f 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegion.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegion.java
@@ -24,23 +24,26 @@
package sun.jvm.hotspot.gc_implementation.g1;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Observable;
import java.util.Observer;
-
import sun.jvm.hotspot.debugger.Address;
-import sun.jvm.hotspot.memory.ContiguousSpace;
+import sun.jvm.hotspot.memory.CompactibleSpace;
+import sun.jvm.hotspot.memory.MemRegion;
import sun.jvm.hotspot.runtime.VM;
+import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
// Mirror class for HeapRegion. Currently we don't actually include
-// any of its fields but only iterate over it (which we get "for free"
-// as HeapRegion ultimately inherits from ContiguousSpace).
+// any of its fields but only iterate over it.
-public class HeapRegion extends ContiguousSpace {
+public class HeapRegion extends CompactibleSpace {
// static int GrainBytes;
static private CIntegerField grainBytesField;
+ static private AddressField topField;
static {
VM.registerVMInitializedObserver(new Observer() {
@@ -54,6 +57,8 @@ public class HeapRegion extends ContiguousSpace {
Type type = db.lookupType("HeapRegion");
grainBytesField = type.getCIntegerField("GrainBytes");
+ topField = type.getAddressField("_top");
+
}
static public long grainBytes() {
@@ -63,4 +68,25 @@ public class HeapRegion extends ContiguousSpace {
public HeapRegion(Address addr) {
super(addr);
}
+
+ public Address top() {
+ return topField.getValue(addr);
+ }
+
+ @Override
+ public List getLiveRegions() {
+ List res = new ArrayList();
+ res.add(new MemRegion(bottom(), top()));
+ return res;
+ }
+
+ @Override
+ public long used() {
+ return top().minus(bottom());
+ }
+
+ @Override
+ public long free() {
+ return end().minus(top());
+ }
}
diff --git a/hotspot/make/bsd/makefiles/gcc.make b/hotspot/make/bsd/makefiles/gcc.make
index b2b925b2e1c..54d319bb1eb 100644
--- a/hotspot/make/bsd/makefiles/gcc.make
+++ b/hotspot/make/bsd/makefiles/gcc.make
@@ -280,16 +280,7 @@ endif
# optimization control flags (Used by fastdebug and release variants)
OPT_CFLAGS/NOOPT=-O0
-ifeq ($(USE_CLANG), true)
- # Clang does not support -Og
- OPT_CFLAGS/DEBUG=-O0
-else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
- # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
- OPT_CFLAGS/DEBUG=-Og
-else
- # Allow no optimizations.
- OPT_CFLAGS/DEBUG=-O0
-endif
+OPT_CFLAGS/DEBUG=-O0
OPT_CFLAGS/SIZE=-Os
OPT_CFLAGS/SPEED=-O3
@@ -457,16 +448,8 @@ ifeq ($(USE_CLANG), true)
CFLAGS += -flimit-debug-info
endif
-ifeq ($(USE_CLANG), true)
- # Clang does not support -Og
- DEBUG_CFLAGS=-O0
-else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
- # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
- DEBUG_CFLAGS=-Og
-else
- # Allow no optimizations.
- DEBUG_CFLAGS=-O0
-endif
+# Allow no optimizations.
+DEBUG_CFLAGS=-O0
# DEBUG_BINARIES uses full -g debug information for all configs
ifeq ($(DEBUG_BINARIES), true)
diff --git a/hotspot/make/excludeSrc.make b/hotspot/make/excludeSrc.make
index 55495e6bef2..00db453d5f8 100644
--- a/hotspot/make/excludeSrc.make
+++ b/hotspot/make/excludeSrc.make
@@ -93,6 +93,7 @@ ifeq ($(INCLUDE_ALL_GCS), false)
ageTable.cpp \
collectorCounters.cpp \
cSpaceCounters.cpp \
+ gcId.cpp \
gcPolicyCounters.cpp \
gcStats.cpp \
gcTimer.cpp \
diff --git a/hotspot/make/jprt.properties b/hotspot/make/jprt.properties
index eea0ef53391..22c7b05ad6d 100644
--- a/hotspot/make/jprt.properties
+++ b/hotspot/make/jprt.properties
@@ -350,21 +350,25 @@ jprt.make.rule.test.targets.standard.internalvmtests = \
${jprt.my.windows.i586}-fastdebug-c2-internalvmtests, \
${jprt.my.windows.x64}-fastdebug-c2-internalvmtests
-jprt.make.rule.test.targets.standard.wbapi = \
- ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-wbapitest, \
- ${jprt.my.solaris.x64}-{product|fastdebug}-c2-wbapitest, \
- ${jprt.my.linux.i586}-{product|fastdebug}-c2-wbapitest, \
- ${jprt.my.linux.x64}-{product|fastdebug}-c2-wbapitest, \
- ${jprt.my.windows.i586}-{product|fastdebug}-c2-wbapitest, \
- ${jprt.my.windows.x64}-{product|fastdebug}-c2-wbapitest, \
- ${jprt.my.linux.i586}-{product|fastdebug}-c1-wbapitest, \
- ${jprt.my.windows.i586}-{product|fastdebug}-c1-wbapitest
+jprt.make.rule.test.targets.standard.reg.group = \
+ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GROUP, \
+ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GROUP, \
+ ${jprt.my.linux.i586}-{product|fastdebug}-c2-GROUP, \
+ ${jprt.my.linux.x64}-{product|fastdebug}-c2-GROUP, \
+ ${jprt.my.windows.i586}-{product|fastdebug}-c2-GROUP, \
+ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GROUP, \
+ ${jprt.my.linux.i586}-{product|fastdebug}-c1-GROUP, \
+ ${jprt.my.windows.i586}-{product|fastdebug}-c1-GROUP
jprt.make.rule.test.targets.standard = \
${jprt.make.rule.test.targets.standard.client}, \
${jprt.make.rule.test.targets.standard.server}, \
${jprt.make.rule.test.targets.standard.internalvmtests}, \
- ${jprt.make.rule.test.targets.standard.wbapi}
+ ${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_wbapitest}, \
+ ${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_compiler}, \
+ ${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_gc}, \
+ ${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_runtime}, \
+ ${jprt.make.rule.test.targets.standard.reg.group:GROUP=hotspot_serviceability}
jprt.make.rule.test.targets.embedded = \
${jprt.make.rule.test.targets.standard.client}
diff --git a/hotspot/make/linux/makefiles/dtrace.make b/hotspot/make/linux/makefiles/dtrace.make
index 3a053736aae..7585eae9429 100644
--- a/hotspot/make/linux/makefiles/dtrace.make
+++ b/hotspot/make/linux/makefiles/dtrace.make
@@ -40,7 +40,14 @@ else
ifneq ($(ALT_SDT_H),)
SDT_H_FILE = $(ALT_SDT_H)
else
- SDT_H_FILE = /usr/include/sys/sdt.h
+ ifeq ($(USE_CLANG), true)
+ # Clang doesn't support the -print-sysroot option and there is no known equivalent
+ # option, so fall back to using / as sysroot
+ SDT_SYSROOT=
+ else
+ SDT_SYSROOT=$(shell $(CXX) -print-sysroot)
+ endif
+ SDT_H_FILE = $(SDT_SYSROOT)/usr/include/sys/sdt.h
endif
DTRACE_ENABLED = $(shell test -f $(SDT_H_FILE) && echo $(SDT_H_FILE))
diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make
index df3f8bda26f..a20e7a1c18b 100644
--- a/hotspot/make/linux/makefiles/gcc.make
+++ b/hotspot/make/linux/makefiles/gcc.make
@@ -231,13 +231,7 @@ CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
# optimization control flags (Used by fastdebug and release variants)
OPT_CFLAGS/NOOPT=-O0
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
- # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
- OPT_CFLAGS/DEBUG=-Og
-else
- # Allow no optimizations.
- OPT_CFLAGS/DEBUG=-O0
-endif
+OPT_CFLAGS/DEBUG=-O0
OPT_CFLAGS/SIZE=-Os
OPT_CFLAGS/SPEED=-O3
@@ -344,13 +338,8 @@ ifeq ($(USE_CLANG), true)
CFLAGS += -flimit-debug-info
endif
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
- # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
- DEBUG_CFLAGS=-Og
-else
- # Allow no optimizations.
- DEBUG_CFLAGS=-O0
-endif
+# Allow no optimizations.
+DEBUG_CFLAGS=-O0
# DEBUG_BINARIES uses full -g debug information for all configs
ifeq ($(DEBUG_BINARIES), true)
diff --git a/hotspot/make/solaris/makefiles/gcc.make b/hotspot/make/solaris/makefiles/gcc.make
index 801bb4ee08e..9ea05411166 100644
--- a/hotspot/make/solaris/makefiles/gcc.make
+++ b/hotspot/make/solaris/makefiles/gcc.make
@@ -127,13 +127,7 @@ CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
# optimization control flags (Used by fastdebug and release variants)
OPT_CFLAGS/NOOPT=-O0
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
- # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
- OPT_CFLAGS/DEBUG=-Og
-+else
- # Allow no optimizations.
- OPT_CFLAGS/DEBUG=-O0
-endif
+OPT_CFLAGS/DEBUG=-O0
OPT_CFLAGS/SIZE=-Os
OPT_CFLAGS/SPEED=-O3
@@ -229,14 +223,8 @@ SHARED_FLAG = -shared
#------------------------------------------------------------------------
# Debug flags
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
- # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
- DEBUG_CFLAGS=-Og
-else
- # Allow no optimizations.
- DEBUG_CFLAGS=-O0
-endif
-
+# Allow no optimizations.
+DEBUG_CFLAGS=-O0
# Use the stabs format for debugging information (this is the default
# on gcc-2.91). It's good enough, has all the information about line
diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp
index e6b92b76f12..caa0ff1ccff 100644
--- a/hotspot/src/os/aix/vm/os_aix.cpp
+++ b/hotspot/src/os/aix/vm/os_aix.cpp
@@ -2809,12 +2809,10 @@ bool os::dont_yield() {
return DontYieldALot;
}
-void os::yield() {
+void os::naked_yield() {
sched_yield();
}
-os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
-
////////////////////////////////////////////////////////////////////////////////
// thread priority support
@@ -3071,7 +3069,7 @@ static bool do_suspend(OSThread* osthread) {
for (int n = 0; !osthread->sr.is_suspended(); n++) {
for (int i = 0; i < RANDOMLY_LARGE_INTEGER2 && !osthread->sr.is_suspended(); i++) {
- os::yield();
+ os::naked_yield();
}
// timeout, try to cancel the request
@@ -3105,7 +3103,7 @@ static void do_resume(OSThread* osthread) {
if (sr_notify(osthread) == 0) {
for (int n = 0; n < RANDOMLY_LARGE_INTEGER && !osthread->sr.is_running(); n++) {
for (int i = 0; i < 100 && !osthread->sr.is_running(); i++) {
- os::yield();
+ os::naked_yield();
}
}
} else {
diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp
index 13b87c571fb..70dfe81e563 100644
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp
@@ -2596,12 +2596,10 @@ bool os::dont_yield() {
return DontYieldALot;
}
-void os::yield() {
+void os::naked_yield() {
sched_yield();
}
-os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
-
////////////////////////////////////////////////////////////////////////////////
// thread priority support
@@ -4218,22 +4216,12 @@ static struct timespec* compute_abstime(struct timespec* abstime, jlong millis)
return abstime;
}
-
-// Test-and-clear _Event, always leaves _Event set to 0, returns immediately.
-// Conceptually TryPark() should be equivalent to park(0).
-
-int os::PlatformEvent::TryPark() {
- for (;;) {
- const int v = _Event;
- guarantee((v == 0) || (v == 1), "invariant");
- if (Atomic::cmpxchg(0, &_Event, v) == v) return v;
- }
-}
-
void os::PlatformEvent::park() { // AKA "down()"
// Invariant: Only the thread associated with the Event/PlatformEvent
// may call park().
// TODO: assert that _Assoc != NULL or _Assoc == Self
+ assert(_nParked == 0, "invariant");
+
int v;
for (;;) {
v = _Event;
@@ -4333,8 +4321,7 @@ void os::PlatformEvent::unpark() {
// 1 :=> 1
// -1 :=> either 0 or 1; must signal target thread
// That is, we can safely transition _Event from -1 to either
- // 0 or 1. Forcing 1 is slightly more efficient for back-to-back
- // unpark() calls.
+ // 0 or 1.
// See also: "Semaphores in Plan 9" by Mullender & Cox
//
// Note: Forcing a transition from "-1" to "1" on an unpark() means
@@ -4541,10 +4528,9 @@ void Parker::park(bool isAbsolute, jlong time) {
}
void Parker::unpark() {
- int s, status;
- status = pthread_mutex_lock(_mutex);
+ int status = pthread_mutex_lock(_mutex);
assert(status == 0, "invariant");
- s = _counter;
+ const int s = _counter;
_counter = 1;
if (s < 1) {
if (WorkAroundNPTLTimedWaitHang) {
diff --git a/hotspot/src/os/bsd/vm/os_bsd.hpp b/hotspot/src/os/bsd/vm/os_bsd.hpp
index 36fb913f38a..2c1ebaf5eea 100644
--- a/hotspot/src/os/bsd/vm/os_bsd.hpp
+++ b/hotspot/src/os/bsd/vm/os_bsd.hpp
@@ -219,7 +219,6 @@ class PlatformEvent : public CHeapObj {
int fired() { return _Event; }
void park();
void unpark();
- int TryPark();
int park(jlong millis);
void SetAssociation(Thread * a) { _Assoc = a; }
};
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
index 8b731840b1a..ca1867ce39a 100644
--- a/hotspot/src/os/linux/vm/os_linux.cpp
+++ b/hotspot/src/os/linux/vm/os_linux.cpp
@@ -3791,12 +3791,10 @@ bool os::dont_yield() {
return DontYieldALot;
}
-void os::yield() {
+void os::naked_yield() {
sched_yield();
}
-os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
-
////////////////////////////////////////////////////////////////////////////////
// thread priority support
@@ -5457,22 +5455,12 @@ static struct timespec* compute_abstime(timespec* abstime, jlong millis) {
return abstime;
}
-
-// Test-and-clear _Event, always leaves _Event set to 0, returns immediately.
-// Conceptually TryPark() should be equivalent to park(0).
-
-int os::PlatformEvent::TryPark() {
- for (;;) {
- const int v = _Event;
- guarantee((v == 0) || (v == 1), "invariant");
- if (Atomic::cmpxchg(0, &_Event, v) == v) return v;
- }
-}
-
void os::PlatformEvent::park() { // AKA "down()"
// Invariant: Only the thread associated with the Event/PlatformEvent
// may call park().
// TODO: assert that _Assoc != NULL or _Assoc == Self
+ assert(_nParked == 0, "invariant");
+
int v;
for (;;) {
v = _Event;
@@ -5572,8 +5560,7 @@ void os::PlatformEvent::unpark() {
// 1 :=> 1
// -1 :=> either 0 or 1; must signal target thread
// That is, we can safely transition _Event from -1 to either
- // 0 or 1. Forcing 1 is slightly more efficient for back-to-back
- // unpark() calls.
+ // 0 or 1.
// See also: "Semaphores in Plan 9" by Mullender & Cox
//
// Note: Forcing a transition from "-1" to "1" on an unpark() means
@@ -5801,10 +5788,9 @@ void Parker::park(bool isAbsolute, jlong time) {
}
void Parker::unpark() {
- int s, status;
- status = pthread_mutex_lock(_mutex);
+ int status = pthread_mutex_lock(_mutex);
assert(status == 0, "invariant");
- s = _counter;
+ const int s = _counter;
_counter = 1;
if (s < 1) {
// thread might be parked
diff --git a/hotspot/src/os/linux/vm/os_linux.hpp b/hotspot/src/os/linux/vm/os_linux.hpp
index 3e287387b05..1b62f3f35ea 100644
--- a/hotspot/src/os/linux/vm/os_linux.hpp
+++ b/hotspot/src/os/linux/vm/os_linux.hpp
@@ -315,7 +315,6 @@ class PlatformEvent : public CHeapObj {
int fired() { return _Event; }
void park();
void unpark();
- int TryPark();
int park(jlong millis); // relative timed-wait only
void SetAssociation(Thread * a) { _Assoc = a; }
};
diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp
index e963aeec5ad..ce30df44a33 100644
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp
@@ -3174,20 +3174,14 @@ bool os::dont_yield() {
}
}
-// Caveat: Solaris os::yield() causes a thread-state transition whereas
-// the linux and win32 implementations do not. This should be checked.
-
-void os::yield() {
- // Yields to all threads with same or greater priority
- os::sleep(Thread::current(), 0, false);
-}
-
// Note that yield semantics are defined by the scheduling class to which
// the thread currently belongs. Typically, yield will _not yield to
// other equal or higher priority threads that reside on the dispatch queues
// of other CPUs.
-os::YieldResult os::NakedYield() { thr_yield(); return os::YIELD_UNKNOWN; }
+void os::naked_yield() {
+ thr_yield();
+}
// Interface for setting lwp priorities. If we are using T2 libthread,
// which forces the use of BoundThreads or we manually set UseBoundThreads,
@@ -5441,20 +5435,11 @@ static timestruc_t* compute_abstime(timestruc_t* abstime, jlong millis) {
return abstime;
}
-// Test-and-clear _Event, always leaves _Event set to 0, returns immediately.
-// Conceptually TryPark() should be equivalent to park(0).
-
-int os::PlatformEvent::TryPark() {
- for (;;) {
- const int v = _Event;
- guarantee((v == 0) || (v == 1), "invariant");
- if (Atomic::cmpxchg(0, &_Event, v) == v) return v;
- }
-}
-
void os::PlatformEvent::park() { // AKA: down()
// Invariant: Only the thread associated with the Event/PlatformEvent
// may call park().
+ assert(_nParked == 0, "invariant");
+
int v;
for (;;) {
v = _Event;
@@ -5541,8 +5526,7 @@ void os::PlatformEvent::unpark() {
// 1 :=> 1
// -1 :=> either 0 or 1; must signal target thread
// That is, we can safely transition _Event from -1 to either
- // 0 or 1. Forcing 1 is slightly more efficient for back-to-back
- // unpark() calls.
+ // 0 or 1.
// See also: "Semaphores in Plan 9" by Mullender & Cox
//
// Note: Forcing a transition from "-1" to "1" on an unpark() means
@@ -5746,10 +5730,9 @@ void Parker::park(bool isAbsolute, jlong time) {
}
void Parker::unpark() {
- int s, status;
- status = os::Solaris::mutex_lock(_mutex);
+ int status = os::Solaris::mutex_lock(_mutex);
assert(status == 0, "invariant");
- s = _counter;
+ const int s = _counter;
_counter = 1;
status = os::Solaris::mutex_unlock(_mutex);
assert(status == 0, "invariant");
diff --git a/hotspot/src/os/solaris/vm/os_solaris.hpp b/hotspot/src/os/solaris/vm/os_solaris.hpp
index 28d1700ca62..ab0ab85f438 100644
--- a/hotspot/src/os/solaris/vm/os_solaris.hpp
+++ b/hotspot/src/os/solaris/vm/os_solaris.hpp
@@ -332,7 +332,6 @@ class PlatformEvent : public CHeapObj {
int fired() { return _Event; }
void park();
int park(jlong millis);
- int TryPark();
void unpark();
};
diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp
index 86d6913299c..6ea6f62e49a 100644
--- a/hotspot/src/os/windows/vm/os_windows.cpp
+++ b/hotspot/src/os/windows/vm/os_windows.cpp
@@ -3516,19 +3516,16 @@ void os::infinite_sleep() {
typedef BOOL (WINAPI * STTSignature)(void);
-os::YieldResult os::NakedYield() {
+void os::naked_yield() {
// Use either SwitchToThread() or Sleep(0)
// Consider passing back the return value from SwitchToThread().
if (os::Kernel32Dll::SwitchToThreadAvailable()) {
- return SwitchToThread() ? os::YIELD_SWITCHED : os::YIELD_NONEREADY;
+ SwitchToThread();
} else {
Sleep(0);
}
- return os::YIELD_UNKNOWN;
}
-void os::yield() { os::NakedYield(); }
-
// Win32 only gives you access to seven real priorities at a time,
// so we compress Java's ten down to seven. It would be better
// if we dynamically adjusted relative priorities.
@@ -4877,8 +4874,7 @@ void os::PlatformEvent::unpark() {
// 1 :=> 1
// -1 :=> either 0 or 1; must signal target thread
// That is, we can safely transition _Event from -1 to either
- // 0 or 1. Forcing 1 is slightly more efficient for back-to-back
- // unpark() calls.
+ // 0 or 1.
// See also: "Semaphores in Plan 9" by Mullender & Cox
//
// Note: Forcing a transition from "-1" to "1" on an unpark() means
diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
index 6798e615e56..4883df22da3 100644
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
@@ -1998,7 +1998,13 @@ void GraphBuilder::invoke(Bytecodes::Code code) {
if (!UseInlineCaches && is_loaded && code == Bytecodes::_invokevirtual
&& !target->can_be_statically_bound()) {
// Find a vtable index if one is available
- vtable_index = target->resolve_vtable_index(calling_klass, callee_holder);
+ // For arrays, callee_holder is Object. Resolving the call with
+ // Object would allow an illegal call to finalize() on an
+ // array. We use holder instead: illegal calls to finalize() won't
+ // be compiled as vtable calls (IC call resolution will catch the
+ // illegal call) and the few legal calls on array types won't be
+ // either.
+ vtable_index = target->resolve_vtable_index(calling_klass, holder);
}
#endif
diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp
index b78b787fc5b..b8dd1bbfb83 100644
--- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp
@@ -1051,6 +1051,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
n_copy->set_data((intx) (load_klass()));
} else {
assert(mirror() != NULL, "klass not set");
+ // Don't need a G1 pre-barrier here since we assert above that data isn't an oop.
n_copy->set_data(cast_from_oop(mirror()));
}
diff --git a/hotspot/src/share/vm/ci/ciConstantPoolCache.cpp b/hotspot/src/share/vm/ci/ciConstantPoolCache.cpp
index a277e421a32..6ceacdc5a5a 100644
--- a/hotspot/src/share/vm/ci/ciConstantPoolCache.cpp
+++ b/hotspot/src/share/vm/ci/ciConstantPoolCache.cpp
@@ -38,7 +38,7 @@ ciConstantPoolCache::ciConstantPoolCache(Arena* arena,
int expected_size) {
_elements =
new (arena) GrowableArray(arena, expected_size, 0, 0);
- _keys = new (arena) GrowableArray(arena, expected_size, 0, 0);
+ _keys = new (arena) GrowableArray(arena, expected_size, 0, 0);
}
// ------------------------------------------------------------------
diff --git a/hotspot/src/share/vm/ci/ciConstantPoolCache.hpp b/hotspot/src/share/vm/ci/ciConstantPoolCache.hpp
index 30ebcac2079..17cf77681e0 100644
--- a/hotspot/src/share/vm/ci/ciConstantPoolCache.hpp
+++ b/hotspot/src/share/vm/ci/ciConstantPoolCache.hpp
@@ -35,7 +35,7 @@
// Usage note: this klass has nothing to do with ConstantPoolCache*.
class ciConstantPoolCache : public ResourceObj {
private:
- GrowableArray* _keys;
+ GrowableArray* _keys;
GrowableArray* _elements;
int find(int index);
diff --git a/hotspot/src/share/vm/ci/ciEnv.hpp b/hotspot/src/share/vm/ci/ciEnv.hpp
index 65e4bb39434..ced8d895207 100644
--- a/hotspot/src/share/vm/ci/ciEnv.hpp
+++ b/hotspot/src/share/vm/ci/ciEnv.hpp
@@ -185,6 +185,10 @@ private:
}
}
+ void ensure_metadata_alive(ciMetadata* m) {
+ _factory->ensure_metadata_alive(m);
+ }
+
ciInstance* get_instance(oop o) {
if (o == NULL) return NULL;
return get_object(o)->as_instance();
diff --git a/hotspot/src/share/vm/ci/ciKlass.hpp b/hotspot/src/share/vm/ci/ciKlass.hpp
index b28edd7adea..e4a8a71709e 100644
--- a/hotspot/src/share/vm/ci/ciKlass.hpp
+++ b/hotspot/src/share/vm/ci/ciKlass.hpp
@@ -43,6 +43,7 @@ class ciKlass : public ciType {
friend class ciMethod;
friend class ciMethodData;
friend class ciObjArrayKlass;
+ friend class ciReceiverTypeData;
private:
ciSymbol* _name;
diff --git a/hotspot/src/share/vm/ci/ciMethodData.cpp b/hotspot/src/share/vm/ci/ciMethodData.cpp
index 9a7c405a2d8..aa157e15283 100644
--- a/hotspot/src/share/vm/ci/ciMethodData.cpp
+++ b/hotspot/src/share/vm/ci/ciMethodData.cpp
@@ -170,6 +170,7 @@ void ciReceiverTypeData::translate_receiver_data_from(const ProfileData* data) {
Klass* k = data->as_ReceiverTypeData()->receiver(row);
if (k != NULL) {
ciKlass* klass = CURRENT_ENV->get_klass(k);
+ CURRENT_ENV->ensure_metadata_alive(klass);
set_receiver(row, klass);
}
}
@@ -191,6 +192,7 @@ void ciReturnTypeEntry::translate_type_data_from(const ReturnTypeEntry* ret) {
void ciSpeculativeTrapData::translate_from(const ProfileData* data) {
Method* m = data->as_SpeculativeTrapData()->method();
ciMethod* ci_m = CURRENT_ENV->get_method(m);
+ CURRENT_ENV->ensure_metadata_alive(ci_m);
set_method(ci_m);
}
diff --git a/hotspot/src/share/vm/ci/ciMethodData.hpp b/hotspot/src/share/vm/ci/ciMethodData.hpp
index 9b9f67c446a..ec88c5dd26c 100644
--- a/hotspot/src/share/vm/ci/ciMethodData.hpp
+++ b/hotspot/src/share/vm/ci/ciMethodData.hpp
@@ -70,6 +70,7 @@ protected:
Klass* v = TypeEntries::valid_klass(k);
if (v != NULL) {
ciKlass* klass = CURRENT_ENV->get_klass(v);
+ CURRENT_ENV->ensure_metadata_alive(klass);
return with_status(klass, k);
}
return with_status(NULL, k);
diff --git a/hotspot/src/share/vm/ci/ciObjectFactory.cpp b/hotspot/src/share/vm/ci/ciObjectFactory.cpp
index d257e8ac467..6bacf2b2f1f 100644
--- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp
+++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp
@@ -46,6 +46,9 @@
#include "oops/oop.inline.hpp"
#include "oops/oop.inline2.hpp"
#include "runtime/fieldType.hpp"
+#if INCLUDE_ALL_GCS
+# include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#endif
// ciObjectFactory
//
@@ -374,6 +377,37 @@ ciMetadata* ciObjectFactory::create_new_object(Metadata* o) {
return NULL;
}
+// ------------------------------------------------------------------
+// ciObjectFactory::ensure_metadata_alive
+//
+// Ensure that the metadata wrapped by the ciMetadata is kept alive by GC.
+// This is primarily useful for metadata which is considered as weak roots
+// by the GC but need to be strong roots if reachable from a current compilation.
+//
+void ciObjectFactory::ensure_metadata_alive(ciMetadata* m) {
+ ASSERT_IN_VM; // We're handling raw oops here.
+
+#if INCLUDE_ALL_GCS
+ if (!UseG1GC) {
+ return;
+ }
+ Klass* metadata_owner_klass;
+ if (m->is_klass()) {
+ metadata_owner_klass = m->as_klass()->get_Klass();
+ } else if (m->is_method()) {
+ metadata_owner_klass = m->as_method()->get_Method()->constants()->pool_holder();
+ } else {
+ fatal("Not implemented for other types of metadata");
+ }
+
+ oop metadata_holder = metadata_owner_klass->klass_holder();
+ if (metadata_holder != NULL) {
+ G1SATBCardTableModRefBS::enqueue(metadata_holder);
+ }
+
+#endif
+}
+
//------------------------------------------------------------------
// ciObjectFactory::get_unloaded_method
//
diff --git a/hotspot/src/share/vm/ci/ciObjectFactory.hpp b/hotspot/src/share/vm/ci/ciObjectFactory.hpp
index c1baca0ee62..6c228e09d40 100644
--- a/hotspot/src/share/vm/ci/ciObjectFactory.hpp
+++ b/hotspot/src/share/vm/ci/ciObjectFactory.hpp
@@ -75,6 +75,8 @@ private:
ciObject* create_new_object(oop o);
ciMetadata* create_new_object(Metadata* o);
+ void ensure_metadata_alive(ciMetadata* m);
+
static bool is_equal(NonPermObject* p, oop key) {
return p->object()->get_oop() == key;
}
diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp
index e58b280b07b..b0f237a2773 100644
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp
@@ -4590,8 +4590,9 @@ void ClassFileParser::check_final_method_override(instanceKlassHandle this_klass
Exceptions::fthrow(
THREAD_AND_LOCATION,
vmSymbols::java_lang_VerifyError(),
- "class %s overrides final method %s.%s",
+ "class %s overrides final method %s.%s%s",
this_klass->external_name(),
+ super_m->method_holder()->external_name(),
name->as_C_string(),
signature->as_C_string()
);
diff --git a/hotspot/src/share/vm/classfile/classLoaderData.cpp b/hotspot/src/share/vm/classfile/classLoaderData.cpp
index d04c46b7dde..71bcad2b445 100644
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp
@@ -332,6 +332,27 @@ void ClassLoaderData::unload() {
}
}
+#ifdef ASSERT
+class AllAliveClosure : public OopClosure {
+ BoolObjectClosure* _is_alive_closure;
+ bool _found_dead;
+ public:
+ AllAliveClosure(BoolObjectClosure* is_alive_closure) : _is_alive_closure(is_alive_closure), _found_dead(false) {}
+ template void do_oop_work(T* p) {
+ T heap_oop = oopDesc::load_heap_oop(p);
+ if (!oopDesc::is_null(heap_oop)) {
+ oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
+ if (!_is_alive_closure->do_object_b(obj)) {
+ _found_dead = true;
+ }
+ }
+ }
+ void do_oop(oop* p) { do_oop_work(p); }
+ void do_oop(narrowOop* p) { do_oop_work(p); }
+ bool found_dead() { return _found_dead; }
+};
+#endif
+
oop ClassLoaderData::keep_alive_object() const {
assert(!keep_alive(), "Don't use with CLDs that are artificially kept alive");
return is_anonymous() ? _klasses->java_mirror() : class_loader();
@@ -341,7 +362,15 @@ bool ClassLoaderData::is_alive(BoolObjectClosure* is_alive_closure) const {
bool alive = keep_alive() // null class loader and incomplete anonymous klasses.
|| is_alive_closure->do_object_b(keep_alive_object());
- assert(!alive || claimed(), "must be claimed");
+#ifdef ASSERT
+ if (alive) {
+ AllAliveClosure all_alive_closure(is_alive_closure);
+ KlassToOopClosure klass_closure(&all_alive_closure);
+ const_cast(this)->oops_do(&all_alive_closure, &klass_closure, false);
+ assert(!all_alive_closure.found_dead(), err_msg("Found dead oop in alive cld: " PTR_FORMAT, p2i(this)));
+ }
+#endif
+
return alive;
}
@@ -620,9 +649,9 @@ void ClassLoaderDataGraph::keep_alive_oops_do(OopClosure* f, KlassClosure* klass
void ClassLoaderDataGraph::always_strong_oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim) {
if (ClassUnloading) {
- ClassLoaderDataGraph::keep_alive_oops_do(f, klass_closure, must_claim);
+ keep_alive_oops_do(f, klass_closure, must_claim);
} else {
- ClassLoaderDataGraph::oops_do(f, klass_closure, must_claim);
+ oops_do(f, klass_closure, must_claim);
}
}
@@ -632,6 +661,27 @@ void ClassLoaderDataGraph::cld_do(CLDClosure* cl) {
}
}
+void ClassLoaderDataGraph::roots_cld_do(CLDClosure* strong, CLDClosure* weak) {
+ for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->_next) {
+ CLDClosure* closure = cld->keep_alive() ? strong : weak;
+ if (closure != NULL) {
+ closure->do_cld(cld);
+ }
+ }
+}
+
+void ClassLoaderDataGraph::keep_alive_cld_do(CLDClosure* cl) {
+ roots_cld_do(cl, NULL);
+}
+
+void ClassLoaderDataGraph::always_strong_cld_do(CLDClosure* cl) {
+ if (ClassUnloading) {
+ keep_alive_cld_do(cl);
+ } else {
+ cld_do(cl);
+ }
+}
+
void ClassLoaderDataGraph::classes_do(KlassClosure* klass_closure) {
for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
cld->classes_do(klass_closure);
@@ -689,6 +739,16 @@ GrowableArray* ClassLoaderDataGraph::new_clds() {
return array;
}
+bool ClassLoaderDataGraph::unload_list_contains(const void* x) {
+ assert(SafepointSynchronize::is_at_safepoint(), "only safe to call at safepoint");
+ for (ClassLoaderData* cld = _unloading; cld != NULL; cld = cld->next()) {
+ if (cld->metaspace_or_null() != NULL && cld->metaspace_or_null()->contains(x)) {
+ return true;
+ }
+ }
+ return false;
+}
+
#ifndef PRODUCT
bool ClassLoaderDataGraph::contains_loader_data(ClassLoaderData* loader_data) {
for (ClassLoaderData* data = _head; data != NULL; data = data->next()) {
@@ -809,6 +869,60 @@ Metaspace* ClassLoaderData::rw_metaspace() {
return _rw_metaspace;
}
+ClassLoaderDataGraphKlassIteratorAtomic::ClassLoaderDataGraphKlassIteratorAtomic()
+ : _next_klass(NULL) {
+ ClassLoaderData* cld = ClassLoaderDataGraph::_head;
+ Klass* klass = NULL;
+
+ // Find the first klass in the CLDG.
+ while (cld != NULL) {
+ klass = cld->_klasses;
+ if (klass != NULL) {
+ _next_klass = klass;
+ return;
+ }
+ cld = cld->next();
+ }
+}
+
+Klass* ClassLoaderDataGraphKlassIteratorAtomic::next_klass_in_cldg(Klass* klass) {
+ Klass* next = klass->next_link();
+ if (next != NULL) {
+ return next;
+ }
+
+ // No more klasses in the current CLD. Time to find a new CLD.
+ ClassLoaderData* cld = klass->class_loader_data();
+ while (next == NULL) {
+ cld = cld->next();
+ if (cld == NULL) {
+ break;
+ }
+ next = cld->_klasses;
+ }
+
+ return next;
+}
+
+Klass* ClassLoaderDataGraphKlassIteratorAtomic::next_klass() {
+ Klass* head = (Klass*)_next_klass;
+
+ while (head != NULL) {
+ Klass* next = next_klass_in_cldg(head);
+
+ Klass* old_head = (Klass*)Atomic::cmpxchg_ptr(next, &_next_klass, head);
+
+ if (old_head == head) {
+ return head; // Won the CAS.
+ }
+
+ head = old_head;
+ }
+
+ // Nothing more for the iterator to hand out.
+ assert(head == NULL, err_msg("head is " PTR_FORMAT ", expected not null:", p2i(head)));
+ return NULL;
+}
ClassLoaderDataGraphMetaspaceIterator::ClassLoaderDataGraphMetaspaceIterator() {
_data = ClassLoaderDataGraph::_head;
diff --git a/hotspot/src/share/vm/classfile/classLoaderData.hpp b/hotspot/src/share/vm/classfile/classLoaderData.hpp
index 35088a7fbbe..f9c638c4d51 100644
--- a/hotspot/src/share/vm/classfile/classLoaderData.hpp
+++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp
@@ -31,7 +31,6 @@
#include "memory/metaspaceCounters.hpp"
#include "runtime/mutex.hpp"
#include "utilities/growableArray.hpp"
-
#if INCLUDE_TRACE
# include "utilities/ticks.hpp"
#endif
@@ -59,6 +58,7 @@ class Metadebug;
class ClassLoaderDataGraph : public AllStatic {
friend class ClassLoaderData;
friend class ClassLoaderDataGraphMetaspaceIterator;
+ friend class ClassLoaderDataGraphKlassIteratorAtomic;
friend class VMStructs;
private:
// All CLDs (except the null CLD) can be reached by walking _head->_next->...
@@ -75,10 +75,16 @@ class ClassLoaderDataGraph : public AllStatic {
static ClassLoaderData* find_or_create(Handle class_loader, TRAPS);
static void purge();
static void clear_claimed_marks();
+ // oops do
static void oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim);
- static void always_strong_oops_do(OopClosure* blk, KlassClosure* klass_closure, bool must_claim);
static void keep_alive_oops_do(OopClosure* blk, KlassClosure* klass_closure, bool must_claim);
+ static void always_strong_oops_do(OopClosure* blk, KlassClosure* klass_closure, bool must_claim);
+ // cld do
static void cld_do(CLDClosure* cl);
+ static void roots_cld_do(CLDClosure* strong, CLDClosure* weak);
+ static void keep_alive_cld_do(CLDClosure* cl);
+ static void always_strong_cld_do(CLDClosure* cl);
+ // klass do
static void classes_do(KlassClosure* klass_closure);
static void classes_do(void f(Klass* const));
static void methods_do(void f(Method*));
@@ -104,6 +110,7 @@ class ClassLoaderDataGraph : public AllStatic {
static void dump() { dump_on(tty); }
static void verify();
+ static bool unload_list_contains(const void* x);
#ifndef PRODUCT
static bool contains_loader_data(ClassLoaderData* loader_data);
#endif
@@ -136,6 +143,7 @@ class ClassLoaderData : public CHeapObj {
};
friend class ClassLoaderDataGraph;
+ friend class ClassLoaderDataGraphKlassIteratorAtomic;
friend class ClassLoaderDataGraphMetaspaceIterator;
friend class MetaDataFactory;
friend class Method;
@@ -195,7 +203,6 @@ class ClassLoaderData : public CHeapObj {
void unload();
bool keep_alive() const { return _keep_alive; }
- bool is_alive(BoolObjectClosure* is_alive_closure) const;
void classes_do(void f(Klass*));
void loaded_classes_do(KlassClosure* klass_closure);
void classes_do(void f(InstanceKlass*));
@@ -208,6 +215,9 @@ class ClassLoaderData : public CHeapObj {
MetaWord* allocate(size_t size);
public:
+
+ bool is_alive(BoolObjectClosure* is_alive_closure) const;
+
// Accessors
Metaspace* metaspace_or_null() const { return _metaspace; }
@@ -293,6 +303,16 @@ class ClassLoaderData : public CHeapObj {
void initialize_shared_metaspaces();
};
+// An iterator that distributes Klasses to parallel worker threads.
+class ClassLoaderDataGraphKlassIteratorAtomic : public StackObj {
+ volatile Klass* _next_klass;
+ public:
+ ClassLoaderDataGraphKlassIteratorAtomic();
+ Klass* next_klass();
+ private:
+ static Klass* next_klass_in_cldg(Klass* klass);
+};
+
class ClassLoaderDataGraphMetaspaceIterator : public StackObj {
ClassLoaderData* _data;
public:
diff --git a/hotspot/src/share/vm/classfile/dictionary.cpp b/hotspot/src/share/vm/classfile/dictionary.cpp
index b84475a8dbb..dcb295687aa 100644
--- a/hotspot/src/share/vm/classfile/dictionary.cpp
+++ b/hotspot/src/share/vm/classfile/dictionary.cpp
@@ -199,6 +199,26 @@ bool Dictionary::do_unloading() {
return class_was_unloaded;
}
+void Dictionary::roots_oops_do(OopClosure* strong, OopClosure* weak) {
+ // Skip the strong roots probe marking if the closures are the same.
+ if (strong == weak) {
+ oops_do(strong);
+ return;
+ }
+
+ for (int index = 0; index < table_size(); index++) {
+ for (DictionaryEntry *probe = bucket(index);
+ probe != NULL;
+ probe = probe->next()) {
+ Klass* e = probe->klass();
+ ClassLoaderData* loader_data = probe->loader_data();
+ if (is_strongly_reachable(loader_data, e)) {
+ probe->set_strongly_reachable();
+ }
+ }
+ }
+ _pd_cache_table->roots_oops_do(strong, weak);
+}
void Dictionary::always_strong_oops_do(OopClosure* blk) {
// Follow all system classes and temporary placeholders in dictionary; only
@@ -490,6 +510,23 @@ void ProtectionDomainCacheTable::oops_do(OopClosure* f) {
}
}
+void ProtectionDomainCacheTable::roots_oops_do(OopClosure* strong, OopClosure* weak) {
+ for (int index = 0; index < table_size(); index++) {
+ for (ProtectionDomainCacheEntry* probe = bucket(index);
+ probe != NULL;
+ probe = probe->next()) {
+ if (probe->is_strongly_reachable()) {
+ probe->reset_strongly_reachable();
+ probe->oops_do(strong);
+ } else {
+ if (weak != NULL) {
+ probe->oops_do(weak);
+ }
+ }
+ }
+ }
+}
+
uint ProtectionDomainCacheTable::bucket_size() {
return sizeof(ProtectionDomainCacheEntry);
}
diff --git a/hotspot/src/share/vm/classfile/dictionary.hpp b/hotspot/src/share/vm/classfile/dictionary.hpp
index bc25c811c52..042772f45cc 100644
--- a/hotspot/src/share/vm/classfile/dictionary.hpp
+++ b/hotspot/src/share/vm/classfile/dictionary.hpp
@@ -89,6 +89,7 @@ public:
// GC support
void oops_do(OopClosure* f);
void always_strong_oops_do(OopClosure* blk);
+ void roots_oops_do(OopClosure* strong, OopClosure* weak);
void always_strong_classes_do(KlassClosure* closure);
@@ -218,6 +219,7 @@ public:
// GC support
void oops_do(OopClosure* f);
void always_strong_oops_do(OopClosure* f);
+ void roots_oops_do(OopClosure* strong, OopClosure* weak);
static uint bucket_size();
diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp
index 8ada113ffaa..cd313d27757 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp
@@ -1239,6 +1239,16 @@ oop java_lang_Throwable::message(Handle throwable) {
}
+// Return Symbol for detailed_message or NULL
+Symbol* java_lang_Throwable::detail_message(oop throwable) {
+ PRESERVE_EXCEPTION_MARK; // Keep original exception
+ oop detailed_message = java_lang_Throwable::message(throwable);
+ if (detailed_message != NULL) {
+ return java_lang_String::as_symbol(detailed_message, THREAD);
+ }
+ return NULL;
+}
+
void java_lang_Throwable::set_message(oop throwable, oop value) {
throwable->obj_field_put(detailMessage_offset, value);
}
diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp
index 88b747fdcc1..aeafbfbf8b1 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp
@@ -520,6 +520,7 @@ class java_lang_Throwable: AllStatic {
static oop message(oop throwable);
static oop message(Handle throwable);
static void set_message(oop throwable, oop value);
+ static Symbol* detail_message(oop throwable);
static void print_stack_element(outputStream *st, Handle mirror, int method,
int version, int bci);
static void print_stack_element(outputStream *st, methodHandle method, int bci);
diff --git a/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp b/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp
index 032c3e3fc70..d21e19bd6f8 100644
--- a/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp
+++ b/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp
@@ -47,8 +47,11 @@ MetadataOnStackMark::MetadataOnStackMark() {
if (_marked_objects == NULL) {
_marked_objects = new (ResourceObj::C_HEAP, mtClass) GrowableArray(1000, true);
}
+
Threads::metadata_do(Metadata::mark_on_stack);
- CodeCache::alive_nmethods_do(nmethod::mark_on_stack);
+ if (JvmtiExport::has_redefined_a_class()) {
+ CodeCache::alive_nmethods_do(nmethod::mark_on_stack);
+ }
CompileBroker::mark_on_stack();
JvmtiCurrentBreakpoints::metadata_do(Metadata::mark_on_stack);
ThreadService::metadata_do(Metadata::mark_on_stack);
diff --git a/hotspot/src/share/vm/classfile/stringTable.cpp b/hotspot/src/share/vm/classfile/stringTable.cpp
index 4958e5ce7ee..46f4eba59cd 100644
--- a/hotspot/src/share/vm/classfile/stringTable.cpp
+++ b/hotspot/src/share/vm/classfile/stringTable.cpp
@@ -37,6 +37,7 @@
#include "runtime/mutexLocker.hpp"
#include "utilities/hashtable.inline.hpp"
#if INCLUDE_ALL_GCS
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
#include "gc_implementation/g1/g1StringDedup.hpp"
#endif
@@ -157,11 +158,26 @@ oop StringTable::lookup(Symbol* symbol) {
return lookup(chars, length);
}
+// Tell the GC that this string was looked up in the StringTable.
+static void ensure_string_alive(oop string) {
+ // A lookup in the StringTable could return an object that was previously
+ // considered dead. The SATB part of G1 needs to get notified about this
+ // potential resurrection, otherwise the marking might not find the object.
+#if INCLUDE_ALL_GCS
+ if (UseG1GC && string != NULL) {
+ G1SATBCardTableModRefBS::enqueue(string);
+ }
+#endif
+}
oop StringTable::lookup(jchar* name, int len) {
unsigned int hash = hash_string(name, len);
int index = the_table()->hash_to_index(hash);
- return the_table()->lookup(index, name, len, hash);
+ oop string = the_table()->lookup(index, name, len, hash);
+
+ ensure_string_alive(string);
+
+ return string;
}
@@ -172,7 +188,10 @@ oop StringTable::intern(Handle string_or_null, jchar* name,
oop found_string = the_table()->lookup(index, name, len, hashValue);
// Found
- if (found_string != NULL) return found_string;
+ if (found_string != NULL) {
+ ensure_string_alive(found_string);
+ return found_string;
+ }
debug_only(StableMemoryChecker smc(name, len * sizeof(name[0])));
assert(!Universe::heap()->is_in_reserved(name),
@@ -197,11 +216,17 @@ oop StringTable::intern(Handle string_or_null, jchar* name,
// Grab the StringTable_lock before getting the_table() because it could
// change at safepoint.
- MutexLocker ml(StringTable_lock, THREAD);
+ oop added_or_found;
+ {
+ MutexLocker ml(StringTable_lock, THREAD);
+ // Otherwise, add to symbol to table
+ added_or_found = the_table()->basic_add(index, string, name, len,
+ hashValue, CHECK_NULL);
+ }
- // Otherwise, add to symbol to table
- return the_table()->basic_add(index, string, name, len,
- hashValue, CHECK_NULL);
+ ensure_string_alive(added_or_found);
+
+ return added_or_found;
}
oop StringTable::intern(Symbol* symbol, TRAPS) {
diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp
index 4a6e1c3e377..3b058b5a625 100644
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp
@@ -1612,13 +1612,7 @@ void SystemDictionary::add_to_hierarchy(instanceKlassHandle k, TRAPS) {
// system dictionary and follows the remaining classes' contents.
void SystemDictionary::always_strong_oops_do(OopClosure* blk) {
- blk->do_oop(&_java_system_loader);
- blk->do_oop(&_system_loader_lock_obj);
-
- dictionary()->always_strong_oops_do(blk);
-
- // Visit extra methods
- invoke_method_table()->oops_do(blk);
+ roots_oops_do(blk, NULL);
}
void SystemDictionary::always_strong_classes_do(KlassClosure* closure) {
@@ -1685,6 +1679,17 @@ bool SystemDictionary::do_unloading(BoolObjectClosure* is_alive) {
return unloading_occurred;
}
+void SystemDictionary::roots_oops_do(OopClosure* strong, OopClosure* weak) {
+ strong->do_oop(&_java_system_loader);
+ strong->do_oop(&_system_loader_lock_obj);
+
+ // Adjust dictionary
+ dictionary()->roots_oops_do(strong, weak);
+
+ // Visit extra methods
+ invoke_method_table()->oops_do(strong);
+}
+
void SystemDictionary::oops_do(OopClosure* f) {
f->do_oop(&_java_system_loader);
f->do_oop(&_system_loader_lock_obj);
diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp
index f26a9d8c56e..f46f67bd9b5 100644
--- a/hotspot/src/share/vm/classfile/systemDictionary.hpp
+++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp
@@ -330,6 +330,7 @@ public:
// Applies "f->do_oop" to all root oops in the system dictionary.
static void oops_do(OopClosure* f);
+ static void roots_oops_do(OopClosure* strong, OopClosure* weak);
// System loader lock
static oop system_loader_lock() { return _system_loader_lock_obj; }
diff --git a/hotspot/src/share/vm/code/codeCache.cpp b/hotspot/src/share/vm/code/codeCache.cpp
index 8fe9efcb427..9cdc302bf78 100644
--- a/hotspot/src/share/vm/code/codeCache.cpp
+++ b/hotspot/src/share/vm/code/codeCache.cpp
@@ -331,6 +331,11 @@ void CodeCache::blobs_do(CodeBlobClosure* f) {
// Walk the list of methods which might contain non-perm oops.
void CodeCache::scavenge_root_nmethods_do(CodeBlobClosure* f) {
assert_locked_or_safepoint(CodeCache_lock);
+
+ if (UseG1GC) {
+ return;
+ }
+
debug_only(mark_scavenge_root_nmethods());
for (nmethod* cur = scavenge_root_nmethods(); cur != NULL; cur = cur->scavenge_root_link()) {
@@ -356,6 +361,11 @@ void CodeCache::scavenge_root_nmethods_do(CodeBlobClosure* f) {
void CodeCache::add_scavenge_root_nmethod(nmethod* nm) {
assert_locked_or_safepoint(CodeCache_lock);
+
+ if (UseG1GC) {
+ return;
+ }
+
nm->set_on_scavenge_root_list();
nm->set_scavenge_root_link(_scavenge_root_nmethods);
set_scavenge_root_nmethods(nm);
@@ -364,6 +374,11 @@ void CodeCache::add_scavenge_root_nmethod(nmethod* nm) {
void CodeCache::drop_scavenge_root_nmethod(nmethod* nm) {
assert_locked_or_safepoint(CodeCache_lock);
+
+ if (UseG1GC) {
+ return;
+ }
+
print_trace("drop_scavenge_root", nm);
nmethod* last = NULL;
nmethod* cur = scavenge_root_nmethods();
@@ -385,6 +400,11 @@ void CodeCache::drop_scavenge_root_nmethod(nmethod* nm) {
void CodeCache::prune_scavenge_root_nmethods() {
assert_locked_or_safepoint(CodeCache_lock);
+
+ if (UseG1GC) {
+ return;
+ }
+
debug_only(mark_scavenge_root_nmethods());
nmethod* last = NULL;
@@ -417,6 +437,10 @@ void CodeCache::prune_scavenge_root_nmethods() {
#ifndef PRODUCT
void CodeCache::asserted_non_scavengable_nmethods_do(CodeBlobClosure* f) {
+ if (UseG1GC) {
+ return;
+ }
+
// While we are here, verify the integrity of the list.
mark_scavenge_root_nmethods();
for (nmethod* cur = scavenge_root_nmethods(); cur != NULL; cur = cur->scavenge_root_link()) {
@@ -457,9 +481,36 @@ void CodeCache::verify_perm_nmethods(CodeBlobClosure* f_or_null) {
}
#endif //PRODUCT
+void CodeCache::verify_clean_inline_caches() {
+#ifdef ASSERT
+ FOR_ALL_ALIVE_BLOBS(cb) {
+ if (cb->is_nmethod()) {
+ nmethod* nm = (nmethod*)cb;
+ assert(!nm->is_unloaded(), "Tautology");
+ nm->verify_clean_inline_caches();
+ nm->verify();
+ }
+ }
+#endif
+}
+
+void CodeCache::verify_icholder_relocations() {
+#ifdef ASSERT
+ // make sure that we aren't leaking icholders
+ int count = 0;
+ FOR_ALL_BLOBS(cb) {
+ if (cb->is_nmethod()) {
+ nmethod* nm = (nmethod*)cb;
+ count += nm->verify_icholder_relocations();
+ }
+ }
+
+ assert(count + InlineCacheBuffer::pending_icholder_count() + CompiledICHolder::live_not_claimed_count() ==
+ CompiledICHolder::live_count(), "must agree");
+#endif
+}
void CodeCache::gc_prologue() {
- assert(!nmethod::oops_do_marking_is_active(), "oops_do_marking_epilogue must be called");
}
void CodeCache::gc_epilogue() {
@@ -472,41 +523,15 @@ void CodeCache::gc_epilogue() {
nm->cleanup_inline_caches();
}
DEBUG_ONLY(nm->verify());
- nm->fix_oop_relocations();
+ DEBUG_ONLY(nm->verify_oop_relocations());
}
}
set_needs_cache_clean(false);
prune_scavenge_root_nmethods();
- assert(!nmethod::oops_do_marking_is_active(), "oops_do_marking_prologue must be called");
-#ifdef ASSERT
- // make sure that we aren't leaking icholders
- int count = 0;
- FOR_ALL_BLOBS(cb) {
- if (cb->is_nmethod()) {
- RelocIterator iter((nmethod*)cb);
- while(iter.next()) {
- if (iter.type() == relocInfo::virtual_call_type) {
- if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc())) {
- CompiledIC *ic = CompiledIC_at(iter.reloc());
- if (TraceCompiledIC) {
- tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder()));
- ic->print();
- }
- assert(ic->cached_icholder() != NULL, "must be non-NULL");
- count++;
- }
- }
- }
- }
- }
-
- assert(count + InlineCacheBuffer::pending_icholder_count() + CompiledICHolder::live_not_claimed_count() ==
- CompiledICHolder::live_count(), "must agree");
-#endif
+ verify_icholder_relocations();
}
-
void CodeCache::verify_oops() {
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
VerifyOopClosure voc;
diff --git a/hotspot/src/share/vm/code/codeCache.hpp b/hotspot/src/share/vm/code/codeCache.hpp
index f9f656cc35a..9bd75bfd97d 100644
--- a/hotspot/src/share/vm/code/codeCache.hpp
+++ b/hotspot/src/share/vm/code/codeCache.hpp
@@ -134,10 +134,6 @@ class CodeCache : AllStatic {
// to) any unmarked codeBlobs in the cache. Sets "marked_for_unloading"
// to "true" iff some code got unloaded.
static void do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred);
- static void oops_do(OopClosure* f) {
- CodeBlobToOopClosure oopc(f, /*do_marking=*/ false);
- blobs_do(&oopc);
- }
static void asserted_non_scavengable_nmethods_do(CodeBlobClosure* f = NULL) PRODUCT_RETURN;
static void scavenge_root_nmethods_do(CodeBlobClosure* f);
@@ -173,6 +169,9 @@ class CodeCache : AllStatic {
static void set_needs_cache_clean(bool v) { _needs_cache_clean = v; }
static void clear_inline_caches(); // clear all inline caches
+ static void verify_clean_inline_caches();
+ static void verify_icholder_relocations();
+
// Deoptimization
static int mark_for_deoptimization(DepChange& changes);
#ifdef HOTSWAP
diff --git a/hotspot/src/share/vm/code/compiledIC.cpp b/hotspot/src/share/vm/code/compiledIC.cpp
index 2ce7c3c6793..25ef072b128 100644
--- a/hotspot/src/share/vm/code/compiledIC.cpp
+++ b/hotspot/src/share/vm/code/compiledIC.cpp
@@ -99,13 +99,13 @@ void CompiledIC::internal_set_ic_destination(address entry_point, bool is_icstub
}
{
- MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);
+ MutexLockerEx pl(SafepointSynchronize::is_at_safepoint() ? NULL : Patching_lock, Mutex::_no_safepoint_check_flag);
#ifdef ASSERT
- CodeBlob* cb = CodeCache::find_blob_unsafe(_ic_call);
- assert(cb != NULL && cb->is_nmethod(), "must be nmethod");
+ CodeBlob* cb = CodeCache::find_blob_unsafe(_ic_call);
+ assert(cb != NULL && cb->is_nmethod(), "must be nmethod");
#endif
- _ic_call->set_destination_mt_safe(entry_point);
-}
+ _ic_call->set_destination_mt_safe(entry_point);
+ }
if (is_optimized() || is_icstub) {
// Optimized call sites don't have a cache value and ICStub call
@@ -159,10 +159,24 @@ address CompiledIC::stub_address() const {
//-----------------------------------------------------------------------------
// High-level access to an inline cache. Guaranteed to be MT-safe.
+void CompiledIC::initialize_from_iter(RelocIterator* iter) {
+ assert(iter->addr() == _ic_call->instruction_address(), "must find ic_call");
+
+ if (iter->type() == relocInfo::virtual_call_type) {
+ virtual_call_Relocation* r = iter->virtual_call_reloc();
+ _is_optimized = false;
+ _value = nativeMovConstReg_at(r->cached_value());
+ } else {
+ assert(iter->type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
+ _is_optimized = true;
+ _value = NULL;
+ }
+}
+
CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)
: _ic_call(call)
{
- address ic_call = call->instruction_address();
+ address ic_call = _ic_call->instruction_address();
assert(ic_call != NULL, "ic_call address must be set");
assert(nm != NULL, "must pass nmethod");
@@ -173,15 +187,21 @@ CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)
bool ret = iter.next();
assert(ret == true, "relocInfo must exist at this address");
assert(iter.addr() == ic_call, "must find ic_call");
- if (iter.type() == relocInfo::virtual_call_type) {
- virtual_call_Relocation* r = iter.virtual_call_reloc();
- _is_optimized = false;
- _value = nativeMovConstReg_at(r->cached_value());
- } else {
- assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
- _is_optimized = true;
- _value = NULL;
- }
+
+ initialize_from_iter(&iter);
+}
+
+CompiledIC::CompiledIC(RelocIterator* iter)
+ : _ic_call(nativeCall_at(iter->addr()))
+{
+ address ic_call = _ic_call->instruction_address();
+
+ nmethod* nm = iter->code();
+ assert(ic_call != NULL, "ic_call address must be set");
+ assert(nm != NULL, "must pass nmethod");
+ assert(nm->contains(ic_call), "must be in nmethod");
+
+ initialize_from_iter(iter);
}
bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS) {
@@ -509,7 +529,7 @@ bool CompiledIC::is_icholder_entry(address entry) {
void CompiledStaticCall::set_to_clean() {
assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call");
// Reset call site
- MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);
+ MutexLockerEx pl(SafepointSynchronize::is_at_safepoint() ? NULL : Patching_lock, Mutex::_no_safepoint_check_flag);
#ifdef ASSERT
CodeBlob* cb = CodeCache::find_blob_unsafe(this);
assert(cb != NULL && cb->is_nmethod(), "must be nmethod");
diff --git a/hotspot/src/share/vm/code/compiledIC.hpp b/hotspot/src/share/vm/code/compiledIC.hpp
index ec36381b1f2..d1e9b9a2bce 100644
--- a/hotspot/src/share/vm/code/compiledIC.hpp
+++ b/hotspot/src/share/vm/code/compiledIC.hpp
@@ -136,6 +136,9 @@ class CompiledIC: public ResourceObj {
bool _is_optimized; // an optimized virtual call (i.e., no compiled IC)
CompiledIC(nmethod* nm, NativeCall* ic_call);
+ CompiledIC(RelocIterator* iter);
+
+ void initialize_from_iter(RelocIterator* iter);
static bool is_icholder_entry(address entry);
@@ -169,6 +172,7 @@ class CompiledIC: public ResourceObj {
friend CompiledIC* CompiledIC_before(nmethod* nm, address return_addr);
friend CompiledIC* CompiledIC_at(nmethod* nm, address call_site);
friend CompiledIC* CompiledIC_at(Relocation* call_site);
+ friend CompiledIC* CompiledIC_at(RelocIterator* reloc_iter);
// This is used to release CompiledICHolder*s from nmethods that
// are about to be freed. The callsite might contain other stale
@@ -249,6 +253,13 @@ inline CompiledIC* CompiledIC_at(Relocation* call_site) {
return c_ic;
}
+inline CompiledIC* CompiledIC_at(RelocIterator* reloc_iter) {
+ assert(reloc_iter->type() == relocInfo::virtual_call_type ||
+ reloc_iter->type() == relocInfo::opt_virtual_call_type, "wrong reloc. info");
+ CompiledIC* c_ic = new CompiledIC(reloc_iter);
+ c_ic->verify();
+ return c_ic;
+}
//-----------------------------------------------------------------------------
// The CompiledStaticCall represents a call to a static method in the compiled
diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp
index 795c700fa1b..f654ffb4bc2 100644
--- a/hotspot/src/share/vm/code/nmethod.cpp
+++ b/hotspot/src/share/vm/code/nmethod.cpp
@@ -51,6 +51,8 @@
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
+unsigned char nmethod::_global_unloading_clock = 0;
+
#ifdef DTRACE_ENABLED
// Only bother with this argument setup if dtrace is available
@@ -446,6 +448,7 @@ const char* nmethod::compile_kind() const {
// Fill in default values for various flag fields
void nmethod::init_defaults() {
_state = in_use;
+ _unloading_clock = 0;
_marked_for_reclamation = 0;
_has_flushed_dependencies = 0;
_has_unsafe_access = 0;
@@ -464,7 +467,11 @@ void nmethod::init_defaults() {
_oops_do_mark_link = NULL;
_jmethod_id = NULL;
_osr_link = NULL;
- _scavenge_root_link = NULL;
+ if (UseG1GC) {
+ _unloading_next = NULL;
+ } else {
+ _scavenge_root_link = NULL;
+ }
_scavenge_root_state = 0;
_compiler = NULL;
#if INCLUDE_RTM_OPT
@@ -1146,7 +1153,7 @@ void nmethod::cleanup_inline_caches() {
switch(iter.type()) {
case relocInfo::virtual_call_type:
case relocInfo::opt_virtual_call_type: {
- CompiledIC *ic = CompiledIC_at(iter.reloc());
+ CompiledIC *ic = CompiledIC_at(&iter);
// Ok, to lookup references to zombies here
CodeBlob *cb = CodeCache::find_blob_unsafe(ic->ic_destination());
if( cb != NULL && cb->is_nmethod() ) {
@@ -1170,6 +1177,77 @@ void nmethod::cleanup_inline_caches() {
}
}
+void nmethod::verify_clean_inline_caches() {
+ assert_locked_or_safepoint(CompiledIC_lock);
+
+ // If the method is not entrant or zombie then a JMP is plastered over the
+ // first few bytes. If an oop in the old code was there, that oop
+ // should not get GC'd. Skip the first few bytes of oops on
+ // not-entrant methods.
+ address low_boundary = verified_entry_point();
+ if (!is_in_use()) {
+ low_boundary += NativeJump::instruction_size;
+ // %%% Note: On SPARC we patch only a 4-byte trap, not a full NativeJump.
+ // This means that the low_boundary is going to be a little too high.
+ // This shouldn't matter, since oops of non-entrant methods are never used.
+ // In fact, why are we bothering to look at oops in a non-entrant method??
+ }
+
+ ResourceMark rm;
+ RelocIterator iter(this, low_boundary);
+ while(iter.next()) {
+ switch(iter.type()) {
+ case relocInfo::virtual_call_type:
+ case relocInfo::opt_virtual_call_type: {
+ CompiledIC *ic = CompiledIC_at(&iter);
+ // Ok, to lookup references to zombies here
+ CodeBlob *cb = CodeCache::find_blob_unsafe(ic->ic_destination());
+ if( cb != NULL && cb->is_nmethod() ) {
+ nmethod* nm = (nmethod*)cb;
+ // Verify that inline caches pointing to both zombie and not_entrant methods are clean
+ if (!nm->is_in_use() || (nm->method()->code() != nm)) {
+ assert(ic->is_clean(), "IC should be clean");
+ }
+ }
+ break;
+ }
+ case relocInfo::static_call_type: {
+ CompiledStaticCall *csc = compiledStaticCall_at(iter.reloc());
+ CodeBlob *cb = CodeCache::find_blob_unsafe(csc->destination());
+ if( cb != NULL && cb->is_nmethod() ) {
+ nmethod* nm = (nmethod*)cb;
+ // Verify that inline caches pointing to both zombie and not_entrant methods are clean
+ if (!nm->is_in_use() || (nm->method()->code() != nm)) {
+ assert(csc->is_clean(), "IC should be clean");
+ }
+ }
+ break;
+ }
+ }
+ }
+}
+
+int nmethod::verify_icholder_relocations() {
+ int count = 0;
+
+ RelocIterator iter(this);
+ while(iter.next()) {
+ if (iter.type() == relocInfo::virtual_call_type) {
+ if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc())) {
+ CompiledIC *ic = CompiledIC_at(&iter);
+ if (TraceCompiledIC) {
+ tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder()));
+ ic->print();
+ }
+ assert(ic->cached_icholder() != NULL, "must be non-NULL");
+ count++;
+ }
+ }
+ }
+
+ return count;
+}
+
// This is a private interface with the sweeper.
void nmethod::mark_as_seen_on_stack() {
assert(is_alive(), "Must be an alive method");
@@ -1202,6 +1280,23 @@ void nmethod::inc_decompile_count() {
mdo->inc_decompile_count();
}
+void nmethod::increase_unloading_clock() {
+ _global_unloading_clock++;
+ if (_global_unloading_clock == 0) {
+ // _nmethods are allocated with _unloading_clock == 0,
+ // so 0 is never used as a clock value.
+ _global_unloading_clock = 1;
+ }
+}
+
+void nmethod::set_unloading_clock(unsigned char unloading_clock) {
+ OrderAccess::release_store((volatile jubyte*)&_unloading_clock, unloading_clock);
+}
+
+unsigned char nmethod::unloading_clock() {
+ return (unsigned char)OrderAccess::load_acquire((volatile jubyte*)&_unloading_clock);
+}
+
void nmethod::make_unloaded(BoolObjectClosure* is_alive, oop cause) {
post_compiled_method_unload();
@@ -1247,6 +1342,10 @@ void nmethod::make_unloaded(BoolObjectClosure* is_alive, oop cause) {
// for later on.
CodeCache::set_needs_cache_clean(true);
}
+
+ // Unregister must be done before the state change
+ Universe::heap()->unregister_nmethod(this);
+
_state = unloaded;
// Log the unloading.
@@ -1590,6 +1689,35 @@ void nmethod::post_compiled_method_unload() {
set_unload_reported();
}
+void static clean_ic_if_metadata_is_dead(CompiledIC *ic, BoolObjectClosure *is_alive) {
+ if (ic->is_icholder_call()) {
+ // The only exception is compiledICHolder oops which may
+ // yet be marked below. (We check this further below).
+ CompiledICHolder* cichk_oop = ic->cached_icholder();
+ if (cichk_oop->holder_method()->method_holder()->is_loader_alive(is_alive) &&
+ cichk_oop->holder_klass()->is_loader_alive(is_alive)) {
+ return;
+ }
+ } else {
+ Metadata* ic_oop = ic->cached_metadata();
+ if (ic_oop != NULL) {
+ if (ic_oop->is_klass()) {
+ if (((Klass*)ic_oop)->is_loader_alive(is_alive)) {
+ return;
+ }
+ } else if (ic_oop->is_method()) {
+ if (((Method*)ic_oop)->method_holder()->is_loader_alive(is_alive)) {
+ return;
+ }
+ } else {
+ ShouldNotReachHere();
+ }
+ }
+ }
+
+ ic->set_to_clean();
+}
+
// This is called at the end of the strong tracing/marking phase of a
// GC to unload an nmethod if it contains otherwise unreachable
// oops.
@@ -1632,32 +1760,8 @@ void nmethod::do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred)
RelocIterator iter(this, low_boundary);
while(iter.next()) {
if (iter.type() == relocInfo::virtual_call_type) {
- CompiledIC *ic = CompiledIC_at(iter.reloc());
- if (ic->is_icholder_call()) {
- // The only exception is compiledICHolder oops which may
- // yet be marked below. (We check this further below).
- CompiledICHolder* cichk_oop = ic->cached_icholder();
- if (cichk_oop->holder_method()->method_holder()->is_loader_alive(is_alive) &&
- cichk_oop->holder_klass()->is_loader_alive(is_alive)) {
- continue;
- }
- } else {
- Metadata* ic_oop = ic->cached_metadata();
- if (ic_oop != NULL) {
- if (ic_oop->is_klass()) {
- if (((Klass*)ic_oop)->is_loader_alive(is_alive)) {
- continue;
- }
- } else if (ic_oop->is_method()) {
- if (((Method*)ic_oop)->method_holder()->is_loader_alive(is_alive)) {
- continue;
- }
- } else {
- ShouldNotReachHere();
- }
- }
- }
- ic->set_to_clean();
+ CompiledIC *ic = CompiledIC_at(&iter);
+ clean_ic_if_metadata_is_dead(ic, is_alive);
}
}
}
@@ -1695,6 +1799,175 @@ void nmethod::do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred)
verify_metadata_loaders(low_boundary, is_alive);
}
+template
+static bool clean_if_nmethod_is_unloaded(CompiledICorStaticCall *ic, address addr, BoolObjectClosure *is_alive, nmethod* from) {
+ // Ok, to lookup references to zombies here
+ CodeBlob *cb = CodeCache::find_blob_unsafe(addr);
+ if (cb != NULL && cb->is_nmethod()) {
+ nmethod* nm = (nmethod*)cb;
+
+ if (nm->unloading_clock() != nmethod::global_unloading_clock()) {
+ // The nmethod has not been processed yet.
+ return true;
+ }
+
+ // Clean inline caches pointing to both zombie and not_entrant methods
+ if (!nm->is_in_use() || (nm->method()->code() != nm)) {
+ ic->set_to_clean();
+ assert(ic->is_clean(), err_msg("nmethod " PTR_FORMAT "not clean %s", from, from->method()->name_and_sig_as_C_string()));
+ }
+ }
+
+ return false;
+}
+
+static bool clean_if_nmethod_is_unloaded(CompiledIC *ic, BoolObjectClosure *is_alive, nmethod* from) {
+ return clean_if_nmethod_is_unloaded(ic, ic->ic_destination(), is_alive, from);
+}
+
+static bool clean_if_nmethod_is_unloaded(CompiledStaticCall *csc, BoolObjectClosure *is_alive, nmethod* from) {
+ return clean_if_nmethod_is_unloaded(csc, csc->destination(), is_alive, from);
+}
+
+bool nmethod::do_unloading_parallel(BoolObjectClosure* is_alive, bool unloading_occurred) {
+ ResourceMark rm;
+
+ // Make sure the oop's ready to receive visitors
+ assert(!is_zombie() && !is_unloaded(),
+ "should not call follow on zombie or unloaded nmethod");
+
+ // If the method is not entrant then a JMP is plastered over the
+ // first few bytes. If an oop in the old code was there, that oop
+ // should not get GC'd. Skip the first few bytes of oops on
+ // not-entrant methods.
+ address low_boundary = verified_entry_point();
+ if (is_not_entrant()) {
+ low_boundary += NativeJump::instruction_size;
+ // %%% Note: On SPARC we patch only a 4-byte trap, not a full NativeJump.
+ // (See comment above.)
+ }
+
+ // The RedefineClasses() API can cause the class unloading invariant
+ // to no longer be true. See jvmtiExport.hpp for details.
+ // Also, leave a debugging breadcrumb in local flag.
+ bool a_class_was_redefined = JvmtiExport::has_redefined_a_class();
+ if (a_class_was_redefined) {
+ // This set of the unloading_occurred flag is done before the
+ // call to post_compiled_method_unload() so that the unloading
+ // of this nmethod is reported.
+ unloading_occurred = true;
+ }
+
+ // Exception cache
+ clean_exception_cache(is_alive);
+
+ bool is_unloaded = false;
+ bool postponed = false;
+
+ RelocIterator iter(this, low_boundary);
+ while(iter.next()) {
+
+ switch (iter.type()) {
+
+ case relocInfo::virtual_call_type:
+ if (unloading_occurred) {
+ // If class unloading occurred we first iterate over all inline caches and
+ // clear ICs where the cached oop is referring to an unloaded klass or method.
+ clean_ic_if_metadata_is_dead(CompiledIC_at(&iter), is_alive);
+ }
+
+ postponed |= clean_if_nmethod_is_unloaded(CompiledIC_at(&iter), is_alive, this);
+ break;
+
+ case relocInfo::opt_virtual_call_type:
+ postponed |= clean_if_nmethod_is_unloaded(CompiledIC_at(&iter), is_alive, this);
+ break;
+
+ case relocInfo::static_call_type:
+ postponed |= clean_if_nmethod_is_unloaded(compiledStaticCall_at(iter.reloc()), is_alive, this);
+ break;
+
+ case relocInfo::oop_type:
+ if (!is_unloaded) {
+ // Unload check
+ oop_Relocation* r = iter.oop_reloc();
+ // Traverse those oops directly embedded in the code.
+ // Other oops (oop_index>0) are seen as part of scopes_oops.
+ assert(1 == (r->oop_is_immediate()) +
+ (r->oop_addr() >= oops_begin() && r->oop_addr() < oops_end()),
+ "oop must be found in exactly one place");
+ if (r->oop_is_immediate() && r->oop_value() != NULL) {
+ if (can_unload(is_alive, r->oop_addr(), unloading_occurred)) {
+ is_unloaded = true;
+ }
+ }
+ }
+ break;
+
+ }
+ }
+
+ if (is_unloaded) {
+ return postponed;
+ }
+
+ // Scopes
+ for (oop* p = oops_begin(); p < oops_end(); p++) {
+ if (*p == Universe::non_oop_word()) continue; // skip non-oops
+ if (can_unload(is_alive, p, unloading_occurred)) {
+ is_unloaded = true;
+ break;
+ }
+ }
+
+ if (is_unloaded) {
+ return postponed;
+ }
+
+ // Ensure that all metadata is still alive
+ verify_metadata_loaders(low_boundary, is_alive);
+
+ return postponed;
+}
+
+void nmethod::do_unloading_parallel_postponed(BoolObjectClosure* is_alive, bool unloading_occurred) {
+ ResourceMark rm;
+
+ // Make sure the oop's ready to receive visitors
+ assert(!is_zombie(),
+ "should not call follow on zombie nmethod");
+
+ // If the method is not entrant then a JMP is plastered over the
+ // first few bytes. If an oop in the old code was there, that oop
+ // should not get GC'd. Skip the first few bytes of oops on
+ // not-entrant methods.
+ address low_boundary = verified_entry_point();
+ if (is_not_entrant()) {
+ low_boundary += NativeJump::instruction_size;
+ // %%% Note: On SPARC we patch only a 4-byte trap, not a full NativeJump.
+ // (See comment above.)
+ }
+
+ RelocIterator iter(this, low_boundary);
+ while(iter.next()) {
+
+ switch (iter.type()) {
+
+ case relocInfo::virtual_call_type:
+ clean_if_nmethod_is_unloaded(CompiledIC_at(&iter), is_alive, this);
+ break;
+
+ case relocInfo::opt_virtual_call_type:
+ clean_if_nmethod_is_unloaded(CompiledIC_at(&iter), is_alive, this);
+ break;
+
+ case relocInfo::static_call_type:
+ clean_if_nmethod_is_unloaded(compiledStaticCall_at(iter.reloc()), is_alive, this);
+ break;
+ }
+ }
+}
+
#ifdef ASSERT
class CheckClass : AllStatic {
@@ -1741,7 +2014,7 @@ void nmethod::verify_metadata_loaders(address low_boundary, BoolObjectClosure* i
// compiled code is maintaining a link to dead metadata.
address static_call_addr = NULL;
if (iter.type() == relocInfo::opt_virtual_call_type) {
- CompiledIC* cic = CompiledIC_at(iter.reloc());
+ CompiledIC* cic = CompiledIC_at(&iter);
if (!cic->is_call_to_interpreted()) {
static_call_addr = iter.addr();
}
@@ -1793,7 +2066,7 @@ void nmethod::metadata_do(void f(Metadata*)) {
}
} else if (iter.type() == relocInfo::virtual_call_type) {
// Check compiledIC holders associated with this nmethod
- CompiledIC *ic = CompiledIC_at(iter.reloc());
+ CompiledIC *ic = CompiledIC_at(&iter);
if (ic->is_icholder_call()) {
CompiledICHolder* cichk = ic->cached_icholder();
f(cichk->holder_method());
@@ -1911,7 +2184,7 @@ void nmethod::oops_do_marking_epilogue() {
assert(cur != NULL, "not NULL-terminated");
nmethod* next = cur->_oops_do_mark_link;
cur->_oops_do_mark_link = NULL;
- cur->fix_oop_relocations();
+ cur->verify_oop_relocations();
NOT_PRODUCT(if (TraceScavenge) cur->print_on(tty, "oops_do, unmark"));
cur = next;
}
@@ -2479,6 +2752,10 @@ public:
};
void nmethod::verify_scavenge_root_oops() {
+ if (UseG1GC) {
+ return;
+ }
+
if (!on_scavenge_root_list()) {
// Actually look inside, to verify the claim that it's clean.
DebugScavengeRoot debug_scavenge_root(this);
@@ -2922,7 +3199,7 @@ void nmethod::print_calls(outputStream* st) {
case relocInfo::virtual_call_type:
case relocInfo::opt_virtual_call_type: {
VerifyMutexLocker mc(CompiledIC_lock);
- CompiledIC_at(iter.reloc())->print();
+ CompiledIC_at(&iter)->print();
break;
}
case relocInfo::static_call_type:
diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp
index 5ffbde6ad70..5ea2ca8891d 100644
--- a/hotspot/src/share/vm/code/nmethod.hpp
+++ b/hotspot/src/share/vm/code/nmethod.hpp
@@ -111,6 +111,11 @@ class nmethod : public CodeBlob {
friend class NMethodSweeper;
friend class CodeCache; // scavengable oops
private:
+
+ // GC support to help figure out if an nmethod has been
+ // cleaned/unloaded by the current GC.
+ static unsigned char _global_unloading_clock;
+
// Shared fields for all nmethod's
Method* _method;
int _entry_bci; // != InvocationEntryBci if this nmethod is an on-stack replacement method
@@ -118,7 +123,13 @@ class nmethod : public CodeBlob {
// To support simple linked-list chaining of nmethods:
nmethod* _osr_link; // from InstanceKlass::osr_nmethods_head
- nmethod* _scavenge_root_link; // from CodeCache::scavenge_root_nmethods
+
+ union {
+ // Used by G1 to chain nmethods.
+ nmethod* _unloading_next;
+ // Used by non-G1 GCs to chain nmethods.
+ nmethod* _scavenge_root_link; // from CodeCache::scavenge_root_nmethods
+ };
static nmethod* volatile _oops_do_mark_nmethods;
nmethod* volatile _oops_do_mark_link;
@@ -180,6 +191,8 @@ class nmethod : public CodeBlob {
// Protected by Patching_lock
volatile unsigned char _state; // {alive, not_entrant, zombie, unloaded}
+ volatile unsigned char _unloading_clock; // Incremented after GC unloaded/cleaned the nmethod
+
#ifdef ASSERT
bool _oops_are_stale; // indicates that it's no longer safe to access oops section
#endif
@@ -437,6 +450,15 @@ class nmethod : public CodeBlob {
bool unload_reported() { return _unload_reported; }
void set_unload_reported() { _unload_reported = true; }
+ void set_unloading_next(nmethod* next) { _unloading_next = next; }
+ nmethod* unloading_next() { return _unloading_next; }
+
+ static unsigned char global_unloading_clock() { return _global_unloading_clock; }
+ static void increase_unloading_clock();
+
+ void set_unloading_clock(unsigned char unloading_clock);
+ unsigned char unloading_clock();
+
bool is_marked_for_deoptimization() const { return _marked_for_deoptimization; }
void mark_for_deoptimization() { _marked_for_deoptimization = true; }
@@ -552,6 +574,10 @@ public:
return (addr >= code_begin() && addr < verified_entry_point());
}
+ // Verify calls to dead methods have been cleaned.
+ void verify_clean_inline_caches();
+ // Verify and count cached icholder relocations.
+ int verify_icholder_relocations();
// Check that all metadata is still alive
void verify_metadata_loaders(address low_boundary, BoolObjectClosure* is_alive);
@@ -577,6 +603,10 @@ public:
// GC support
void do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred);
+ // The parallel versions are used by G1.
+ bool do_unloading_parallel(BoolObjectClosure* is_alive, bool unloading_occurred);
+ void do_unloading_parallel_postponed(BoolObjectClosure* is_alive, bool unloading_occurred);
+ // Unload a nmethod if the *root object is dead.
bool can_unload(BoolObjectClosure* is_alive, oop* root, bool unloading_occurred);
void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map,
diff --git a/hotspot/src/share/vm/code/vtableStubs.cpp b/hotspot/src/share/vm/code/vtableStubs.cpp
index ac99da40e1c..07a1083518f 100644
--- a/hotspot/src/share/vm/code/vtableStubs.cpp
+++ b/hotspot/src/share/vm/code/vtableStubs.cpp
@@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "code/vtableStubs.hpp"
+#include "compiler/compileBroker.hpp"
#include "compiler/disassembler.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
@@ -62,6 +63,7 @@ void* VtableStub::operator new(size_t size, int code_size) throw() {
// If changing the name, update the other file accordingly.
BufferBlob* blob = BufferBlob::create("vtable chunks", bytes);
if (blob == NULL) {
+ CompileBroker::handle_full_code_cache();
return NULL;
}
_chunk = blob->content_begin();
diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp
index b97a554192d..b328fdd90b4 100644
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp
@@ -1048,7 +1048,7 @@ CompilerThread* CompileBroker::make_compiler_thread(const char* name, CompileQue
}
// Let go of Threads_lock before yielding
- os::yield(); // make sure that the compiler thread is started early (especially helpful on SOLARIS)
+ os::naked_yield(); // make sure that the compiler thread is started early (especially helpful on SOLARIS)
return compiler_thread;
}
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp
deleted file mode 100644
index 3882916e472..00000000000
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp
+++ /dev/null
@@ -1,1340 +0,0 @@
-/*
- * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#include "precompiled.hpp"
-#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
-#include "gc_implementation/shared/gcStats.hpp"
-#include "memory/defNewGeneration.hpp"
-#include "memory/genCollectedHeap.hpp"
-#include "runtime/thread.hpp"
-
-elapsedTimer CMSAdaptiveSizePolicy::_concurrent_timer;
-elapsedTimer CMSAdaptiveSizePolicy::_STW_timer;
-
-// Defined if the granularity of the time measurements is potentially too large.
-#define CLOCK_GRANULARITY_TOO_LARGE
-
-CMSAdaptiveSizePolicy::CMSAdaptiveSizePolicy(size_t init_eden_size,
- size_t init_promo_size,
- size_t init_survivor_size,
- double max_gc_minor_pause_sec,
- double max_gc_pause_sec,
- uint gc_cost_ratio) :
- AdaptiveSizePolicy(init_eden_size,
- init_promo_size,
- init_survivor_size,
- max_gc_pause_sec,
- gc_cost_ratio) {
-
- clear_internal_time_intervals();
-
- _processor_count = os::active_processor_count();
-
- if (CMSConcurrentMTEnabled && (ConcGCThreads > 1)) {
- assert(_processor_count > 0, "Processor count is suspect");
- _concurrent_processor_count = MIN2((uint) ConcGCThreads,
- (uint) _processor_count);
- } else {
- _concurrent_processor_count = 1;
- }
-
- _avg_concurrent_time = new AdaptiveWeightedAverage(AdaptiveTimeWeight);
- _avg_concurrent_interval = new AdaptiveWeightedAverage(AdaptiveTimeWeight);
- _avg_concurrent_gc_cost = new AdaptiveWeightedAverage(AdaptiveTimeWeight);
-
- _avg_initial_pause = new AdaptivePaddedAverage(AdaptiveTimeWeight,
- PausePadding);
- _avg_remark_pause = new AdaptivePaddedAverage(AdaptiveTimeWeight,
- PausePadding);
-
- _avg_cms_STW_time = new AdaptiveWeightedAverage(AdaptiveTimeWeight);
- _avg_cms_STW_gc_cost = new AdaptiveWeightedAverage(AdaptiveTimeWeight);
-
- _avg_cms_free = new AdaptiveWeightedAverage(AdaptiveTimeWeight);
- _avg_cms_free_at_sweep = new AdaptiveWeightedAverage(AdaptiveTimeWeight);
- _avg_cms_promo = new AdaptiveWeightedAverage(AdaptiveTimeWeight);
-
- // Mark-sweep-compact
- _avg_msc_pause = new AdaptiveWeightedAverage(AdaptiveTimeWeight);
- _avg_msc_interval = new AdaptiveWeightedAverage(AdaptiveTimeWeight);
- _avg_msc_gc_cost = new AdaptiveWeightedAverage(AdaptiveTimeWeight);
-
- // Mark-sweep
- _avg_ms_pause = new AdaptiveWeightedAverage(AdaptiveTimeWeight);
- _avg_ms_interval = new AdaptiveWeightedAverage(AdaptiveTimeWeight);
- _avg_ms_gc_cost = new AdaptiveWeightedAverage(AdaptiveTimeWeight);
-
- // Variables that estimate pause times as a function of generation
- // size.
- _remark_pause_old_estimator =
- new LinearLeastSquareFit(AdaptiveSizePolicyWeight);
- _initial_pause_old_estimator =
- new LinearLeastSquareFit(AdaptiveSizePolicyWeight);
- _remark_pause_young_estimator =
- new LinearLeastSquareFit(AdaptiveSizePolicyWeight);
- _initial_pause_young_estimator =
- new LinearLeastSquareFit(AdaptiveSizePolicyWeight);
-
- // Alignment comes from that used in ReservedSpace.
- _generation_alignment = os::vm_allocation_granularity();
-
- // Start the concurrent timer here so that the first
- // concurrent_phases_begin() measures a finite mutator
- // time. A finite mutator time is used to determine
- // if a concurrent collection has been started. If this
- // proves to be a problem, use some explicit flag to
- // signal that a concurrent collection has been started.
- _concurrent_timer.start();
- _STW_timer.start();
-}
-
-double CMSAdaptiveSizePolicy::concurrent_processor_fraction() {
- // For now assume no other daemon threads are taking alway
- // cpu's from the application.
- return ((double) _concurrent_processor_count / (double) _processor_count);
-}
-
-double CMSAdaptiveSizePolicy::concurrent_collection_cost(
- double interval_in_seconds) {
- // When the precleaning and sweeping phases use multiple
- // threads, change one_processor_fraction to
- // concurrent_processor_fraction().
- double one_processor_fraction = 1.0 / ((double) processor_count());
- double concurrent_cost =
- collection_cost(_latest_cms_concurrent_marking_time_secs,
- interval_in_seconds) * concurrent_processor_fraction() +
- collection_cost(_latest_cms_concurrent_precleaning_time_secs,
- interval_in_seconds) * one_processor_fraction +
- collection_cost(_latest_cms_concurrent_sweeping_time_secs,
- interval_in_seconds) * one_processor_fraction;
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(
- "\nCMSAdaptiveSizePolicy::scaled_concurrent_collection_cost(%f) "
- "_latest_cms_concurrent_marking_cost %f "
- "_latest_cms_concurrent_precleaning_cost %f "
- "_latest_cms_concurrent_sweeping_cost %f "
- "concurrent_processor_fraction %f "
- "concurrent_cost %f ",
- interval_in_seconds,
- collection_cost(_latest_cms_concurrent_marking_time_secs,
- interval_in_seconds),
- collection_cost(_latest_cms_concurrent_precleaning_time_secs,
- interval_in_seconds),
- collection_cost(_latest_cms_concurrent_sweeping_time_secs,
- interval_in_seconds),
- concurrent_processor_fraction(),
- concurrent_cost);
- }
- return concurrent_cost;
-}
-
-double CMSAdaptiveSizePolicy::concurrent_collection_time() {
- double latest_cms_sum_concurrent_phases_time_secs =
- _latest_cms_concurrent_marking_time_secs +
- _latest_cms_concurrent_precleaning_time_secs +
- _latest_cms_concurrent_sweeping_time_secs;
- return latest_cms_sum_concurrent_phases_time_secs;
-}
-
-double CMSAdaptiveSizePolicy::scaled_concurrent_collection_time() {
- // When the precleaning and sweeping phases use multiple
- // threads, change one_processor_fraction to
- // concurrent_processor_fraction().
- double one_processor_fraction = 1.0 / ((double) processor_count());
- double latest_cms_sum_concurrent_phases_time_secs =
- _latest_cms_concurrent_marking_time_secs * concurrent_processor_fraction() +
- _latest_cms_concurrent_precleaning_time_secs * one_processor_fraction +
- _latest_cms_concurrent_sweeping_time_secs * one_processor_fraction ;
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(
- "\nCMSAdaptiveSizePolicy::scaled_concurrent_collection_time "
- "_latest_cms_concurrent_marking_time_secs %f "
- "_latest_cms_concurrent_precleaning_time_secs %f "
- "_latest_cms_concurrent_sweeping_time_secs %f "
- "concurrent_processor_fraction %f "
- "latest_cms_sum_concurrent_phases_time_secs %f ",
- _latest_cms_concurrent_marking_time_secs,
- _latest_cms_concurrent_precleaning_time_secs,
- _latest_cms_concurrent_sweeping_time_secs,
- concurrent_processor_fraction(),
- latest_cms_sum_concurrent_phases_time_secs);
- }
- return latest_cms_sum_concurrent_phases_time_secs;
-}
-
-void CMSAdaptiveSizePolicy::update_minor_pause_old_estimator(
- double minor_pause_in_ms) {
- // Get the equivalent of the free space
- // that is available for promotions in the CMS generation
- // and use that to update _minor_pause_old_estimator
-
- // Don't implement this until it is needed. A warning is
- // printed if _minor_pause_old_estimator is used.
-}
-
-void CMSAdaptiveSizePolicy::concurrent_marking_begin() {
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print(" ");
- gclog_or_tty->stamp();
- gclog_or_tty->print(": concurrent_marking_begin ");
- }
- // Update the interval time
- _concurrent_timer.stop();
- _latest_cms_collection_end_to_collection_start_secs = _concurrent_timer.seconds();
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr("CMSAdaptiveSizePolicy::concurrent_marking_begin: "
- "mutator time %f", _latest_cms_collection_end_to_collection_start_secs);
- }
- _concurrent_timer.reset();
- _concurrent_timer.start();
-}
-
-void CMSAdaptiveSizePolicy::concurrent_marking_end() {
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->stamp();
- gclog_or_tty->print_cr("CMSAdaptiveSizePolicy::concurrent_marking_end()");
- }
-
- _concurrent_timer.stop();
- _latest_cms_concurrent_marking_time_secs = _concurrent_timer.seconds();
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr("\n CMSAdaptiveSizePolicy::concurrent_marking_end"
- ":concurrent marking time (s) %f",
- _latest_cms_concurrent_marking_time_secs);
- }
-}
-
-void CMSAdaptiveSizePolicy::concurrent_precleaning_begin() {
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->stamp();
- gclog_or_tty->print_cr(
- "CMSAdaptiveSizePolicy::concurrent_precleaning_begin()");
- }
- _concurrent_timer.reset();
- _concurrent_timer.start();
-}
-
-
-void CMSAdaptiveSizePolicy::concurrent_precleaning_end() {
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->stamp();
- gclog_or_tty->print_cr("CMSAdaptiveSizePolicy::concurrent_precleaning_end()");
- }
-
- _concurrent_timer.stop();
- // May be set again by a second call during the same collection.
- _latest_cms_concurrent_precleaning_time_secs = _concurrent_timer.seconds();
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr("\n CMSAdaptiveSizePolicy::concurrent_precleaning_end"
- ":concurrent precleaning time (s) %f",
- _latest_cms_concurrent_precleaning_time_secs);
- }
-}
-
-void CMSAdaptiveSizePolicy::concurrent_sweeping_begin() {
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->stamp();
- gclog_or_tty->print_cr(
- "CMSAdaptiveSizePolicy::concurrent_sweeping_begin()");
- }
- _concurrent_timer.reset();
- _concurrent_timer.start();
-}
-
-
-void CMSAdaptiveSizePolicy::concurrent_sweeping_end() {
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->stamp();
- gclog_or_tty->print_cr("CMSAdaptiveSizePolicy::concurrent_sweeping_end()");
- }
-
- _concurrent_timer.stop();
- _latest_cms_concurrent_sweeping_time_secs = _concurrent_timer.seconds();
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr("\n CMSAdaptiveSizePolicy::concurrent_sweeping_end"
- ":concurrent sweeping time (s) %f",
- _latest_cms_concurrent_sweeping_time_secs);
- }
-}
-
-void CMSAdaptiveSizePolicy::concurrent_phases_end(GCCause::Cause gc_cause,
- size_t cur_eden,
- size_t cur_promo) {
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print(" ");
- gclog_or_tty->stamp();
- gclog_or_tty->print(": concurrent_phases_end ");
- }
-
- // Update the concurrent timer
- _concurrent_timer.stop();
-
- if (gc_cause != GCCause::_java_lang_system_gc ||
- UseAdaptiveSizePolicyWithSystemGC) {
-
- avg_cms_free()->sample(cur_promo);
- double latest_cms_sum_concurrent_phases_time_secs =
- concurrent_collection_time();
-
- _avg_concurrent_time->sample(latest_cms_sum_concurrent_phases_time_secs);
-
- // Cost of collection (unit-less)
-
- // Total interval for collection. May not be valid. Tests
- // below determine whether to use this.
- //
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr("\nCMSAdaptiveSizePolicy::concurrent_phases_end \n"
- "_latest_cms_reset_end_to_initial_mark_start_secs %f \n"
- "_latest_cms_initial_mark_start_to_end_time_secs %f \n"
- "_latest_cms_remark_start_to_end_time_secs %f \n"
- "_latest_cms_concurrent_marking_time_secs %f \n"
- "_latest_cms_concurrent_precleaning_time_secs %f \n"
- "_latest_cms_concurrent_sweeping_time_secs %f \n"
- "latest_cms_sum_concurrent_phases_time_secs %f \n"
- "_latest_cms_collection_end_to_collection_start_secs %f \n"
- "concurrent_processor_fraction %f",
- _latest_cms_reset_end_to_initial_mark_start_secs,
- _latest_cms_initial_mark_start_to_end_time_secs,
- _latest_cms_remark_start_to_end_time_secs,
- _latest_cms_concurrent_marking_time_secs,
- _latest_cms_concurrent_precleaning_time_secs,
- _latest_cms_concurrent_sweeping_time_secs,
- latest_cms_sum_concurrent_phases_time_secs,
- _latest_cms_collection_end_to_collection_start_secs,
- concurrent_processor_fraction());
- }
- double interval_in_seconds =
- _latest_cms_initial_mark_start_to_end_time_secs +
- _latest_cms_remark_start_to_end_time_secs +
- latest_cms_sum_concurrent_phases_time_secs +
- _latest_cms_collection_end_to_collection_start_secs;
- assert(interval_in_seconds >= 0.0,
- "Bad interval between cms collections");
-
- // Sample for performance counter
- avg_concurrent_interval()->sample(interval_in_seconds);
-
- // STW costs (initial and remark pauses)
- // Cost of collection (unit-less)
- assert(_latest_cms_initial_mark_start_to_end_time_secs >= 0.0,
- "Bad initial mark pause");
- assert(_latest_cms_remark_start_to_end_time_secs >= 0.0,
- "Bad remark pause");
- double STW_time_in_seconds =
- _latest_cms_initial_mark_start_to_end_time_secs +
- _latest_cms_remark_start_to_end_time_secs;
- double STW_collection_cost = 0.0;
- if (interval_in_seconds > 0.0) {
- // cost for the STW phases of the concurrent collection.
- STW_collection_cost = STW_time_in_seconds / interval_in_seconds;
- avg_cms_STW_gc_cost()->sample(STW_collection_cost);
- }
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print("cmsAdaptiveSizePolicy::STW_collection_end: "
- "STW gc cost: %f average: %f", STW_collection_cost,
- avg_cms_STW_gc_cost()->average());
- gclog_or_tty->print_cr(" STW pause: %f (ms) STW period %f (ms)",
- (double) STW_time_in_seconds * MILLIUNITS,
- (double) interval_in_seconds * MILLIUNITS);
- }
-
- double concurrent_cost = 0.0;
- if (latest_cms_sum_concurrent_phases_time_secs > 0.0) {
- concurrent_cost = concurrent_collection_cost(interval_in_seconds);
-
- avg_concurrent_gc_cost()->sample(concurrent_cost);
- // Average this ms cost into all the other types gc costs
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print("cmsAdaptiveSizePolicy::concurrent_phases_end: "
- "concurrent gc cost: %f average: %f",
- concurrent_cost,
- _avg_concurrent_gc_cost->average());
- gclog_or_tty->print_cr(" concurrent time: %f (ms) cms period %f (ms)"
- " processor fraction: %f",
- latest_cms_sum_concurrent_phases_time_secs * MILLIUNITS,
- interval_in_seconds * MILLIUNITS,
- concurrent_processor_fraction());
- }
- }
- double total_collection_cost = STW_collection_cost + concurrent_cost;
- avg_major_gc_cost()->sample(total_collection_cost);
-
- // Gather information for estimating future behavior
- double initial_pause_in_ms = _latest_cms_initial_mark_start_to_end_time_secs * MILLIUNITS;
- double remark_pause_in_ms = _latest_cms_remark_start_to_end_time_secs * MILLIUNITS;
-
- double cur_promo_size_in_mbytes = ((double)cur_promo)/((double)M);
- initial_pause_old_estimator()->update(cur_promo_size_in_mbytes,
- initial_pause_in_ms);
- remark_pause_old_estimator()->update(cur_promo_size_in_mbytes,
- remark_pause_in_ms);
- major_collection_estimator()->update(cur_promo_size_in_mbytes,
- total_collection_cost);
-
- // This estimate uses the average eden size. It could also
- // have used the latest eden size. Which is better?
- double cur_eden_size_in_mbytes = ((double)cur_eden)/((double) M);
- initial_pause_young_estimator()->update(cur_eden_size_in_mbytes,
- initial_pause_in_ms);
- remark_pause_young_estimator()->update(cur_eden_size_in_mbytes,
- remark_pause_in_ms);
- }
-
- clear_internal_time_intervals();
-
- set_first_after_collection();
-
- // The concurrent phases keeps track of it's own mutator interval
- // with this timer. This allows the stop-the-world phase to
- // be included in the mutator time so that the stop-the-world time
- // is not double counted. Reset and start it.
- _concurrent_timer.reset();
- _concurrent_timer.start();
-
- // The mutator time between STW phases does not include the
- // concurrent collection time.
- _STW_timer.reset();
- _STW_timer.start();
-}
-
-void CMSAdaptiveSizePolicy::checkpoint_roots_initial_begin() {
- // Update the interval time
- _STW_timer.stop();
- _latest_cms_reset_end_to_initial_mark_start_secs = _STW_timer.seconds();
- // Reset for the initial mark
- _STW_timer.reset();
- _STW_timer.start();
-}
-
-void CMSAdaptiveSizePolicy::checkpoint_roots_initial_end(
- GCCause::Cause gc_cause) {
- _STW_timer.stop();
-
- if (gc_cause != GCCause::_java_lang_system_gc ||
- UseAdaptiveSizePolicyWithSystemGC) {
- _latest_cms_initial_mark_start_to_end_time_secs = _STW_timer.seconds();
- avg_initial_pause()->sample(_latest_cms_initial_mark_start_to_end_time_secs);
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print(
- "cmsAdaptiveSizePolicy::checkpoint_roots_initial_end: "
- "initial pause: %f ", _latest_cms_initial_mark_start_to_end_time_secs);
- }
- }
-
- _STW_timer.reset();
- _STW_timer.start();
-}
-
-void CMSAdaptiveSizePolicy::checkpoint_roots_final_begin() {
- _STW_timer.stop();
- _latest_cms_initial_mark_end_to_remark_start_secs = _STW_timer.seconds();
- // Start accumulating time for the remark in the STW timer.
- _STW_timer.reset();
- _STW_timer.start();
-}
-
-void CMSAdaptiveSizePolicy::checkpoint_roots_final_end(
- GCCause::Cause gc_cause) {
- _STW_timer.stop();
- if (gc_cause != GCCause::_java_lang_system_gc ||
- UseAdaptiveSizePolicyWithSystemGC) {
- // Total initial mark pause + remark pause.
- _latest_cms_remark_start_to_end_time_secs = _STW_timer.seconds();
- double STW_time_in_seconds = _latest_cms_initial_mark_start_to_end_time_secs +
- _latest_cms_remark_start_to_end_time_secs;
- double STW_time_in_ms = STW_time_in_seconds * MILLIUNITS;
-
- avg_remark_pause()->sample(_latest_cms_remark_start_to_end_time_secs);
-
- // Sample total for initial mark + remark
- avg_cms_STW_time()->sample(STW_time_in_seconds);
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print("cmsAdaptiveSizePolicy::checkpoint_roots_final_end: "
- "remark pause: %f", _latest_cms_remark_start_to_end_time_secs);
- }
-
- }
- // Don't start the STW times here because the concurrent
- // sweep and reset has not happened.
- // Keep the old comment above in case I don't understand
- // what is going on but now
- // Start the STW timer because it is used by ms_collection_begin()
- // and ms_collection_end() to get the sweep time if a MS is being
- // done in the foreground.
- _STW_timer.reset();
- _STW_timer.start();
-}
-
-void CMSAdaptiveSizePolicy::msc_collection_begin() {
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print(" ");
- gclog_or_tty->stamp();
- gclog_or_tty->print(": msc_collection_begin ");
- }
- _STW_timer.stop();
- _latest_cms_msc_end_to_msc_start_time_secs = _STW_timer.seconds();
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr("CMSAdaptiveSizePolicy::msc_collection_begin: "
- "mutator time %f",
- _latest_cms_msc_end_to_msc_start_time_secs);
- }
- avg_msc_interval()->sample(_latest_cms_msc_end_to_msc_start_time_secs);
- _STW_timer.reset();
- _STW_timer.start();
-}
-
-void CMSAdaptiveSizePolicy::msc_collection_end(GCCause::Cause gc_cause) {
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print(" ");
- gclog_or_tty->stamp();
- gclog_or_tty->print(": msc_collection_end ");
- }
- _STW_timer.stop();
- if (gc_cause != GCCause::_java_lang_system_gc ||
- UseAdaptiveSizePolicyWithSystemGC) {
- double msc_pause_in_seconds = _STW_timer.seconds();
- if ((_latest_cms_msc_end_to_msc_start_time_secs > 0.0) &&
- (msc_pause_in_seconds > 0.0)) {
- avg_msc_pause()->sample(msc_pause_in_seconds);
- double mutator_time_in_seconds = 0.0;
- if (_latest_cms_collection_end_to_collection_start_secs == 0.0) {
- // This assertion may fail because of time stamp granularity.
- // Comment it out and investigate it at a later time. The large
- // time stamp granularity occurs on some older linux systems.
-#ifndef CLOCK_GRANULARITY_TOO_LARGE
- assert((_latest_cms_concurrent_marking_time_secs == 0.0) &&
- (_latest_cms_concurrent_precleaning_time_secs == 0.0) &&
- (_latest_cms_concurrent_sweeping_time_secs == 0.0),
- "There should not be any concurrent time");
-#endif
- // A concurrent collection did not start. Mutator time
- // between collections comes from the STW MSC timer.
- mutator_time_in_seconds = _latest_cms_msc_end_to_msc_start_time_secs;
- } else {
- // The concurrent collection did start so count the mutator
- // time to the start of the concurrent collection. In this
- // case the _latest_cms_msc_end_to_msc_start_time_secs measures
- // the time between the initial mark or remark and the
- // start of the MSC. That has no real meaning.
- mutator_time_in_seconds = _latest_cms_collection_end_to_collection_start_secs;
- }
-
- double latest_cms_sum_concurrent_phases_time_secs =
- concurrent_collection_time();
- double interval_in_seconds =
- mutator_time_in_seconds +
- _latest_cms_initial_mark_start_to_end_time_secs +
- _latest_cms_remark_start_to_end_time_secs +
- latest_cms_sum_concurrent_phases_time_secs +
- msc_pause_in_seconds;
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(" interval_in_seconds %f \n"
- " mutator_time_in_seconds %f \n"
- " _latest_cms_initial_mark_start_to_end_time_secs %f\n"
- " _latest_cms_remark_start_to_end_time_secs %f\n"
- " latest_cms_sum_concurrent_phases_time_secs %f\n"
- " msc_pause_in_seconds %f\n",
- interval_in_seconds,
- mutator_time_in_seconds,
- _latest_cms_initial_mark_start_to_end_time_secs,
- _latest_cms_remark_start_to_end_time_secs,
- latest_cms_sum_concurrent_phases_time_secs,
- msc_pause_in_seconds);
- }
-
- // The concurrent cost is wasted cost but it should be
- // included.
- double concurrent_cost = concurrent_collection_cost(interval_in_seconds);
-
- // Initial mark and remark, also wasted.
- double STW_time_in_seconds = _latest_cms_initial_mark_start_to_end_time_secs +
- _latest_cms_remark_start_to_end_time_secs;
- double STW_collection_cost =
- collection_cost(STW_time_in_seconds, interval_in_seconds) +
- concurrent_cost;
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(" msc_collection_end:\n"
- "_latest_cms_collection_end_to_collection_start_secs %f\n"
- "_latest_cms_msc_end_to_msc_start_time_secs %f\n"
- "_latest_cms_initial_mark_start_to_end_time_secs %f\n"
- "_latest_cms_remark_start_to_end_time_secs %f\n"
- "latest_cms_sum_concurrent_phases_time_secs %f\n",
- _latest_cms_collection_end_to_collection_start_secs,
- _latest_cms_msc_end_to_msc_start_time_secs,
- _latest_cms_initial_mark_start_to_end_time_secs,
- _latest_cms_remark_start_to_end_time_secs,
- latest_cms_sum_concurrent_phases_time_secs);
-
- gclog_or_tty->print_cr(" msc_collection_end: \n"
- "latest_cms_sum_concurrent_phases_time_secs %f\n"
- "STW_time_in_seconds %f\n"
- "msc_pause_in_seconds %f\n",
- latest_cms_sum_concurrent_phases_time_secs,
- STW_time_in_seconds,
- msc_pause_in_seconds);
- }
-
- double cost = concurrent_cost + STW_collection_cost +
- collection_cost(msc_pause_in_seconds, interval_in_seconds);
-
- _avg_msc_gc_cost->sample(cost);
-
- // Average this ms cost into all the other types gc costs
- avg_major_gc_cost()->sample(cost);
-
- // Sample for performance counter
- _avg_msc_interval->sample(interval_in_seconds);
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print("cmsAdaptiveSizePolicy::msc_collection_end: "
- "MSC gc cost: %f average: %f", cost,
- _avg_msc_gc_cost->average());
-
- double msc_pause_in_ms = msc_pause_in_seconds * MILLIUNITS;
- gclog_or_tty->print_cr(" MSC pause: %f (ms) MSC period %f (ms)",
- msc_pause_in_ms, (double) interval_in_seconds * MILLIUNITS);
- }
- }
- }
-
- clear_internal_time_intervals();
-
- // Can this call be put into the epilogue?
- set_first_after_collection();
-
- // The concurrent phases keeps track of it's own mutator interval
- // with this timer. This allows the stop-the-world phase to
- // be included in the mutator time so that the stop-the-world time
- // is not double counted. Reset and start it.
- _concurrent_timer.stop();
- _concurrent_timer.reset();
- _concurrent_timer.start();
-
- _STW_timer.reset();
- _STW_timer.start();
-}
-
-void CMSAdaptiveSizePolicy::ms_collection_begin() {
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print(" ");
- gclog_or_tty->stamp();
- gclog_or_tty->print(": ms_collection_begin ");
- }
- _STW_timer.stop();
- _latest_cms_ms_end_to_ms_start = _STW_timer.seconds();
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr("CMSAdaptiveSizePolicy::ms_collection_begin: "
- "mutator time %f",
- _latest_cms_ms_end_to_ms_start);
- }
- avg_ms_interval()->sample(_STW_timer.seconds());
- _STW_timer.reset();
- _STW_timer.start();
-}
-
-void CMSAdaptiveSizePolicy::ms_collection_end(GCCause::Cause gc_cause) {
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print(" ");
- gclog_or_tty->stamp();
- gclog_or_tty->print(": ms_collection_end ");
- }
- _STW_timer.stop();
- if (gc_cause != GCCause::_java_lang_system_gc ||
- UseAdaptiveSizePolicyWithSystemGC) {
- // The MS collection is a foreground collection that does all
- // the parts of a mostly concurrent collection.
- //
- // For this collection include the cost of the
- // initial mark
- // remark
- // all concurrent time (scaled down by the
- // concurrent_processor_fraction). Some
- // may be zero if the baton was passed before
- // it was reached.
- // concurrent marking
- // sweeping
- // resetting
- // STW after baton was passed (STW_in_foreground_in_seconds)
- double STW_in_foreground_in_seconds = _STW_timer.seconds();
-
- double latest_cms_sum_concurrent_phases_time_secs =
- concurrent_collection_time();
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr("\nCMSAdaptiveSizePolicy::ms_collection_end "
- "STW_in_foreground_in_seconds %f "
- "_latest_cms_initial_mark_start_to_end_time_secs %f "
- "_latest_cms_remark_start_to_end_time_secs %f "
- "latest_cms_sum_concurrent_phases_time_secs %f "
- "_latest_cms_ms_marking_start_to_end_time_secs %f "
- "_latest_cms_ms_end_to_ms_start %f",
- STW_in_foreground_in_seconds,
- _latest_cms_initial_mark_start_to_end_time_secs,
- _latest_cms_remark_start_to_end_time_secs,
- latest_cms_sum_concurrent_phases_time_secs,
- _latest_cms_ms_marking_start_to_end_time_secs,
- _latest_cms_ms_end_to_ms_start);
- }
-
- double STW_marking_in_seconds = _latest_cms_initial_mark_start_to_end_time_secs +
- _latest_cms_remark_start_to_end_time_secs;
-#ifndef CLOCK_GRANULARITY_TOO_LARGE
- assert(_latest_cms_ms_marking_start_to_end_time_secs == 0.0 ||
- latest_cms_sum_concurrent_phases_time_secs == 0.0,
- "marking done twice?");
-#endif
- double ms_time_in_seconds = STW_marking_in_seconds +
- STW_in_foreground_in_seconds +
- _latest_cms_ms_marking_start_to_end_time_secs +
- scaled_concurrent_collection_time();
- avg_ms_pause()->sample(ms_time_in_seconds);
- // Use the STW costs from the initial mark and remark plus
- // the cost of the concurrent phase to calculate a
- // collection cost.
- double cost = 0.0;
- if ((_latest_cms_ms_end_to_ms_start > 0.0) &&
- (ms_time_in_seconds > 0.0)) {
- double interval_in_seconds =
- _latest_cms_ms_end_to_ms_start + ms_time_in_seconds;
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr("\n ms_time_in_seconds %f "
- "latest_cms_sum_concurrent_phases_time_secs %f "
- "interval_in_seconds %f",
- ms_time_in_seconds,
- latest_cms_sum_concurrent_phases_time_secs,
- interval_in_seconds);
- }
-
- cost = collection_cost(ms_time_in_seconds, interval_in_seconds);
-
- _avg_ms_gc_cost->sample(cost);
- // Average this ms cost into all the other types gc costs
- avg_major_gc_cost()->sample(cost);
-
- // Sample for performance counter
- _avg_ms_interval->sample(interval_in_seconds);
- }
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print("cmsAdaptiveSizePolicy::ms_collection_end: "
- "MS gc cost: %f average: %f", cost, _avg_ms_gc_cost->average());
-
- double ms_time_in_ms = ms_time_in_seconds * MILLIUNITS;
- gclog_or_tty->print_cr(" MS pause: %f (ms) MS period %f (ms)",
- ms_time_in_ms,
- _latest_cms_ms_end_to_ms_start * MILLIUNITS);
- }
- }
-
- // Consider putting this code (here to end) into a
- // method for convenience.
- clear_internal_time_intervals();
-
- set_first_after_collection();
-
- // The concurrent phases keeps track of it's own mutator interval
- // with this timer. This allows the stop-the-world phase to
- // be included in the mutator time so that the stop-the-world time
- // is not double counted. Reset and start it.
- _concurrent_timer.stop();
- _concurrent_timer.reset();
- _concurrent_timer.start();
-
- _STW_timer.reset();
- _STW_timer.start();
-}
-
-void CMSAdaptiveSizePolicy::clear_internal_time_intervals() {
- _latest_cms_reset_end_to_initial_mark_start_secs = 0.0;
- _latest_cms_initial_mark_end_to_remark_start_secs = 0.0;
- _latest_cms_collection_end_to_collection_start_secs = 0.0;
- _latest_cms_concurrent_marking_time_secs = 0.0;
- _latest_cms_concurrent_precleaning_time_secs = 0.0;
- _latest_cms_concurrent_sweeping_time_secs = 0.0;
- _latest_cms_msc_end_to_msc_start_time_secs = 0.0;
- _latest_cms_ms_end_to_ms_start = 0.0;
- _latest_cms_remark_start_to_end_time_secs = 0.0;
- _latest_cms_initial_mark_start_to_end_time_secs = 0.0;
- _latest_cms_ms_marking_start_to_end_time_secs = 0.0;
-}
-
-void CMSAdaptiveSizePolicy::clear_generation_free_space_flags() {
- AdaptiveSizePolicy::clear_generation_free_space_flags();
-
- set_change_young_gen_for_maj_pauses(0);
-}
-
-void CMSAdaptiveSizePolicy::concurrent_phases_resume() {
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->stamp();
- gclog_or_tty->print_cr("CMSAdaptiveSizePolicy::concurrent_phases_resume()");
- }
- _concurrent_timer.start();
-}
-
-double CMSAdaptiveSizePolicy::time_since_major_gc() const {
- _concurrent_timer.stop();
- double time_since_cms_gc = _concurrent_timer.seconds();
- _concurrent_timer.start();
- _STW_timer.stop();
- double time_since_STW_gc = _STW_timer.seconds();
- _STW_timer.start();
-
- return MIN2(time_since_cms_gc, time_since_STW_gc);
-}
-
-double CMSAdaptiveSizePolicy::major_gc_interval_average_for_decay() const {
- double cms_interval = _avg_concurrent_interval->average();
- double msc_interval = _avg_msc_interval->average();
- double ms_interval = _avg_ms_interval->average();
-
- return MAX3(cms_interval, msc_interval, ms_interval);
-}
-
-double CMSAdaptiveSizePolicy::cms_gc_cost() const {
- return avg_major_gc_cost()->average();
-}
-
-void CMSAdaptiveSizePolicy::ms_collection_marking_begin() {
- _STW_timer.stop();
- // Start accumulating time for the marking in the STW timer.
- _STW_timer.reset();
- _STW_timer.start();
-}
-
-void CMSAdaptiveSizePolicy::ms_collection_marking_end(
- GCCause::Cause gc_cause) {
- _STW_timer.stop();
- if (gc_cause != GCCause::_java_lang_system_gc ||
- UseAdaptiveSizePolicyWithSystemGC) {
- _latest_cms_ms_marking_start_to_end_time_secs = _STW_timer.seconds();
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr("CMSAdaptiveSizePolicy::"
- "msc_collection_marking_end: mutator time %f",
- _latest_cms_ms_marking_start_to_end_time_secs);
- }
- }
- _STW_timer.reset();
- _STW_timer.start();
-}
-
-double CMSAdaptiveSizePolicy::gc_cost() const {
- double cms_gen_cost = cms_gc_cost();
- double result = MIN2(1.0, minor_gc_cost() + cms_gen_cost);
- assert(result >= 0.0, "Both minor and major costs are non-negative");
- return result;
-}
-
-// Cost of collection (unit-less)
-double CMSAdaptiveSizePolicy::collection_cost(double pause_in_seconds,
- double interval_in_seconds) {
- // Cost of collection (unit-less)
- double cost = 0.0;
- if ((interval_in_seconds > 0.0) &&
- (pause_in_seconds > 0.0)) {
- cost =
- pause_in_seconds / interval_in_seconds;
- }
- return cost;
-}
-
-size_t CMSAdaptiveSizePolicy::adjust_eden_for_pause_time(size_t cur_eden) {
- size_t change = 0;
- size_t desired_eden = cur_eden;
-
- // reduce eden size
- change = eden_decrement_aligned_down(cur_eden);
- desired_eden = cur_eden - change;
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(
- "CMSAdaptiveSizePolicy::adjust_eden_for_pause_time "
- "adjusting eden for pause time. "
- " starting eden size " SIZE_FORMAT
- " reduced eden size " SIZE_FORMAT
- " eden delta " SIZE_FORMAT,
- cur_eden, desired_eden, change);
- }
-
- return desired_eden;
-}
-
-size_t CMSAdaptiveSizePolicy::adjust_eden_for_throughput(size_t cur_eden) {
-
- size_t desired_eden = cur_eden;
-
- set_change_young_gen_for_throughput(increase_young_gen_for_througput_true);
-
- size_t change = eden_increment_aligned_up(cur_eden);
- size_t scaled_change = scale_by_gen_gc_cost(change, minor_gc_cost());
-
- if (cur_eden + scaled_change > cur_eden) {
- desired_eden = cur_eden + scaled_change;
- }
-
- _young_gen_change_for_minor_throughput++;
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(
- "CMSAdaptiveSizePolicy::adjust_eden_for_throughput "
- "adjusting eden for throughput. "
- " starting eden size " SIZE_FORMAT
- " increased eden size " SIZE_FORMAT
- " eden delta " SIZE_FORMAT,
- cur_eden, desired_eden, scaled_change);
- }
-
- return desired_eden;
-}
-
-size_t CMSAdaptiveSizePolicy::adjust_eden_for_footprint(size_t cur_eden) {
-
- set_decrease_for_footprint(decrease_young_gen_for_footprint_true);
-
- size_t change = eden_decrement(cur_eden);
- size_t desired_eden_size = cur_eden - change;
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(
- "CMSAdaptiveSizePolicy::adjust_eden_for_footprint "
- "adjusting eden for footprint. "
- " starting eden size " SIZE_FORMAT
- " reduced eden size " SIZE_FORMAT
- " eden delta " SIZE_FORMAT,
- cur_eden, desired_eden_size, change);
- }
- return desired_eden_size;
-}
-
-// The eden and promo versions should be combined if possible.
-// They are the same except that the sizes of the decrement
-// and increment are different for eden and promo.
-size_t CMSAdaptiveSizePolicy::eden_decrement_aligned_down(size_t cur_eden) {
- size_t delta = eden_decrement(cur_eden);
- return align_size_down(delta, generation_alignment());
-}
-
-size_t CMSAdaptiveSizePolicy::eden_increment_aligned_up(size_t cur_eden) {
- size_t delta = eden_increment(cur_eden);
- return align_size_up(delta, generation_alignment());
-}
-
-size_t CMSAdaptiveSizePolicy::promo_decrement_aligned_down(size_t cur_promo) {
- size_t delta = promo_decrement(cur_promo);
- return align_size_down(delta, generation_alignment());
-}
-
-size_t CMSAdaptiveSizePolicy::promo_increment_aligned_up(size_t cur_promo) {
- size_t delta = promo_increment(cur_promo);
- return align_size_up(delta, generation_alignment());
-}
-
-
-void CMSAdaptiveSizePolicy::compute_eden_space_size(size_t cur_eden,
- size_t max_eden_size)
-{
- size_t desired_eden_size = cur_eden;
- size_t eden_limit = max_eden_size;
-
- // Printout input
- if (PrintGC && PrintAdaptiveSizePolicy) {
- gclog_or_tty->print_cr(
- "CMSAdaptiveSizePolicy::compute_eden_space_size: "
- "cur_eden " SIZE_FORMAT,
- cur_eden);
- }
-
- // Used for diagnostics
- clear_generation_free_space_flags();
-
- if (_avg_minor_pause->padded_average() > gc_pause_goal_sec()) {
- if (minor_pause_young_estimator()->decrement_will_decrease()) {
- // If the minor pause is too long, shrink the young gen.
- set_change_young_gen_for_min_pauses(
- decrease_young_gen_for_min_pauses_true);
- desired_eden_size = adjust_eden_for_pause_time(desired_eden_size);
- }
- } else if ((avg_remark_pause()->padded_average() > gc_pause_goal_sec()) ||
- (avg_initial_pause()->padded_average() > gc_pause_goal_sec())) {
- // The remark or initial pauses are not meeting the goal. Should
- // the generation be shrunk?
- if (get_and_clear_first_after_collection() &&
- ((avg_remark_pause()->padded_average() > gc_pause_goal_sec() &&
- remark_pause_young_estimator()->decrement_will_decrease()) ||
- (avg_initial_pause()->padded_average() > gc_pause_goal_sec() &&
- initial_pause_young_estimator()->decrement_will_decrease()))) {
-
- set_change_young_gen_for_maj_pauses(
- decrease_young_gen_for_maj_pauses_true);
-
- // If the remark or initial pause is too long and this is the
- // first young gen collection after a cms collection, shrink
- // the young gen.
- desired_eden_size = adjust_eden_for_pause_time(desired_eden_size);
- }
- // If not the first young gen collection after a cms collection,
- // don't do anything. In this case an adjustment has already
- // been made and the results of the adjustment has not yet been
- // measured.
- } else if ((minor_gc_cost() >= 0.0) &&
- (adjusted_mutator_cost() < _throughput_goal)) {
- desired_eden_size = adjust_eden_for_throughput(desired_eden_size);
- } else {
- desired_eden_size = adjust_eden_for_footprint(desired_eden_size);
- }
-
- if (PrintGC && PrintAdaptiveSizePolicy) {
- gclog_or_tty->print_cr(
- "CMSAdaptiveSizePolicy::compute_eden_space_size limits:"
- " desired_eden_size: " SIZE_FORMAT
- " old_eden_size: " SIZE_FORMAT,
- desired_eden_size, cur_eden);
- }
-
- set_eden_size(desired_eden_size);
-}
-
-size_t CMSAdaptiveSizePolicy::adjust_promo_for_pause_time(size_t cur_promo) {
- size_t change = 0;
- size_t desired_promo = cur_promo;
- // Move this test up to caller like the adjust_eden_for_pause_time()
- // call.
- if ((AdaptiveSizePausePolicy == 0) &&
- ((avg_remark_pause()->padded_average() > gc_pause_goal_sec()) ||
- (avg_initial_pause()->padded_average() > gc_pause_goal_sec()))) {
- set_change_old_gen_for_maj_pauses(decrease_old_gen_for_maj_pauses_true);
- change = promo_decrement_aligned_down(cur_promo);
- desired_promo = cur_promo - change;
- } else if ((AdaptiveSizePausePolicy > 0) &&
- (((avg_remark_pause()->padded_average() > gc_pause_goal_sec()) &&
- remark_pause_old_estimator()->decrement_will_decrease()) ||
- ((avg_initial_pause()->padded_average() > gc_pause_goal_sec()) &&
- initial_pause_old_estimator()->decrement_will_decrease()))) {
- set_change_old_gen_for_maj_pauses(decrease_old_gen_for_maj_pauses_true);
- change = promo_decrement_aligned_down(cur_promo);
- desired_promo = cur_promo - change;
- }
-
- if ((change != 0) &&PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(
- "CMSAdaptiveSizePolicy::adjust_promo_for_pause_time "
- "adjusting promo for pause time. "
- " starting promo size " SIZE_FORMAT
- " reduced promo size " SIZE_FORMAT
- " promo delta " SIZE_FORMAT,
- cur_promo, desired_promo, change);
- }
-
- return desired_promo;
-}
-
-// Try to share this with PS.
-size_t CMSAdaptiveSizePolicy::scale_by_gen_gc_cost(size_t base_change,
- double gen_gc_cost) {
-
- // Calculate the change to use for the tenured gen.
- size_t scaled_change = 0;
- // Can the increment to the generation be scaled?
- if (gc_cost() >= 0.0 && gen_gc_cost >= 0.0) {
- double scale_by_ratio = gen_gc_cost / gc_cost();
- scaled_change =
- (size_t) (scale_by_ratio * (double) base_change);
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(
- "Scaled tenured increment: " SIZE_FORMAT " by %f down to "
- SIZE_FORMAT,
- base_change, scale_by_ratio, scaled_change);
- }
- } else if (gen_gc_cost >= 0.0) {
- // Scaling is not going to work. If the major gc time is the
- // larger than the other GC costs, give it a full increment.
- if (gen_gc_cost >= (gc_cost() - gen_gc_cost)) {
- scaled_change = base_change;
- }
- } else {
- // Don't expect to get here but it's ok if it does
- // in the product build since the delta will be 0
- // and nothing will change.
- assert(false, "Unexpected value for gc costs");
- }
-
- return scaled_change;
-}
-
-size_t CMSAdaptiveSizePolicy::adjust_promo_for_throughput(size_t cur_promo) {
-
- size_t desired_promo = cur_promo;
-
- set_change_old_gen_for_throughput(increase_old_gen_for_throughput_true);
-
- size_t change = promo_increment_aligned_up(cur_promo);
- size_t scaled_change = scale_by_gen_gc_cost(change, major_gc_cost());
-
- if (cur_promo + scaled_change > cur_promo) {
- desired_promo = cur_promo + scaled_change;
- }
-
- _old_gen_change_for_major_throughput++;
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(
- "CMSAdaptiveSizePolicy::adjust_promo_for_throughput "
- "adjusting promo for throughput. "
- " starting promo size " SIZE_FORMAT
- " increased promo size " SIZE_FORMAT
- " promo delta " SIZE_FORMAT,
- cur_promo, desired_promo, scaled_change);
- }
-
- return desired_promo;
-}
-
-size_t CMSAdaptiveSizePolicy::adjust_promo_for_footprint(size_t cur_promo,
- size_t cur_eden) {
-
- set_decrease_for_footprint(decrease_young_gen_for_footprint_true);
-
- size_t change = promo_decrement(cur_promo);
- size_t desired_promo_size = cur_promo - change;
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(
- "CMSAdaptiveSizePolicy::adjust_promo_for_footprint "
- "adjusting promo for footprint. "
- " starting promo size " SIZE_FORMAT
- " reduced promo size " SIZE_FORMAT
- " promo delta " SIZE_FORMAT,
- cur_promo, desired_promo_size, change);
- }
- return desired_promo_size;
-}
-
-void CMSAdaptiveSizePolicy::compute_tenured_generation_free_space(
- size_t cur_tenured_free,
- size_t max_tenured_available,
- size_t cur_eden) {
- // This can be bad if the desired value grows/shrinks without
- // any connection to the read free space
- size_t desired_promo_size = promo_size();
- size_t tenured_limit = max_tenured_available;
-
- // Printout input
- if (PrintGC && PrintAdaptiveSizePolicy) {
- gclog_or_tty->print_cr(
- "CMSAdaptiveSizePolicy::compute_tenured_generation_free_space: "
- "cur_tenured_free " SIZE_FORMAT
- " max_tenured_available " SIZE_FORMAT,
- cur_tenured_free, max_tenured_available);
- }
-
- // Used for diagnostics
- clear_generation_free_space_flags();
-
- set_decide_at_full_gc(decide_at_full_gc_true);
- if (avg_remark_pause()->padded_average() > gc_pause_goal_sec() ||
- avg_initial_pause()->padded_average() > gc_pause_goal_sec()) {
- desired_promo_size = adjust_promo_for_pause_time(cur_tenured_free);
- } else if (avg_minor_pause()->padded_average() > gc_pause_goal_sec()) {
- // Nothing to do since the minor collections are too large and
- // this method only deals with the cms generation.
- } else if ((cms_gc_cost() >= 0.0) &&
- (adjusted_mutator_cost() < _throughput_goal)) {
- desired_promo_size = adjust_promo_for_throughput(cur_tenured_free);
- } else {
- desired_promo_size = adjust_promo_for_footprint(cur_tenured_free,
- cur_eden);
- }
-
- if (PrintGC && PrintAdaptiveSizePolicy) {
- gclog_or_tty->print_cr(
- "CMSAdaptiveSizePolicy::compute_tenured_generation_free_space limits:"
- " desired_promo_size: " SIZE_FORMAT
- " old_promo_size: " SIZE_FORMAT,
- desired_promo_size, cur_tenured_free);
- }
-
- set_promo_size(desired_promo_size);
-}
-
-uint CMSAdaptiveSizePolicy::compute_survivor_space_size_and_threshold(
- bool is_survivor_overflow,
- uint tenuring_threshold,
- size_t survivor_limit) {
- assert(survivor_limit >= generation_alignment(),
- "survivor_limit too small");
- assert((size_t)align_size_down(survivor_limit, generation_alignment())
- == survivor_limit, "survivor_limit not aligned");
-
- // Change UsePSAdaptiveSurvivorSizePolicy -> UseAdaptiveSurvivorSizePolicy?
- if (!UsePSAdaptiveSurvivorSizePolicy ||
- !young_gen_policy_is_ready()) {
- return tenuring_threshold;
- }
-
- // We'll decide whether to increase or decrease the tenuring
- // threshold based partly on the newly computed survivor size
- // (if we hit the maximum limit allowed, we'll always choose to
- // decrement the threshold).
- bool incr_tenuring_threshold = false;
- bool decr_tenuring_threshold = false;
-
- set_decrement_tenuring_threshold_for_gc_cost(false);
- set_increment_tenuring_threshold_for_gc_cost(false);
- set_decrement_tenuring_threshold_for_survivor_limit(false);
-
- if (!is_survivor_overflow) {
- // Keep running averages on how much survived
-
- // We use the tenuring threshold to equalize the cost of major
- // and minor collections.
- // ThresholdTolerance is used to indicate how sensitive the
- // tenuring threshold is to differences in cost between the
- // collection types.
-
- // Get the times of interest. This involves a little work, so
- // we cache the values here.
- const double major_cost = major_gc_cost();
- const double minor_cost = minor_gc_cost();
-
- if (minor_cost > major_cost * _threshold_tolerance_percent) {
- // Minor times are getting too long; lower the threshold so
- // less survives and more is promoted.
- decr_tenuring_threshold = true;
- set_decrement_tenuring_threshold_for_gc_cost(true);
- } else if (major_cost > minor_cost * _threshold_tolerance_percent) {
- // Major times are too long, so we want less promotion.
- incr_tenuring_threshold = true;
- set_increment_tenuring_threshold_for_gc_cost(true);
- }
-
- } else {
- // Survivor space overflow occurred, so promoted and survived are
- // not accurate. We'll make our best guess by combining survived
- // and promoted and count them as survivors.
- //
- // We'll lower the tenuring threshold to see if we can correct
- // things. Also, set the survivor size conservatively. We're
- // trying to avoid many overflows from occurring if defnew size
- // is just too small.
-
- decr_tenuring_threshold = true;
- }
-
- // The padded average also maintains a deviation from the average;
- // we use this to see how good of an estimate we have of what survived.
- // We're trying to pad the survivor size as little as possible without
- // overflowing the survivor spaces.
- size_t target_size = align_size_up((size_t)_avg_survived->padded_average(),
- generation_alignment());
- target_size = MAX2(target_size, generation_alignment());
-
- if (target_size > survivor_limit) {
- // Target size is bigger than we can handle. Let's also reduce
- // the tenuring threshold.
- target_size = survivor_limit;
- decr_tenuring_threshold = true;
- set_decrement_tenuring_threshold_for_survivor_limit(true);
- }
-
- // Finally, increment or decrement the tenuring threshold, as decided above.
- // We test for decrementing first, as we might have hit the target size
- // limit.
- if (decr_tenuring_threshold && !(AlwaysTenure || NeverTenure)) {
- if (tenuring_threshold > 1) {
- tenuring_threshold--;
- }
- } else if (incr_tenuring_threshold && !(AlwaysTenure || NeverTenure)) {
- if (tenuring_threshold < MaxTenuringThreshold) {
- tenuring_threshold++;
- }
- }
-
- // We keep a running average of the amount promoted which is used
- // to decide when we should collect the old generation (when
- // the amount of old gen free space is less than what we expect to
- // promote).
-
- if (PrintAdaptiveSizePolicy) {
- // A little more detail if Verbose is on
- GenCollectedHeap* gch = GenCollectedHeap::heap();
- if (Verbose) {
- gclog_or_tty->print( " avg_survived: %f"
- " avg_deviation: %f",
- _avg_survived->average(),
- _avg_survived->deviation());
- }
-
- gclog_or_tty->print( " avg_survived_padded_avg: %f",
- _avg_survived->padded_average());
-
- if (Verbose) {
- gclog_or_tty->print( " avg_promoted_avg: %f"
- " avg_promoted_dev: %f",
- gch->gc_stats(1)->avg_promoted()->average(),
- gch->gc_stats(1)->avg_promoted()->deviation());
- }
-
- gclog_or_tty->print( " avg_promoted_padded_avg: %f"
- " avg_pretenured_padded_avg: %f"
- " tenuring_thresh: %u"
- " target_size: " SIZE_FORMAT
- " survivor_limit: " SIZE_FORMAT,
- gch->gc_stats(1)->avg_promoted()->padded_average(),
- _avg_pretenured->padded_average(),
- tenuring_threshold, target_size, survivor_limit);
- gclog_or_tty->cr();
- }
-
- set_survivor_size(target_size);
-
- return tenuring_threshold;
-}
-
-bool CMSAdaptiveSizePolicy::get_and_clear_first_after_collection() {
- bool result = _first_after_collection;
- _first_after_collection = false;
- return result;
-}
-
-bool CMSAdaptiveSizePolicy::print_adaptive_size_policy_on(
- outputStream* st) const {
-
- if (!UseAdaptiveSizePolicy) {
- return false;
- }
-
- GenCollectedHeap* gch = GenCollectedHeap::heap();
- Generation* young = gch->get_gen(0);
- DefNewGeneration* def_new = young->as_DefNewGeneration();
- return AdaptiveSizePolicy::print_adaptive_size_policy_on(
- st,
- def_new->tenuring_threshold());
-}
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp
deleted file mode 100644
index 1bf4ca34cf1..00000000000
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp
+++ /dev/null
@@ -1,477 +0,0 @@
-/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSADAPTIVESIZEPOLICY_HPP
-#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSADAPTIVESIZEPOLICY_HPP
-
-#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
-#include "runtime/timer.hpp"
-
-// This class keeps statistical information and computes the
-// size of the heap for the concurrent mark sweep collector.
-//
-// Cost for garbage collector include cost for
-// minor collection
-// concurrent collection
-// stop-the-world component
-// concurrent component
-// major compacting collection
-// uses decaying cost
-
-// Forward decls
-class elapsedTimer;
-
-class CMSAdaptiveSizePolicy : public AdaptiveSizePolicy {
- friend class CMSGCAdaptivePolicyCounters;
- friend class CMSCollector;
- private:
-
- // Total number of processors available
- int _processor_count;
- // Number of processors used by the concurrent phases of GC
- // This number is assumed to be the same for all concurrent
- // phases.
- int _concurrent_processor_count;
-
- // Time that the mutators run exclusive of a particular
- // phase. For example, the time the mutators run excluding
- // the time during which the cms collector runs concurrently
- // with the mutators.
- // Between end of most recent cms reset and start of initial mark
- // This may be redundant
- double _latest_cms_reset_end_to_initial_mark_start_secs;
- // Between end of the most recent initial mark and start of remark
- double _latest_cms_initial_mark_end_to_remark_start_secs;
- // Between end of most recent collection and start of
- // a concurrent collection
- double _latest_cms_collection_end_to_collection_start_secs;
- // Times of the concurrent phases of the most recent
- // concurrent collection
- double _latest_cms_concurrent_marking_time_secs;
- double _latest_cms_concurrent_precleaning_time_secs;
- double _latest_cms_concurrent_sweeping_time_secs;
- // Between end of most recent STW MSC and start of next STW MSC
- double _latest_cms_msc_end_to_msc_start_time_secs;
- // Between end of most recent MS and start of next MS
- // This does not include any time spent during a concurrent
- // collection.
- double _latest_cms_ms_end_to_ms_start;
- // Between start and end of the initial mark of the most recent
- // concurrent collection.
- double _latest_cms_initial_mark_start_to_end_time_secs;
- // Between start and end of the remark phase of the most recent
- // concurrent collection
- double _latest_cms_remark_start_to_end_time_secs;
- // Between start and end of the most recent MS STW marking phase
- double _latest_cms_ms_marking_start_to_end_time_secs;
-
- // Pause time timers
- static elapsedTimer _STW_timer;
- // Concurrent collection timer. Used for total of all concurrent phases
- // during 1 collection cycle.
- static elapsedTimer _concurrent_timer;
-
- // When the size of the generation is changed, the size
- // of the change will rounded up or down (depending on the
- // type of change) by this value.
- size_t _generation_alignment;
-
- // If this variable is true, the size of the young generation
- // may be changed in order to reduce the pause(s) of the
- // collection of the tenured generation in order to meet the
- // pause time goal. It is common to change the size of the
- // tenured generation in order to meet the pause time goal
- // for the tenured generation. With the CMS collector for
- // the tenured generation, the size of the young generation
- // can have an significant affect on the pause times for collecting the
- // tenured generation.
- // This is a duplicate of a variable in PSAdaptiveSizePolicy. It
- // is duplicated because it is not clear that it is general enough
- // to go into AdaptiveSizePolicy.
- int _change_young_gen_for_maj_pauses;
-
- // Variable that is set to true after a collection.
- bool _first_after_collection;
-
- // Fraction of collections that are of each type
- double concurrent_fraction() const;
- double STW_msc_fraction() const;
- double STW_ms_fraction() const;
-
- // This call cannot be put into the epilogue as long as some
- // of the counters can be set during concurrent phases.
- virtual void clear_generation_free_space_flags();
-
- void set_first_after_collection() { _first_after_collection = true; }
-
- protected:
- // Average of the sum of the concurrent times for
- // one collection in seconds.
- AdaptiveWeightedAverage* _avg_concurrent_time;
- // Average time between concurrent collections in seconds.
- AdaptiveWeightedAverage* _avg_concurrent_interval;
- // Average cost of the concurrent part of a collection
- // in seconds.
- AdaptiveWeightedAverage* _avg_concurrent_gc_cost;
-
- // Average of the initial pause of a concurrent collection in seconds.
- AdaptivePaddedAverage* _avg_initial_pause;
- // Average of the remark pause of a concurrent collection in seconds.
- AdaptivePaddedAverage* _avg_remark_pause;
-
- // Average of the stop-the-world (STW) (initial mark + remark)
- // times in seconds for concurrent collections.
- AdaptiveWeightedAverage* _avg_cms_STW_time;
- // Average of the STW collection cost for concurrent collections.
- AdaptiveWeightedAverage* _avg_cms_STW_gc_cost;
-
- // Average of the bytes free at the start of the sweep.
- AdaptiveWeightedAverage* _avg_cms_free_at_sweep;
- // Average of the bytes free at the end of the collection.
- AdaptiveWeightedAverage* _avg_cms_free;
- // Average of the bytes promoted between cms collections.
- AdaptiveWeightedAverage* _avg_cms_promo;
-
- // stop-the-world (STW) mark-sweep-compact
- // Average of the pause time in seconds for STW mark-sweep-compact
- // collections.
- AdaptiveWeightedAverage* _avg_msc_pause;
- // Average of the interval in seconds between STW mark-sweep-compact
- // collections.
- AdaptiveWeightedAverage* _avg_msc_interval;
- // Average of the collection costs for STW mark-sweep-compact
- // collections.
- AdaptiveWeightedAverage* _avg_msc_gc_cost;
-
- // Averages for mark-sweep collections.
- // The collection may have started as a background collection
- // that completes in a stop-the-world (STW) collection.
- // Average of the pause time in seconds for mark-sweep
- // collections.
- AdaptiveWeightedAverage* _avg_ms_pause;
- // Average of the interval in seconds between mark-sweep
- // collections.
- AdaptiveWeightedAverage* _avg_ms_interval;
- // Average of the collection costs for mark-sweep
- // collections.
- AdaptiveWeightedAverage* _avg_ms_gc_cost;
-
- // These variables contain a linear fit of
- // a generation size as the independent variable
- // and a pause time as the dependent variable.
- // For example _remark_pause_old_estimator
- // is a fit of the old generation size as the
- // independent variable and the remark pause
- // as the dependent variable.
- // remark pause time vs. cms gen size
- LinearLeastSquareFit* _remark_pause_old_estimator;
- // initial pause time vs. cms gen size
- LinearLeastSquareFit* _initial_pause_old_estimator;
- // remark pause time vs. young gen size
- LinearLeastSquareFit* _remark_pause_young_estimator;
- // initial pause time vs. young gen size
- LinearLeastSquareFit* _initial_pause_young_estimator;
-
- // Accessors
- int processor_count() const { return _processor_count; }
- int concurrent_processor_count() const { return _concurrent_processor_count; }
-
- AdaptiveWeightedAverage* avg_concurrent_time() const {
- return _avg_concurrent_time;
- }
-
- AdaptiveWeightedAverage* avg_concurrent_interval() const {
- return _avg_concurrent_interval;
- }
-
- AdaptiveWeightedAverage* avg_concurrent_gc_cost() const {
- return _avg_concurrent_gc_cost;
- }
-
- AdaptiveWeightedAverage* avg_cms_STW_time() const {
- return _avg_cms_STW_time;
- }
-
- AdaptiveWeightedAverage* avg_cms_STW_gc_cost() const {
- return _avg_cms_STW_gc_cost;
- }
-
- AdaptivePaddedAverage* avg_initial_pause() const {
- return _avg_initial_pause;
- }
-
- AdaptivePaddedAverage* avg_remark_pause() const {
- return _avg_remark_pause;
- }
-
- AdaptiveWeightedAverage* avg_cms_free() const {
- return _avg_cms_free;
- }
-
- AdaptiveWeightedAverage* avg_cms_free_at_sweep() const {
- return _avg_cms_free_at_sweep;
- }
-
- AdaptiveWeightedAverage* avg_msc_pause() const {
- return _avg_msc_pause;
- }
-
- AdaptiveWeightedAverage* avg_msc_interval() const {
- return _avg_msc_interval;
- }
-
- AdaptiveWeightedAverage* avg_msc_gc_cost() const {
- return _avg_msc_gc_cost;
- }
-
- AdaptiveWeightedAverage* avg_ms_pause() const {
- return _avg_ms_pause;
- }
-
- AdaptiveWeightedAverage* avg_ms_interval() const {
- return _avg_ms_interval;
- }
-
- AdaptiveWeightedAverage* avg_ms_gc_cost() const {
- return _avg_ms_gc_cost;
- }
-
- LinearLeastSquareFit* remark_pause_old_estimator() {
- return _remark_pause_old_estimator;
- }
- LinearLeastSquareFit* initial_pause_old_estimator() {
- return _initial_pause_old_estimator;
- }
- LinearLeastSquareFit* remark_pause_young_estimator() {
- return _remark_pause_young_estimator;
- }
- LinearLeastSquareFit* initial_pause_young_estimator() {
- return _initial_pause_young_estimator;
- }
-
- // These *slope() methods return the slope
- // m for the linear fit of an independent
- // variable vs. a dependent variable. For
- // example
- // remark_pause = m * old_generation_size + c
- // These may be used to determine if an
- // adjustment should be made to achieve a goal.
- // For example, if remark_pause_old_slope() is
- // positive, a reduction of the old generation
- // size has on average resulted in the reduction
- // of the remark pause.
- float remark_pause_old_slope() {
- return _remark_pause_old_estimator->slope();
- }
-
- float initial_pause_old_slope() {
- return _initial_pause_old_estimator->slope();
- }
-
- float remark_pause_young_slope() {
- return _remark_pause_young_estimator->slope();
- }
-
- float initial_pause_young_slope() {
- return _initial_pause_young_estimator->slope();
- }
-
- // Update estimators
- void update_minor_pause_old_estimator(double minor_pause_in_ms);
-
- // Fraction of processors used by the concurrent phases.
- double concurrent_processor_fraction();
-
- // Returns the total times for the concurrent part of the
- // latest collection in seconds.
- double concurrent_collection_time();
-
- // Return the total times for the concurrent part of the
- // latest collection in seconds where the times of the various
- // concurrent phases are scaled by the processor fraction used
- // during the phase.
- double scaled_concurrent_collection_time();
-
- // Dimensionless concurrent GC cost for all the concurrent phases.
- double concurrent_collection_cost(double interval_in_seconds);
-
- // Dimensionless GC cost
- double collection_cost(double pause_in_seconds, double interval_in_seconds);
-
- virtual GCPolicyKind kind() const { return _gc_cms_adaptive_size_policy; }
-
- virtual double time_since_major_gc() const;
-
- // This returns the maximum average for the concurrent, ms, and
- // msc collections. This is meant to be used for the calculation
- // of the decayed major gc cost and is not in general the
- // average of all the different types of major collections.
- virtual double major_gc_interval_average_for_decay() const;
-
- public:
- CMSAdaptiveSizePolicy(size_t init_eden_size,
- size_t init_promo_size,
- size_t init_survivor_size,
- double max_gc_minor_pause_sec,
- double max_gc_pause_sec,
- uint gc_cost_ratio);
-
- // The timers for the stop-the-world phases measure a total
- // stop-the-world time. The timer is started and stopped
- // for each phase but is only reset after the final checkpoint.
- void checkpoint_roots_initial_begin();
- void checkpoint_roots_initial_end(GCCause::Cause gc_cause);
- void checkpoint_roots_final_begin();
- void checkpoint_roots_final_end(GCCause::Cause gc_cause);
-
- // Methods for gathering information about the
- // concurrent marking phase of the collection.
- // Records the mutator times and
- // resets the concurrent timer.
- void concurrent_marking_begin();
- // Resets concurrent phase timer in the begin methods and
- // saves the time for a phase in the end methods.
- void concurrent_marking_end();
- void concurrent_sweeping_begin();
- void concurrent_sweeping_end();
- // Similar to the above (e.g., concurrent_marking_end()) and
- // is used for both the precleaning an abortable precleaning
- // phases.
- void concurrent_precleaning_begin();
- void concurrent_precleaning_end();
- // Stops the concurrent phases time. Gathers
- // information and resets the timer.
- void concurrent_phases_end(GCCause::Cause gc_cause,
- size_t cur_eden,
- size_t cur_promo);
-
- // Methods for gather information about STW Mark-Sweep-Compact
- void msc_collection_begin();
- void msc_collection_end(GCCause::Cause gc_cause);
-
- // Methods for gather information about Mark-Sweep done
- // in the foreground.
- void ms_collection_begin();
- void ms_collection_end(GCCause::Cause gc_cause);
-
- // Cost for a mark-sweep tenured gen collection done in the foreground
- double ms_gc_cost() const {
- return MAX2(0.0F, _avg_ms_gc_cost->average());
- }
-
- // Cost of collecting the tenured generation. Includes
- // concurrent collection and STW collection costs
- double cms_gc_cost() const;
-
- // Cost of STW mark-sweep-compact tenured gen collection.
- double msc_gc_cost() const {
- return MAX2(0.0F, _avg_msc_gc_cost->average());
- }
-
- //
- double compacting_gc_cost() const {
- double result = MIN2(1.0, minor_gc_cost() + msc_gc_cost());
- assert(result >= 0.0, "Both minor and major costs are non-negative");
- return result;
- }
-
- // Restarts the concurrent phases timer.
- void concurrent_phases_resume();
-
- // Time beginning and end of the marking phase for
- // a synchronous MS collection. A MS collection
- // that finishes in the foreground can have started
- // in the background. These methods capture the
- // completion of the marking (after the initial
- // marking) that is done in the foreground.
- void ms_collection_marking_begin();
- void ms_collection_marking_end(GCCause::Cause gc_cause);
-
- static elapsedTimer* concurrent_timer_ptr() {
- return &_concurrent_timer;
- }
-
- AdaptiveWeightedAverage* avg_cms_promo() const {
- return _avg_cms_promo;
- }
-
- int change_young_gen_for_maj_pauses() {
- return _change_young_gen_for_maj_pauses;
- }
- void set_change_young_gen_for_maj_pauses(int v) {
- _change_young_gen_for_maj_pauses = v;
- }
-
- void clear_internal_time_intervals();
-
-
- // Either calculated_promo_size_in_bytes() or promo_size()
- // should be deleted.
- size_t promo_size() { return _promo_size; }
- void set_promo_size(size_t v) { _promo_size = v; }
-
- // Cost of GC for all types of collections.
- virtual double gc_cost() const;
-
- size_t generation_alignment() { return _generation_alignment; }
-
- virtual void compute_eden_space_size(size_t cur_eden,
- size_t max_eden_size);
- // Calculates new survivor space size; returns a new tenuring threshold
- // value. Stores new survivor size in _survivor_size.
- virtual uint compute_survivor_space_size_and_threshold(
- bool is_survivor_overflow,
- uint tenuring_threshold,
- size_t survivor_limit);
-
- virtual void compute_tenured_generation_free_space(size_t cur_tenured_free,
- size_t max_tenured_available,
- size_t cur_eden);
-
- size_t eden_decrement_aligned_down(size_t cur_eden);
- size_t eden_increment_aligned_up(size_t cur_eden);
-
- size_t adjust_eden_for_pause_time(size_t cur_eden);
- size_t adjust_eden_for_throughput(size_t cur_eden);
- size_t adjust_eden_for_footprint(size_t cur_eden);
-
- size_t promo_decrement_aligned_down(size_t cur_promo);
- size_t promo_increment_aligned_up(size_t cur_promo);
-
- size_t adjust_promo_for_pause_time(size_t cur_promo);
- size_t adjust_promo_for_throughput(size_t cur_promo);
- size_t adjust_promo_for_footprint(size_t cur_promo, size_t cur_eden);
-
- // Scale down the input size by the ratio of the cost to collect the
- // generation to the total GC cost.
- size_t scale_by_gen_gc_cost(size_t base_change, double gen_gc_cost);
-
- // Return the value and clear it.
- bool get_and_clear_first_after_collection();
-
- // Printing support
- virtual bool print_adaptive_size_policy_on(outputStream* st) const;
-};
-
-#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSADAPTIVESIZEPOLICY_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp
index 19d49f039a3..c2df7a29512 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp
@@ -23,9 +23,8 @@
*/
#include "precompiled.hpp"
-#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
+#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
#include "gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp"
-#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp"
#include "gc_implementation/parNew/parNewGeneration.hpp"
#include "gc_implementation/shared/gcPolicyCounters.hpp"
#include "gc_implementation/shared/vmGCOperations.hpp"
@@ -57,25 +56,12 @@ void ConcurrentMarkSweepPolicy::initialize_generations() {
if (_generations == NULL)
vm_exit_during_initialization("Unable to allocate gen spec");
- if (UseParNewGC) {
- if (UseAdaptiveSizePolicy) {
- _generations[0] = new GenerationSpec(Generation::ASParNew,
- _initial_young_size, _max_young_size);
- } else {
- _generations[0] = new GenerationSpec(Generation::ParNew,
- _initial_young_size, _max_young_size);
- }
- } else {
- _generations[0] = new GenerationSpec(Generation::DefNew,
- _initial_young_size, _max_young_size);
- }
- if (UseAdaptiveSizePolicy) {
- _generations[1] = new GenerationSpec(Generation::ASConcurrentMarkSweep,
- _initial_old_size, _max_old_size);
- } else {
- _generations[1] = new GenerationSpec(Generation::ConcurrentMarkSweep,
- _initial_old_size, _max_old_size);
- }
+ Generation::Name yg_name =
+ UseParNewGC ? Generation::ParNew : Generation::DefNew;
+ _generations[0] = new GenerationSpec(yg_name, _initial_young_size,
+ _max_young_size);
+ _generations[1] = new GenerationSpec(Generation::ConcurrentMarkSweep,
+ _initial_old_size, _max_old_size);
if (_generations[0] == NULL || _generations[1] == NULL) {
vm_exit_during_initialization("Unable to allocate gen spec");
@@ -85,14 +71,12 @@ void ConcurrentMarkSweepPolicy::initialize_generations() {
void ConcurrentMarkSweepPolicy::initialize_size_policy(size_t init_eden_size,
size_t init_promo_size,
size_t init_survivor_size) {
- double max_gc_minor_pause_sec = ((double) MaxGCMinorPauseMillis)/1000.0;
double max_gc_pause_sec = ((double) MaxGCPauseMillis)/1000.0;
- _size_policy = new CMSAdaptiveSizePolicy(init_eden_size,
- init_promo_size,
- init_survivor_size,
- max_gc_minor_pause_sec,
- max_gc_pause_sec,
- GCTimeRatio);
+ _size_policy = new AdaptiveSizePolicy(init_eden_size,
+ init_promo_size,
+ init_survivor_size,
+ max_gc_pause_sec,
+ GCTimeRatio);
}
void ConcurrentMarkSweepPolicy::initialize_gc_policy_counters() {
@@ -110,22 +94,3 @@ bool ConcurrentMarkSweepPolicy::has_soft_ended_eden()
{
return CMSIncrementalMode;
}
-
-
-//
-// ASConcurrentMarkSweepPolicy methods
-//
-
-void ASConcurrentMarkSweepPolicy::initialize_gc_policy_counters() {
-
- assert(size_policy() != NULL, "A size policy is required");
- // initialize the policy counters - 2 collectors, 3 generations
- if (UseParNewGC) {
- _gc_policy_counters = new CMSGCAdaptivePolicyCounters("ParNew:CMS", 2, 3,
- size_policy());
- }
- else {
- _gc_policy_counters = new CMSGCAdaptivePolicyCounters("Copy:CMS", 2, 3,
- size_policy());
- }
-}
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp
index aaa5a1bb770..24c59ac83ab 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp
@@ -47,19 +47,4 @@ class ConcurrentMarkSweepPolicy : public GenCollectorPolicy {
virtual bool has_soft_ended_eden();
};
-class ASConcurrentMarkSweepPolicy : public ConcurrentMarkSweepPolicy {
- public:
-
- // Initialize the jstat counters. This method requires a
- // size policy. The size policy is expected to be created
- // after the generations are fully initialized so the
- // initialization of the counters need to be done post
- // the initialization of the generations.
- void initialize_gc_policy_counters();
-
- virtual CollectorPolicy::Name kind() {
- return CollectorPolicy::ASConcurrentMarkSweepPolicyKind;
- }
-};
-
#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSCOLLECTORPOLICY_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp
deleted file mode 100644
index 8e633b65f15..00000000000
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#include "precompiled.hpp"
-#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp"
-#include "memory/resourceArea.hpp"
-
-CMSGCAdaptivePolicyCounters::CMSGCAdaptivePolicyCounters(const char* name_arg,
- int collectors,
- int generations,
- AdaptiveSizePolicy* size_policy_arg)
- : GCAdaptivePolicyCounters(name_arg,
- collectors,
- generations,
- size_policy_arg) {
- if (UsePerfData) {
- EXCEPTION_MARK;
- ResourceMark rm;
-
- const char* cname =
- PerfDataManager::counter_name(name_space(), "cmsCapacity");
- _cms_capacity_counter = PerfDataManager::create_variable(SUN_GC, cname,
- PerfData::U_Bytes, (jlong) OldSize, CHECK);
-#ifdef NOT_PRODUCT
- cname =
- PerfDataManager::counter_name(name_space(), "initialPause");
- _initial_pause_counter = PerfDataManager::create_variable(SUN_GC, cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_initial_pause()->last_sample(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "remarkPause");
- _remark_pause_counter = PerfDataManager::create_variable(SUN_GC, cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_remark_pause()->last_sample(),
- CHECK);
-#endif
- cname =
- PerfDataManager::counter_name(name_space(), "avgInitialPause");
- _avg_initial_pause_counter = PerfDataManager::create_variable(SUN_GC, cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_initial_pause()->average(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "avgRemarkPause");
- _avg_remark_pause_counter = PerfDataManager::create_variable(SUN_GC, cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_remark_pause()->average(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "avgSTWGcCost");
- _avg_cms_STW_gc_cost_counter = PerfDataManager::create_variable(SUN_GC,
- cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_cms_STW_gc_cost()->average(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "avgSTWTime");
- _avg_cms_STW_time_counter = PerfDataManager::create_variable(SUN_GC,
- cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_cms_STW_time()->average(),
- CHECK);
-
-
- cname = PerfDataManager::counter_name(name_space(), "avgConcurrentTime");
- _avg_concurrent_time_counter = PerfDataManager::create_variable(SUN_GC,
- cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_concurrent_time()->average(),
- CHECK);
-
- cname =
- PerfDataManager::counter_name(name_space(), "avgConcurrentInterval");
- _avg_concurrent_interval_counter = PerfDataManager::create_variable(SUN_GC,
- cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_concurrent_interval()->average(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "avgConcurrentGcCost");
- _avg_concurrent_gc_cost_counter = PerfDataManager::create_variable(SUN_GC,
- cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_concurrent_gc_cost()->average(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "avgCMSFreeAtSweep");
- _avg_cms_free_at_sweep_counter = PerfDataManager::create_variable(SUN_GC,
- cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_cms_free_at_sweep()->average(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "avgCMSFree");
- _avg_cms_free_counter = PerfDataManager::create_variable(SUN_GC,
- cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_cms_free()->average(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "avgCMSPromo");
- _avg_cms_promo_counter = PerfDataManager::create_variable(SUN_GC,
- cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_cms_promo()->average(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "avgMscPause");
- _avg_msc_pause_counter = PerfDataManager::create_variable(SUN_GC,
- cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_msc_pause()->average(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "avgMscInterval");
- _avg_msc_interval_counter = PerfDataManager::create_variable(SUN_GC,
- cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_msc_interval()->average(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "mscGcCost");
- _msc_gc_cost_counter = PerfDataManager::create_variable(SUN_GC,
- cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_msc_gc_cost()->average(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "avgMsPause");
- _avg_ms_pause_counter = PerfDataManager::create_variable(SUN_GC,
- cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_ms_pause()->average(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "avgMsInterval");
- _avg_ms_interval_counter = PerfDataManager::create_variable(SUN_GC,
- cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_ms_interval()->average(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "msGcCost");
- _ms_gc_cost_counter = PerfDataManager::create_variable(SUN_GC,
- cname,
- PerfData::U_Ticks,
- (jlong) cms_size_policy()->avg_ms_gc_cost()->average(),
- CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "majorGcCost");
- _major_gc_cost_counter = PerfDataManager::create_variable(SUN_GC, cname,
- PerfData::U_Ticks, (jlong) cms_size_policy()->cms_gc_cost(), CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "avgPromotedAvg");
- _promoted_avg_counter =
- PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
- cms_size_policy()->calculated_promo_size_in_bytes(), CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "avgPromotedDev");
- _promoted_avg_dev_counter =
- PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
- (jlong) 0 , CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "avgPromotedPaddedAvg");
- _promoted_padded_avg_counter =
- PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
- cms_size_policy()->calculated_promo_size_in_bytes(), CHECK);
-
- cname = PerfDataManager::counter_name(name_space(),
- "changeYoungGenForMajPauses");
- _change_young_gen_for_maj_pauses_counter =
- PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Events,
- (jlong)0, CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "remarkPauseOldSlope");
- _remark_pause_old_slope_counter =
- PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
- (jlong) cms_size_policy()->remark_pause_old_slope(), CHECK);
-
- cname = PerfDataManager::counter_name(name_space(), "initialPauseOldSlope");
- _initial_pause_old_slope_counter =
- PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
- (jlong) cms_size_policy()->initial_pause_old_slope(), CHECK);
-
- cname =
- PerfDataManager::counter_name(name_space(), "remarkPauseYoungSlope") ;
- _remark_pause_young_slope_counter =
- PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
- (jlong) cms_size_policy()->remark_pause_young_slope(), CHECK);
-
- cname =
- PerfDataManager::counter_name(name_space(), "initialPauseYoungSlope");
- _initial_pause_young_slope_counter =
- PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
- (jlong) cms_size_policy()->initial_pause_young_slope(), CHECK);
-
-
- }
- assert(size_policy()->is_gc_cms_adaptive_size_policy(),
- "Wrong type of size policy");
-}
-
-void CMSGCAdaptivePolicyCounters::update_counters() {
- if (UsePerfData) {
- GCAdaptivePolicyCounters::update_counters_from_policy();
- update_counters_from_policy();
- }
-}
-
-void CMSGCAdaptivePolicyCounters::update_counters(CMSGCStats* gc_stats) {
- if (UsePerfData) {
- update_counters();
- update_promoted((size_t) gc_stats->avg_promoted()->last_sample());
- update_avg_promoted_avg(gc_stats);
- update_avg_promoted_dev(gc_stats);
- update_avg_promoted_padded_avg(gc_stats);
- }
-}
-
-void CMSGCAdaptivePolicyCounters::update_counters_from_policy() {
- if (UsePerfData && (cms_size_policy() != NULL)) {
-
- GCAdaptivePolicyCounters::update_counters_from_policy();
-
- update_major_gc_cost_counter();
- update_mutator_cost_counter();
-
- update_eden_size();
- update_promo_size();
-
- // If these updates from the last_sample() work,
- // revise the update methods for these counters
- // (both here and in PS).
- update_survived((size_t) cms_size_policy()->avg_survived()->last_sample());
-
- update_avg_concurrent_time_counter();
- update_avg_concurrent_interval_counter();
- update_avg_concurrent_gc_cost_counter();
-#ifdef NOT_PRODUCT
- update_initial_pause_counter();
- update_remark_pause_counter();
-#endif
- update_avg_initial_pause_counter();
- update_avg_remark_pause_counter();
-
- update_avg_cms_STW_time_counter();
- update_avg_cms_STW_gc_cost_counter();
-
- update_avg_cms_free_counter();
- update_avg_cms_free_at_sweep_counter();
- update_avg_cms_promo_counter();
-
- update_avg_msc_pause_counter();
- update_avg_msc_interval_counter();
- update_msc_gc_cost_counter();
-
- update_avg_ms_pause_counter();
- update_avg_ms_interval_counter();
- update_ms_gc_cost_counter();
-
- update_avg_old_live_counter();
-
- update_survivor_size_counters();
- update_avg_survived_avg_counters();
- update_avg_survived_dev_counters();
-
- update_decrement_tenuring_threshold_for_gc_cost();
- update_increment_tenuring_threshold_for_gc_cost();
- update_decrement_tenuring_threshold_for_survivor_limit();
-
- update_change_young_gen_for_maj_pauses();
-
- update_major_collection_slope_counter();
- update_remark_pause_old_slope_counter();
- update_initial_pause_old_slope_counter();
- update_remark_pause_young_slope_counter();
- update_initial_pause_young_slope_counter();
-
- update_decide_at_full_gc_counter();
- }
-}
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp
deleted file mode 100644
index b6e91c1b349..00000000000
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP
-#define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP
-
-#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
-#include "gc_implementation/shared/gcAdaptivePolicyCounters.hpp"
-#include "gc_implementation/shared/gcStats.hpp"
-#include "runtime/perfData.hpp"
-
-// CMSGCAdaptivePolicyCounters is a holder class for performance counters
-// that track the data and decisions for the ergonomics policy for the
-// concurrent mark sweep collector
-
-class CMSGCAdaptivePolicyCounters : public GCAdaptivePolicyCounters {
- friend class VMStructs;
-
- private:
-
- // Capacity of tenured generation recorded at the end of
- // any collection.
- PerfVariable* _cms_capacity_counter; // Make this common with PS _old_capacity
-
- // Average stop-the-world pause time for both initial and
- // remark pauses sampled at the end of the checkpointRootsFinalWork.
- PerfVariable* _avg_cms_STW_time_counter;
- // Average stop-the-world (STW) GC cost for the STW pause time
- // _avg_cms_STW_time_counter.
- PerfVariable* _avg_cms_STW_gc_cost_counter;
-
-#ifdef NOT_PRODUCT
- // These are useful to see how the most recent values of these
- // counters compare to their respective averages but
- // do not control behavior.
- PerfVariable* _initial_pause_counter;
- PerfVariable* _remark_pause_counter;
-#endif
-
- // Average of the initial marking pause for a concurrent collection.
- PerfVariable* _avg_initial_pause_counter;
- // Average of the remark pause for a concurrent collection.
- PerfVariable* _avg_remark_pause_counter;
-
- // Average for the sum of all the concurrent times per collection.
- PerfVariable* _avg_concurrent_time_counter;
- // Average for the time between the most recent end of a
- // concurrent collection and the beginning of the next
- // concurrent collection.
- PerfVariable* _avg_concurrent_interval_counter;
- // Average of the concurrent GC costs based on _avg_concurrent_time_counter
- // and _avg_concurrent_interval_counter.
- PerfVariable* _avg_concurrent_gc_cost_counter;
-
- // Average of the free space in the tenured generation at the
- // end of the sweep of the tenured generation.
- PerfVariable* _avg_cms_free_counter;
- // Average of the free space in the tenured generation at the
- // start of the sweep of the tenured generation.
- PerfVariable* _avg_cms_free_at_sweep_counter;
- // Average of the free space in the tenured generation at the
- // after any resizing of the tenured generation at the end
- // of a collection of the tenured generation.
- PerfVariable* _avg_cms_promo_counter;
-
- // Average of the mark-sweep-compact (MSC) pause time for a collection
- // of the tenured generation.
- PerfVariable* _avg_msc_pause_counter;
- // Average for the time between the most recent end of a
- // MSC collection and the beginning of the next MSC collection.
- PerfVariable* _avg_msc_interval_counter;
- // Average for the GC cost of a MSC collection based on
- // _avg_msc_pause_counter and _avg_msc_interval_counter.
- PerfVariable* _msc_gc_cost_counter;
-
- // Average of the mark-sweep (MS) pause time for a collection
- // of the tenured generation.
- PerfVariable* _avg_ms_pause_counter;
- // Average for the time between the most recent end of a
- // MS collection and the beginning of the next MS collection.
- PerfVariable* _avg_ms_interval_counter;
- // Average for the GC cost of a MS collection based on
- // _avg_ms_pause_counter and _avg_ms_interval_counter.
- PerfVariable* _ms_gc_cost_counter;
-
- // Average of the bytes promoted per minor collection.
- PerfVariable* _promoted_avg_counter;
- // Average of the deviation of the promoted average.
- PerfVariable* _promoted_avg_dev_counter;
- // Padded average of the bytes promoted per minor collection.
- PerfVariable* _promoted_padded_avg_counter;
-
- // See description of the _change_young_gen_for_maj_pauses
- // variable recently in cmsAdaptiveSizePolicy.hpp.
- PerfVariable* _change_young_gen_for_maj_pauses_counter;
-
- // See descriptions of _remark_pause_old_slope, _initial_pause_old_slope,
- // etc. variables recently in cmsAdaptiveSizePolicy.hpp.
- PerfVariable* _remark_pause_old_slope_counter;
- PerfVariable* _initial_pause_old_slope_counter;
- PerfVariable* _remark_pause_young_slope_counter;
- PerfVariable* _initial_pause_young_slope_counter;
-
- CMSAdaptiveSizePolicy* cms_size_policy() {
- assert(_size_policy->kind() ==
- AdaptiveSizePolicy::_gc_cms_adaptive_size_policy,
- "Wrong size policy");
- return (CMSAdaptiveSizePolicy*)_size_policy;
- }
-
- inline void update_avg_cms_STW_time_counter() {
- _avg_cms_STW_time_counter->set_value(
- (jlong) (cms_size_policy()->avg_cms_STW_time()->average() *
- (double) MILLIUNITS));
- }
-
- inline void update_avg_cms_STW_gc_cost_counter() {
- _avg_cms_STW_gc_cost_counter->set_value(
- (jlong) (cms_size_policy()->avg_cms_STW_gc_cost()->average() * 100.0));
- }
-
- inline void update_avg_initial_pause_counter() {
- _avg_initial_pause_counter->set_value(
- (jlong) (cms_size_policy()->avg_initial_pause()->average() *
- (double) MILLIUNITS));
- }
-#ifdef NOT_PRODUCT
- inline void update_avg_remark_pause_counter() {
- _avg_remark_pause_counter->set_value(
- (jlong) (cms_size_policy()-> avg_remark_pause()->average() *
- (double) MILLIUNITS));
- }
-
- inline void update_initial_pause_counter() {
- _initial_pause_counter->set_value(
- (jlong) (cms_size_policy()->avg_initial_pause()->average() *
- (double) MILLIUNITS));
- }
-#endif
- inline void update_remark_pause_counter() {
- _remark_pause_counter->set_value(
- (jlong) (cms_size_policy()-> avg_remark_pause()->last_sample() *
- (double) MILLIUNITS));
- }
-
- inline void update_avg_concurrent_time_counter() {
- _avg_concurrent_time_counter->set_value(
- (jlong) (cms_size_policy()->avg_concurrent_time()->last_sample() *
- (double) MILLIUNITS));
- }
-
- inline void update_avg_concurrent_interval_counter() {
- _avg_concurrent_interval_counter->set_value(
- (jlong) (cms_size_policy()->avg_concurrent_interval()->average() *
- (double) MILLIUNITS));
- }
-
- inline void update_avg_concurrent_gc_cost_counter() {
- _avg_concurrent_gc_cost_counter->set_value(
- (jlong) (cms_size_policy()->avg_concurrent_gc_cost()->average() * 100.0));
- }
-
- inline void update_avg_cms_free_counter() {
- _avg_cms_free_counter->set_value(
- (jlong) cms_size_policy()->avg_cms_free()->average());
- }
-
- inline void update_avg_cms_free_at_sweep_counter() {
- _avg_cms_free_at_sweep_counter->set_value(
- (jlong) cms_size_policy()->avg_cms_free_at_sweep()->average());
- }
-
- inline void update_avg_cms_promo_counter() {
- _avg_cms_promo_counter->set_value(
- (jlong) cms_size_policy()->avg_cms_promo()->average());
- }
-
- inline void update_avg_old_live_counter() {
- _avg_old_live_counter->set_value(
- (jlong)(cms_size_policy()->avg_old_live()->average())
- );
- }
-
- inline void update_avg_msc_pause_counter() {
- _avg_msc_pause_counter->set_value(
- (jlong) (cms_size_policy()->avg_msc_pause()->average() *
- (double) MILLIUNITS));
- }
-
- inline void update_avg_msc_interval_counter() {
- _avg_msc_interval_counter->set_value(
- (jlong) (cms_size_policy()->avg_msc_interval()->average() *
- (double) MILLIUNITS));
- }
-
- inline void update_msc_gc_cost_counter() {
- _msc_gc_cost_counter->set_value(
- (jlong) (cms_size_policy()->avg_msc_gc_cost()->average() * 100.0));
- }
-
- inline void update_avg_ms_pause_counter() {
- _avg_ms_pause_counter->set_value(
- (jlong) (cms_size_policy()->avg_ms_pause()->average() *
- (double) MILLIUNITS));
- }
-
- inline void update_avg_ms_interval_counter() {
- _avg_ms_interval_counter->set_value(
- (jlong) (cms_size_policy()->avg_ms_interval()->average() *
- (double) MILLIUNITS));
- }
-
- inline void update_ms_gc_cost_counter() {
- _ms_gc_cost_counter->set_value(
- (jlong) (cms_size_policy()->avg_ms_gc_cost()->average() * 100.0));
- }
-
- inline void update_major_gc_cost_counter() {
- _major_gc_cost_counter->set_value(
- (jlong)(cms_size_policy()->cms_gc_cost() * 100.0)
- );
- }
- inline void update_mutator_cost_counter() {
- _mutator_cost_counter->set_value(
- (jlong)(cms_size_policy()->mutator_cost() * 100.0)
- );
- }
-
- inline void update_avg_promoted_avg(CMSGCStats* gc_stats) {
- _promoted_avg_counter->set_value(
- (jlong)(gc_stats->avg_promoted()->average())
- );
- }
- inline void update_avg_promoted_dev(CMSGCStats* gc_stats) {
- _promoted_avg_dev_counter->set_value(
- (jlong)(gc_stats->avg_promoted()->deviation())
- );
- }
- inline void update_avg_promoted_padded_avg(CMSGCStats* gc_stats) {
- _promoted_padded_avg_counter->set_value(
- (jlong)(gc_stats->avg_promoted()->padded_average())
- );
- }
- inline void update_remark_pause_old_slope_counter() {
- _remark_pause_old_slope_counter->set_value(
- (jlong)(cms_size_policy()->remark_pause_old_slope() * 1000)
- );
- }
- inline void update_initial_pause_old_slope_counter() {
- _initial_pause_old_slope_counter->set_value(
- (jlong)(cms_size_policy()->initial_pause_old_slope() * 1000)
- );
- }
- inline void update_remark_pause_young_slope_counter() {
- _remark_pause_young_slope_counter->set_value(
- (jlong)(cms_size_policy()->remark_pause_young_slope() * 1000)
- );
- }
- inline void update_initial_pause_young_slope_counter() {
- _initial_pause_young_slope_counter->set_value(
- (jlong)(cms_size_policy()->initial_pause_young_slope() * 1000)
- );
- }
- inline void update_change_young_gen_for_maj_pauses() {
- _change_young_gen_for_maj_pauses_counter->set_value(
- cms_size_policy()->change_young_gen_for_maj_pauses());
- }
-
- public:
- CMSGCAdaptivePolicyCounters(const char* name, int collectors, int generations,
- AdaptiveSizePolicy* size_policy);
-
- // update counters
- void update_counters();
- void update_counters(CMSGCStats* gc_stats);
- void update_counters_from_policy();
-
- inline void update_cms_capacity_counter(size_t size_in_bytes) {
- _cms_capacity_counter->set_value(size_in_bytes);
- }
-
- virtual GCPolicyCounters::Name kind() const {
- return GCPolicyCounters::CMSGCAdaptivePolicyCountersKind;
- }
-};
-
-#endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSGCADAPTIVEPOLICYCOUNTERS_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
index e1d5e29a84b..ba2ff9c55ff 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp
@@ -70,7 +70,6 @@ class LinearAllocBlock VALUE_OBJ_CLASS_SPEC {
class CompactibleFreeListSpace: public CompactibleSpace {
friend class VMStructs;
friend class ConcurrentMarkSweepGeneration;
- friend class ASConcurrentMarkSweepGeneration;
friend class CMSCollector;
// Local alloc buffer for promotion into this space.
friend class CFLS_LAB;
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
index c0daf2c32ec..7dbc7f1d503 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -27,9 +27,8 @@
#include "classfile/stringTable.hpp"
#include "classfile/systemDictionary.hpp"
#include "code/codeCache.hpp"
-#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
+#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
#include "gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp"
-#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp"
#include "gc_implementation/concurrentMarkSweep/cmsOopClosures.inline.hpp"
#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp"
@@ -319,27 +318,13 @@ void CMSCollector::ref_processor_init() {
}
}
-CMSAdaptiveSizePolicy* CMSCollector::size_policy() {
+AdaptiveSizePolicy* CMSCollector::size_policy() {
GenCollectedHeap* gch = GenCollectedHeap::heap();
assert(gch->kind() == CollectedHeap::GenCollectedHeap,
"Wrong type of heap");
- CMSAdaptiveSizePolicy* sp = (CMSAdaptiveSizePolicy*)
- gch->gen_policy()->size_policy();
- assert(sp->is_gc_cms_adaptive_size_policy(),
- "Wrong type of size policy");
- return sp;
+ return gch->gen_policy()->size_policy();
}
-CMSGCAdaptivePolicyCounters* CMSCollector::gc_adaptive_policy_counters() {
- CMSGCAdaptivePolicyCounters* results =
- (CMSGCAdaptivePolicyCounters*) collector_policy()->counters();
- assert(
- results->kind() == GCPolicyCounters::CMSGCAdaptivePolicyCountersKind,
- "Wrong gc policy counter kind");
- return results;
-}
-
-
void ConcurrentMarkSweepGeneration::initialize_performance_counters() {
const char* gen_name = "old";
@@ -1573,11 +1558,11 @@ bool CMSCollector::shouldConcurrentCollect() {
}
if (MetaspaceGC::should_concurrent_collect()) {
- if (Verbose && PrintGCDetails) {
+ if (Verbose && PrintGCDetails) {
gclog_or_tty->print("CMSCollector: collect for metadata allocation ");
- }
- return true;
}
+ return true;
+ }
// CMSTriggerInterval starts a CMS cycle if enough time has passed.
if (CMSTriggerInterval >= 0) {
@@ -2031,11 +2016,6 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) {
"collections passed to foreground collector", _full_gcs_since_conc_gc);
}
- // Sample collection interval time and reset for collection pause.
- if (UseAdaptiveSizePolicy) {
- size_policy()->msc_collection_begin();
- }
-
// Temporarily widen the span of the weak reference processing to
// the entire heap.
MemRegion new_span(GenCollectedHeap::heap()->reserved_region());
@@ -2111,11 +2091,6 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) {
_inter_sweep_timer.reset();
_inter_sweep_timer.start();
- // Sample collection pause time and reset for collection interval.
- if (UseAdaptiveSizePolicy) {
- size_policy()->msc_collection_end(gch->gc_cause());
- }
-
gc_timer->register_gc_end();
gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions());
@@ -2373,26 +2348,14 @@ void CMSCollector::collect_in_background(bool clear_all_soft_refs, GCCause::Caus
}
break;
case Precleaning:
- if (UseAdaptiveSizePolicy) {
- size_policy()->concurrent_precleaning_begin();
- }
// marking from roots in markFromRoots has been completed
preclean();
- if (UseAdaptiveSizePolicy) {
- size_policy()->concurrent_precleaning_end();
- }
assert(_collectorState == AbortablePreclean ||
_collectorState == FinalMarking,
"Collector state should have changed");
break;
case AbortablePreclean:
- if (UseAdaptiveSizePolicy) {
- size_policy()->concurrent_phases_resume();
- }
abortable_preclean();
- if (UseAdaptiveSizePolicy) {
- size_policy()->concurrent_precleaning_end();
- }
assert(_collectorState == FinalMarking, "Collector state should "
"have changed");
break;
@@ -2406,23 +2369,12 @@ void CMSCollector::collect_in_background(bool clear_all_soft_refs, GCCause::Caus
assert(_foregroundGCShouldWait, "block post-condition");
break;
case Sweeping:
- if (UseAdaptiveSizePolicy) {
- size_policy()->concurrent_sweeping_begin();
- }
// final marking in checkpointRootsFinal has been completed
sweep(true);
assert(_collectorState == Resizing, "Collector state change "
"to Resizing must be done under the free_list_lock");
_full_gcs_since_conc_gc = 0;
- // Stop the timers for adaptive size policy for the concurrent phases
- if (UseAdaptiveSizePolicy) {
- size_policy()->concurrent_sweeping_end();
- size_policy()->concurrent_phases_end(gch->gc_cause(),
- gch->prev_gen(_cmsGen)->capacity(),
- _cmsGen->free());
- }
-
case Resizing: {
// Sweeping has been completed...
// At this point the background collection has completed.
@@ -2539,9 +2491,6 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs, GCCause::Caus
const GCId gc_id = _collectorState == InitialMarking ? GCId::peek() : _gc_tracer_cm->gc_id();
NOT_PRODUCT(GCTraceTime t("CMS:MS (foreground) ", PrintGCDetails && Verbose,
true, NULL, gc_id);)
- if (UseAdaptiveSizePolicy) {
- size_policy()->ms_collection_begin();
- }
COMPILER2_PRESENT(DerivedPointerTableDeactivate dpt_deact);
HandleMark hm; // Discard invalid handles created during verification
@@ -2633,11 +2582,6 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs, GCCause::Caus
}
}
- if (UseAdaptiveSizePolicy) {
- GenCollectedHeap* gch = GenCollectedHeap::heap();
- size_policy()->ms_collection_end(gch->gc_cause());
- }
-
if (VerifyAfterGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
Universe::verify();
@@ -3053,20 +2997,21 @@ void CMSCollector::verify_after_remark_work_1() {
HandleMark hm;
GenCollectedHeap* gch = GenCollectedHeap::heap();
- // Get a clear set of claim bits for the strong roots processing to work with.
+ // Get a clear set of claim bits for the roots processing to work with.
ClassLoaderDataGraph::clear_claimed_marks();
// Mark from roots one level into CMS
MarkRefsIntoClosure notOlder(_span, verification_mark_bm());
gch->rem_set()->prepare_for_younger_refs_iterate(false); // Not parallel.
- gch->gen_process_strong_roots(_cmsGen->level(),
- true, // younger gens are roots
- true, // activate StrongRootsScope
- SharedHeap::ScanningOption(roots_scanning_options()),
- ¬Older,
- NULL,
- NULL); // SSS: Provide correct closure
+ gch->gen_process_roots(_cmsGen->level(),
+ true, // younger gens are roots
+ true, // activate StrongRootsScope
+ SharedHeap::ScanningOption(roots_scanning_options()),
+ should_unload_classes(),
+ ¬Older,
+ NULL,
+ NULL); // SSS: Provide correct closure
// Now mark from the roots
MarkFromRootsClosure markFromRootsClosure(this, _span,
@@ -3117,22 +3062,24 @@ void CMSCollector::verify_after_remark_work_2() {
HandleMark hm;
GenCollectedHeap* gch = GenCollectedHeap::heap();
- // Get a clear set of claim bits for the strong roots processing to work with.
+ // Get a clear set of claim bits for the roots processing to work with.
ClassLoaderDataGraph::clear_claimed_marks();
// Mark from roots one level into CMS
MarkRefsIntoVerifyClosure notOlder(_span, verification_mark_bm(),
markBitMap());
- KlassToOopClosure klass_closure(¬Older);
+ CLDToOopClosure cld_closure(¬Older, true);
gch->rem_set()->prepare_for_younger_refs_iterate(false); // Not parallel.
- gch->gen_process_strong_roots(_cmsGen->level(),
- true, // younger gens are roots
- true, // activate StrongRootsScope
- SharedHeap::ScanningOption(roots_scanning_options()),
- ¬Older,
- NULL,
- &klass_closure);
+
+ gch->gen_process_roots(_cmsGen->level(),
+ true, // younger gens are roots
+ true, // activate StrongRootsScope
+ SharedHeap::ScanningOption(roots_scanning_options()),
+ should_unload_classes(),
+ ¬Older,
+ NULL,
+ &cld_closure);
// Now mark from the roots
MarkFromRootsVerifyClosure markFromRootsClosure(this, _span,
@@ -3319,12 +3266,10 @@ bool ConcurrentMarkSweepGeneration::is_too_full() const {
void CMSCollector::setup_cms_unloading_and_verification_state() {
const bool should_verify = VerifyBeforeGC || VerifyAfterGC || VerifyDuringGC
|| VerifyBeforeExit;
- const int rso = SharedHeap::SO_Strings | SharedHeap::SO_AllCodeCache;
+ const int rso = SharedHeap::SO_AllCodeCache;
// We set the proper root for this CMS cycle here.
if (should_unload_classes()) { // Should unload classes this cycle
- remove_root_scanning_option(SharedHeap::SO_AllClasses);
- add_root_scanning_option(SharedHeap::SO_SystemClasses);
remove_root_scanning_option(rso); // Shrink the root set appropriately
set_verifying(should_verify); // Set verification state for this cycle
return; // Nothing else needs to be done at this time
@@ -3332,8 +3277,6 @@ void CMSCollector::setup_cms_unloading_and_verification_state() {
// Not unloading classes this cycle
assert(!should_unload_classes(), "Inconsistency!");
- remove_root_scanning_option(SharedHeap::SO_SystemClasses);
- add_root_scanning_option(SharedHeap::SO_AllClasses);
if ((!verifying() || unloaded_classes_last_cycle()) && should_verify) {
// Include symbols, strings and code cache elements to prevent their resurrection.
@@ -3687,9 +3630,6 @@ void CMSCollector::checkpointRootsInitialWork(bool asynch) {
NOT_PRODUCT(GCTraceTime t("\ncheckpointRootsInitialWork",
PrintGCDetails && Verbose, true, _gc_timer_cm, _gc_tracer_cm->gc_id());)
- if (UseAdaptiveSizePolicy) {
- size_policy()->checkpoint_roots_initial_begin();
- }
// Reset all the PLAB chunk arrays if necessary.
if (_survivor_plab_array != NULL && !CMSPLABRecordAlways) {
@@ -3744,15 +3684,16 @@ void CMSCollector::checkpointRootsInitialWork(bool asynch) {
gch->set_par_threads(0);
} else {
// The serial version.
- KlassToOopClosure klass_closure(¬Older);
+ CLDToOopClosure cld_closure(¬Older, true);
gch->rem_set()->prepare_for_younger_refs_iterate(false); // Not parallel.
- gch->gen_process_strong_roots(_cmsGen->level(),
- true, // younger gens are roots
- true, // activate StrongRootsScope
- SharedHeap::ScanningOption(roots_scanning_options()),
- ¬Older,
- NULL,
- &klass_closure);
+ gch->gen_process_roots(_cmsGen->level(),
+ true, // younger gens are roots
+ true, // activate StrongRootsScope
+ SharedHeap::ScanningOption(roots_scanning_options()),
+ should_unload_classes(),
+ ¬Older,
+ NULL,
+ &cld_closure);
}
}
@@ -3769,9 +3710,6 @@ void CMSCollector::checkpointRootsInitialWork(bool asynch) {
// Save the end of the used_region of the constituent generations
// to be used to limit the extent of sweep in each generation.
save_sweep_limits();
- if (UseAdaptiveSizePolicy) {
- size_policy()->checkpoint_roots_initial_end(gch->gc_cause());
- }
verify_overflow_empty();
}
@@ -3788,15 +3726,6 @@ bool CMSCollector::markFromRoots(bool asynch) {
bool res;
if (asynch) {
-
- // Start the timers for adaptive size policy for the concurrent phases
- // Do it here so that the foreground MS can use the concurrent
- // timer since a foreground MS might has the sweep done concurrently
- // or STW.
- if (UseAdaptiveSizePolicy) {
- size_policy()->concurrent_marking_begin();
- }
-
// Weak ref discovery note: We may be discovering weak
// refs in this generation concurrent (but interleaved) with
// weak ref discovery by a younger generation collector.
@@ -3814,22 +3743,12 @@ bool CMSCollector::markFromRoots(bool asynch) {
gclog_or_tty->print_cr("bailing out to foreground collection");
}
}
- if (UseAdaptiveSizePolicy) {
- size_policy()->concurrent_marking_end();
- }
} else {
assert(SafepointSynchronize::is_at_safepoint(),
"inconsistent with asynch == false");
- if (UseAdaptiveSizePolicy) {
- size_policy()->ms_collection_marking_begin();
- }
// already have locks
res = markFromRootsWork(asynch);
_collectorState = FinalMarking;
- if (UseAdaptiveSizePolicy) {
- GenCollectedHeap* gch = GenCollectedHeap::heap();
- size_policy()->ms_collection_marking_end(gch->gc_cause());
- }
}
verify_overflow_empty();
return res;
@@ -4705,8 +4624,7 @@ size_t CMSCollector::preclean_work(bool clean_refs, bool clean_survivor) {
if (clean_survivor) { // preclean the active survivor space(s)
assert(_young_gen->kind() == Generation::DefNew ||
- _young_gen->kind() == Generation::ParNew ||
- _young_gen->kind() == Generation::ASParNew,
+ _young_gen->kind() == Generation::ParNew,
"incorrect type for cast");
DefNewGeneration* dng = (DefNewGeneration*)_young_gen;
PushAndMarkClosure pam_cl(this, _span, ref_processor(),
@@ -5077,10 +4995,6 @@ void CMSCollector::checkpointRootsFinalWork(bool asynch,
assert(haveFreelistLocks(), "must have free list locks");
assert_lock_strong(bitMapLock());
- if (UseAdaptiveSizePolicy) {
- size_policy()->checkpoint_roots_final_begin();
- }
-
ResourceMark rm;
HandleMark hm;
@@ -5214,9 +5128,6 @@ void CMSCollector::checkpointRootsFinalWork(bool asynch,
"Should be clear by end of the final marking");
assert(_ct->klass_rem_set()->mod_union_is_clear(),
"Should be clear by end of the final marking");
- if (UseAdaptiveSizePolicy) {
- size_policy()->checkpoint_roots_final_end(gch->gc_cause());
- }
}
void CMSParInitialMarkTask::work(uint worker_id) {
@@ -5228,7 +5139,6 @@ void CMSParInitialMarkTask::work(uint worker_id) {
_timer.start();
GenCollectedHeap* gch = GenCollectedHeap::heap();
Par_MarkRefsIntoClosure par_mri_cl(_collector->_span, &(_collector->_markBitMap));
- KlassToOopClosure klass_closure(&par_mri_cl);
// ---------- young gen roots --------------
{
@@ -5244,13 +5154,17 @@ void CMSParInitialMarkTask::work(uint worker_id) {
// ---------- remaining roots --------------
_timer.reset();
_timer.start();
- gch->gen_process_strong_roots(_collector->_cmsGen->level(),
- false, // yg was scanned above
- false, // this is parallel code
- SharedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
- &par_mri_cl,
- NULL,
- &klass_closure);
+
+ CLDToOopClosure cld_closure(&par_mri_cl, true);
+
+ gch->gen_process_roots(_collector->_cmsGen->level(),
+ false, // yg was scanned above
+ false, // this is parallel code
+ SharedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
+ _collector->should_unload_classes(),
+ &par_mri_cl,
+ NULL,
+ &cld_closure);
assert(_collector->should_unload_classes()
|| (_collector->CMSCollector::roots_scanning_options() & SharedHeap::SO_AllCodeCache),
"if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
@@ -5379,13 +5293,15 @@ void CMSParRemarkTask::work(uint worker_id) {
// ---------- remaining roots --------------
_timer.reset();
_timer.start();
- gch->gen_process_strong_roots(_collector->_cmsGen->level(),
- false, // yg was scanned above
- false, // this is parallel code
- SharedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
- &par_mrias_cl,
- NULL,
- NULL); // The dirty klasses will be handled below
+ gch->gen_process_roots(_collector->_cmsGen->level(),
+ false, // yg was scanned above
+ false, // this is parallel code
+ SharedHeap::ScanningOption(_collector->CMSCollector::roots_scanning_options()),
+ _collector->should_unload_classes(),
+ &par_mrias_cl,
+ NULL,
+ NULL); // The dirty klasses will be handled below
+
assert(_collector->should_unload_classes()
|| (_collector->CMSCollector::roots_scanning_options() & SharedHeap::SO_AllCodeCache),
"if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops");
@@ -5440,7 +5356,7 @@ void CMSParRemarkTask::work(uint worker_id) {
// We might have added oops to ClassLoaderData::_handles during the
// concurrent marking phase. These oops point to newly allocated objects
// that are guaranteed to be kept alive. Either by the direct allocation
- // code, or when the young collector processes the strong roots. Hence,
+ // code, or when the young collector processes the roots. Hence,
// we don't have to revisit the _handles block during the remark phase.
// ---------- rescan dirty cards ------------
@@ -5862,7 +5778,7 @@ void CMSCollector::do_remark_parallel() {
cms_space,
n_workers, workers, task_queues());
- // Set up for parallel process_strong_roots work.
+ // Set up for parallel process_roots work.
gch->set_par_threads(n_workers);
// We won't be iterating over the cards in the card table updating
// the younger_gen cards, so we shouldn't call the following else
@@ -5871,7 +5787,7 @@ void CMSCollector::do_remark_parallel() {
// gch->rem_set()->prepare_for_younger_refs_iterate(true); // parallel
// The young gen rescan work will not be done as part of
- // process_strong_roots (which currently doesn't knw how to
+ // process_roots (which currently doesn't know how to
// parallelize such a scan), but rather will be broken up into
// a set of parallel tasks (via the sampling that the [abortable]
// preclean phase did of EdenSpace, plus the [two] tasks of
@@ -5968,13 +5884,15 @@ void CMSCollector::do_remark_non_parallel() {
gch->rem_set()->prepare_for_younger_refs_iterate(false); // Not parallel.
GenCollectedHeap::StrongRootsScope srs(gch);
- gch->gen_process_strong_roots(_cmsGen->level(),
- true, // younger gens as roots
- false, // use the local StrongRootsScope
- SharedHeap::ScanningOption(roots_scanning_options()),
- &mrias_cl,
- NULL,
- NULL); // The dirty klasses will be handled below
+
+ gch->gen_process_roots(_cmsGen->level(),
+ true, // younger gens as roots
+ false, // use the local StrongRootsScope
+ SharedHeap::ScanningOption(roots_scanning_options()),
+ should_unload_classes(),
+ &mrias_cl,
+ NULL,
+ NULL); // The dirty klasses will be handled below
assert(should_unload_classes()
|| (roots_scanning_options() & SharedHeap::SO_AllCodeCache),
@@ -6014,7 +5932,7 @@ void CMSCollector::do_remark_non_parallel() {
// We might have added oops to ClassLoaderData::_handles during the
// concurrent marking phase. These oops point to newly allocated objects
// that are guaranteed to be kept alive. Either by the direct allocation
- // code, or when the young collector processes the strong roots. Hence,
+ // code, or when the young collector processes the roots. Hence,
// we don't have to revisit the _handles block during the remark phase.
verify_work_stacks_empty();
@@ -6264,15 +6182,14 @@ void CMSCollector::refProcessingWork(bool asynch, bool clear_all_soft_refs) {
// Clean up unreferenced symbols in symbol table.
SymbolTable::unlink();
}
+
+ {
+ GCTraceTime t("scrub string table", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
+ // Delete entries for dead interned strings.
+ StringTable::unlink(&_is_alive_closure);
+ }
}
- // CMS doesn't use the StringTable as hard roots when class unloading is turned off.
- // Need to check if we really scanned the StringTable.
- if ((roots_scanning_options() & SharedHeap::SO_Strings) == 0) {
- GCTraceTime t("scrub string table", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());
- // Delete entries for dead interned strings.
- StringTable::unlink(&_is_alive_closure);
- }
// Restore any preserved marks as a result of mark stack or
// work queue overflow
@@ -6329,7 +6246,6 @@ void CMSCollector::sweep(bool asynch) {
_inter_sweep_timer.stop();
_inter_sweep_estimate.sample(_inter_sweep_timer.seconds());
- size_policy()->avg_cms_free_at_sweep()->sample(_cmsGen->free());
assert(!_intra_sweep_timer.is_active(), "Should not be active");
_intra_sweep_timer.reset();
@@ -6454,17 +6370,6 @@ void ConcurrentMarkSweepGeneration::update_gc_stats(int current_level,
}
}
-CMSAdaptiveSizePolicy* ConcurrentMarkSweepGeneration::size_policy() {
- GenCollectedHeap* gch = GenCollectedHeap::heap();
- assert(gch->kind() == CollectedHeap::GenCollectedHeap,
- "Wrong type of heap");
- CMSAdaptiveSizePolicy* sp = (CMSAdaptiveSizePolicy*)
- gch->gen_policy()->size_policy();
- assert(sp->is_gc_cms_adaptive_size_policy(),
- "Wrong type of size policy");
- return sp;
-}
-
void ConcurrentMarkSweepGeneration::rotate_debug_collection_type() {
if (PrintGCDetails && Verbose) {
gclog_or_tty->print("Rotate from %d ", _debug_collection_type);
@@ -6540,9 +6445,6 @@ void CMSCollector::sweepWork(ConcurrentMarkSweepGeneration* gen,
// Reset CMS data structures (for now just the marking bit map)
// preparatory for the next cycle.
void CMSCollector::reset(bool asynch) {
- GenCollectedHeap* gch = GenCollectedHeap::heap();
- CMSAdaptiveSizePolicy* sp = size_policy();
- AdaptiveSizePolicyOutput(sp, gch->total_collections());
if (asynch) {
CMSTokenSyncWithLocks ts(true, bitMapLock());
@@ -6597,7 +6499,7 @@ void CMSCollector::reset(bool asynch) {
// Because only the full (i.e., concurrent mode failure) collections
// are being measured for gc overhead limits, clean the "near" flag
// and count.
- sp->reset_gc_overhead_limit_count();
+ size_policy()->reset_gc_overhead_limit_count();
_collectorState = Idling;
} else {
// already have the lock
@@ -7064,7 +6966,6 @@ void MarkRefsIntoAndScanClosure::do_yield_work() {
ConcurrentMarkSweepThread::desynchronize(true);
ConcurrentMarkSweepThread::acknowledge_yield_request();
_collector->stopTimer();
- GCPauseTimer p(_collector->size_policy()->concurrent_timer_ptr());
if (PrintCMSStatistics != 0) {
_collector->incrementYields();
}
@@ -7225,7 +7126,6 @@ void ScanMarkedObjectsAgainCarefullyClosure::do_yield_work() {
ConcurrentMarkSweepThread::desynchronize(true);
ConcurrentMarkSweepThread::acknowledge_yield_request();
_collector->stopTimer();
- GCPauseTimer p(_collector->size_policy()->concurrent_timer_ptr());
if (PrintCMSStatistics != 0) {
_collector->incrementYields();
}
@@ -7298,7 +7198,6 @@ void SurvivorSpacePrecleanClosure::do_yield_work() {
ConcurrentMarkSweepThread::desynchronize(true);
ConcurrentMarkSweepThread::acknowledge_yield_request();
_collector->stopTimer();
- GCPauseTimer p(_collector->size_policy()->concurrent_timer_ptr());
if (PrintCMSStatistics != 0) {
_collector->incrementYields();
}
@@ -7457,7 +7356,6 @@ void MarkFromRootsClosure::do_yield_work() {
ConcurrentMarkSweepThread::desynchronize(true);
ConcurrentMarkSweepThread::acknowledge_yield_request();
_collector->stopTimer();
- GCPauseTimer p(_collector->size_policy()->concurrent_timer_ptr());
if (PrintCMSStatistics != 0) {
_collector->incrementYields();
}
@@ -8099,7 +7997,6 @@ void CMSPrecleanRefsYieldClosure::do_yield_work() {
ConcurrentMarkSweepThread::acknowledge_yield_request();
_collector->stopTimer();
- GCPauseTimer p(_collector->size_policy()->concurrent_timer_ptr());
if (PrintCMSStatistics != 0) {
_collector->incrementYields();
}
@@ -8780,7 +8677,6 @@ void SweepClosure::do_yield_work(HeapWord* addr) {
ConcurrentMarkSweepThread::desynchronize(true);
ConcurrentMarkSweepThread::acknowledge_yield_request();
_collector->stopTimer();
- GCPauseTimer p(_collector->size_policy()->concurrent_timer_ptr());
if (PrintCMSStatistics != 0) {
_collector->incrementYields();
}
@@ -9327,172 +9223,6 @@ bool CMSCollector::no_preserved_marks() const {
}
#endif
-CMSAdaptiveSizePolicy* ASConcurrentMarkSweepGeneration::cms_size_policy() const
-{
- GenCollectedHeap* gch = (GenCollectedHeap*) GenCollectedHeap::heap();
- CMSAdaptiveSizePolicy* size_policy =
- (CMSAdaptiveSizePolicy*) gch->gen_policy()->size_policy();
- assert(size_policy->is_gc_cms_adaptive_size_policy(),
- "Wrong type for size policy");
- return size_policy;
-}
-
-void ASConcurrentMarkSweepGeneration::resize(size_t cur_promo_size,
- size_t desired_promo_size) {
- if (cur_promo_size < desired_promo_size) {
- size_t expand_bytes = desired_promo_size - cur_promo_size;
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(" ASConcurrentMarkSweepGeneration::resize "
- "Expanding tenured generation by " SIZE_FORMAT " (bytes)",
- expand_bytes);
- }
- expand(expand_bytes,
- MinHeapDeltaBytes,
- CMSExpansionCause::_adaptive_size_policy);
- } else if (desired_promo_size < cur_promo_size) {
- size_t shrink_bytes = cur_promo_size - desired_promo_size;
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(" ASConcurrentMarkSweepGeneration::resize "
- "Shrinking tenured generation by " SIZE_FORMAT " (bytes)",
- shrink_bytes);
- }
- shrink(shrink_bytes);
- }
-}
-
-CMSGCAdaptivePolicyCounters* ASConcurrentMarkSweepGeneration::gc_adaptive_policy_counters() {
- GenCollectedHeap* gch = GenCollectedHeap::heap();
- CMSGCAdaptivePolicyCounters* counters =
- (CMSGCAdaptivePolicyCounters*) gch->collector_policy()->counters();
- assert(counters->kind() == GCPolicyCounters::CMSGCAdaptivePolicyCountersKind,
- "Wrong kind of counters");
- return counters;
-}
-
-
-void ASConcurrentMarkSweepGeneration::update_counters() {
- if (UsePerfData) {
- _space_counters->update_all();
- _gen_counters->update_all();
- CMSGCAdaptivePolicyCounters* counters = gc_adaptive_policy_counters();
- GenCollectedHeap* gch = GenCollectedHeap::heap();
- CMSGCStats* gc_stats_l = (CMSGCStats*) gc_stats();
- assert(gc_stats_l->kind() == GCStats::CMSGCStatsKind,
- "Wrong gc statistics type");
- counters->update_counters(gc_stats_l);
- }
-}
-
-void ASConcurrentMarkSweepGeneration::update_counters(size_t used) {
- if (UsePerfData) {
- _space_counters->update_used(used);
- _space_counters->update_capacity();
- _gen_counters->update_all();
-
- CMSGCAdaptivePolicyCounters* counters = gc_adaptive_policy_counters();
- GenCollectedHeap* gch = GenCollectedHeap::heap();
- CMSGCStats* gc_stats_l = (CMSGCStats*) gc_stats();
- assert(gc_stats_l->kind() == GCStats::CMSGCStatsKind,
- "Wrong gc statistics type");
- counters->update_counters(gc_stats_l);
- }
-}
-
-void ASConcurrentMarkSweepGeneration::shrink_by(size_t desired_bytes) {
- assert_locked_or_safepoint(Heap_lock);
- assert_lock_strong(freelistLock());
- HeapWord* old_end = _cmsSpace->end();
- HeapWord* unallocated_start = _cmsSpace->unallocated_block();
- assert(old_end >= unallocated_start, "Miscalculation of unallocated_start");
- FreeChunk* chunk_at_end = find_chunk_at_end();
- if (chunk_at_end == NULL) {
- // No room to shrink
- if (PrintGCDetails && Verbose) {
- gclog_or_tty->print_cr("No room to shrink: old_end "
- PTR_FORMAT " unallocated_start " PTR_FORMAT
- " chunk_at_end " PTR_FORMAT,
- old_end, unallocated_start, chunk_at_end);
- }
- return;
- } else {
-
- // Find the chunk at the end of the space and determine
- // how much it can be shrunk.
- size_t shrinkable_size_in_bytes = chunk_at_end->size();
- size_t aligned_shrinkable_size_in_bytes =
- align_size_down(shrinkable_size_in_bytes, os::vm_page_size());
- assert(unallocated_start <= (HeapWord*) chunk_at_end->end(),
- "Inconsistent chunk at end of space");
- size_t bytes = MIN2(desired_bytes, aligned_shrinkable_size_in_bytes);
- size_t word_size_before = heap_word_size(_virtual_space.committed_size());
-
- // Shrink the underlying space
- _virtual_space.shrink_by(bytes);
- if (PrintGCDetails && Verbose) {
- gclog_or_tty->print_cr("ConcurrentMarkSweepGeneration::shrink_by:"
- " desired_bytes " SIZE_FORMAT
- " shrinkable_size_in_bytes " SIZE_FORMAT
- " aligned_shrinkable_size_in_bytes " SIZE_FORMAT
- " bytes " SIZE_FORMAT,
- desired_bytes, shrinkable_size_in_bytes,
- aligned_shrinkable_size_in_bytes, bytes);
- gclog_or_tty->print_cr(" old_end " SIZE_FORMAT
- " unallocated_start " SIZE_FORMAT,
- old_end, unallocated_start);
- }
-
- // If the space did shrink (shrinking is not guaranteed),
- // shrink the chunk at the end by the appropriate amount.
- if (((HeapWord*)_virtual_space.high()) < old_end) {
- size_t new_word_size =
- heap_word_size(_virtual_space.committed_size());
-
- // Have to remove the chunk from the dictionary because it is changing
- // size and might be someplace elsewhere in the dictionary.
-
- // Get the chunk at end, shrink it, and put it
- // back.
- _cmsSpace->removeChunkFromDictionary(chunk_at_end);
- size_t word_size_change = word_size_before - new_word_size;
- size_t chunk_at_end_old_size = chunk_at_end->size();
- assert(chunk_at_end_old_size >= word_size_change,
- "Shrink is too large");
- chunk_at_end->set_size(chunk_at_end_old_size -
- word_size_change);
- _cmsSpace->freed((HeapWord*) chunk_at_end->end(),
- word_size_change);
-
- _cmsSpace->returnChunkToDictionary(chunk_at_end);
-
- MemRegion mr(_cmsSpace->bottom(), new_word_size);
- _bts->resize(new_word_size); // resize the block offset shared array
- Universe::heap()->barrier_set()->resize_covered_region(mr);
- _cmsSpace->assert_locked();
- _cmsSpace->set_end((HeapWord*)_virtual_space.high());
-
- NOT_PRODUCT(_cmsSpace->dictionary()->verify());
-
- // update the space and generation capacity counters
- if (UsePerfData) {
- _space_counters->update_capacity();
- _gen_counters->update_all();
- }
-
- if (Verbose && PrintGCDetails) {
- size_t new_mem_size = _virtual_space.committed_size();
- size_t old_mem_size = new_mem_size + bytes;
- gclog_or_tty->print_cr("Shrinking %s from " SIZE_FORMAT "K by " SIZE_FORMAT "K to " SIZE_FORMAT "K",
- name(), old_mem_size/K, bytes/K, new_mem_size/K);
- }
- }
-
- assert(_cmsSpace->unallocated_block() <= _cmsSpace->end(),
- "Inconsistency at end of space");
- assert(chunk_at_end->end() == (uintptr_t*) _cmsSpace->end(),
- "Shrinking is inconsistent");
- return;
- }
-}
// Transfer some number of overflown objects to usual marking
// stack. Return true if some objects were transferred.
bool MarkRefsIntoAndScanClosure::take_from_overflow_list() {
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
index 7e3ef58605f..8d3d6ef128e 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
@@ -32,6 +32,7 @@
#include "gc_implementation/shared/generationCounters.hpp"
#include "memory/freeBlockDictionary.hpp"
#include "memory/generation.hpp"
+#include "memory/iterator.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/virtualspace.hpp"
#include "services/memoryService.hpp"
@@ -52,7 +53,7 @@
// Concurrent mode failures are currently handled by
// means of a sliding mark-compact.
-class CMSAdaptiveSizePolicy;
+class AdaptiveSizePolicy;
class CMSConcMarkingTask;
class CMSGCAdaptivePolicyCounters;
class CMSTracer;
@@ -1009,8 +1010,7 @@ class CMSCollector: public CHeapObj {
void icms_wait(); // Called at yield points.
// Adaptive size policy
- CMSAdaptiveSizePolicy* size_policy();
- CMSGCAdaptivePolicyCounters* gc_adaptive_policy_counters();
+ AdaptiveSizePolicy* size_policy();
static void print_on_error(outputStream* st);
@@ -1150,9 +1150,6 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
virtual Generation::Name kind() { return Generation::ConcurrentMarkSweep; }
- // Adaptive size policy
- CMSAdaptiveSizePolicy* size_policy();
-
void set_did_compact(bool v) { _did_compact = v; }
bool refs_discovery_is_atomic() const { return false; }
@@ -1346,37 +1343,6 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
void rotate_debug_collection_type();
};
-class ASConcurrentMarkSweepGeneration : public ConcurrentMarkSweepGeneration {
-
- // Return the size policy from the heap's collector
- // policy casted to CMSAdaptiveSizePolicy*.
- CMSAdaptiveSizePolicy* cms_size_policy() const;
-
- // Resize the generation based on the adaptive size
- // policy.
- void resize(size_t cur_promo, size_t desired_promo);
-
- // Return the GC counters from the collector policy
- CMSGCAdaptivePolicyCounters* gc_adaptive_policy_counters();
-
- virtual void shrink_by(size_t bytes);
-
- public:
- ASConcurrentMarkSweepGeneration(ReservedSpace rs, size_t initial_byte_size,
- int level, CardTableRS* ct,
- bool use_adaptive_freelists,
- FreeBlockDictionary::DictionaryChoice
- dictionaryChoice) :
- ConcurrentMarkSweepGeneration(rs, initial_byte_size, level, ct,
- use_adaptive_freelists, dictionaryChoice) {}
-
- virtual const char* short_name() const { return "ASCMS"; }
- virtual Generation::Name kind() { return Generation::ASConcurrentMarkSweep; }
-
- virtual void update_counters();
- virtual void update_counters(size_t used);
-};
-
//
// Closures of various sorts used by CMS to accomplish its work
//
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
index aba4dbb11f3..74c079d8ccf 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
@@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "classfile/symbolTable.hpp"
+#include "code/codeCache.hpp"
#include "gc_implementation/g1/concurrentMark.inline.hpp"
#include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
@@ -39,6 +40,7 @@
#include "gc_implementation/shared/gcTimer.hpp"
#include "gc_implementation/shared/gcTrace.hpp"
#include "gc_implementation/shared/gcTraceTime.hpp"
+#include "memory/allocation.hpp"
#include "memory/genOopClosures.inline.hpp"
#include "memory/referencePolicy.hpp"
#include "memory/resourceArea.hpp"
@@ -58,8 +60,8 @@ CMBitMapRO::CMBitMapRO(int shifter) :
_bmWordSize = 0;
}
-HeapWord* CMBitMapRO::getNextMarkedWordAddress(HeapWord* addr,
- HeapWord* limit) const {
+HeapWord* CMBitMapRO::getNextMarkedWordAddress(const HeapWord* addr,
+ const HeapWord* limit) const {
// First we must round addr *up* to a possible object boundary.
addr = (HeapWord*)align_size_up((intptr_t)addr,
HeapWordSize << _shifter);
@@ -76,8 +78,8 @@ HeapWord* CMBitMapRO::getNextMarkedWordAddress(HeapWord* addr,
return nextAddr;
}
-HeapWord* CMBitMapRO::getNextUnmarkedWordAddress(HeapWord* addr,
- HeapWord* limit) const {
+HeapWord* CMBitMapRO::getNextUnmarkedWordAddress(const HeapWord* addr,
+ const HeapWord* limit) const {
size_t addrOffset = heapWordToOffset(addr);
if (limit == NULL) {
limit = _bmStartWord + _bmWordSize;
@@ -1223,6 +1225,9 @@ public:
};
void ConcurrentMark::scanRootRegions() {
+ // Start of concurrent marking.
+ ClassLoaderDataGraph::clear_claimed_marks();
+
// scan_in_progress() will have been set to true only if there was
// at least one root region to scan. So, if it's false, we
// should not attempt to do any further work.
@@ -1271,7 +1276,7 @@ void ConcurrentMark::markFromRoots() {
CMConcurrentMarkingTask markingTask(this, cmThread());
if (use_parallel_marking_threads()) {
_parallel_workers->set_active_workers((int)active_workers);
- // Don't set _n_par_threads because it affects MT in process_strong_roots()
+ // Don't set _n_par_threads because it affects MT in process_roots()
// and the decisions on that MT processing is made elsewhere.
assert(_parallel_workers->active_workers() > 0, "Should have been set");
_parallel_workers->run_task(&markingTask);
@@ -2142,23 +2147,29 @@ void ConcurrentMark::cleanup() {
// Update the soft reference policy with the new heap occupancy.
Universe::update_heap_info_at_gc();
- // We need to make this be a "collection" so any collection pause that
- // races with it goes around and waits for completeCleanup to finish.
- g1h->increment_total_collections();
-
- // We reclaimed old regions so we should calculate the sizes to make
- // sure we update the old gen/space data.
- g1h->g1mm()->update_sizes();
-
if (VerifyDuringGC) {
HandleMark hm; // handle scope
Universe::heap()->prepare_for_verify();
Universe::verify(VerifyOption_G1UsePrevMarking,
" VerifyDuringGC:(after)");
}
+
g1h->check_bitmaps("Cleanup End");
g1h->verify_region_sets_optional();
+
+ // We need to make this be a "collection" so any collection pause that
+ // races with it goes around and waits for completeCleanup to finish.
+ g1h->increment_total_collections();
+
+ // Clean out dead classes and update Metaspace sizes.
+ ClassLoaderDataGraph::purge();
+ MetaspaceGC::compute_new_size();
+
+ // We reclaimed old regions so we should calculate the sizes to make
+ // sure we update the old gen/space data.
+ g1h->g1mm()->update_sizes();
+
g1h->trace_heap_after_concurrent_cycle();
}
@@ -2445,6 +2456,26 @@ void G1CMRefProcTaskExecutor::execute(EnqueueTask& enq_task) {
_g1h->set_par_threads(0);
}
+void ConcurrentMark::weakRefsWorkParallelPart(BoolObjectClosure* is_alive, bool purged_classes) {
+ G1CollectedHeap::heap()->parallel_cleaning(is_alive, true, true, purged_classes);
+}
+
+// Helper class to get rid of some boilerplate code.
+class G1RemarkGCTraceTime : public GCTraceTime {
+ static bool doit_and_prepend(bool doit) {
+ if (doit) {
+ gclog_or_tty->put(' ');
+ }
+ return doit;
+ }
+
+ public:
+ G1RemarkGCTraceTime(const char* title, bool doit)
+ : GCTraceTime(title, doit_and_prepend(doit), false, G1CollectedHeap::heap()->gc_timer_cm(),
+ G1CollectedHeap::heap()->concurrent_mark()->concurrent_gc_id()) {
+ }
+};
+
void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) {
if (has_overflown()) {
// Skip processing the discovered references if we have
@@ -2557,9 +2588,28 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) {
return;
}
- g1h->unlink_string_and_symbol_table(&g1_is_alive,
- /* process_strings */ false, // currently strings are always roots
- /* process_symbols */ true);
+ assert(_markStack.isEmpty(), "Marking should have completed");
+
+ // Unload Klasses, String, Symbols, Code Cache, etc.
+
+ G1RemarkGCTraceTime trace("Unloading", G1Log::finer());
+
+ bool purged_classes;
+
+ {
+ G1RemarkGCTraceTime trace("System Dictionary Unloading", G1Log::finest());
+ purged_classes = SystemDictionary::do_unloading(&g1_is_alive);
+ }
+
+ {
+ G1RemarkGCTraceTime trace("Parallel Unloading", G1Log::finest());
+ weakRefsWorkParallelPart(&g1_is_alive, purged_classes);
+ }
+
+ if (G1StringDedup::is_enabled()) {
+ G1RemarkGCTraceTime trace("String Deduplication Unlink", G1Log::finest());
+ G1StringDedup::unlink(&g1_is_alive);
+ }
}
void ConcurrentMark::swapMarkBitMaps() {
@@ -2568,6 +2618,57 @@ void ConcurrentMark::swapMarkBitMaps() {
_nextMarkBitMap = (CMBitMap*) temp;
}
+class CMObjectClosure;
+
+// Closure for iterating over objects, currently only used for
+// processing SATB buffers.
+class CMObjectClosure : public ObjectClosure {
+private:
+ CMTask* _task;
+
+public:
+ void do_object(oop obj) {
+ _task->deal_with_reference(obj);
+ }
+
+ CMObjectClosure(CMTask* task) : _task(task) { }
+};
+
+class G1RemarkThreadsClosure : public ThreadClosure {
+ CMObjectClosure _cm_obj;
+ G1CMOopClosure _cm_cl;
+ MarkingCodeBlobClosure _code_cl;
+ int _thread_parity;
+ bool _is_par;
+
+ public:
+ G1RemarkThreadsClosure(G1CollectedHeap* g1h, CMTask* task, bool is_par) :
+ _cm_obj(task), _cm_cl(g1h, g1h->concurrent_mark(), task), _code_cl(&_cm_cl, !CodeBlobToOopClosure::FixRelocations),
+ _thread_parity(SharedHeap::heap()->strong_roots_parity()), _is_par(is_par) {}
+
+ void do_thread(Thread* thread) {
+ if (thread->is_Java_thread()) {
+ if (thread->claim_oops_do(_is_par, _thread_parity)) {
+ JavaThread* jt = (JavaThread*)thread;
+
+ // In theory it should not be neccessary to explicitly walk the nmethods to find roots for concurrent marking
+ // however the liveness of oops reachable from nmethods have very complex lifecycles:
+ // * Alive if on the stack of an executing method
+ // * Weakly reachable otherwise
+ // Some objects reachable from nmethods, such as the class loader (or klass_holder) of the receiver should be
+ // live by the SATB invariant but other oops recorded in nmethods may behave differently.
+ jt->nmethods_do(&_code_cl);
+
+ jt->satb_mark_queue().apply_closure_and_empty(&_cm_obj);
+ }
+ } else if (thread->is_VM_thread()) {
+ if (thread->claim_oops_do(_is_par, _thread_parity)) {
+ JavaThread::satb_mark_queue_set().shared_satb_queue()->apply_closure_and_empty(&_cm_obj);
+ }
+ }
+ }
+};
+
class CMRemarkTask: public AbstractGangTask {
private:
ConcurrentMark* _cm;
@@ -2579,6 +2680,14 @@ public:
if (worker_id < _cm->active_tasks()) {
CMTask* task = _cm->task(worker_id);
task->record_start_time();
+ {
+ ResourceMark rm;
+ HandleMark hm;
+
+ G1RemarkThreadsClosure threads_f(G1CollectedHeap::heap(), task, !_is_serial);
+ Threads::threads_do(&threads_f);
+ }
+
do {
task->do_marking_step(1000000000.0 /* something very large */,
true /* do_termination */,
@@ -2601,6 +2710,8 @@ void ConcurrentMark::checkpointRootsFinalWork() {
HandleMark hm;
G1CollectedHeap* g1h = G1CollectedHeap::heap();
+ G1RemarkGCTraceTime trace("Finalize Marking", G1Log::finer());
+
g1h->ensure_parsability(false);
if (G1CollectedHeap::use_parallel_gc_threads()) {
@@ -3430,20 +3541,6 @@ public:
}
};
-// Closure for iterating over objects, currently only used for
-// processing SATB buffers.
-class CMObjectClosure : public ObjectClosure {
-private:
- CMTask* _task;
-
-public:
- void do_object(oop obj) {
- _task->deal_with_reference(obj);
- }
-
- CMObjectClosure(CMTask* task) : _task(task) { }
-};
-
G1CMOopClosure::G1CMOopClosure(G1CollectedHeap* g1h,
ConcurrentMark* cm,
CMTask* task)
@@ -3908,15 +4005,6 @@ void CMTask::drain_satb_buffers() {
}
}
- if (!concurrent() && !has_aborted()) {
- // We should only do this during remark.
- if (G1CollectedHeap::use_parallel_gc_threads()) {
- satb_mq_set.par_iterate_closure_all_threads(_worker_id);
- } else {
- satb_mq_set.iterate_closure_all_threads();
- }
- }
-
_draining_satb_buffers = false;
assert(has_aborted() ||
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
index 1e4ad366c75..d0b67b39f97 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
@@ -25,6 +25,7 @@
#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_HPP
#define SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_HPP
+#include "classfile/javaClasses.hpp"
#include "gc_implementation/g1/heapRegionSet.hpp"
#include "gc_implementation/shared/gcId.hpp"
#include "utilities/taskqueue.hpp"
@@ -86,19 +87,19 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
// Return the address corresponding to the next marked bit at or after
// "addr", and before "limit", if "limit" is non-NULL. If there is no
// such bit, returns "limit" if that is non-NULL, or else "endWord()".
- HeapWord* getNextMarkedWordAddress(HeapWord* addr,
- HeapWord* limit = NULL) const;
+ HeapWord* getNextMarkedWordAddress(const HeapWord* addr,
+ const HeapWord* limit = NULL) const;
// Return the address corresponding to the next unmarked bit at or after
// "addr", and before "limit", if "limit" is non-NULL. If there is no
// such bit, returns "limit" if that is non-NULL, or else "endWord()".
- HeapWord* getNextUnmarkedWordAddress(HeapWord* addr,
- HeapWord* limit = NULL) const;
+ HeapWord* getNextUnmarkedWordAddress(const HeapWord* addr,
+ const HeapWord* limit = NULL) const;
// conversion utilities
HeapWord* offsetToHeapWord(size_t offset) const {
return _bmStartWord + (offset << _shifter);
}
- size_t heapWordToOffset(HeapWord* addr) const {
+ size_t heapWordToOffset(const HeapWord* addr) const {
return pointer_delta(addr, _bmStartWord) >> _shifter;
}
int heapWordDiffToOffsetDiff(size_t diff) const;
@@ -476,6 +477,7 @@ protected:
ForceOverflowSettings _force_overflow_conc;
ForceOverflowSettings _force_overflow_stw;
+ void weakRefsWorkParallelPart(BoolObjectClosure* is_alive, bool purged_classes);
void weakRefsWork(bool clear_all_soft_refs);
void swapMarkBitMaps();
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.inline.hpp
index 05efc6ebc3d..2f3529d3e3c 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.inline.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.inline.hpp
@@ -26,6 +26,7 @@
#define SHARE_VM_GC_IMPLEMENTATION_G1_G1ALLOCREGION_INLINE_HPP
#include "gc_implementation/g1/g1AllocRegion.hpp"
+#include "gc_implementation/g1/heapRegion.inline.hpp"
inline HeapWord* G1AllocRegion::allocate(HeapRegion* alloc_region,
size_t word_size,
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
index c07fa50f04d..c7d4ff3431a 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
@@ -426,7 +426,7 @@ G1BlockOffsetArray::forward_to_block_containing_addr_slow(HeapWord* q,
q = n;
oop obj = oop(q);
if (obj->klass_or_null() == NULL) return q;
- n += obj->size();
+ n += block_size(q);
}
assert(q <= next_boundary && n > next_boundary, "Consequence of loop");
// [q, n) is the block that crosses the boundary.
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp
index 24f97f35dcb..4cf0a06cd74 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp
@@ -26,7 +26,8 @@
#define SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_INLINE_HPP
#include "gc_implementation/g1/g1BlockOffsetTable.hpp"
-#include "gc_implementation/g1/heapRegion.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/heapRegion.inline.hpp"
#include "memory/space.hpp"
inline HeapWord* G1BlockOffsetTable::block_start(const void* addr) {
@@ -112,7 +113,7 @@ forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n,
q = n;
oop obj = oop(q);
if (obj->klass_or_null() == NULL) return q;
- n += obj->size();
+ n += block_size(q);
}
assert(q <= n, "wrong order for q and addr");
assert(addr < n, "wrong order for addr and n");
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp
index fbe7095f75c..159a445b325 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.cpp
@@ -30,23 +30,52 @@
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-G1CodeRootChunk::G1CodeRootChunk() : _top(NULL), _next(NULL), _prev(NULL) {
+G1CodeRootChunk::G1CodeRootChunk() : _top(NULL), _next(NULL), _prev(NULL), _free(NULL) {
_top = bottom();
}
void G1CodeRootChunk::reset() {
_next = _prev = NULL;
+ _free = NULL;
_top = bottom();
}
void G1CodeRootChunk::nmethods_do(CodeBlobClosure* cl) {
- nmethod** cur = bottom();
+ NmethodOrLink* cur = bottom();
while (cur != _top) {
- cl->do_code_blob(*cur);
+ if (is_nmethod(cur)) {
+ cl->do_code_blob(cur->_nmethod);
+ }
cur++;
}
}
+bool G1CodeRootChunk::remove_lock_free(nmethod* method) {
+ NmethodOrLink* cur = bottom();
+
+ for (NmethodOrLink* cur = bottom(); cur != _top; cur++) {
+ if (cur->_nmethod == method) {
+ bool result = Atomic::cmpxchg_ptr(NULL, &cur->_nmethod, method) == method;
+
+ if (!result) {
+ // Someone else cleared out this entry.
+ return false;
+ }
+
+ // The method was cleared. Time to link it into the free list.
+ NmethodOrLink* prev_free;
+ do {
+ prev_free = (NmethodOrLink*)_free;
+ cur->_link = prev_free;
+ } while (Atomic::cmpxchg_ptr(cur, &_free, prev_free) != prev_free);
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
G1CodeRootChunkManager::G1CodeRootChunkManager() : _free_list(), _num_chunks_handed_out(0) {
_free_list.initialize();
_free_list.set_size(G1CodeRootChunk::word_size());
@@ -140,34 +169,43 @@ G1CodeRootSet::~G1CodeRootSet() {
void G1CodeRootSet::add(nmethod* method) {
if (!contains(method)) {
- // Try to add the nmethod. If there is not enough space, get a new chunk.
- if (_list.head() == NULL || _list.head()->is_full()) {
- G1CodeRootChunk* cur = new_chunk();
+ // Find the first chunk that isn't full.
+ G1CodeRootChunk* cur = _list.head();
+ while (cur != NULL) {
+ if (!cur->is_full()) {
+ break;
+ }
+ cur = cur->next();
+ }
+
+ // All chunks are full, get a new chunk.
+ if (cur == NULL) {
+ cur = new_chunk();
_list.return_chunk_at_head(cur);
}
- bool result = _list.head()->add(method);
+
+ // Add the nmethod.
+ bool result = cur->add(method);
+
guarantee(result, err_msg("Not able to add nmethod "PTR_FORMAT" to newly allocated chunk.", method));
+
_length++;
}
}
-void G1CodeRootSet::remove(nmethod* method) {
+void G1CodeRootSet::remove_lock_free(nmethod* method) {
G1CodeRootChunk* found = find(method);
if (found != NULL) {
- bool result = found->remove(method);
- guarantee(result, err_msg("could not find nmethod "PTR_FORMAT" during removal although we previously found it", method));
- // eventually free completely emptied chunk
- if (found->is_empty()) {
- _list.remove_chunk(found);
- free(found);
+ bool result = found->remove_lock_free(method);
+ if (result) {
+ Atomic::dec_ptr((volatile intptr_t*)&_length);
}
- _length--;
}
assert(!contains(method), err_msg(PTR_FORMAT" still contains nmethod "PTR_FORMAT, this, method));
}
nmethod* G1CodeRootSet::pop() {
- do {
+ while (true) {
G1CodeRootChunk* cur = _list.head();
if (cur == NULL) {
assert(_length == 0, "when there are no chunks, there should be no elements");
@@ -180,7 +218,7 @@ nmethod* G1CodeRootSet::pop() {
} else {
free(_list.get_chunk_at_head());
}
- } while (true);
+ }
}
G1CodeRootChunk* G1CodeRootSet::find(nmethod* method) {
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.hpp
index 84008213dbc..c351330f12f 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CodeCacheRemSet.hpp
@@ -31,6 +31,14 @@
class CodeBlobClosure;
+// The elements of the G1CodeRootChunk is either:
+// 1) nmethod pointers
+// 2) nodes in an internally chained free list
+typedef union {
+ nmethod* _nmethod;
+ void* _link;
+} NmethodOrLink;
+
class G1CodeRootChunk : public CHeapObj {
private:
static const int NUM_ENTRIES = 32;
@@ -38,16 +46,28 @@ class G1CodeRootChunk : public CHeapObj {
G1CodeRootChunk* _next;
G1CodeRootChunk* _prev;
- nmethod** _top;
+ NmethodOrLink* _top;
+ // First free position within the chunk.
+ volatile NmethodOrLink* _free;
- nmethod* _data[NUM_ENTRIES];
+ NmethodOrLink _data[NUM_ENTRIES];
- nmethod** bottom() const {
- return (nmethod**) &(_data[0]);
+ NmethodOrLink* bottom() const {
+ return (NmethodOrLink*) &(_data[0]);
}
- nmethod** end() const {
- return (nmethod**) &(_data[NUM_ENTRIES]);
+ NmethodOrLink* end() const {
+ return (NmethodOrLink*) &(_data[NUM_ENTRIES]);
+ }
+
+ bool is_link(NmethodOrLink* nmethod_or_link) {
+ return nmethod_or_link->_link == NULL ||
+ (bottom() <= nmethod_or_link->_link
+ && nmethod_or_link->_link < end());
+ }
+
+ bool is_nmethod(NmethodOrLink* nmethod_or_link) {
+ return !is_link(nmethod_or_link);
}
public:
@@ -85,46 +105,55 @@ class G1CodeRootChunk : public CHeapObj {
}
bool is_full() const {
- return _top == (nmethod**)end();
+ return _top == end() && _free == NULL;
}
bool contains(nmethod* method) {
- nmethod** cur = bottom();
+ NmethodOrLink* cur = bottom();
while (cur != _top) {
- if (*cur == method) return true;
+ if (cur->_nmethod == method) return true;
cur++;
}
return false;
}
bool add(nmethod* method) {
- if (is_full()) return false;
- *_top = method;
- _top++;
+ if (is_full()) {
+ return false;
+ }
+
+ if (_free != NULL) {
+ // Take from internally chained free list
+ NmethodOrLink* first_free = (NmethodOrLink*)_free;
+ _free = (NmethodOrLink*)_free->_link;
+ first_free->_nmethod = method;
+ } else {
+ // Take from top.
+ _top->_nmethod = method;
+ _top++;
+ }
+
return true;
}
- bool remove(nmethod* method) {
- nmethod** cur = bottom();
- while (cur != _top) {
- if (*cur == method) {
- memmove(cur, cur + 1, (_top - (cur + 1)) * sizeof(nmethod**));
- _top--;
- return true;
- }
- cur++;
- }
- return false;
- }
+ bool remove_lock_free(nmethod* method);
void nmethods_do(CodeBlobClosure* blk);
nmethod* pop() {
- if (is_empty()) {
- return NULL;
+ if (_free != NULL) {
+ // Kill the free list.
+ _free = NULL;
}
- _top--;
- return *_top;
+
+ while (!is_empty()) {
+ _top--;
+ if (is_nmethod(_top)) {
+ return _top->_nmethod;
+ }
+ }
+
+ return NULL;
}
};
@@ -193,7 +222,7 @@ class G1CodeRootSet VALUE_OBJ_CLASS_SPEC {
// method is likely to be repeatedly called with the same nmethod.
void add(nmethod* method);
- void remove(nmethod* method);
+ void remove_lock_free(nmethod* method);
nmethod* pop();
bool contains(nmethod* method);
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
index f020f0d53a1..aca5699351b 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
@@ -44,6 +44,7 @@
#include "gc_implementation/g1/g1Log.hpp"
#include "gc_implementation/g1/g1MarkSweep.hpp"
#include "gc_implementation/g1/g1OopClosures.inline.hpp"
+#include "gc_implementation/g1/g1ParScanThreadState.inline.hpp"
#include "gc_implementation/g1/g1RemSet.inline.hpp"
#include "gc_implementation/g1/g1StringDedup.hpp"
#include "gc_implementation/g1/g1YCTypes.hpp"
@@ -56,6 +57,7 @@
#include "gc_implementation/shared/gcTrace.hpp"
#include "gc_implementation/shared/gcTraceTime.hpp"
#include "gc_implementation/shared/isGCActiveMark.hpp"
+#include "memory/allocation.hpp"
#include "memory/gcLocker.inline.hpp"
#include "memory/generationSpec.hpp"
#include "memory/iterator.hpp"
@@ -63,11 +65,9 @@
#include "oops/oop.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
#include "runtime/atomic.inline.hpp"
-#include "runtime/prefetch.inline.hpp"
#include "runtime/orderAccess.inline.hpp"
#include "runtime/vmThread.hpp"
#include "utilities/globalDefinitions.hpp"
-#include "utilities/ticks.hpp"
size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0;
@@ -92,10 +92,10 @@ size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0;
// G1ParVerifyTask uses heap_region_par_iterate_chunked() for parallelism.
// The number of GC workers is passed to heap_region_par_iterate_chunked().
// It does use run_task() which sets _n_workers in the task.
-// G1ParTask executes g1_process_strong_roots() ->
-// SharedHeap::process_strong_roots() which calls eventually to
+// G1ParTask executes g1_process_roots() ->
+// SharedHeap::process_roots() which calls eventually to
// CardTableModRefBS::par_non_clean_card_iterate_work() which uses
-// SequentialSubTasksDone. SharedHeap::process_strong_roots() also
+// SequentialSubTasksDone. SharedHeap::process_roots() also
// directly uses SubTasksDone (_process_strong_tasks field in SharedHeap).
//
@@ -3380,25 +3380,19 @@ void G1CollectedHeap::verify(bool silent, VerifyOption vo) {
if (!silent) { gclog_or_tty->print("Roots "); }
VerifyRootsClosure rootsCl(vo);
VerifyKlassClosure klassCl(this, &rootsCl);
+ CLDToKlassAndOopClosure cldCl(&klassCl, &rootsCl, false);
// We apply the relevant closures to all the oops in the
- // system dictionary, class loader data graph and the string table.
- // Don't verify the code cache here, since it's verified below.
- const int so = SO_AllClasses | SO_Strings;
-
- // Need cleared claim bits for the strong roots processing
- ClassLoaderDataGraph::clear_claimed_marks();
-
- process_strong_roots(true, // activate StrongRootsScope
- ScanningOption(so), // roots scanning options
- &rootsCl,
- &klassCl
- );
-
- // Verify the nmethods in the code cache.
+ // system dictionary, class loader data graph, the string table
+ // and the nmethods in the code cache.
G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo);
G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl);
- CodeCache::blobs_do(&blobsCl);
+
+ process_all_roots(true, // activate StrongRootsScope
+ SO_AllCodeCache, // roots scanning options
+ &rootsCl,
+ &cldCl,
+ &blobsCl);
bool failures = rootsCl.failures() || codeRootsCl.failures();
@@ -3980,6 +3974,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
increment_gc_time_stamp();
verify_before_gc();
+
check_bitmaps("GC Start");
COMPILER2_PRESENT(DerivedPointerTable::clear());
@@ -4330,11 +4325,7 @@ void G1CollectedHeap::release_mutator_alloc_region() {
assert(_mutator_alloc_region.get() == NULL, "post-condition");
}
-void G1CollectedHeap::init_gc_alloc_regions(EvacuationInfo& evacuation_info) {
- assert_at_safepoint(true /* should_be_vm_thread */);
-
- _survivor_gc_alloc_region.init();
- _old_gc_alloc_region.init();
+void G1CollectedHeap::use_retained_old_gc_alloc_region(EvacuationInfo& evacuation_info) {
HeapRegion* retained_region = _retained_old_gc_alloc_region;
_retained_old_gc_alloc_region = NULL;
@@ -4352,7 +4343,7 @@ void G1CollectedHeap::init_gc_alloc_regions(EvacuationInfo& evacuation_info) {
!(retained_region->top() == retained_region->end()) &&
!retained_region->is_empty() &&
!retained_region->isHumongous()) {
- retained_region->set_saved_mark();
+ retained_region->record_top_and_timestamp();
// The retained region was added to the old region set when it was
// retired. We have to remove it now, since we don't allow regions
// we allocate to in the region sets. We'll re-add it later, when
@@ -4366,6 +4357,15 @@ void G1CollectedHeap::init_gc_alloc_regions(EvacuationInfo& evacuation_info) {
}
}
+void G1CollectedHeap::init_gc_alloc_regions(EvacuationInfo& evacuation_info) {
+ assert_at_safepoint(true /* should_be_vm_thread */);
+
+ _survivor_gc_alloc_region.init();
+ _old_gc_alloc_region.init();
+
+ use_retained_old_gc_alloc_region(evacuation_info);
+}
+
void G1CollectedHeap::release_gc_alloc_regions(uint no_of_gc_workers, EvacuationInfo& evacuation_info) {
evacuation_info.set_allocation_regions(_survivor_gc_alloc_region.count() +
_old_gc_alloc_region.count());
@@ -4559,126 +4559,6 @@ HeapWord* G1CollectedHeap::par_allocate_during_gc(GCAllocPurpose purpose,
G1ParGCAllocBuffer::G1ParGCAllocBuffer(size_t gclab_word_size) :
ParGCAllocBuffer(gclab_word_size), _retired(true) { }
-G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num, ReferenceProcessor* rp)
- : _g1h(g1h),
- _refs(g1h->task_queue(queue_num)),
- _dcq(&g1h->dirty_card_queue_set()),
- _ct_bs(g1h->g1_barrier_set()),
- _g1_rem(g1h->g1_rem_set()),
- _hash_seed(17), _queue_num(queue_num),
- _term_attempts(0),
- _surviving_alloc_buffer(g1h->desired_plab_sz(GCAllocForSurvived)),
- _tenured_alloc_buffer(g1h->desired_plab_sz(GCAllocForTenured)),
- _age_table(false), _scanner(g1h, this, rp),
- _strong_roots_time(0), _term_time(0),
- _alloc_buffer_waste(0), _undo_waste(0) {
- // we allocate G1YoungSurvRateNumRegions plus one entries, since
- // we "sacrifice" entry 0 to keep track of surviving bytes for
- // non-young regions (where the age is -1)
- // We also add a few elements at the beginning and at the end in
- // an attempt to eliminate cache contention
- uint real_length = 1 + _g1h->g1_policy()->young_cset_region_length();
- uint array_length = PADDING_ELEM_NUM +
- real_length +
- PADDING_ELEM_NUM;
- _surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length, mtGC);
- if (_surviving_young_words_base == NULL)
- vm_exit_out_of_memory(array_length * sizeof(size_t), OOM_MALLOC_ERROR,
- "Not enough space for young surv histo.");
- _surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM;
- memset(_surviving_young_words, 0, (size_t) real_length * sizeof(size_t));
-
- _alloc_buffers[GCAllocForSurvived] = &_surviving_alloc_buffer;
- _alloc_buffers[GCAllocForTenured] = &_tenured_alloc_buffer;
-
- _start = os::elapsedTime();
-}
-
-void
-G1ParScanThreadState::print_termination_stats_hdr(outputStream* const st)
-{
- st->print_raw_cr("GC Termination Stats");
- st->print_raw_cr(" elapsed --strong roots-- -------termination-------"
- " ------waste (KiB)------");
- st->print_raw_cr("thr ms ms % ms % attempts"
- " total alloc undo");
- st->print_raw_cr("--- --------- --------- ------ --------- ------ --------"
- " ------- ------- -------");
-}
-
-void
-G1ParScanThreadState::print_termination_stats(int i,
- outputStream* const st) const
-{
- const double elapsed_ms = elapsed_time() * 1000.0;
- const double s_roots_ms = strong_roots_time() * 1000.0;
- const double term_ms = term_time() * 1000.0;
- st->print_cr("%3d %9.2f %9.2f %6.2f "
- "%9.2f %6.2f " SIZE_FORMAT_W(8) " "
- SIZE_FORMAT_W(7) " " SIZE_FORMAT_W(7) " " SIZE_FORMAT_W(7),
- i, elapsed_ms, s_roots_ms, s_roots_ms * 100 / elapsed_ms,
- term_ms, term_ms * 100 / elapsed_ms, term_attempts(),
- (alloc_buffer_waste() + undo_waste()) * HeapWordSize / K,
- alloc_buffer_waste() * HeapWordSize / K,
- undo_waste() * HeapWordSize / K);
-}
-
-#ifdef ASSERT
-bool G1ParScanThreadState::verify_ref(narrowOop* ref) const {
- assert(ref != NULL, "invariant");
- assert(UseCompressedOops, "sanity");
- assert(!has_partial_array_mask(ref), err_msg("ref=" PTR_FORMAT, ref));
- oop p = oopDesc::load_decode_heap_oop(ref);
- assert(_g1h->is_in_g1_reserved(p),
- err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, (void *)p));
- return true;
-}
-
-bool G1ParScanThreadState::verify_ref(oop* ref) const {
- assert(ref != NULL, "invariant");
- if (has_partial_array_mask(ref)) {
- // Must be in the collection set--it's already been copied.
- oop p = clear_partial_array_mask(ref);
- assert(_g1h->obj_in_cs(p),
- err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, (void *)p));
- } else {
- oop p = oopDesc::load_decode_heap_oop(ref);
- assert(_g1h->is_in_g1_reserved(p),
- err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, ref, (void *)p));
- }
- return true;
-}
-
-bool G1ParScanThreadState::verify_task(StarTask ref) const {
- if (ref.is_narrow()) {
- return verify_ref((narrowOop*) ref);
- } else {
- return verify_ref((oop*) ref);
- }
-}
-#endif // ASSERT
-
-void G1ParScanThreadState::trim_queue() {
- assert(_evac_failure_cl != NULL, "not set");
-
- StarTask ref;
- do {
- // Drain the overflow stack first, so other threads can steal.
- while (refs()->pop_overflow(ref)) {
- deal_with_reference(ref);
- }
-
- while (refs()->pop_local(ref)) {
- deal_with_reference(ref);
- }
- } while (!refs()->is_empty());
-}
-
-G1ParClosureSuper::G1ParClosureSuper(G1CollectedHeap* g1,
- G1ParScanThreadState* par_scan_state) :
- _g1(g1), _par_scan_state(par_scan_state),
- _worker_id(par_scan_state->queue_num()) { }
-
void G1ParCopyHelper::mark_object(oop obj) {
assert(!_g1->heap_region_containing(obj)->in_collection_set(), "should not mark objects in the CSet");
@@ -4701,107 +4581,6 @@ void G1ParCopyHelper::mark_forwarded_object(oop from_obj, oop to_obj) {
_cm->grayRoot(to_obj, (size_t) from_obj->size(), _worker_id);
}
-oop G1ParScanThreadState::copy_to_survivor_space(oop const old) {
- size_t word_sz = old->size();
- HeapRegion* from_region = _g1h->heap_region_containing_raw(old);
- // +1 to make the -1 indexes valid...
- int young_index = from_region->young_index_in_cset()+1;
- assert( (from_region->is_young() && young_index > 0) ||
- (!from_region->is_young() && young_index == 0), "invariant" );
- G1CollectorPolicy* g1p = _g1h->g1_policy();
- markOop m = old->mark();
- int age = m->has_displaced_mark_helper() ? m->displaced_mark_helper()->age()
- : m->age();
- GCAllocPurpose alloc_purpose = g1p->evacuation_destination(from_region, age,
- word_sz);
- HeapWord* obj_ptr = allocate(alloc_purpose, word_sz);
-#ifndef PRODUCT
- // Should this evacuation fail?
- if (_g1h->evacuation_should_fail()) {
- if (obj_ptr != NULL) {
- undo_allocation(alloc_purpose, obj_ptr, word_sz);
- obj_ptr = NULL;
- }
- }
-#endif // !PRODUCT
-
- if (obj_ptr == NULL) {
- // This will either forward-to-self, or detect that someone else has
- // installed a forwarding pointer.
- return _g1h->handle_evacuation_failure_par(this, old);
- }
-
- oop obj = oop(obj_ptr);
-
- // We're going to allocate linearly, so might as well prefetch ahead.
- Prefetch::write(obj_ptr, PrefetchCopyIntervalInBytes);
-
- oop forward_ptr = old->forward_to_atomic(obj);
- if (forward_ptr == NULL) {
- Copy::aligned_disjoint_words((HeapWord*) old, obj_ptr, word_sz);
-
- // alloc_purpose is just a hint to allocate() above, recheck the type of region
- // we actually allocated from and update alloc_purpose accordingly
- HeapRegion* to_region = _g1h->heap_region_containing_raw(obj_ptr);
- alloc_purpose = to_region->is_young() ? GCAllocForSurvived : GCAllocForTenured;
-
- if (g1p->track_object_age(alloc_purpose)) {
- // We could simply do obj->incr_age(). However, this causes a
- // performance issue. obj->incr_age() will first check whether
- // the object has a displaced mark by checking its mark word;
- // getting the mark word from the new location of the object
- // stalls. So, given that we already have the mark word and we
- // are about to install it anyway, it's better to increase the
- // age on the mark word, when the object does not have a
- // displaced mark word. We're not expecting many objects to have
- // a displaced marked word, so that case is not optimized
- // further (it could be...) and we simply call obj->incr_age().
-
- if (m->has_displaced_mark_helper()) {
- // in this case, we have to install the mark word first,
- // otherwise obj looks to be forwarded (the old mark word,
- // which contains the forward pointer, was copied)
- obj->set_mark(m);
- obj->incr_age();
- } else {
- m = m->incr_age();
- obj->set_mark(m);
- }
- age_table()->add(obj, word_sz);
- } else {
- obj->set_mark(m);
- }
-
- if (G1StringDedup::is_enabled()) {
- G1StringDedup::enqueue_from_evacuation(from_region->is_young(),
- to_region->is_young(),
- queue_num(),
- obj);
- }
-
- size_t* surv_young_words = surviving_young_words();
- surv_young_words[young_index] += word_sz;
-
- if (obj->is_objArray() && arrayOop(obj)->length() >= ParGCArrayScanChunk) {
- // We keep track of the next start index in the length field of
- // the to-space object. The actual length can be found in the
- // length field of the from-space object.
- arrayOop(obj)->set_length(0);
- oop* old_p = set_partial_array_mask(old);
- push_on_queue(old_p);
- } else {
- // No point in using the slower heap_region_containing() method,
- // given that we know obj is in the heap.
- _scanner.set_region(_g1h->heap_region_containing_raw(obj));
- obj->oop_iterate_backwards(&_scanner);
- }
- } else {
- undo_allocation(alloc_purpose, obj_ptr, word_sz);
- obj = forward_ptr;
- }
- return obj;
-}
-
template
void G1ParCopyHelper::do_klass_barrier(T* p, oop new_obj) {
if (_g1->heap_region_containing_raw(new_obj)->is_young()) {
@@ -4809,7 +4588,7 @@ void G1ParCopyHelper::do_klass_barrier(T* p, oop new_obj) {
}
}
-template
+template
template
void G1ParCopyClosure::do_oop_work(T* p) {
T heap_oop = oopDesc::load_heap_oop(p);
@@ -4831,7 +4610,7 @@ void G1ParCopyClosure::do_oop_work(T* p) {
}
assert(forwardee != NULL, "forwardee should not be NULL");
oopDesc::encode_store_heap_oop(p, forwardee);
- if (do_mark_object && forwardee != obj) {
+ if (do_mark_object != G1MarkNone && forwardee != obj) {
// If the object is self-forwarded we don't need to explicitly
// mark it, the evacuation failure protocol will do so.
mark_forwarded_object(obj, forwardee);
@@ -4842,9 +4621,8 @@ void G1ParCopyClosure::do_oop_work(T* p) {
}
} else {
// The object is not in collection set. If we're a root scanning
- // closure during an initial mark pause (i.e. do_mark_object will
- // be true) then attempt to mark the object.
- if (do_mark_object) {
+ // closure during an initial mark pause then attempt to mark the object.
+ if (do_mark_object == G1MarkFromRoot) {
mark_object(obj);
}
}
@@ -4854,8 +4632,8 @@ void G1ParCopyClosure::do_oop_work(T* p) {
}
}
-template void G1ParCopyClosure::do_oop_work(oop* p);
-template void G1ParCopyClosure::do_oop_work(narrowOop* p);
+template void G1ParCopyClosure::do_oop_work(oop* p);
+template void G1ParCopyClosure::do_oop_work(narrowOop* p);
class G1ParEvacuateFollowersClosure : public VoidClosure {
protected:
@@ -4891,24 +4669,10 @@ bool G1ParEvacuateFollowersClosure::offer_termination() {
}
void G1ParEvacuateFollowersClosure::do_void() {
- StarTask stolen_task;
G1ParScanThreadState* const pss = par_scan_state();
pss->trim_queue();
-
do {
- while (queues()->steal(pss->queue_num(), pss->hash_seed(), stolen_task)) {
- assert(pss->verify_task(stolen_task), "sanity");
- if (stolen_task.is_narrow()) {
- pss->deal_with_reference((narrowOop*) stolen_task);
- } else {
- pss->deal_with_reference((oop*) stolen_task);
- }
-
- // We've just processed a reference and we might have made
- // available new entries on the queues. So we have to make sure
- // we drain the queues as necessary.
- pss->trim_queue();
- }
+ pss->steal_and_trim_queue(queues());
} while (!offer_termination());
}
@@ -4954,8 +4718,7 @@ protected:
}
public:
- G1ParTask(G1CollectedHeap* g1h,
- RefToScanQueueSet *task_queues)
+ G1ParTask(G1CollectedHeap* g1h, RefToScanQueueSet *task_queues)
: AbstractGangTask("G1 collection"),
_g1h(g1h),
_queues(task_queues),
@@ -4983,6 +4746,51 @@ public:
_n_workers = active_workers;
}
+ // Helps out with CLD processing.
+ //
+ // During InitialMark we need to:
+ // 1) Scavenge all CLDs for the young GC.
+ // 2) Mark all objects directly reachable from strong CLDs.
+ template
+ class G1CLDClosure : public CLDClosure {
+ G1ParCopyClosure* _oop_closure;
+ G1ParCopyClosure _oop_in_klass_closure;
+ G1KlassScanClosure _klass_in_cld_closure;
+ bool _claim;
+
+ public:
+ G1CLDClosure(G1ParCopyClosure* oop_closure,
+ bool only_young, bool claim)
+ : _oop_closure(oop_closure),
+ _oop_in_klass_closure(oop_closure->g1(),
+ oop_closure->pss(),
+ oop_closure->rp()),
+ _klass_in_cld_closure(&_oop_in_klass_closure, only_young),
+ _claim(claim) {
+
+ }
+
+ void do_cld(ClassLoaderData* cld) {
+ cld->oops_do(_oop_closure, &_klass_in_cld_closure, _claim);
+ }
+ };
+
+ class G1CodeBlobClosure: public CodeBlobClosure {
+ OopClosure* _f;
+
+ public:
+ G1CodeBlobClosure(OopClosure* f) : _f(f) {}
+ void do_code_blob(CodeBlob* blob) {
+ nmethod* that = blob->as_nmethod_or_null();
+ if (that != NULL) {
+ if (!that->test_set_oops_do_mark()) {
+ that->oops_do(_f);
+ that->fix_oop_relocations();
+ }
+ }
+ }
+ };
+
void work(uint worker_id) {
if (worker_id >= _n_workers) return; // no work needed this round
@@ -5000,40 +4808,62 @@ public:
pss.set_evac_failure_closure(&evac_failure_cl);
- G1ParScanExtRootClosure only_scan_root_cl(_g1h, &pss, rp);
- G1ParScanMetadataClosure only_scan_metadata_cl(_g1h, &pss, rp);
+ bool only_young = _g1h->g1_policy()->gcs_are_young();
- G1ParScanAndMarkExtRootClosure scan_mark_root_cl(_g1h, &pss, rp);
- G1ParScanAndMarkMetadataClosure scan_mark_metadata_cl(_g1h, &pss, rp);
+ // Non-IM young GC.
+ G1ParCopyClosure scan_only_root_cl(_g1h, &pss, rp);
+ G1CLDClosure scan_only_cld_cl(&scan_only_root_cl,
+ only_young, // Only process dirty klasses.
+ false); // No need to claim CLDs.
+ // IM young GC.
+ // Strong roots closures.
+ G1ParCopyClosure scan_mark_root_cl(_g1h, &pss, rp);
+ G1CLDClosure scan_mark_cld_cl(&scan_mark_root_cl,
+ false, // Process all klasses.
+ true); // Need to claim CLDs.
+ // Weak roots closures.
+ G1ParCopyClosure scan_mark_weak_root_cl(_g1h, &pss, rp);
+ G1CLDClosure scan_mark_weak_cld_cl(&scan_mark_weak_root_cl,
+ false, // Process all klasses.
+ true); // Need to claim CLDs.
- bool only_young = _g1h->g1_policy()->gcs_are_young();
- G1KlassScanClosure scan_mark_klasses_cl_s(&scan_mark_metadata_cl, false);
- G1KlassScanClosure only_scan_klasses_cl_s(&only_scan_metadata_cl, only_young);
+ G1CodeBlobClosure scan_only_code_cl(&scan_only_root_cl);
+ G1CodeBlobClosure scan_mark_code_cl(&scan_mark_root_cl);
+ // IM Weak code roots are handled later.
- OopClosure* scan_root_cl = &only_scan_root_cl;
- G1KlassScanClosure* scan_klasses_cl = &only_scan_klasses_cl_s;
+ OopClosure* strong_root_cl;
+ OopClosure* weak_root_cl;
+ CLDClosure* strong_cld_cl;
+ CLDClosure* weak_cld_cl;
+ CodeBlobClosure* strong_code_cl;
if (_g1h->g1_policy()->during_initial_mark_pause()) {
// We also need to mark copied objects.
- scan_root_cl = &scan_mark_root_cl;
- scan_klasses_cl = &scan_mark_klasses_cl_s;
+ strong_root_cl = &scan_mark_root_cl;
+ weak_root_cl = &scan_mark_weak_root_cl;
+ strong_cld_cl = &scan_mark_cld_cl;
+ weak_cld_cl = &scan_mark_weak_cld_cl;
+ strong_code_cl = &scan_mark_code_cl;
+ } else {
+ strong_root_cl = &scan_only_root_cl;
+ weak_root_cl = &scan_only_root_cl;
+ strong_cld_cl = &scan_only_cld_cl;
+ weak_cld_cl = &scan_only_cld_cl;
+ strong_code_cl = &scan_only_code_cl;
}
- G1ParPushHeapRSClosure push_heap_rs_cl(_g1h, &pss);
- // Don't scan the scavengable methods in the code cache as part
- // of strong root scanning. The code roots that point into a
- // region in the collection set are scanned when we scan the
- // region's RSet.
- int so = SharedHeap::SO_AllClasses | SharedHeap::SO_Strings;
+ G1ParPushHeapRSClosure push_heap_rs_cl(_g1h, &pss);
pss.start_strong_roots();
- _g1h->g1_process_strong_roots(/* is scavenging */ true,
- SharedHeap::ScanningOption(so),
- scan_root_cl,
- &push_heap_rs_cl,
- scan_klasses_cl,
- worker_id);
+ _g1h->g1_process_roots(strong_root_cl,
+ weak_root_cl,
+ &push_heap_rs_cl,
+ strong_cld_cl,
+ weak_cld_cl,
+ strong_code_cl,
+ worker_id);
+
pss.end_strong_roots();
{
@@ -5053,7 +4883,7 @@ public:
pss.print_termination_stats(worker_id);
}
- assert(pss.refs()->is_empty(), "should be empty");
+ assert(pss.queue_is_empty(), "should be empty");
// Close the inner scope so that the ResourceMark and HandleMark
// destructors are executed here and are included as part of the
@@ -5071,24 +4901,31 @@ public:
void
G1CollectedHeap::
-g1_process_strong_roots(bool is_scavenging,
- ScanningOption so,
- OopClosure* scan_non_heap_roots,
- OopsInHeapRegionClosure* scan_rs,
- G1KlassScanClosure* scan_klasses,
- uint worker_i) {
+g1_process_roots(OopClosure* scan_non_heap_roots,
+ OopClosure* scan_non_heap_weak_roots,
+ OopsInHeapRegionClosure* scan_rs,
+ CLDClosure* scan_strong_clds,
+ CLDClosure* scan_weak_clds,
+ CodeBlobClosure* scan_strong_code,
+ uint worker_i) {
- // First scan the strong roots
+ // First scan the shared roots.
double ext_roots_start = os::elapsedTime();
double closure_app_time_sec = 0.0;
- BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
+ bool during_im = _g1h->g1_policy()->during_initial_mark_pause();
- process_strong_roots(false, // no scoping; this is parallel code
- so,
- &buf_scan_non_heap_roots,
- scan_klasses
- );
+ BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots);
+ BufferingOopClosure buf_scan_non_heap_weak_roots(scan_non_heap_weak_roots);
+
+ process_roots(false, // no scoping; this is parallel code
+ SharedHeap::SO_None,
+ &buf_scan_non_heap_roots,
+ &buf_scan_non_heap_weak_roots,
+ scan_strong_clds,
+ // Initial Mark handles the weak CLDs separately.
+ (during_im ? NULL : scan_weak_clds),
+ scan_strong_code);
// Now the CM ref_processor roots.
if (!_process_strong_tasks->is_task_claimed(G1H_PS_refProcessor_oops_do)) {
@@ -5099,10 +4936,21 @@ g1_process_strong_roots(bool is_scavenging,
ref_processor_cm()->weak_oops_do(&buf_scan_non_heap_roots);
}
+ if (during_im) {
+ // Barrier to make sure all workers passed
+ // the strong CLD and strong nmethods phases.
+ active_strong_roots_scope()->wait_until_all_workers_done_with_threads(n_par_threads());
+
+ // Now take the complement of the strong CLDs.
+ ClassLoaderDataGraph::roots_cld_do(NULL, scan_weak_clds);
+ }
+
// Finish up any enqueued closure apps (attributed as object copy time).
buf_scan_non_heap_roots.done();
+ buf_scan_non_heap_weak_roots.done();
- double obj_copy_time_sec = buf_scan_non_heap_roots.closure_app_seconds();
+ double obj_copy_time_sec = buf_scan_non_heap_roots.closure_app_seconds()
+ + buf_scan_non_heap_weak_roots.closure_app_seconds();
g1_policy()->phase_times()->record_obj_copy_time(worker_i, obj_copy_time_sec * 1000.0);
@@ -5126,22 +4974,10 @@ g1_process_strong_roots(bool is_scavenging,
}
g1_policy()->phase_times()->record_satb_filtering_time(worker_i, satb_filtering_ms);
- // If this is an initial mark pause, and we're not scanning
- // the entire code cache, we need to mark the oops in the
- // strong code root lists for the regions that are not in
- // the collection set.
- // Note all threads participate in this set of root tasks.
- double mark_strong_code_roots_ms = 0.0;
- if (g1_policy()->during_initial_mark_pause() && !(so & SO_AllCodeCache)) {
- double mark_strong_roots_start = os::elapsedTime();
- mark_strong_code_roots(worker_i);
- mark_strong_code_roots_ms = (os::elapsedTime() - mark_strong_roots_start) * 1000.0;
- }
- g1_policy()->phase_times()->record_strong_code_root_mark_time(worker_i, mark_strong_code_roots_ms);
-
// Now scan the complement of the collection set.
- CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */);
- g1_rem_set()->oops_into_collection_set_do(scan_rs, &eager_scan_code_roots, worker_i);
+ MarkingCodeBlobClosure scavenge_cs_nmethods(scan_non_heap_weak_roots, CodeBlobToOopClosure::FixRelocations);
+
+ g1_rem_set()->oops_into_collection_set_do(scan_rs, &scavenge_cs_nmethods, worker_i);
_process_strong_tasks->all_tasks_completed();
}
@@ -5163,7 +4999,8 @@ private:
bool _do_in_parallel;
public:
G1StringSymbolTableUnlinkTask(BoolObjectClosure* is_alive, bool process_strings, bool process_symbols) :
- AbstractGangTask("Par String/Symbol table unlink"), _is_alive(is_alive),
+ AbstractGangTask("String/Symbol Unlinking"),
+ _is_alive(is_alive),
_do_in_parallel(G1CollectedHeap::use_parallel_gc_threads()),
_process_strings(process_strings), _strings_processed(0), _strings_removed(0),
_process_symbols(process_symbols), _symbols_processed(0), _symbols_removed(0) {
@@ -5185,6 +5022,14 @@ public:
guarantee(!_process_symbols || !_do_in_parallel || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size,
err_msg("claim value %d after unlink less than initial symbol table size %d",
SymbolTable::parallel_claimed_index(), _initial_symbol_table_size));
+
+ if (G1TraceStringSymbolTableScrubbing) {
+ gclog_or_tty->print_cr("Cleaned string and symbol table, "
+ "strings: "SIZE_FORMAT" processed, "SIZE_FORMAT" removed, "
+ "symbols: "SIZE_FORMAT" processed, "SIZE_FORMAT" removed",
+ strings_processed(), strings_removed(),
+ symbols_processed(), symbols_removed());
+ }
}
void work(uint worker_id) {
@@ -5220,12 +5065,279 @@ public:
size_t symbols_removed() const { return (size_t)_symbols_removed; }
};
-void G1CollectedHeap::unlink_string_and_symbol_table(BoolObjectClosure* is_alive,
- bool process_strings, bool process_symbols) {
- uint n_workers = (G1CollectedHeap::use_parallel_gc_threads() ?
- _g1h->workers()->active_workers() : 1);
+class G1CodeCacheUnloadingTask VALUE_OBJ_CLASS_SPEC {
+private:
+ static Monitor* _lock;
- G1StringSymbolTableUnlinkTask g1_unlink_task(is_alive, process_strings, process_symbols);
+ BoolObjectClosure* const _is_alive;
+ const bool _unloading_occurred;
+ const uint _num_workers;
+
+ // Variables used to claim nmethods.
+ nmethod* _first_nmethod;
+ volatile nmethod* _claimed_nmethod;
+
+ // The list of nmethods that need to be processed by the second pass.
+ volatile nmethod* _postponed_list;
+ volatile uint _num_entered_barrier;
+
+ public:
+ G1CodeCacheUnloadingTask(uint num_workers, BoolObjectClosure* is_alive, bool unloading_occurred) :
+ _is_alive(is_alive),
+ _unloading_occurred(unloading_occurred),
+ _num_workers(num_workers),
+ _first_nmethod(NULL),
+ _claimed_nmethod(NULL),
+ _postponed_list(NULL),
+ _num_entered_barrier(0)
+ {
+ nmethod::increase_unloading_clock();
+ _first_nmethod = CodeCache::alive_nmethod(CodeCache::first());
+ _claimed_nmethod = (volatile nmethod*)_first_nmethod;
+ }
+
+ ~G1CodeCacheUnloadingTask() {
+ CodeCache::verify_clean_inline_caches();
+
+ CodeCache::set_needs_cache_clean(false);
+ guarantee(CodeCache::scavenge_root_nmethods() == NULL, "Must be");
+
+ CodeCache::verify_icholder_relocations();
+ }
+
+ private:
+ void add_to_postponed_list(nmethod* nm) {
+ nmethod* old;
+ do {
+ old = (nmethod*)_postponed_list;
+ nm->set_unloading_next(old);
+ } while ((nmethod*)Atomic::cmpxchg_ptr(nm, &_postponed_list, old) != old);
+ }
+
+ void clean_nmethod(nmethod* nm) {
+ bool postponed = nm->do_unloading_parallel(_is_alive, _unloading_occurred);
+
+ if (postponed) {
+ // This nmethod referred to an nmethod that has not been cleaned/unloaded yet.
+ add_to_postponed_list(nm);
+ }
+
+ // Mark that this thread has been cleaned/unloaded.
+ // After this call, it will be safe to ask if this nmethod was unloaded or not.
+ nm->set_unloading_clock(nmethod::global_unloading_clock());
+ }
+
+ void clean_nmethod_postponed(nmethod* nm) {
+ nm->do_unloading_parallel_postponed(_is_alive, _unloading_occurred);
+ }
+
+ static const int MaxClaimNmethods = 16;
+
+ void claim_nmethods(nmethod** claimed_nmethods, int *num_claimed_nmethods) {
+ nmethod* first;
+ nmethod* last;
+
+ do {
+ *num_claimed_nmethods = 0;
+
+ first = last = (nmethod*)_claimed_nmethod;
+
+ if (first != NULL) {
+ for (int i = 0; i < MaxClaimNmethods; i++) {
+ last = CodeCache::alive_nmethod(CodeCache::next(last));
+
+ if (last == NULL) {
+ break;
+ }
+
+ claimed_nmethods[i] = last;
+ (*num_claimed_nmethods)++;
+ }
+ }
+
+ } while ((nmethod*)Atomic::cmpxchg_ptr(last, &_claimed_nmethod, first) != first);
+ }
+
+ nmethod* claim_postponed_nmethod() {
+ nmethod* claim;
+ nmethod* next;
+
+ do {
+ claim = (nmethod*)_postponed_list;
+ if (claim == NULL) {
+ return NULL;
+ }
+
+ next = claim->unloading_next();
+
+ } while ((nmethod*)Atomic::cmpxchg_ptr(next, &_postponed_list, claim) != claim);
+
+ return claim;
+ }
+
+ public:
+ // Mark that we're done with the first pass of nmethod cleaning.
+ void barrier_mark(uint worker_id) {
+ MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag);
+ _num_entered_barrier++;
+ if (_num_entered_barrier == _num_workers) {
+ ml.notify_all();
+ }
+ }
+
+ // See if we have to wait for the other workers to
+ // finish their first-pass nmethod cleaning work.
+ void barrier_wait(uint worker_id) {
+ if (_num_entered_barrier < _num_workers) {
+ MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag);
+ while (_num_entered_barrier < _num_workers) {
+ ml.wait(Mutex::_no_safepoint_check_flag, 0, false);
+ }
+ }
+ }
+
+ // Cleaning and unloading of nmethods. Some work has to be postponed
+ // to the second pass, when we know which nmethods survive.
+ void work_first_pass(uint worker_id) {
+ // The first nmethods is claimed by the first worker.
+ if (worker_id == 0 && _first_nmethod != NULL) {
+ clean_nmethod(_first_nmethod);
+ _first_nmethod = NULL;
+ }
+
+ int num_claimed_nmethods;
+ nmethod* claimed_nmethods[MaxClaimNmethods];
+
+ while (true) {
+ claim_nmethods(claimed_nmethods, &num_claimed_nmethods);
+
+ if (num_claimed_nmethods == 0) {
+ break;
+ }
+
+ for (int i = 0; i < num_claimed_nmethods; i++) {
+ clean_nmethod(claimed_nmethods[i]);
+ }
+ }
+ }
+
+ void work_second_pass(uint worker_id) {
+ nmethod* nm;
+ // Take care of postponed nmethods.
+ while ((nm = claim_postponed_nmethod()) != NULL) {
+ clean_nmethod_postponed(nm);
+ }
+ }
+};
+
+Monitor* G1CodeCacheUnloadingTask::_lock = new Monitor(Mutex::leaf, "Code Cache Unload lock");
+
+class G1KlassCleaningTask : public StackObj {
+ BoolObjectClosure* _is_alive;
+ volatile jint _clean_klass_tree_claimed;
+ ClassLoaderDataGraphKlassIteratorAtomic _klass_iterator;
+
+ public:
+ G1KlassCleaningTask(BoolObjectClosure* is_alive) :
+ _is_alive(is_alive),
+ _clean_klass_tree_claimed(0),
+ _klass_iterator() {
+ }
+
+ private:
+ bool claim_clean_klass_tree_task() {
+ if (_clean_klass_tree_claimed) {
+ return false;
+ }
+
+ return Atomic::cmpxchg(1, (jint*)&_clean_klass_tree_claimed, 0) == 0;
+ }
+
+ InstanceKlass* claim_next_klass() {
+ Klass* klass;
+ do {
+ klass =_klass_iterator.next_klass();
+ } while (klass != NULL && !klass->oop_is_instance());
+
+ return (InstanceKlass*)klass;
+ }
+
+public:
+
+ void clean_klass(InstanceKlass* ik) {
+ ik->clean_implementors_list(_is_alive);
+ ik->clean_method_data(_is_alive);
+
+ // G1 specific cleanup work that has
+ // been moved here to be done in parallel.
+ ik->clean_dependent_nmethods();
+ }
+
+ void work() {
+ ResourceMark rm;
+
+ // One worker will clean the subklass/sibling klass tree.
+ if (claim_clean_klass_tree_task()) {
+ Klass::clean_subklass_tree(_is_alive);
+ }
+
+ // All workers will help cleaning the classes,
+ InstanceKlass* klass;
+ while ((klass = claim_next_klass()) != NULL) {
+ clean_klass(klass);
+ }
+ }
+};
+
+// To minimize the remark pause times, the tasks below are done in parallel.
+class G1ParallelCleaningTask : public AbstractGangTask {
+private:
+ G1StringSymbolTableUnlinkTask _string_symbol_task;
+ G1CodeCacheUnloadingTask _code_cache_task;
+ G1KlassCleaningTask _klass_cleaning_task;
+
+public:
+ // The constructor is run in the VMThread.
+ G1ParallelCleaningTask(BoolObjectClosure* is_alive, bool process_strings, bool process_symbols, uint num_workers, bool unloading_occurred) :
+ AbstractGangTask("Parallel Cleaning"),
+ _string_symbol_task(is_alive, process_strings, process_symbols),
+ _code_cache_task(num_workers, is_alive, unloading_occurred),
+ _klass_cleaning_task(is_alive) {
+ }
+
+ // The parallel work done by all worker threads.
+ void work(uint worker_id) {
+ // Do first pass of code cache cleaning.
+ _code_cache_task.work_first_pass(worker_id);
+
+ // Let the threads mark that the first pass is done.
+ _code_cache_task.barrier_mark(worker_id);
+
+ // Clean the Strings and Symbols.
+ _string_symbol_task.work(worker_id);
+
+ // Wait for all workers to finish the first code cache cleaning pass.
+ _code_cache_task.barrier_wait(worker_id);
+
+ // Do the second code cache cleaning work, which realize on
+ // the liveness information gathered during the first pass.
+ _code_cache_task.work_second_pass(worker_id);
+
+ // Clean all klasses that were not unloaded.
+ _klass_cleaning_task.work();
+ }
+};
+
+
+void G1CollectedHeap::parallel_cleaning(BoolObjectClosure* is_alive,
+ bool process_strings,
+ bool process_symbols,
+ bool class_unloading_occurred) {
+ uint n_workers = (G1CollectedHeap::use_parallel_gc_threads() ?
+ workers()->active_workers() : 1);
+
+ G1ParallelCleaningTask g1_unlink_task(is_alive, process_strings, process_symbols,
+ n_workers, class_unloading_occurred);
if (G1CollectedHeap::use_parallel_gc_threads()) {
set_par_threads(n_workers);
workers()->run_task(&g1_unlink_task);
@@ -5233,12 +5345,21 @@ void G1CollectedHeap::unlink_string_and_symbol_table(BoolObjectClosure* is_alive
} else {
g1_unlink_task.work(0);
}
- if (G1TraceStringSymbolTableScrubbing) {
- gclog_or_tty->print_cr("Cleaned string and symbol table, "
- "strings: "SIZE_FORMAT" processed, "SIZE_FORMAT" removed, "
- "symbols: "SIZE_FORMAT" processed, "SIZE_FORMAT" removed",
- g1_unlink_task.strings_processed(), g1_unlink_task.strings_removed(),
- g1_unlink_task.symbols_processed(), g1_unlink_task.symbols_removed());
+}
+
+void G1CollectedHeap::unlink_string_and_symbol_table(BoolObjectClosure* is_alive,
+ bool process_strings, bool process_symbols) {
+ {
+ uint n_workers = (G1CollectedHeap::use_parallel_gc_threads() ?
+ _g1h->workers()->active_workers() : 1);
+ G1StringSymbolTableUnlinkTask g1_unlink_task(is_alive, process_strings, process_symbols);
+ if (G1CollectedHeap::use_parallel_gc_threads()) {
+ set_par_threads(n_workers);
+ workers()->run_task(&g1_unlink_task);
+ set_par_threads(0);
+ } else {
+ g1_unlink_task.work(0);
+ }
}
if (G1StringDedup::is_enabled()) {
@@ -5577,8 +5698,7 @@ public:
pss.set_evac_failure_closure(&evac_failure_cl);
- assert(pss.refs()->is_empty(), "both queue and overflow should be empty");
-
+ assert(pss.queue_is_empty(), "both queue and overflow should be empty");
G1ParScanExtRootClosure only_copy_non_heap_cl(_g1h, &pss, NULL);
@@ -5632,7 +5752,7 @@ public:
G1ParEvacuateFollowersClosure drain_queue(_g1h, &pss, _queues, &_terminator);
drain_queue.do_void();
// Allocation buffers were retired at the end of G1ParEvacuateFollowersClosure
- assert(pss.refs()->is_empty(), "should be");
+ assert(pss.queue_is_empty(), "should be");
}
};
@@ -5699,7 +5819,7 @@ void G1CollectedHeap::process_discovered_references(uint no_of_gc_workers) {
pss.set_evac_failure_closure(&evac_failure_cl);
- assert(pss.refs()->is_empty(), "pre-condition");
+ assert(pss.queue_is_empty(), "pre-condition");
G1ParScanExtRootClosure only_copy_non_heap_cl(this, &pss, NULL);
@@ -5747,7 +5867,7 @@ void G1CollectedHeap::process_discovered_references(uint no_of_gc_workers) {
_gc_tracer_stw->report_gc_reference_stats(stats);
// We have completed copying any necessary live referent objects.
- assert(pss.refs()->is_empty(), "both queue and overflow should be empty");
+ assert(pss.queue_is_empty(), "both queue and overflow should be empty");
double ref_proc_time = os::elapsedTime() - ref_proc_start;
g1_policy()->phase_times()->record_ref_proc_time(ref_proc_time * 1000.0);
@@ -5832,6 +5952,10 @@ void G1CollectedHeap::evacuate_collection_set(EvacuationInfo& evacuation_info) {
{
StrongRootsScope srs(this);
+ // InitialMark needs claim bits to keep track of the marked-through CLDs.
+ if (g1_policy()->during_initial_mark_pause()) {
+ ClassLoaderDataGraph::clear_claimed_marks();
+ }
if (G1CollectedHeap::use_parallel_gc_threads()) {
// The individual threads will set their evac-failure closures.
@@ -6603,7 +6727,7 @@ HeapRegion* G1CollectedHeap::new_gc_alloc_region(size_t word_size,
// We really only need to do this for old regions given that we
// should never scan survivors. But it doesn't hurt to do it
// for survivors too.
- new_alloc_region->set_saved_mark();
+ new_alloc_region->record_top_and_timestamp();
if (survivor) {
new_alloc_region->set_survivor();
_hr_printer.alloc(new_alloc_region, G1HRPrinter::Survivor);
@@ -6867,106 +6991,6 @@ void G1CollectedHeap::purge_code_root_memory() {
g1_policy()->phase_times()->record_strong_code_root_purge_time(purge_time_ms);
}
-// Mark all the code roots that point into regions *not* in the
-// collection set.
-//
-// Note we do not want to use a "marking" CodeBlobToOopClosure while
-// walking the the code roots lists of regions not in the collection
-// set. Suppose we have an nmethod (M) that points to objects in two
-// separate regions - one in the collection set (R1) and one not (R2).
-// Using a "marking" CodeBlobToOopClosure here would result in "marking"
-// nmethod M when walking the code roots for R1. When we come to scan
-// the code roots for R2, we would see that M is already marked and it
-// would be skipped and the objects in R2 that are referenced from M
-// would not be evacuated.
-
-class MarkStrongCodeRootCodeBlobClosure: public CodeBlobClosure {
-
- class MarkStrongCodeRootOopClosure: public OopClosure {
- ConcurrentMark* _cm;
- HeapRegion* _hr;
- uint _worker_id;
-
- template void do_oop_work(T* p) {
- T heap_oop = oopDesc::load_heap_oop(p);
- if (!oopDesc::is_null(heap_oop)) {
- oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
- // Only mark objects in the region (which is assumed
- // to be not in the collection set).
- if (_hr->is_in(obj)) {
- _cm->grayRoot(obj, (size_t) obj->size(), _worker_id);
- }
- }
- }
-
- public:
- MarkStrongCodeRootOopClosure(ConcurrentMark* cm, HeapRegion* hr, uint worker_id) :
- _cm(cm), _hr(hr), _worker_id(worker_id) {
- assert(!_hr->in_collection_set(), "sanity");
- }
-
- void do_oop(narrowOop* p) { do_oop_work(p); }
- void do_oop(oop* p) { do_oop_work(p); }
- };
-
- MarkStrongCodeRootOopClosure _oop_cl;
-
-public:
- MarkStrongCodeRootCodeBlobClosure(ConcurrentMark* cm, HeapRegion* hr, uint worker_id):
- _oop_cl(cm, hr, worker_id) {}
-
- void do_code_blob(CodeBlob* cb) {
- nmethod* nm = (cb == NULL) ? NULL : cb->as_nmethod_or_null();
- if (nm != NULL) {
- nm->oops_do(&_oop_cl);
- }
- }
-};
-
-class MarkStrongCodeRootsHRClosure: public HeapRegionClosure {
- G1CollectedHeap* _g1h;
- uint _worker_id;
-
-public:
- MarkStrongCodeRootsHRClosure(G1CollectedHeap* g1h, uint worker_id) :
- _g1h(g1h), _worker_id(worker_id) {}
-
- bool doHeapRegion(HeapRegion *hr) {
- HeapRegionRemSet* hrrs = hr->rem_set();
- if (hr->continuesHumongous()) {
- // Code roots should never be attached to a continuation of a humongous region
- assert(hrrs->strong_code_roots_list_length() == 0,
- err_msg("code roots should never be attached to continuations of humongous region "HR_FORMAT
- " starting at "HR_FORMAT", but has "SIZE_FORMAT,
- HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()),
- hrrs->strong_code_roots_list_length()));
- return false;
- }
-
- if (hr->in_collection_set()) {
- // Don't mark code roots into regions in the collection set here.
- // They will be marked when we scan them.
- return false;
- }
-
- MarkStrongCodeRootCodeBlobClosure cb_cl(_g1h->concurrent_mark(), hr, _worker_id);
- hr->strong_code_roots_do(&cb_cl);
- return false;
- }
-};
-
-void G1CollectedHeap::mark_strong_code_roots(uint worker_id) {
- MarkStrongCodeRootsHRClosure cl(this, worker_id);
- if (G1CollectedHeap::use_parallel_gc_threads()) {
- heap_region_par_iterate_chunked(&cl,
- worker_id,
- workers()->active_workers(),
- HeapRegion::ParMarkRootClaimValue);
- } else {
- heap_region_iterate(&cl);
- }
-}
-
class RebuildStrongCodeRootClosure: public CodeBlobClosure {
G1CollectedHeap* _g1h;
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
index f4d0baae983..30a3d7ebcb8 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
@@ -31,7 +31,6 @@
#include "gc_implementation/g1/g1BiasedArray.hpp"
#include "gc_implementation/g1/g1HRPrinter.hpp"
#include "gc_implementation/g1/g1MonitoringSupport.hpp"
-#include "gc_implementation/g1/g1RemSet.hpp"
#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
#include "gc_implementation/g1/g1YCTypes.hpp"
#include "gc_implementation/g1/heapRegionSeq.hpp"
@@ -211,6 +210,7 @@ class G1FastCSetBiasedMappedArray : public G1BiasedMappedArray {
class RefineCardTableEntryClosure;
class G1CollectedHeap : public SharedHeap {
+ friend class VM_CollectForMetadataAllocation;
friend class VM_G1CollectForAllocation;
friend class VM_G1CollectFull;
friend class VM_G1IncCollectionPause;
@@ -220,7 +220,7 @@ class G1CollectedHeap : public SharedHeap {
friend class OldGCAllocRegion;
// Closures used in implementation.
- template
+ template
friend class G1ParCopyClosure;
friend class G1IsAliveClosure;
friend class G1EvacuateFollowersClosure;
@@ -347,6 +347,9 @@ private:
// It initializes the GC alloc regions at the start of a GC.
void init_gc_alloc_regions(EvacuationInfo& evacuation_info);
+ // Setup the retained old gc alloc region as the currrent old gc alloc region.
+ void use_retained_old_gc_alloc_region(EvacuationInfo& evacuation_info);
+
// It releases the GC alloc regions at the end of a GC.
void release_gc_alloc_regions(uint no_of_gc_workers, EvacuationInfo& evacuation_info);
@@ -828,12 +831,13 @@ protected:
// param is for use with parallel roots processing, and should be
// the "i" of the calling parallel worker thread's work(i) function.
// In the sequential case this param will be ignored.
- void g1_process_strong_roots(bool is_scavenging,
- ScanningOption so,
- OopClosure* scan_non_heap_roots,
- OopsInHeapRegionClosure* scan_rs,
- G1KlassScanClosure* scan_klasses,
- uint worker_i);
+ void g1_process_roots(OopClosure* scan_non_heap_roots,
+ OopClosure* scan_non_heap_weak_roots,
+ OopsInHeapRegionClosure* scan_rs,
+ CLDClosure* scan_strong_clds,
+ CLDClosure* scan_weak_clds,
+ CodeBlobClosure* scan_strong_code,
+ uint worker_i);
// Notifies all the necessary spaces that the committed space has
// been updated (either expanded or shrunk). It should be called
@@ -1026,7 +1030,7 @@ protected:
// of G1CollectedHeap::_gc_time_stamp.
unsigned int* _worker_cset_start_region_time_stamp;
- enum G1H_process_strong_roots_tasks {
+ enum G1H_process_roots_tasks {
G1H_PS_filter_satb_buffers,
G1H_PS_refProcessor_oops_do,
// Leave this one last.
@@ -1608,10 +1612,6 @@ public:
// Free up superfluous code root memory.
void purge_code_root_memory();
- // During an initial mark pause, mark all the code roots that
- // point into regions *not* in the collection set.
- void mark_strong_code_roots(uint worker_id);
-
// Rebuild the strong code root lists for each region
// after a full GC.
void rebuild_strong_code_roots();
@@ -1620,6 +1620,9 @@ public:
// in symbol table, possibly in parallel.
void unlink_string_and_symbol_table(BoolObjectClosure* is_alive, bool unlink_strings = true, bool unlink_symbols = true);
+ // Parallel phase of unloading/cleaning after G1 concurrent mark.
+ void parallel_cleaning(BoolObjectClosure* is_alive, bool process_strings, bool process_symbols, bool class_unloading_occurred);
+
// Redirty logged cards in the refinement queue.
void redirty_logged_cards();
// Verification
@@ -1715,256 +1718,4 @@ public:
}
};
-class G1ParScanThreadState : public StackObj {
-protected:
- G1CollectedHeap* _g1h;
- RefToScanQueue* _refs;
- DirtyCardQueue _dcq;
- G1SATBCardTableModRefBS* _ct_bs;
- G1RemSet* _g1_rem;
-
- G1ParGCAllocBuffer _surviving_alloc_buffer;
- G1ParGCAllocBuffer _tenured_alloc_buffer;
- G1ParGCAllocBuffer* _alloc_buffers[GCAllocPurposeCount];
- ageTable _age_table;
-
- G1ParScanClosure _scanner;
-
- size_t _alloc_buffer_waste;
- size_t _undo_waste;
-
- OopsInHeapRegionClosure* _evac_failure_cl;
-
- int _hash_seed;
- uint _queue_num;
-
- size_t _term_attempts;
-
- double _start;
- double _start_strong_roots;
- double _strong_roots_time;
- double _start_term;
- double _term_time;
-
- // Map from young-age-index (0 == not young, 1 is youngest) to
- // surviving words. base is what we get back from the malloc call
- size_t* _surviving_young_words_base;
- // this points into the array, as we use the first few entries for padding
- size_t* _surviving_young_words;
-
-#define PADDING_ELEM_NUM (DEFAULT_CACHE_LINE_SIZE / sizeof(size_t))
-
- void add_to_alloc_buffer_waste(size_t waste) { _alloc_buffer_waste += waste; }
-
- void add_to_undo_waste(size_t waste) { _undo_waste += waste; }
-
- DirtyCardQueue& dirty_card_queue() { return _dcq; }
- G1SATBCardTableModRefBS* ctbs() { return _ct_bs; }
-
- template inline void immediate_rs_update(HeapRegion* from, T* p, int tid);
-
- template void deferred_rs_update(HeapRegion* from, T* p, int tid) {
- // If the new value of the field points to the same region or
- // is the to-space, we don't need to include it in the Rset updates.
- if (!from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) && !from->is_survivor()) {
- size_t card_index = ctbs()->index_for(p);
- // If the card hasn't been added to the buffer, do it.
- if (ctbs()->mark_card_deferred(card_index)) {
- dirty_card_queue().enqueue((jbyte*)ctbs()->byte_for_index(card_index));
- }
- }
- }
-
-public:
- G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num, ReferenceProcessor* rp);
-
- ~G1ParScanThreadState() {
- retire_alloc_buffers();
- FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_base, mtGC);
- }
-
- RefToScanQueue* refs() { return _refs; }
- ageTable* age_table() { return &_age_table; }
-
- G1ParGCAllocBuffer* alloc_buffer(GCAllocPurpose purpose) {
- return _alloc_buffers[purpose];
- }
-
- size_t alloc_buffer_waste() const { return _alloc_buffer_waste; }
- size_t undo_waste() const { return _undo_waste; }
-
-#ifdef ASSERT
- bool verify_ref(narrowOop* ref) const;
- bool verify_ref(oop* ref) const;
- bool verify_task(StarTask ref) const;
-#endif // ASSERT
-
- template void push_on_queue(T* ref) {
- assert(verify_ref(ref), "sanity");
- refs()->push(ref);
- }
-
- template inline void update_rs(HeapRegion* from, T* p, int tid);
-
- HeapWord* allocate_slow(GCAllocPurpose purpose, size_t word_sz) {
- HeapWord* obj = NULL;
- size_t gclab_word_size = _g1h->desired_plab_sz(purpose);
- if (word_sz * 100 < gclab_word_size * ParallelGCBufferWastePct) {
- G1ParGCAllocBuffer* alloc_buf = alloc_buffer(purpose);
- add_to_alloc_buffer_waste(alloc_buf->words_remaining());
- alloc_buf->retire(false /* end_of_gc */, false /* retain */);
-
- HeapWord* buf = _g1h->par_allocate_during_gc(purpose, gclab_word_size);
- if (buf == NULL) return NULL; // Let caller handle allocation failure.
- // Otherwise.
- alloc_buf->set_word_size(gclab_word_size);
- alloc_buf->set_buf(buf);
-
- obj = alloc_buf->allocate(word_sz);
- assert(obj != NULL, "buffer was definitely big enough...");
- } else {
- obj = _g1h->par_allocate_during_gc(purpose, word_sz);
- }
- return obj;
- }
-
- HeapWord* allocate(GCAllocPurpose purpose, size_t word_sz) {
- HeapWord* obj = alloc_buffer(purpose)->allocate(word_sz);
- if (obj != NULL) return obj;
- return allocate_slow(purpose, word_sz);
- }
-
- void undo_allocation(GCAllocPurpose purpose, HeapWord* obj, size_t word_sz) {
- if (alloc_buffer(purpose)->contains(obj)) {
- assert(alloc_buffer(purpose)->contains(obj + word_sz - 1),
- "should contain whole object");
- alloc_buffer(purpose)->undo_allocation(obj, word_sz);
- } else {
- CollectedHeap::fill_with_object(obj, word_sz);
- add_to_undo_waste(word_sz);
- }
- }
-
- void set_evac_failure_closure(OopsInHeapRegionClosure* evac_failure_cl) {
- _evac_failure_cl = evac_failure_cl;
- }
- OopsInHeapRegionClosure* evac_failure_closure() {
- return _evac_failure_cl;
- }
-
- int* hash_seed() { return &_hash_seed; }
- uint queue_num() { return _queue_num; }
-
- size_t term_attempts() const { return _term_attempts; }
- void note_term_attempt() { _term_attempts++; }
-
- void start_strong_roots() {
- _start_strong_roots = os::elapsedTime();
- }
- void end_strong_roots() {
- _strong_roots_time += (os::elapsedTime() - _start_strong_roots);
- }
- double strong_roots_time() const { return _strong_roots_time; }
-
- void start_term_time() {
- note_term_attempt();
- _start_term = os::elapsedTime();
- }
- void end_term_time() {
- _term_time += (os::elapsedTime() - _start_term);
- }
- double term_time() const { return _term_time; }
-
- double elapsed_time() const {
- return os::elapsedTime() - _start;
- }
-
- static void
- print_termination_stats_hdr(outputStream* const st = gclog_or_tty);
- void
- print_termination_stats(int i, outputStream* const st = gclog_or_tty) const;
-
- size_t* surviving_young_words() {
- // We add on to hide entry 0 which accumulates surviving words for
- // age -1 regions (i.e. non-young ones)
- return _surviving_young_words;
- }
-
-private:
- void retire_alloc_buffers() {
- for (int ap = 0; ap < GCAllocPurposeCount; ++ap) {
- size_t waste = _alloc_buffers[ap]->words_remaining();
- add_to_alloc_buffer_waste(waste);
- _alloc_buffers[ap]->flush_stats_and_retire(_g1h->stats_for_purpose((GCAllocPurpose)ap),
- true /* end_of_gc */,
- false /* retain */);
- }
- }
-
-#define G1_PARTIAL_ARRAY_MASK 0x2
-
- inline bool has_partial_array_mask(oop* ref) const {
- return ((uintptr_t)ref & G1_PARTIAL_ARRAY_MASK) == G1_PARTIAL_ARRAY_MASK;
- }
-
- // We never encode partial array oops as narrowOop*, so return false immediately.
- // This allows the compiler to create optimized code when popping references from
- // the work queue.
- inline bool has_partial_array_mask(narrowOop* ref) const {
- assert(((uintptr_t)ref & G1_PARTIAL_ARRAY_MASK) != G1_PARTIAL_ARRAY_MASK, "Partial array oop reference encoded as narrowOop*");
- return false;
- }
-
- // Only implement set_partial_array_mask() for regular oops, not for narrowOops.
- // We always encode partial arrays as regular oop, to allow the
- // specialization for has_partial_array_mask() for narrowOops above.
- // This means that unintentional use of this method with narrowOops are caught
- // by the compiler.
- inline oop* set_partial_array_mask(oop obj) const {
- assert(((uintptr_t)(void *)obj & G1_PARTIAL_ARRAY_MASK) == 0, "Information loss!");
- return (oop*) ((uintptr_t)(void *)obj | G1_PARTIAL_ARRAY_MASK);
- }
-
- inline oop clear_partial_array_mask(oop* ref) const {
- return cast_to_oop((intptr_t)ref & ~G1_PARTIAL_ARRAY_MASK);
- }
-
- inline void do_oop_partial_array(oop* p);
-
- // This method is applied to the fields of the objects that have just been copied.
- template void do_oop_evac(T* p, HeapRegion* from) {
- assert(!oopDesc::is_null(oopDesc::load_decode_heap_oop(p)),
- "Reference should not be NULL here as such are never pushed to the task queue.");
- oop obj = oopDesc::load_decode_heap_oop_not_null(p);
-
- // Although we never intentionally push references outside of the collection
- // set, due to (benign) races in the claim mechanism during RSet scanning more
- // than one thread might claim the same card. So the same card may be
- // processed multiple times. So redo this check.
- if (_g1h->in_cset_fast_test(obj)) {
- oop forwardee;
- if (obj->is_forwarded()) {
- forwardee = obj->forwardee();
- } else {
- forwardee = copy_to_survivor_space(obj);
- }
- assert(forwardee != NULL, "forwardee should not be NULL");
- oopDesc::encode_store_heap_oop(p, forwardee);
- }
-
- assert(obj != NULL, "Must be");
- update_rs(from, p, queue_num());
- }
-public:
-
- oop copy_to_survivor_space(oop const obj);
-
- template inline void deal_with_reference(T* ref_to_scan);
-
- inline void deal_with_reference(StarTask ref);
-
-public:
- void trim_queue();
-};
-
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp
index 42a5931815b..7d5e530c497 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp
@@ -29,7 +29,6 @@
#include "gc_implementation/g1/g1CollectedHeap.hpp"
#include "gc_implementation/g1/g1AllocRegion.inline.hpp"
#include "gc_implementation/g1/g1CollectorPolicy.hpp"
-#include "gc_implementation/g1/g1RemSet.inline.hpp"
#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
#include "gc_implementation/g1/heapRegionSet.inline.hpp"
#include "gc_implementation/g1/heapRegionSeq.inline.hpp"
@@ -289,89 +288,4 @@ inline bool G1CollectedHeap::is_obj_ill(const oop obj) const {
return is_obj_ill(obj, heap_region_containing(obj));
}
-template inline void G1ParScanThreadState::immediate_rs_update(HeapRegion* from, T* p, int tid) {
- if (!from->is_survivor()) {
- _g1_rem->par_write_ref(from, p, tid);
- }
-}
-
-template void G1ParScanThreadState::update_rs(HeapRegion* from, T* p, int tid) {
- if (G1DeferredRSUpdate) {
- deferred_rs_update(from, p, tid);
- } else {
- immediate_rs_update(from, p, tid);
- }
-}
-
-
-inline void G1ParScanThreadState::do_oop_partial_array(oop* p) {
- assert(has_partial_array_mask(p), "invariant");
- oop from_obj = clear_partial_array_mask(p);
-
- assert(Universe::heap()->is_in_reserved(from_obj), "must be in heap.");
- assert(from_obj->is_objArray(), "must be obj array");
- objArrayOop from_obj_array = objArrayOop(from_obj);
- // The from-space object contains the real length.
- int length = from_obj_array->length();
-
- assert(from_obj->is_forwarded(), "must be forwarded");
- oop to_obj = from_obj->forwardee();
- assert(from_obj != to_obj, "should not be chunking self-forwarded objects");
- objArrayOop to_obj_array = objArrayOop(to_obj);
- // We keep track of the next start index in the length field of the
- // to-space object.
- int next_index = to_obj_array->length();
- assert(0 <= next_index && next_index < length,
- err_msg("invariant, next index: %d, length: %d", next_index, length));
-
- int start = next_index;
- int end = length;
- int remainder = end - start;
- // We'll try not to push a range that's smaller than ParGCArrayScanChunk.
- if (remainder > 2 * ParGCArrayScanChunk) {
- end = start + ParGCArrayScanChunk;
- to_obj_array->set_length(end);
- // Push the remainder before we process the range in case another
- // worker has run out of things to do and can steal it.
- oop* from_obj_p = set_partial_array_mask(from_obj);
- push_on_queue(from_obj_p);
- } else {
- assert(length == end, "sanity");
- // We'll process the final range for this object. Restore the length
- // so that the heap remains parsable in case of evacuation failure.
- to_obj_array->set_length(end);
- }
- _scanner.set_region(_g1h->heap_region_containing_raw(to_obj));
- // Process indexes [start,end). It will also process the header
- // along with the first chunk (i.e., the chunk with start == 0).
- // Note that at this point the length field of to_obj_array is not
- // correct given that we are using it to keep track of the next
- // start index. oop_iterate_range() (thankfully!) ignores the length
- // field and only relies on the start / end parameters. It does
- // however return the size of the object which will be incorrect. So
- // we have to ignore it even if we wanted to use it.
- to_obj_array->oop_iterate_range(&_scanner, start, end);
-}
-
-template inline void G1ParScanThreadState::deal_with_reference(T* ref_to_scan) {
- if (!has_partial_array_mask(ref_to_scan)) {
- // Note: we can use "raw" versions of "region_containing" because
- // "obj_to_scan" is definitely in the heap, and is not in a
- // humongous region.
- HeapRegion* r = _g1h->heap_region_containing_raw(ref_to_scan);
- do_oop_evac(ref_to_scan, r);
- } else {
- do_oop_partial_array((oop*)ref_to_scan);
- }
-}
-
-inline void G1ParScanThreadState::deal_with_reference(StarTask ref) {
- assert(verify_task(ref), "sanity");
- if (ref.is_narrow()) {
- deal_with_reference((narrowOop*)ref);
- } else {
- deal_with_reference((oop*)ref);
- }
-}
-
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_INLINE_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp
index cb6fd08d77e..4b25d904063 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp
@@ -71,6 +71,9 @@ private:
bool _during_initial_mark;
bool _during_conc_mark;
uint _worker_id;
+ HeapWord* _end_of_last_gap;
+ HeapWord* _last_gap_threshold;
+ HeapWord* _last_obj_threshold;
public:
RemoveSelfForwardPtrObjClosure(G1CollectedHeap* g1, ConcurrentMark* cm,
@@ -83,7 +86,10 @@ public:
_update_rset_cl(update_rset_cl),
_during_initial_mark(during_initial_mark),
_during_conc_mark(during_conc_mark),
- _worker_id(worker_id) { }
+ _worker_id(worker_id),
+ _end_of_last_gap(hr->bottom()),
+ _last_gap_threshold(hr->bottom()),
+ _last_obj_threshold(hr->bottom()) { }
size_t marked_bytes() { return _marked_bytes; }
@@ -107,7 +113,12 @@ public:
HeapWord* obj_addr = (HeapWord*) obj;
assert(_hr->is_in(obj_addr), "sanity");
size_t obj_size = obj->size();
- _hr->update_bot_for_object(obj_addr, obj_size);
+ HeapWord* obj_end = obj_addr + obj_size;
+
+ if (_end_of_last_gap != obj_addr) {
+ // there was a gap before obj_addr
+ _last_gap_threshold = _hr->cross_threshold(_end_of_last_gap, obj_addr);
+ }
if (obj->is_forwarded() && obj->forwardee() == obj) {
// The object failed to move.
@@ -115,7 +126,9 @@ public:
// We consider all objects that we find self-forwarded to be
// live. What we'll do is that we'll update the prev marking
// info so that they are all under PTAMS and explicitly marked.
- _cm->markPrev(obj);
+ if (!_cm->isPrevMarked(obj)) {
+ _cm->markPrev(obj);
+ }
if (_during_initial_mark) {
// For the next marking info we'll only mark the
// self-forwarded objects explicitly if we are during
@@ -145,13 +158,18 @@ public:
// remembered set entries missing given that we skipped cards on
// the collection set. So, we'll recreate such entries now.
obj->oop_iterate(_update_rset_cl);
- assert(_cm->isPrevMarked(obj), "Should be marked!");
} else {
+
// The object has been either evacuated or is dead. Fill it with a
// dummy object.
- MemRegion mr((HeapWord*) obj, obj_size);
+ MemRegion mr(obj_addr, obj_size);
CollectedHeap::fill_with_object(mr);
+
+ // must nuke all dead objects which we skipped when iterating over the region
+ _cm->clearRangePrevBitmap(MemRegion(_end_of_last_gap, obj_end));
}
+ _end_of_last_gap = obj_end;
+ _last_obj_threshold = _hr->cross_threshold(obj_addr, obj_end);
}
};
@@ -182,13 +200,6 @@ public:
during_conc_mark,
_worker_id);
- MemRegion mr(hr->bottom(), hr->end());
- // We'll recreate the prev marking info so we'll first clear
- // the prev bitmap range for this region. We never mark any
- // CSet objects explicitly so the next bitmap range should be
- // cleared anyway.
- _cm->clearRangePrevBitmap(mr);
-
hr->note_self_forwarding_removal_start(during_initial_mark,
during_conc_mark);
_g1h->check_bitmaps("Self-Forwarding Ptr Removal", hr);
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp
index 3dc72522c07..49232d60728 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp
@@ -167,7 +167,6 @@ G1GCPhaseTimes::G1GCPhaseTimes(uint max_gc_threads) :
_last_update_rs_processed_buffers(_max_gc_threads, "%d"),
_last_scan_rs_times_ms(_max_gc_threads, "%.1lf"),
_last_strong_code_root_scan_times_ms(_max_gc_threads, "%.1lf"),
- _last_strong_code_root_mark_times_ms(_max_gc_threads, "%.1lf"),
_last_obj_copy_times_ms(_max_gc_threads, "%.1lf"),
_last_termination_times_ms(_max_gc_threads, "%.1lf"),
_last_termination_attempts(_max_gc_threads, SIZE_FORMAT),
@@ -194,7 +193,6 @@ void G1GCPhaseTimes::note_gc_start(uint active_gc_threads) {
_last_update_rs_processed_buffers.reset();
_last_scan_rs_times_ms.reset();
_last_strong_code_root_scan_times_ms.reset();
- _last_strong_code_root_mark_times_ms.reset();
_last_obj_copy_times_ms.reset();
_last_termination_times_ms.reset();
_last_termination_attempts.reset();
@@ -215,7 +213,6 @@ void G1GCPhaseTimes::note_gc_end() {
_last_update_rs_processed_buffers.verify();
_last_scan_rs_times_ms.verify();
_last_strong_code_root_scan_times_ms.verify();
- _last_strong_code_root_mark_times_ms.verify();
_last_obj_copy_times_ms.verify();
_last_termination_times_ms.verify();
_last_termination_attempts.verify();
@@ -230,7 +227,6 @@ void G1GCPhaseTimes::note_gc_end() {
_last_update_rs_times_ms.get(i) +
_last_scan_rs_times_ms.get(i) +
_last_strong_code_root_scan_times_ms.get(i) +
- _last_strong_code_root_mark_times_ms.get(i) +
_last_obj_copy_times_ms.get(i) +
_last_termination_times_ms.get(i);
@@ -302,9 +298,6 @@ void G1GCPhaseTimes::print(double pause_time_sec) {
if (_last_satb_filtering_times_ms.sum() > 0.0) {
_last_satb_filtering_times_ms.print(2, "SATB Filtering (ms)");
}
- if (_last_strong_code_root_mark_times_ms.sum() > 0.0) {
- _last_strong_code_root_mark_times_ms.print(2, "Code Root Marking (ms)");
- }
_last_update_rs_times_ms.print(2, "Update RS (ms)");
_last_update_rs_processed_buffers.print(3, "Processed Buffers");
_last_scan_rs_times_ms.print(2, "Scan RS (ms)");
@@ -322,9 +315,6 @@ void G1GCPhaseTimes::print(double pause_time_sec) {
if (_last_satb_filtering_times_ms.sum() > 0.0) {
_last_satb_filtering_times_ms.print(1, "SATB Filtering (ms)");
}
- if (_last_strong_code_root_mark_times_ms.sum() > 0.0) {
- _last_strong_code_root_mark_times_ms.print(1, "Code Root Marking (ms)");
- }
_last_update_rs_times_ms.print(1, "Update RS (ms)");
_last_update_rs_processed_buffers.print(2, "Processed Buffers");
_last_scan_rs_times_ms.print(1, "Scan RS (ms)");
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp
index 221a7a1240d..12a3a7dd21b 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp
@@ -120,7 +120,6 @@ class G1GCPhaseTimes : public CHeapObj {
WorkerDataArray _last_update_rs_processed_buffers;
WorkerDataArray _last_scan_rs_times_ms;
WorkerDataArray _last_strong_code_root_scan_times_ms;
- WorkerDataArray _last_strong_code_root_mark_times_ms;
WorkerDataArray _last_obj_copy_times_ms;
WorkerDataArray _last_termination_times_ms;
WorkerDataArray _last_termination_attempts;
@@ -199,10 +198,6 @@ class G1GCPhaseTimes : public CHeapObj {
_last_strong_code_root_scan_times_ms.set(worker_i, ms);
}
- void record_strong_code_root_mark_time(uint worker_i, double ms) {
- _last_strong_code_root_mark_times_ms.set(worker_i, ms);
- }
-
void record_obj_copy_time(uint worker_i, double ms) {
_last_obj_copy_times_ms.set(worker_i, ms);
}
@@ -369,10 +364,6 @@ class G1GCPhaseTimes : public CHeapObj {
return _last_strong_code_root_scan_times_ms.average();
}
- double average_last_strong_code_root_mark_time(){
- return _last_strong_code_root_mark_times_ms.average();
- }
-
double average_last_obj_copy_time() {
return _last_obj_copy_times_ms.average();
}
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
index ae3b83072da..6a2627d10fc 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
@@ -129,13 +129,15 @@ void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading,
SharedHeap* sh = SharedHeap::heap();
- // Need cleared claim bits for the strong roots processing
+ // Need cleared claim bits for the roots processing
ClassLoaderDataGraph::clear_claimed_marks();
- sh->process_strong_roots(true, // activate StrongRootsScope
- SharedHeap::SO_SystemClasses,
+ MarkingCodeBlobClosure follow_code_closure(&GenMarkSweep::follow_root_closure, !CodeBlobToOopClosure::FixRelocations);
+ sh->process_strong_roots(true, // activate StrongRootsScope
+ SharedHeap::SO_None,
&GenMarkSweep::follow_root_closure,
- &GenMarkSweep::follow_klass_closure);
+ &GenMarkSweep::follow_cld_closure,
+ &follow_code_closure);
// Process reference objects found during marking
ReferenceProcessor* rp = GenMarkSweep::ref_processor();
@@ -304,13 +306,15 @@ void G1MarkSweep::mark_sweep_phase3() {
SharedHeap* sh = SharedHeap::heap();
- // Need cleared claim bits for the strong roots processing
+ // Need cleared claim bits for the roots processing
ClassLoaderDataGraph::clear_claimed_marks();
- sh->process_strong_roots(true, // activate StrongRootsScope
- SharedHeap::SO_AllClasses | SharedHeap::SO_Strings | SharedHeap::SO_AllCodeCache,
- &GenMarkSweep::adjust_pointer_closure,
- &GenMarkSweep::adjust_klass_closure);
+ CodeBlobToOopClosure adjust_code_closure(&GenMarkSweep::adjust_pointer_closure, CodeBlobToOopClosure::FixRelocations);
+ sh->process_all_roots(true, // activate StrongRootsScope
+ SharedHeap::SO_AllCodeCache,
+ &GenMarkSweep::adjust_pointer_closure,
+ &GenMarkSweep::adjust_cld_closure,
+ &adjust_code_closure);
assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity");
g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure);
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.cpp
index a30b00416bc..2bdbca58686 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.cpp
@@ -25,7 +25,28 @@
#include "precompiled.hpp"
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
#include "gc_implementation/g1/g1OopClosures.inline.hpp"
+#include "gc_implementation/g1/g1ParScanThreadState.hpp"
G1ParCopyHelper::G1ParCopyHelper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) :
G1ParClosureSuper(g1, par_scan_state), _scanned_klass(NULL),
_cm(_g1->concurrent_mark()) {}
+
+G1ParClosureSuper::G1ParClosureSuper(G1CollectedHeap* g1) :
+ _g1(g1), _par_scan_state(NULL), _worker_id(UINT_MAX) { }
+
+G1ParClosureSuper::G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) :
+ _g1(g1), _par_scan_state(NULL),
+ _worker_id(UINT_MAX) {
+ set_par_scan_thread_state(par_scan_state);
+}
+
+void G1ParClosureSuper::set_par_scan_thread_state(G1ParScanThreadState* par_scan_state) {
+ assert(_par_scan_state == NULL, "_par_scan_state must only be set once");
+ assert(par_scan_state != NULL, "Must set par_scan_state to non-NULL.");
+
+ _par_scan_state = par_scan_state;
+ _worker_id = par_scan_state->queue_num();
+
+ assert(_worker_id < MAX2((uint)ParallelGCThreads, 1u),
+ err_msg("The given worker id %u must be less than the number of threads %u", _worker_id, MAX2((uint)ParallelGCThreads, 1u)));
+}
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp
index fd22e81bdca..79f8b52f682 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp
@@ -25,6 +25,8 @@
#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_HPP
#define SHARE_VM_GC_IMPLEMENTATION_G1_G1OOPCLOSURES_HPP
+#include "memory/iterator.hpp"
+
class HeapRegion;
class G1CollectedHeap;
class G1RemSet;
@@ -51,8 +53,13 @@ protected:
G1ParScanThreadState* _par_scan_state;
uint _worker_id;
public:
+ // Initializes the instance, leaving _par_scan_state uninitialized. Must be done
+ // later using the set_par_scan_thread_state() method.
+ G1ParClosureSuper(G1CollectedHeap* g1);
G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state);
bool apply_to_weak_ref_discovered_field() { return true; }
+
+ void set_par_scan_thread_state(G1ParScanThreadState* par_scan_state);
};
class G1ParPushHeapRSClosure : public G1ParClosureSuper {
@@ -68,9 +75,8 @@ public:
class G1ParScanClosure : public G1ParClosureSuper {
public:
- G1ParScanClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state, ReferenceProcessor* rp) :
- G1ParClosureSuper(g1, par_scan_state)
- {
+ G1ParScanClosure(G1CollectedHeap* g1, ReferenceProcessor* rp) :
+ G1ParClosureSuper(g1) {
assert(_ref_processor == NULL, "sanity");
_ref_processor = rp;
}
@@ -102,7 +108,7 @@ protected:
template void do_klass_barrier(T* p, oop new_obj);
};
-template
+template
class G1ParCopyClosure : public G1ParCopyHelper {
private:
template void do_oop_work(T* p);
@@ -117,19 +123,19 @@ public:
template void do_oop_nv(T* p) { do_oop_work(p); }
virtual void do_oop(oop* p) { do_oop_nv(p); }
virtual void do_oop(narrowOop* p) { do_oop_nv(p); }
+
+ G1CollectedHeap* g1() { return _g1; };
+ G1ParScanThreadState* pss() { return _par_scan_state; }
+ ReferenceProcessor* rp() { return _ref_processor; };
};
-typedef G1ParCopyClosure G1ParScanExtRootClosure;
-typedef G1ParCopyClosure G1ParScanMetadataClosure;
-
-
-typedef G1ParCopyClosure G1ParScanAndMarkExtRootClosure;
-typedef G1ParCopyClosure G1ParScanAndMarkMetadataClosure;
-
+typedef G1ParCopyClosure G1ParScanExtRootClosure;
+typedef G1ParCopyClosure G1ParScanAndMarkExtRootClosure;
+typedef G1ParCopyClosure G1ParScanAndMarkWeakExtRootClosure;
// We use a separate closure to handle references during evacuation
// failure processing.
-typedef G1ParCopyClosure G1ParScanHeapEvacFailureClosure;
+typedef G1ParCopyClosure G1ParScanHeapEvacFailureClosure;
class FilterIntoCSClosure: public ExtendedOopClosure {
G1CollectedHeap* _g1;
@@ -160,10 +166,11 @@ public:
};
// Closure for iterating over object fields during concurrent marking
-class G1CMOopClosure : public ExtendedOopClosure {
+class G1CMOopClosure : public MetadataAwareOopClosure {
+protected:
+ ConcurrentMark* _cm;
private:
G1CollectedHeap* _g1h;
- ConcurrentMark* _cm;
CMTask* _task;
public:
G1CMOopClosure(G1CollectedHeap* g1h, ConcurrentMark* cm, CMTask* task);
@@ -173,7 +180,7 @@ public:
};
// Closure to scan the root regions during concurrent marking
-class G1RootRegionScanClosure : public ExtendedOopClosure {
+class G1RootRegionScanClosure : public MetadataAwareOopClosure {
private:
G1CollectedHeap* _g1h;
ConcurrentMark* _cm;
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp
index 48c024d7470..2db5b9bfa1a 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp
@@ -28,9 +28,11 @@
#include "gc_implementation/g1/concurrentMark.inline.hpp"
#include "gc_implementation/g1/g1CollectedHeap.hpp"
#include "gc_implementation/g1/g1OopClosures.hpp"
+#include "gc_implementation/g1/g1ParScanThreadState.inline.hpp"
#include "gc_implementation/g1/g1RemSet.hpp"
#include "gc_implementation/g1/g1RemSet.inline.hpp"
#include "gc_implementation/g1/heapRegionRemSet.hpp"
+#include "memory/iterator.inline.hpp"
#include "runtime/prefetch.inline.hpp"
/*
@@ -107,10 +109,6 @@ inline void G1ParPushHeapRSClosure::do_oop_nv(T* p) {
template
inline void G1CMOopClosure::do_oop_nv(T* p) {
- assert(_g1h->is_in_g1_reserved((HeapWord*) p), "invariant");
- assert(!_g1h->is_on_master_free_list(
- _g1h->heap_region_containing((HeapWord*) p)), "invariant");
-
oop obj = oopDesc::load_decode_heap_oop(p);
if (_cm->verbose_high()) {
gclog_or_tty->print_cr("[%u] we're looking at location "
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp
new file mode 100644
index 00000000000..89e3e813b98
--- /dev/null
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp
@@ -0,0 +1,306 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
+#include "gc_implementation/g1/g1OopClosures.inline.hpp"
+#include "gc_implementation/g1/g1ParScanThreadState.inline.hpp"
+#include "oops/oop.inline.hpp"
+#include "oops/oop.pcgc.inline.hpp"
+#include "runtime/prefetch.inline.hpp"
+
+G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num, ReferenceProcessor* rp)
+ : _g1h(g1h),
+ _refs(g1h->task_queue(queue_num)),
+ _dcq(&g1h->dirty_card_queue_set()),
+ _ct_bs(g1h->g1_barrier_set()),
+ _g1_rem(g1h->g1_rem_set()),
+ _hash_seed(17), _queue_num(queue_num),
+ _term_attempts(0),
+ _surviving_alloc_buffer(g1h->desired_plab_sz(GCAllocForSurvived)),
+ _tenured_alloc_buffer(g1h->desired_plab_sz(GCAllocForTenured)),
+ _age_table(false), _scanner(g1h, rp),
+ _strong_roots_time(0), _term_time(0),
+ _alloc_buffer_waste(0), _undo_waste(0) {
+ _scanner.set_par_scan_thread_state(this);
+ // we allocate G1YoungSurvRateNumRegions plus one entries, since
+ // we "sacrifice" entry 0 to keep track of surviving bytes for
+ // non-young regions (where the age is -1)
+ // We also add a few elements at the beginning and at the end in
+ // an attempt to eliminate cache contention
+ uint real_length = 1 + _g1h->g1_policy()->young_cset_region_length();
+ uint array_length = PADDING_ELEM_NUM +
+ real_length +
+ PADDING_ELEM_NUM;
+ _surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length, mtGC);
+ if (_surviving_young_words_base == NULL)
+ vm_exit_out_of_memory(array_length * sizeof(size_t), OOM_MALLOC_ERROR,
+ "Not enough space for young surv histo.");
+ _surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM;
+ memset(_surviving_young_words, 0, (size_t) real_length * sizeof(size_t));
+
+ _alloc_buffers[GCAllocForSurvived] = &_surviving_alloc_buffer;
+ _alloc_buffers[GCAllocForTenured] = &_tenured_alloc_buffer;
+
+ _start = os::elapsedTime();
+}
+
+G1ParScanThreadState::~G1ParScanThreadState() {
+ retire_alloc_buffers();
+ FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_base, mtGC);
+}
+
+void
+G1ParScanThreadState::print_termination_stats_hdr(outputStream* const st)
+{
+ st->print_raw_cr("GC Termination Stats");
+ st->print_raw_cr(" elapsed --strong roots-- -------termination-------"
+ " ------waste (KiB)------");
+ st->print_raw_cr("thr ms ms % ms % attempts"
+ " total alloc undo");
+ st->print_raw_cr("--- --------- --------- ------ --------- ------ --------"
+ " ------- ------- -------");
+}
+
+void
+G1ParScanThreadState::print_termination_stats(int i,
+ outputStream* const st) const
+{
+ const double elapsed_ms = elapsed_time() * 1000.0;
+ const double s_roots_ms = strong_roots_time() * 1000.0;
+ const double term_ms = term_time() * 1000.0;
+ st->print_cr("%3d %9.2f %9.2f %6.2f "
+ "%9.2f %6.2f " SIZE_FORMAT_W(8) " "
+ SIZE_FORMAT_W(7) " " SIZE_FORMAT_W(7) " " SIZE_FORMAT_W(7),
+ i, elapsed_ms, s_roots_ms, s_roots_ms * 100 / elapsed_ms,
+ term_ms, term_ms * 100 / elapsed_ms, term_attempts(),
+ (alloc_buffer_waste() + undo_waste()) * HeapWordSize / K,
+ alloc_buffer_waste() * HeapWordSize / K,
+ undo_waste() * HeapWordSize / K);
+}
+
+#ifdef ASSERT
+bool G1ParScanThreadState::verify_ref(narrowOop* ref) const {
+ assert(ref != NULL, "invariant");
+ assert(UseCompressedOops, "sanity");
+ assert(!has_partial_array_mask(ref), err_msg("ref=" PTR_FORMAT, p2i(ref)));
+ oop p = oopDesc::load_decode_heap_oop(ref);
+ assert(_g1h->is_in_g1_reserved(p),
+ err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, p2i(ref), p2i(p)));
+ return true;
+}
+
+bool G1ParScanThreadState::verify_ref(oop* ref) const {
+ assert(ref != NULL, "invariant");
+ if (has_partial_array_mask(ref)) {
+ // Must be in the collection set--it's already been copied.
+ oop p = clear_partial_array_mask(ref);
+ assert(_g1h->obj_in_cs(p),
+ err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, p2i(ref), p2i(p)));
+ } else {
+ oop p = oopDesc::load_decode_heap_oop(ref);
+ assert(_g1h->is_in_g1_reserved(p),
+ err_msg("ref=" PTR_FORMAT " p=" PTR_FORMAT, p2i(ref), p2i(p)));
+ }
+ return true;
+}
+
+bool G1ParScanThreadState::verify_task(StarTask ref) const {
+ if (ref.is_narrow()) {
+ return verify_ref((narrowOop*) ref);
+ } else {
+ return verify_ref((oop*) ref);
+ }
+}
+#endif // ASSERT
+
+void G1ParScanThreadState::trim_queue() {
+ assert(_evac_failure_cl != NULL, "not set");
+
+ StarTask ref;
+ do {
+ // Drain the overflow stack first, so other threads can steal.
+ while (_refs->pop_overflow(ref)) {
+ dispatch_reference(ref);
+ }
+
+ while (_refs->pop_local(ref)) {
+ dispatch_reference(ref);
+ }
+ } while (!_refs->is_empty());
+}
+
+oop G1ParScanThreadState::copy_to_survivor_space(oop const old) {
+ size_t word_sz = old->size();
+ HeapRegion* from_region = _g1h->heap_region_containing_raw(old);
+ // +1 to make the -1 indexes valid...
+ int young_index = from_region->young_index_in_cset()+1;
+ assert( (from_region->is_young() && young_index > 0) ||
+ (!from_region->is_young() && young_index == 0), "invariant" );
+ G1CollectorPolicy* g1p = _g1h->g1_policy();
+ markOop m = old->mark();
+ int age = m->has_displaced_mark_helper() ? m->displaced_mark_helper()->age()
+ : m->age();
+ GCAllocPurpose alloc_purpose = g1p->evacuation_destination(from_region, age,
+ word_sz);
+ HeapWord* obj_ptr = allocate(alloc_purpose, word_sz);
+#ifndef PRODUCT
+ // Should this evacuation fail?
+ if (_g1h->evacuation_should_fail()) {
+ if (obj_ptr != NULL) {
+ undo_allocation(alloc_purpose, obj_ptr, word_sz);
+ obj_ptr = NULL;
+ }
+ }
+#endif // !PRODUCT
+
+ if (obj_ptr == NULL) {
+ // This will either forward-to-self, or detect that someone else has
+ // installed a forwarding pointer.
+ return _g1h->handle_evacuation_failure_par(this, old);
+ }
+
+ oop obj = oop(obj_ptr);
+
+ // We're going to allocate linearly, so might as well prefetch ahead.
+ Prefetch::write(obj_ptr, PrefetchCopyIntervalInBytes);
+
+ oop forward_ptr = old->forward_to_atomic(obj);
+ if (forward_ptr == NULL) {
+ Copy::aligned_disjoint_words((HeapWord*) old, obj_ptr, word_sz);
+
+ // alloc_purpose is just a hint to allocate() above, recheck the type of region
+ // we actually allocated from and update alloc_purpose accordingly
+ HeapRegion* to_region = _g1h->heap_region_containing_raw(obj_ptr);
+ alloc_purpose = to_region->is_young() ? GCAllocForSurvived : GCAllocForTenured;
+
+ if (g1p->track_object_age(alloc_purpose)) {
+ // We could simply do obj->incr_age(). However, this causes a
+ // performance issue. obj->incr_age() will first check whether
+ // the object has a displaced mark by checking its mark word;
+ // getting the mark word from the new location of the object
+ // stalls. So, given that we already have the mark word and we
+ // are about to install it anyway, it's better to increase the
+ // age on the mark word, when the object does not have a
+ // displaced mark word. We're not expecting many objects to have
+ // a displaced marked word, so that case is not optimized
+ // further (it could be...) and we simply call obj->incr_age().
+
+ if (m->has_displaced_mark_helper()) {
+ // in this case, we have to install the mark word first,
+ // otherwise obj looks to be forwarded (the old mark word,
+ // which contains the forward pointer, was copied)
+ obj->set_mark(m);
+ obj->incr_age();
+ } else {
+ m = m->incr_age();
+ obj->set_mark(m);
+ }
+ age_table()->add(obj, word_sz);
+ } else {
+ obj->set_mark(m);
+ }
+
+ if (G1StringDedup::is_enabled()) {
+ G1StringDedup::enqueue_from_evacuation(from_region->is_young(),
+ to_region->is_young(),
+ queue_num(),
+ obj);
+ }
+
+ size_t* surv_young_words = surviving_young_words();
+ surv_young_words[young_index] += word_sz;
+
+ if (obj->is_objArray() && arrayOop(obj)->length() >= ParGCArrayScanChunk) {
+ // We keep track of the next start index in the length field of
+ // the to-space object. The actual length can be found in the
+ // length field of the from-space object.
+ arrayOop(obj)->set_length(0);
+ oop* old_p = set_partial_array_mask(old);
+ push_on_queue(old_p);
+ } else {
+ // No point in using the slower heap_region_containing() method,
+ // given that we know obj is in the heap.
+ _scanner.set_region(_g1h->heap_region_containing_raw(obj));
+ obj->oop_iterate_backwards(&_scanner);
+ }
+ } else {
+ undo_allocation(alloc_purpose, obj_ptr, word_sz);
+ obj = forward_ptr;
+ }
+ return obj;
+}
+
+HeapWord* G1ParScanThreadState::allocate_slow(GCAllocPurpose purpose, size_t word_sz) {
+ HeapWord* obj = NULL;
+ size_t gclab_word_size = _g1h->desired_plab_sz(purpose);
+ if (word_sz * 100 < gclab_word_size * ParallelGCBufferWastePct) {
+ G1ParGCAllocBuffer* alloc_buf = alloc_buffer(purpose);
+ add_to_alloc_buffer_waste(alloc_buf->words_remaining());
+ alloc_buf->retire(false /* end_of_gc */, false /* retain */);
+
+ HeapWord* buf = _g1h->par_allocate_during_gc(purpose, gclab_word_size);
+ if (buf == NULL) {
+ return NULL; // Let caller handle allocation failure.
+ }
+ // Otherwise.
+ alloc_buf->set_word_size(gclab_word_size);
+ alloc_buf->set_buf(buf);
+
+ obj = alloc_buf->allocate(word_sz);
+ assert(obj != NULL, "buffer was definitely big enough...");
+ } else {
+ obj = _g1h->par_allocate_during_gc(purpose, word_sz);
+ }
+ return obj;
+}
+
+void G1ParScanThreadState::undo_allocation(GCAllocPurpose purpose, HeapWord* obj, size_t word_sz) {
+ if (alloc_buffer(purpose)->contains(obj)) {
+ assert(alloc_buffer(purpose)->contains(obj + word_sz - 1),
+ "should contain whole object");
+ alloc_buffer(purpose)->undo_allocation(obj, word_sz);
+ } else {
+ CollectedHeap::fill_with_object(obj, word_sz);
+ add_to_undo_waste(word_sz);
+ }
+}
+
+HeapWord* G1ParScanThreadState::allocate(GCAllocPurpose purpose, size_t word_sz) {
+ HeapWord* obj = alloc_buffer(purpose)->allocate(word_sz);
+ if (obj != NULL) {
+ return obj;
+ }
+ return allocate_slow(purpose, word_sz);
+}
+
+void G1ParScanThreadState::retire_alloc_buffers() {
+ for (int ap = 0; ap < GCAllocPurposeCount; ++ap) {
+ size_t waste = _alloc_buffers[ap]->words_remaining();
+ add_to_alloc_buffer_waste(waste);
+ _alloc_buffers[ap]->flush_stats_and_retire(_g1h->stats_for_purpose((GCAllocPurpose)ap),
+ true /* end_of_gc */,
+ false /* retain */);
+ }
+}
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.hpp
new file mode 100644
index 00000000000..e590a9ee86d
--- /dev/null
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.hpp
@@ -0,0 +1,227 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1PARSCANTHREADSTATE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1PARSCANTHREADSTATE_HPP
+
+#include "gc_implementation/g1/dirtyCardQueue.hpp"
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.hpp"
+#include "gc_implementation/g1/g1CollectorPolicy.hpp"
+#include "gc_implementation/g1/g1OopClosures.hpp"
+#include "gc_implementation/g1/g1RemSet.hpp"
+#include "gc_implementation/shared/ageTable.hpp"
+#include "memory/allocation.hpp"
+#include "oops/oop.hpp"
+
+class HeapRegion;
+class outputStream;
+
+class G1ParScanThreadState : public StackObj {
+ private:
+ G1CollectedHeap* _g1h;
+ RefToScanQueue* _refs;
+ DirtyCardQueue _dcq;
+ G1SATBCardTableModRefBS* _ct_bs;
+ G1RemSet* _g1_rem;
+
+ G1ParGCAllocBuffer _surviving_alloc_buffer;
+ G1ParGCAllocBuffer _tenured_alloc_buffer;
+ G1ParGCAllocBuffer* _alloc_buffers[GCAllocPurposeCount];
+ ageTable _age_table;
+
+ G1ParScanClosure _scanner;
+
+ size_t _alloc_buffer_waste;
+ size_t _undo_waste;
+
+ OopsInHeapRegionClosure* _evac_failure_cl;
+
+ int _hash_seed;
+ uint _queue_num;
+
+ size_t _term_attempts;
+
+ double _start;
+ double _start_strong_roots;
+ double _strong_roots_time;
+ double _start_term;
+ double _term_time;
+
+ // Map from young-age-index (0 == not young, 1 is youngest) to
+ // surviving words. base is what we get back from the malloc call
+ size_t* _surviving_young_words_base;
+ // this points into the array, as we use the first few entries for padding
+ size_t* _surviving_young_words;
+
+#define PADDING_ELEM_NUM (DEFAULT_CACHE_LINE_SIZE / sizeof(size_t))
+
+ void add_to_alloc_buffer_waste(size_t waste) { _alloc_buffer_waste += waste; }
+
+ void add_to_undo_waste(size_t waste) { _undo_waste += waste; }
+
+ DirtyCardQueue& dirty_card_queue() { return _dcq; }
+ G1SATBCardTableModRefBS* ctbs() { return _ct_bs; }
+
+ template inline void immediate_rs_update(HeapRegion* from, T* p, int tid);
+
+ template void deferred_rs_update(HeapRegion* from, T* p, int tid) {
+ // If the new value of the field points to the same region or
+ // is the to-space, we don't need to include it in the Rset updates.
+ if (!from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) && !from->is_survivor()) {
+ size_t card_index = ctbs()->index_for(p);
+ // If the card hasn't been added to the buffer, do it.
+ if (ctbs()->mark_card_deferred(card_index)) {
+ dirty_card_queue().enqueue((jbyte*)ctbs()->byte_for_index(card_index));
+ }
+ }
+ }
+
+ public:
+ G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num, ReferenceProcessor* rp);
+ ~G1ParScanThreadState();
+
+ ageTable* age_table() { return &_age_table; }
+
+ G1ParGCAllocBuffer* alloc_buffer(GCAllocPurpose purpose) {
+ return _alloc_buffers[purpose];
+ }
+
+ size_t alloc_buffer_waste() const { return _alloc_buffer_waste; }
+ size_t undo_waste() const { return _undo_waste; }
+
+#ifdef ASSERT
+ bool queue_is_empty() const { return _refs->is_empty(); }
+
+ bool verify_ref(narrowOop* ref) const;
+ bool verify_ref(oop* ref) const;
+ bool verify_task(StarTask ref) const;
+#endif // ASSERT
+
+ template void push_on_queue(T* ref) {
+ assert(verify_ref(ref), "sanity");
+ _refs->push(ref);
+ }
+
+ template inline void update_rs(HeapRegion* from, T* p, int tid);
+
+ private:
+
+ inline HeapWord* allocate(GCAllocPurpose purpose, size_t word_sz);
+ inline HeapWord* allocate_slow(GCAllocPurpose purpose, size_t word_sz);
+ inline void undo_allocation(GCAllocPurpose purpose, HeapWord* obj, size_t word_sz);
+
+ public:
+
+ void set_evac_failure_closure(OopsInHeapRegionClosure* evac_failure_cl) {
+ _evac_failure_cl = evac_failure_cl;
+ }
+
+ OopsInHeapRegionClosure* evac_failure_closure() { return _evac_failure_cl; }
+
+ int* hash_seed() { return &_hash_seed; }
+ uint queue_num() { return _queue_num; }
+
+ size_t term_attempts() const { return _term_attempts; }
+ void note_term_attempt() { _term_attempts++; }
+
+ void start_strong_roots() {
+ _start_strong_roots = os::elapsedTime();
+ }
+ void end_strong_roots() {
+ _strong_roots_time += (os::elapsedTime() - _start_strong_roots);
+ }
+ double strong_roots_time() const { return _strong_roots_time; }
+
+ void start_term_time() {
+ note_term_attempt();
+ _start_term = os::elapsedTime();
+ }
+ void end_term_time() {
+ _term_time += (os::elapsedTime() - _start_term);
+ }
+ double term_time() const { return _term_time; }
+
+ double elapsed_time() const {
+ return os::elapsedTime() - _start;
+ }
+
+ static void print_termination_stats_hdr(outputStream* const st = gclog_or_tty);
+ void print_termination_stats(int i, outputStream* const st = gclog_or_tty) const;
+
+ size_t* surviving_young_words() {
+ // We add on to hide entry 0 which accumulates surviving words for
+ // age -1 regions (i.e. non-young ones)
+ return _surviving_young_words;
+ }
+
+ private:
+ void retire_alloc_buffers();
+
+ #define G1_PARTIAL_ARRAY_MASK 0x2
+
+ inline bool has_partial_array_mask(oop* ref) const {
+ return ((uintptr_t)ref & G1_PARTIAL_ARRAY_MASK) == G1_PARTIAL_ARRAY_MASK;
+ }
+
+ // We never encode partial array oops as narrowOop*, so return false immediately.
+ // This allows the compiler to create optimized code when popping references from
+ // the work queue.
+ inline bool has_partial_array_mask(narrowOop* ref) const {
+ assert(((uintptr_t)ref & G1_PARTIAL_ARRAY_MASK) != G1_PARTIAL_ARRAY_MASK, "Partial array oop reference encoded as narrowOop*");
+ return false;
+ }
+
+ // Only implement set_partial_array_mask() for regular oops, not for narrowOops.
+ // We always encode partial arrays as regular oop, to allow the
+ // specialization for has_partial_array_mask() for narrowOops above.
+ // This means that unintentional use of this method with narrowOops are caught
+ // by the compiler.
+ inline oop* set_partial_array_mask(oop obj) const {
+ assert(((uintptr_t)(void *)obj & G1_PARTIAL_ARRAY_MASK) == 0, "Information loss!");
+ return (oop*) ((uintptr_t)(void *)obj | G1_PARTIAL_ARRAY_MASK);
+ }
+
+ inline oop clear_partial_array_mask(oop* ref) const {
+ return cast_to_oop((intptr_t)ref & ~G1_PARTIAL_ARRAY_MASK);
+ }
+
+ inline void do_oop_partial_array(oop* p);
+
+ // This method is applied to the fields of the objects that have just been copied.
+ template inline void do_oop_evac(T* p, HeapRegion* from);
+
+ template inline void deal_with_reference(T* ref_to_scan);
+
+ inline void dispatch_reference(StarTask ref);
+ public:
+
+ oop copy_to_survivor_space(oop const obj);
+
+ void trim_queue();
+
+ inline void steal_and_trim_queue(RefToScanQueueSet *task_queues);
+};
+
+#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1PARSCANTHREADSTATE_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp
new file mode 100644
index 00000000000..fc2fbe3ff45
--- /dev/null
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1ParScanThreadState.inline.hpp
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1PARSCANTHREADSTATE_INLINE_HPP
+#define SHARE_VM_GC_IMPLEMENTATION_G1_G1PARSCANTHREADSTATE_INLINE_HPP
+
+#include "gc_implementation/g1/g1ParScanThreadState.hpp"
+#include "gc_implementation/g1/g1RemSet.inline.hpp"
+#include "oops/oop.inline.hpp"
+
+template inline void G1ParScanThreadState::immediate_rs_update(HeapRegion* from, T* p, int tid) {
+ if (!from->is_survivor()) {
+ _g1_rem->par_write_ref(from, p, tid);
+ }
+}
+
+template void G1ParScanThreadState::update_rs(HeapRegion* from, T* p, int tid) {
+ if (G1DeferredRSUpdate) {
+ deferred_rs_update(from, p, tid);
+ } else {
+ immediate_rs_update(from, p, tid);
+ }
+}
+
+template void G1ParScanThreadState::do_oop_evac(T* p, HeapRegion* from) {
+ assert(!oopDesc::is_null(oopDesc::load_decode_heap_oop(p)),
+ "Reference should not be NULL here as such are never pushed to the task queue.");
+ oop obj = oopDesc::load_decode_heap_oop_not_null(p);
+
+ // Although we never intentionally push references outside of the collection
+ // set, due to (benign) races in the claim mechanism during RSet scanning more
+ // than one thread might claim the same card. So the same card may be
+ // processed multiple times. So redo this check.
+ if (_g1h->in_cset_fast_test(obj)) {
+ oop forwardee;
+ if (obj->is_forwarded()) {
+ forwardee = obj->forwardee();
+ } else {
+ forwardee = copy_to_survivor_space(obj);
+ }
+ assert(forwardee != NULL, "forwardee should not be NULL");
+ oopDesc::encode_store_heap_oop(p, forwardee);
+ }
+
+ assert(obj != NULL, "Must be");
+ update_rs(from, p, queue_num());
+}
+
+inline void G1ParScanThreadState::do_oop_partial_array(oop* p) {
+ assert(has_partial_array_mask(p), "invariant");
+ oop from_obj = clear_partial_array_mask(p);
+
+ assert(Universe::heap()->is_in_reserved(from_obj), "must be in heap.");
+ assert(from_obj->is_objArray(), "must be obj array");
+ objArrayOop from_obj_array = objArrayOop(from_obj);
+ // The from-space object contains the real length.
+ int length = from_obj_array->length();
+
+ assert(from_obj->is_forwarded(), "must be forwarded");
+ oop to_obj = from_obj->forwardee();
+ assert(from_obj != to_obj, "should not be chunking self-forwarded objects");
+ objArrayOop to_obj_array = objArrayOop(to_obj);
+ // We keep track of the next start index in the length field of the
+ // to-space object.
+ int next_index = to_obj_array->length();
+ assert(0 <= next_index && next_index < length,
+ err_msg("invariant, next index: %d, length: %d", next_index, length));
+
+ int start = next_index;
+ int end = length;
+ int remainder = end - start;
+ // We'll try not to push a range that's smaller than ParGCArrayScanChunk.
+ if (remainder > 2 * ParGCArrayScanChunk) {
+ end = start + ParGCArrayScanChunk;
+ to_obj_array->set_length(end);
+ // Push the remainder before we process the range in case another
+ // worker has run out of things to do and can steal it.
+ oop* from_obj_p = set_partial_array_mask(from_obj);
+ push_on_queue(from_obj_p);
+ } else {
+ assert(length == end, "sanity");
+ // We'll process the final range for this object. Restore the length
+ // so that the heap remains parsable in case of evacuation failure.
+ to_obj_array->set_length(end);
+ }
+ _scanner.set_region(_g1h->heap_region_containing_raw(to_obj));
+ // Process indexes [start,end). It will also process the header
+ // along with the first chunk (i.e., the chunk with start == 0).
+ // Note that at this point the length field of to_obj_array is not
+ // correct given that we are using it to keep track of the next
+ // start index. oop_iterate_range() (thankfully!) ignores the length
+ // field and only relies on the start / end parameters. It does
+ // however return the size of the object which will be incorrect. So
+ // we have to ignore it even if we wanted to use it.
+ to_obj_array->oop_iterate_range(&_scanner, start, end);
+}
+
+template inline void G1ParScanThreadState::deal_with_reference(T* ref_to_scan) {
+ if (!has_partial_array_mask(ref_to_scan)) {
+ // Note: we can use "raw" versions of "region_containing" because
+ // "obj_to_scan" is definitely in the heap, and is not in a
+ // humongous region.
+ HeapRegion* r = _g1h->heap_region_containing_raw(ref_to_scan);
+ do_oop_evac(ref_to_scan, r);
+ } else {
+ do_oop_partial_array((oop*)ref_to_scan);
+ }
+}
+
+inline void G1ParScanThreadState::dispatch_reference(StarTask ref) {
+ assert(verify_task(ref), "sanity");
+ if (ref.is_narrow()) {
+ deal_with_reference((narrowOop*)ref);
+ } else {
+ deal_with_reference((oop*)ref);
+ }
+}
+
+void G1ParScanThreadState::steal_and_trim_queue(RefToScanQueueSet *task_queues) {
+ StarTask stolen_task;
+ while (task_queues->steal(queue_num(), hash_seed(), stolen_task)) {
+ assert(verify_task(stolen_task), "sanity");
+ dispatch_reference(stolen_task);
+
+ // We've just processed a reference and we might have made
+ // available new entries on the queues. So we have to make sure
+ // we drain the queues as necessary.
+ trim_queue();
+ }
+}
+
+#endif /* SHARE_VM_GC_IMPLEMENTATION_G1_G1PARSCANTHREADSTATE_INLINE_HPP */
+
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp
index cf90d9ca23c..949614b28fc 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp
@@ -26,6 +26,7 @@
#define SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSET_INLINE_HPP
#include "gc_implementation/g1/g1RemSet.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
#include "gc_implementation/g1/heapRegionRemSet.hpp"
#include "oops/oop.inline.hpp"
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp
index 53d88d9cb64..bcabcdd9bfa 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp
@@ -66,6 +66,17 @@ G1SATBCardTableModRefBS::write_ref_array_pre_work(T* dst, int count) {
}
}
+void G1SATBCardTableModRefBS::write_ref_array_pre(oop* dst, int count, bool dest_uninitialized) {
+ if (!dest_uninitialized) {
+ write_ref_array_pre_work(dst, count);
+ }
+}
+void G1SATBCardTableModRefBS::write_ref_array_pre(narrowOop* dst, int count, bool dest_uninitialized) {
+ if (!dest_uninitialized) {
+ write_ref_array_pre_work(dst, count);
+ }
+}
+
bool G1SATBCardTableModRefBS::mark_card_deferred(size_t card_index) {
jbyte val = _byte_map[card_index];
// It's already processed
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp
index 99d49cc6185..3e612605c02 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp
@@ -86,16 +86,8 @@ public:
}
template void write_ref_array_pre_work(T* dst, int count);
- virtual void write_ref_array_pre(oop* dst, int count, bool dest_uninitialized) {
- if (!dest_uninitialized) {
- write_ref_array_pre_work(dst, count);
- }
- }
- virtual void write_ref_array_pre(narrowOop* dst, int count, bool dest_uninitialized) {
- if (!dest_uninitialized) {
- write_ref_array_pre_work(dst, count);
- }
- }
+ virtual void write_ref_array_pre(oop* dst, int count, bool dest_uninitialized);
+ virtual void write_ref_array_pre(narrowOop* dst, int count, bool dest_uninitialized);
/*
Claimed and deferred bits are used together in G1 during the evacuation
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp
index 538ca4452b9..309392cc0ce 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp
@@ -30,14 +30,21 @@
// non-virtually, using a mechanism defined in this file. Extend these
// macros in the obvious way to add specializations for new closures.
-// Forward declarations.
enum G1Barrier {
G1BarrierNone,
G1BarrierEvac,
G1BarrierKlass
};
-template
+enum G1Mark {
+ G1MarkNone,
+ G1MarkFromRoot,
+ G1MarkPromotedFromRoot
+};
+
+// Forward declarations.
+
+template
class G1ParCopyClosure;
class G1ParScanClosure;
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
index 037d76ca8aa..cecf891306a 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
@@ -30,6 +30,7 @@
#include "gc_implementation/g1/heapRegion.inline.hpp"
#include "gc_implementation/g1/heapRegionRemSet.hpp"
#include "gc_implementation/g1/heapRegionSeq.inline.hpp"
+#include "gc_implementation/shared/liveRange.hpp"
#include "memory/genOopClosures.inline.hpp"
#include "memory/iterator.hpp"
#include "memory/space.inline.hpp"
@@ -61,7 +62,7 @@ HeapWord* walk_mem_region_loop(ClosureType* cl, G1CollectedHeap* g1h,
HeapRegion* hr,
HeapWord* cur, HeapWord* top) {
oop cur_oop = oop(cur);
- int oop_size = cur_oop->size();
+ size_t oop_size = hr->block_size(cur);
HeapWord* next_obj = cur + oop_size;
while (next_obj < top) {
// Keep filtering the remembered set.
@@ -72,7 +73,7 @@ HeapWord* walk_mem_region_loop(ClosureType* cl, G1CollectedHeap* g1h,
}
cur = next_obj;
cur_oop = oop(cur);
- oop_size = cur_oop->size();
+ oop_size = hr->block_size(cur);
next_obj = cur + oop_size;
}
return cur;
@@ -82,7 +83,7 @@ void HeapRegionDCTOC::walk_mem_region(MemRegion mr,
HeapWord* bottom,
HeapWord* top) {
G1CollectedHeap* g1h = _g1;
- int oop_size;
+ size_t oop_size;
ExtendedOopClosure* cl2 = NULL;
FilterIntoCSClosure intoCSFilt(this, g1h, _cl);
@@ -102,7 +103,7 @@ void HeapRegionDCTOC::walk_mem_region(MemRegion mr,
if (!g1h->is_obj_dead(oop(bottom), _hr)) {
oop_size = oop(bottom)->oop_iterate(cl2, mr);
} else {
- oop_size = oop(bottom)->size();
+ oop_size = _hr->block_size(bottom);
}
bottom += oop_size;
@@ -374,7 +375,7 @@ HeapRegion::HeapRegion(uint hrs_index,
// region.
hr_clear(false /*par*/, false /*clear_space*/);
set_top(bottom());
- set_saved_mark();
+ record_top_and_timestamp();
assert(HeapRegionRemSet::num_par_rem_sets() > 0, "Invariant.");
}
@@ -394,38 +395,11 @@ CompactibleSpace* HeapRegion::next_compaction_space() const {
return NULL;
}
-void HeapRegion::save_marks() {
- set_saved_mark();
-}
-
-void HeapRegion::oops_in_mr_iterate(MemRegion mr, ExtendedOopClosure* cl) {
- HeapWord* p = mr.start();
- HeapWord* e = mr.end();
- oop obj;
- while (p < e) {
- obj = oop(p);
- p += obj->oop_iterate(cl);
- }
- assert(p == e, "bad memregion: doesn't end on obj boundary");
-}
-
-#define HeapRegion_OOP_SINCE_SAVE_MARKS_DEFN(OopClosureType, nv_suffix) \
-void HeapRegion::oop_since_save_marks_iterate##nv_suffix(OopClosureType* cl) { \
- ContiguousSpace::oop_since_save_marks_iterate##nv_suffix(cl); \
-}
-SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(HeapRegion_OOP_SINCE_SAVE_MARKS_DEFN)
-
-
-void HeapRegion::oop_before_save_marks_iterate(ExtendedOopClosure* cl) {
- oops_in_mr_iterate(MemRegion(bottom(), saved_mark_word()), cl);
-}
-
void HeapRegion::note_self_forwarding_removal_start(bool during_initial_mark,
bool during_conc_mark) {
// We always recreate the prev marking info and we'll explicitly
// mark all objects we find to be self-forwarded on the prev
// bitmap. So all objects need to be below PTAMS.
- _prev_top_at_mark_start = top();
_prev_marked_bytes = 0;
if (during_initial_mark) {
@@ -449,6 +423,7 @@ void HeapRegion::note_self_forwarding_removal_end(bool during_initial_mark,
assert(0 <= marked_bytes && marked_bytes <= used(),
err_msg("marked: "SIZE_FORMAT" used: "SIZE_FORMAT,
marked_bytes, used()));
+ _prev_top_at_mark_start = top();
_prev_marked_bytes = marked_bytes;
}
@@ -476,7 +451,7 @@ HeapRegion::object_iterate_mem_careful(MemRegion mr,
} else if (!g1h->is_obj_dead(obj)) {
cl->do_object(obj);
}
- cur += obj->size();
+ cur += block_size(cur);
}
return NULL;
}
@@ -548,7 +523,7 @@ oops_on_card_seq_iterate_careful(MemRegion mr,
return cur;
}
// Otherwise...
- next = (cur + obj->size());
+ next = cur + block_size(cur);
}
// If we finish the above loop...We have a parseable object that
@@ -556,10 +531,9 @@ oops_on_card_seq_iterate_careful(MemRegion mr,
// inside or spans the entire region.
assert(obj == oop(cur), "sanity");
- assert(cur <= start &&
- obj->klass_or_null() != NULL &&
- (cur + obj->size()) > start,
- "Loop postcondition");
+ assert(cur <= start, "Loop postcondition");
+ assert(obj->klass_or_null() != NULL, "Loop postcondition");
+ assert((cur + block_size(cur)) > start, "Loop postcondition");
if (!g1h->is_obj_dead(obj)) {
obj->oop_iterate(cl, mr);
@@ -573,7 +547,7 @@ oops_on_card_seq_iterate_careful(MemRegion mr,
};
// Otherwise:
- next = (cur + obj->size());
+ next = cur + block_size(cur);
if (!g1h->is_obj_dead(obj)) {
if (next < end || !obj->is_objArray()) {
@@ -928,10 +902,11 @@ void HeapRegion::verify(VerifyOption vo,
size_t object_num = 0;
while (p < top()) {
oop obj = oop(p);
- size_t obj_size = obj->size();
+ size_t obj_size = block_size(p);
object_num += 1;
- if (is_humongous != g1->isHumongous(obj_size)) {
+ if (is_humongous != g1->isHumongous(obj_size) &&
+ !g1->is_obj_dead(obj, this)) { // Dead objects may have bigger block_size since they span several objects.
gclog_or_tty->print_cr("obj "PTR_FORMAT" is of %shumongous size ("
SIZE_FORMAT" words) in a %shumongous region",
p, g1->isHumongous(obj_size) ? "" : "non-",
@@ -942,7 +917,9 @@ void HeapRegion::verify(VerifyOption vo,
// If it returns false, verify_for_object() will output the
// appropriate messasge.
- if (do_bot_verify && !_offsets.verify_for_object(p, obj_size)) {
+ if (do_bot_verify &&
+ !g1->is_obj_dead(obj, this) &&
+ !_offsets.verify_for_object(p, obj_size)) {
*failures = true;
return;
}
@@ -950,7 +927,10 @@ void HeapRegion::verify(VerifyOption vo,
if (!g1->is_obj_dead_cond(obj, this, vo)) {
if (obj->is_oop()) {
Klass* klass = obj->klass();
- if (!klass->is_metaspace_object()) {
+ bool is_metaspace_object = Metaspace::contains(klass) ||
+ (vo == VerifyOption_G1UsePrevMarking &&
+ ClassLoaderDataGraph::unload_list_contains(klass));
+ if (!is_metaspace_object) {
gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" "
"not metadata", klass, (void *)obj);
*failures = true;
@@ -1064,7 +1044,9 @@ void HeapRegion::verify() const {
// away eventually.
void G1OffsetTableContigSpace::clear(bool mangle_space) {
- ContiguousSpace::clear(mangle_space);
+ set_top(bottom());
+ set_saved_mark_word(bottom());
+ CompactibleSpace::clear(mangle_space);
_offsets.zero_bottom_entry();
_offsets.initialize_threshold();
}
@@ -1102,10 +1084,10 @@ HeapWord* G1OffsetTableContigSpace::saved_mark_word() const {
if (_gc_time_stamp < g1h->get_gc_time_stamp())
return top();
else
- return ContiguousSpace::saved_mark_word();
+ return Space::saved_mark_word();
}
-void G1OffsetTableContigSpace::set_saved_mark() {
+void G1OffsetTableContigSpace::record_top_and_timestamp() {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
unsigned curr_gc_time_stamp = g1h->get_gc_time_stamp();
@@ -1117,7 +1099,7 @@ void G1OffsetTableContigSpace::set_saved_mark() {
// of region. If it does so after _gc_time_stamp = ..., then it
// will pick up the right saved_mark_word() as the high water mark
// of the region. Either way, the behavior will be correct.
- ContiguousSpace::set_saved_mark();
+ Space::set_saved_mark_word(top());
OrderAccess::storestore();
_gc_time_stamp = curr_gc_time_stamp;
// No need to do another barrier to flush the writes above. If
@@ -1128,6 +1110,26 @@ void G1OffsetTableContigSpace::set_saved_mark() {
}
}
+void G1OffsetTableContigSpace::safe_object_iterate(ObjectClosure* blk) {
+ object_iterate(blk);
+}
+
+void G1OffsetTableContigSpace::object_iterate(ObjectClosure* blk) {
+ HeapWord* p = bottom();
+ while (p < top()) {
+ if (block_is_obj(p)) {
+ blk->do_object(oop(p));
+ }
+ p += block_size(p);
+ }
+}
+
+#define block_is_always_obj(q) true
+void G1OffsetTableContigSpace::prepare_for_compaction(CompactPoint* cp) {
+ SCAN_AND_FORWARD(cp, top, block_is_always_obj, block_size);
+}
+#undef block_is_always_obj
+
G1OffsetTableContigSpace::
G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray,
MemRegion mr) :
@@ -1137,7 +1139,8 @@ G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray,
{
_offsets.set_space(this);
// false ==> we'll do the clearing if there's clearing to be done.
- ContiguousSpace::initialize(mr, false, SpaceDecorator::Mangle);
+ CompactibleSpace::initialize(mr, false, SpaceDecorator::Mangle);
+ _top = bottom();
_offsets.zero_bottom_entry();
_offsets.initialize_threshold();
}
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp
index 0b9fce740fb..42c9eac5431 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp
@@ -46,8 +46,6 @@
// The solution is to remove this method from the definition
// of a Space.
-class CompactibleSpace;
-class ContiguousSpace;
class HeapRegionRemSet;
class HeapRegionRemSetIterator;
class HeapRegion;
@@ -125,9 +123,9 @@ public:
// the regions anyway) and at the end of a Full GC. The current scheme
// that uses sequential unsigned ints will fail only if we have 4b
// evacuation pauses between two cleanups, which is _highly_ unlikely.
-
-class G1OffsetTableContigSpace: public ContiguousSpace {
+class G1OffsetTableContigSpace: public CompactibleSpace {
friend class VMStructs;
+ HeapWord* _top;
protected:
G1BlockOffsetArrayContigSpace _offsets;
Mutex _par_alloc_lock;
@@ -144,11 +142,32 @@ class G1OffsetTableContigSpace: public ContiguousSpace {
G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray,
MemRegion mr);
+ void set_top(HeapWord* value) { _top = value; }
+ HeapWord* top() const { return _top; }
+
+ protected:
+ HeapWord** top_addr() { return &_top; }
+ // Allocation helpers (return NULL if full).
+ inline HeapWord* allocate_impl(size_t word_size, HeapWord* end_value);
+ inline HeapWord* par_allocate_impl(size_t word_size, HeapWord* end_value);
+
+ public:
+ void reset_after_compaction() { set_top(compaction_top()); }
+
+ size_t used() const { return byte_size(bottom(), top()); }
+ size_t free() const { return byte_size(top(), end()); }
+ bool is_free_block(const HeapWord* p) const { return p >= top(); }
+
+ MemRegion used_region() const { return MemRegion(bottom(), top()); }
+
+ void object_iterate(ObjectClosure* blk);
+ void safe_object_iterate(ObjectClosure* blk);
+
void set_bottom(HeapWord* value);
void set_end(HeapWord* value);
virtual HeapWord* saved_mark_word() const;
- virtual void set_saved_mark();
+ void record_top_and_timestamp();
void reset_gc_time_stamp() { _gc_time_stamp = 0; }
unsigned get_gc_time_stamp() { return _gc_time_stamp; }
@@ -168,6 +187,8 @@ class G1OffsetTableContigSpace: public ContiguousSpace {
HeapWord* block_start(const void* p);
HeapWord* block_start_const(const void* p) const;
+ void prepare_for_compaction(CompactPoint* cp);
+
// Add offset table update.
virtual HeapWord* allocate(size_t word_size);
HeapWord* par_allocate(size_t word_size);
@@ -202,10 +223,6 @@ class HeapRegion: public G1OffsetTableContigSpace {
ContinuesHumongous
};
- // Requires that the region "mr" be dense with objects, and begin and end
- // with an object.
- void oops_in_mr_iterate(MemRegion mr, ExtendedOopClosure* cl);
-
// The remembered set for this region.
// (Might want to make this "inline" later, to avoid some alloc failure
// issues.)
@@ -230,11 +247,9 @@ class HeapRegion: public G1OffsetTableContigSpace {
bool _evacuation_failed;
// A heap region may be a member one of a number of special subsets, each
- // represented as linked lists through the field below. Currently, these
- // sets include:
+ // represented as linked lists through the field below. Currently, there
+ // is only one set:
// The collection set.
- // The set of allocation regions used in a collection pause.
- // Spaces that may contain gray objects.
HeapRegion* _next_in_special_set;
// next region in the young "generation" region set
@@ -353,14 +368,15 @@ class HeapRegion: public G1OffsetTableContigSpace {
ParMarkRootClaimValue = 9
};
- inline HeapWord* par_allocate_no_bot_updates(size_t word_size) {
- assert(is_young(), "we can only skip BOT updates on young regions");
- return ContiguousSpace::par_allocate(word_size);
- }
- inline HeapWord* allocate_no_bot_updates(size_t word_size) {
- assert(is_young(), "we can only skip BOT updates on young regions");
- return ContiguousSpace::allocate(word_size);
- }
+ // All allocated blocks are occupied by objects in a HeapRegion
+ bool block_is_obj(const HeapWord* p) const;
+
+ // Returns the object size for all valid block starts
+ // and the amount of unallocated words if called on top()
+ size_t block_size(const HeapWord* p) const;
+
+ inline HeapWord* par_allocate_no_bot_updates(size_t word_size);
+ inline HeapWord* allocate_no_bot_updates(size_t word_size);
// If this region is a member of a HeapRegionSeq, the index in that
// sequence, otherwise -1.
@@ -569,9 +585,6 @@ class HeapRegion: public G1OffsetTableContigSpace {
HeapWord* orig_end() { return _orig_end; }
- // Allows logical separation between objects allocated before and after.
- void save_marks();
-
// Reset HR stuff to default values.
void hr_clear(bool par, bool clear_space, bool locked = false);
void par_clear();
@@ -580,10 +593,6 @@ class HeapRegion: public G1OffsetTableContigSpace {
HeapWord* prev_top_at_mark_start() const { return _prev_top_at_mark_start; }
HeapWord* next_top_at_mark_start() const { return _next_top_at_mark_start; }
- // Apply "cl->do_oop" to (the addresses of) all reference fields in objects
- // allocated in the current region before the last call to "save_mark".
- void oop_before_save_marks_iterate(ExtendedOopClosure* cl);
-
// Note the start or end of marking. This tells the heap region
// that the collector is about to start or has finished (concurrently)
// marking the heap.
@@ -769,10 +778,6 @@ class HeapRegion: public G1OffsetTableContigSpace {
_predicted_bytes_to_copy = bytes;
}
-#define HeapRegion_OOP_SINCE_SAVE_MARKS_DECL(OopClosureType, nv_suffix) \
- virtual void oop_since_save_marks_iterate##nv_suffix(OopClosureType* cl);
- SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(HeapRegion_OOP_SINCE_SAVE_MARKS_DECL)
-
virtual CompactibleSpace* next_compaction_space() const;
virtual void reset_after_compaction();
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp
index b85c448d161..ebe4c067b9d 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp
@@ -26,9 +26,48 @@
#define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_INLINE_HPP
#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
+#include "gc_implementation/g1/g1CollectedHeap.hpp"
+#include "gc_implementation/g1/heapRegion.hpp"
+#include "memory/space.hpp"
+#include "runtime/atomic.inline.hpp"
+
+// This version requires locking.
+inline HeapWord* G1OffsetTableContigSpace::allocate_impl(size_t size,
+ HeapWord* const end_value) {
+ HeapWord* obj = top();
+ if (pointer_delta(end_value, obj) >= size) {
+ HeapWord* new_top = obj + size;
+ set_top(new_top);
+ assert(is_aligned(obj) && is_aligned(new_top), "checking alignment");
+ return obj;
+ } else {
+ return NULL;
+ }
+}
+
+// This version is lock-free.
+inline HeapWord* G1OffsetTableContigSpace::par_allocate_impl(size_t size,
+ HeapWord* const end_value) {
+ do {
+ HeapWord* obj = top();
+ if (pointer_delta(end_value, obj) >= size) {
+ HeapWord* new_top = obj + size;
+ HeapWord* result = (HeapWord*)Atomic::cmpxchg_ptr(new_top, top_addr(), obj);
+ // result can be one of two:
+ // the old top value: the exchange succeeded
+ // otherwise: the new value of the top is returned.
+ if (result == obj) {
+ assert(is_aligned(obj) && is_aligned(new_top), "checking alignment");
+ return obj;
+ }
+ } else {
+ return NULL;
+ }
+ } while (true);
+}
inline HeapWord* G1OffsetTableContigSpace::allocate(size_t size) {
- HeapWord* res = ContiguousSpace::allocate(size);
+ HeapWord* res = allocate_impl(size, end());
if (res != NULL) {
_offsets.alloc_block(res, size);
}
@@ -40,12 +79,7 @@ inline HeapWord* G1OffsetTableContigSpace::allocate(size_t size) {
// this is used for larger LAB allocations only.
inline HeapWord* G1OffsetTableContigSpace::par_allocate(size_t size) {
MutexLocker x(&_par_alloc_lock);
- // Given that we take the lock no need to use par_allocate() here.
- HeapWord* res = ContiguousSpace::allocate(size);
- if (res != NULL) {
- _offsets.alloc_block(res, size);
- }
- return res;
+ return allocate(size);
}
inline HeapWord* G1OffsetTableContigSpace::block_start(const void* p) {
@@ -57,6 +91,41 @@ G1OffsetTableContigSpace::block_start_const(const void* p) const {
return _offsets.block_start_const(p);
}
+inline bool
+HeapRegion::block_is_obj(const HeapWord* p) const {
+ G1CollectedHeap* g1h = G1CollectedHeap::heap();
+ return !g1h->is_obj_dead(oop(p), this);
+}
+
+inline size_t
+HeapRegion::block_size(const HeapWord *addr) const {
+ // Old regions' dead objects may have dead classes
+ // We need to find the next live object in some other
+ // manner than getting the oop size
+ G1CollectedHeap* g1h = G1CollectedHeap::heap();
+ if (g1h->is_obj_dead(oop(addr), this)) {
+ HeapWord* next = g1h->concurrent_mark()->prevMarkBitMap()->
+ getNextMarkedWordAddress(addr, prev_top_at_mark_start());
+
+ assert(next > addr, "must get the next live object");
+
+ return pointer_delta(next, addr);
+ } else if (addr == top()) {
+ return pointer_delta(end(), addr);
+ }
+ return oop(addr)->size();
+}
+
+inline HeapWord* HeapRegion::par_allocate_no_bot_updates(size_t word_size) {
+ assert(is_young(), "we can only skip BOT updates on young regions");
+ return par_allocate_impl(word_size, end());
+}
+
+inline HeapWord* HeapRegion::allocate_no_bot_updates(size_t word_size) {
+ assert(is_young(), "we can only skip BOT updates on young regions");
+ return allocate_impl(word_size, end());
+}
+
inline void HeapRegion::note_start_of_marking() {
_next_marked_bytes = 0;
_next_top_at_mark_start = top();
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
index 08f016d83d9..df65940100d 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
@@ -931,7 +931,10 @@ void HeapRegionRemSet::add_strong_code_root(nmethod* nm) {
void HeapRegionRemSet::remove_strong_code_root(nmethod* nm) {
assert(nm != NULL, "sanity");
- _code_roots.remove(nm);
+ assert_locked_or_safepoint(CodeCache_lock);
+
+ _code_roots.remove_lock_free(nm);
+
// Check that there were no duplicates
guarantee(!_code_roots.contains(nm), "duplicate entry found");
}
diff --git a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp
index 8a0e42ea4e5..5831650cf36 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp
@@ -285,37 +285,6 @@ void SATBMarkQueueSet::set_par_closure(int i, ObjectClosure* par_closure) {
_par_closures[i] = par_closure;
}
-void SATBMarkQueueSet::iterate_closure_all_threads() {
- for(JavaThread* t = Threads::first(); t; t = t->next()) {
- t->satb_mark_queue().apply_closure_and_empty(_closure);
- }
- shared_satb_queue()->apply_closure_and_empty(_closure);
-}
-
-void SATBMarkQueueSet::par_iterate_closure_all_threads(uint worker) {
- SharedHeap* sh = SharedHeap::heap();
- int parity = sh->strong_roots_parity();
-
- for(JavaThread* t = Threads::first(); t; t = t->next()) {
- if (t->claim_oops_do(true, parity)) {
- t->satb_mark_queue().apply_closure_and_empty(_par_closures[worker]);
- }
- }
-
- // We also need to claim the VMThread so that its parity is updated
- // otherwise the next call to Thread::possibly_parallel_oops_do inside
- // a StrongRootsScope might skip the VMThread because it has a stale
- // parity that matches the parity set by the StrongRootsScope
- //
- // Whichever worker succeeds in claiming the VMThread gets to do
- // the shared queue.
-
- VMThread* vmt = VMThread::vm_thread();
- if (vmt->claim_oops_do(true, parity)) {
- shared_satb_queue()->apply_closure_and_empty(_par_closures[worker]);
- }
-}
-
bool SATBMarkQueueSet::apply_closure_to_completed_buffer_work(bool par,
uint worker) {
BufferNode* nd = NULL;
diff --git a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp
index dca73d0dbd4..4da54470128 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp
@@ -33,7 +33,9 @@ class SATBMarkQueueSet;
// A ptrQueue whose elements are "oops", pointers to object heads.
class ObjPtrQueue: public PtrQueue {
+ friend class Threads;
friend class SATBMarkQueueSet;
+ friend class G1RemarkThreadsClosure;
private:
// Filter out unwanted entries from the buffer.
@@ -119,13 +121,6 @@ public:
// closures, one for each parallel GC thread.
void set_par_closure(int i, ObjectClosure* closure);
- // Apply the registered closure to all entries on each
- // currently-active buffer and then empty the buffer. It should only
- // be called serially and at a safepoint.
- void iterate_closure_all_threads();
- // Parallel version of the above.
- void par_iterate_closure_all_threads(uint worker);
-
// If there exists some completed buffer, pop it, then apply the
// registered closure to all its elements, and return true. If no
// completed buffers exist, return false.
diff --git a/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp b/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp
index d7820f89abe..f32bfb0e3a3 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/vmStructs_g1.hpp
@@ -34,6 +34,8 @@
static_field(HeapRegion, GrainBytes, size_t) \
static_field(HeapRegion, LogOfHRGrainBytes, int) \
\
+ nonstatic_field(G1OffsetTableContigSpace, _top, HeapWord*) \
+ \
nonstatic_field(G1HeapRegionTable, _base, address) \
nonstatic_field(G1HeapRegionTable, _length, size_t) \
nonstatic_field(G1HeapRegionTable, _biased_base, address) \
@@ -69,7 +71,8 @@
\
declare_type(G1CollectedHeap, SharedHeap) \
\
- declare_type(HeapRegion, ContiguousSpace) \
+ declare_type(G1OffsetTableContigSpace, CompactibleSpace) \
+ declare_type(HeapRegion, G1OffsetTableContigSpace) \
declare_toplevel_type(HeapRegionSeq) \
declare_toplevel_type(HeapRegionSetBase) \
declare_toplevel_type(HeapRegionSetCount) \
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp
deleted file mode 100644
index 9b39c289900..00000000000
--- a/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp
+++ /dev/null
@@ -1,657 +0,0 @@
-/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#include "precompiled.hpp"
-#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
-#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp"
-#include "gc_implementation/parNew/asParNewGeneration.hpp"
-#include "gc_implementation/parNew/parNewGeneration.hpp"
-#include "gc_implementation/shared/markSweep.inline.hpp"
-#include "gc_implementation/shared/spaceDecorator.hpp"
-#include "memory/defNewGeneration.inline.hpp"
-#include "memory/referencePolicy.hpp"
-#include "oops/markOop.inline.hpp"
-#include "oops/oop.pcgc.inline.hpp"
-
-ASParNewGeneration::ASParNewGeneration(ReservedSpace rs,
- size_t initial_byte_size,
- size_t min_byte_size,
- int level) :
- ParNewGeneration(rs, initial_byte_size, level),
- _min_gen_size(min_byte_size) {}
-
-const char* ASParNewGeneration::name() const {
- return "adaptive size par new generation";
-}
-
-void ASParNewGeneration::adjust_desired_tenuring_threshold() {
- assert(UseAdaptiveSizePolicy,
- "Should only be used with UseAdaptiveSizePolicy");
-}
-
-void ASParNewGeneration::resize(size_t eden_size, size_t survivor_size) {
- // Resize the generation if needed. If the generation resize
- // reports false, do not attempt to resize the spaces.
- if (resize_generation(eden_size, survivor_size)) {
- // Then we lay out the spaces inside the generation
- resize_spaces(eden_size, survivor_size);
-
- space_invariants();
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr("Young generation size: "
- "desired eden: " SIZE_FORMAT " survivor: " SIZE_FORMAT
- " used: " SIZE_FORMAT " capacity: " SIZE_FORMAT
- " gen limits: " SIZE_FORMAT " / " SIZE_FORMAT,
- eden_size, survivor_size, used(), capacity(),
- max_gen_size(), min_gen_size());
- }
- }
-}
-
-size_t ASParNewGeneration::available_to_min_gen() {
- assert(virtual_space()->committed_size() >= min_gen_size(), "Invariant");
- return virtual_space()->committed_size() - min_gen_size();
-}
-
-// This method assumes that from-space has live data and that
-// any shrinkage of the young gen is limited by location of
-// from-space.
-size_t ASParNewGeneration::available_to_live() const {
-#undef SHRINKS_AT_END_OF_EDEN
-#ifdef SHRINKS_AT_END_OF_EDEN
- size_t delta_in_survivor = 0;
- ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
- const size_t space_alignment = heap->intra_heap_alignment();
- const size_t gen_alignment = heap->object_heap_alignment();
-
- MutableSpace* space_shrinking = NULL;
- if (from_space()->end() > to_space()->end()) {
- space_shrinking = from_space();
- } else {
- space_shrinking = to_space();
- }
-
- // Include any space that is committed but not included in
- // the survivor spaces.
- assert(((HeapWord*)virtual_space()->high()) >= space_shrinking->end(),
- "Survivor space beyond high end");
- size_t unused_committed = pointer_delta(virtual_space()->high(),
- space_shrinking->end(), sizeof(char));
-
- if (space_shrinking->is_empty()) {
- // Don't let the space shrink to 0
- assert(space_shrinking->capacity_in_bytes() >= space_alignment,
- "Space is too small");
- delta_in_survivor = space_shrinking->capacity_in_bytes() - space_alignment;
- } else {
- delta_in_survivor = pointer_delta(space_shrinking->end(),
- space_shrinking->top(),
- sizeof(char));
- }
-
- size_t delta_in_bytes = unused_committed + delta_in_survivor;
- delta_in_bytes = align_size_down(delta_in_bytes, gen_alignment);
- return delta_in_bytes;
-#else
- // The only space available for shrinking is in to-space if it
- // is above from-space.
- if (to()->bottom() > from()->bottom()) {
- const size_t alignment = os::vm_page_size();
- if (to()->capacity() < alignment) {
- return 0;
- } else {
- return to()->capacity() - alignment;
- }
- } else {
- return 0;
- }
-#endif
-}
-
-// Return the number of bytes available for resizing down the young
-// generation. This is the minimum of
-// input "bytes"
-// bytes to the minimum young gen size
-// bytes to the size currently being used + some small extra
-size_t ASParNewGeneration::limit_gen_shrink (size_t bytes) {
- // Allow shrinkage into the current eden but keep eden large enough
- // to maintain the minimum young gen size
- bytes = MIN3(bytes, available_to_min_gen(), available_to_live());
- return align_size_down(bytes, os::vm_page_size());
-}
-
-// Note that the the alignment used is the OS page size as
-// opposed to an alignment associated with the virtual space
-// (as is done in the ASPSYoungGen/ASPSOldGen)
-bool ASParNewGeneration::resize_generation(size_t eden_size,
- size_t survivor_size) {
- const size_t alignment = os::vm_page_size();
- size_t orig_size = virtual_space()->committed_size();
- bool size_changed = false;
-
- // There used to be this guarantee there.
- // guarantee ((eden_size + 2*survivor_size) <= _max_gen_size, "incorrect input arguments");
- // Code below forces this requirement. In addition the desired eden
- // size and desired survivor sizes are desired goals and may
- // exceed the total generation size.
-
- assert(min_gen_size() <= orig_size && orig_size <= max_gen_size(),
- "just checking");
-
- // Adjust new generation size
- const size_t eden_plus_survivors =
- align_size_up(eden_size + 2 * survivor_size, alignment);
- size_t desired_size = MAX2(MIN2(eden_plus_survivors, max_gen_size()),
- min_gen_size());
- assert(desired_size <= max_gen_size(), "just checking");
-
- if (desired_size > orig_size) {
- // Grow the generation
- size_t change = desired_size - orig_size;
- assert(change % alignment == 0, "just checking");
- if (expand(change)) {
- return false; // Error if we fail to resize!
- }
- size_changed = true;
- } else if (desired_size < orig_size) {
- size_t desired_change = orig_size - desired_size;
- assert(desired_change % alignment == 0, "just checking");
-
- desired_change = limit_gen_shrink(desired_change);
-
- if (desired_change > 0) {
- virtual_space()->shrink_by(desired_change);
- reset_survivors_after_shrink();
-
- size_changed = true;
- }
- } else {
- if (Verbose && PrintGC) {
- if (orig_size == max_gen_size()) {
- gclog_or_tty->print_cr("ASParNew generation size at maximum: "
- SIZE_FORMAT "K", orig_size/K);
- } else if (orig_size == min_gen_size()) {
- gclog_or_tty->print_cr("ASParNew generation size at minium: "
- SIZE_FORMAT "K", orig_size/K);
- }
- }
- }
-
- if (size_changed) {
- MemRegion cmr((HeapWord*)virtual_space()->low(),
- (HeapWord*)virtual_space()->high());
- GenCollectedHeap::heap()->barrier_set()->resize_covered_region(cmr);
-
- if (Verbose && PrintGC) {
- size_t current_size = virtual_space()->committed_size();
- gclog_or_tty->print_cr("ASParNew generation size changed: "
- SIZE_FORMAT "K->" SIZE_FORMAT "K",
- orig_size/K, current_size/K);
- }
- }
-
- guarantee(eden_plus_survivors <= virtual_space()->committed_size() ||
- virtual_space()->committed_size() == max_gen_size(), "Sanity");
-
- return true;
-}
-
-void ASParNewGeneration::reset_survivors_after_shrink() {
-
- GenCollectedHeap* gch = GenCollectedHeap::heap();
- HeapWord* new_end = (HeapWord*)virtual_space()->high();
-
- if (from()->end() > to()->end()) {
- assert(new_end >= from()->end(), "Shrinking past from-space");
- } else {
- assert(new_end >= to()->bottom(), "Shrink was too large");
- // Was there a shrink of the survivor space?
- if (new_end < to()->end()) {
- MemRegion mr(to()->bottom(), new_end);
- to()->initialize(mr,
- SpaceDecorator::DontClear,
- SpaceDecorator::DontMangle);
- }
- }
-}
-void ASParNewGeneration::resize_spaces(size_t requested_eden_size,
- size_t requested_survivor_size) {
- assert(UseAdaptiveSizePolicy, "sanity check");
- assert(requested_eden_size > 0 && requested_survivor_size > 0,
- "just checking");
- CollectedHeap* heap = Universe::heap();
- assert(heap->kind() == CollectedHeap::GenCollectedHeap, "Sanity");
-
-
- // We require eden and to space to be empty
- if ((!eden()->is_empty()) || (!to()->is_empty())) {
- return;
- }
-
- size_t cur_eden_size = eden()->capacity();
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr("ASParNew::resize_spaces(requested_eden_size: "
- SIZE_FORMAT
- ", requested_survivor_size: " SIZE_FORMAT ")",
- requested_eden_size, requested_survivor_size);
- gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") "
- SIZE_FORMAT,
- p2i(eden()->bottom()),
- p2i(eden()->end()),
- pointer_delta(eden()->end(),
- eden()->bottom(),
- sizeof(char)));
- gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") "
- SIZE_FORMAT,
- p2i(from()->bottom()),
- p2i(from()->end()),
- pointer_delta(from()->end(),
- from()->bottom(),
- sizeof(char)));
- gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") "
- SIZE_FORMAT,
- p2i(to()->bottom()),
- p2i(to()->end()),
- pointer_delta( to()->end(),
- to()->bottom(),
- sizeof(char)));
- }
-
- // There's nothing to do if the new sizes are the same as the current
- if (requested_survivor_size == to()->capacity() &&
- requested_survivor_size == from()->capacity() &&
- requested_eden_size == eden()->capacity()) {
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(" capacities are the right sizes, returning");
- }
- return;
- }
-
- char* eden_start = (char*)eden()->bottom();
- char* eden_end = (char*)eden()->end();
- char* from_start = (char*)from()->bottom();
- char* from_end = (char*)from()->end();
- char* to_start = (char*)to()->bottom();
- char* to_end = (char*)to()->end();
-
- const size_t alignment = os::vm_page_size();
- const bool maintain_minimum =
- (requested_eden_size + 2 * requested_survivor_size) <= min_gen_size();
-
- // Check whether from space is below to space
- if (from_start < to_start) {
- // Eden, from, to
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(" Eden, from, to:");
- }
-
- // Set eden
- // "requested_eden_size" is a goal for the size of eden
- // and may not be attainable. "eden_size" below is
- // calculated based on the location of from-space and
- // the goal for the size of eden. from-space is
- // fixed in place because it contains live data.
- // The calculation is done this way to avoid 32bit
- // overflow (i.e., eden_start + requested_eden_size
- // may too large for representation in 32bits).
- size_t eden_size;
- if (maintain_minimum) {
- // Only make eden larger than the requested size if
- // the minimum size of the generation has to be maintained.
- // This could be done in general but policy at a higher
- // level is determining a requested size for eden and that
- // should be honored unless there is a fundamental reason.
- eden_size = pointer_delta(from_start,
- eden_start,
- sizeof(char));
- } else {
- eden_size = MIN2(requested_eden_size,
- pointer_delta(from_start, eden_start, sizeof(char)));
- }
-
- eden_size = align_size_down(eden_size, alignment);
- eden_end = eden_start + eden_size;
- assert(eden_end >= eden_start, "addition overflowed");
-
- // To may resize into from space as long as it is clear of live data.
- // From space must remain page aligned, though, so we need to do some
- // extra calculations.
-
- // First calculate an optimal to-space
- to_end = (char*)virtual_space()->high();
- to_start = (char*)pointer_delta(to_end, (char*)requested_survivor_size,
- sizeof(char));
-
- // Does the optimal to-space overlap from-space?
- if (to_start < (char*)from()->end()) {
- // Calculate the minimum offset possible for from_end
- size_t from_size = pointer_delta(from()->top(), from_start, sizeof(char));
-
- // Should we be in this method if from_space is empty? Why not the set_space method? FIX ME!
- if (from_size == 0) {
- from_size = alignment;
- } else {
- from_size = align_size_up(from_size, alignment);
- }
-
- from_end = from_start + from_size;
- assert(from_end > from_start, "addition overflow or from_size problem");
-
- guarantee(from_end <= (char*)from()->end(), "from_end moved to the right");
-
- // Now update to_start with the new from_end
- to_start = MAX2(from_end, to_start);
- } else {
- // If shrinking, move to-space down to abut the end of from-space
- // so that shrinking will move to-space down. If not shrinking
- // to-space is moving up to allow for growth on the next expansion.
- if (requested_eden_size <= cur_eden_size) {
- to_start = from_end;
- if (to_start + requested_survivor_size > to_start) {
- to_end = to_start + requested_survivor_size;
- }
- }
- // else leave to_end pointing to the high end of the virtual space.
- }
-
- guarantee(to_start != to_end, "to space is zero sized");
-
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(" [eden_start .. eden_end): "
- "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- p2i(eden_start),
- p2i(eden_end),
- pointer_delta(eden_end, eden_start, sizeof(char)));
- gclog_or_tty->print_cr(" [from_start .. from_end): "
- "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- p2i(from_start),
- p2i(from_end),
- pointer_delta(from_end, from_start, sizeof(char)));
- gclog_or_tty->print_cr(" [ to_start .. to_end): "
- "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- p2i(to_start),
- p2i(to_end),
- pointer_delta( to_end, to_start, sizeof(char)));
- }
- } else {
- // Eden, to, from
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(" Eden, to, from:");
- }
-
- // Calculate the to-space boundaries based on
- // the start of from-space.
- to_end = from_start;
- to_start = (char*)pointer_delta(from_start,
- (char*)requested_survivor_size,
- sizeof(char));
- // Calculate the ideal eden boundaries.
- // eden_end is already at the bottom of the generation
- assert(eden_start == virtual_space()->low(),
- "Eden is not starting at the low end of the virtual space");
- if (eden_start + requested_eden_size >= eden_start) {
- eden_end = eden_start + requested_eden_size;
- } else {
- eden_end = to_start;
- }
-
- // Does eden intrude into to-space? to-space
- // gets priority but eden is not allowed to shrink
- // to 0.
- if (eden_end > to_start) {
- eden_end = to_start;
- }
-
- // Don't let eden shrink down to 0 or less.
- eden_end = MAX2(eden_end, eden_start + alignment);
- assert(eden_start + alignment >= eden_start, "Overflow");
-
- size_t eden_size;
- if (maintain_minimum) {
- // Use all the space available.
- eden_end = MAX2(eden_end, to_start);
- eden_size = pointer_delta(eden_end, eden_start, sizeof(char));
- eden_size = MIN2(eden_size, cur_eden_size);
- } else {
- eden_size = pointer_delta(eden_end, eden_start, sizeof(char));
- }
- eden_size = align_size_down(eden_size, alignment);
- assert(maintain_minimum || eden_size <= requested_eden_size,
- "Eden size is too large");
- assert(eden_size >= alignment, "Eden size is too small");
- eden_end = eden_start + eden_size;
-
- // Move to-space down to eden.
- if (requested_eden_size < cur_eden_size) {
- to_start = eden_end;
- if (to_start + requested_survivor_size > to_start) {
- to_end = MIN2(from_start, to_start + requested_survivor_size);
- } else {
- to_end = from_start;
- }
- }
-
- // eden_end may have moved so again make sure
- // the to-space and eden don't overlap.
- to_start = MAX2(eden_end, to_start);
-
- // from-space
- size_t from_used = from()->used();
- if (requested_survivor_size > from_used) {
- if (from_start + requested_survivor_size >= from_start) {
- from_end = from_start + requested_survivor_size;
- }
- if (from_end > virtual_space()->high()) {
- from_end = virtual_space()->high();
- }
- }
-
- assert(to_start >= eden_end, "to-space should be above eden");
- if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr(" [eden_start .. eden_end): "
- "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- p2i(eden_start),
- p2i(eden_end),
- pointer_delta(eden_end, eden_start, sizeof(char)));
- gclog_or_tty->print_cr(" [ to_start .. to_end): "
- "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- p2i(to_start),
- p2i(to_end),
- pointer_delta( to_end, to_start, sizeof(char)));
- gclog_or_tty->print_cr(" [from_start .. from_end): "
- "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
- p2i(from_start),
- p2i(from_end),
- pointer_delta(from_end, from_start, sizeof(char)));
- }
- }
-
-
- guarantee((HeapWord*)from_start <= from()->bottom(),
- "from start moved to the right");
- guarantee((HeapWord*)from_end >= from()->top(),
- "from end moved into live data");
- assert(is_object_aligned((intptr_t)eden_start), "checking alignment");
- assert(is_object_aligned((intptr_t)from_start), "checking alignment");
- assert(is_object_aligned((intptr_t)to_start), "checking alignment");
-
- MemRegion edenMR((HeapWord*)eden_start, (HeapWord*)eden_end);
- MemRegion toMR ((HeapWord*)to_start, (HeapWord*)to_end);
- MemRegion fromMR((HeapWord*)from_start, (HeapWord*)from_end);
-
- // Let's make sure the call to initialize doesn't reset "top"!
- HeapWord* old_from_top = from()->top();
-
- // For PrintAdaptiveSizePolicy block below
- size_t old_from = from()->capacity();
- size_t old_to = to()->capacity();
-
- // If not clearing the spaces, do some checking to verify that
- // the spaces are already mangled.
-
- // Must check mangling before the spaces are reshaped. Otherwise,
- // the bottom or end of one space may have moved into another
- // a failure of the check may not correctly indicate which space
- // is not properly mangled.
- if (ZapUnusedHeapArea) {
- HeapWord* limit = (HeapWord*) virtual_space()->high();
- eden()->check_mangled_unused_area(limit);
- from()->check_mangled_unused_area(limit);
- to()->check_mangled_unused_area(limit);
- }
-
- // The call to initialize NULL's the next compaction space
- eden()->initialize(edenMR,
- SpaceDecorator::Clear,
- SpaceDecorator::DontMangle);
- eden()->set_next_compaction_space(from());
- to()->initialize(toMR ,
- SpaceDecorator::Clear,
- SpaceDecorator::DontMangle);
- from()->initialize(fromMR,
- SpaceDecorator::DontClear,
- SpaceDecorator::DontMangle);
-
- assert(from()->top() == old_from_top, "from top changed!");
-
- if (PrintAdaptiveSizePolicy) {
- GenCollectedHeap* gch = GenCollectedHeap::heap();
- assert(gch->kind() == CollectedHeap::GenCollectedHeap, "Sanity");
-
- gclog_or_tty->print("AdaptiveSizePolicy::survivor space sizes: "
- "collection: %d "
- "(" SIZE_FORMAT ", " SIZE_FORMAT ") -> "
- "(" SIZE_FORMAT ", " SIZE_FORMAT ") ",
- gch->total_collections(),
- old_from, old_to,
- from()->capacity(),
- to()->capacity());
- gclog_or_tty->cr();
- }
-}
-
-void ASParNewGeneration::compute_new_size() {
- GenCollectedHeap* gch = GenCollectedHeap::heap();
- assert(gch->kind() == CollectedHeap::GenCollectedHeap,
- "not a CMS generational heap");
-
-
- CMSAdaptiveSizePolicy* size_policy =
- (CMSAdaptiveSizePolicy*)gch->gen_policy()->size_policy();
- assert(size_policy->is_gc_cms_adaptive_size_policy(),
- "Wrong type of size policy");
-
- size_t survived = from()->used();
- if (!survivor_overflow()) {
- // Keep running averages on how much survived
- size_policy->avg_survived()->sample(survived);
- } else {
- size_t promoted =
- (size_t) next_gen()->gc_stats()->avg_promoted()->last_sample();
- assert(promoted < gch->capacity(), "Conversion problem?");
- size_t survived_guess = survived + promoted;
- size_policy->avg_survived()->sample(survived_guess);
- }
-
- size_t survivor_limit = max_survivor_size();
- _tenuring_threshold =
- size_policy->compute_survivor_space_size_and_threshold(
- _survivor_overflow,
- _tenuring_threshold,
- survivor_limit);
- size_policy->avg_young_live()->sample(used());
- size_policy->avg_eden_live()->sample(eden()->used());
-
- size_policy->compute_eden_space_size(eden()->capacity(), max_gen_size());
-
- resize(size_policy->calculated_eden_size_in_bytes(),
- size_policy->calculated_survivor_size_in_bytes());
-
- if (UsePerfData) {
- CMSGCAdaptivePolicyCounters* counters =
- (CMSGCAdaptivePolicyCounters*) gch->collector_policy()->counters();
- assert(counters->kind() ==
- GCPolicyCounters::CMSGCAdaptivePolicyCountersKind,
- "Wrong kind of counters");
- counters->update_tenuring_threshold(_tenuring_threshold);
- counters->update_survivor_overflowed(_survivor_overflow);
- counters->update_young_capacity(capacity());
- }
-}
-
-
-#ifndef PRODUCT
-// Changes from PSYoungGen version
-// value of "alignment"
-void ASParNewGeneration::space_invariants() {
- const size_t alignment = os::vm_page_size();
-
- // Currently, our eden size cannot shrink to zero
- guarantee(eden()->capacity() >= alignment, "eden too small");
- guarantee(from()->capacity() >= alignment, "from too small");
- guarantee(to()->capacity() >= alignment, "to too small");
-
- // Relationship of spaces to each other
- char* eden_start = (char*)eden()->bottom();
- char* eden_end = (char*)eden()->end();
- char* from_start = (char*)from()->bottom();
- char* from_end = (char*)from()->end();
- char* to_start = (char*)to()->bottom();
- char* to_end = (char*)to()->end();
-
- guarantee(eden_start >= virtual_space()->low(), "eden bottom");
- guarantee(eden_start < eden_end, "eden space consistency");
- guarantee(from_start < from_end, "from space consistency");
- guarantee(to_start < to_end, "to space consistency");
-
- // Check whether from space is below to space
- if (from_start < to_start) {
- // Eden, from, to
- guarantee(eden_end <= from_start, "eden/from boundary");
- guarantee(from_end <= to_start, "from/to boundary");
- guarantee(to_end <= virtual_space()->high(), "to end");
- } else {
- // Eden, to, from
- guarantee(eden_end <= to_start, "eden/to boundary");
- guarantee(to_end <= from_start, "to/from boundary");
- guarantee(from_end <= virtual_space()->high(), "from end");
- }
-
- // More checks that the virtual space is consistent with the spaces
- assert(virtual_space()->committed_size() >=
- (eden()->capacity() +
- to()->capacity() +
- from()->capacity()), "Committed size is inconsistent");
- assert(virtual_space()->committed_size() <= virtual_space()->reserved_size(),
- "Space invariant");
- char* eden_top = (char*)eden()->top();
- char* from_top = (char*)from()->top();
- char* to_top = (char*)to()->top();
- assert(eden_top <= virtual_space()->high(), "eden top");
- assert(from_top <= virtual_space()->high(), "from top");
- assert(to_top <= virtual_space()->high(), "to top");
-}
-#endif
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.hpp b/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.hpp
deleted file mode 100644
index 70646fe9b08..00000000000
--- a/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.hpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP
-#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP
-
-#include "gc_implementation/parNew/parNewGeneration.hpp"
-#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
-
-// A Generation that does parallel young-gen collection extended
-// for adaptive size policy.
-
-// Division of generation into spaces
-// done by DefNewGeneration::compute_space_boundaries()
-// +---------------+
-// | uncommitted |
-// |---------------|
-// | ss0 |
-// |---------------|
-// | ss1 |
-// |---------------|
-// | |
-// | eden |
-// | |
-// +---------------+ <-- low end of VirtualSpace
-//
-class ASParNewGeneration: public ParNewGeneration {
-
- size_t _min_gen_size;
-
- // Resize the generation based on the desired sizes of
- // the constituent spaces.
- bool resize_generation(size_t eden_size, size_t survivor_size);
- // Resize the spaces based on their desired sizes but
- // respecting the maximum size of the generation.
- void resize_spaces(size_t eden_size, size_t survivor_size);
- // Return the byte size remaining to the minimum generation size.
- size_t available_to_min_gen();
- // Return the byte size remaining to the live data in the generation.
- size_t available_to_live() const;
- // Return the byte size that the generation is allowed to shrink.
- size_t limit_gen_shrink(size_t bytes);
- // Reset the size of the spaces after a shrink of the generation.
- void reset_survivors_after_shrink();
-
- // Accessor
- VirtualSpace* virtual_space() { return &_virtual_space; }
-
- virtual void adjust_desired_tenuring_threshold();
-
- public:
-
- ASParNewGeneration(ReservedSpace rs,
- size_t initial_byte_size,
- size_t min_byte_size,
- int level);
-
- virtual const char* short_name() const { return "ASParNew"; }
- virtual const char* name() const;
- virtual Generation::Name kind() { return ASParNew; }
-
- // Change the sizes of eden and the survivor spaces in
- // the generation. The parameters are desired sizes
- // and are not guaranteed to be met. For example, if
- // the total is larger than the generation.
- void resize(size_t eden_size, size_t survivor_size);
-
- virtual void compute_new_size();
-
- size_t max_gen_size() { return _reserved.byte_size(); }
- size_t min_gen_size() const { return _min_gen_size; }
-
- // Space boundary invariant checker
- void space_invariants() PRODUCT_RETURN;
-};
-
-#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
index c97f97516f1..bddc6f678a3 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
@@ -614,18 +614,21 @@ void ParNewGenTask::work(uint worker_id) {
KlassScanClosure klass_scan_closure(&par_scan_state.to_space_root_closure(),
gch->rem_set()->klass_rem_set());
-
- int so = SharedHeap::SO_AllClasses | SharedHeap::SO_Strings | SharedHeap::SO_ScavengeCodeCache;
+ CLDToKlassAndOopClosure cld_scan_closure(&klass_scan_closure,
+ &par_scan_state.to_space_root_closure(),
+ false);
par_scan_state.start_strong_roots();
- gch->gen_process_strong_roots(_gen->level(),
- true, // Process younger gens, if any,
- // as strong roots.
- false, // no scope; this is parallel code
- SharedHeap::ScanningOption(so),
- &par_scan_state.to_space_root_closure(),
- &par_scan_state.older_gen_closure(),
- &klass_scan_closure);
+ gch->gen_process_roots(_gen->level(),
+ true, // Process younger gens, if any,
+ // as strong roots.
+ false, // no scope; this is parallel code
+ SharedHeap::SO_ScavengeCodeCache,
+ GenCollectedHeap::StrongAndWeakRoots,
+ &par_scan_state.to_space_root_closure(),
+ &par_scan_state.older_gen_closure(),
+ &cld_scan_closure);
+
par_scan_state.end_strong_roots();
// "evacuate followers".
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
index 6d3b25d9545..bde15f7b8f8 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
@@ -69,7 +69,7 @@ class ParScanThreadState {
ParScanWithoutBarrierClosure _to_space_closure; // scan_without_gc_barrier
ParScanWithBarrierClosure _old_gen_closure; // scan_with_gc_barrier
ParRootScanWithoutBarrierClosure _to_space_root_closure; // scan_root_without_gc_barrier
- // One of these two will be passed to process_strong_roots, which will
+ // One of these two will be passed to process_roots, which will
// set its generation. The first is for two-gen configs where the
// old gen collects the perm gen; the second is for arbitrary configs.
// The second isn't used right now (it used to be used for the train, an
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
index 01790ef9310..bd22eb5574f 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp
@@ -59,7 +59,7 @@ void ThreadRootsMarkingTask::do_it(GCTaskManager* manager, uint which) {
PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm);
CLDToOopClosure mark_and_push_from_clds(&mark_and_push_closure, true);
- CodeBlobToOopClosure mark_and_push_in_blobs(&mark_and_push_closure, /*do_marking=*/ true);
+ MarkingCodeBlobClosure mark_and_push_in_blobs(&mark_and_push_closure, !CodeBlobToOopClosure::FixRelocations);
if (_java_thread != NULL)
_java_thread->oops_do(
@@ -100,7 +100,7 @@ void MarkFromRootsTask::do_it(GCTaskManager* manager, uint which) {
case threads:
{
ResourceMark rm;
- CodeBlobToOopClosure each_active_code_blob(&mark_and_push_closure, /*do_marking=*/ true);
+ MarkingCodeBlobClosure each_active_code_blob(&mark_and_push_closure, !CodeBlobToOopClosure::FixRelocations);
CLDToOopClosure mark_and_push_from_cld(&mark_and_push_closure);
Threads::oops_do(&mark_and_push_closure, &mark_and_push_from_cld, &each_active_code_blob);
}
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
index 51867d1622f..647ed85ecdb 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
@@ -536,14 +536,14 @@ void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {
Universe::oops_do(mark_and_push_closure());
JNIHandles::oops_do(mark_and_push_closure()); // Global (strong) JNI handles
CLDToOopClosure mark_and_push_from_cld(mark_and_push_closure());
- CodeBlobToOopClosure each_active_code_blob(mark_and_push_closure(), /*do_marking=*/ true);
+ MarkingCodeBlobClosure each_active_code_blob(mark_and_push_closure(), !CodeBlobToOopClosure::FixRelocations);
Threads::oops_do(mark_and_push_closure(), &mark_and_push_from_cld, &each_active_code_blob);
ObjectSynchronizer::oops_do(mark_and_push_closure());
FlatProfiler::oops_do(mark_and_push_closure());
Management::oops_do(mark_and_push_closure());
JvmtiExport::oops_do(mark_and_push_closure());
SystemDictionary::always_strong_oops_do(mark_and_push_closure());
- ClassLoaderDataGraph::always_strong_oops_do(mark_and_push_closure(), follow_klass_closure(), true);
+ ClassLoaderDataGraph::always_strong_cld_do(follow_cld_closure());
// Do not treat nmethods as strong roots for mark/sweep, since we can unload them.
//CodeCache::scavenge_root_nmethods_do(CodeBlobToOopClosure(mark_and_push_closure()));
}
@@ -633,16 +633,16 @@ void PSMarkSweep::mark_sweep_phase3() {
FlatProfiler::oops_do(adjust_pointer_closure());
Management::oops_do(adjust_pointer_closure());
JvmtiExport::oops_do(adjust_pointer_closure());
- // SO_AllClasses
SystemDictionary::oops_do(adjust_pointer_closure());
- ClassLoaderDataGraph::oops_do(adjust_pointer_closure(), adjust_klass_closure(), true);
+ ClassLoaderDataGraph::cld_do(adjust_cld_closure());
// Now adjust pointers in remaining weak roots. (All of which should
// have been cleared if they pointed to non-surviving objects.)
// Global (weak) JNI handles
JNIHandles::weak_oops_do(&always_true, adjust_pointer_closure());
- CodeCache::oops_do(adjust_pointer_closure());
+ CodeBlobToOopClosure adjust_from_blobs(adjust_pointer_closure(), CodeBlobToOopClosure::FixRelocations);
+ CodeCache::blobs_do(&adjust_from_blobs);
StringTable::oops_do(adjust_pointer_closure());
ref_processor()->weak_oops_do(adjust_pointer_closure());
PSScavenge::reference_processor()->weak_oops_do(adjust_pointer_closure());
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp
index 68b3de470ea..46073f9e293 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp
@@ -40,11 +40,11 @@ class PSMarkSweep : public MarkSweep {
static CollectorCounters* _counters;
// Closure accessors
- static OopClosure* mark_and_push_closure() { return &MarkSweep::mark_and_push_closure; }
- static KlassClosure* follow_klass_closure() { return &MarkSweep::follow_klass_closure; }
- static VoidClosure* follow_stack_closure() { return (VoidClosure*)&MarkSweep::follow_stack_closure; }
- static OopClosure* adjust_pointer_closure() { return (OopClosure*)&MarkSweep::adjust_pointer_closure; }
- static KlassClosure* adjust_klass_closure() { return &MarkSweep::adjust_klass_closure; }
+ static OopClosure* mark_and_push_closure() { return &MarkSweep::mark_and_push_closure; }
+ static VoidClosure* follow_stack_closure() { return (VoidClosure*)&MarkSweep::follow_stack_closure; }
+ static CLDClosure* follow_cld_closure() { return &MarkSweep::follow_cld_closure; }
+ static OopClosure* adjust_pointer_closure() { return (OopClosure*)&MarkSweep::adjust_pointer_closure; }
+ static CLDClosure* adjust_cld_closure() { return &MarkSweep::adjust_cld_closure; }
static BoolObjectClosure* is_alive_closure() { return (BoolObjectClosure*)&MarkSweep::is_alive; }
debug_only(public:) // Used for PSParallelCompact debugging
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
index 9f552fd1874..7246a61b634 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
@@ -2474,7 +2474,6 @@ void PSParallelCompact::adjust_roots() {
FlatProfiler::oops_do(adjust_pointer_closure());
Management::oops_do(adjust_pointer_closure());
JvmtiExport::oops_do(adjust_pointer_closure());
- // SO_AllClasses
SystemDictionary::oops_do(adjust_pointer_closure());
ClassLoaderDataGraph::oops_do(adjust_pointer_closure(), adjust_klass_closure(), true);
@@ -2483,7 +2482,8 @@ void PSParallelCompact::adjust_roots() {
// Global (weak) JNI handles
JNIHandles::weak_oops_do(&always_true, adjust_pointer_closure());
- CodeCache::oops_do(adjust_pointer_closure());
+ CodeBlobToOopClosure adjust_from_blobs(adjust_pointer_closure(), CodeBlobToOopClosure::FixRelocations);
+ CodeCache::blobs_do(&adjust_from_blobs);
StringTable::oops_do(adjust_pointer_closure());
ref_processor()->weak_oops_do(adjust_pointer_closure());
// Roots were visited so references into the young gen in roots
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp
index ea0e627dc79..f829e934408 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp
@@ -100,7 +100,7 @@ void ScavengeRootsTask::do_it(GCTaskManager* manager, uint which) {
case code_cache:
{
- CodeBlobToOopClosure each_scavengable_code_blob(&roots_to_old_closure, /*do_marking=*/ true);
+ MarkingCodeBlobClosure each_scavengable_code_blob(&roots_to_old_closure, CodeBlobToOopClosure::FixRelocations);
CodeCache::scavenge_root_nmethods_do(&each_scavengable_code_blob);
}
break;
@@ -123,7 +123,7 @@ void ThreadRootsTask::do_it(GCTaskManager* manager, uint which) {
PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which);
PSScavengeRootsClosure roots_closure(pm);
CLDClosure* roots_from_clds = NULL; // Not needed. All CLDs are already visited.
- CodeBlobToOopClosure roots_in_blobs(&roots_closure, /*do_marking=*/ true);
+ MarkingCodeBlobClosure roots_in_blobs(&roots_closure, CodeBlobToOopClosure::FixRelocations);
if (_java_thread != NULL)
_java_thread->oops_do(&roots_closure, roots_from_clds, &roots_in_blobs);
diff --git a/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.hpp b/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.hpp
index f2f4b53c7f5..2695fccec7a 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.hpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.hpp
@@ -507,7 +507,7 @@ class AdaptiveSizePolicyOutput : StackObj {
// always fail (never do the print based on the interval test).
return PrintGCDetails &&
UseAdaptiveSizePolicy &&
- (UseParallelGC || UseConcMarkSweepGC) &&
+ UseParallelGC &&
(AdaptiveSizePolicyOutputInterval > 0) &&
((count == 0) ||
((count % AdaptiveSizePolicyOutputInterval) == 0));
diff --git a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp
index 8a105bfa3fb..b85be793146 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -134,7 +134,7 @@ SurrogateLockerThread* SurrogateLockerThread::make(TRAPS) {
Threads::add(res);
Thread::start(res);
}
- os::yield(); // This seems to help with initial start-up of SLT
+ os::naked_yield(); // This seems to help with initial start-up of SLT
return res;
}
diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp
index 0e32e2a970f..f1292ebcd7d 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp
@@ -216,16 +216,4 @@ class LinearLeastSquareFit : public CHeapObj {
bool increment_will_decrease();
};
-class GCPauseTimer : StackObj {
- elapsedTimer* _timer;
- public:
- GCPauseTimer(elapsedTimer* timer) {
- _timer = timer;
- _timer->stop();
- }
- ~GCPauseTimer() {
- _timer->start();
- }
-};
-
#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCUTIL_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp
index 07cbb23de4a..309a955d8a3 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp
@@ -54,21 +54,14 @@ void MarkSweep::FollowRootClosure::do_oop(oop* p) { follow_root(p); }
void MarkSweep::FollowRootClosure::do_oop(narrowOop* p) { follow_root(p); }
MarkSweep::MarkAndPushClosure MarkSweep::mark_and_push_closure;
-MarkSweep::FollowKlassClosure MarkSweep::follow_klass_closure;
-MarkSweep::AdjustKlassClosure MarkSweep::adjust_klass_closure;
+CLDToOopClosure MarkSweep::follow_cld_closure(&mark_and_push_closure);
+CLDToOopClosure MarkSweep::adjust_cld_closure(&adjust_pointer_closure);
void MarkSweep::MarkAndPushClosure::do_oop(oop* p) { mark_and_push(p); }
void MarkSweep::MarkAndPushClosure::do_oop(narrowOop* p) { mark_and_push(p); }
-void MarkSweep::FollowKlassClosure::do_klass(Klass* klass) {
- klass->oops_do(&MarkSweep::mark_and_push_closure);
-}
-void MarkSweep::AdjustKlassClosure::do_klass(Klass* klass) {
- klass->oops_do(&MarkSweep::adjust_pointer_closure);
-}
-
void MarkSweep::follow_class_loader(ClassLoaderData* cld) {
- cld->oops_do(&MarkSweep::mark_and_push_closure, &MarkSweep::follow_klass_closure, true);
+ MarkSweep::follow_cld_closure.do_cld(cld);
}
void MarkSweep::follow_stack() {
diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp
index 1857c2a3acc..462643e2f52 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp
@@ -65,17 +65,6 @@ class MarkSweep : AllStatic {
virtual void do_oop(narrowOop* p);
};
- // The one and only place to start following the classes.
- // Should only be applied to the ClassLoaderData klasses list.
- class FollowKlassClosure : public KlassClosure {
- public:
- void do_klass(Klass* klass);
- };
- class AdjustKlassClosure : public KlassClosure {
- public:
- void do_klass(Klass* klass);
- };
-
class FollowStackClosure: public VoidClosure {
public:
virtual void do_void();
@@ -144,10 +133,10 @@ class MarkSweep : AllStatic {
static IsAliveClosure is_alive;
static FollowRootClosure follow_root_closure;
static MarkAndPushClosure mark_and_push_closure;
- static FollowKlassClosure follow_klass_closure;
static FollowStackClosure follow_stack_closure;
+ static CLDToOopClosure follow_cld_closure;
static AdjustPointerClosure adjust_pointer_closure;
- static AdjustKlassClosure adjust_klass_closure;
+ static CLDToOopClosure adjust_cld_closure;
// Accessors
static uint total_invocations() { return _total_invocations; }
diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp
index bdbbae7f412..439256140a6 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp
@@ -195,6 +195,43 @@ void VM_GenCollectFull::doit() {
gch->do_full_collection(gch->must_clear_all_soft_refs(), _max_level);
}
+bool VM_CollectForMetadataAllocation::initiate_concurrent_GC() {
+#if INCLUDE_ALL_GCS
+ if (UseConcMarkSweepGC || UseG1GC) {
+ if (UseConcMarkSweepGC && CMSClassUnloadingEnabled) {
+ MetaspaceGC::set_should_concurrent_collect(true);
+ } else if (UseG1GC) {
+ G1CollectedHeap* g1h = G1CollectedHeap::heap();
+ g1h->g1_policy()->set_initiate_conc_mark_if_possible();
+
+ GCCauseSetter x(g1h, _gc_cause);
+
+ // At this point we are supposed to start a concurrent cycle. We
+ // will do so if one is not already in progress.
+ bool should_start = g1h->g1_policy()->force_initial_mark_if_outside_cycle(_gc_cause);
+
+ if (should_start) {
+ double pause_target = g1h->g1_policy()->max_pause_time_ms();
+ g1h->do_collection_pause_at_safepoint(pause_target);
+ }
+ }
+
+ return true;
+ }
+#endif
+ return false;
+}
+
+static void log_metaspace_alloc_failure_for_concurrent_GC() {
+ if (Verbose && PrintGCDetails) {
+ if (UseConcMarkSweepGC) {
+ gclog_or_tty->print_cr("\nCMS full GC for Metaspace");
+ } else if (UseG1GC) {
+ gclog_or_tty->print_cr("\nG1 full GC for Metaspace");
+ }
+ }
+}
+
void VM_CollectForMetadataAllocation::doit() {
SvcGCMarker sgcm(SvcGCMarker::FULL);
@@ -206,54 +243,57 @@ void VM_CollectForMetadataAllocation::doit() {
// a GC that freed space for the allocation.
if (!MetadataAllocationFailALot) {
_result = _loader_data->metaspace_non_null()->allocate(_size, _mdtype);
- }
-
- if (_result == NULL) {
- if (UseConcMarkSweepGC) {
- if (CMSClassUnloadingEnabled) {
- MetaspaceGC::set_should_concurrent_collect(true);
- }
- // For CMS expand since the collection is going to be concurrent.
- _result =
- _loader_data->metaspace_non_null()->expand_and_allocate(_size, _mdtype);
- }
- if (_result == NULL) {
- // Don't clear the soft refs yet.
- if (Verbose && PrintGCDetails && UseConcMarkSweepGC) {
- gclog_or_tty->print_cr("\nCMS full GC for Metaspace");
- }
- heap->collect_as_vm_thread(GCCause::_metadata_GC_threshold);
- // After a GC try to allocate without expanding. Could fail
- // and expansion will be tried below.
- _result =
- _loader_data->metaspace_non_null()->allocate(_size, _mdtype);
- }
- if (_result == NULL) {
- // If still failing, allow the Metaspace to expand.
- // See delta_capacity_until_GC() for explanation of the
- // amount of the expansion.
- // This should work unless there really is no more space
- // or a MaxMetaspaceSize has been specified on the command line.
- _result =
- _loader_data->metaspace_non_null()->expand_and_allocate(_size, _mdtype);
- if (_result == NULL) {
- // If expansion failed, do a last-ditch collection and try allocating
- // again. A last-ditch collection will clear softrefs. This
- // behavior is similar to the last-ditch collection done for perm
- // gen when it was full and a collection for failed allocation
- // did not free perm gen space.
- heap->collect_as_vm_thread(GCCause::_last_ditch_collection);
- _result =
- _loader_data->metaspace_non_null()->allocate(_size, _mdtype);
- }
- }
- if (Verbose && PrintGCDetails && _result == NULL) {
- gclog_or_tty->print_cr("\nAfter Metaspace GC failed to allocate size "
- SIZE_FORMAT, _size);
+ if (_result != NULL) {
+ return;
}
}
- if (_result == NULL && GC_locker::is_active_and_needs_gc()) {
+ if (initiate_concurrent_GC()) {
+ // For CMS and G1 expand since the collection is going to be concurrent.
+ _result = _loader_data->metaspace_non_null()->expand_and_allocate(_size, _mdtype);
+ if (_result != NULL) {
+ return;
+ }
+
+ log_metaspace_alloc_failure_for_concurrent_GC();
+ }
+
+ // Don't clear the soft refs yet.
+ heap->collect_as_vm_thread(GCCause::_metadata_GC_threshold);
+ // After a GC try to allocate without expanding. Could fail
+ // and expansion will be tried below.
+ _result = _loader_data->metaspace_non_null()->allocate(_size, _mdtype);
+ if (_result != NULL) {
+ return;
+ }
+
+ // If still failing, allow the Metaspace to expand.
+ // See delta_capacity_until_GC() for explanation of the
+ // amount of the expansion.
+ // This should work unless there really is no more space
+ // or a MaxMetaspaceSize has been specified on the command line.
+ _result = _loader_data->metaspace_non_null()->expand_and_allocate(_size, _mdtype);
+ if (_result != NULL) {
+ return;
+ }
+
+ // If expansion failed, do a last-ditch collection and try allocating
+ // again. A last-ditch collection will clear softrefs. This
+ // behavior is similar to the last-ditch collection done for perm
+ // gen when it was full and a collection for failed allocation
+ // did not free perm gen space.
+ heap->collect_as_vm_thread(GCCause::_last_ditch_collection);
+ _result = _loader_data->metaspace_non_null()->allocate(_size, _mdtype);
+ if (_result != NULL) {
+ return;
+ }
+
+ if (Verbose && PrintGCDetails) {
+ gclog_or_tty->print_cr("\nAfter Metaspace GC failed to allocate size "
+ SIZE_FORMAT, _size);
+ }
+
+ if (GC_locker::is_active_and_needs_gc()) {
set_gc_locked();
}
}
diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp
index 82cbf231fa6..8f60dcbdb2a 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp
@@ -217,6 +217,8 @@ class VM_CollectForMetadataAllocation: public VM_GC_Operation {
virtual VMOp_Type type() const { return VMOp_CollectForMetadataAllocation; }
virtual void doit();
MetaWord* result() const { return _result; }
+
+ bool initiate_concurrent_GC();
};
class SvcGCMarker : public StackObj {
diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
index b736d8edbdb..23d4bddca1b 100644
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
@@ -416,9 +416,18 @@ IRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea
// tracing
if (TraceExceptions) {
- ttyLocker ttyl;
ResourceMark rm(thread);
- tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", h_exception->print_value_string(), (address)h_exception());
+ Symbol* message = java_lang_Throwable::detail_message(h_exception());
+ ttyLocker ttyl; // Lock after getting the detail message
+ if (message != NULL) {
+ tty->print_cr("Exception <%s: %s> (" INTPTR_FORMAT ")",
+ h_exception->print_value_string(), message->as_C_string(),
+ (address)h_exception());
+ } else {
+ tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")",
+ h_exception->print_value_string(),
+ (address)h_exception());
+ }
tty->print_cr(" thrown in interpreter method <%s>", h_method->print_value_string());
tty->print_cr(" at bci %d for thread " INTPTR_FORMAT, current_bci, thread);
}
@@ -1079,6 +1088,7 @@ IRT_END
address SignatureHandlerLibrary::set_handler_blob() {
BufferBlob* handler_blob = BufferBlob::create("native signature handlers", blob_size);
if (handler_blob == NULL) {
+ CompileBroker::handle_full_code_cache();
return NULL;
}
address handler = handler_blob->code_begin();
diff --git a/hotspot/src/share/vm/interpreter/oopMapCache.cpp b/hotspot/src/share/vm/interpreter/oopMapCache.cpp
index 79e2bba8bad..d3f188863ae 100644
--- a/hotspot/src/share/vm/interpreter/oopMapCache.cpp
+++ b/hotspot/src/share/vm/interpreter/oopMapCache.cpp
@@ -180,7 +180,7 @@ InterpreterOopMap::~InterpreterOopMap() {
}
}
-bool InterpreterOopMap::is_empty() {
+bool InterpreterOopMap::is_empty() const {
bool result = _method == NULL;
assert(_method != NULL || (_bci == 0 &&
(_mask_size == 0 || _mask_size == USHRT_MAX) &&
@@ -196,7 +196,7 @@ void InterpreterOopMap::initialize() {
for (int i = 0; i < N; i++) _bit_mask[i] = 0;
}
-void InterpreterOopMap::iterate_oop(OffsetClosure* oop_closure) {
+void InterpreterOopMap::iterate_oop(OffsetClosure* oop_closure) const {
int n = number_of_entries();
int word_index = 0;
uintptr_t value = 0;
@@ -238,16 +238,14 @@ void InterpreterOopMap::iterate_all(OffsetClosure* oop_closure, OffsetClosure* v
#endif
-void InterpreterOopMap::print() {
+void InterpreterOopMap::print() const {
int n = number_of_entries();
tty->print("oop map for ");
method()->print_value();
tty->print(" @ %d = [%d] { ", bci(), n);
for (int i = 0; i < n; i++) {
-#ifdef ENABLE_ZAP_DEAD_LOCALS
if (is_dead(i)) tty->print("%d+ ", i);
else
-#endif
if (is_oop(i)) tty->print("%d ", i);
}
tty->print_cr("}");
@@ -402,13 +400,11 @@ void OopMapCacheEntry::set_mask(CellTypeState *vars, CellTypeState *stack, int s
value |= (mask << oop_bit_number );
}
- #ifdef ENABLE_ZAP_DEAD_LOCALS
// set dead bit
if (!cell->is_live()) {
value |= (mask << dead_bit_number);
assert(!cell->is_reference(), "dead value marked as oop");
}
- #endif
}
// make sure last word is stored
@@ -469,7 +465,7 @@ void InterpreterOopMap::resource_copy(OopMapCacheEntry* from) {
}
}
-inline unsigned int OopMapCache::hash_value_for(methodHandle method, int bci) {
+inline unsigned int OopMapCache::hash_value_for(methodHandle method, int bci) const {
// We use method->code_size() rather than method->identity_hash() below since
// the mark may not be present if a pointer to the method is already reversed.
return ((unsigned int) bci)
@@ -522,7 +518,7 @@ void OopMapCache::flush_obsolete_entries() {
void OopMapCache::lookup(methodHandle method,
int bci,
- InterpreterOopMap* entry_for) {
+ InterpreterOopMap* entry_for) const {
MutexLocker x(&_mut);
OopMapCacheEntry* entry = NULL;
diff --git a/hotspot/src/share/vm/interpreter/oopMapCache.hpp b/hotspot/src/share/vm/interpreter/oopMapCache.hpp
index 5b9980b2984..dbdd4cb1a88 100644
--- a/hotspot/src/share/vm/interpreter/oopMapCache.hpp
+++ b/hotspot/src/share/vm/interpreter/oopMapCache.hpp
@@ -66,19 +66,15 @@ class InterpreterOopMap: ResourceObj {
public:
enum {
- N = 2, // the number of words reserved
+ N = 4, // the number of words reserved
// for inlined mask storage
small_mask_limit = N * BitsPerWord, // the maximum number of bits
// available for small masks,
// small_mask_limit can be set to 0
// for testing bit_mask allocation
-#ifdef ENABLE_ZAP_DEAD_LOCALS
bits_per_entry = 2,
dead_bit_number = 1,
-#else
- bits_per_entry = 1,
-#endif
oop_bit_number = 0
};
@@ -101,32 +97,27 @@ class InterpreterOopMap: ResourceObj {
// access methods
Method* method() const { return _method; }
- void set_method(Method* v) { _method = v; }
+ void set_method(Method* v) { _method = v; }
int bci() const { return _bci; }
void set_bci(int v) { _bci = v; }
int mask_size() const { return _mask_size; }
void set_mask_size(int v) { _mask_size = v; }
- int number_of_entries() const { return mask_size() / bits_per_entry; }
// Test bit mask size and return either the in-line bit mask or allocated
// bit mask.
- uintptr_t* bit_mask() { return (uintptr_t*)(mask_size() <= small_mask_limit ? (intptr_t)_bit_mask : _bit_mask[0]); }
+ uintptr_t* bit_mask() const { return (uintptr_t*)(mask_size() <= small_mask_limit ? (intptr_t)_bit_mask : _bit_mask[0]); }
// return the word size of_bit_mask. mask_size() <= 4 * MAX_USHORT
- size_t mask_word_size() {
+ size_t mask_word_size() const {
return (mask_size() + BitsPerWord - 1) / BitsPerWord;
}
- uintptr_t entry_at(int offset) { int i = offset * bits_per_entry; return bit_mask()[i / BitsPerWord] >> (i % BitsPerWord); }
+ uintptr_t entry_at(int offset) const { int i = offset * bits_per_entry; return bit_mask()[i / BitsPerWord] >> (i % BitsPerWord); }
- void set_expression_stack_size(int sz) { _expression_stack_size = sz; }
-
-#ifdef ENABLE_ZAP_DEAD_LOCALS
- bool is_dead(int offset) { return (entry_at(offset) & (1 << dead_bit_number)) != 0; }
-#endif
+ void set_expression_stack_size(int sz) { _expression_stack_size = sz; }
// Lookup
- bool match(methodHandle method, int bci) { return _method == method() && _bci == bci; }
- bool is_empty();
+ bool match(methodHandle method, int bci) const { return _method == method() && _bci == bci; }
+ bool is_empty() const;
// Initialization
void initialize();
@@ -141,12 +132,14 @@ class InterpreterOopMap: ResourceObj {
// in-line), allocate the space from a Resource area.
void resource_copy(OopMapCacheEntry* from);
- void iterate_oop(OffsetClosure* oop_closure);
- void print();
+ void iterate_oop(OffsetClosure* oop_closure) const;
+ void print() const;
- bool is_oop (int offset) { return (entry_at(offset) & (1 << oop_bit_number )) != 0; }
+ int number_of_entries() const { return mask_size() / bits_per_entry; }
+ bool is_dead(int offset) const { return (entry_at(offset) & (1 << dead_bit_number)) != 0; }
+ bool is_oop (int offset) const { return (entry_at(offset) & (1 << oop_bit_number )) != 0; }
- int expression_stack_size() { return _expression_stack_size; }
+ int expression_stack_size() const { return _expression_stack_size; }
#ifdef ENABLE_ZAP_DEAD_LOCALS
void iterate_all(OffsetClosure* oop_closure, OffsetClosure* value_closure, OffsetClosure* dead_closure);
@@ -161,10 +154,10 @@ class OopMapCache : public CHeapObj {
OopMapCacheEntry* _array;
- unsigned int hash_value_for(methodHandle method, int bci);
+ unsigned int hash_value_for(methodHandle method, int bci) const;
OopMapCacheEntry* entry_at(int i) const;
- Mutex _mut;
+ mutable Mutex _mut;
void flush();
@@ -177,7 +170,7 @@ class OopMapCache : public CHeapObj {
// Returns the oopMap for (method, bci) in parameter "entry".
// Returns false if an oop map was not found.
- void lookup(methodHandle method, int bci, InterpreterOopMap* entry);
+ void lookup(methodHandle method, int bci, InterpreterOopMap* entry) const;
// Compute an oop map without updating the cache or grabbing any locks (for debugging)
static void compute_one_oop_map(methodHandle method, int bci, InterpreterOopMap* entry);
diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp
index f5ff6aad2c1..1f56344c95d 100644
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp
@@ -429,7 +429,7 @@ void CardTableModRefBS::non_clean_card_iterate_possibly_parallel(Space* sp,
OopsInGenClosure* cl,
CardTableRS* ct) {
if (!mr.is_empty()) {
- // Caller (process_strong_roots()) claims that all GC threads
+ // Caller (process_roots()) claims that all GC threads
// execute this call. With UseDynamicNumberOfGCThreads now all
// active GC threads execute this call. The number of active GC
// threads needs to be passed to par_non_clean_card_iterate_work()
@@ -438,7 +438,7 @@ void CardTableModRefBS::non_clean_card_iterate_possibly_parallel(Space* sp,
// This is an example of where n_par_threads() is used instead
// of workers()->active_workers(). n_par_threads can be set to 0 to
// turn off parallelism. For example when this code is called as
- // part of verification and SharedHeap::process_strong_roots() is being
+ // part of verification and SharedHeap::process_roots() is being
// used, then n_par_threads() may have been set to 0. active_workers
// is not overloaded with the meaning that it is a switch to disable
// parallelism and so keeps the meaning of the number of
diff --git a/hotspot/src/share/vm/memory/collectorPolicy.cpp b/hotspot/src/share/vm/memory/collectorPolicy.cpp
index de33c9107d7..af6e39d05f0 100644
--- a/hotspot/src/share/vm/memory/collectorPolicy.cpp
+++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp
@@ -40,10 +40,6 @@
#include "runtime/thread.inline.hpp"
#include "runtime/vmThread.hpp"
#include "utilities/macros.hpp"
-#if INCLUDE_ALL_GCS
-#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
-#include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp"
-#endif // INCLUDE_ALL_GCS
// CollectorPolicy methods
diff --git a/hotspot/src/share/vm/memory/collectorPolicy.hpp b/hotspot/src/share/vm/memory/collectorPolicy.hpp
index 57f59b2bd92..faffc6fec34 100644
--- a/hotspot/src/share/vm/memory/collectorPolicy.hpp
+++ b/hotspot/src/share/vm/memory/collectorPolicy.hpp
@@ -115,7 +115,6 @@ class CollectorPolicy : public CHeapObj {
CollectorPolicyKind,
GenCollectorPolicyKind,
ConcurrentMarkSweepPolicyKind,
- ASConcurrentMarkSweepPolicyKind,
G1CollectorPolicyKind
};
diff --git a/hotspot/src/share/vm/memory/defNewGeneration.cpp b/hotspot/src/share/vm/memory/defNewGeneration.cpp
index 1a904b5c636..281228d28eb 100644
--- a/hotspot/src/share/vm/memory/defNewGeneration.cpp
+++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp
@@ -614,6 +614,9 @@ void DefNewGeneration::collect(bool full,
KlassScanClosure klass_scan_closure(&fsc_with_no_gc_barrier,
gch->rem_set()->klass_rem_set());
+ CLDToKlassAndOopClosure cld_scan_closure(&klass_scan_closure,
+ &fsc_with_no_gc_barrier,
+ false);
set_promo_failure_scan_stack_closure(&fsc_with_no_gc_barrier);
FastEvacuateFollowersClosure evacuate_followers(gch, _level, this,
@@ -623,16 +626,15 @@ void DefNewGeneration::collect(bool full,
assert(gch->no_allocs_since_save_marks(0),
"save marks have not been newly set.");
- int so = SharedHeap::SO_AllClasses | SharedHeap::SO_Strings | SharedHeap::SO_ScavengeCodeCache;
-
- gch->gen_process_strong_roots(_level,
- true, // Process younger gens, if any,
- // as strong roots.
- true, // activate StrongRootsScope
- SharedHeap::ScanningOption(so),
- &fsc_with_no_gc_barrier,
- &fsc_with_gc_barrier,
- &klass_scan_closure);
+ gch->gen_process_roots(_level,
+ true, // Process younger gens, if any,
+ // as strong roots.
+ true, // activate StrongRootsScope
+ SharedHeap::SO_ScavengeCodeCache,
+ GenCollectedHeap::StrongAndWeakRoots,
+ &fsc_with_no_gc_barrier,
+ &fsc_with_gc_barrier,
+ &cld_scan_closure);
// "evacuate followers".
evacuate_followers.do_void();
diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.cpp b/hotspot/src/share/vm/memory/genCollectedHeap.cpp
index bdb915ebb0c..bbca44a36f6 100644
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp
@@ -61,8 +61,8 @@
GenCollectedHeap* GenCollectedHeap::_gch;
NOT_PRODUCT(size_t GenCollectedHeap::_skip_header_HeapWords = 0;)
-// The set of potentially parallel tasks in strong root scanning.
-enum GCH_process_strong_roots_tasks {
+// The set of potentially parallel tasks in root scanning.
+enum GCH_strong_roots_tasks {
// We probably want to parallelize both of these internally, but for now...
GCH_PS_younger_gens,
// Leave this one last.
@@ -72,11 +72,11 @@ enum GCH_process_strong_roots_tasks {
GenCollectedHeap::GenCollectedHeap(GenCollectorPolicy *policy) :
SharedHeap(policy),
_gen_policy(policy),
- _gen_process_strong_tasks(new SubTasksDone(GCH_PS_NumElements)),
+ _gen_process_roots_tasks(new SubTasksDone(GCH_PS_NumElements)),
_full_collections_completed(0)
{
- if (_gen_process_strong_tasks == NULL ||
- !_gen_process_strong_tasks->valid()) {
+ if (_gen_process_roots_tasks == NULL ||
+ !_gen_process_roots_tasks->valid()) {
vm_exit_during_initialization("Failed necessary allocation.");
}
assert(policy != NULL, "Sanity check");
@@ -202,13 +202,11 @@ void GenCollectedHeap::post_initialize() {
guarantee(policy->is_generation_policy(), "Illegal policy type");
DefNewGeneration* def_new_gen = (DefNewGeneration*) get_gen(0);
assert(def_new_gen->kind() == Generation::DefNew ||
- def_new_gen->kind() == Generation::ParNew ||
- def_new_gen->kind() == Generation::ASParNew,
+ def_new_gen->kind() == Generation::ParNew,
"Wrong generation kind");
Generation* old_gen = get_gen(1);
assert(old_gen->kind() == Generation::ConcurrentMarkSweep ||
- old_gen->kind() == Generation::ASConcurrentMarkSweep ||
old_gen->kind() == Generation::MarkSweepCompact,
"Wrong generation kind");
@@ -573,9 +571,6 @@ void GenCollectedHeap::do_collection(bool full,
}
}
- AdaptiveSizePolicy* sp = gen_policy()->size_policy();
- AdaptiveSizePolicyOutput(sp, total_collections());
-
print_heap_after_gc();
#ifdef TRACESPINNING
@@ -589,24 +584,29 @@ HeapWord* GenCollectedHeap::satisfy_failed_allocation(size_t size, bool is_tlab)
void GenCollectedHeap::set_par_threads(uint t) {
SharedHeap::set_par_threads(t);
- _gen_process_strong_tasks->set_n_threads(t);
+ _gen_process_roots_tasks->set_n_threads(t);
}
void GenCollectedHeap::
-gen_process_strong_roots(int level,
- bool younger_gens_as_roots,
- bool activate_scope,
- SharedHeap::ScanningOption so,
- OopsInGenClosure* not_older_gens,
- OopsInGenClosure* older_gens,
- KlassClosure* klass_closure) {
- // General strong roots.
+gen_process_roots(int level,
+ bool younger_gens_as_roots,
+ bool activate_scope,
+ SharedHeap::ScanningOption so,
+ OopsInGenClosure* not_older_gens,
+ OopsInGenClosure* weak_roots,
+ OopsInGenClosure* older_gens,
+ CLDClosure* cld_closure,
+ CLDClosure* weak_cld_closure,
+ CodeBlobClosure* code_closure) {
- SharedHeap::process_strong_roots(activate_scope, so,
- not_older_gens, klass_closure);
+ // General roots.
+ SharedHeap::process_roots(activate_scope, so,
+ not_older_gens, weak_roots,
+ cld_closure, weak_cld_closure,
+ code_closure);
if (younger_gens_as_roots) {
- if (!_gen_process_strong_tasks->is_task_claimed(GCH_PS_younger_gens)) {
+ if (!_gen_process_roots_tasks->is_task_claimed(GCH_PS_younger_gens)) {
for (int i = 0; i < level; i++) {
not_older_gens->set_generation(_gens[i]);
_gens[i]->oop_iterate(not_older_gens);
@@ -622,7 +622,38 @@ gen_process_strong_roots(int level,
older_gens->reset_generation();
}
- _gen_process_strong_tasks->all_tasks_completed();
+ _gen_process_roots_tasks->all_tasks_completed();
+}
+
+void GenCollectedHeap::
+gen_process_roots(int level,
+ bool younger_gens_as_roots,
+ bool activate_scope,
+ SharedHeap::ScanningOption so,
+ bool only_strong_roots,
+ OopsInGenClosure* not_older_gens,
+ OopsInGenClosure* older_gens,
+ CLDClosure* cld_closure) {
+
+ const bool is_adjust_phase = !only_strong_roots && !younger_gens_as_roots;
+
+ bool is_moving_collection = false;
+ if (level == 0 || is_adjust_phase) {
+ // young collections are always moving
+ is_moving_collection = true;
+ }
+
+ MarkingCodeBlobClosure mark_code_closure(not_older_gens, is_moving_collection);
+ CodeBlobClosure* code_closure = &mark_code_closure;
+
+ gen_process_roots(level,
+ younger_gens_as_roots,
+ activate_scope, so,
+ not_older_gens, only_strong_roots ? NULL : not_older_gens,
+ older_gens,
+ cld_closure, only_strong_roots ? NULL : cld_closure,
+ code_closure);
+
}
void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure) {
@@ -724,8 +755,7 @@ void GenCollectedHeap::collect_locked(GCCause::Cause cause, int max_level) {
#if INCLUDE_ALL_GCS
bool GenCollectedHeap::create_cms_collector() {
- assert(((_gens[1]->kind() == Generation::ConcurrentMarkSweep) ||
- (_gens[1]->kind() == Generation::ASConcurrentMarkSweep)),
+ assert(_gens[1]->kind() == Generation::ConcurrentMarkSweep,
"Unexpected generation kinds");
// Skip two header words in the block content verification
NOT_PRODUCT(_skip_header_HeapWords = CMSCollector::skip_header_HeapWords();)
diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.hpp b/hotspot/src/share/vm/memory/genCollectedHeap.hpp
index dcd389cc90d..dab317d71ff 100644
--- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp
@@ -78,9 +78,9 @@ public:
unsigned int _full_collections_completed;
// Data structure for claiming the (potentially) parallel tasks in
- // (gen-specific) strong roots processing.
- SubTasksDone* _gen_process_strong_tasks;
- SubTasksDone* gen_process_strong_tasks() { return _gen_process_strong_tasks; }
+ // (gen-specific) roots processing.
+ SubTasksDone* _gen_process_roots_tasks;
+ SubTasksDone* gen_process_roots_tasks() { return _gen_process_roots_tasks; }
// In block contents verification, the number of header words to skip
NOT_PRODUCT(static size_t _skip_header_HeapWords;)
@@ -403,18 +403,30 @@ public:
// The "so" argument determines which of the roots
// the closure is applied to:
// "SO_None" does none;
- // "SO_AllClasses" applies the closure to all entries in the SystemDictionary;
- // "SO_SystemClasses" to all the "system" classes and loaders;
- // "SO_Strings" applies the closure to all entries in the StringTable.
- void gen_process_strong_roots(int level,
- bool younger_gens_as_roots,
- // The remaining arguments are in an order
- // consistent with SharedHeap::process_strong_roots:
- bool activate_scope,
- SharedHeap::ScanningOption so,
- OopsInGenClosure* not_older_gens,
- OopsInGenClosure* older_gens,
- KlassClosure* klass_closure);
+ private:
+ void gen_process_roots(int level,
+ bool younger_gens_as_roots,
+ bool activate_scope,
+ SharedHeap::ScanningOption so,
+ OopsInGenClosure* not_older_gens,
+ OopsInGenClosure* weak_roots,
+ OopsInGenClosure* older_gens,
+ CLDClosure* cld_closure,
+ CLDClosure* weak_cld_closure,
+ CodeBlobClosure* code_closure);
+
+ public:
+ static const bool StrongAndWeakRoots = false;
+ static const bool StrongRootsOnly = true;
+
+ void gen_process_roots(int level,
+ bool younger_gens_as_roots,
+ bool activate_scope,
+ SharedHeap::ScanningOption so,
+ bool only_strong_roots,
+ OopsInGenClosure* not_older_gens,
+ OopsInGenClosure* older_gens,
+ CLDClosure* cld_closure);
// Apply "root_closure" to all the weak roots of the system.
// These include JNI weak roots, string table,
diff --git a/hotspot/src/share/vm/memory/genMarkSweep.cpp b/hotspot/src/share/vm/memory/genMarkSweep.cpp
index dcd7308843e..5faab645408 100644
--- a/hotspot/src/share/vm/memory/genMarkSweep.cpp
+++ b/hotspot/src/share/vm/memory/genMarkSweep.cpp
@@ -207,13 +207,14 @@ void GenMarkSweep::mark_sweep_phase1(int level,
// Need new claim bits before marking starts.
ClassLoaderDataGraph::clear_claimed_marks();
- gch->gen_process_strong_roots(level,
- false, // Younger gens are not roots.
- true, // activate StrongRootsScope
- SharedHeap::SO_SystemClasses,
- &follow_root_closure,
- &follow_root_closure,
- &follow_klass_closure);
+ gch->gen_process_roots(level,
+ false, // Younger gens are not roots.
+ true, // activate StrongRootsScope
+ SharedHeap::SO_None,
+ GenCollectedHeap::StrongRootsOnly,
+ &follow_root_closure,
+ &follow_root_closure,
+ &follow_cld_closure);
// Process reference objects found during marking
{
@@ -291,13 +292,14 @@ void GenMarkSweep::mark_sweep_phase3(int level) {
// are run.
adjust_pointer_closure.set_orig_generation(gch->get_gen(level));
- gch->gen_process_strong_roots(level,
- false, // Younger gens are not roots.
- true, // activate StrongRootsScope
- SharedHeap::SO_AllClasses | SharedHeap::SO_Strings | SharedHeap::SO_AllCodeCache,
- &adjust_pointer_closure,
- &adjust_pointer_closure,
- &adjust_klass_closure);
+ gch->gen_process_roots(level,
+ false, // Younger gens are not roots.
+ true, // activate StrongRootsScope
+ SharedHeap::SO_AllCodeCache,
+ GenCollectedHeap::StrongAndWeakRoots,
+ &adjust_pointer_closure,
+ &adjust_pointer_closure,
+ &adjust_cld_closure);
gch->gen_process_weak_roots(&adjust_pointer_closure);
diff --git a/hotspot/src/share/vm/memory/generation.cpp b/hotspot/src/share/vm/memory/generation.cpp
index 0c121503a17..7a7d21f2563 100644
--- a/hotspot/src/share/vm/memory/generation.cpp
+++ b/hotspot/src/share/vm/memory/generation.cpp
@@ -154,8 +154,7 @@ bool Generation::is_in(const void* p) const {
DefNewGeneration* Generation::as_DefNewGeneration() {
assert((kind() == Generation::DefNew) ||
- (kind() == Generation::ParNew) ||
- (kind() == Generation::ASParNew),
+ (kind() == Generation::ParNew),
"Wrong youngest generation type");
return (DefNewGeneration*) this;
}
diff --git a/hotspot/src/share/vm/memory/generation.hpp b/hotspot/src/share/vm/memory/generation.hpp
index de60d23f197..feb2fb7946d 100644
--- a/hotspot/src/share/vm/memory/generation.hpp
+++ b/hotspot/src/share/vm/memory/generation.hpp
@@ -131,8 +131,6 @@ class Generation: public CHeapObj {
public:
// The set of possible generation kinds.
enum Name {
- ASParNew,
- ASConcurrentMarkSweep,
DefNew,
ParNew,
MarkSweepCompact,
diff --git a/hotspot/src/share/vm/memory/generationSpec.cpp b/hotspot/src/share/vm/memory/generationSpec.cpp
index 128387cc952..bed0d5484ab 100644
--- a/hotspot/src/share/vm/memory/generationSpec.cpp
+++ b/hotspot/src/share/vm/memory/generationSpec.cpp
@@ -32,7 +32,6 @@
#include "runtime/java.hpp"
#include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
-#include "gc_implementation/parNew/asParNewGeneration.hpp"
#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
#include "gc_implementation/parNew/parNewGeneration.hpp"
#endif // INCLUDE_ALL_GCS
@@ -50,12 +49,6 @@ Generation* GenerationSpec::init(ReservedSpace rs, int level,
case Generation::ParNew:
return new ParNewGeneration(rs, init_size(), level);
- case Generation::ASParNew:
- return new ASParNewGeneration(rs,
- init_size(),
- init_size() /* min size */,
- level);
-
case Generation::ConcurrentMarkSweep: {
assert(UseConcMarkSweepGC, "UseConcMarkSweepGC should be set");
CardTableRS* ctrs = remset->as_CardTableRS();
@@ -75,26 +68,6 @@ Generation* GenerationSpec::init(ReservedSpace rs, int level,
return g;
}
-
- case Generation::ASConcurrentMarkSweep: {
- assert(UseConcMarkSweepGC, "UseConcMarkSweepGC should be set");
- CardTableRS* ctrs = remset->as_CardTableRS();
- if (ctrs == NULL) {
- vm_exit_during_initialization("Rem set incompatibility.");
- }
- // Otherwise
- // The constructor creates the CMSCollector if needed,
- // else registers with an existing CMSCollector
-
- ASConcurrentMarkSweepGeneration* g = NULL;
- g = new ASConcurrentMarkSweepGeneration(rs,
- init_size(), level, ctrs, UseCMSAdaptiveFreeLists,
- (FreeBlockDictionary::DictionaryChoice)CMSDictionaryChoice);
-
- g->initialize_performance_counters();
-
- return g;
- }
#endif // INCLUDE_ALL_GCS
default:
diff --git a/hotspot/src/share/vm/memory/iterator.cpp b/hotspot/src/share/vm/memory/iterator.cpp
index 6cd8e965922..1022ece4617 100644
--- a/hotspot/src/share/vm/memory/iterator.cpp
+++ b/hotspot/src/share/vm/memory/iterator.cpp
@@ -35,6 +35,10 @@ void CLDToOopClosure::do_cld(ClassLoaderData* cld) {
cld->oops_do(_oop_closure, &_klass_closure, _must_claim_cld);
}
+void CLDToKlassAndOopClosure::do_cld(ClassLoaderData* cld) {
+ cld->oops_do(_oop_closure, _klass_closure, _must_claim_cld);
+}
+
void ObjectToOopClosure::do_object(oop obj) {
obj->oop_iterate(_cl);
}
@@ -43,6 +47,20 @@ void VoidClosure::do_void() {
ShouldNotCallThis();
}
+void CodeBlobToOopClosure::do_nmethod(nmethod* nm) {
+ nm->oops_do(_cl);
+ if (_fix_relocations) {
+ nm->fix_oop_relocations();
+ }
+}
+
+void CodeBlobToOopClosure::do_code_blob(CodeBlob* cb) {
+ nmethod* nm = cb->as_nmethod_or_null();
+ if (nm != NULL) {
+ do_nmethod(nm);
+ }
+}
+
MarkingCodeBlobClosure::MarkScope::MarkScope(bool activate)
: _active(activate)
{
@@ -55,32 +73,7 @@ MarkingCodeBlobClosure::MarkScope::~MarkScope() {
void MarkingCodeBlobClosure::do_code_blob(CodeBlob* cb) {
nmethod* nm = cb->as_nmethod_or_null();
- if (nm == NULL) return;
- if (!nm->test_set_oops_do_mark()) {
- NOT_PRODUCT(if (TraceScavenge) nm->print_on(tty, "oops_do, 1st visit\n"));
- do_newly_marked_nmethod(nm);
- } else {
- NOT_PRODUCT(if (TraceScavenge) nm->print_on(tty, "oops_do, skipped on 2nd visit\n"));
+ if (nm != NULL && !nm->test_set_oops_do_mark()) {
+ do_nmethod(nm);
}
}
-
-void CodeBlobToOopClosure::do_newly_marked_nmethod(nmethod* nm) {
- nm->oops_do(_cl, /*allow_zombie=*/ false);
-}
-
-void CodeBlobToOopClosure::do_code_blob(CodeBlob* cb) {
- if (!_do_marking) {
- nmethod* nm = cb->as_nmethod_or_null();
- NOT_PRODUCT(if (TraceScavenge && Verbose && nm != NULL) nm->print_on(tty, "oops_do, unmarked visit\n"));
- // This assert won't work, since there are lots of mini-passes
- // (mostly in debug mode) that co-exist with marking phases.
- //assert(!(cb->is_nmethod() && ((nmethod*)cb)->test_oops_do_mark()), "found marked nmethod during mark-free phase");
- if (nm != NULL) {
- nm->oops_do(_cl);
- }
- } else {
- MarkingCodeBlobClosure::do_code_blob(cb);
- }
-}
-
-
diff --git a/hotspot/src/share/vm/memory/iterator.hpp b/hotspot/src/share/vm/memory/iterator.hpp
index e91d42974b1..12684527023 100644
--- a/hotspot/src/share/vm/memory/iterator.hpp
+++ b/hotspot/src/share/vm/memory/iterator.hpp
@@ -70,8 +70,8 @@ class ExtendedOopClosure : public OopClosure {
//
// Providing default implementations of the _nv functions unfortunately
// removes the compile-time safeness, but reduces the clutter for the
- // ExtendedOopClosures that don't need to walk the metadata. Currently,
- // only CMS needs these.
+ // ExtendedOopClosures that don't need to walk the metadata.
+ // Currently, only CMS and G1 need these.
virtual bool do_metadata() { return do_metadata_nv(); }
bool do_metadata_v() { return do_metadata(); }
@@ -126,15 +126,16 @@ class KlassToOopClosure : public KlassClosure {
_oop_closure = oop_closure;
}
-public:
+ public:
KlassToOopClosure(OopClosure* oop_closure = NULL) : _oop_closure(oop_closure) {}
+
virtual void do_klass(Klass* k);
};
class CLDToOopClosure : public CLDClosure {
- OopClosure* _oop_closure;
+ OopClosure* _oop_closure;
KlassToOopClosure _klass_closure;
- bool _must_claim_cld;
+ bool _must_claim_cld;
public:
CLDToOopClosure(OopClosure* oop_closure, bool must_claim_cld = true) :
@@ -145,6 +146,23 @@ class CLDToOopClosure : public CLDClosure {
void do_cld(ClassLoaderData* cld);
};
+class CLDToKlassAndOopClosure : public CLDClosure {
+ friend class SharedHeap;
+ friend class G1CollectedHeap;
+ protected:
+ OopClosure* _oop_closure;
+ KlassClosure* _klass_closure;
+ bool _must_claim_cld;
+ public:
+ CLDToKlassAndOopClosure(KlassClosure* klass_closure,
+ OopClosure* oop_closure,
+ bool must_claim_cld) :
+ _oop_closure(oop_closure),
+ _klass_closure(klass_closure),
+ _must_claim_cld(must_claim_cld) {}
+ void do_cld(ClassLoaderData* cld);
+};
+
// The base class for all concurrent marking closures,
// that participates in class unloading.
// It's used to proxy through the metadata to the oops defined in them.
@@ -246,14 +264,26 @@ class CodeBlobClosure : public Closure {
virtual void do_code_blob(CodeBlob* cb) = 0;
};
-
-class MarkingCodeBlobClosure : public CodeBlobClosure {
+// Applies an oop closure to all ref fields in code blobs
+// iterated over in an object iteration.
+class CodeBlobToOopClosure : public CodeBlobClosure {
+ OopClosure* _cl;
+ bool _fix_relocations;
+ protected:
+ void do_nmethod(nmethod* nm);
public:
+ CodeBlobToOopClosure(OopClosure* cl, bool fix_relocations) : _cl(cl), _fix_relocations(fix_relocations) {}
+ virtual void do_code_blob(CodeBlob* cb);
+
+ const static bool FixRelocations = true;
+};
+
+class MarkingCodeBlobClosure : public CodeBlobToOopClosure {
+ public:
+ MarkingCodeBlobClosure(OopClosure* cl, bool fix_relocations) : CodeBlobToOopClosure(cl, fix_relocations) {}
// Called for each code blob, but at most once per unique blob.
- virtual void do_newly_marked_nmethod(nmethod* nm) = 0;
virtual void do_code_blob(CodeBlob* cb);
- // = { if (!nmethod(cb)->test_set_oops_do_mark()) do_newly_marked_nmethod(cb); }
class MarkScope : public StackObj {
protected:
@@ -266,23 +296,6 @@ class MarkingCodeBlobClosure : public CodeBlobClosure {
};
};
-
-// Applies an oop closure to all ref fields in code blobs
-// iterated over in an object iteration.
-class CodeBlobToOopClosure: public MarkingCodeBlobClosure {
- OopClosure* _cl;
- bool _do_marking;
-public:
- virtual void do_newly_marked_nmethod(nmethod* cb);
- // = { cb->oops_do(_cl); }
- virtual void do_code_blob(CodeBlob* cb);
- // = { if (_do_marking) super::do_code_blob(cb); else cb->oops_do(_cl); }
- CodeBlobToOopClosure(OopClosure* cl, bool do_marking)
- : _cl(cl), _do_marking(do_marking) {}
-};
-
-
-
// MonitorClosure is used for iterating over monitors in the monitors cache
class ObjectMonitor;
diff --git a/hotspot/src/share/vm/memory/metadataFactory.hpp b/hotspot/src/share/vm/memory/metadataFactory.hpp
index 9f7a22eaf55..dbb936fdf57 100644
--- a/hotspot/src/share/vm/memory/metadataFactory.hpp
+++ b/hotspot/src/share/vm/memory/metadataFactory.hpp
@@ -25,6 +25,7 @@
#ifndef SHARE_VM_MEMORY_METADATAFACTORY_HPP
#define SHARE_VM_MEMORY_METADATAFACTORY_HPP
+#include "classfile/classLoaderData.hpp"
#include "utilities/array.hpp"
#include "utilities/exceptions.hpp"
#include "utilities/globalDefinitions.hpp"
diff --git a/hotspot/src/share/vm/memory/sharedHeap.cpp b/hotspot/src/share/vm/memory/sharedHeap.cpp
index 77011f7a166..e0a5d9961cb 100644
--- a/hotspot/src/share/vm/memory/sharedHeap.cpp
+++ b/hotspot/src/share/vm/memory/sharedHeap.cpp
@@ -29,6 +29,7 @@
#include "gc_interface/collectedHeap.inline.hpp"
#include "memory/sharedHeap.hpp"
#include "oops/oop.inline.hpp"
+#include "runtime/atomic.inline.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/java.hpp"
#include "services/management.hpp"
@@ -39,8 +40,8 @@ PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
SharedHeap* SharedHeap::_sh;
-// The set of potentially parallel tasks in strong root scanning.
-enum SH_process_strong_roots_tasks {
+// The set of potentially parallel tasks in root scanning.
+enum SH_process_roots_tasks {
SH_PS_Universe_oops_do,
SH_PS_JNIHandles_oops_do,
SH_PS_ObjectSynchronizer_oops_do,
@@ -58,6 +59,7 @@ SharedHeap::SharedHeap(CollectorPolicy* policy_) :
CollectedHeap(),
_collector_policy(policy_),
_rem_set(NULL),
+ _strong_roots_scope(NULL),
_strong_roots_parity(0),
_process_strong_tasks(new SubTasksDone(SH_PS_NumElements)),
_workers(NULL)
@@ -114,6 +116,19 @@ public:
static AssertNonScavengableClosure assert_is_non_scavengable_closure;
#endif
+SharedHeap::StrongRootsScope* SharedHeap::active_strong_roots_scope() const {
+ return _strong_roots_scope;
+}
+void SharedHeap::register_strong_roots_scope(SharedHeap::StrongRootsScope* scope) {
+ assert(_strong_roots_scope == NULL, "Should only have one StrongRootsScope active");
+ assert(scope != NULL, "Illegal argument");
+ _strong_roots_scope = scope;
+}
+void SharedHeap::unregister_strong_roots_scope(SharedHeap::StrongRootsScope* scope) {
+ assert(_strong_roots_scope == scope, "Wrong scope unregistered");
+ _strong_roots_scope = NULL;
+}
+
void SharedHeap::change_strong_roots_parity() {
// Also set the new collection parity.
assert(_strong_roots_parity >= 0 && _strong_roots_parity <= 2,
@@ -124,112 +139,161 @@ void SharedHeap::change_strong_roots_parity() {
"Not in range.");
}
-SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* outer, bool activate)
- : MarkScope(activate)
+SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* heap, bool activate)
+ : MarkScope(activate), _sh(heap), _n_workers_done_with_threads(0)
{
if (_active) {
- outer->change_strong_roots_parity();
+ _sh->register_strong_roots_scope(this);
+ _sh->change_strong_roots_parity();
// Zero the claimed high water mark in the StringTable
StringTable::clear_parallel_claimed_index();
}
}
SharedHeap::StrongRootsScope::~StrongRootsScope() {
- // nothing particular
+ if (_active) {
+ _sh->unregister_strong_roots_scope(this);
+ }
}
-void SharedHeap::process_strong_roots(bool activate_scope,
- ScanningOption so,
- OopClosure* roots,
- KlassClosure* klass_closure) {
+Monitor* SharedHeap::StrongRootsScope::_lock = new Monitor(Mutex::leaf, "StrongRootsScope lock", false);
+
+void SharedHeap::StrongRootsScope::mark_worker_done_with_threads(uint n_workers) {
+ // The Thread work barrier is only needed by G1.
+ // No need to use the barrier if this is single-threaded code.
+ if (UseG1GC && n_workers > 0) {
+ uint new_value = (uint)Atomic::add(1, &_n_workers_done_with_threads);
+ if (new_value == n_workers) {
+ // This thread is last. Notify the others.
+ MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag);
+ _lock->notify_all();
+ }
+ }
+}
+
+void SharedHeap::StrongRootsScope::wait_until_all_workers_done_with_threads(uint n_workers) {
+ // No need to use the barrier if this is single-threaded code.
+ if (n_workers > 0 && (uint)_n_workers_done_with_threads != n_workers) {
+ MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag);
+ while ((uint)_n_workers_done_with_threads != n_workers) {
+ _lock->wait(Mutex::_no_safepoint_check_flag, 0, false);
+ }
+ }
+}
+
+void SharedHeap::process_roots(bool activate_scope,
+ ScanningOption so,
+ OopClosure* strong_roots,
+ OopClosure* weak_roots,
+ CLDClosure* strong_cld_closure,
+ CLDClosure* weak_cld_closure,
+ CodeBlobClosure* code_roots) {
StrongRootsScope srs(this, activate_scope);
- // General strong roots.
+ // General roots.
assert(_strong_roots_parity != 0, "must have called prologue code");
+ assert(code_roots != NULL, "code root closure should always be set");
// _n_termination for _process_strong_tasks should be set up stream
// in a method not running in a GC worker. Otherwise the GC worker
// could be trying to change the termination condition while the task
// is executing in another GC worker.
+
+ // Iterating over the CLDG and the Threads are done early to allow G1 to
+ // first process the strong CLDs and nmethods and then, after a barrier,
+ // let the thread process the weak CLDs and nmethods.
+
+ if (!_process_strong_tasks->is_task_claimed(SH_PS_ClassLoaderDataGraph_oops_do)) {
+ ClassLoaderDataGraph::roots_cld_do(strong_cld_closure, weak_cld_closure);
+ }
+
+ // Some CLDs contained in the thread frames should be considered strong.
+ // Don't process them if they will be processed during the ClassLoaderDataGraph phase.
+ CLDClosure* roots_from_clds_p = (strong_cld_closure != weak_cld_closure) ? strong_cld_closure : NULL;
+ // Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
+ CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
+
+ Threads::possibly_parallel_oops_do(strong_roots, roots_from_clds_p, roots_from_code_p);
+
+ // This is the point where this worker thread will not find more strong CLDs/nmethods.
+ // Report this so G1 can synchronize the strong and weak CLDs/nmethods processing.
+ active_strong_roots_scope()->mark_worker_done_with_threads(n_par_threads());
+
if (!_process_strong_tasks->is_task_claimed(SH_PS_Universe_oops_do)) {
- Universe::oops_do(roots);
+ Universe::oops_do(strong_roots);
}
// Global (strong) JNI handles
if (!_process_strong_tasks->is_task_claimed(SH_PS_JNIHandles_oops_do))
- JNIHandles::oops_do(roots);
-
- CodeBlobToOopClosure code_roots(roots, true);
-
- CLDToOopClosure roots_from_clds(roots);
- // If we limit class scanning to SO_SystemClasses we need to apply a CLD closure to
- // CLDs which are strongly reachable from the thread stacks.
- CLDToOopClosure* roots_from_clds_p = ((so & SO_SystemClasses) ? &roots_from_clds : NULL);
- // All threads execute this; the individual threads are task groups.
- if (CollectedHeap::use_parallel_gc_threads()) {
- Threads::possibly_parallel_oops_do(roots, roots_from_clds_p, &code_roots);
- } else {
- Threads::oops_do(roots, roots_from_clds_p, &code_roots);
- }
+ JNIHandles::oops_do(strong_roots);
if (!_process_strong_tasks-> is_task_claimed(SH_PS_ObjectSynchronizer_oops_do))
- ObjectSynchronizer::oops_do(roots);
+ ObjectSynchronizer::oops_do(strong_roots);
if (!_process_strong_tasks->is_task_claimed(SH_PS_FlatProfiler_oops_do))
- FlatProfiler::oops_do(roots);
+ FlatProfiler::oops_do(strong_roots);
if (!_process_strong_tasks->is_task_claimed(SH_PS_Management_oops_do))
- Management::oops_do(roots);
+ Management::oops_do(strong_roots);
if (!_process_strong_tasks->is_task_claimed(SH_PS_jvmti_oops_do))
- JvmtiExport::oops_do(roots);
+ JvmtiExport::oops_do(strong_roots);
if (!_process_strong_tasks->is_task_claimed(SH_PS_SystemDictionary_oops_do)) {
- if (so & SO_AllClasses) {
- SystemDictionary::oops_do(roots);
- } else if (so & SO_SystemClasses) {
- SystemDictionary::always_strong_oops_do(roots);
- } else {
- fatal("We should always have selected either SO_AllClasses or SO_SystemClasses");
- }
- }
-
- if (!_process_strong_tasks->is_task_claimed(SH_PS_ClassLoaderDataGraph_oops_do)) {
- if (so & SO_AllClasses) {
- ClassLoaderDataGraph::oops_do(roots, klass_closure, /* must_claim */ false);
- } else if (so & SO_SystemClasses) {
- ClassLoaderDataGraph::always_strong_oops_do(roots, klass_closure, /* must_claim */ true);
- }
+ SystemDictionary::roots_oops_do(strong_roots, weak_roots);
}
// All threads execute the following. A specific chunk of buckets
// from the StringTable are the individual tasks.
- if (so & SO_Strings) {
+ if (weak_roots != NULL) {
if (CollectedHeap::use_parallel_gc_threads()) {
- StringTable::possibly_parallel_oops_do(roots);
+ StringTable::possibly_parallel_oops_do(weak_roots);
} else {
- StringTable::oops_do(roots);
+ StringTable::oops_do(weak_roots);
}
}
if (!_process_strong_tasks->is_task_claimed(SH_PS_CodeCache_oops_do)) {
if (so & SO_ScavengeCodeCache) {
- assert(&code_roots != NULL, "must supply closure for code cache");
+ assert(code_roots != NULL, "must supply closure for code cache");
// We only visit parts of the CodeCache when scavenging.
- CodeCache::scavenge_root_nmethods_do(&code_roots);
+ CodeCache::scavenge_root_nmethods_do(code_roots);
}
if (so & SO_AllCodeCache) {
- assert(&code_roots != NULL, "must supply closure for code cache");
+ assert(code_roots != NULL, "must supply closure for code cache");
// CMSCollector uses this to do intermediate-strength collections.
// We scan the entire code cache, since CodeCache::do_unloading is not called.
- CodeCache::blobs_do(&code_roots);
+ CodeCache::blobs_do(code_roots);
}
// Verify that the code cache contents are not subject to
// movement by a scavenging collection.
- DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, /*do_marking=*/ false));
+ DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
}
_process_strong_tasks->all_tasks_completed();
}
+void SharedHeap::process_all_roots(bool activate_scope,
+ ScanningOption so,
+ OopClosure* roots,
+ CLDClosure* cld_closure,
+ CodeBlobClosure* code_closure) {
+ process_roots(activate_scope, so,
+ roots, roots,
+ cld_closure, cld_closure,
+ code_closure);
+}
+
+void SharedHeap::process_strong_roots(bool activate_scope,
+ ScanningOption so,
+ OopClosure* roots,
+ CLDClosure* cld_closure,
+ CodeBlobClosure* code_closure) {
+ process_roots(activate_scope, so,
+ roots, NULL,
+ cld_closure, NULL,
+ code_closure);
+}
+
+
class AlwaysTrueClosure: public BoolObjectClosure {
public:
bool do_object_b(oop p) { return true; }
diff --git a/hotspot/src/share/vm/memory/sharedHeap.hpp b/hotspot/src/share/vm/memory/sharedHeap.hpp
index fef0a3da068..c934b6bdf15 100644
--- a/hotspot/src/share/vm/memory/sharedHeap.hpp
+++ b/hotspot/src/share/vm/memory/sharedHeap.hpp
@@ -69,14 +69,10 @@ class KlassClosure;
// number of active GC workers. CompactibleFreeListSpace and Space
// have SequentialSubTasksDone's.
// Example of using SubTasksDone and SequentialSubTasksDone
-// G1CollectedHeap::g1_process_strong_roots() calls
-// process_strong_roots(false, // no scoping; this is parallel code
-// is_scavenging, so,
-// &buf_scan_non_heap_roots,
-// &eager_scan_code_roots);
-// which delegates to SharedHeap::process_strong_roots() and uses
+// G1CollectedHeap::g1_process_roots()
+// to SharedHeap::process_roots() and uses
// SubTasksDone* _process_strong_tasks to claim tasks.
-// process_strong_roots() calls
+// process_roots() calls
// rem_set()->younger_refs_iterate()
// to scan the card table and which eventually calls down into
// CardTableModRefBS::par_non_clean_card_iterate_work(). This method
@@ -182,12 +178,12 @@ public:
// task. (This also means that a parallel thread may only call
// process_strong_roots once.)
//
- // For calls to process_strong_roots by sequential code, the parity is
+ // For calls to process_roots by sequential code, the parity is
// updated automatically.
//
// The idea is that objects representing fine-grained tasks, such as
// threads, will contain a "parity" field. A task will is claimed in the
- // current "process_strong_roots" call only if its parity field is the
+ // current "process_roots" call only if its parity field is the
// same as the "strong_roots_parity"; task claiming is accomplished by
// updating the parity field to the strong_roots_parity with a CAS.
//
@@ -198,27 +194,44 @@ public:
// c) to never return a distinguished value (zero) with which such
// task-claiming variables may be initialized, to indicate "never
// claimed".
- private:
- void change_strong_roots_parity();
public:
int strong_roots_parity() { return _strong_roots_parity; }
- // Call these in sequential code around process_strong_roots.
+ // Call these in sequential code around process_roots.
// strong_roots_prologue calls change_strong_roots_parity, if
// parallel tasks are enabled.
class StrongRootsScope : public MarkingCodeBlobClosure::MarkScope {
- public:
- StrongRootsScope(SharedHeap* outer, bool activate = true);
+ // Used to implement the Thread work barrier.
+ static Monitor* _lock;
+
+ SharedHeap* _sh;
+ volatile jint _n_workers_done_with_threads;
+
+ public:
+ StrongRootsScope(SharedHeap* heap, bool activate = true);
~StrongRootsScope();
+
+ // Mark that this thread is done with the Threads work.
+ void mark_worker_done_with_threads(uint n_workers);
+ // Wait until all n_workers are done with the Threads work.
+ void wait_until_all_workers_done_with_threads(uint n_workers);
};
friend class StrongRootsScope;
+ // The current active StrongRootScope
+ StrongRootsScope* _strong_roots_scope;
+
+ StrongRootsScope* active_strong_roots_scope() const;
+
+ private:
+ void register_strong_roots_scope(StrongRootsScope* scope);
+ void unregister_strong_roots_scope(StrongRootsScope* scope);
+ void change_strong_roots_parity();
+
+ public:
enum ScanningOption {
- SO_None = 0x0,
- SO_AllClasses = 0x1,
- SO_SystemClasses = 0x2,
- SO_Strings = 0x4,
- SO_AllCodeCache = 0x8,
+ SO_None = 0x0,
+ SO_AllCodeCache = 0x8,
SO_ScavengeCodeCache = 0x10
};
@@ -227,15 +240,26 @@ public:
// Invoke the "do_oop" method the closure "roots" on all root locations.
// The "so" argument determines which roots the closure is applied to:
// "SO_None" does none;
- // "SO_AllClasses" applies the closure to all entries in the SystemDictionary;
- // "SO_SystemClasses" to all the "system" classes and loaders;
- // "SO_Strings" applies the closure to all entries in StringTable;
// "SO_AllCodeCache" applies the closure to all elements of the CodeCache.
// "SO_ScavengeCodeCache" applies the closure to elements on the scavenge root list in the CodeCache.
+ void process_roots(bool activate_scope,
+ ScanningOption so,
+ OopClosure* strong_roots,
+ OopClosure* weak_roots,
+ CLDClosure* strong_cld_closure,
+ CLDClosure* weak_cld_closure,
+ CodeBlobClosure* code_roots);
+ void process_all_roots(bool activate_scope,
+ ScanningOption so,
+ OopClosure* roots,
+ CLDClosure* cld_closure,
+ CodeBlobClosure* code_roots);
void process_strong_roots(bool activate_scope,
ScanningOption so,
OopClosure* roots,
- KlassClosure* klass_closure);
+ CLDClosure* cld_closure,
+ CodeBlobClosure* code_roots);
+
// Apply "root_closure" to the JNI weak roots..
void process_weak_roots(OopClosure* root_closure);
@@ -251,7 +275,7 @@ public:
virtual void gc_epilogue(bool full) = 0;
// Sets the number of parallel threads that will be doing tasks
- // (such as process strong roots) subsequently.
+ // (such as process roots) subsequently.
virtual void set_par_threads(uint t);
int n_termination();
diff --git a/hotspot/src/share/vm/memory/space.cpp b/hotspot/src/share/vm/memory/space.cpp
index 396a743ac3b..330dd3fdef9 100644
--- a/hotspot/src/share/vm/memory/space.cpp
+++ b/hotspot/src/share/vm/memory/space.cpp
@@ -685,14 +685,8 @@ size_t ContiguousSpace::block_size(const HeapWord* p) const {
// This version requires locking.
inline HeapWord* ContiguousSpace::allocate_impl(size_t size,
HeapWord* const end_value) {
- // In G1 there are places where a GC worker can allocates into a
- // region using this serial allocation code without being prone to a
- // race with other GC workers (we ensure that no other GC worker can
- // access the same region at the same time). So the assert below is
- // too strong in the case of G1.
assert(Heap_lock->owned_by_self() ||
- (SafepointSynchronize::is_at_safepoint() &&
- (Thread::current()->is_VM_thread() || UseG1GC)),
+ (SafepointSynchronize::is_at_safepoint() && Thread::current()->is_VM_thread()),
"not locked");
HeapWord* obj = top();
if (pointer_delta(end_value, obj) >= size) {
diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp
index 9d5a2a6cbae..8ea866f4dec 100644
--- a/hotspot/src/share/vm/memory/universe.cpp
+++ b/hotspot/src/share/vm/memory/universe.cpp
@@ -72,7 +72,7 @@
#include "utilities/preserveException.hpp"
#include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
-#include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
+#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
#include "gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp"
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
#include "gc_implementation/g1/g1CollectorPolicy.hpp"
@@ -802,13 +802,9 @@ jint Universe::initialize_heap() {
gc_policy = new MarkSweepPolicy();
} else if (UseConcMarkSweepGC) {
#if INCLUDE_ALL_GCS
- if (UseAdaptiveSizePolicy) {
- gc_policy = new ASConcurrentMarkSweepPolicy();
- } else {
- gc_policy = new ConcurrentMarkSweepPolicy();
- }
+ gc_policy = new ConcurrentMarkSweepPolicy();
#else // INCLUDE_ALL_GCS
- fatal("UseConcMarkSweepGC not supported in this VM.");
+ fatal("UseConcMarkSweepGC not supported in this VM.");
#endif // INCLUDE_ALL_GCS
} else { // default old generation
gc_policy = new MarkSweepPolicy();
diff --git a/hotspot/src/share/vm/oops/constantPool.cpp b/hotspot/src/share/vm/oops/constantPool.cpp
index 111d55b3af7..f26c0d4318a 100644
--- a/hotspot/src/share/vm/oops/constantPool.cpp
+++ b/hotspot/src/share/vm/oops/constantPool.cpp
@@ -520,13 +520,9 @@ bool ConstantPool::resolve_class_constants(TRAPS) {
Symbol* ConstantPool::exception_message(constantPoolHandle this_cp, int which, constantTag tag, oop pending_exception) {
// Dig out the detailed message to reuse if possible
- Symbol* message = NULL;
- oop detailed_message = java_lang_Throwable::message(pending_exception);
- if (detailed_message != NULL) {
- message = java_lang_String::as_symbol_or_null(detailed_message);
- if (message != NULL) {
- return message;
- }
+ Symbol* message = java_lang_Throwable::detail_message(pending_exception);
+ if (message != NULL) {
+ return message;
}
// Return specific message for the tag
diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp
index 91d00f8fdea..2dba59265b1 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp
@@ -245,6 +245,7 @@ InstanceKlass::InstanceKlass(int vtable_len,
set_static_oop_field_count(0);
set_nonstatic_field_size(0);
set_is_marked_dependent(false);
+ set_has_unloaded_dependent(false);
set_init_state(InstanceKlass::allocated);
set_init_thread(NULL);
set_reference_type(rt);
@@ -1801,6 +1802,9 @@ jmethodID InstanceKlass::jmethod_id_or_null(Method* method) {
return id;
}
+int nmethodBucket::decrement() {
+ return Atomic::add(-1, (volatile int *)&_count);
+}
//
// Walk the list of dependent nmethods searching for nmethods which
@@ -1815,7 +1819,7 @@ int InstanceKlass::mark_dependent_nmethods(DepChange& changes) {
nmethod* nm = b->get_nmethod();
// since dependencies aren't removed until an nmethod becomes a zombie,
// the dependency list may contain nmethods which aren't alive.
- if (nm->is_alive() && !nm->is_marked_for_deoptimization() && nm->check_dependency_on(changes)) {
+ if (b->count() > 0 && nm->is_alive() && !nm->is_marked_for_deoptimization() && nm->check_dependency_on(changes)) {
if (TraceDependencies) {
ResourceMark rm;
tty->print_cr("Marked for deoptimization");
@@ -1832,6 +1836,43 @@ int InstanceKlass::mark_dependent_nmethods(DepChange& changes) {
return found;
}
+void InstanceKlass::clean_dependent_nmethods() {
+ assert_locked_or_safepoint(CodeCache_lock);
+
+ if (has_unloaded_dependent()) {
+ nmethodBucket* b = _dependencies;
+ nmethodBucket* last = NULL;
+ while (b != NULL) {
+ assert(b->count() >= 0, err_msg("bucket count: %d", b->count()));
+
+ nmethodBucket* next = b->next();
+
+ if (b->count() == 0) {
+ if (last == NULL) {
+ _dependencies = next;
+ } else {
+ last->set_next(next);
+ }
+ delete b;
+ // last stays the same.
+ } else {
+ last = b;
+ }
+
+ b = next;
+ }
+ set_has_unloaded_dependent(false);
+ }
+#ifdef ASSERT
+ else {
+ // Verification
+ for (nmethodBucket* b = _dependencies; b != NULL; b = b->next()) {
+ assert(b->count() >= 0, err_msg("bucket count: %d", b->count()));
+ assert(b->count() != 0, "empty buckets need to be cleaned");
+ }
+ }
+#endif
+}
//
// Add an nmethodBucket to the list of dependencies for this nmethod.
@@ -1866,13 +1907,10 @@ void InstanceKlass::remove_dependent_nmethod(nmethod* nm) {
nmethodBucket* last = NULL;
while (b != NULL) {
if (nm == b->get_nmethod()) {
- if (b->decrement() == 0) {
- if (last == NULL) {
- _dependencies = b->next();
- } else {
- last->set_next(b->next());
- }
- delete b;
+ int val = b->decrement();
+ guarantee(val >= 0, err_msg("Underflow: %d", val));
+ if (val == 0) {
+ set_has_unloaded_dependent(true);
}
return;
}
@@ -1911,6 +1949,10 @@ bool InstanceKlass::is_dependent_nmethod(nmethod* nm) {
nmethodBucket* b = _dependencies;
while (b != NULL) {
if (nm == b->get_nmethod()) {
+#ifdef ASSERT
+ int count = b->count();
+ assert(count >= 0, err_msg("count shouldn't be negative: %d", count));
+#endif
return true;
}
b = b->next();
@@ -2209,7 +2251,7 @@ int InstanceKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
#endif // INCLUDE_ALL_GCS
void InstanceKlass::clean_implementors_list(BoolObjectClosure* is_alive) {
- assert(is_loader_alive(is_alive), "this klass should be live");
+ assert(class_loader_data()->is_alive(is_alive), "this klass should be live");
if (is_interface()) {
if (ClassUnloading) {
Klass* impl = implementor();
diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp
index d6c919e9462..f2904057146 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp
@@ -197,6 +197,7 @@ class InstanceKlass: public Klass {
// _is_marked_dependent can be set concurrently, thus cannot be part of the
// _misc_flags.
bool _is_marked_dependent; // used for marking during flushing and deoptimization
+ bool _has_unloaded_dependent;
enum {
_misc_rewritten = 1 << 0, // methods rewritten.
@@ -444,6 +445,9 @@ class InstanceKlass: public Klass {
bool is_marked_dependent() const { return _is_marked_dependent; }
void set_is_marked_dependent(bool value) { _is_marked_dependent = value; }
+ bool has_unloaded_dependent() const { return _has_unloaded_dependent; }
+ void set_has_unloaded_dependent(bool value) { _has_unloaded_dependent = value; }
+
// initialization (virtuals from Klass)
bool should_be_initialized() const; // means that initialize should be called
void initialize(TRAPS);
@@ -922,6 +926,7 @@ class InstanceKlass: public Klass {
void clean_implementors_list(BoolObjectClosure* is_alive);
void clean_method_data(BoolObjectClosure* is_alive);
+ void clean_dependent_nmethods();
// Explicit metaspace deallocation of fields
// For RedefineClasses and class file parsing errors, we need to deallocate
@@ -1210,7 +1215,7 @@ class nmethodBucket: public CHeapObj {
}
int count() { return _count; }
int increment() { _count += 1; return _count; }
- int decrement() { _count -= 1; assert(_count >= 0, "don't underflow"); return _count; }
+ int decrement();
nmethodBucket* next() { return _next; }
void set_next(nmethodBucket* b) { _next = b; }
nmethod* get_nmethod() { return _nmethod; }
diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp
index 77e2561258f..1df975312c7 100644
--- a/hotspot/src/share/vm/oops/klass.cpp
+++ b/hotspot/src/share/vm/oops/klass.cpp
@@ -42,6 +42,7 @@
#include "utilities/stack.hpp"
#include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
+#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
#include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
#include "gc_implementation/parallelScavenge/psScavenge.hpp"
@@ -159,7 +160,12 @@ Klass::Klass() {
_primary_supers[0] = k;
set_super_check_offset(in_bytes(primary_supers_offset()));
- set_java_mirror(NULL);
+ // The constructor is used from init_self_patching_vtbl_list,
+ // which doesn't zero out the memory before calling the constructor.
+ // Need to set the field explicitly to not hit an assert that the field
+ // should be NULL before setting it.
+ _java_mirror = NULL;
+
set_modifier_flags(0);
set_layout_helper(Klass::_lh_neutral_value);
set_name(NULL);
@@ -383,7 +389,7 @@ bool Klass::is_loader_alive(BoolObjectClosure* is_alive) {
return mirror_alive;
}
-void Klass::clean_weak_klass_links(BoolObjectClosure* is_alive) {
+void Klass::clean_weak_klass_links(BoolObjectClosure* is_alive, bool clean_alive_klasses) {
if (!ClassUnloading) {
return;
}
@@ -428,7 +434,7 @@ void Klass::clean_weak_klass_links(BoolObjectClosure* is_alive) {
}
// Clean the implementors list and method data.
- if (current->oop_is_instance()) {
+ if (clean_alive_klasses && current->oop_is_instance()) {
InstanceKlass* ik = InstanceKlass::cast(current);
ik->clean_implementors_list(is_alive);
ik->clean_method_data(is_alive);
@@ -440,12 +446,18 @@ void Klass::klass_update_barrier_set(oop v) {
record_modified_oops();
}
-void Klass::klass_update_barrier_set_pre(void* p, oop v) {
- // This barrier used by G1, where it's used remember the old oop values,
- // so that we don't forget any objects that were live at the snapshot at
- // the beginning. This function is only used when we write oops into
- // Klasses. Since the Klasses are used as roots in G1, we don't have to
- // do anything here.
+// This barrier is used by G1 to remember the old oop values, so
+// that we don't forget any objects that were live at the snapshot at
+// the beginning. This function is only used when we write oops into Klasses.
+void Klass::klass_update_barrier_set_pre(oop* p, oop v) {
+#if INCLUDE_ALL_GCS
+ if (UseG1GC) {
+ oop obj = *p;
+ if (obj != NULL) {
+ G1SATBCardTableModRefBS::enqueue(obj);
+ }
+ }
+#endif
}
void Klass::klass_oop_store(oop* p, oop v) {
@@ -456,7 +468,7 @@ void Klass::klass_oop_store(oop* p, oop v) {
if (always_do_update_barrier) {
klass_oop_store((volatile oop*)p, v);
} else {
- klass_update_barrier_set_pre((void*)p, v);
+ klass_update_barrier_set_pre(p, v);
*p = v;
klass_update_barrier_set(v);
}
@@ -466,7 +478,7 @@ void Klass::klass_oop_store(volatile oop* p, oop v) {
assert(!Universe::heap()->is_in_reserved((void*)p), "Should store pointer into metadata");
assert(v == NULL || Universe::heap()->is_in_reserved((void*)v), "Should store pointer to an object");
- klass_update_barrier_set_pre((void*)p, v);
+ klass_update_barrier_set_pre((oop*)p, v); // Cast away volatile.
OrderAccess::release_store_ptr(p, v);
klass_update_barrier_set(v);
}
diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp
index 06198fbb11c..e443dddeed8 100644
--- a/hotspot/src/share/vm/oops/klass.hpp
+++ b/hotspot/src/share/vm/oops/klass.hpp
@@ -553,7 +553,10 @@ class Klass : public Metadata {
// The is_alive closure passed in depends on the Garbage Collector used.
bool is_loader_alive(BoolObjectClosure* is_alive);
- static void clean_weak_klass_links(BoolObjectClosure* is_alive);
+ static void clean_weak_klass_links(BoolObjectClosure* is_alive, bool clean_alive_klasses = true);
+ static void clean_subklass_tree(BoolObjectClosure* is_alive) {
+ clean_weak_klass_links(is_alive, false /* clean_alive_klasses */);
+ }
// iterators
virtual int oop_oop_iterate(oop obj, ExtendedOopClosure* blk) = 0;
@@ -660,7 +663,7 @@ class Klass : public Metadata {
private:
// barriers used by klass_oop_store
void klass_update_barrier_set(oop v);
- void klass_update_barrier_set_pre(void* p, oop v);
+ void klass_update_barrier_set_pre(oop* p, oop v);
};
#endif // SHARE_VM_OOPS_KLASS_HPP
diff --git a/hotspot/src/share/vm/oops/oopsHierarchy.hpp b/hotspot/src/share/vm/oops/oopsHierarchy.hpp
index cd63547c38c..b6c12faec37 100644
--- a/hotspot/src/share/vm/oops/oopsHierarchy.hpp
+++ b/hotspot/src/share/vm/oops/oopsHierarchy.hpp
@@ -124,7 +124,7 @@ public:
operator oopDesc* () const volatile { return obj(); }
operator intptr_t* () const { return (intptr_t*)obj(); }
operator PromotedObject* () const { return (PromotedObject*)obj(); }
- operator markOop () const { return markOop(obj()); }
+ operator markOop () const volatile { return markOop(obj()); }
operator address () const { return (address)obj(); }
// from javaCalls.cpp
diff --git a/hotspot/src/share/vm/opto/callGenerator.cpp b/hotspot/src/share/vm/opto/callGenerator.cpp
index 73282119981..246446167ca 100644
--- a/hotspot/src/share/vm/opto/callGenerator.cpp
+++ b/hotspot/src/share/vm/opto/callGenerator.cpp
@@ -871,8 +871,11 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod*
Node* receiver_node = kit.argument(0);
const TypeOopPtr* receiver_type = gvn.type(receiver_node)->isa_oopptr();
// call_does_dispatch and vtable_index are out-parameters. They might be changed.
- target = C->optimize_virtual_call(caller, jvms->bci(), klass, target, receiver_type,
- is_virtual,
+ // optimize_virtual_call() takes 2 different holder
+ // arguments for a corner case that doesn't apply here (see
+ // Parse::do_call())
+ target = C->optimize_virtual_call(caller, jvms->bci(), klass, klass,
+ target, receiver_type, is_virtual,
call_does_dispatch, vtable_index); // out-parameters
// We lack profiling at this call but type speculation may
// provide us with a type
diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp
index 86f566c5877..585f9315241 100644
--- a/hotspot/src/share/vm/opto/compile.cpp
+++ b/hotspot/src/share/vm/opto/compile.cpp
@@ -29,6 +29,7 @@
#include "classfile/systemDictionary.hpp"
#include "code/exceptionHandlerTable.hpp"
#include "code/nmethod.hpp"
+#include "compiler/compileBroker.hpp"
#include "compiler/compileLog.hpp"
#include "compiler/disassembler.hpp"
#include "compiler/oopMap.hpp"
@@ -534,6 +535,7 @@ void Compile::init_scratch_buffer_blob(int const_size) {
if (scratch_buffer_blob() == NULL) {
// Let CompilerBroker disable further compilations.
record_failure("Not enough space for scratch buffer in CodeCache");
+ CompileBroker::handle_full_code_cache();
return;
}
}
diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp
index 7d7dd653aaa..29380e1f898 100644
--- a/hotspot/src/share/vm/opto/compile.hpp
+++ b/hotspot/src/share/vm/opto/compile.hpp
@@ -852,8 +852,8 @@ class Compile : public Phase {
// Helper functions to identify inlining potential at call-site
ciMethod* optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKlass* klass,
- ciMethod* callee, const TypeOopPtr* receiver_type,
- bool is_virtual,
+ ciKlass* holder, ciMethod* callee,
+ const TypeOopPtr* receiver_type, bool is_virtual,
bool &call_does_dispatch, int &vtable_index);
ciMethod* optimize_inlining(ciMethod* caller, int bci, ciInstanceKlass* klass,
ciMethod* callee, const TypeOopPtr* receiver_type);
diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp
index 72dc6b8a79c..62eb88460f1 100644
--- a/hotspot/src/share/vm/opto/doCall.cpp
+++ b/hotspot/src/share/vm/opto/doCall.cpp
@@ -468,8 +468,14 @@ void Parse::do_call() {
Node* receiver_node = stack(sp() - nargs);
const TypeOopPtr* receiver_type = _gvn.type(receiver_node)->isa_oopptr();
// call_does_dispatch and vtable_index are out-parameters. They might be changed.
- callee = C->optimize_virtual_call(method(), bci(), klass, orig_callee, receiver_type,
- is_virtual,
+ // For arrays, klass below is Object. When vtable calls are used,
+ // resolving the call with Object would allow an illegal call to
+ // finalize() on an array. We use holder instead: illegal calls to
+ // finalize() won't be compiled as vtable calls (IC call
+ // resolution will catch the illegal call) and the few legal calls
+ // on array types won't be either.
+ callee = C->optimize_virtual_call(method(), bci(), klass, holder, orig_callee,
+ receiver_type, is_virtual,
call_does_dispatch, vtable_index); // out-parameters
speculative_receiver_type = receiver_type != NULL ? receiver_type->speculative_type() : NULL;
}
@@ -940,8 +946,8 @@ void Parse::count_compiled_calls(bool at_method_entry, bool is_inline) {
ciMethod* Compile::optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKlass* klass,
- ciMethod* callee, const TypeOopPtr* receiver_type,
- bool is_virtual,
+ ciKlass* holder, ciMethod* callee,
+ const TypeOopPtr* receiver_type, bool is_virtual,
bool& call_does_dispatch, int& vtable_index) {
// Set default values for out-parameters.
call_does_dispatch = true;
@@ -956,7 +962,7 @@ ciMethod* Compile::optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKl
call_does_dispatch = false;
} else if (!UseInlineCaches && is_virtual && callee->is_loaded()) {
// We can make a vtable call at this site
- vtable_index = callee->resolve_vtable_index(caller->holder(), klass);
+ vtable_index = callee->resolve_vtable_index(caller->holder(), holder);
}
return callee;
}
@@ -979,8 +985,10 @@ ciMethod* Compile::optimize_inlining(ciMethod* caller, int bci, ciInstanceKlass*
ciInstanceKlass* actual_receiver = klass;
if (receiver_type != NULL) {
// Array methods are all inherited from Object, and are monomorphic.
+ // finalize() call on array is not allowed.
if (receiver_type->isa_aryptr() &&
- callee->holder() == env()->Object_klass()) {
+ callee->holder() == env()->Object_klass() &&
+ callee->name() != ciSymbol::finalize_method_name()) {
return callee;
}
diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp
index d6768a7fdf8..dac317cad9b 100644
--- a/hotspot/src/share/vm/opto/output.cpp
+++ b/hotspot/src/share/vm/opto/output.cpp
@@ -1165,6 +1165,7 @@ CodeBuffer* Compile::init_buffer(uint* blk_starts) {
// Have we run out of code space?
if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
C->record_failure("CodeCache is full");
+ CompileBroker::handle_full_code_cache();
return NULL;
}
// Configure the code buffer.
@@ -1489,6 +1490,7 @@ void Compile::fill_buffer(CodeBuffer* cb, uint* blk_starts) {
cb->insts()->maybe_expand_to_ensure_remaining(MAX_inst_size);
if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
C->record_failure("CodeCache is full");
+ CompileBroker::handle_full_code_cache();
return;
}
@@ -1645,6 +1647,7 @@ void Compile::fill_buffer(CodeBuffer* cb, uint* blk_starts) {
// One last check for failed CodeBuffer::expand:
if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) {
C->record_failure("CodeCache is full");
+ CompileBroker::handle_full_code_cache();
return;
}
diff --git a/hotspot/src/share/vm/opto/parse.hpp b/hotspot/src/share/vm/opto/parse.hpp
index fe941c07298..34c4eb4b045 100644
--- a/hotspot/src/share/vm/opto/parse.hpp
+++ b/hotspot/src/share/vm/opto/parse.hpp
@@ -557,8 +557,9 @@ class Parse : public GraphKit {
float dynamic_branch_prediction(float &cnt);
float branch_prediction(float &cnt, BoolTest::mask btest, int target_bci);
- bool seems_never_taken(float prob);
- bool seems_stable_comparison(BoolTest::mask btest, Node* c);
+ bool seems_never_taken(float prob) const;
+ bool path_is_suitable_for_uncommon_trap(float prob) const;
+ bool seems_stable_comparison() const;
void do_ifnull(BoolTest::mask btest, Node* c);
void do_if(BoolTest::mask btest, Node* c);
diff --git a/hotspot/src/share/vm/opto/parse2.cpp b/hotspot/src/share/vm/opto/parse2.cpp
index 15826863ee5..7ed28ea1d45 100644
--- a/hotspot/src/share/vm/opto/parse2.cpp
+++ b/hotspot/src/share/vm/opto/parse2.cpp
@@ -886,7 +886,7 @@ float Parse::branch_prediction(float& cnt,
// some branches (e.g., _213_javac.Assembler.eliminate) validly produce
// very small but nonzero probabilities, which if confused with zero
// counts would keep the program recompiling indefinitely.
-bool Parse::seems_never_taken(float prob) {
+bool Parse::seems_never_taken(float prob) const {
return prob < PROB_MIN;
}
@@ -898,7 +898,7 @@ bool Parse::seems_never_taken(float prob) {
// already acting in a stable fashion. If the comparison
// seems stable, we will put an expensive uncommon trap
// on the untaken path.
-bool Parse::seems_stable_comparison(BoolTest::mask btest, Node* cmp) {
+bool Parse::seems_stable_comparison() const {
if (C->too_many_traps(method(), bci(), Deoptimization::Reason_unstable_if)) {
return false;
}
@@ -1127,6 +1127,14 @@ void Parse::do_if(BoolTest::mask btest, Node* c) {
}
}
+bool Parse::path_is_suitable_for_uncommon_trap(float prob) const {
+ // Don't want to speculate on uncommon traps when running with -Xcomp
+ if (!UseInterpreter) {
+ return false;
+ }
+ return (seems_never_taken(prob) && seems_stable_comparison());
+}
+
//----------------------------adjust_map_after_if------------------------------
// Adjust the JVM state to reflect the result of taking this path.
// Basically, it means inspecting the CmpNode controlling this
@@ -1140,7 +1148,7 @@ void Parse::adjust_map_after_if(BoolTest::mask btest, Node* c, float prob,
bool is_fallthrough = (path == successor_for_bci(iter().next_bci()));
- if (seems_never_taken(prob) && seems_stable_comparison(btest, c)) {
+ if (path_is_suitable_for_uncommon_trap(prob)) {
repush_if_args();
uncommon_trap(Deoptimization::Reason_unstable_if,
Deoptimization::Action_reinterpret,
diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp
index 135a6318e7c..b1b38c948cc 100644
--- a/hotspot/src/share/vm/prims/jni.cpp
+++ b/hotspot/src/share/vm/prims/jni.cpp
@@ -247,15 +247,6 @@ void jfieldIDWorkaround::verify_instance_jfieldID(Klass* k, jfieldID id) {
"Bug in native code: jfieldID offset must address interior of object");
}
-// Pick a reasonable higher bound for local capacity requested
-// for EnsureLocalCapacity and PushLocalFrame. We don't want it too
-// high because a test (or very unusual application) may try to allocate
-// that many handles and run out of swap space. An implementation is
-// permitted to allocate more handles than the ensured capacity, so this
-// value is set high enough to prevent compatibility problems.
-const int MAX_REASONABLE_LOCAL_CAPACITY = 4*K;
-
-
// Wrapper to trace JNI functions
#ifdef ASSERT
@@ -741,7 +732,8 @@ JNI_ENTRY(jint, jni_PushLocalFrame(JNIEnv *env, jint capacity))
HOTSPOT_JNI_PUSHLOCALFRAME_ENTRY(env, capacity);
//%note jni_11
- if (capacity < 0 || capacity > MAX_REASONABLE_LOCAL_CAPACITY) {
+ if (capacity < 0 ||
+ ((MaxJNILocalCapacity > 0) && (capacity > MaxJNILocalCapacity))) {
HOTSPOT_JNI_PUSHLOCALFRAME_RETURN((uint32_t)JNI_ERR);
return JNI_ERR;
}
@@ -844,7 +836,8 @@ JNI_LEAF(jint, jni_EnsureLocalCapacity(JNIEnv *env, jint capacity))
HOTSPOT_JNI_ENSURELOCALCAPACITY_ENTRY(env, capacity);
jint ret;
- if (capacity >= 0 && capacity <= MAX_REASONABLE_LOCAL_CAPACITY) {
+ if (capacity >= 0 &&
+ ((MaxJNILocalCapacity <= 0) || (capacity <= MaxJNILocalCapacity))) {
ret = JNI_OK;
} else {
ret = JNI_ERR;
@@ -3325,7 +3318,7 @@ static bool initializeDirectBufferSupport(JNIEnv* env, JavaThread* thread) {
directBufferSupportInitializeEnded = 1;
} else {
while (!directBufferSupportInitializeEnded && !directBufferSupportInitializeFailed) {
- os::yield();
+ os::naked_yield();
}
}
diff --git a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp
index 73a2965004e..1de4f021017 100644
--- a/hotspot/src/share/vm/prims/jniCheck.cpp
+++ b/hotspot/src/share/vm/prims/jniCheck.cpp
@@ -170,6 +170,9 @@ static void NativeReportJNIWarning(JavaThread* thr, const char *msg) {
* throw an ArrayIndexOutOfBoundsException or ArrayStoreException.
*
* In all other cases, a non-error return value guarantees that no exceptions have been thrown.
+ *
+ * Programmers often defend against ArrayIndexOutOfBoundsException, so warning
+ * for these functions would be pedantic.
*/
static inline void
check_pending_exception(JavaThread* thr) {
@@ -186,6 +189,16 @@ check_pending_exception(JavaThread* thr) {
}
}
+/**
+ * Add to the planned number of handles. I.e. plus current live & warning threshold
+ */
+static inline void
+add_planned_handle_capacity(JNIHandleBlock* handles, size_t capacity) {
+ handles->set_planned_capacity(capacity +
+ handles->get_number_of_live_handles() +
+ CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD);
+}
+
static inline void
functionEnterCritical(JavaThread* thr)
@@ -228,7 +241,7 @@ functionExit(JavaThread* thr)
thr->print_stack();
)
// Complain just the once, reset to current + warn threshold
- handles->set_planned_capacity(live_handles + CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD);
+ add_planned_handle_capacity(handles, 0);
}
}
@@ -705,7 +718,7 @@ JNI_ENTRY_CHECKED(jint,
NativeReportJNIFatalError(thr, "negative capacity");
jint result = UNCHECKED()->PushLocalFrame(env, capacity);
if (result == JNI_OK) {
- thr->active_handles()->set_planned_capacity(capacity + CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD);
+ add_planned_handle_capacity(thr->active_handles(), capacity);
}
functionExit(thr);
return result;
@@ -809,7 +822,7 @@ JNI_ENTRY_CHECKED(jint,
}
jint result = UNCHECKED()->EnsureLocalCapacity(env, capacity);
if (result == JNI_OK) {
- thr->active_handles()->set_planned_capacity(capacity + CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD);
+ add_planned_handle_capacity(thr->active_handles(), capacity);
}
functionExit(thr);
return result;
@@ -1613,7 +1626,6 @@ JNI_ENTRY_CHECKED(jobject,
check_is_obj_array(thr, array);
)
jobject result = UNCHECKED()->GetObjectArrayElement(env,array,index);
- thr->set_pending_jni_exception_check("GetObjectArrayElement");
functionExit(thr);
return result;
JNI_END
@@ -1628,7 +1640,6 @@ JNI_ENTRY_CHECKED(void,
check_is_obj_array(thr, array);
)
UNCHECKED()->SetObjectArrayElement(env,array,index,val);
- thr->set_pending_jni_exception_check("SetObjectArrayElement");
functionExit(thr);
JNI_END
@@ -1718,7 +1729,6 @@ JNI_ENTRY_CHECKED(void, \
check_primitive_array_type(thr, array, ElementTag); \
) \
UNCHECKED()->Get##Result##ArrayRegion(env,array,start,len,buf); \
- thr->set_pending_jni_exception_check("Get"#Result"ArrayRegion"); \
functionExit(thr); \
JNI_END
@@ -1743,7 +1753,6 @@ JNI_ENTRY_CHECKED(void, \
check_primitive_array_type(thr, array, ElementTag); \
) \
UNCHECKED()->Set##Result##ArrayRegion(env,array,start,len,buf); \
- thr->set_pending_jni_exception_check("Set"#Result"ArrayRegion"); \
functionExit(thr); \
JNI_END
@@ -1820,7 +1829,6 @@ JNI_ENTRY_CHECKED(void,
checkString(thr, str);
)
UNCHECKED()->GetStringRegion(env, str, start, len, buf);
- thr->set_pending_jni_exception_check("GetStringRegion");
functionExit(thr);
JNI_END
@@ -1835,7 +1843,6 @@ JNI_ENTRY_CHECKED(void,
checkString(thr, str);
)
UNCHECKED()->GetStringUTFRegion(env, str, start, len, buf);
- thr->set_pending_jni_exception_check("GetStringUTFRegion");
functionExit(thr);
JNI_END
diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp
index 6e03e784952..1970d715ebc 100644
--- a/hotspot/src/share/vm/prims/jvm.cpp
+++ b/hotspot/src/share/vm/prims/jvm.cpp
@@ -3043,7 +3043,7 @@ JVM_ENTRY(void, JVM_Yield(JNIEnv *env, jclass threadClass))
if (ConvertYieldToSleep) {
os::sleep(thread, MinSleepInterval, false);
} else {
- os::yield();
+ os::naked_yield();
}
JVM_END
@@ -3073,7 +3073,7 @@ JVM_ENTRY(void, JVM_Sleep(JNIEnv* env, jclass threadClass, jlong millis))
// It appears that in certain GUI contexts, it may be beneficial to do a short sleep
// for SOLARIS
if (ConvertSleepToYield) {
- os::yield();
+ os::naked_yield();
} else {
ThreadState old_state = thread->osthread()->get_state();
thread->osthread()->set_state(SLEEPING);
diff --git a/hotspot/src/share/vm/prims/jvmtiImpl.cpp b/hotspot/src/share/vm/prims/jvmtiImpl.cpp
index 328e9d869af..55aec25613e 100644
--- a/hotspot/src/share/vm/prims/jvmtiImpl.cpp
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.cpp
@@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "classfile/systemDictionary.hpp"
#include "interpreter/interpreter.hpp"
+#include "interpreter/oopMapCache.hpp"
#include "jvmtifiles/jvmtiEnv.hpp"
#include "memory/resourceArea.hpp"
#include "oops/instanceKlass.hpp"
@@ -744,6 +745,13 @@ bool VM_GetOrSetLocal::doit_prologue() {
}
void VM_GetOrSetLocal::doit() {
+ InterpreterOopMap oop_mask;
+ _jvf->method()->mask_for(_jvf->bci(), &oop_mask);
+ if (oop_mask.is_dead(_index)) {
+ // The local can be invalid and uninitialized in the scope of current bci
+ _result = JVMTI_ERROR_INVALID_SLOT;
+ return;
+ }
if (_set) {
// Force deoptimization of frame if compiled because it's
// possible the compiler emitted some locals as constant values,
diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp
index 70e9a98e30a..89680d13ea6 100644
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp
@@ -3020,7 +3020,7 @@ inline bool VM_HeapWalkOperation::collect_simple_roots() {
// If there are any non-perm roots in the code cache, visit them.
blk.set_kind(JVMTI_HEAP_REFERENCE_OTHER);
- CodeBlobToOopClosure look_in_blobs(&blk, false);
+ CodeBlobToOopClosure look_in_blobs(&blk, !CodeBlobToOopClosure::FixRelocations);
CodeCache::scavenge_root_nmethods_do(&look_in_blobs);
return true;
diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp
index 683ac097c3f..e6805b12e5b 100644
--- a/hotspot/src/share/vm/prims/whitebox.cpp
+++ b/hotspot/src/share/vm/prims/whitebox.cpp
@@ -25,7 +25,7 @@
#include "precompiled.hpp"
#include "code/codeCache.hpp"
-
+#include "memory/metadataFactory.hpp"
#include "memory/universe.hpp"
#include "oops/oop.inline.hpp"
@@ -41,6 +41,7 @@
#include "runtime/os.hpp"
#include "runtime/vm_version.hpp"
+#include "utilities/array.hpp"
#include "utilities/debug.hpp"
#include "utilities/macros.hpp"
#include "utilities/exceptions.hpp"
@@ -729,7 +730,6 @@ WB_ENTRY(jobjectArray, WB_GetNMethod(JNIEnv* env, jobject o, jobject method, jbo
return result;
WB_END
-
WB_ENTRY(jlong, WB_GetThreadStackSize(JNIEnv* env, jobject o))
return (jlong) Thread::current()->stack_size();
WB_END
@@ -739,6 +739,35 @@ WB_ENTRY(jlong, WB_GetThreadRemainingStackSize(JNIEnv* env, jobject o))
return (jlong) t->stack_available(os::current_stack_pointer()) - (jlong) StackShadowPages * os::vm_page_size();
WB_END
+int WhiteBox::array_bytes_to_length(size_t bytes) {
+ return Array::bytes_to_length(bytes);
+}
+
+WB_ENTRY(jlong, WB_AllocateMetaspace(JNIEnv* env, jobject wb, jobject class_loader, jlong size))
+ if (size < 0) {
+ THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
+ err_msg("WB_AllocateMetaspace: size is negative: " JLONG_FORMAT, size));
+ }
+
+ oop class_loader_oop = JNIHandles::resolve(class_loader);
+ ClassLoaderData* cld = class_loader_oop != NULL
+ ? java_lang_ClassLoader::loader_data(class_loader_oop)
+ : ClassLoaderData::the_null_class_loader_data();
+
+ void* metadata = MetadataFactory::new_writeable_array(cld, WhiteBox::array_bytes_to_length((size_t)size), thread);
+
+ return (jlong)(uintptr_t)metadata;
+WB_END
+
+WB_ENTRY(void, WB_FreeMetaspace(JNIEnv* env, jobject wb, jobject class_loader, jlong addr, jlong size))
+ oop class_loader_oop = JNIHandles::resolve(class_loader);
+ ClassLoaderData* cld = class_loader_oop != NULL
+ ? java_lang_ClassLoader::loader_data(class_loader_oop)
+ : ClassLoaderData::the_null_class_loader_data();
+
+ MetadataFactory::free_array(cld, (Array*)(uintptr_t)addr);
+WB_END
+
//Some convenience methods to deal with objects from java
int WhiteBox::offset_for_field(const char* field_name, oop object,
Symbol* signature_symbol) {
@@ -869,6 +898,10 @@ static JNINativeMethod methods[] = {
{CC"isInStringTable", CC"(Ljava/lang/String;)Z", (void*)&WB_IsInStringTable },
{CC"fullGC", CC"()V", (void*)&WB_FullGC },
{CC"readReservedMemory", CC"()V", (void*)&WB_ReadReservedMemory },
+ {CC"allocateMetaspace",
+ CC"(Ljava/lang/ClassLoader;J)J", (void*)&WB_AllocateMetaspace },
+ {CC"freeMetaspace",
+ CC"(Ljava/lang/ClassLoader;JJ)V", (void*)&WB_FreeMetaspace },
{CC"getCPUFeatures", CC"()Ljava/lang/String;", (void*)&WB_GetCPUFeatures },
{CC"getNMethod", CC"(Ljava/lang/reflect/Executable;Z)[Ljava/lang/Object;",
(void*)&WB_GetNMethod },
diff --git a/hotspot/src/share/vm/prims/whitebox.hpp b/hotspot/src/share/vm/prims/whitebox.hpp
index a9854f3ffea..9ab406fc672 100644
--- a/hotspot/src/share/vm/prims/whitebox.hpp
+++ b/hotspot/src/share/vm/prims/whitebox.hpp
@@ -62,6 +62,8 @@ class WhiteBox : public AllStatic {
Symbol* signature_symbol);
static const char* lookup_jstring(const char* field_name, oop object);
static bool lookup_bool(const char* field_name, oop object);
+
+ static int array_bytes_to_length(size_t bytes);
};
diff --git a/hotspot/src/share/vm/runtime/atomic.hpp b/hotspot/src/share/vm/runtime/atomic.hpp
index b2b56171362..52e122fce48 100644
--- a/hotspot/src/share/vm/runtime/atomic.hpp
+++ b/hotspot/src/share/vm/runtime/atomic.hpp
@@ -35,6 +35,18 @@ class Atomic : AllStatic {
// can provide an alternative action if not - see supports_cx8() for
// a means to test availability.
+ // The memory operations that are mentioned with each of the atomic
+ // function families come from src/share/vm/runtime/orderAccess.hpp,
+ // e.g., is described in that file and is implemented by the
+ // OrderAccess::fence() function. See that file for the gory details
+ // on the Memory Access Ordering Model.
+
+ // All of the atomic operations that imply a read-modify-write action
+ // guarantee a two-way memory barrier across that operation. Historically
+ // these semantics reflect the strength of atomic operations that are
+ // provided on SPARC/X86. We assume that strength is necessary unless
+ // we can prove that a weaker form is sufficiently safe.
+
// Atomically store to a location
inline static void store (jbyte store_value, jbyte* dest);
inline static void store (jshort store_value, jshort* dest);
@@ -55,7 +67,8 @@ class Atomic : AllStatic {
// See comment above about using jlong atomics on 32-bit platforms
inline static jlong load(volatile jlong* src);
- // Atomically add to a location, return updated value
+ // Atomically add to a location. Returns updated value. add*() provide:
+ // add-value-to-dest
inline static jint add (jint add_value, volatile jint* dest);
inline static size_t add (size_t add_value, volatile size_t* dest);
inline static intptr_t add_ptr(intptr_t add_value, volatile intptr_t* dest);
@@ -63,30 +76,35 @@ class Atomic : AllStatic {
// See comment above about using jlong atomics on 32-bit platforms
static jlong add (jlong add_value, volatile jlong* dest);
- // Atomically increment location
+ // Atomically increment location. inc*() provide:
+ // increment-dest
inline static void inc (volatile jint* dest);
static void inc (volatile jshort* dest);
inline static void inc (volatile size_t* dest);
inline static void inc_ptr(volatile intptr_t* dest);
inline static void inc_ptr(volatile void* dest);
- // Atomically decrement a location
+ // Atomically decrement a location. dec*() provide:
+ // decrement-dest
inline static void dec (volatile jint* dest);
static void dec (volatile jshort* dest);
inline static void dec (volatile size_t* dest);
inline static void dec_ptr(volatile intptr_t* dest);
inline static void dec_ptr(volatile void* dest);
- // Performs atomic exchange of *dest with exchange_value. Returns old prior value of *dest.
+ // Performs atomic exchange of *dest with exchange_value. Returns old
+ // prior value of *dest. xchg*() provide:
+ // exchange-value-with-dest
inline static jint xchg(jint exchange_value, volatile jint* dest);
static unsigned int xchg(unsigned int exchange_value, volatile unsigned int* dest);
inline static intptr_t xchg_ptr(intptr_t exchange_value, volatile intptr_t* dest);
inline static void* xchg_ptr(void* exchange_value, volatile void* dest);
- // Performs atomic compare of *dest and compare_value, and exchanges *dest with exchange_value
- // if the comparison succeeded. Returns prior value of *dest. Guarantees a two-way memory
- // barrier across the cmpxchg. I.e., it's really a 'fence_cmpxchg_acquire'.
+ // Performs atomic compare of *dest and compare_value, and exchanges
+ // *dest with exchange_value if the comparison succeeded. Returns prior
+ // value of *dest. cmpxchg*() provide:
+ // compare-and-exchange
static jbyte cmpxchg (jbyte exchange_value, volatile jbyte* dest, jbyte compare_value);
inline static jint cmpxchg (jint exchange_value, volatile jint* dest, jint compare_value);
// See comment above about using jlong atomics on 32-bit platforms
diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp
index 56cafb65600..2d1805e2fb6 100644
--- a/hotspot/src/share/vm/runtime/globals.hpp
+++ b/hotspot/src/share/vm/runtime/globals.hpp
@@ -1130,29 +1130,30 @@ class CommandLineFlags {
"Use LWP-based instead of libthread-based synchronization " \
"(SPARC only)") \
\
- product(ccstr, SyncKnobs, NULL, \
- "(Unstable) Various monitor synchronization tunables") \
+ experimental(ccstr, SyncKnobs, NULL, \
+ "(Unstable) Various monitor synchronization tunables") \
\
- product(intx, EmitSync, 0, \
- "(Unsafe, Unstable) " \
- "Control emission of inline sync fast-path code") \
+ experimental(intx, EmitSync, 0, \
+ "(Unsafe, Unstable) " \
+ "Control emission of inline sync fast-path code") \
\
product(intx, MonitorBound, 0, "Bound Monitor population") \
\
product(bool, MonitorInUseLists, false, "Track Monitors for Deflation") \
\
- product(intx, SyncFlags, 0, "(Unsafe, Unstable) Experimental Sync flags") \
+ experimental(intx, SyncFlags, 0, "(Unsafe, Unstable) " \
+ "Experimental Sync flags") \
\
- product(intx, SyncVerbose, 0, "(Unstable)") \
+ experimental(intx, SyncVerbose, 0, "(Unstable)") \
\
- product(intx, ClearFPUAtPark, 0, "(Unsafe, Unstable)") \
+ experimental(intx, ClearFPUAtPark, 0, "(Unsafe, Unstable)") \
\
- product(intx, hashCode, 5, \
- "(Unstable) select hashCode generation algorithm") \
+ experimental(intx, hashCode, 5, \
+ "(Unstable) select hashCode generation algorithm") \
\
- product(intx, WorkAroundNPTLTimedWaitHang, 1, \
- "(Unstable, Linux-specific) " \
- "avoid NPTL-FUTEX hang pthread_cond_timedwait") \
+ experimental(intx, WorkAroundNPTLTimedWaitHang, 1, \
+ "(Unstable, Linux-specific) " \
+ "avoid NPTL-FUTEX hang pthread_cond_timedwait") \
\
product(bool, FilterSpuriousWakeups, true, \
"When true prevents OS-level spurious, or premature, wakeups " \
@@ -1215,6 +1216,11 @@ class CommandLineFlags {
product(bool, UseFastJNIAccessors, true, \
"Use optimized versions of GetField") \
\
+ product(intx, MaxJNILocalCapacity, 65536, \
+ "Maximum allowable local JNI handle capacity to " \
+ "EnsureLocalCapacity() and PushLocalFrame(), " \
+ "where <= 0 is unlimited, default: 65536") \
+ \
product(bool, EagerXrunInit, false, \
"Eagerly initialize -Xrun libraries; allows startup profiling, " \
"but not all -Xrun libraries may support the state of the VM " \
diff --git a/hotspot/src/share/vm/runtime/icache.cpp b/hotspot/src/share/vm/runtime/icache.cpp
index 02ac795b372..02f36d54d6c 100644
--- a/hotspot/src/share/vm/runtime/icache.cpp
+++ b/hotspot/src/share/vm/runtime/icache.cpp
@@ -34,6 +34,9 @@ void AbstractICache::initialize() {
ResourceMark rm;
BufferBlob* b = BufferBlob::create("flush_icache_stub", ICache::stub_size);
+ if (b == NULL) {
+ vm_exit_out_of_memory(ICache::stub_size, OOM_MALLOC_ERROR, "CodeCache: no space for flush_icache_stub");
+ }
CodeBuffer c(b);
ICacheStubGenerator g(&c);
diff --git a/hotspot/src/share/vm/runtime/mutex.cpp b/hotspot/src/share/vm/runtime/mutex.cpp
index f903c00291c..aa10bfbc761 100644
--- a/hotspot/src/share/vm/runtime/mutex.cpp
+++ b/hotspot/src/share/vm/runtime/mutex.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -488,7 +487,6 @@ void Monitor::ILock (Thread * Self) {
for (;;) {
assert(_OnDeck == ESelf, "invariant");
if (TrySpin(Self)) break;
- // CONSIDER: if ESelf->TryPark() && TryLock() break ...
// It's probably wise to spin only if we *actually* blocked
// CONSIDER: check the lockbyte, if it remains set then
// preemptively drain the cxq into the EntryList.
diff --git a/hotspot/src/share/vm/runtime/objectMonitor.cpp b/hotspot/src/share/vm/runtime/objectMonitor.cpp
index 9480de55e3d..d763a84e07b 100644
--- a/hotspot/src/share/vm/runtime/objectMonitor.cpp
+++ b/hotspot/src/share/vm/runtime/objectMonitor.cpp
@@ -46,9 +46,9 @@
#if defined(__GNUC__) && !defined(IA64) && !defined(PPC64)
// Need to inhibit inlining for older versions of GCC to avoid build-time failures
- #define ATTR __attribute__((noinline))
+ #define NOINLINE __attribute__((noinline))
#else
- #define ATTR
+ #define NOINLINE
#endif
@@ -103,38 +103,39 @@
// The knob* variables are effectively final. Once set they should
// never be modified hence. Consider using __read_mostly with GCC.
-int ObjectMonitor::Knob_Verbose = 0;
-int ObjectMonitor::Knob_SpinLimit = 5000; // derived by an external tool -
-static int Knob_LogSpins = 0; // enable jvmstat tally for spins
-static int Knob_HandOff = 0;
-static int Knob_ReportSettings = 0;
+int ObjectMonitor::Knob_Verbose = 0;
+int ObjectMonitor::Knob_VerifyInUse = 0;
+int ObjectMonitor::Knob_SpinLimit = 5000; // derived by an external tool -
+static int Knob_LogSpins = 0; // enable jvmstat tally for spins
+static int Knob_HandOff = 0;
+static int Knob_ReportSettings = 0;
-static int Knob_SpinBase = 0; // Floor AKA SpinMin
-static int Knob_SpinBackOff = 0; // spin-loop backoff
-static int Knob_CASPenalty = -1; // Penalty for failed CAS
-static int Knob_OXPenalty = -1; // Penalty for observed _owner change
-static int Knob_SpinSetSucc = 1; // spinners set the _succ field
-static int Knob_SpinEarly = 1;
-static int Knob_SuccEnabled = 1; // futile wake throttling
-static int Knob_SuccRestrict = 0; // Limit successors + spinners to at-most-one
-static int Knob_MaxSpinners = -1; // Should be a function of # CPUs
-static int Knob_Bonus = 100; // spin success bonus
-static int Knob_BonusB = 100; // spin success bonus
-static int Knob_Penalty = 200; // spin failure penalty
-static int Knob_Poverty = 1000;
-static int Knob_SpinAfterFutile = 1; // Spin after returning from park()
-static int Knob_FixedSpin = 0;
-static int Knob_OState = 3; // Spinner checks thread state of _owner
-static int Knob_UsePause = 1;
-static int Knob_ExitPolicy = 0;
-static int Knob_PreSpin = 10; // 20-100 likely better
-static int Knob_ResetEvent = 0;
-static int BackOffMask = 0;
+static int Knob_SpinBase = 0; // Floor AKA SpinMin
+static int Knob_SpinBackOff = 0; // spin-loop backoff
+static int Knob_CASPenalty = -1; // Penalty for failed CAS
+static int Knob_OXPenalty = -1; // Penalty for observed _owner change
+static int Knob_SpinSetSucc = 1; // spinners set the _succ field
+static int Knob_SpinEarly = 1;
+static int Knob_SuccEnabled = 1; // futile wake throttling
+static int Knob_SuccRestrict = 0; // Limit successors + spinners to at-most-one
+static int Knob_MaxSpinners = -1; // Should be a function of # CPUs
+static int Knob_Bonus = 100; // spin success bonus
+static int Knob_BonusB = 100; // spin success bonus
+static int Knob_Penalty = 200; // spin failure penalty
+static int Knob_Poverty = 1000;
+static int Knob_SpinAfterFutile = 1; // Spin after returning from park()
+static int Knob_FixedSpin = 0;
+static int Knob_OState = 3; // Spinner checks thread state of _owner
+static int Knob_UsePause = 1;
+static int Knob_ExitPolicy = 0;
+static int Knob_PreSpin = 10; // 20-100 likely better
+static int Knob_ResetEvent = 0;
+static int BackOffMask = 0;
-static int Knob_FastHSSEC = 0;
-static int Knob_MoveNotifyee = 2; // notify() - disposition of notifyee
-static int Knob_QMode = 0; // EntryList-cxq policy - queue discipline
-static volatile int InitDone = 0;
+static int Knob_FastHSSEC = 0;
+static int Knob_MoveNotifyee = 2; // notify() - disposition of notifyee
+static int Knob_QMode = 0; // EntryList-cxq policy - queue discipline
+static volatile int InitDone = 0;
#define TrySpin TrySpin_VaryDuration
@@ -199,7 +200,7 @@ static volatile int InitDone = 0;
// on EntryList|cxq. That is, spinning relieves contention on the "inner"
// locks and monitor metadata.
//
-// Cxq points to the the set of Recently Arrived Threads attempting entry.
+// Cxq points to the set of Recently Arrived Threads attempting entry.
// Because we push threads onto _cxq with CAS, the RATs must take the form of
// a singly-linked LIFO. We drain _cxq into EntryList at unlock-time when
// the unlocking thread notices that EntryList is null but _cxq is != null.
@@ -269,13 +270,12 @@ bool ObjectMonitor::try_enter(Thread* THREAD) {
}
}
-void ATTR ObjectMonitor::enter(TRAPS) {
+void NOINLINE ObjectMonitor::enter(TRAPS) {
// The following code is ordered to check the most common cases first
// and to reduce RTS->RTO cache line upgrades on SPARC and IA32 processors.
Thread * const Self = THREAD;
- void * cur;
- cur = Atomic::cmpxchg_ptr(Self, &_owner, NULL);
+ void * cur = Atomic::cmpxchg_ptr (Self, &_owner, NULL);
if (cur == NULL) {
// Either ASSERT _recursions == 0 or explicitly set _recursions = 0.
assert(_recursions == 0 , "invariant");
@@ -435,26 +435,24 @@ void ATTR ObjectMonitor::enter(TRAPS) {
// Callers must compensate as needed.
int ObjectMonitor::TryLock (Thread * Self) {
- for (;;) {
- void * own = _owner;
- if (own != NULL) return 0;
- if (Atomic::cmpxchg_ptr (Self, &_owner, NULL) == NULL) {
- // Either guarantee _recursions == 0 or set _recursions = 0.
- assert(_recursions == 0, "invariant");
- assert(_owner == Self, "invariant");
- // CONSIDER: set or assert that OwnerIsThread == 1
- return 1;
- }
- // The lock had been free momentarily, but we lost the race to the lock.
- // Interference -- the CAS failed.
- // We can either return -1 or retry.
- // Retry doesn't make as much sense because the lock was just acquired.
- if (true) return -1;
- }
+ void * own = _owner;
+ if (own != NULL) return 0;
+ if (Atomic::cmpxchg_ptr (Self, &_owner, NULL) == NULL) {
+ // Either guarantee _recursions == 0 or set _recursions = 0.
+ assert(_recursions == 0, "invariant");
+ assert(_owner == Self, "invariant");
+ // CONSIDER: set or assert that OwnerIsThread == 1
+ return 1;
+ }
+ // The lock had been free momentarily, but we lost the race to the lock.
+ // Interference -- the CAS failed.
+ // We can either return -1 or retry.
+ // Retry doesn't make as much sense because the lock was just acquired.
+ return -1;
}
-void ATTR ObjectMonitor::EnterI (TRAPS) {
- Thread * Self = THREAD;
+void NOINLINE ObjectMonitor::EnterI (TRAPS) {
+ Thread * const Self = THREAD;
assert(Self->is_Java_thread(), "invariant");
assert(((JavaThread *) Self)->thread_state() == _thread_blocked , "invariant");
@@ -550,7 +548,7 @@ void ATTR ObjectMonitor::EnterI (TRAPS) {
Atomic::cmpxchg_ptr(Self, &_Responsible, NULL);
}
- // The lock have been released while this thread was occupied queueing
+ // The lock might have been released while this thread was occupied queueing
// itself onto _cxq. To close the race and avoid "stranding" and
// progress-liveness failure we must resample-retry _owner before parking.
// Note the Dekker/Lamport duality: ST cxq; MEMBAR; LD Owner.
@@ -702,7 +700,7 @@ void ATTR ObjectMonitor::EnterI (TRAPS) {
// Knob_Reset and Knob_SpinAfterFutile support and restructuring the
// loop accordingly.
-void ATTR ObjectMonitor::ReenterI (Thread * Self, ObjectWaiter * SelfNode) {
+void NOINLINE ObjectMonitor::ReenterI (Thread * Self, ObjectWaiter * SelfNode) {
assert(Self != NULL , "invariant");
assert(SelfNode != NULL , "invariant");
assert(SelfNode->_thread == Self , "invariant");
@@ -790,6 +788,7 @@ void ATTR ObjectMonitor::ReenterI (Thread * Self, ObjectWaiter * SelfNode) {
OrderAccess::fence(); // see comments at the end of EnterI()
}
+// By convention we unlink a contending thread from EntryList|cxq immediately
// after the thread acquires the lock in ::enter(). Equally, we could defer
// unlinking the thread until ::exit()-time.
@@ -810,7 +809,7 @@ void ObjectMonitor::UnlinkAfterAcquire (Thread * Self, ObjectWaiter * SelfNode)
assert(prv == NULL || prv->TState == ObjectWaiter::TS_ENTER, "invariant");
TEVENT(Unlink from EntryList);
} else {
- guarantee(SelfNode->TState == ObjectWaiter::TS_CXQ, "invariant");
+ assert(SelfNode->TState == ObjectWaiter::TS_CXQ, "invariant");
// Inopportune interleaving -- Self is still on the cxq.
// This usually means the enqueue of self raced an exiting thread.
// Normally we'll find Self near the front of the cxq, so
@@ -850,10 +849,12 @@ void ObjectMonitor::UnlinkAfterAcquire (Thread * Self, ObjectWaiter * SelfNode)
TEVENT(Unlink from cxq);
}
+#ifdef ASSERT
// Diagnostic hygiene ...
SelfNode->_prev = (ObjectWaiter *) 0xBAD;
SelfNode->_next = (ObjectWaiter *) 0xBAD;
SelfNode->TState = ObjectWaiter::TS_RUN;
+#endif
}
// -----------------------------------------------------------------------------
@@ -906,9 +907,15 @@ void ObjectMonitor::UnlinkAfterAcquire (Thread * Self, ObjectWaiter * SelfNode)
// the integral of the # of active timers at any instant over time).
// Both impinge on OS scalability. Given that, at most one thread parked on
// a monitor will use a timer.
+//
+// There is also the risk of a futile wake-up. If we drop the lock
+// another thread can reacquire the lock immediately, and we can
+// then wake a thread unnecessarily. This is benign, and we've
+// structured the code so the windows are short and the frequency
+// of such futile wakups is low.
-void ATTR ObjectMonitor::exit(bool not_suspended, TRAPS) {
- Thread * Self = THREAD;
+void NOINLINE ObjectMonitor::exit(bool not_suspended, TRAPS) {
+ Thread * const Self = THREAD;
if (THREAD != _owner) {
if (THREAD->is_lock_owned((address) _owner)) {
// Transmute _owner from a BasicLock pointer to a Thread address.
@@ -920,14 +927,17 @@ void ATTR ObjectMonitor::exit(bool not_suspended, TRAPS) {
_recursions = 0;
OwnerIsThread = 1;
} else {
- // NOTE: we need to handle unbalanced monitor enter/exit
- // in native code by throwing an exception.
- // TODO: Throw an IllegalMonitorStateException ?
+ // Apparent unbalanced locking ...
+ // Naively we'd like to throw IllegalMonitorStateException.
+ // As a practical matter we can neither allocate nor throw an
+ // exception as ::exit() can be called from leaf routines.
+ // see x86_32.ad Fast_Unlock() and the I1 and I2 properties.
+ // Upon deeper reflection, however, in a properly run JVM the only
+ // way we should encounter this situation is in the presence of
+ // unbalanced JNI locking. TODO: CheckJNICalls.
+ // See also: CR4414101
TEVENT(Exit - Throw IMSX);
- assert(false, "Non-balanced monitor enter/exit!");
- if (false) {
- THROW(vmSymbols::java_lang_IllegalMonitorStateException());
- }
+ assert(false, "Non-balanced monitor enter/exit! Likely JNI locking");
return;
}
}
@@ -976,6 +986,7 @@ void ATTR ObjectMonitor::exit(bool not_suspended, TRAPS) {
return;
}
TEVENT(Inflated exit - complex egress);
+ // Other threads are blocked trying to acquire the lock.
// Normally the exiting thread is responsible for ensuring succession,
// but if other successors are ready or other entering threads are spinning
@@ -1142,9 +1153,9 @@ void ATTR ObjectMonitor::exit(bool not_suspended, TRAPS) {
if (w != NULL) {
// I'd like to write: guarantee (w->_thread != Self).
// But in practice an exiting thread may find itself on the EntryList.
- // Lets say thread T1 calls O.wait(). Wait() enqueues T1 on O's waitset and
+ // Let's say thread T1 calls O.wait(). Wait() enqueues T1 on O's waitset and
// then calls exit(). Exit release the lock by setting O._owner to NULL.
- // Lets say T1 then stalls. T2 acquires O and calls O.notify(). The
+ // Let's say T1 then stalls. T2 acquires O and calls O.notify(). The
// notify() operation moves T1 from O's waitset to O's EntryList. T2 then
// release the lock "O". T2 resumes immediately after the ST of null into
// _owner, above. T2 notices that the EntryList is populated, so it
@@ -1261,10 +1272,13 @@ void ATTR ObjectMonitor::exit(bool not_suspended, TRAPS) {
// MEMBAR
// LD Self_>_suspend_flags
//
+// UPDATE 2007-10-6: since I've replaced the native Mutex/Monitor subsystem
+// with a more efficient implementation, the need to use "FastHSSEC" has
+// decreased. - Dave
bool ObjectMonitor::ExitSuspendEquivalent (JavaThread * jSelf) {
- int Mode = Knob_FastHSSEC;
+ const int Mode = Knob_FastHSSEC;
if (Mode && !jSelf->is_external_suspend()) {
assert(jSelf->is_suspend_equivalent(), "invariant");
jSelf->clear_suspend_equivalent();
@@ -1413,7 +1427,7 @@ void ObjectMonitor::post_monitor_wait_event(EventJavaMonitorWait* event,
// Wait/Notify/NotifyAll
//
// Note: a subset of changes to ObjectMonitor::wait()
-// will need to be replicated in complete_exit above
+// will need to be replicated in complete_exit
void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) {
Thread * const Self = THREAD;
assert(Self->is_Java_thread(), "Must be Java thread!");
@@ -2268,12 +2282,12 @@ ObjectWaiter::ObjectWaiter(Thread* thread) {
assert(_event != NULL, "invariant");
}
-void ObjectWaiter::wait_reenter_begin(ObjectMonitor *mon) {
+void ObjectWaiter::wait_reenter_begin(ObjectMonitor * const mon) {
JavaThread *jt = (JavaThread *)this->_thread;
_active = JavaThreadBlockedOnMonitorEnterState::wait_reenter_begin(jt, mon);
}
-void ObjectWaiter::wait_reenter_end(ObjectMonitor *mon) {
+void ObjectWaiter::wait_reenter_end(ObjectMonitor * const mon) {
JavaThread *jt = (JavaThread *)this->_thread;
JavaThreadBlockedOnMonitorEnterState::wait_reenter_end(jt, _active);
}
@@ -2455,6 +2469,7 @@ void ObjectMonitor::DeferredInitialize() {
#define SETKNOB(x) { Knob_##x = kvGetInt (knobs, #x, Knob_##x); }
SETKNOB(ReportSettings);
SETKNOB(Verbose);
+ SETKNOB(VerifyInUse);
SETKNOB(FixedSpin);
SETKNOB(SpinLimit);
SETKNOB(SpinBase);
diff --git a/hotspot/src/share/vm/runtime/objectMonitor.hpp b/hotspot/src/share/vm/runtime/objectMonitor.hpp
index 9feaf7b8a90..c7c6886a2ba 100644
--- a/hotspot/src/share/vm/runtime/objectMonitor.hpp
+++ b/hotspot/src/share/vm/runtime/objectMonitor.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -311,6 +311,7 @@ public:
public:
static int Knob_Verbose;
+ static int Knob_VerifyInUse;
static int Knob_SpinLimit;
void* operator new (size_t size) throw() {
return AllocateHeap(size, mtInternal);
diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp
index 093d16122ee..1624a61b357 100644
--- a/hotspot/src/share/vm/runtime/os.hpp
+++ b/hotspot/src/share/vm/runtime/os.hpp
@@ -442,16 +442,7 @@ class os: AllStatic {
// ms = 0, will sleep for the least amount of time allowed by the OS.
static void naked_short_sleep(jlong ms);
static void infinite_sleep(); // never returns, use with CAUTION
- static void yield(); // Yields to all threads with same priority
- enum YieldResult {
- YIELD_SWITCHED = 1, // caller descheduled, other ready threads exist & ran
- YIELD_NONEREADY = 0, // No other runnable/ready threads.
- // platform-specific yield return immediately
- YIELD_UNKNOWN = -1 // Unknown: platform doesn't support _SWITCHED or _NONEREADY
- // YIELD_SWITCHED and YIELD_NONREADY imply the platform supports a "strong"
- // yield that can be used in lieu of blocking.
- } ;
- static YieldResult NakedYield () ;
+ static void naked_yield () ;
static OSReturn set_priority(Thread* thread, ThreadPriority priority);
static OSReturn get_priority(const Thread* const thread, ThreadPriority& priority);
diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp
index 05bb2224a53..4b16f6b04a8 100644
--- a/hotspot/src/share/vm/runtime/safepoint.cpp
+++ b/hotspot/src/share/vm/runtime/safepoint.cpp
@@ -302,7 +302,7 @@ void SafepointSynchronize::begin() {
SpinPause() ; // MP-Polite spin
} else
if (steps < DeferThrSuspendLoopCount) {
- os::NakedYield() ;
+ os::naked_yield() ;
} else {
os::naked_short_sleep(1);
}
diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
index 1656cdc1cd5..8ccee76cdb6 100644
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
@@ -1791,14 +1791,8 @@ JRT_END
// Handles the uncommon case in locking, i.e., contention or an inflated lock.
-#ifndef PRODUCT
-int SharedRuntime::_monitor_enter_ctr=0;
-#endif
JRT_ENTRY_NO_ASYNC(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, BasicLock* lock, JavaThread* thread))
oop obj(_obj);
-#ifndef PRODUCT
- _monitor_enter_ctr++; // monitor enter slow
-#endif
if (PrintBiasedLockingStatistics) {
Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
}
@@ -1812,15 +1806,9 @@ JRT_ENTRY_NO_ASYNC(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj
assert(!HAS_PENDING_EXCEPTION, "Should have no exception here");
JRT_END
-#ifndef PRODUCT
-int SharedRuntime::_monitor_exit_ctr=0;
-#endif
// Handles the uncommon cases of monitor unlocking in compiled code
JRT_LEAF(void, SharedRuntime::complete_monitor_unlocking_C(oopDesc* _obj, BasicLock* lock))
oop obj(_obj);
-#ifndef PRODUCT
- _monitor_exit_ctr++; // monitor exit slow
-#endif
Thread* THREAD = JavaThread::current();
// I'm not convinced we need the code contained by MIGHT_HAVE_PENDING anymore
// testing was unable to ever fire the assert that guarded it so I have removed it.
@@ -1860,8 +1848,6 @@ void SharedRuntime::print_statistics() {
ttyLocker ttyl;
if (xtty != NULL) xtty->head("statistics type='SharedRuntime'");
- if (_monitor_enter_ctr) tty->print_cr("%5d monitor enter slow", _monitor_enter_ctr);
- if (_monitor_exit_ctr) tty->print_cr("%5d monitor exit slow", _monitor_exit_ctr);
if (_throw_null_ctr) tty->print_cr("%5d implicit null throw", _throw_null_ctr);
SharedRuntime::print_ic_miss_histogram();
@@ -2445,9 +2431,9 @@ AdapterHandlerEntry* AdapterHandlerLibrary::get_adapter(methodHandle method) {
if (PrintAdapterHandlers || PrintStubCode) {
ttyLocker ttyl;
entry->print_adapter_on(tty);
- tty->print_cr("i2c argument handler #%d for: %s %s (%d bytes generated)",
+ tty->print_cr("i2c argument handler #%d for: %s %s %s (%d bytes generated)",
_adapters->number_of_entries(), (method->is_static() ? "static" : "receiver"),
- method->signature()->as_C_string(), insts_size);
+ method->signature()->as_C_string(), fingerprint->as_string(), insts_size);
tty->print_cr("c2i argument handler starts at %p", entry->get_c2i_entry());
if (Verbose || PrintStubCode) {
address first_pc = entry->base_address();
diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.hpp b/hotspot/src/share/vm/runtime/sharedRuntime.hpp
index a6d4dfd704d..93fa35d1b2f 100644
--- a/hotspot/src/share/vm/runtime/sharedRuntime.hpp
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.hpp
@@ -516,8 +516,6 @@ class SharedRuntime: AllStatic {
static void trace_ic_miss(address at);
public:
- static int _monitor_enter_ctr; // monitor enter slow
- static int _monitor_exit_ctr; // monitor exit slow
static int _throw_null_ctr; // throwing a null-pointer exception
static int _ic_miss_ctr; // total # of IC misses
static int _wrong_method_ctr;
diff --git a/hotspot/src/share/vm/runtime/synchronizer.cpp b/hotspot/src/share/vm/runtime/synchronizer.cpp
index b8f0a45f390..fbdda196980 100644
--- a/hotspot/src/share/vm/runtime/synchronizer.cpp
+++ b/hotspot/src/share/vm/runtime/synchronizer.cpp
@@ -44,9 +44,9 @@
#if defined(__GNUC__) && !defined(PPC64)
// Need to inhibit inlining for older versions of GCC to avoid build-time failures
- #define ATTR __attribute__((noinline))
+ #define NOINLINE __attribute__((noinline))
#else
- #define ATTR
+ #define NOINLINE
#endif
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
@@ -206,14 +206,6 @@ void ObjectSynchronizer::slow_enter(Handle obj, BasicLock* lock, TRAPS) {
return;
}
-#if 0
- // The following optimization isn't particularly useful.
- if (mark->has_monitor() && mark->monitor()->is_entered(THREAD)) {
- lock->set_displaced_header(NULL);
- return;
- }
-#endif
-
// The object header will never be displaced to this lock,
// so it does not matter what the value is, except that it
// must be non-zero to avoid looking like a re-entrant lock,
@@ -457,7 +449,7 @@ static markOop ReadStableMark (oop obj) {
++its;
if (its > 10000 || !os::is_MP()) {
if (its & 1) {
- os::NakedYield();
+ os::naked_yield();
TEVENT(Inflate: INFLATING - yield);
} else {
// Note that the following code attenuates the livelock problem but is not
@@ -487,7 +479,7 @@ static markOop ReadStableMark (oop obj) {
if ((YieldThenBlock++) >= 16) {
Thread::current()->_ParkEvent->park(1);
} else {
- os::NakedYield();
+ os::naked_yield();
}
}
Thread::muxRelease(InflationLocks + ix);
@@ -573,7 +565,7 @@ intptr_t ObjectSynchronizer::FastHashCode (Thread * Self, oop obj) {
// added check of the bias pattern is to avoid useless calls to
// thread-local storage.
if (obj->mark()->has_bias_pattern()) {
- // Box and unbox the raw reference just in case we cause a STW safepoint.
+ // Handle for oop obj in case of STW safepoint
Handle hobj(Self, obj);
// Relaxing assertion for bug 6320749.
assert(Universe::verify_in_progress() ||
@@ -890,23 +882,23 @@ static void InduceScavenge (Thread * Self, const char * Whence) {
}
}
}
-/* Too slow for general assert or debug
+
void ObjectSynchronizer::verifyInUse (Thread *Self) {
ObjectMonitor* mid;
int inusetally = 0;
for (mid = Self->omInUseList; mid != NULL; mid = mid->FreeNext) {
- inusetally ++;
+ inusetally++;
}
assert(inusetally == Self->omInUseCount, "inuse count off");
int freetally = 0;
for (mid = Self->omFreeList; mid != NULL; mid = mid->FreeNext) {
- freetally ++;
+ freetally++;
}
assert(freetally == Self->omFreeCount, "free count off");
}
-*/
-ObjectMonitor * ATTR ObjectSynchronizer::omAlloc (Thread * Self) {
+
+ObjectMonitor * NOINLINE ObjectSynchronizer::omAlloc (Thread * Self) {
// A large MAXPRIVATE value reduces both list lock contention
// and list coherency traffic, but also tends to increase the
// number of objectMonitors in circulation as well as the STW
@@ -932,7 +924,9 @@ ObjectMonitor * ATTR ObjectSynchronizer::omAlloc (Thread * Self) {
m->FreeNext = Self->omInUseList;
Self->omInUseList = m;
Self->omInUseCount++;
- // verifyInUse(Self);
+ if (ObjectMonitor::Knob_VerifyInUse) {
+ verifyInUse(Self);
+ }
} else {
m->FreeNext = NULL;
}
@@ -1052,7 +1046,9 @@ void ObjectSynchronizer::omRelease (Thread * Self, ObjectMonitor * m, bool fromP
curmidinuse->FreeNext = mid->FreeNext; // maintain the current thread inuselist
}
Self->omInUseCount--;
- // verifyInUse(Self);
+ if (ObjectMonitor::Knob_VerifyInUse) {
+ verifyInUse(Self);
+ }
break;
} else {
curmidinuse = mid;
@@ -1061,7 +1057,7 @@ void ObjectSynchronizer::omRelease (Thread * Self, ObjectMonitor * m, bool fromP
}
}
- // FreeNext is used for both onInUseList and omFreeList, so clear old before setting new
+ // FreeNext is used for both omInUseList and omFreeList, so clear old before setting new
m->FreeNext = Self->omFreeList;
Self->omFreeList = m;
Self->omFreeCount++;
@@ -1074,7 +1070,7 @@ void ObjectSynchronizer::omRelease (Thread * Self, ObjectMonitor * m, bool fromP
// consecutive STW safepoints. Relatedly, we might decay
// omFreeProvision at STW safepoints.
//
-// Also return the monitors of a moribund thread"s omInUseList to
+// Also return the monitors of a moribund thread's omInUseList to
// a global gOmInUseList under the global list lock so these
// will continue to be scanned.
//
@@ -1115,7 +1111,6 @@ void ObjectSynchronizer::omFlush (Thread * Self) {
InUseTail = curom;
InUseTally++;
}
-// TODO debug
assert(Self->omInUseCount == InUseTally, "inuse count off");
Self->omInUseCount = 0;
guarantee(InUseTail != NULL && InUseList != NULL, "invariant");
@@ -1154,7 +1149,7 @@ ObjectMonitor* ObjectSynchronizer::inflate_helper(oop obj) {
// multiple locks occupy the same $ line. Padding might be appropriate.
-ObjectMonitor * ATTR ObjectSynchronizer::inflate (Thread * Self, oop object) {
+ObjectMonitor * NOINLINE ObjectSynchronizer::inflate (Thread * Self, oop object) {
// Inflate mutates the heap ...
// Relaxing assertion for bug 6320749.
assert(Universe::verify_in_progress() ||
@@ -1385,7 +1380,7 @@ enum ManifestConstants {
// Deflate a single monitor if not in use
// Return true if deflated, false if in use
bool ObjectSynchronizer::deflate_monitor(ObjectMonitor* mid, oop obj,
- ObjectMonitor** FreeHeadp, ObjectMonitor** FreeTailp) {
+ ObjectMonitor** freeHeadp, ObjectMonitor** freeTailp) {
bool deflated;
// Normal case ... The monitor is associated with obj.
guarantee(obj->mark() == markOopDesc::encode(mid), "invariant");
@@ -1415,13 +1410,13 @@ bool ObjectSynchronizer::deflate_monitor(ObjectMonitor* mid, oop obj,
assert(mid->object() == NULL, "invariant");
// Move the object to the working free list defined by FreeHead,FreeTail.
- if (*FreeHeadp == NULL) *FreeHeadp = mid;
- if (*FreeTailp != NULL) {
- ObjectMonitor * prevtail = *FreeTailp;
+ if (*freeHeadp == NULL) *freeHeadp = mid;
+ if (*freeTailp != NULL) {
+ ObjectMonitor * prevtail = *freeTailp;
assert(prevtail->FreeNext == NULL, "cleaned up deflated?"); // TODO KK
prevtail->FreeNext = mid;
}
- *FreeTailp = mid;
+ *freeTailp = mid;
deflated = true;
}
return deflated;
@@ -1429,7 +1424,7 @@ bool ObjectSynchronizer::deflate_monitor(ObjectMonitor* mid, oop obj,
// Caller acquires ListLock
int ObjectSynchronizer::walk_monitor_list(ObjectMonitor** listheadp,
- ObjectMonitor** FreeHeadp, ObjectMonitor** FreeTailp) {
+ ObjectMonitor** freeHeadp, ObjectMonitor** freeTailp) {
ObjectMonitor* mid;
ObjectMonitor* next;
ObjectMonitor* curmidinuse = NULL;
@@ -1439,7 +1434,7 @@ int ObjectSynchronizer::walk_monitor_list(ObjectMonitor** listheadp,
oop obj = (oop) mid->object();
bool deflated = false;
if (obj != NULL) {
- deflated = deflate_monitor(mid, obj, FreeHeadp, FreeTailp);
+ deflated = deflate_monitor(mid, obj, freeHeadp, freeTailp);
}
if (deflated) {
// extract from per-thread in-use-list
@@ -1482,7 +1477,9 @@ void ObjectSynchronizer::deflate_idle_monitors() {
nInCirculation+= cur->omInUseCount;
int deflatedcount = walk_monitor_list(cur->omInUseList_addr(), &FreeHead, &FreeTail);
cur->omInUseCount-= deflatedcount;
- // verifyInUse(cur);
+ if (ObjectMonitor::Knob_VerifyInUse) {
+ verifyInUse(cur);
+ }
nScavenged += deflatedcount;
nInuse += cur->omInUseCount;
}
diff --git a/hotspot/src/share/vm/runtime/synchronizer.hpp b/hotspot/src/share/vm/runtime/synchronizer.hpp
index bf3959be688..07af7e325ef 100644
--- a/hotspot/src/share/vm/runtime/synchronizer.hpp
+++ b/hotspot/src/share/vm/runtime/synchronizer.hpp
@@ -84,7 +84,7 @@ class ObjectSynchronizer : AllStatic {
static void reenter (Handle obj, intptr_t recursion, TRAPS);
// thread-specific and global objectMonitor free list accessors
-// static void verifyInUse (Thread * Self) ; too slow for general assert/debug
+ static void verifyInUse(Thread * Self);
static ObjectMonitor * omAlloc(Thread * Self);
static void omRelease(Thread * Self, ObjectMonitor * m, bool FromPerThreadAlloc);
static void omFlush(Thread * Self);
@@ -114,10 +114,10 @@ class ObjectSynchronizer : AllStatic {
// An adaptive profile-based deflation policy could be used if needed
static void deflate_idle_monitors();
static int walk_monitor_list(ObjectMonitor** listheadp,
- ObjectMonitor** FreeHeadp,
- ObjectMonitor** FreeTailp);
- static bool deflate_monitor(ObjectMonitor* mid, oop obj, ObjectMonitor** FreeHeadp,
- ObjectMonitor** FreeTailp);
+ ObjectMonitor** freeHeadp,
+ ObjectMonitor** freeTailp);
+ static bool deflate_monitor(ObjectMonitor* mid, oop obj, ObjectMonitor** freeHeadp,
+ ObjectMonitor** freeTailp);
static void oops_do(OopClosure* f);
// debugging
@@ -130,7 +130,10 @@ class ObjectSynchronizer : AllStatic {
enum { _BLOCKSIZE = 128 };
static ObjectMonitor* gBlockList;
static ObjectMonitor * volatile gFreeList;
- static ObjectMonitor * volatile gOmInUseList; // for moribund thread, so monitors they inflated still get scanned
+ // global monitor in use list, for moribund threads,
+ // monitors they inflated need to be scanned for deflation
+ static ObjectMonitor * volatile gOmInUseList;
+ // count of entries in gOmInUseList
static int gOmInUseCount;
};
diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp
index 69c2326a6ff..f2ad3d5d2b6 100644
--- a/hotspot/src/share/vm/runtime/thread.cpp
+++ b/hotspot/src/share/vm/runtime/thread.cpp
@@ -4101,8 +4101,8 @@ void Threads::possibly_parallel_oops_do(OopClosure* f, CLDClosure* cld_f, CodeBl
SharedHeap* sh = SharedHeap::heap();
// Cannot yet substitute active_workers for n_par_threads
// because of G1CollectedHeap::verify() use of
- // SharedHeap::process_strong_roots(). n_par_threads == 0 will
- // turn off parallelism in process_strong_roots while active_workers
+ // SharedHeap::process_roots(). n_par_threads == 0 will
+ // turn off parallelism in process_roots while active_workers
// is being used for parallelism elsewhere.
bool is_par = sh->n_par_threads() > 0;
assert(!is_par ||
@@ -4376,7 +4376,7 @@ void Thread::SpinAcquire (volatile int * adr, const char * LockName) {
if (Yields > 5) {
os::naked_short_sleep(1);
} else {
- os::NakedYield();
+ os::naked_yield();
++Yields;
}
} else {
@@ -4394,6 +4394,12 @@ void Thread::SpinRelease (volatile int * adr) {
// It's safe if subsequent LDs and STs float "up" into the critical section,
// but prior LDs and STs within the critical section can't be allowed
// to reorder or float past the ST that releases the lock.
+ // Loads and stores in the critical section - which appear in program
+ // order before the store that releases the lock - must also appear
+ // before the store that releases the lock in memory visibility order.
+ // Conceptually we need a #loadstore|#storestore "release" MEMBAR before
+ // the ST of 0 into the lock-word which releases the lock, so fence
+ // more than covers this on all platforms.
*adr = 0;
}
@@ -4575,18 +4581,25 @@ void Thread::muxAcquireW (volatile intptr_t * Lock, ParkEvent * ev) {
// This implementation pops from the head of the list. This is unfair,
// but tends to provide excellent throughput as hot threads remain hot.
// (We wake recently run threads first).
-
+//
+// All paths through muxRelease() will execute a CAS.
+// Release consistency -- We depend on the CAS in muxRelease() to provide full
+// bidirectional fence/MEMBAR semantics, ensuring that all prior memory operations
+// executed within the critical section are complete and globally visible before the
+// store (CAS) to the lock-word that releases the lock becomes globally visible.
void Thread::muxRelease (volatile intptr_t * Lock) {
for (;;) {
const intptr_t w = Atomic::cmpxchg_ptr(0, Lock, LOCKBIT);
assert(w & LOCKBIT, "invariant");
if (w == LOCKBIT) return;
- ParkEvent * List = (ParkEvent *)(w & ~LOCKBIT);
+ ParkEvent * const List = (ParkEvent *) (w & ~LOCKBIT);
assert(List != NULL, "invariant");
assert(List->OnList == intptr_t(Lock), "invariant");
- ParkEvent * nxt = List->ListNext;
+ ParkEvent * const nxt = List->ListNext;
+ guarantee((intptr_t(nxt) & LOCKBIT) == 0, "invariant");
// The following CAS() releases the lock and pops the head element.
+ // The CAS() also ratifies the previously fetched lock-word value.
if (Atomic::cmpxchg_ptr (intptr_t(nxt), Lock, w) != w) {
continue;
}
diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp
index 501a4b4f186..715e50a552f 100644
--- a/hotspot/src/share/vm/runtime/thread.hpp
+++ b/hotspot/src/share/vm/runtime/thread.hpp
@@ -452,7 +452,7 @@ class Thread: public ThreadShadow {
private:
bool claim_oops_do_par_case(int collection_parity);
public:
- // Requires that "collection_parity" is that of the current strong roots
+ // Requires that "collection_parity" is that of the current roots
// iteration. If "is_par" is false, sets the parity of "this" to
// "collection_parity", and returns "true". If "is_par" is true,
// uses an atomic instruction to set the current threads parity to
diff --git a/hotspot/src/share/vm/runtime/vframe.cpp b/hotspot/src/share/vm/runtime/vframe.cpp
index 57900245436..53f344956cc 100644
--- a/hotspot/src/share/vm/runtime/vframe.cpp
+++ b/hotspot/src/share/vm/runtime/vframe.cpp
@@ -260,66 +260,156 @@ Method* interpretedVFrame::method() const {
return fr().interpreter_frame_method();
}
-StackValueCollection* interpretedVFrame::locals() const {
- int length = method()->max_locals();
+static StackValue* create_stack_value_from_oop_map(const InterpreterOopMap& oop_mask,
+ int index,
+ const intptr_t* const addr) {
- if (method()->is_native()) {
- // If the method is native, max_locals is not telling the truth.
- // maxlocals then equals the size of parameters
- length = method()->size_of_parameters();
+ assert(index >= 0 &&
+ index < oop_mask.number_of_entries(), "invariant");
+
+ // categorize using oop_mask
+ if (oop_mask.is_oop(index)) {
+ // reference (oop) "r"
+ Handle h(addr != NULL ? (*(oop*)addr) : (oop)NULL);
+ return new StackValue(h);
+ }
+ // value (integer) "v"
+ return new StackValue(addr != NULL ? *addr : 0);
+}
+
+static bool is_in_expression_stack(const frame& fr, const intptr_t* const addr) {
+ assert(addr != NULL, "invariant");
+
+ // Ensure to be 'inside' the expresion stack (i.e., addr >= sp for Intel).
+ // In case of exceptions, the expression stack is invalid and the sp
+ // will be reset to express this condition.
+ if (frame::interpreter_frame_expression_stack_direction() > 0) {
+ return addr <= fr.interpreter_frame_tos_address();
}
- StackValueCollection* result = new StackValueCollection(length);
+ return addr >= fr.interpreter_frame_tos_address();
+}
+
+static void stack_locals(StackValueCollection* result,
+ int length,
+ const InterpreterOopMap& oop_mask,
+ const frame& fr) {
+
+ assert(result != NULL, "invariant");
+
+ for (int i = 0; i < length; ++i) {
+ const intptr_t* const addr = fr.interpreter_frame_local_at(i);
+ assert(addr != NULL, "invariant");
+ assert(addr >= fr.sp(), "must be inside the frame");
+
+ StackValue* const sv = create_stack_value_from_oop_map(oop_mask, i, addr);
+ assert(sv != NULL, "sanity check");
+
+ result->add(sv);
+ }
+}
+
+static void stack_expressions(StackValueCollection* result,
+ int length,
+ int max_locals,
+ const InterpreterOopMap& oop_mask,
+ const frame& fr) {
+
+ assert(result != NULL, "invariant");
+
+ for (int i = 0; i < length; ++i) {
+ const intptr_t* addr = fr.interpreter_frame_expression_stack_at(i);
+ assert(addr != NULL, "invariant");
+ if (!is_in_expression_stack(fr, addr)) {
+ // Need to ensure no bogus escapes.
+ addr = NULL;
+ }
+
+ StackValue* const sv = create_stack_value_from_oop_map(oop_mask,
+ i + max_locals,
+ addr);
+ assert(sv != NULL, "sanity check");
+
+ result->add(sv);
+ }
+}
+
+StackValueCollection* interpretedVFrame::locals() const {
+ return stack_data(false);
+}
+
+StackValueCollection* interpretedVFrame::expressions() const {
+ return stack_data(true);
+}
+
+/*
+ * Worker routine for fetching references and/or values
+ * for a particular bci in the interpretedVFrame.
+ *
+ * Returns data for either "locals" or "expressions",
+ * using bci relative oop_map (oop_mask) information.
+ *
+ * @param expressions bool switch controlling what data to return
+ (false == locals / true == expression)
+ *
+ */
+StackValueCollection* interpretedVFrame::stack_data(bool expressions) const {
- // Get oopmap describing oops and int for current bci
InterpreterOopMap oop_mask;
+ // oopmap for current bci
if (TraceDeoptimization && Verbose) {
- // need the current JavaThread and not thread()
methodHandle m_h(Thread::current(), method());
OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask);
} else {
method()->mask_for(bci(), &oop_mask);
}
- // handle locals
- for(int i=0; i < length; i++) {
- // Find stack location
- intptr_t *addr = locals_addr_at(i);
- // Depending on oop/int put it in the right package
- StackValue *sv;
- if (oop_mask.is_oop(i)) {
- // oop value
- Handle h(*(oop *)addr);
- sv = new StackValue(h);
- } else {
- // integer
- sv = new StackValue(*addr);
- }
- assert(sv != NULL, "sanity check");
- result->add(sv);
+ const int mask_len = oop_mask.number_of_entries();
+
+ // If the method is native, method()->max_locals() is not telling the truth.
+ // For our purposes, max locals instead equals the size of parameters.
+ const int max_locals = method()->is_native() ?
+ method()->size_of_parameters() : method()->max_locals();
+
+ assert(mask_len >= max_locals, "invariant");
+
+ const int length = expressions ? mask_len - max_locals : max_locals;
+ assert(length >= 0, "invariant");
+
+ StackValueCollection* const result = new StackValueCollection(length);
+
+ if (0 == length) {
+ return result;
}
+
+ if (expressions) {
+ stack_expressions(result, length, max_locals, oop_mask, fr());
+ } else {
+ stack_locals(result, length, oop_mask, fr());
+ }
+
+ assert(length == result->size(), "invariant");
+
return result;
}
void interpretedVFrame::set_locals(StackValueCollection* values) const {
if (values == NULL || values->size() == 0) return;
- int length = method()->max_locals();
- if (method()->is_native()) {
- // If the method is native, max_locals is not telling the truth.
- // maxlocals then equals the size of parameters
- length = method()->size_of_parameters();
- }
+ // If the method is native, max_locals is not telling the truth.
+ // maxlocals then equals the size of parameters
+ const int max_locals = method()->is_native() ?
+ method()->size_of_parameters() : method()->max_locals();
- assert(length == values->size(), "Mismatch between actual stack format and supplied data");
+ assert(max_locals == values->size(), "Mismatch between actual stack format and supplied data");
// handle locals
- for (int i = 0; i < length; i++) {
+ for (int i = 0; i < max_locals; i++) {
// Find stack location
intptr_t *addr = locals_addr_at(i);
// Depending on oop/int put it in the right package
- StackValue *sv = values->at(i);
+ const StackValue* const sv = values->at(i);
assert(sv != NULL, "sanity check");
if (sv->type() == T_OBJECT) {
*(oop *) addr = (sv->get_obj())();
@@ -329,61 +419,6 @@ void interpretedVFrame::set_locals(StackValueCollection* values) const {
}
}
-StackValueCollection* interpretedVFrame::expressions() const {
-
- InterpreterOopMap oop_mask;
-
- if (!method()->is_native()) {
- // Get oopmap describing oops and int for current bci
- if (TraceDeoptimization && Verbose) {
- // need the current JavaThread and not thread()
- methodHandle m_h(Thread::current(), method());
- OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask);
- } else {
- method()->mask_for(bci(), &oop_mask);
- }
- }
-
- // If the bci is a call instruction, i.e. any of the invoke* instructions,
- // the InterpreterOopMap does not include expression/operand stack liveness
- // info in the oop_mask/bit_mask. This can lead to a discrepancy of what
- // is actually on the expression stack compared to what is given by the
- // oop_map. We need to use the length reported in the oop_map.
- int length = oop_mask.expression_stack_size();
-
- assert(fr().interpreter_frame_expression_stack_size() >= length,
- "error in expression stack!");
-
- StackValueCollection* result = new StackValueCollection(length);
-
- if (0 == length) {
- return result;
- }
-
- int nof_locals = method()->max_locals();
-
- // handle expressions
- for(int i=0; i < length; i++) {
- // Find stack location
- intptr_t *addr = fr().interpreter_frame_expression_stack_at(i);
-
- // Depending on oop/int put it in the right package
- StackValue *sv;
- if (oop_mask.is_oop(i + nof_locals)) {
- // oop value
- Handle h(*(oop *)addr);
- sv = new StackValue(h);
- } else {
- // integer
- sv = new StackValue(*addr);
- }
- assert(sv != NULL, "sanity check");
- result->add(sv);
- }
- return result;
-}
-
-
// ------------- cChunk --------------
entryVFrame::entryVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread)
diff --git a/hotspot/src/share/vm/runtime/vframe.hpp b/hotspot/src/share/vm/runtime/vframe.hpp
index a284b13de0c..70f31b14c51 100644
--- a/hotspot/src/share/vm/runtime/vframe.hpp
+++ b/hotspot/src/share/vm/runtime/vframe.hpp
@@ -186,7 +186,7 @@ class interpretedVFrame: public javaVFrame {
private:
static const int bcp_offset;
intptr_t* locals_addr_at(int offset) const;
-
+ StackValueCollection* stack_data(bool expressions) const;
// returns where the parameters starts relative to the frame pointer
int start_of_parameters() const;
diff --git a/hotspot/src/share/vm/services/memTracker.hpp b/hotspot/src/share/vm/services/memTracker.hpp
index 52715a68764..8573c1f6530 100644
--- a/hotspot/src/share/vm/services/memTracker.hpp
+++ b/hotspot/src/share/vm/services/memTracker.hpp
@@ -484,7 +484,7 @@ class MemTracker : AllStatic {
// as short sleep.
os::naked_short_sleep(1);
#else
- os::NakedYield();
+ os::naked_yield();
#endif
}
}
diff --git a/hotspot/src/share/vm/services/memoryService.cpp b/hotspot/src/share/vm/services/memoryService.cpp
index ea9cb59873d..625d367a265 100644
--- a/hotspot/src/share/vm/services/memoryService.cpp
+++ b/hotspot/src/share/vm/services/memoryService.cpp
@@ -136,7 +136,6 @@ void MemoryService::add_gen_collected_heap_info(GenCollectedHeap* heap) {
break;
#if INCLUDE_ALL_GCS
case Generation::ParNew:
- case Generation::ASParNew:
_minor_gc_manager = MemoryManager::get_parnew_memory_manager();
break;
#endif // INCLUDE_ALL_GCS
@@ -268,7 +267,6 @@ void MemoryService::add_generation_memory_pool(Generation* gen,
#if INCLUDE_ALL_GCS
case Generation::ParNew:
- case Generation::ASParNew:
{
assert(major_mgr != NULL && minor_mgr != NULL, "Should have two managers");
// Add a memory pool for each space and young gen doesn't
@@ -300,7 +298,6 @@ void MemoryService::add_generation_memory_pool(Generation* gen,
#if INCLUDE_ALL_GCS
case Generation::ConcurrentMarkSweep:
- case Generation::ASConcurrentMarkSweep:
{
assert(major_mgr != NULL && minor_mgr == NULL, "Should have only one manager");
ConcurrentMarkSweepGeneration* cms = (ConcurrentMarkSweepGeneration*) gen;
@@ -548,23 +545,20 @@ Handle MemoryService::create_MemoryUsage_obj(MemoryUsage usage, TRAPS) {
// GC manager type depends on the type of Generation. Depending on the space
// availablity and vm options the gc uses major gc manager or minor gc
// manager or both. The type of gc manager depends on the generation kind.
-// For DefNew, ParNew and ASParNew generation doing scavenge gc uses minor
-// gc manager (so _fullGC is set to false ) and for other generation kinds
-// doing mark-sweep-compact uses major gc manager (so _fullGC is set
-// to true).
+// For DefNew and ParNew generation doing scavenge gc uses minor gc manager (so
+// _fullGC is set to false ) and for other generation kinds doing
+// mark-sweep-compact uses major gc manager (so _fullGC is set to true).
TraceMemoryManagerStats::TraceMemoryManagerStats(Generation::Name kind, GCCause::Cause cause) {
switch (kind) {
case Generation::DefNew:
#if INCLUDE_ALL_GCS
case Generation::ParNew:
- case Generation::ASParNew:
#endif // INCLUDE_ALL_GCS
_fullGC=false;
break;
case Generation::MarkSweepCompact:
#if INCLUDE_ALL_GCS
case Generation::ConcurrentMarkSweep:
- case Generation::ASConcurrentMarkSweep:
#endif // INCLUDE_ALL_GCS
_fullGC=true;
break;
diff --git a/hotspot/src/share/vm/utilities/array.hpp b/hotspot/src/share/vm/utilities/array.hpp
index 632b7c656b2..b7ce8e71588 100644
--- a/hotspot/src/share/vm/utilities/array.hpp
+++ b/hotspot/src/share/vm/utilities/array.hpp
@@ -305,6 +305,7 @@ class Array: public MetaspaceObj {
friend class MetadataFactory;
friend class VMStructs;
friend class MethodHandleCompiler; // special case
+ friend class WhiteBox;
protected:
int _length; // the number of array elements
T _data[1]; // the array memory
@@ -326,6 +327,31 @@ protected:
static size_t byte_sizeof(int length) { return sizeof(Array) + MAX2(length - 1, 0) * sizeof(T); }
+ // WhiteBox API helper.
+ // Can't distinguish between array of length 0 and length 1,
+ // will always return 0 in those cases.
+ static int bytes_to_length(size_t bytes) {
+ assert(is_size_aligned(bytes, BytesPerWord), "Must be, for now");
+
+ if (sizeof(Array) >= bytes) {
+ return 0;
+ }
+
+ size_t left = bytes - sizeof(Array);
+ assert(is_size_aligned(left, sizeof(T)), "Must be");
+
+ size_t elements = left / sizeof(T);
+ assert(elements <= (size_t)INT_MAX, err_msg("number of elements " SIZE_FORMAT "doesn't fit into an int.", elements));
+
+ int length = (int)elements;
+
+ assert((size_t)size(length) * BytesPerWord == bytes,
+ err_msg("Expected: " SIZE_FORMAT " got: " SIZE_FORMAT,
+ bytes, (size_t)size(length) * BytesPerWord));
+
+ return length;
+ }
+
explicit Array(int length) : _length(length) {
assert(length >= 0, "illegal length");
}
diff --git a/hotspot/src/share/vm/utilities/taskqueue.cpp b/hotspot/src/share/vm/utilities/taskqueue.cpp
index 9a992c1664d..bb63fe6385e 100644
--- a/hotspot/src/share/vm/utilities/taskqueue.cpp
+++ b/hotspot/src/share/vm/utilities/taskqueue.cpp
@@ -142,7 +142,7 @@ bool ParallelTaskTerminator::peek_in_queue_set() {
void ParallelTaskTerminator::yield() {
assert(_offered_termination <= _n_threads, "Invariant");
- os::yield();
+ os::naked_yield();
}
void ParallelTaskTerminator::sleep(uint millis) {
diff --git a/hotspot/test/Makefile b/hotspot/test/Makefile
index f81cc8d64df..929de70cdf0 100644
--- a/hotspot/test/Makefile
+++ b/hotspot/test/Makefile
@@ -23,14 +23,36 @@
#
#
-# Makefile to run various jdk tests
+# Makefile to run various hotspot tests
#
GETMIXEDPATH=echo
-# Get OS/ARCH specifics
-OSNAME = $(shell uname -s)
-ifeq ($(OSNAME), SunOS)
+# Utilities used
+AWK = awk
+CAT = cat
+CD = cd
+CHMOD = chmod
+CP = cp
+CUT = cut
+DIRNAME = dirname
+ECHO = echo
+EGREP = egrep
+EXPAND = expand
+FIND = find
+MKDIR = mkdir
+PWD = pwd
+SED = sed
+SORT = sort
+TEE = tee
+UNAME = uname
+UNIQ = uniq
+WC = wc
+ZIP = zip
+
+# Get OS name from uname (Cygwin inexplicably adds _NT-5.1)
+UNAME_S := $(shell $(UNAME) -s | $(CUT) -f1 -d_)
+ifeq ($(UNAME_S), SunOS)
PLATFORM = solaris
SLASH_JAVA = /java
ARCH = $(shell uname -p)
@@ -38,7 +60,7 @@ ifeq ($(OSNAME), SunOS)
ARCH=i586
endif
endif
-ifeq ($(OSNAME), Linux)
+ifeq ($(UNAME_S), Linux)
PLATFORM = linux
SLASH_JAVA = /java
ARCH = $(shell uname -m)
@@ -46,7 +68,7 @@ ifeq ($(OSNAME), Linux)
ARCH = i586
endif
endif
-ifeq ($(OSNAME), Darwin)
+ifeq ($(UNAME_S), Darwin)
PLATFORM = bsd
SLASH_JAVA = /java
ARCH = $(shell uname -m)
@@ -54,7 +76,7 @@ ifeq ($(OSNAME), Darwin)
ARCH = i586
endif
endif
-ifeq ($(findstring BSD,$(OSNAME)), BSD)
+ifeq ($(findstring BSD,$(UNAME_S)), BSD)
PLATFORM = bsd
SLASH_JAVA = /java
ARCH = $(shell uname -m)
@@ -63,12 +85,12 @@ ifeq ($(findstring BSD,$(OSNAME)), BSD)
endif
endif
ifeq ($(PLATFORM),)
- # detect wether we're running in MKS or cygwin
- ifeq ($(OSNAME), Windows_NT) # MKS
+ # detect whether we're running in MKS or cygwin
+ ifeq ($(UNAME_S), Windows_NT) # MKS
GETMIXEDPATH=dosname -s
endif
- ifeq ($(findstring CYGWIN,$(OSNAME)), CYGWIN)
- GETMIXEDPATH=cygpath -m -s
+ ifeq ($(findstring CYGWIN,$(UNAME_S)), CYGWIN)
+ GETMIXEDPATH=cygpath -m
endif
PLATFORM = windows
SLASH_JAVA = J:
@@ -92,13 +114,6 @@ ifdef ALT_SLASH_JAVA
SLASH_JAVA = $(ALT_SLASH_JAVA)
endif
-# Utilities used
-CD = cd
-CP = cp
-ECHO = echo
-MKDIR = mkdir
-ZIP = zip
-
# Root of this test area (important to use full paths in some places)
TEST_ROOT := $(shell pwd)
@@ -136,21 +151,82 @@ ifdef JPRT_ARCHIVE_BUNDLE
endif
# How to create the test bundle (pass or fail, we want to create this)
-BUNDLE_UP = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)` \
- && $(CD) $(ABS_TEST_OUTPUT_DIR) \
- && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
-BUNDLE_UP_FAILED = ( exitCode=$$? && $(BUNDLE_UP) && exit $${exitCode} )
+# Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
+ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)` \
+ && $(CD) $(ABS_TEST_OUTPUT_DIR) \
+ && $(CHMOD) -R a+r . \
+ && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
+
+# important results files
+SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt")
+STATS_TXT_NAME = Stats.txt
+STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/$(STATS_TXT_NAME)")
+RUNLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/runlist.txt")
+PASSLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/passlist.txt")
+FAILLIST = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/faillist.txt")
+EXITCODE = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/exitcode.txt")
+
+TESTEXIT = \
+ if [ ! -s $(EXITCODE) ] ; then \
+ $(ECHO) "ERROR: EXITCODE file not filled in."; \
+ $(ECHO) "1" > $(EXITCODE); \
+ fi ; \
+ testExitCode=`$(CAT) $(EXITCODE)`; \
+ $(ECHO) "EXIT CODE: $${testExitCode}"; \
+ exit $${testExitCode}
+
+BUNDLE_UP_AND_EXIT = \
+( \
+ jtregExitCode=$$? && \
+ _summary="$(SUMMARY_TXT)"; \
+ $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
+ $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
+ if [ -r "$${_summary}" ] ; then \
+ $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \
+ $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \
+ $(EGREP) ' Passed\.' $(RUNLIST) \
+ | $(EGREP) -v ' Error\.' \
+ | $(EGREP) -v ' Failed\.' > $(PASSLIST); \
+ ( $(EGREP) ' Failed\.' $(RUNLIST); \
+ $(EGREP) ' Error\.' $(RUNLIST); \
+ $(EGREP) -v ' Passed\.' $(RUNLIST) ) \
+ | $(SORT) | $(UNIQ) > $(FAILLIST); \
+ if [ $${jtregExitCode} != 0 -o -s $(FAILLIST) ] ; then \
+ $(EXPAND) $(FAILLIST) \
+ | $(CUT) -d' ' -f1 \
+ | $(SED) -e 's@^@FAILED: @' >> $(STATS_TXT); \
+ if [ $${jtregExitCode} = 0 ] ; then \
+ jtregExitCode=1; \
+ fi; \
+ fi; \
+ runc="`$(CAT) $(RUNLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
+ passc="`$(CAT) $(PASSLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
+ failc="`$(CAT) $(FAILLIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
+ exclc="FIXME CODETOOLS-7900176"; \
+ $(ECHO) "TEST STATS: name=$(UNIQUE_DIR) run=$${runc} pass=$${passc} fail=$${failc}" \
+ >> $(STATS_TXT); \
+ else \
+ $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
+ fi; \
+ if [ -f $(STATS_TXT) ] ; then \
+ $(CAT) $(STATS_TXT); \
+ fi; \
+ $(ZIP_UP_RESULTS) ; \
+ $(TESTEXIT) \
+)
################################################################
# Default make rule (runs jtreg_tests)
-all: jtreg_tests
+all: hotspot_all
@$(ECHO) "Testing completed successfully"
-# Support "hotspot_" prefixed test make targets too
-# The hotspot_% targets are for example invoked by the top level Makefile
+# Support "hotspot_" prefixed test make targets (too)
+# The hotspot_% targets are used by the top level Makefile
+# Unless explicitly defined below, hotspot_ is interpreted as a jtreg test group name
hotspot_%:
- $(MAKE) $*
+ $(ECHO) "Running tests: $@"
+ $(MAKE) -j 1 TEST_SELECTION=":$@" UNIQUE_DIR=$@ jtreg_tests;
# Prep for output
prep: clean
@@ -168,41 +244,64 @@ clean:
# Expect JT_HOME to be set for jtreg tests. (home for jtreg)
ifndef JT_HOME
- JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
-endif
-ifdef JPRT_JTREG_HOME
- JT_HOME = $(JPRT_JTREG_HOME)
+ JT_HOME = $(SLASH_JAVA)/re/jtreg/4.1/promoted/latest/binaries/jtreg
+ ifdef JPRT_JTREG_HOME
+ JT_HOME = $(JPRT_JTREG_HOME)
+ endif
endif
-# Expect JPRT to set TESTDIRS to the jtreg test dirs
-JTREG_TESTDIRS = demo/jvmti/gctest demo/jvmti/hprof
+# When called from JPRT the TESTDIRS variable is set to the jtreg tests to run
ifdef TESTDIRS
- JTREG_TESTDIRS = $(TESTDIRS)
+ TEST_SELECTION = $(TESTDIRS)
+endif
+
+ifdef CONCURRENCY
+ EXTRA_JTREG_OPTIONS += -concurrency:$(CONCURRENCY)
endif
# Default JTREG to run (win32 script works for everybody)
JTREG = $(JT_HOME)/win32/bin/jtreg
+# Only run automatic tests
+JTREG_BASIC_OPTIONS += -a
+# Report details on all failed or error tests, times too
+JTREG_BASIC_OPTIONS += -v:fail,error,time
+# Retain all files for failing tests
+JTREG_BASIC_OPTIONS += -retain:fail,error
+# Ignore tests are not run and completely silent about it
+JTREG_IGNORE_OPTION = -ignore:quiet
+JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_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:%)
+
# Option to tell jtreg to not run tests marked with "ignore"
ifeq ($(PLATFORM), windows)
JTREG_KEY_OPTION = -k:!ignore
else
JTREG_KEY_OPTION = -k:\!ignore
endif
+JTREG_BASIC_OPTIONS += $(JTREG_KEY_OPTION)
-#EXTRA_JTREG_OPTIONS =
+# Make sure jtreg exists
+$(JTREG): $(JT_HOME)
-jtreg_tests: prep $(JT_HOME) $(PRODUCT_HOME) $(JTREG)
- $(JTREG) -a -v:fail,error \
- $(JTREG_KEY_OPTION) \
- $(EXTRA_JTREG_OPTIONS) \
- -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \
- -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \
- -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
- $(JAVA_OPTIONS:%=-vmoption:%) \
- $(JTREG_TESTDIRS) \
- || $(BUNDLE_UP_FAILED)
- $(BUNDLE_UP)
+jtreg_tests: prep $(PRODUCT_HOME) $(JTREG)
+ ( \
+ ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \
+ export JT_HOME; \
+ $(shell $(GETMIXEDPATH) "$(JTREG)") \
+ $(JTREG_BASIC_OPTIONS) \
+ -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport") \
+ -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork") \
+ -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
+ $(JTREG_EXCLUSIONS) \
+ $(JTREG_TEST_OPTIONS) \
+ $(TEST_SELECTION) \
+ ) ; \
+ $(BUNDLE_UP_AND_EXIT) \
+ ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
PHONY_LIST += jtreg_tests
@@ -210,7 +309,7 @@ PHONY_LIST += jtreg_tests
# clienttest (make sure various basic java client options work)
-clienttest: prep $(PRODUCT_HOME)
+hotspot_clienttest clienttest: prep $(PRODUCT_HOME)
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -version
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -help
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -X
@@ -218,73 +317,27 @@ clienttest: prep $(PRODUCT_HOME)
$(RM) $(PRODUCT_HOME)/jre/bin/client/classes.jsa
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -Xshare:dump
-PHONY_LIST += clienttest
+PHONY_LIST += hotspot_clienttest clienttest
################################################################
# servertest (make sure various basic java server options work)
-servertest: prep $(PRODUCT_HOME)
+hotspot_servertest servertest: prep $(PRODUCT_HOME)
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -version
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -help
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -X
-PHONY_LIST += servertest
+PHONY_LIST += hotspot_servertest servertest
################################################################
# internalvmtests (run internal unit tests inside the VM)
-internalvmtests: prep $(PRODUCT_HOME)
+hotspot_internalvmtests internalvmtests: prep $(PRODUCT_HOME)
$(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) -XX:+ExecuteInternalVMTests -version
-PHONY_LIST += internalvmtests
-
-################################################################
-
-# wbapitest (make sure the whitebox testing api classes work
-
-wbapitest: prep $(JT_HOME) $(PRODUCT_HOME) $(JTREG)
- $(JTREG) -a -v:fail,error \
- $(JTREG_KEY_OPTION) \
- $(EXTRA_JTREG_OPTIONS) \
- -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \
- -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \
- -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \
- $(JAVA_OPTIONS:%=-vmoption:%) \
- $(shell $(GETMIXEDPATH) "$(TEST_ROOT)")/sanity \
- || $(BUNDLE_UP_FAILED)
- $(BUNDLE_UP)
-
-PHONY_LIST += wbapitest
-
-################################################################
-
-# packtest
-
-# Expect JPRT to set JPRT_PACKTEST_HOME.
-PACKTEST_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/packtest
-ifdef JPRT_PACKTEST_HOME
- PACKTEST_HOME = $(JPRT_PACKTEST_HOME)
-endif
-
-#EXTRA_PACKTEST_OPTIONS =
-
-packtest: prep $(PACKTEST_HOME)/ptest $(PRODUCT_HOME)
- ( $(CD) $(PACKTEST_HOME) && \
- $(PACKTEST_HOME)/ptest \
- -t "$(PRODUCT_HOME)" \
- $(PACKTEST_STRESS_OPTION) \
- $(EXTRA_PACKTEST_OPTIONS) \
- -W $(ABS_TEST_OUTPUT_DIR) \
- $(JAVA_OPTIONS:%=-J %) \
- ) || $(BUNDLE_UP_FAILED)
- $(BUNDLE_UP)
-
-packtest_stress: PACKTEST_STRESS_OPTION=-s
-packtest_stress: packtest
-
-PHONY_LIST += packtest packtest_stress
+PHONY_LIST += hotspot_internalvmtests internalvmtests
################################################################
@@ -292,4 +345,3 @@ PHONY_LIST += packtest packtest_stress
.PHONY: all clean prep $(PHONY_LIST)
################################################################
-
diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups
index 22ff9c82228..b3c46afbaeb 100644
--- a/hotspot/test/TEST.groups
+++ b/hotspot/test/TEST.groups
@@ -325,3 +325,24 @@ applicable_cmsgc = \
-:needs_parallelgc
+# When called from top level the test suites use the hotspot_ prefix
+hotspot_wbapitest = \
+ sanity/
+
+hotspot_compiler = \
+ sanity/ExecuteInternalVMTests.java
+
+hotspot_gc = \
+ sanity/ExecuteInternalVMTests.java
+
+hotspot_runtime = \
+ sanity/ExecuteInternalVMTests.java
+
+hotspot_serviceability = \
+ sanity/ExecuteInternalVMTests.java
+
+hotspot_all = \
+ :hotspot_compiler \
+ :hotspot_gc \
+ :hotspot_runtime \
+ :hotspot_serviceability
diff --git a/hotspot/test/compiler/6775880/Test.java b/hotspot/test/compiler/6775880/Test.java
index e9cdd9fc237..f5a51fe4597 100644
--- a/hotspot/test/compiler/6775880/Test.java
+++ b/hotspot/test/compiler/6775880/Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
* @test
* @bug 6775880
* @summary EA +DeoptimizeALot: assert(mon_info->owner()->is_locked(),"object must be locked now")
- * @compile -source 1.4 -target 1.4 Test.java
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:+DoEscapeAnalysis -XX:+DeoptimizeALot -XX:CompileCommand=exclude,java.lang.AbstractStringBuilder::append Test
*/
diff --git a/hotspot/test/compiler/8009761/Test8009761.java b/hotspot/test/compiler/8009761/Test8009761.java
index 39a25748348..ed0f94665e4 100644
--- a/hotspot/test/compiler/8009761/Test8009761.java
+++ b/hotspot/test/compiler/8009761/Test8009761.java
@@ -21,11 +21,7 @@
* questions.
*/
-import com.sun.management.HotSpotDiagnosticMXBean;
-import com.sun.management.VMOption;
import sun.hotspot.WhiteBox;
-import sun.management.ManagementFactoryHelper;
-
import java.lang.reflect.Method;
/*
@@ -40,6 +36,7 @@ import java.lang.reflect.Method;
public class Test8009761 {
private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
+ private static int COMP_LEVEL_SIMPLE = 1;
private static int COMP_LEVEL_FULL_OPTIMIZATION = 4;
private static Method m3 = null;
@@ -236,7 +233,7 @@ public class Test8009761 {
static public void main(String[] args) {
// Make sure background compilation is disabled
- if (backgroundCompilationEnabled()) {
+ if (WHITE_BOX.getBooleanVMFlag("BackgroundCompilation")) {
throw new RuntimeException("Background compilation enabled");
}
@@ -256,7 +253,11 @@ public class Test8009761 {
c1 = count;
// Force the compilation of m3() that will inline m1()
- WHITE_BOX.enqueueMethodForCompilation(m3, COMP_LEVEL_FULL_OPTIMIZATION);
+ if(!WHITE_BOX.enqueueMethodForCompilation(m3, COMP_LEVEL_FULL_OPTIMIZATION)) {
+ // C2 compiler not available, compile with C1
+ WHITE_BOX.enqueueMethodForCompilation(m3, COMP_LEVEL_SIMPLE);
+ }
+
// Because background compilation is disabled, method should now be compiled
if(!WHITE_BOX.isMethodCompiled(m3)) {
throw new RuntimeException(m3 + " not compiled");
@@ -278,19 +279,4 @@ public class Test8009761 {
System.out.println("PASSED " + c1);
}
}
-
- /**
- * Checks if background compilation (-XX:+BackgroundCompilation) is enabled.
- * @return True if background compilation is enabled, false otherwise
- */
- private static boolean backgroundCompilationEnabled() {
- HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean();
- VMOption backgroundCompilation;
- try {
- backgroundCompilation = diagnostic.getVMOption("BackgroundCompilation");
- } catch (IllegalArgumentException e) {
- return false;
- }
- return Boolean.valueOf(backgroundCompilation.getValue());
- }
}
diff --git a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java
index 13411a0dd73..08321b87266 100644
--- a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java
+++ b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java
@@ -25,6 +25,7 @@ import java.util.function.IntPredicate;
/**
* @test NonTieredLevelsTest
+ * @ignore 8046268
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
* @build NonTieredLevelsTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/compiler/tiered/TieredLevelsTest.java b/hotspot/test/compiler/tiered/TieredLevelsTest.java
index 9fb2254d0b5..4b9a0a4a906 100644
--- a/hotspot/test/compiler/tiered/TieredLevelsTest.java
+++ b/hotspot/test/compiler/tiered/TieredLevelsTest.java
@@ -23,6 +23,7 @@
/**
* @test TieredLevelsTest
+ * @ignore 8046268
* @library /testlibrary /testlibrary/whitebox /compiler/whitebox
* @build TieredLevelsTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java
index 89fff68460f..195221658cf 100644
--- a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java
+++ b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java
@@ -25,6 +25,7 @@ import java.util.function.Function;
/*
* @test ClearMethodStateTest
+ * @ignore 8046268
* @bug 8006683 8007288 8022832
* @library /testlibrary /testlibrary/whitebox
* @build ClearMethodStateTest
diff --git a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java
index ea4e36400eb..a5b9d794c66 100644
--- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java
+++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java
@@ -23,6 +23,7 @@
/*
* @test DeoptimizeAllTest
+ * @ignore 8046268
* @bug 8006683 8007288 8022832
* @library /testlibrary /testlibrary/whitebox
* @build DeoptimizeAllTest
diff --git a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java
index 0b9ffd2d9db..e257a1e5e25 100644
--- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java
+++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java
@@ -23,6 +23,7 @@
/*
* @test DeoptimizeMethodTest
+ * @ignore 8046268
* @bug 8006683 8007288 8022832
* @library /testlibrary /testlibrary/whitebox
* @build DeoptimizeMethodTest
diff --git a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
index d9139dd3674..4acebb2b123 100644
--- a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
+++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
@@ -23,6 +23,7 @@
/*
* @test EnqueueMethodForCompilationTest
+ * @ignore 8046268
* @bug 8006683 8007288 8022832
* @library /testlibrary /testlibrary/whitebox
* @build EnqueueMethodForCompilationTest
diff --git a/hotspot/test/compiler/whitebox/GetNMethodTest.java b/hotspot/test/compiler/whitebox/GetNMethodTest.java
index bb95f01b991..9800f3a3eb3 100644
--- a/hotspot/test/compiler/whitebox/GetNMethodTest.java
+++ b/hotspot/test/compiler/whitebox/GetNMethodTest.java
@@ -26,6 +26,7 @@ import sun.hotspot.code.NMethod;
/*
* @test GetNMethodTest
+ * @ignore 8046268
* @bug 8038240
* @library /testlibrary /testlibrary/whitebox
* @build GetNMethodTest
diff --git a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java
index d6586879778..604175c38ef 100644
--- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java
+++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java
@@ -23,6 +23,7 @@
/*
* @test MakeMethodNotCompilableTest
+ * @ignore 8046268
* @bug 8012322 8006683 8007288 8022832
* @library /testlibrary /testlibrary/whitebox
* @build MakeMethodNotCompilableTest
diff --git a/hotspot/test/gc/g1/TestDeferredRSUpdate.java b/hotspot/test/gc/g1/TestDeferredRSUpdate.java
new file mode 100644
index 00000000000..7d2ebdc4eb3
--- /dev/null
+++ b/hotspot/test/gc/g1/TestDeferredRSUpdate.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test TestDeferredRSUpdate
+ * @bug 8040977
+ * @summary Ensure that running with -XX:-G1DeferredRSUpdate does not crash the VM
+ * @key gc
+ * @library /testlibrary
+ */
+
+import com.oracle.java.testlibrary.ProcessTools;
+import com.oracle.java.testlibrary.OutputAnalyzer;
+
+public class TestDeferredRSUpdate {
+ public static void main(String[] args) throws Exception {
+ GCTest.main(args);
+
+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
+ "-Xmx10M",
+ // G1DeferredRSUpdate is a develop option, but we cannot limit execution of this test to only debug VMs.
+ "-XX:+IgnoreUnrecognizedVMOptions",
+ "-XX:-G1DeferredRSUpdate",
+ GCTest.class.getName());
+
+ OutputAnalyzer output = new OutputAnalyzer(pb.start());
+ output.shouldHaveExitValue(0);
+ }
+
+ static class GCTest {
+ private static Object[] garbage = new Object[32];
+
+ public static void main(String [] args) {
+ System.out.println("Creating garbage");
+ // Create 128MB of garbage. This should result in at least one minor GC, with
+ // some objects copied to old gen. As references from old to young are installed,
+ // the crash due to the use before initialize occurs.
+ Object prev = null;
+ Object prevPrev = null;
+ for (int i = 0; i < 1024; i++) {
+ Object[] next = new Object[32 * 1024];
+ next[0] = prev;
+ next[1] = prevPrev;
+
+ Object[] cur = (Object[]) garbage[i % garbage.length];
+ if (cur != null) {
+ cur[0] = null;
+ cur[1] = null;
+ }
+ garbage[i % garbage.length] = next;
+
+ prevPrev = prev;
+ prev = next;
+ }
+ System.out.println("Done");
+ }
+ }
+}
diff --git a/hotspot/test/runtime/6626217/Test6626217.sh b/hotspot/test/runtime/6626217/Test6626217.sh
index 52031ed7beb..99ee83a06ec 100644
--- a/hotspot/test/runtime/6626217/Test6626217.sh
+++ b/hotspot/test/runtime/6626217/Test6626217.sh
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@ sleep 2
# Compile all the usual suspects, including the default 'many_loader'
${CP} many_loader1.java.foo many_loader.java
-${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint *.java
+${JAVAC} ${TESTJAVACOPTS} -Xlint *.java
# Rename the class files, so the custom loader (and not the system loader) will find it
${MV} from_loader2.class from_loader2.impl2
@@ -62,7 +62,7 @@ ${MV} from_loader2.class from_loader2.impl2
# Compile the next version of 'many_loader'
${MV} many_loader.class many_loader.impl1
${CP} many_loader2.java.foo many_loader.java
-${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint many_loader.java
+${JAVAC} ${TESTJAVACOPTS} -Xlint many_loader.java
# Rename the class file, so the custom loader (and not the system loader) will find it
${MV} many_loader.class many_loader.impl2
diff --git a/hotspot/test/runtime/8003720/Test8003720.java b/hotspot/test/runtime/8003720/Test8003720.java
index 88682712a2a..0963628a80a 100644
--- a/hotspot/test/runtime/8003720/Test8003720.java
+++ b/hotspot/test/runtime/8003720/Test8003720.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
* @test
* @bug 8003720
* @summary Method in interpreter stack frame can be deallocated
- * @compile -XDignore.symbol.file -source 1.7 -target 1.7 Victim.java
+ * @compile -XDignore.symbol.file Victim.java
* @run main/othervm -Xverify:all -Xint Test8003720
*/
diff --git a/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java b/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java
new file mode 100644
index 00000000000..8cba4a5bf72
--- /dev/null
+++ b/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8048933
+ * @summary TraceExceptions output should have the exception message - useful for ClassNotFoundExceptions especially
+ * @library /testlibrary
+ */
+
+import com.oracle.java.testlibrary.*;
+
+public class TraceExceptionsTest {
+ public static void main(String[] args) throws Exception {
+
+ if (!Platform.isDebugBuild()) {
+ System.out.println("Skip the test on product builds since XX:+TraceExceptions is not available on product builds");
+ return;
+ }
+
+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+ "-XX:+TraceExceptions", "NoClassFound");
+ OutputAnalyzer output = new OutputAnalyzer(pb.start());
+ output.shouldContain("");
+ output.shouldNotContain("");
+ output.shouldHaveExitValue(1);
+ }
+}
diff --git a/hotspot/test/runtime/verifier/OverriderMsg.java b/hotspot/test/runtime/verifier/OverriderMsg.java
new file mode 100644
index 00000000000..f8c7155ee57
--- /dev/null
+++ b/hotspot/test/runtime/verifier/OverriderMsg.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import static jdk.internal.org.objectweb.asm.Opcodes.*;
+import com.oracle.java.testlibrary.*;
+
+/*
+ * @test OverriderMsg
+ * @bug 8026894
+ * @library /testlibrary
+ * @compile -XDignore.symbol.file OverriderMsg.java
+ * @run main/othervm OverriderMsg
+ */
+
+// This test checks that the super class name is included in the message when
+// a method is detected overriding a final method in its super class. The
+// asm part of the test creates these two classes:
+//
+// public class HasFinal {
+// public final void m(String s) { }
+// }
+//
+// public class Overrider extends HasFinal {
+// public void m(String s) { }
+// public static void main(String[] args) { }
+// }
+//
+public class OverriderMsg {
+
+ public static void dump_HasFinal () throws Exception {
+
+ ClassWriter cw = new ClassWriter(0);
+ MethodVisitor mv;
+
+ cw.visit(V1_7, ACC_PUBLIC + ACC_SUPER, "HasFinal", null, "java/lang/Object", null);
+
+ {
+ mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V");
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PUBLIC + ACC_FINAL, "m", "(Ljava/lang/String;)V", null, null);
+ mv.visitCode();
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(0, 2);
+ mv.visitEnd();
+ }
+ cw.visitEnd();
+ try (FileOutputStream fos = new FileOutputStream(new File("HasFinal.class"))) {
+ fos.write(cw.toByteArray());
+ }
+ }
+
+
+ public static void dump_Overrider () throws Exception {
+
+ ClassWriter cw = new ClassWriter(0);
+ MethodVisitor mv;
+ cw.visit(V1_7, ACC_PUBLIC + ACC_SUPER, "Overrider", null, "HasFinal", null);
+
+ {
+ mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKESPECIAL, "HasFinal", "", "()V");
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PUBLIC, "m", "(Ljava/lang/String;)V", null, null);
+ mv.visitCode();
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(0, 2);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "main", "([Ljava/lang/String;)V", null, null);
+ mv.visitCode();
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(0, 1);
+ mv.visitEnd();
+ }
+ cw.visitEnd();
+
+ try (FileOutputStream fos = new FileOutputStream(new File("Overrider.class"))) {
+ fos.write(cw.toByteArray());
+ }
+ }
+
+
+ public static void main(String... args) throws Exception {
+ dump_HasFinal();
+ dump_Overrider();
+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", ".", "Overrider");
+ OutputAnalyzer output = new OutputAnalyzer(pb.start());
+ output.shouldContain(
+ "java.lang.VerifyError: class Overrider overrides final method HasFinal.m(Ljava/lang/String;)V");
+ output.shouldHaveExitValue(1);
+ }
+
+}
diff --git a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
index 8c817182e4c..bc38438285e 100644
--- a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
+++ b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
@@ -142,6 +142,8 @@ public class WhiteBox {
// Memory
public native void readReservedMemory();
+ public native long allocateMetaspace(ClassLoader classLoader, long size);
+ public native void freeMetaspace(ClassLoader classLoader, long addr, long size);
// force Full GC
public native void fullGC();
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index 0bc9cacf9a9..710410b142d 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -261,3 +261,7 @@ e88cecf5a21b760ff7d7761c2db6bb8c82bc9f0c jdk9-b12
a1461221b05d4620e4d7d1907e2a0282aaedf31c jdk9-b16
6f923fcbe5129eceb9617a9a18dbdd743980e785 jdk9-b17
5afa90c28742d175431be75f9098745510bd2b30 jdk9-b18
+f9c82769a6bc2b219a8f01c24afe5c91039267d7 jdk9-b19
+94fd4d9d3a75819644b21e18c8a567fd0e973eaf jdk9-b20
+7eb0ab676ea75cb1dd31c613e77008a7d8cb0af7 jdk9-b21
+82b94ff002c6e007a03bf0f364ca94b381e09135 jdk9-b22
diff --git a/jaxp/src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java b/jaxp/src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java
index 4d28f2a92f5..db83c73b299 100644
--- a/jaxp/src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java
+++ b/jaxp/src/com/sun/org/apache/bcel/internal/classfile/JavaClass.java
@@ -78,7 +78,6 @@ import java.util.StringTokenizer;
* class file. Those interested in programatically generating classes
* should see the ClassGen class.
- * @version $Id: JavaClass.java,v 1.4 2007-07-19 04:34:42 ofung Exp $
* @see com.sun.org.apache.bcel.internal.generic.ClassGen
* @author M. Dahm
*/
diff --git a/jaxp/src/com/sun/org/apache/bcel/internal/util/Class2HTML.java b/jaxp/src/com/sun/org/apache/bcel/internal/util/Class2HTML.java
index 5a9e094d460..52b9df945c7 100644
--- a/jaxp/src/com/sun/org/apache/bcel/internal/util/Class2HTML.java
+++ b/jaxp/src/com/sun/org/apache/bcel/internal/util/Class2HTML.java
@@ -82,7 +82,6 @@ import com.sun.org.apache.bcel.internal.Constants;
* method in the Method's frame will jump to the appropiate method in
* the Code frame.
*
- * @version $Id: Class2HTML.java,v 1.3 2007-07-19 04:34:52 ofung Exp $
* @author M. Dahm
*/
public class Class2HTML implements Constants
diff --git a/jaxp/src/com/sun/org/apache/bcel/internal/util/ClassPath.java b/jaxp/src/com/sun/org/apache/bcel/internal/util/ClassPath.java
index 0cd5021ddb1..ac4745ea97f 100644
--- a/jaxp/src/com/sun/org/apache/bcel/internal/util/ClassPath.java
+++ b/jaxp/src/com/sun/org/apache/bcel/internal/util/ClassPath.java
@@ -66,7 +66,6 @@ import java.io.*;
* Responsible for loading (class) files from the CLASSPATH. Inspired by
* sun.tools.ClassPath.
*
- * @version $Id: ClassPath.java,v 1.4 2007-07-19 04:34:52 ofung Exp $
* @author M. Dahm
*/
public class ClassPath implements Serializable {
diff --git a/jaxp/src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java b/jaxp/src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java
index 1540f6d5c8b..d264b047ba1 100644
--- a/jaxp/src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java
+++ b/jaxp/src/com/sun/org/apache/bcel/internal/util/JavaWrapper.java
@@ -72,7 +72,6 @@ import java.lang.reflect.*;
* java com.sun.org.apache.bcel.internal.util.JavaWrapper -Dbcel.classloader=foo.MyLoader <real.class.name> [arguments]
*
*
- * @version $Id: JavaWrapper.java,v 1.3 2007-07-19 04:34:52 ofung Exp $
* @author M. Dahm
* @see ClassLoader
*/
diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java b/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java
index 095a6e74b96..9b3b0fa46cd 100644
--- a/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java
@@ -32,7 +32,6 @@ import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
*
* @author Huizhe Wang, Oracle
*
- * @version $Id: Constants.java,v 1.14 2011-06-07 04:39:40 joehw Exp $
*/
public final class XalanConstants {
diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java
index 034d8eec84b..7d5d104501d 100644
--- a/jaxp/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java
@@ -32,7 +32,6 @@ package com.sun.org.apache.xalan.internal.utils;
* class and modified to be used as a general utility for creating objects
* dynamically.
*
- * @version $Id: ObjectFactory.java,v 1.11 2010-11-01 04:34:25 joehw Exp $
*/
public class ObjectFactory {
diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java b/jaxp/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java
index 928da3e9e9d..a6b99891be4 100644
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java
@@ -92,7 +92,6 @@ import org.w3c.dom.Node;
* of thing but in a much simpler manner.
*
* @author Shane_Curcuru@us.ibm.com
- * @version $Id: EnvironmentCheck.java,v 1.10 2010-11-01 04:34:13 joehw Exp $
*/
public class EnvironmentCheck
{
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttrImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttrImpl.java
index 352fba6a18c..873f7be9842 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttrImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttrImpl.java
@@ -109,7 +109,6 @@ import org.w3c.dom.Text;
* @author Arnaud Le Hors, IBM
* @author Joe Kesselman, IBM
* @author Andy Clark, IBM
- * @version $Id: AttrImpl.java,v 1.5 2008/06/10 00:59:32 joehw Exp $
* @since PR-DOM-Level-1-19980818.
*
*/
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttrNSImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttrNSImpl.java
index 7defc559d01..34de50dccde 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttrNSImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttrNSImpl.java
@@ -37,7 +37,6 @@ import org.w3c.dom.DOMException;
* @author Arnaud Le Hors, IBM
* @author Andy Clark, IBM
* @author Ralf Pfeiffer, IBM
- * @version $Id: AttrNSImpl.java,v 1.7 2010-11-01 04:39:37 joehw Exp $
*/
public class AttrNSImpl
extends AttrImpl {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttributeMap.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttributeMap.java
index 8d2d054fccc..5f7f4e17340 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttributeMap.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttributeMap.java
@@ -40,7 +40,6 @@ import org.w3c.dom.Node;
*
* @xerces.internal
*
- * @version $Id: AttributeMap.java,v 1.7 2010-11-01 04:39:37 joehw Exp $
*/
public class AttributeMap extends NamedNodeMapImpl {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java
index f20775e3f7a..45b91dc9aa2 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java
@@ -52,7 +52,6 @@ import org.w3c.dom.ls.LSSerializer;
*
* @xerces.internal
*
- * @version $Id: CoreDOMImplementationImpl.java,v 1.6 2010-11-01 04:39:37 joehw Exp $
* @since PR-DOM-Level-1-19980818.
*/
public class CoreDOMImplementationImpl
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java
index 46cbc349ff4..2fb6f8b225d 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java
@@ -79,7 +79,6 @@ import org.w3c.dom.ls.LSSerializer;
* @author Joe Kesselman, IBM
* @author Andy Clark, IBM
* @author Ralf Pfeiffer, IBM
- * @version $Id: CoreDocumentImpl.java,v 1.9 2010-11-01 04:39:37 joehw Exp $
* @since PR-DOM-Level-1-19980818.
*/
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java
index 1e8dcd98817..189abdff259 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java
@@ -68,7 +68,6 @@ import org.w3c.dom.ls.LSResourceResolver;
*
* @author Elena Litani, IBM
* @author Neeraj Bajaj, Sun Microsystems.
- * @version $Id: DOMConfigurationImpl.java,v 1.9 2010-11-01 04:39:37 joehw Exp $
*/
public class DOMConfigurationImpl extends ParserConfigurationSettings
implements XMLParserConfiguration, DOMConfiguration {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java
index f7d131fdb9b..1d30c9e76b4 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java
@@ -31,7 +31,6 @@ import java.util.ResourceBundle;
* @xerces.internal
*
* @author Sandy Gao, IBM
- * @version $Id: DOMMessageFormatter.java,v 1.6 2010-11-01 04:39:38 joehw Exp $
*/
public class DOMMessageFormatter {
public static final String DOM_DOMAIN = "http://www.w3.org/dom/DOMTR";
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java
index 3758f399230..651bd741432 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java
@@ -94,7 +94,6 @@ import org.w3c.dom.Text;
*
* @author Elena Litani, IBM
* @author Neeraj Bajaj, Sun Microsystems, inc.
- * @version $Id: DOMNormalizer.java,v 1.9 2010-11-01 04:39:38 joehw Exp $
*/
public class DOMNormalizer implements XMLDocumentHandler {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java
index 92c03b0baad..8f133b8799a 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java
@@ -40,7 +40,6 @@ import org.w3c.dom.Node;
*
* @xerces.internal
*
- * @version $Id: DeferredDocumentImpl.java,v 1.11 2010-11-01 04:39:38 joehw Exp $
* @since PR-DOM-Level-1-19980818.
*/
public class DeferredDocumentImpl
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java
index 4cc06483c56..55d43c6df90 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java
@@ -76,7 +76,6 @@ import org.w3c.dom.traversal.TreeWalker;
* @author Joe Kesselman, IBM
* @author Andy Clark, IBM
* @author Ralf Pfeiffer, IBM
- * @version $Id: DocumentImpl.java,v 1.6 2010/07/20 20:25:24 joehw Exp $
* @since PR-DOM-Level-1-19980818.
*/
public class DocumentImpl
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/ElementNSImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/ElementNSImpl.java
index 35757db0911..042835e7ce6 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/ElementNSImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/ElementNSImpl.java
@@ -42,7 +42,6 @@ import org.w3c.dom.DOMException;
*
* @author Elena litani, IBM
* @author Neeraj Bajaj, Sun Microsystems
- * @version $Id: ElementNSImpl.java,v 1.7 2010-11-01 04:39:39 joehw Exp $
*/
public class ElementNSImpl
extends ElementImpl {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java
index fcf40479703..f3e0c942758 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java
@@ -56,7 +56,6 @@ import org.w3c.dom.Node;
*
* @xerces.internal
*
- * @version $Id: NamedNodeMapImpl.java,v 1.8 2010-11-01 04:39:39 joehw Exp $
* @since PR-DOM-Level-1-19980818.
*/
public class NamedNodeMapImpl
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/NodeListCache.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/NodeListCache.java
index e0923ce9960..585c41e6364 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/NodeListCache.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/NodeListCache.java
@@ -30,7 +30,6 @@ import java.io.Serializable;
*
* @author Arnaud Le Hors, IBM
*
- * @version $Id: NodeListCache.java,v 1.6 2010/07/20 20:25:25 joehw Exp $
*/
class NodeListCache implements Serializable {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/PSVIElementNSImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/PSVIElementNSImpl.java
index 7b26a9ad96c..272a7c93a18 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/PSVIElementNSImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/PSVIElementNSImpl.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.xs.*;
*
* @author Sandy Gao, IBM
*
- * @version $Id: PSVIElementNSImpl.java,v 1.6 2010/08/20 18:51:54 joehw Exp $
*/
public class PSVIElementNSImpl extends ElementNSImpl implements ElementPSVI {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/ParentNode.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/ParentNode.java
index 7725c4c530d..3481afe1f6a 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/ParentNode.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/ParentNode.java
@@ -68,7 +68,6 @@ import org.w3c.dom.UserDataHandler;
* @author Arnaud Le Hors, IBM
* @author Joe Kesselman, IBM
* @author Andy Clark, IBM
- * @version $Id: ParentNode.java,v 1.6 2009/07/21 20:30:28 joehw Exp $
*/
public abstract class ParentNode
extends ChildNode {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java
index 4eab0fadfe9..147a3ab43a6 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java
@@ -31,7 +31,6 @@ import java.util.NoSuchElementException;
*
* @author Andy Clark, IBM
*
- * @version $Id: Constants.java,v 1.14 2010-11-01 04:39:40 joehw Exp $
*/
public final class Constants {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/Version.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Version.java
index ac62db7dc26..41a2b620b5c 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/Version.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Version.java
@@ -64,7 +64,6 @@ package com.sun.org.apache.xerces.internal.impl;
/**
* This class defines the version number of the parser.
*
- * @version $Id: Version.java,v 1.4 2010-11-01 04:39:40 joehw Exp $
*/
public class Version {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java
index dda470ae873..cf5f3b9059b 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java
@@ -96,7 +96,6 @@ import com.sun.org.apache.xerces.internal.xni.XNIException;
* @author Arnaud Le Hors, IBM
* @author Eric Ye, IBM
*
- * @version $Id: XML11DocumentScannerImpl.java,v 1.5 2010/08/04 20:59:09 joehw Exp $
*/
public class XML11DocumentScannerImpl
extends XMLDocumentScannerImpl {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java
index 518c09ab7f6..130c6227511 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java
@@ -77,7 +77,6 @@ import java.io.IOException;
*
* @author Michael Glavassevich, IBM
* @author Neil Graham, IBM
- * @version $Id: XML11EntityScanner.java,v 1.5 2010-11-01 04:39:40 joehw Exp $
*/
public class XML11EntityScanner
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java
index 7a826dfcc97..7d6b3cbd043 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java
@@ -108,7 +108,6 @@ import javax.xml.stream.events.XMLEvent;
* @author Elena Litani, IBM
* @author Michael Glavassevich, IBM
* @author Sunitha Reddy, Sun Microsystems
- * @version $Id: XML11NSDocumentScannerImpl.java,v 1.6 2010-11-01 04:39:40 joehw Exp $
*/
public class XML11NSDocumentScannerImpl extends XML11DocumentScannerImpl {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
index d2ede948ac1..74db88ca6cd 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
@@ -69,7 +69,6 @@ import com.sun.xml.internal.stream.Entity;
* @author Glenn Marcy, IBM
* @author Eric Ye, IBM
*
- * @version $Id: XMLDTDScannerImpl.java,v 1.8 2010-11-01 04:39:41 joehw Exp $
*/
public class XMLDTDScannerImpl
extends XMLScanner
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
index 01468284cd1..fc8b5098a57 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
@@ -78,7 +78,6 @@ import javax.xml.stream.events.XMLEvent;
* @author Arnaud Le Hors, IBM
* @author Eric Ye, IBM
* @author Sunitha Reddy, SUN Microsystems
- * @version $Id: XMLDocumentFragmentScannerImpl.java,v 1.19 2010-11-02 19:54:55 joehw Exp $
*
*/
public class XMLDocumentFragmentScannerImpl
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java
index c2d58bd4070..d191de9ba89 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java
@@ -65,7 +65,6 @@ import javax.xml.stream.events.XMLEvent;
* Refer to the table in unit-test javax.xml.stream.XMLStreamReaderTest.SupportDTD for changes
* related to property SupportDTD.
* @author Joe Wang, Sun Microsystems
- * @version $Id: XMLDocumentScannerImpl.java,v 1.17 2010-11-01 04:39:41 joehw Exp $
*/
public class XMLDocumentScannerImpl
extends XMLDocumentFragmentScannerImpl{
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java
index 988fd6f9c60..7a70b3abece 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java
@@ -83,7 +83,6 @@ import java.util.StringTokenizer;
* @author K.Venugopal SUN Microsystems
* @author Neeraj Bajaj SUN Microsystems
* @author Sunitha Reddy SUN Microsystems
- * @version $Id: XMLEntityManager.java,v 1.17 2010-11-01 04:39:41 joehw Exp $
*/
public class XMLEntityManager implements XMLComponent, XMLEntityResolver {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java
index 8d0ed6d76fd..e6ce89d3816 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java
@@ -111,7 +111,6 @@ import org.xml.sax.ErrorHandler;
* @author Eric Ye, IBM
* @author Andy Clark, IBM
*
- * @version $Id: XMLErrorReporter.java,v 1.5 2010-11-01 04:39:41 joehw Exp $
*/
public class XMLErrorReporter
implements XMLComponent {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java
index 66b8179b97b..36d72ac51df 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java
@@ -58,7 +58,6 @@ import javax.xml.stream.events.XMLEvent;
* @author Neeraj Bajaj, Sun Microsystems
* @author Venugopal Rao K, Sun Microsystems
* @author Elena Litani, IBM
- * @version $Id: XMLNSDocumentScannerImpl.java,v 1.11 2010-11-01 04:39:41 joehw Exp $
*/
public class XMLNSDocumentScannerImpl
extends XMLDocumentScannerImpl {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java
index 13c27bc8fed..33a18a84444 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java
@@ -97,7 +97,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
*
* @author Andy Clark, IBM
*
- * @version $Id: XMLNamespaceBinder.java,v 1.4 2010-11-01 04:39:41 joehw Exp $
*/
public class XMLNamespaceBinder
implements XMLComponent, XMLDocumentFilter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
index 0cb44b2c0c0..28fbc69270e 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
@@ -69,7 +69,6 @@ import com.sun.xml.internal.stream.Entity;
* @author Eric Ye, IBM
* @author K.Venugopal SUN Microsystems
* @author Sunitha Reddy, SUN Microsystems
- * @version $Id: XMLScanner.java,v 1.12 2010-11-01 04:39:41 joehw Exp $
*/
public abstract class XMLScanner
implements XMLComponent {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/BalancedDTDGrammar.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/BalancedDTDGrammar.java
index 0b09e34ffc1..c144a2490b6 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/BalancedDTDGrammar.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/BalancedDTDGrammar.java
@@ -32,7 +32,6 @@ import com.sun.org.apache.xerces.internal.xni.XNIException;
* @xerces.internal
*
* @author Michael Glavassevich, IBM
- * @version $Id: BalancedDTDGrammar.java,v 1.1 2010/08/11 07:18:38 joehw Exp $
*/
final class BalancedDTDGrammar extends DTDGrammar {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java
index 71a9231f71b..f0478f45fb8 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java
@@ -101,7 +101,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
* @author Andy Clark, IBM
* @author Neil Graham, IBM
*
- * @version $Id: DTDGrammar.java,v 1.4 2010/08/11 07:18:37 joehw Exp $
*/
public class DTDGrammar
implements XMLDTDHandler, XMLDTDContentModelHandler, EntityState, Grammar {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.java
index b9e48e9225e..90a55affe91 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.java
@@ -75,7 +75,6 @@ import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl;
* @xerces.internal
*
* @author Neil Graham, IBM
- * @version $Id: XMLDTDDescription.java,v 1.4 2010/08/11 07:18:38 joehw Exp $
*/
public class XMLDTDDescription extends XMLResourceIdentifierImpl
implements com.sun.org.apache.xerces.internal.xni.grammars.XMLDTDDescription {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java
index ea343942ea5..eea1b94613f 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java
@@ -108,7 +108,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
* @author Neil Graham, IBM
* @author Michael Glavassevich, IBM
*
- * @version $Id: XMLDTDLoader.java,v 1.6 2010-11-01 04:39:42 joehw Exp $
*/
public class XMLDTDLoader
extends XMLDTDProcessor
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java
index 45e1b31e0bc..85bdb7f74c5 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java
@@ -113,7 +113,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
*
* @author Neil Graham, IBM
*
- * @version $Id: XMLDTDProcessor.java,v 1.5 2010-11-01 04:39:42 joehw Exp $
*/
public class XMLDTDProcessor
implements XMLComponent, XMLDTDFilter, XMLDTDContentModelFilter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java
index 05308782e62..01c8c54f7a7 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java
@@ -83,7 +83,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
* @author Jeffrey Rodriguez IBM
* @author Neil Graham, IBM
*
- * @version $Id: XMLDTDValidator.java,v 1.8 2010-11-01 04:39:42 joehw Exp $
*/
public class XMLDTDValidator
implements XMLComponent, XMLDocumentFilter, XMLDTDValidatorFilter, RevalidationHandler {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java
index 9a4e0f5c122..008bd6ff8fe 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java
@@ -68,7 +68,6 @@ import com.sun.org.apache.xerces.internal.xni.QName;
/**
- * @version $Id: DFAContentModel.java,v 1.4 2010/08/06 23:49:43 joehw Exp $
* DFAContentModel is the derivative of ContentModel that does
* all of the non-trivial element content validation. This class does
* the conversion from the regular expression to the DFA that
@@ -82,7 +81,6 @@ import com.sun.org.apache.xerces.internal.xni.QName;
*
* @xerces.internal
*
- * @version $Id: DFAContentModel.java,v 1.4 2010/08/06 23:49:43 joehw Exp $
*/
public class DFAContentModel
implements ContentModelValidator {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java
index 15afa2e1407..fd7426f7551 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java
@@ -32,7 +32,6 @@ import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
*
* @author Sandy Gao, IBM
*
- * @version $Id: DTDDVFactory.java,v 1.6 2010-11-01 04:39:43 joehw Exp $
*/
public abstract class DTDDVFactory {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java
index f38b1d3797f..363b26844f3 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java
@@ -35,7 +35,6 @@ import java.util.MissingResourceException;
*
* @author Sandy Gao, IBM
*
- * @version $Id: DatatypeException.java,v 1.6 2010-11-01 04:39:43 joehw Exp $
*/
public class DatatypeException extends Exception {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/SchemaDVFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/SchemaDVFactory.java
index 902d9d3fdea..47646f2dad2 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/SchemaDVFactory.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/SchemaDVFactory.java
@@ -40,7 +40,6 @@ import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
*
* @author Sandy Gao, IBM
*
- * @version $Id: SchemaDVFactory.java,v 1.6 2010-11-01 04:39:43 joehw Exp $
*/
public abstract class SchemaDVFactory {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/ValidationContext.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/ValidationContext.java
index 6ff4d66031e..da8d550a84a 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/ValidationContext.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/ValidationContext.java
@@ -29,7 +29,6 @@ import java.util.Locale;
* @xerces.internal
*
* @author Sandy Gao, IBM
- * @version $Id: ValidationContext.java,v 1.6 2010/07/23 02:09:29 joehw Exp $
*/
public interface ValidationContext {
// whether to validate against facets
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java
index 984fb2ab404..3357593489d 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java
@@ -31,7 +31,6 @@ import com.sun.org.apache.xerces.internal.xs.datatypes.ByteList;
*
* @author Ankit Pasricha, IBM
*
- * @version $Id: ByteListImpl.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
*/
public class ByteListImpl extends AbstractList implements ByteList {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AbstractDateTimeDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AbstractDateTimeDV.java
index d9d6587379b..64242a5cf95 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AbstractDateTimeDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AbstractDateTimeDV.java
@@ -47,7 +47,6 @@ import com.sun.org.apache.xerces.internal.xs.datatypes.XSDateTime;
* @author Len Berman
* @author Gopal Sharma, SUN Microsystems Inc.
*
- * @version $Id: AbstractDateTimeDV.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
*/
public abstract class AbstractDateTimeDV extends TypeValidator {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/Base64BinaryDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/Base64BinaryDV.java
index fcfa039df43..47185b1725d 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/Base64BinaryDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/Base64BinaryDV.java
@@ -33,7 +33,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.util.ByteListImpl;
* @author Neeraj Bajaj, Sun Microsystems, inc.
* @author Sandy Gao, IBM
*
- * @version $Id: Base64BinaryDV.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
*/
public class Base64BinaryDV extends TypeValidator {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java
index 198f3aba046..715b0ee040c 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.xs.XSObjectList;
* @author Neeraj Bajaj, Sun Microsystems, inc.
* @author Sandy Gao, IBM
*
- * @version $Id: BaseDVFactory.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
*/
public class BaseDVFactory extends SchemaDVFactory {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseSchemaDVFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseSchemaDVFactory.java
index da30a8f5fed..3cc03f0b449 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseSchemaDVFactory.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseSchemaDVFactory.java
@@ -38,7 +38,6 @@ import com.sun.org.apache.xerces.internal.xs.XSObjectList;
* @author Sandy Gao, IBM
* @author Khaled Noaman, IBM
*
- * @version $Id: BaseSchemaDVFactory.java,v 1.2 2010-10-26 23:01:03 joehw Exp $
*/
public abstract class BaseSchemaDVFactory extends SchemaDVFactory {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateDV.java
index 01b0eabcf6d..d302e22fd1a 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateDV.java
@@ -34,7 +34,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
* @author Elena Litani
* @author Gopal Sharma, SUN Microsystems Inc.
*
- * @version $Id: DateDV.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
*/
public class DateDV extends DateTimeDV {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateTimeDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateTimeDV.java
index 6b2011d974d..2a19f8cec9f 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateTimeDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateTimeDV.java
@@ -36,7 +36,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
* @author Elena Litani
* @author Gopal Sharma, SUN Microsystem Inc.
*
- * @version $Id: DateTimeDV.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
*/
public class DateTimeDV extends AbstractDateTimeDV {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayDV.java
index 1e501f01be4..d0e6ce6021e 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayDV.java
@@ -33,7 +33,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
*
* @author Elena Litani
* @author Gopal Sharma, SUN Microsystem Inc.
- * @version $Id: DayDV.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
*/
public class DayDV extends AbstractDateTimeDV {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayTimeDurationDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayTimeDurationDV.java
index dd16f196cd3..8488503acee 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayTimeDurationDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayTimeDurationDV.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
*
* @author Ankit Pasricha, IBM
*
- * @version $Id: DayTimeDurationDV.java,v 1.6 2010-11-01 04:39:46 joehw Exp $
*/
class DayTimeDurationDV extends DurationDV {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DoubleDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DoubleDV.java
index e884d0d62d6..a25d6d7243e 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DoubleDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DoubleDV.java
@@ -32,7 +32,6 @@ import com.sun.org.apache.xerces.internal.xs.datatypes.XSDouble;
* @author Neeraj Bajaj, Sun Microsystems, inc.
* @author Sandy Gao, IBM
*
- * @version $Id: DoubleDV.java,v 1.7 2010-11-01 04:39:46 joehw Exp $
*/
public class DoubleDV extends TypeValidator {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DurationDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DurationDV.java
index 1ec86d0ae6d..9ad95cc77b4 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DurationDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DurationDV.java
@@ -36,7 +36,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
*
* @author Elena Litani
* @author Gopal Sharma, SUN Microsystem Inc.
- * @version $Id: DurationDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
*/
public class DurationDV extends AbstractDateTimeDV {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java
index fa7e79e42c8..13d166a8f53 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java
@@ -32,7 +32,6 @@ import com.sun.org.apache.xerces.internal.util.SymbolHash;
*
* @author Khaled Noaman, IBM
*
- * @version $Id: ExtendedSchemaDVFactoryImpl.java,v 1.2 2010-10-26 23:01:03 joehw Exp $
*/
public class ExtendedSchemaDVFactoryImpl extends BaseSchemaDVFactory {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/FloatDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/FloatDV.java
index 9ff0ecfccd9..f2478233564 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/FloatDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/FloatDV.java
@@ -32,7 +32,6 @@ import com.sun.org.apache.xerces.internal.xs.datatypes.XSFloat;
* @author Neeraj Bajaj, Sun Microsystems, inc.
* @author Sandy Gao, IBM
*
- * @version $Id: FloatDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
*/
public class FloatDV extends TypeValidator {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/HexBinaryDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/HexBinaryDV.java
index 2b872263637..99bc19709dc 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/HexBinaryDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/HexBinaryDV.java
@@ -33,7 +33,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.util.HexBin;
* @author Neeraj Bajaj, Sun Microsystems, inc.
* @author Sandy Gao, IBM
*
- * @version $Id: HexBinaryDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
*/
public class HexBinaryDV extends TypeValidator {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.java
index ca074323d37..07d49b0988c 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.java
@@ -34,7 +34,6 @@ import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
* @author Neeraj Bajaj, Sun Microsystems, inc.
* @author Sandy Gao, IBM
*
- * @version $Id: ListDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
*/
public class ListDV extends TypeValidator{
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDV.java
index ea57736397f..175c5ebf2d9 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDV.java
@@ -34,7 +34,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
* @author Elena Litani
* @author Gopal Sharma, SUN Microsystem Inc.
*
- * @version $Id: MonthDV.java,v 1.8 2010-11-01 04:39:47 joehw Exp $
*/
public class MonthDV extends AbstractDateTimeDV {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDayDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDayDV.java
index 4b4dc118ada..0edc0006ad7 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDayDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDayDV.java
@@ -34,7 +34,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
* @author Elena Litani
* @author Gopal Sharma, SUN Microsystem Inc.
*
- * @version $Id: MonthDayDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
*/
public class MonthDayDV extends AbstractDateTimeDV {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java
index 3e0570b51aa..5bb8a4350ed 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java
@@ -32,7 +32,6 @@ import com.sun.org.apache.xerces.internal.util.SymbolHash;
* @author Neeraj Bajaj, Sun Microsystems, inc.
* @author Sandy Gao, IBM
*
- * @version $Id: SchemaDVFactoryImpl.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
*/
public class SchemaDVFactoryImpl extends BaseSchemaDVFactory {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/TimeDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/TimeDV.java
index c9bbae21174..4c7bb4dd46d 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/TimeDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/TimeDV.java
@@ -34,7 +34,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
* @author Elena Litani
* @author Gopal Sharma, SUN Microsystem Inc.
*
- * @version $Id: TimeDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
*/
public class TimeDV extends AbstractDateTimeDV {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java
index c9c913464e6..fa4a495a571 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java
@@ -60,7 +60,6 @@ import org.w3c.dom.TypeInfo;
* @author Sandy Gao, IBM
* @author Neeraj Bajaj, Sun Microsystems, inc.
*
- * @version $Id: XSSimpleTypeDecl.java 3029 2011-04-24 17:50:18Z joehw $
*/
public class XSSimpleTypeDecl implements XSSimpleType, TypeInfo {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDelegate.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDelegate.java
index 1b683db3457..318bc69299e 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDelegate.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDelegate.java
@@ -39,7 +39,6 @@ import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
*
* @xerces.internal
*
- * @version $Id: XSSimpleTypeDelegate.java,v 1.3 2010-11-01 04:39:47 joehw Exp $
*/
public class XSSimpleTypeDelegate
implements XSSimpleType {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearDV.java
index d069c401a0f..02c5058f55c 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearDV.java
@@ -34,7 +34,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
* @author Elena Litani
* @author Gopal Sharma, SUN Microsystem Inc.
*
- * @version $Id: YearDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
*/
public class YearDV extends AbstractDateTimeDV {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDV.java
index 6b96deb1ded..b9fde68ca18 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDV.java
@@ -34,7 +34,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
* @author Elena Litani
* @author Gopal Sharma, SUN Microsystem Inc.
*
- * @version $Id: YearMonthDV.java,v 1.7 2010-11-01 04:39:47 joehw Exp $
*/
public class YearMonthDV extends AbstractDateTimeDV{
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDurationDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDurationDV.java
index 4723a65cf32..c11413097ec 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDurationDV.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDurationDV.java
@@ -34,7 +34,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.ValidationContext;
*
* @author Ankit Pasricha, IBM
*
- * @version $Id: YearMonthDurationDV.java,v 1.6 2010-11-01 04:39:47 joehw Exp $
*/
class YearMonthDurationDV extends DurationDV {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java
index adb8c44ab2e..0f7ed95d5a8 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java
@@ -33,7 +33,6 @@ import java.util.ResourceBundle;
* @xerces.internal
*
* @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter.java 3094 2012-03-21 05:50:01Z joehw $
*
*/
public class XMLMessageFormatter implements MessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java
index 1f9d2816165..24c5e41d4d7 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
* @xerces.internal
*
* @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_de.java 3094 2012-03-21 05:50:01Z joehw $
*
*/
public class XMLMessageFormatter_de implements MessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java
index 164a2513a9e..5dab448b1fb 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
* @xerces.internal
*
* @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_es.java 3094 2012-03-21 05:50:01Z joehw $
*
*/
public class XMLMessageFormatter_es implements MessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java
index e4e41292716..1b4974a2e8c 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
* @xerces.internal
*
* @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_fr.java 3094 2012-03-21 05:50:01Z joehw $
*
*/
public class XMLMessageFormatter_fr implements MessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java
index e2dd5132d21..66d1b90951c 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
* @xerces.internal
*
* @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_it.java 3094 2012-03-21 05:50:01Z joehw $
*
*/
public class XMLMessageFormatter_it implements MessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java
index b3fb8563e67..14363761574 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
* @xerces.internal
*
* @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_ja.java 3094 2012-03-21 05:50:01Z joehw $
*
*/
public class XMLMessageFormatter_ja implements MessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java
index 3de7757c5bc..a042bdd9afe 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
* @xerces.internal
*
* @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_ko.java 3094 2012-03-21 05:50:01Z joehw $
*
*/
public class XMLMessageFormatter_ko implements MessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java
index 59b3d1d30a7..053445dc06a 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
* @xerces.internal
*
* @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_pt_BR.java 3094 2012-03-21 05:50:01Z joehw $
*
*/
public class XMLMessageFormatter_pt_BR implements MessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java
index 00217ae4f7b..bb4d9531d38 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
* @xerces.internal
*
* @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_sv.java 3094 2012-03-21 05:50:01Z joehw $
*
*/
public class XMLMessageFormatter_sv implements MessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java
index 4cfa9686da0..13f6be55cb6 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
* @xerces.internal
*
* @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_zh_CN.java 3094 2012-03-21 05:50:01Z joehw $
*
*/
public class XMLMessageFormatter_zh_CN implements MessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java
index 4f34fa2adc5..1965d571783 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
* @xerces.internal
*
* @author Eric Ye, IBM
- * @version $Id: XMLMessageFormatter_zh_TW.java 3094 2012-03-21 05:50:01Z joehw $
*
*/
public class XMLMessageFormatter_zh_TW implements MessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.java
index a04c57dcef7..686e2b1c916 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.java
@@ -34,7 +34,6 @@ import java.util.Locale;
* @xerces.internal
*
* @author Elena Litani, IBM
- * @version $Id: ValidationState.java,v 1.7 2010-11-01 04:39:53 joehw Exp $
*/
public class ValidationState implements ValidationContext {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/CaseInsensitiveMap.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/CaseInsensitiveMap.java
index 202f239feaf..3f5da982fa4 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/CaseInsensitiveMap.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/CaseInsensitiveMap.java
@@ -22,7 +22,6 @@
package com.sun.org.apache.xerces.internal.impl.xpath.regex;
/**
- * @version $Id: CaseInsensitiveMap.java,v 1.1 2010/07/27 06:29:27 joehw Exp $
*/
public class CaseInsensitiveMap {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java
index 22e2a710c9b..aa18a901dac 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java
@@ -29,7 +29,6 @@ import java.util.Locale;
* @xerces.internal
*
* @author TAMURA Kent <kent@trl.ibm.co.jp>
- * @version $Id: ParserForXMLSchema.java,v 1.9 2010-11-12 18:09:45 joehw Exp $
*/
class ParserForXMLSchema extends RegexParser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java
index ed1cda9ba3e..5435fc799d9 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java
@@ -31,7 +31,6 @@ import java.util.Vector;
*
* @xerces.internal
*
- * @version $Id: RegexParser.java,v 1.8 2010-11-01 04:39:54 joehw Exp $
*/
class RegexParser {
static final int T_CHAR = 0;
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java
index fa488d64ad2..0a996b27c10 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java
@@ -486,7 +486,6 @@ import com.sun.org.apache.xerces.internal.util.IntStack;
* @xerces.internal
*
* @author TAMURA Kent <kent@trl.ibm.co.jp>
- * @version $Id: RegularExpression.java,v 1.9 2010/07/27 05:02:34 joehw Exp $
*/
public class RegularExpression implements java.io.Serializable {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java
index a395e47fdc4..5221b6e8612 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java
@@ -28,7 +28,6 @@ import java.util.Hashtable;
*
* @xerces.internal
*
- * @version $Id: Token.java,v 1.7 2010/07/27 05:02:34 joehw Exp $
*/
class Token implements java.io.Serializable {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.java
index ea450035ffd..06ec54dd9d2 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.java
@@ -75,7 +75,6 @@ import org.xml.sax.SAXException;
* @author Sandy Gao, IBM
* @author Elena Litani, IBM
*
- * @version $Id: SchemaGrammar.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public class SchemaGrammar implements XSGrammar, XSNamespaceItem {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java
index 1fbe4c74cda..f2d4e745af4 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java
@@ -35,7 +35,6 @@ import java.util.Vector;
*
* @author Sandy Gao, IBM
*
- * @version $Id: SubstitutionGroupHandler.java,v 1.6 2010-11-01 04:39:55 joehw Exp $
*/
public class SubstitutionGroupHandler {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java
index d37a0300ed8..63123391ca3 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java
@@ -98,7 +98,6 @@ import org.xml.sax.InputSource;
* @xerces.internal
*
* @author Neil Graham, IBM
- * @version $Id: XMLSchemaLoader.java,v 1.10 2010-11-01 04:39:55 joehw Exp $
*/
public class XMLSchemaLoader implements XMLGrammarLoader, XMLComponent,
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java
index f7fc09a6d00..fd03b7a8f75 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java
@@ -107,7 +107,6 @@ import com.sun.org.apache.xerces.internal.parsers.XMLParser;
* @author Elena Litani IBM
* @author Andy Clark IBM
* @author Neeraj Bajaj, Sun Microsystems, inc.
- * @version $Id: XMLSchemaValidator.java,v 1.16 2010-11-01 04:39:55 joehw Exp $
*/
public class XMLSchemaValidator
implements XMLComponent, XMLDocumentFilter, FieldActivator, RevalidationHandler {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeDecl.java
index 183c6f22f63..7542c684f69 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeDecl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeDecl.java
@@ -41,7 +41,6 @@ import com.sun.org.apache.xerces.internal.xs.XSSimpleTypeDefinition;
*
* @author Elena Litani, IBM
* @author Sandy Gao, IBM
- * @version $Id: XSAttributeDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public class XSAttributeDecl implements XSAttributeDeclaration {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeGroupDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeGroupDecl.java
index 8e907051eee..fda0899f9da 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeGroupDecl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeGroupDecl.java
@@ -39,7 +39,6 @@ import com.sun.org.apache.xerces.internal.xs.XSWildcard;
* @author Sandy Gao, IBM
* @author Rahul Srivastava, Sun Microsystems Inc.
*
- * @version $Id: XSAttributeGroupDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public class XSAttributeGroupDecl implements XSAttributeGroupDefinition {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeUseImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeUseImpl.java
index 174c2852a92..42e64e3c87a 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeUseImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeUseImpl.java
@@ -36,7 +36,6 @@ import com.sun.org.apache.xerces.internal.xs.XSObjectList;
* @xerces.internal
*
* @author Sandy Gao, IBM
- * @version $Id: XSAttributeUseImpl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public class XSAttributeUseImpl implements XSAttributeUse {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java
index 79f250028b4..3096988cb2e 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java
@@ -36,7 +36,6 @@ import org.w3c.dom.TypeInfo;
*
* @author Elena Litani, IBM
* @author Sandy Gao, IBM
- * @version $Id: XSComplexTypeDecl.java,v 1.8 2010-11-01 04:39:55 joehw Exp $
*/
public class XSComplexTypeDecl implements XSComplexTypeDefinition, TypeInfo {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java
index c56ad0d1b57..3b5e28c2d77 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java
@@ -45,7 +45,6 @@ import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
*
* @author Sandy Gao, IBM
*
- * @version $Id: XSConstraints.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public class XSConstraints {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSDDescription.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSDDescription.java
index c35baa8667a..545388002e7 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSDDescription.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSDDescription.java
@@ -34,7 +34,6 @@ import com.sun.org.apache.xerces.internal.xni.grammars.XMLSchemaDescription;
* @author Neil Graham, IBM
* @author Neeraj Bajaj, SUN Microsystems.
*
- * @version $Id: XSDDescription.java,v 1.6 2010-11-01 04:39:55 joehw Exp $
*/
public class XSDDescription extends XMLResourceIdentifierImpl
implements XMLSchemaDescription {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSDeclarationPool.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSDeclarationPool.java
index 5578da2a44b..604f50da504 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSDeclarationPool.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSDeclarationPool.java
@@ -33,7 +33,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl;
* @xerces.internal
*
* @author Elena Litani, IBM
- * @version $Id: XSDeclarationPool.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public final class XSDeclarationPool {
/** Chunk shift (8). */
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSElementDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSElementDecl.java
index 190daa779b0..70d5347e5c2 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSElementDecl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSElementDecl.java
@@ -43,7 +43,6 @@ import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
*
* @author Elena Litani, IBM
* @author Sandy Gao, IBM
- * @version $Id: XSElementDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public class XSElementDecl implements XSElementDeclaration {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java
index 6d88c5fdd00..456b78ba721 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java
@@ -31,7 +31,6 @@ import java.util.Vector;
* @xerces.internal
*
* @author Sandy Gao, IBM
- * @version $Id: XSGrammarBucket.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public class XSGrammarBucket {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSGroupDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSGroupDecl.java
index a710e53b621..3c51b0c5004 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSGroupDecl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSGroupDecl.java
@@ -36,7 +36,6 @@ import com.sun.org.apache.xerces.internal.xs.XSObjectList;
* @xerces.internal
*
* @author Sandy Gao, IBM
- * @version $Id: XSGroupDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public class XSGroupDecl implements XSModelGroupDefinition {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSLoaderImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSLoaderImpl.java
index 136d69e2dbb..48fa9c38448 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSLoaderImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSLoaderImpl.java
@@ -45,7 +45,6 @@ import org.w3c.dom.ls.LSInput;
*
* @author Michael Glavassevich, IBM
*
- * @version $Id: XSLoaderImpl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public final class XSLoaderImpl implements XSLoader, DOMConfiguration {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java
index 0a51a3c6b8f..236b7962373 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java
@@ -34,7 +34,6 @@ import java.util.ResourceBundle;
* @xerces.internal
*
* @author Elena Litani, IBM
- * @version $Id: XSMessageFormatter.java,v 1.6 2010-11-01 04:39:55 joehw Exp $
*/
public class XSMessageFormatter implements MessageFormatter {
/**
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelGroupImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelGroupImpl.java
index 4414003319c..8f63830c7a6 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelGroupImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelGroupImpl.java
@@ -34,7 +34,6 @@ import com.sun.org.apache.xerces.internal.xs.XSObjectList;
*
* @author Sandy Gao, IBM
*
- * @version $Id: XSModelGroupImpl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public class XSModelGroupImpl implements XSModelGroup {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.java
index bded2950e0b..01201a766ea 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.java
@@ -57,7 +57,6 @@ import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
*
* @author Sandy Gao, IBM
*
- * @version $Id: XSModelImpl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public final class XSModelImpl extends AbstractList implements XSModel, XSNamespaceItemList {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSNotationDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSNotationDecl.java
index 94505f9969d..c34f16b8f88 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSNotationDecl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSNotationDecl.java
@@ -34,7 +34,6 @@ import com.sun.org.apache.xerces.internal.xs.XSObjectList;
* @xerces.internal
*
* @author Rahul Srivastava, Sun Microsystems Inc.
- * @version $Id: XSNotationDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public class XSNotationDecl implements XSNotationDeclaration {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSParticleDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSParticleDecl.java
index 468f652cbc9..cb2ba9a5066 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSParticleDecl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSParticleDecl.java
@@ -34,7 +34,6 @@ import com.sun.org.apache.xerces.internal.xs.XSTerm;
*
* @author Sandy Gao, IBM
*
- * @version $Id: XSParticleDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public class XSParticleDecl implements XSParticle {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSWildcardDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSWildcardDecl.java
index ac3a00eac6c..b56db22ba14 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSWildcardDecl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSWildcardDecl.java
@@ -38,7 +38,6 @@ import com.sun.org.apache.xerces.internal.xs.XSObjectList;
* @author Sandy Gao, IBM
* @author Rahul Srivastava, Sun Microsystems Inc.
*
- * @version $Id: XSWildcardDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
*/
public class XSWildcardDecl implements XSWildcard {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Field.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Field.java
index ca968f8d41e..c00e802e6d4 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Field.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Field.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
* @xerces.internal
*
* @author Andy Clark, IBM
- * @version $Id: Field.java,v 1.6 2010-11-01 04:39:57 joehw Exp $
*/
public class Field {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Selector.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Selector.java
index f36e5ee3ab3..283e6c1f153 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Selector.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Selector.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
* @xerces.internal
*
* @author Andy Clark, IBM
- * @version $Id: Selector.java,v 1.7 2010-11-01 04:39:57 joehw Exp $
*/
public class Selector {
@@ -106,7 +105,6 @@ public class Selector {
* Schema identity constraint selector XPath expression.
*
* @author Andy Clark, IBM
- * @version $Id: Selector.java,v 1.7 2010-11-01 04:39:57 joehw Exp $
*/
public static class XPath
extends com.sun.org.apache.xerces.internal.impl.xpath.XPath {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java
index ca8815458d4..e03ca553540 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java
@@ -36,7 +36,6 @@ import com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl;
* @author Elena Litani, IBM
* @author Sandy Gao, IBM
*
- * @version $Id: CMBuilder.java,v 1.11 2010/08/06 23:49:43 joehw Exp $
*/
public class CMBuilder {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java
index 6aa06b8828d..8962280abbb 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java
@@ -35,7 +35,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
*
* @author Neeraj Bajaj
*
- * @version $Id: CMNodeFactory.java,v 1.7 2010-11-01 04:39:58 joehw Exp $
*/
public class CMNodeFactory {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java
index f2cf0a7b7c1..d3060915341 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java
@@ -35,7 +35,6 @@ import java.util.ArrayList;
* @xerces.internal
*
* @author Pavani Mukthipudi, Sun Microsystems Inc.
- * @version $Id: XSAllCM.java,v 1.10 2010-11-01 04:39:58 joehw Exp $
*/
public class XSAllCM implements XSCMValidator {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMRepeatingLeaf.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMRepeatingLeaf.java
index 46788962e8e..dd7c1184986 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMRepeatingLeaf.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMRepeatingLeaf.java
@@ -27,7 +27,6 @@ package com.sun.org.apache.xerces.internal.impl.xs.models;
* @xerces.internal
*
* @author Michael Glavassevich, IBM
- * @version $Id: XSCMRepeatingLeaf.java,v 1.1 2010/08/06 23:49:43 joehw Exp $
*/
public final class XSCMRepeatingLeaf extends XSCMLeaf {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java
index 341d88bcef0..d387ac52261 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java
@@ -34,7 +34,6 @@ import java.util.ArrayList;
*
* @author Sandy Gao, IBM
* @author Elena Litani, IBM
- * @version $Id: XSCMValidator.java,v 1.6 2009/07/28 15:18:12 spericas Exp $
*/
public interface XSCMValidator {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java
index e4b5ee280eb..997ca17cb95 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java
@@ -45,7 +45,6 @@ import java.util.HashMap;
* @xerces.internal
*
* @author Neil Graham, IBM
- * @version $Id: XSDFACM.java,v 1.9 2010/08/06 23:49:43 joehw Exp $
*/
public class XSDFACM
implements XSCMValidator {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java
index 673211fb196..bf730d692c9 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java
@@ -37,7 +37,6 @@ import java.util.ArrayList;
*
* @author Elena Litani, Lisa Martin
* @author IBM
- * @version $Id: XSEmptyCM.java,v 1.7 2009/07/28 15:18:11 spericas Exp $
*/
public class XSEmptyCM implements XSCMValidator {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/AttrImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/AttrImpl.java
index 331fc2692bf..89c70ebc0fa 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/AttrImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/AttrImpl.java
@@ -73,7 +73,6 @@ import org.w3c.dom.TypeInfo;
*
* @author Rahul Srivastava, Sun Microsystems Inc.
*
- * @version $Id: AttrImpl.java,v 1.5 2010-11-01 04:40:01 joehw Exp $
*/
public class AttrImpl extends NodeImpl
implements Attr {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/ElementImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/ElementImpl.java
index 24eebf7e8dc..28a6bd678b2 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/ElementImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/ElementImpl.java
@@ -31,7 +31,6 @@ import org.w3c.dom.Node;
* @author Rahul Srivastava, Sun Microsystems Inc.
* @author Sandy Gao, IBM
*
- * @version $Id: ElementImpl.java,v 1.7 2010-11-01 04:40:01 joehw Exp $
*/
public class ElementImpl extends DefaultElement {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.java
index 48d6f1280ea..52ed98f24d9 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.java
@@ -40,7 +40,6 @@ import org.w3c.dom.Node;
* @author Rahul Srivastava, Sun Microsystems Inc.
* @author Sandy Gao, IBM
*
- * @version $Id: SchemaDOM.java,v 1.7 2010-11-01 04:40:01 joehw Exp $
*/
public class SchemaDOM extends DefaultDocument {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMImplementation.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMImplementation.java
index 105e6367cfb..eb422a2354a 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMImplementation.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMImplementation.java
@@ -28,7 +28,6 @@ import org.w3c.dom.DocumentType;
/**
* @xerces.internal
*
- * @version $Id: SchemaDOMImplementation.java,v 1.2 2010-10-26 23:01:18 joehw Exp $
*/
final class SchemaDOMImplementation implements DOMImplementation {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMParser.java
index be28c8c836c..b8e1d54959e 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMParser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMParser.java
@@ -46,7 +46,6 @@ import org.w3c.dom.Document;
* @author Rahul Srivastava, Sun Microsystems Inc.
* @author Sandy Gao, IBM
*
- * @version $Id: SchemaDOMParser.java,v 1.8 2010-11-01 04:40:01 joehw Exp $
*/
public class SchemaDOMParser extends DefaultXMLDocumentHandler {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaParsingConfig.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaParsingConfig.java
index a9b251e91f1..5c9afc2c25e 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaParsingConfig.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaParsingConfig.java
@@ -57,7 +57,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
*
* @author Rahul Srivastava, Sun Microsystems Inc.
*
- * @version $Id: SchemaParsingConfig.java,v 1.8 2010-11-01 04:40:01 joehw Exp $
*/
public class SchemaParsingConfig extends BasicParserConfiguration
implements XMLPullParserConfiguration {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.java
index 3d7e3afdded..84f04e2e53f 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.java
@@ -54,7 +54,6 @@ import org.w3c.dom.Document;
*
* @xerces.internal
*
- * @version $Id: StAXSchemaParser.java,v 1.2 2010-10-26 23:01:12 joehw Exp $
*/
final class StAXSchemaParser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java
index f9eea6a4dc4..1a3a41476d3 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java
@@ -69,7 +69,6 @@ import org.w3c.dom.Element;
* @xerces.internal
*
* @author Sandy Gao, IBM
- * @version $Id: XSAttributeChecker.java,v 1.12 2010-11-01 04:40:02 joehw Exp $
*/
public class XSAttributeChecker {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java
index c6455231eeb..af38b2f73f6 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java
@@ -36,7 +36,6 @@ import org.w3c.dom.Element;
*
* @xerces.internal
*
- * @version $Id: XSDAbstractIDConstraintTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
*/
class XSDAbstractIDConstraintTraverser extends XSDAbstractTraverser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractParticleTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractParticleTraverser.java
index 364a94a850a..0a0569a1fc2 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractParticleTraverser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractParticleTraverser.java
@@ -37,7 +37,6 @@ import org.w3c.dom.Element;
*
* @author Elena Litani, IBM
* @author Sandy Gao, IBM
- * @version $Id: XSDAbstractParticleTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
*/
abstract class XSDAbstractParticleTraverser extends XSDAbstractTraverser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.java
index a5e97f08b25..7af4c66754d 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.java
@@ -58,7 +58,6 @@ import org.w3c.dom.Element;
* @author Rahul Srivastava, Sun Microsystems Inc.
* @author Neeraj Bajaj, Sun Microsystems Inc.
*
- * @version $Id: XSDAbstractTraverser.java,v 1.8 2010-11-01 04:40:02 joehw Exp $
*/
abstract class XSDAbstractTraverser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeGroupTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeGroupTraverser.java
index 0e126704d0b..14d15309ea9 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeGroupTraverser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeGroupTraverser.java
@@ -46,7 +46,6 @@ import org.w3c.dom.Element;
* @author Rahul Srivastava, Sun Microsystems Inc.
* @author Sandy Gao, IBM
*
- * @version $Id: XSDAttributeGroupTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
*/
class XSDAttributeGroupTraverser extends XSDAbstractTraverser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeTraverser.java
index 0aa0b32ec33..6174a7b5ec3 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeTraverser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeTraverser.java
@@ -59,7 +59,6 @@ import org.w3c.dom.Element;
*
* @author Sandy Gao, IBM
* @author Neeraj Bajaj, Sun Microsystems, inc.
- * @version $Id: XSDAttributeTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
*/
class XSDAttributeTraverser extends XSDAbstractTraverser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java
index cfc98b834b8..b786158ac7c 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java
@@ -62,7 +62,6 @@ import org.w3c.dom.Element;
*
* @xerces.internal
*
- * @version $Id: XSDComplexTypeTraverser.java,v 1.8 2010-11-01 04:40:02 joehw Exp $
*/
class XSDComplexTypeTraverser extends XSDAbstractParticleTraverser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDElementTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDElementTraverser.java
index 0d480580d6a..e0e4c464c21 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDElementTraverser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDElementTraverser.java
@@ -69,7 +69,6 @@ import org.w3c.dom.Element;
*
* @author Sandy Gao, IBM
*
- * @version $Id: XSDElementTraverser.java,v 1.9 2010-11-01 04:40:02 joehw Exp $
*/
class XSDElementTraverser extends XSDAbstractTraverser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDGroupTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDGroupTraverser.java
index 915f482ddbe..99e2ec99319 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDGroupTraverser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDGroupTraverser.java
@@ -47,7 +47,6 @@ import org.w3c.dom.Element;
* @author Rahul Srivastava, Sun Microsystems Inc.
* @author Elena Litani, IBM
* @author Lisa Martin, IBM
- * @version $Id: XSDGroupTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
*/
class XSDGroupTraverser extends XSDAbstractParticleTraverser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java
index d6a6e948f65..bf6defa6ca7 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java
@@ -131,7 +131,6 @@ import org.xml.sax.helpers.XMLReaderFactory;
* @author Neil Graham, IBM
* @author Pavani Mukthipudi, Sun Microsystems
*
- * @version $Id: XSDHandler.java,v 1.9 2010-11-01 04:40:02 joehw Exp $
*/
public class XSDHandler {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDKeyrefTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDKeyrefTraverser.java
index 07d160e2998..7d590acf55f 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDKeyrefTraverser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDKeyrefTraverser.java
@@ -35,7 +35,6 @@ import org.w3c.dom.Element;
* @xerces.internal
*
* @author Neil Graham, IBM
- * @version $Id: XSDKeyrefTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
*/
class XSDKeyrefTraverser extends XSDAbstractIDConstraintTraverser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDNotationTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDNotationTraverser.java
index 846c9b94326..27acd055d2f 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDNotationTraverser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDNotationTraverser.java
@@ -45,7 +45,6 @@ import org.w3c.dom.Element;
*
* @author Rahul Srivastava, Sun Microsystems Inc.
* @author Elena Litani, IBM
- * @version $Id: XSDNotationTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
*/
class XSDNotationTraverser extends XSDAbstractTraverser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java
index 355881edc84..1564227b1f5 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java
@@ -78,7 +78,6 @@ import org.w3c.dom.Element;
* @author Neeraj Bajaj, Sun Microsystems, Inc.
* @author Sandy Gao, IBM
*
- * @version $Id: XSDSimpleTypeTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
*/
class XSDSimpleTypeTraverser extends XSDAbstractTraverser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java
index 054dd9deb04..2e36be5745e 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java
@@ -35,7 +35,6 @@ import org.w3c.dom.Element;
* @xerces.internal
*
* @author Neil Graham, IBM
- * @version $Id: XSDUniqueOrKeyTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
*/
class XSDUniqueOrKeyTraverser extends XSDAbstractIDConstraintTraverser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDWildcardTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDWildcardTraverser.java
index 60bfb54d88d..c368b74ccfd 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDWildcardTraverser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDWildcardTraverser.java
@@ -57,7 +57,6 @@ import org.w3c.dom.Element;
* @author Rahul Srivastava, Sun Microsystems Inc.
* @author Sandy Gao, IBM
*
- * @version $Id: XSDWildcardTraverser.java,v 1.7 2010-11-01 04:40:02 joehw Exp $
*/
class XSDWildcardTraverser extends XSDAbstractTraverser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java
index b75639f16a4..b941ea90236 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java
@@ -43,7 +43,6 @@ import org.w3c.dom.NamedNodeMap;
* @xerces.internal
*
* @author Neil Graham, IBM
- * @version $Id: XSDocumentInfo.java,v 1.5 2007/10/15 22:27:48 spericas Exp $
*/
class XSDocumentInfo {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.java
index c8a93293e05..4f3bb757ed1 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.java
@@ -34,7 +34,6 @@ import org.w3c.dom.ls.LSInput;
*
* @author Michael Glavassevich, IBM
*
- * @version $Id: LSInputListImpl.java,v 1.2 2010-10-26 23:01:04 joehw Exp $
*/
public final class LSInputListImpl extends AbstractList implements LSInputList {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.java
index 9f0a1964cdb..1d29360a05d 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.java
@@ -31,7 +31,6 @@ import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
*
* @xerces.internal
*
- * @version $Id: ObjectListImpl.java,v 1.2 2010-10-26 23:01:04 joehw Exp $
*/
public final class ObjectListImpl extends AbstractList implements ObjectList {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java
index 9a3ba385747..9dc0641ef26 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java
@@ -32,7 +32,6 @@ import com.sun.org.apache.xerces.internal.xs.XSException;
*
* @author Sandy Gao, IBM
*
- * @version $Id: ShortListImpl.java,v 1.7 2010-11-01 04:40:06 joehw Exp $
*/
public final class ShortListImpl extends AbstractList implements ShortList {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.java
index 5f22628b4f7..cf3d46a494e 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.java
@@ -33,7 +33,6 @@ import com.sun.org.apache.xerces.internal.xs.StringList;
*
* @author Sandy Gao, IBM
*
- * @version $Id: StringListImpl.java,v 1.7 2010-11-01 04:40:06 joehw Exp $
*/
public final class StringListImpl extends AbstractList implements StringList {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java
index 3f83e8373ff..a3f0bc71a37 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java
@@ -36,7 +36,6 @@ import com.sun.org.apache.xerces.internal.xs.XSModel;
*
* @xerces.internal
*
- * @version $Id: XSGrammarPool.java,v 1.7 2010-11-01 04:40:06 joehw Exp $
*/
public class XSGrammarPool extends XMLGrammarPoolImpl {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSInputSource.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSInputSource.java
index 4ca114bbedc..393393c08a0 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSInputSource.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSInputSource.java
@@ -29,7 +29,6 @@ import com.sun.org.apache.xerces.internal.xs.XSObject;
/**
* @xerces.internal
*
- * @version $Id: XSInputSource.java,v 1.2 2010-10-26 23:01:05 joehw Exp $
*/
public final class XSInputSource extends XMLInputSource {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMap4Types.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMap4Types.java
index 63f6f475564..a2c6b29df41 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMap4Types.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMap4Types.java
@@ -32,7 +32,6 @@ import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
*
* @author Sandy Gao, IBM
*
- * @version $Id: XSNamedMap4Types.java,v 1.7 2010-11-01 04:40:06 joehw Exp $
*/
public final class XSNamedMap4Types extends XSNamedMapImpl {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.java
index 17406566405..b15f1ed47b3 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.java
@@ -41,7 +41,6 @@ import com.sun.org.apache.xerces.internal.xs.XSObject;
*
* @author Sandy Gao, IBM
*
- * @version $Id: XSNamedMapImpl.java,v 1.7 2010-11-01 04:40:06 joehw Exp $
*/
public class XSNamedMapImpl extends AbstractMap implements XSNamedMap {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.java
index b5e0de2d52a..7c5b4f7c40f 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.java
@@ -36,7 +36,6 @@ import com.sun.org.apache.xerces.internal.xs.XSObjectList;
*
* @author Sandy Gao, IBM
*
- * @version $Id: XSObjectListImpl.java,v 1.7 2010-11-01 04:40:06 joehw Exp $
*/
public class XSObjectListImpl extends AbstractList implements XSObjectList {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java
index aea63c2eb16..2899ab8dd92 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java
@@ -37,7 +37,6 @@ import org.xml.sax.SAXNotSupportedException;
/**
* @author Rajiv Mordani
* @author Edwin Goei
- * @version $Id: DocumentBuilderFactoryImpl.java,v 1.8 2010-11-01 04:40:06 joehw Exp $
*/
public class DocumentBuilderFactoryImpl extends DocumentBuilderFactory {
/** These are DocumentBuilderFactory attributes not DOM attributes */
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java
index 51f22d713b1..a1d9b1ffb2b 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java
@@ -58,7 +58,6 @@ import org.xml.sax.SAXNotSupportedException;
/**
* @author Rajiv Mordani
* @author Edwin Goei
- * @version $Id: DocumentBuilderImpl.java,v 1.8 2010-11-01 04:40:06 joehw Exp $
*/
public class DocumentBuilderImpl extends DocumentBuilder
implements JAXPConstants
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java
index ae9d99509d9..50c5f3db11d 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java
@@ -43,7 +43,6 @@ import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter;
* @author Rajiv Mordani
* @author Edwin Goei
*
- * @version $Id: SAXParserFactoryImpl.java,v 1.9 2010-11-01 04:40:06 joehw Exp $
*/
public class SAXParserFactoryImpl extends SAXParserFactory {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java
index 6cc3e9a4678..315b2000ccf 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java
@@ -63,7 +63,6 @@ import org.xml.sax.helpers.DefaultHandler;
* @author Rajiv Mordani
* @author Edwin Goei
*
- * @version $Id: SAXParserImpl.java,v 1.7 2010-11-01 04:40:06 joehw Exp $
*/
public class SAXParserImpl extends javax.xml.parsers.SAXParser
implements JAXPConstants, PSVIProvider {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SchemaValidatorConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SchemaValidatorConfiguration.java
index 9ef80be7742..f919ec08a81 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SchemaValidatorConfiguration.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SchemaValidatorConfiguration.java
@@ -34,7 +34,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
/**
* Parser configuration for Xerces' XMLSchemaValidator.
*
- * @version $Id: SchemaValidatorConfiguration.java,v 1.5 2010-11-01 04:40:06 joehw Exp $
*/
final class SchemaValidatorConfiguration implements XMLComponentManager {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.java
index 5714da3be57..8129066eb3d 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.java
@@ -39,7 +39,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
* Events are forwarded to the registered XMLDTDHandler without modification.
*
* @author Michael Glavassevich, IBM
- * @version $Id: UnparsedEntityHandler.java,v 1.6 2010-11-01 04:40:07 joehw Exp $
*/
final class UnparsedEntityHandler implements XMLDTDFilter, EntityState {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java
index 59497a48f5e..aa993a299c5 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java
@@ -58,7 +58,6 @@ import javax.xml.datatype.XMLGregorianCalendar;
*
* @author Joseph Fialli
* @author Jeff Suttor
- * @version $Id: DatatypeFactoryImpl.java,v 1.6 2010/05/19 05:02:55 joehw Exp $
*/
public class DatatypeFactoryImpl
extends DatatypeFactory {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationDayTimeImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationDayTimeImpl.java
index 9e5cafda554..83de0154ba6 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationDayTimeImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationDayTimeImpl.java
@@ -46,7 +46,6 @@ import javax.xml.datatype.DatatypeConstants;
*
* @author Vikram Aroskar
* @author Joe Wang
- * @version $Revision: 1.2 $, $Date: 2010/05/19 23:20:06 $
* @see XMLGregorianCalendar#add(Duration)
*/
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java
index da5de3e1ff5..b8724a70a34 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java
@@ -21,6 +21,7 @@
package com.sun.org.apache.xerces.internal.jaxp.datatype;
+import com.sun.org.apache.xerces.internal.util.DatatypeMessageFormatter;
import java.io.IOException;
import java.io.ObjectStreamException;
import java.io.Serializable;
@@ -30,13 +31,10 @@ import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
-
import javax.xml.datatype.DatatypeConstants;
import javax.xml.datatype.Duration;
import javax.xml.datatype.XMLGregorianCalendar;
-import com.sun.org.apache.xerces.internal.util.DatatypeMessageFormatter;
-
/**
* Immutable representation of a time span as defined in
* the W3C XML Schema 1.0 specification.
@@ -99,7 +97,6 @@ import com.sun.org.apache.xerces.internal.util.DatatypeMessageFormatter;
*
* @author Kohsuke Kawaguchi
* @author Joseph Fialli
- * @version $Revision: 1.8 $, $Date: 2010/05/19 23:20:06 $
* @see XMLGregorianCalendar#add(Duration)
*/
@@ -120,28 +117,23 @@ class DurationImpl
DatatypeConstants.SECONDS
};
- /**
- * Internal array of value Field ids.
- */
- private static final int[] FIELD_IDS = {
- DatatypeConstants.YEARS.getId(),
- DatatypeConstants.MONTHS.getId(),
- DatatypeConstants.DAYS.getId(),
- DatatypeConstants.HOURS.getId(),
- DatatypeConstants.MINUTES.getId(),
- DatatypeConstants.SECONDS.getId()
- };
/**
* TimeZone for GMT.
*/
private static final TimeZone GMT = TimeZone.getTimeZone("GMT");
- /**
+ /**
* BigDecimal value of 0.
*/
private static final BigDecimal ZERO = BigDecimal.valueOf(0);
+ /**
+ * BigInteger value of Integer's max value.
+ */
+ private static final BigInteger MaxIntAsBigInt =
+ BigInteger.valueOf((long) Integer.MAX_VALUE);
+
/**
* Indicates the sign. -1, 0 or 1 if the duration is negative,
* zero, or positive.
@@ -195,12 +187,12 @@ class DurationImpl
return signum;
}
- /**
- * TODO: Javadoc
- * @param isPositive Sign.
- *
- * @return 1 if positive, else -1.
- */
+ /**
+ * Determine the sign of the duration.
+ *
+ * @param isPositive Sign.
+ * @return 1 if positive, -1 negative, or 0 if all fields are zero.
+ */
protected int calcSignum(boolean isPositive) {
if ((years == null || years.signum() == 0)
&& (months == null || months.signum() == 0)
@@ -694,209 +686,71 @@ class DurationImpl
XMLGregorianCalendarImpl.parse("1903-07-01T00:00:00Z")
};
- /**
- * Partial order relation comparison with this Duration
instance.
- *
- * Comparison result must be in accordance with
- * W3C XML Schema 1.0 Part 2, Section 3.2.7.6.2,
- * Order relation on duration.
- *
- * Return:
- *
- * - {@link DatatypeConstants#LESSER} if this
Duration
is shorter than duration
parameter
- * - {@link DatatypeConstants#EQUAL} if this
Duration
is equal to duration
parameter
- * - {@link DatatypeConstants#GREATER} if this
Duration
is longer than duration
parameter
- * - {@link DatatypeConstants#INDETERMINATE} if a conclusive partial order relation cannot be determined
- *
- *
- * @param duration to compare
- *
- * @return the relationship between this
Duration
and duration
parameter as
- * {@link DatatypeConstants#LESSER}, {@link DatatypeConstants#EQUAL}, {@link DatatypeConstants#GREATER}
- * or {@link DatatypeConstants#INDETERMINATE}.
- *
- * @throws UnsupportedOperationException If the underlying implementation
- * cannot reasonably process the request, e.g. W3C XML Schema allows for
- * arbitrarily large/small/precise values, the request may be beyond the
- * implementations capability.
- * @throws NullPointerException if duration
is null
.
- *
- * @see #isShorterThan(Duration)
- * @see #isLongerThan(Duration)
- */
+ /**
+ * Partial order relation comparison with this Duration
instance.
+ *
+ * Comparison result must be in accordance with
+ * W3C XML Schema 1.0 Part 2, Section 3.2.7.6.2,
+ * Order relation on duration.
+ *
+ * Return:
+ *
+ * - {@link DatatypeConstants#LESSER} if this
Duration
is shorter than duration
parameter
+ * - {@link DatatypeConstants#EQUAL} if this
Duration
is equal to duration
parameter
+ * - {@link DatatypeConstants#GREATER} if this
Duration
is longer than duration
parameter
+ * - {@link DatatypeConstants#INDETERMINATE} if a conclusive partial order relation cannot be determined
+ *
+ *
+ * @param duration to compare
+ *
+ * @return the relationship between this
Duration
and duration
parameter as
+ * {@link DatatypeConstants#LESSER}, {@link DatatypeConstants#EQUAL}, {@link DatatypeConstants#GREATER}
+ * or {@link DatatypeConstants#INDETERMINATE}.
+ *
+ * @throws UnsupportedOperationException If the underlying implementation
+ * cannot reasonably process the request, e.g. W3C XML Schema allows for
+ * arbitrarily large/small/precise values, the request may be beyond the
+ * implementations capability.
+ * @throws NullPointerException if duration
is null
.
+ *
+ * @see #isShorterThan(Duration)
+ * @see #isLongerThan(Duration)
+ */
public int compare(Duration rhs) {
+ /** check if any field in the Durations is too large for the operation
+ * that uses XMLGregorianCalendar for comparison
+ */
+ for (DatatypeConstants.Field field : FIELDS) {
+ checkMaxValue(getField(field), field);
+ checkMaxValue(rhs.getField(field), field);
+ }
- BigInteger maxintAsBigInteger = BigInteger.valueOf(Integer.MAX_VALUE);
+ return compareDates(this, rhs);
+ }
- // check for fields that are too large in this Duration
- if (years != null && years.compareTo(maxintAsBigInteger) == 1) {
+ /**
+ * Check if a field exceeds the maximum value
+ * @param field the value of a field
+ * @param fieldType type of the field, e.g. year, month, day, hour, minute or second.
+ */
+ private void checkMaxValue(Number field, DatatypeConstants.Field fieldType) {
+ BigInteger fieldValue = null;
+ if (fieldType != DatatypeConstants.SECONDS) {
+ fieldValue = (BigInteger) field;
+ } else {
+ BigDecimal rhsSecondsAsBigDecimal = (BigDecimal) field;
+ if ( rhsSecondsAsBigDecimal != null ) {
+ fieldValue = rhsSecondsAsBigDecimal.toBigInteger();
+ }
+ }
+
+ if (fieldValue != null && fieldValue.compareTo(MaxIntAsBigInt) == 1) {
throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.YEARS.toString(), years.toString()})
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " years too large to be supported by this implementation "
- //+ years.toString()
- );
+ DatatypeMessageFormatter.formatMessage(null, "TooLarge",
+ new Object[]{this.getClass().getName() + "#compare(Duration duration)"
+ + fieldType, field.toString()})
+ );
}
- if (months != null && months.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.MONTHS.toString(), months.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " months too large to be supported by this implementation "
- //+ months.toString()
- );
- }
- if (days != null && days.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.DAYS.toString(), days.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " days too large to be supported by this implementation "
- //+ days.toString()
- );
- }
- if (hours != null && hours.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.HOURS.toString(), hours.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " hours too large to be supported by this implementation "
- //+ hours.toString()
- );
- }
- if (minutes != null && minutes.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.MINUTES.toString(), minutes.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " minutes too large to be supported by this implementation "
- //+ minutes.toString()
- );
- }
- if (seconds != null && seconds.toBigInteger().compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.SECONDS.toString(), toString(seconds)})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " seconds too large to be supported by this implementation "
- //+ seconds.toString()
- );
- }
-
- // check for fields that are too large in rhs Duration
- BigInteger rhsYears = (BigInteger) rhs.getField(DatatypeConstants.YEARS);
- if (rhsYears != null && rhsYears.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.YEARS.toString(), rhsYears.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " years too large to be supported by this implementation "
- //+ rhsYears.toString()
- );
- }
- BigInteger rhsMonths = (BigInteger) rhs.getField(DatatypeConstants.MONTHS);
- if (rhsMonths != null && rhsMonths.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.MONTHS.toString(), rhsMonths.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " months too large to be supported by this implementation "
- //+ rhsMonths.toString()
- );
- }
- BigInteger rhsDays = (BigInteger) rhs.getField(DatatypeConstants.DAYS);
- if (rhsDays != null && rhsDays.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.DAYS.toString(), rhsDays.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " days too large to be supported by this implementation "
- //+ rhsDays.toString()
- );
- }
- BigInteger rhsHours = (BigInteger) rhs.getField(DatatypeConstants.HOURS);
- if (rhsHours != null && rhsHours.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.HOURS.toString(), rhsHours.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " hours too large to be supported by this implementation "
- //+ rhsHours.toString()
- );
- }
- BigInteger rhsMinutes = (BigInteger) rhs.getField(DatatypeConstants.MINUTES);
- if (rhsMinutes != null && rhsMinutes.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.MINUTES.toString(), rhsMinutes.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " minutes too large to be supported by this implementation "
- //+ rhsMinutes.toString()
- );
- }
- BigDecimal rhsSecondsAsBigDecimal = (BigDecimal) rhs.getField(DatatypeConstants.SECONDS);
- BigInteger rhsSeconds = null;
- if ( rhsSecondsAsBigDecimal != null ) {
- rhsSeconds = rhsSecondsAsBigDecimal.toBigInteger();
- }
- if (rhsSeconds != null && rhsSeconds.compareTo(maxintAsBigInteger) == 1) {
- throw new UnsupportedOperationException(
- DatatypeMessageFormatter.formatMessage(null, "TooLarge",
- new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.SECONDS.toString(), rhsSeconds.toString()})
-
- //this.getClass().getName() + "#compare(Duration duration)"
- //+ " seconds too large to be supported by this implementation "
- //+ rhsSeconds.toString()
- );
- }
-
- // turn this Duration into a GregorianCalendar
- GregorianCalendar lhsCalendar = new GregorianCalendar(
- 1970,
- 1,
- 1,
- 0,
- 0,
- 0);
- lhsCalendar.add(GregorianCalendar.YEAR, getYears() * getSign());
- lhsCalendar.add(GregorianCalendar.MONTH, getMonths() * getSign());
- lhsCalendar.add(GregorianCalendar.DAY_OF_YEAR, getDays() * getSign());
- lhsCalendar.add(GregorianCalendar.HOUR_OF_DAY, getHours() * getSign());
- lhsCalendar.add(GregorianCalendar.MINUTE, getMinutes() * getSign());
- lhsCalendar.add(GregorianCalendar.SECOND, getSeconds() * getSign());
-
- // turn compare Duration into a GregorianCalendar
- GregorianCalendar rhsCalendar = new GregorianCalendar(
- 1970,
- 1,
- 1,
- 0,
- 0,
- 0);
- rhsCalendar.add(GregorianCalendar.YEAR, rhs.getYears() * rhs.getSign());
- rhsCalendar.add(GregorianCalendar.MONTH, rhs.getMonths() * rhs.getSign());
- rhsCalendar.add(GregorianCalendar.DAY_OF_YEAR, rhs.getDays() * rhs.getSign());
- rhsCalendar.add(GregorianCalendar.HOUR_OF_DAY, rhs.getHours() * rhs.getSign());
- rhsCalendar.add(GregorianCalendar.MINUTE, rhs.getMinutes() * rhs.getSign());
- rhsCalendar.add(GregorianCalendar.SECOND, rhs.getSeconds() * rhs.getSign());
-
-
- if (lhsCalendar.equals(rhsCalendar)) {
- return DatatypeConstants.EQUAL;
- }
-
- return compareDates(this, rhs);
}
/**
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationYearMonthImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationYearMonthImpl.java
index abf8c53075f..c4b41b8021b 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationYearMonthImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationYearMonthImpl.java
@@ -42,7 +42,6 @@ import javax.xml.datatype.DatatypeConstants;
*
* @author Vikram Aroskar
* @author Joe Wang
- * @version $Revision: 1.1 $, $Date: 2010/05/19 05:02:55 $
* @see XMLGregorianCalendar#add(Duration)
*/
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java
index 6c629e95184..9026a6f5f61 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java
@@ -188,7 +188,6 @@ import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
* @author Kohsuke Kawaguchi
* @author Joseph Fialli
* @author Sunitha Reddy
- * @version $Revision: 1.14 $, $Date: 2010-11-10 07:41:41 $
* @see javax.xml.datatype.Duration
* @since 1.5
*/
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/AbstractXMLSchema.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/AbstractXMLSchema.java
index 25e13a7a5ce..2d06bc0555a 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/AbstractXMLSchema.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/AbstractXMLSchema.java
@@ -30,7 +30,6 @@ import javax.xml.validation.ValidatorHandler;
* Abstract implementation of Schema for W3C XML Schemas.
*
* @author Michael Glavassevich, IBM
- * @version $Id: AbstractXMLSchema.java,v 1.6 2010-11-01 04:40:07 joehw Exp $
*/
abstract class AbstractXMLSchema extends Schema implements
XSGrammarPoolContainer {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMValidatorHelper.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMValidatorHelper.java
index 4c69e70c0e4..fe006533b1d 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMValidatorHelper.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/DOMValidatorHelper.java
@@ -63,7 +63,6 @@ import org.xml.sax.SAXException;
* A validator helper for DOMSource
s.
*
* @author Michael Glavassevich, IBM
- * @version $Id: DOMValidatorHelper.java,v 1.9 2010-11-01 04:40:08 joehw Exp $
*/
final class DOMValidatorHelper implements ValidatorHelper, EntityState {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/EmptyXMLSchema.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/EmptyXMLSchema.java
index eca00e81d11..ba50c5175b8 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/EmptyXMLSchema.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/EmptyXMLSchema.java
@@ -29,7 +29,6 @@ import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
* which contains no schema components.
*
* @author Michael Glavassevich, IBM
- * @version $Id: EmptyXMLSchema.java,v 1.6 2010-11-01 04:40:08 joehw Exp $
*/
final class EmptyXMLSchema extends AbstractXMLSchema implements XMLGrammarPool {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/JAXPValidationMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/JAXPValidationMessageFormatter.java
index 5c510533c98..8c50c4d477b 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/JAXPValidationMessageFormatter.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/JAXPValidationMessageFormatter.java
@@ -29,7 +29,6 @@ import java.util.ResourceBundle;
* Used to format JAXP Validation API error messages using a specified locale.
*
* @author Michael Glavassevich, IBM
- * @version $Id: JAXPValidationMessageFormatter.java,v 1.5 2010-11-01 04:40:08 joehw Exp $
*/
final class JAXPValidationMessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java
index d6c04fd984a..9e9f5aefc15 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java
@@ -48,7 +48,6 @@ import org.xml.sax.SAXException;
*
* @author Michael Glavassevich, IBM
* @author Sunitha Reddy
- * @version $Id: StreamValidatorHelper.java,v 1.7 2010-11-01 04:40:08 joehw Exp $
*/
final class StreamValidatorHelper implements ValidatorHelper {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java
index fc652af221a..1b6dd4053c1 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java
@@ -94,7 +94,6 @@ import org.xml.sax.ext.EntityResolver2;
* @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
* @author Michael Glavassevich, IBM
*
- * @version $Id: ValidatorHandlerImpl.java,v 1.10 2010-11-01 04:40:08 joehw Exp $
*/
final class ValidatorHandlerImpl extends ValidatorHandler implements
DTDHandler, EntityState, PSVIProvider, ValidatorHelper, XMLDocumentHandler {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorImpl.java
index f0d18dda6f2..acf5df06994 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorImpl.java
@@ -51,7 +51,6 @@ import org.xml.sax.SAXNotSupportedException;
* @author Kohsuke Kawaguchi
* @author Michael Glavassevich, IBM
* @author Sunitha Reddy
- * @version $Id: ValidatorImpl.java,v 1.10 2010-11-01 04:40:08 joehw Exp $
*/
final class ValidatorImpl extends Validator implements PSVIProvider {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java
index f2dadd0fc4a..0bdd28d826f 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java
@@ -65,7 +65,6 @@ import org.xml.sax.SAXParseException;
* {@link SchemaFactory} for XML Schema.
*
* @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
- * @version $Id: XMLSchemaFactory.java,v 1.11 2010-11-01 04:40:08 joehw Exp $
*/
public final class XMLSchemaFactory extends SchemaFactory {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java
index dcbbabd4d4a..58a74191cf0 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java
@@ -55,7 +55,6 @@ import org.xml.sax.ErrorHandler;
* An implementation of XMLComponentManager for a schema validator.
*
* @author Michael Glavassevich, IBM
- * @version $Id: XMLSchemaValidatorComponentManager.java,v 1.9 2010-11-01 04:40:08 joehw Exp $
*/
final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettings implements
XMLComponentManager {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XSGrammarPoolContainer.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XSGrammarPoolContainer.java
index 79ef5593b06..431a0f21f01 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XSGrammarPoolContainer.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XSGrammarPoolContainer.java
@@ -26,7 +26,6 @@ import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
* A container for grammar pools which only contain schema grammars.
*
* @author Michael Glavassevich, IBM
- * @version $Id: XSGrammarPoolContainer.java,v 1.6 2010-11-01 04:40:08 joehw Exp $
*/
public interface XSGrammarPoolContainer {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java
index 88ea9518646..5e6c5773fba 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractDOMParser.java
@@ -85,7 +85,6 @@ import org.xml.sax.SAXException;
* @author Andy Clark, IBM
* @author Elena Litani, IBM
*
- * @version $Id: AbstractDOMParser.java,v 1.10 2010-11-01 04:40:09 joehw Exp $
*/
public class AbstractDOMParser extends AbstractXMLDocumentParser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java
index eea7057417b..881020f0409 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java
@@ -77,7 +77,6 @@ import org.xml.sax.helpers.LocatorImpl;
* @author Arnaud Le Hors, IBM
* @author Andy Clark, IBM
*
- * @version $Id: AbstractSAXParser.java,v 1.6 2010-11-01 04:40:09 joehw Exp $
*/
public abstract class AbstractSAXParser
extends AbstractXMLDocumentParser
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/BasicParserConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/BasicParserConfiguration.java
index 3b352961618..c41f27d5a3f 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/BasicParserConfiguration.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/BasicParserConfiguration.java
@@ -94,7 +94,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
* @author Arnaud Le Hors, IBM
* @author Andy Clark, IBM
*
- * @version $Id: BasicParserConfiguration.java,v 1.6 2010-11-01 04:40:09 joehw Exp $
*/
public abstract class BasicParserConfiguration
extends ParserConfigurationSettings
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java
index f2020efda4b..05814b26396 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java
@@ -58,7 +58,6 @@ import org.xml.sax.helpers.LocatorImpl;
* @author Arnaud Le Hors, IBM
* @author Andy Clark, IBM
*
- * @version $Id: DOMParser.java,v 1.7 2010-11-01 04:40:09 joehw Exp $
*/
public class DOMParser
extends AbstractDOMParser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java
index 614c826047e..0053d984291 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParserImpl.java
@@ -79,7 +79,6 @@ import org.xml.sax.SAXException;
* @author Pavani Mukthipudi, Sun Microsystems Inc.
* @author Elena Litani, IBM
* @author Rahul Srivastava, Sun Microsystems Inc.
- * @version $Id: DOMParserImpl.java,v 1.8 2010-11-01 04:40:09 joehw Exp $
*/
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java
index 0f37f7c375e..ce27b8b1c72 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java
@@ -87,7 +87,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
* @author Andy Clark, IBM
* @author Neil Graham, IBM
*
- * @version $Id: DTDConfiguration.java,v 1.7 2010-11-01 04:40:09 joehw Exp $
*/
public class DTDConfiguration
extends BasicParserConfiguration
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java
index 469780136cd..834fdbf487a 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java
@@ -59,7 +59,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
* include the replacement text of internal entities, and supply default attribute values".
*
* @author Elena Litani, IBM
- * @version $Id: NonValidatingConfiguration.java,v 1.7 2010-11-01 04:40:09 joehw Exp $
*/
public class NonValidatingConfiguration
extends BasicParserConfiguration
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java
index 48b8a1ed538..811d957686e 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java
@@ -37,7 +37,6 @@ import org.xml.sax.SAXNotSupportedException;
* @author Arnaud Le Hors, IBM
* @author Andy Clark, IBM
*
- * @version $Id: SAXParser.java,v 1.7 2010-11-01 04:40:09 joehw Exp $
*/
public class SAXParser
extends AbstractSAXParser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java
index 65c85d164ca..7eba8746e59 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java
@@ -44,7 +44,6 @@ import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
*
* @author Neil Graham, IBM
*
- * @version $Id: SecurityConfiguration.java,v 1.6 2010-11-01 04:40:09 joehw Exp $
*/
public class SecurityConfiguration extends XIncludeAwareParserConfiguration
{
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/StandardParserConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/StandardParserConfiguration.java
index 7caad5bc25a..5ac09f8f866 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/StandardParserConfiguration.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/StandardParserConfiguration.java
@@ -64,7 +64,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
* @author Arnaud Le Hors, IBM
* @author Andy Clark, IBM
*
- * @version $Id: StandardParserConfiguration.java,v 1.7 2010-11-01 04:40:10 joehw Exp $
*/
public class StandardParserConfiguration
extends DTDConfiguration {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XIncludeAwareParserConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XIncludeAwareParserConfiguration.java
index 5b795e5357b..9ef0b52222c 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XIncludeAwareParserConfiguration.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XIncludeAwareParserConfiguration.java
@@ -39,7 +39,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
*
* @author Michael Glavassevich, IBM
*
- * @version $Id: XIncludeAwareParserConfiguration.java,v 1.5 2010-11-01 04:40:10 joehw Exp $
*/
public class XIncludeAwareParserConfiguration extends XML11Configuration {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java
index bbcbceed10e..c0283f74e3c 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java
@@ -78,7 +78,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
* @author Neil Graham, IBM
* @author Michael Glavassevich, IBM
*
- * @version $Id: XML11Configuration.java,v 1.9 2010-11-01 04:40:10 joehw Exp $
*/
public class XML11Configuration extends ParserConfigurationSettings
implements XMLPullParserConfiguration, XML11Configurable {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11DTDConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11DTDConfiguration.java
index 3dfa85e5bd5..f7591ae608e 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11DTDConfiguration.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11DTDConfiguration.java
@@ -103,7 +103,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
* @author Michael Glavassevich, IBM
* @author John Kim, IBM
*
- * @version $Id: XML11DTDConfiguration.java,v 1.5 2010-11-01 04:40:10 joehw Exp $
*/
public class XML11DTDConfiguration extends ParserConfigurationSettings
implements XMLPullParserConfiguration, XML11Configurable {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11NonValidatingConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11NonValidatingConfiguration.java
index 43f873013e7..36a284239f3 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11NonValidatingConfiguration.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11NonValidatingConfiguration.java
@@ -74,7 +74,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
* @author John Kim, IBM
* @author Michael Glavassevich, IBM
*
- * @version $Id: XML11NonValidatingConfiguration.java,v 1.5 2010-11-01 04:40:10 joehw Exp $
*/
public class XML11NonValidatingConfiguration extends ParserConfigurationSettings
implements XMLPullParserConfiguration, XML11Configurable {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLDocumentParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLDocumentParser.java
index 8a89e98f297..eba49fbad92 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLDocumentParser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLDocumentParser.java
@@ -33,7 +33,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
* @author Arnaud Le Hors, IBM
* @author Andy Clark, IBM
*
- * @version $Id: XMLDocumentParser.java,v 1.6 2010-11-01 04:40:10 joehw Exp $
*/
public class XMLDocumentParser
extends AbstractXMLDocumentParser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarCachingConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarCachingConfiguration.java
index 897b7542fde..4e1181a122f 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarCachingConfiguration.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarCachingConfiguration.java
@@ -62,7 +62,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
*
* @author Neil Graham, IBM
*
- * @version $Id: XMLGrammarCachingConfiguration.java,v 1.6 2010-11-01 04:40:10 joehw Exp $
*/
public class XMLGrammarCachingConfiguration
extends XIncludeAwareParserConfiguration {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarParser.java
index 7d88781e679..1089493f2eb 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarParser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarParser.java
@@ -25,7 +25,6 @@ import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
import com.sun.org.apache.xerces.internal.util.SymbolTable;
/**
- * @version $Id: XMLGrammarParser.java,v 1.6 2010-11-01 04:40:10 joehw Exp $
*/
public abstract class XMLGrammarParser
extends XMLParser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java
index 6690922da71..71063cc204f 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLGrammarPreparser.java
@@ -49,7 +49,6 @@ import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
*
* @author Neil Graham, IBM
*
- * @version $Id: XMLGrammarPreparser.java,v 1.7 2010-11-01 04:40:10 joehw Exp $
*/
public class XMLGrammarPreparser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java
index 970cc51cd26..fe7801fcbb3 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java
@@ -49,7 +49,6 @@ import org.xml.sax.SAXNotRecognizedException;
* @author Arnaud Le Hors, IBM
* @author Andy Clark, IBM
*
- * @version $Id: XMLParser.java,v 1.5 2007/07/20 14:11:21 spericas Exp $
*/
public abstract class XMLParser {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/DOMUtil.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/DOMUtil.java
index da13e8fd1a9..4a00810f106 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/util/DOMUtil.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/DOMUtil.java
@@ -42,7 +42,6 @@ import org.w3c.dom.ls.LSException;
* (such as a DTM), we should easily be able to convert our schema
* parsing to utilize it.
*
- * @version $Id: DOMUtil.java,v 1.7 2010-11-01 04:40:14 joehw Exp $
*/
public class DOMUtil {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java
index b964a8fbfd8..500769db59a 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java
@@ -29,7 +29,6 @@ import java.util.ResourceBundle;
* Used to format JAXP 1.3 Datatype API error messages using a specified locale.
*
* @author Neeraj Bajaj, Sun Microsystems
- * @version $Id: DatatypeMessageFormatter.java,v 1.6 2010-11-01 04:40:14 joehw Exp $
*/
public class DatatypeMessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/EncodingMap.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/EncodingMap.java
index 8b083a3ba46..8c4748966c4 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/util/EncodingMap.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/EncodingMap.java
@@ -470,7 +470,6 @@ import java.util.Hashtable;
* @author TAMURA Kent, IBM
* @author Andy Clark, IBM
*
- * @version $Id$
*/
public class EncodingMap {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.java
index cdf62d01ab9..b14922c9154 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.java
@@ -37,7 +37,6 @@ import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
*
* @author Michael Glavassevich, IBM
*
- * @version $Id: JAXPNamespaceContextWrapper.java,v 1.2 2010-10-26 23:01:13 joehw Exp $
*/
public final class JAXPNamespaceContextWrapper implements NamespaceContext {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java
index a13d8154c96..17281841704 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java
@@ -43,7 +43,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
*
* @author Andy Clark, IBM
*
- * @version $Id: ParserConfigurationSettings.java,v 1.6 2010-11-01 04:40:14 joehw Exp $
*/
public class ParserConfigurationSettings
implements XMLComponentManager {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java
index 29648a629f9..5c87f4ba497 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java
@@ -29,7 +29,6 @@ import java.util.ResourceBundle;
*
* @author Michael Glavassevich, IBM
*
- * @version $Id: SAXMessageFormatter.java,v 1.6 2010-11-01 04:40:14 joehw Exp $
*/
public class SAXMessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/StAXInputSource.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/StAXInputSource.java
index 24def72fa7b..6cc9aa6cb48 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/util/StAXInputSource.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/StAXInputSource.java
@@ -30,7 +30,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
/**
* An XMLInputSource
analogue to javax.xml.transform.stax.StAXSource
.
*
- * @version $Id: StAXInputSource.java,v 1.2 2010-10-26 23:01:17 joehw Exp $
*/
public final class StAXInputSource extends XMLInputSource {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/StAXLocationWrapper.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/StAXLocationWrapper.java
index 566533d1582..22b806295ac 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/util/StAXLocationWrapper.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/StAXLocationWrapper.java
@@ -32,7 +32,6 @@ import com.sun.org.apache.xerces.internal.xni.XMLLocator;
*
* @author Michael Glavassevich, IBM
*
- * @version $Id: StAXLocationWrapper.java,v 1.2 2010-10-26 23:01:13 joehw Exp $
*/
public final class StAXLocationWrapper implements XMLLocator {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolHash.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolHash.java
index dee8383ea4a..ae0aacb723b 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolHash.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolHash.java
@@ -28,7 +28,6 @@ package com.sun.org.apache.xerces.internal.util;
* The hash code uses the same algorithm as SymbolTable class.
*
* @author Elena Litani
- * @version $Id: SymbolHash.java,v 1.7 2010-11-01 04:40:14 joehw Exp $
*/
public class SymbolHash {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/XML11Char.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XML11Char.java
index d19518e6afa..8c9e3412e7d 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/util/XML11Char.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/XML11Char.java
@@ -41,7 +41,6 @@ import java.util.Arrays;
* @author Neil Graham, IBM
* @author Michael Glavassevich, IBM
*
- * @version $Id: XML11Char.java,v 1.7 2010-11-01 04:40:15 joehw Exp $
*/
public class XML11Char {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java
index a3b879f2fbc..55717373866 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java
@@ -83,7 +83,6 @@ import com.sun.org.apache.xerces.internal.xni.XMLString;
* @author Elena Litani, IBM
* @author Michael Glavassevich, IBM
*
- * @version $Id: XMLAttributesImpl.java,v 1.7 2010/05/07 20:13:09 joehw Exp $
*/
public class XMLAttributesImpl
implements XMLAttributes, XMLBufferListener {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLChar.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLChar.java
index 731b31a70ab..b649c34efa8 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLChar.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLChar.java
@@ -44,7 +44,6 @@ import java.util.Arrays;
* @author Michael Glavassevich, IBM
* @author Rahul Srivastava, Sun Microsystems Inc.
*
- * @version $Id: XMLChar.java,v 1.7 2010-11-01 04:40:15 joehw Exp $
*/
public class XMLChar {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java
index 2e4ceeae001..0ec5ad520a3 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/ObjectFactory.java
@@ -32,7 +32,6 @@ package com.sun.org.apache.xerces.internal.utils;
* when bundled as part of the JDK.
*
*
- * @version $Id: ObjectFactory.java,v 1.6 2010/04/23 01:44:34 joehw Exp $
*/
public final class ObjectFactory {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java
index a060f99e091..016a6168873 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java
@@ -115,7 +115,6 @@ import java.util.Objects;
* @author Peter McCracken, IBM
* @author Michael Glavassevich, IBM
*
- * @version $Id: XIncludeHandler.java,v 1.7 2010-11-01 04:40:18 joehw Exp $
*
* @see XIncludeNamespaceSupport
*/
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java
index 0275615e2fc..4420e29934d 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java
@@ -32,7 +32,6 @@ import java.util.ResourceBundle;
*
* @author Peter McCracken, IBM
*
- * @version $Id: XIncludeMessageFormatter.java,v 1.7 2010-11-01 04:40:18 joehw Exp $
*/
public class XIncludeMessageFormatter implements MessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xni/QName.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/QName.java
index 5c47b7a53be..d6d5ce6a63d 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xni/QName.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xni/QName.java
@@ -77,7 +77,6 @@ package com.sun.org.apache.xerces.internal.xni;
* == were used to compare strings
* @author Joe Wang, Oracle
*
- * @version $Id: QName.java,v 1.6 2010/03/18 19:32:31 joehw Exp $
*/
public class QName
implements Cloneable {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xni/XNIException.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/XNIException.java
index 4247551e5eb..98b9d40abad 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xni/XNIException.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xni/XNIException.java
@@ -32,7 +32,6 @@ package com.sun.org.apache.xerces.internal.xni;
*
* @author Andy Clark, IBM
*
- * @version $Id: XNIException.java,v 1.6 2010-11-01 04:40:19 joehw Exp $
*/
public class XNIException
extends RuntimeException {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponentManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponentManager.java
index 80faa6a6d02..1ea05c6babd 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponentManager.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponentManager.java
@@ -36,7 +36,6 @@ import com.sun.org.apache.xerces.internal.util.PropertyState;
*
* @author Andy Clark, IBM
*
- * @version $Id: XMLComponentManager.java,v 1.6 2010-11-01 04:40:22 joehw Exp $
*/
public interface XMLComponentManager {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLConfigurationException.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLConfigurationException.java
index b1cd779c483..3f1280d1fb8 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLConfigurationException.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLConfigurationException.java
@@ -30,7 +30,6 @@ import com.sun.org.apache.xerces.internal.xni.XNIException;
*
* @author Andy Clark, IBM
*
- * @version $Id: XMLConfigurationException.java,v 1.7 2010-11-01 04:40:22 joehw Exp $
*/
public class XMLConfigurationException
extends XNIException {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java
index 5f44b08289f..33bf6b880e7 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java
@@ -38,7 +38,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
*
* @xerces.internal
*
- * @version $Id: ElementSchemePointer.java,v 1.4 2009/06/11 23:51:50 joehw Exp $
*/
final class ElementSchemePointer implements XPointerPart {
@@ -498,7 +497,6 @@ final class ElementSchemePointer implements XPointerPart {
* @xerces.internal
*
* @author Neil Delima, IBM
- * @version $Id: ElementSchemePointer.java,v 1.4 2009/06/11 23:51:50 joehw Exp $
*
*/
private final class Tokens {
@@ -656,7 +654,6 @@ final class ElementSchemePointer implements XPointerPart {
*
* @xerces.internal
*
- * @version $Id: ElementSchemePointer.java,v 1.4 2009/06/11 23:51:50 joehw Exp $
*/
private class Scanner {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java
index 36ee4811039..12603a8d722 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java
@@ -34,7 +34,6 @@ import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
*
* @xerces.internal
*
- * @version $Id: XPointerMessageFormatter.java,v 1.5 2010-11-01 04:40:26 joehw Exp $
*/
final class XPointerMessageFormatter implements MessageFormatter {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.java
index a1138401296..c1d1edefd03 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.java
@@ -29,7 +29,6 @@ import com.sun.org.apache.xerces.internal.xs.XSException;
*
* @author Ankit Pasricha, IBM
*
- * @version $Id: ByteList.java,v 1.7 2010-11-01 04:40:31 joehw Exp $
*/
public interface ByteList extends List {
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.java
index c47853f8ea5..141fb0a7b26 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.java
@@ -27,7 +27,6 @@ import java.util.List;
*
* @author Ankit Pasricha, IBM
*
- * @version $Id: ObjectList.java,v 1.7 2010-11-01 04:40:31 joehw Exp $
*/
public interface ObjectList extends List {
diff --git a/jaxp/src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogReader.java b/jaxp/src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogReader.java
index c5740cb1c66..bd14b28ae39 100644
--- a/jaxp/src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogReader.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/resolver/readers/DOMCatalogReader.java
@@ -57,7 +57,6 @@ import sun.reflect.misc.ReflectUtil;
*
The selection of CatalogParsers is made on the basis of the QName
* of the root element of the document.
*
- * This class requires the Java API for XML Parsing.
*
* @see Catalog
* @see CatalogReader
diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java
index c9b36c5b07a..eae65068d82 100644
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java
@@ -72,7 +72,6 @@ import org.w3c.dom.ls.LSSerializerFilter;
* @author Gopal Sharma, Sun Microsystems
* @author Arun Yadav, Sun Microsystems
* @author Sunitha Reddy, Sun Microsystems
- * @version $Id: DOMSerializerImpl.java,v 1.11 2010-11-01 04:40:36 joehw Exp $
*/
public class DOMSerializerImpl implements LSSerializer, DOMConfiguration {
diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java
index 9c21756f8b3..252483fc53d 100644
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java
@@ -29,7 +29,6 @@ import com.sun.org.apache.xerces.internal.util.EncodingMap;
/**
* This class represents an encoding.
*
- * @version $Id: EncodingInfo.java,v 1.6 2007/10/18 03:39:08 joehw Exp $
*/
public class EncodingInfo {
diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java
index 25da0c6517a..2150e31a0b5 100644
--- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java
@@ -32,7 +32,6 @@ import java.util.StringTokenizer;
/**
*
*
- * @version $Revision: 1.6 $ $Date: 2010-11-01 04:40:36 $
* @author Scott Boag
* @author Assaf Arkin
*/
diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java
index d4d95ff8cf2..80eb8a5d969 100644
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java
@@ -50,7 +50,6 @@ import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
* to override encoding names and provide the last printable character
* for each encoding.
*
- * @version $Revision: 1.11 $ $Date: 2010-11-01 04:34:44 $
* @author Assaf Arkin
*/
diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java
index 925ce9c1234..dc64401eda6 100644
--- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java
@@ -52,7 +52,6 @@ import org.xml.sax.InputSource;
/**
* The XPathExpression interface encapsulates a (compiled) XPath expression.
*
- * @version $Revision: 1.10 $
* @author Ramesh Mandava
*/
public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{
diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java
index b050af44674..c649306da4b 100644
--- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java
@@ -36,7 +36,6 @@ import javax.xml.xpath.XPathVariableResolver;
/**
* The XPathFactory builds XPaths.
*
- * @version $Revision: 1.11 $
* @author Ramesh Mandava
*/
public class XPathFactoryImpl extends XPathFactory {
diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java
index af82f378917..ebd6b2c712f 100644
--- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java
@@ -54,7 +54,6 @@ import java.io.IOException;
* of an XPath expression.
*
*
- * @version $Revision: 1.10 $
* @author Ramesh Mandava
*/
public class XPathImpl implements javax.xml.xpath.XPath {
diff --git a/jaxp/src/javax/xml/XMLConstants.java b/jaxp/src/javax/xml/XMLConstants.java
index 8e805ec03da..70b8bdfa812 100644
--- a/jaxp/src/javax/xml/XMLConstants.java
+++ b/jaxp/src/javax/xml/XMLConstants.java
@@ -29,7 +29,6 @@ package javax.xml;
* Utility class to contain basic XML values as constants.
*
* @author Jeff Suttor
- * @version $Revision: 1.8 $, $Date: 2010/05/25 16:19:45 $
* @see Extensible Markup Language (XML) 1.1
* @see Extensible Markup Language (XML) 1.0 (Second Edition)
* @see XML 1.0 Second Edition Specification Errata
diff --git a/jaxp/src/javax/xml/datatype/DatatypeFactory.java b/jaxp/src/javax/xml/datatype/DatatypeFactory.java
index 8138f98de1d..0a96c5760ef 100644
--- a/jaxp/src/javax/xml/datatype/DatatypeFactory.java
+++ b/jaxp/src/javax/xml/datatype/DatatypeFactory.java
@@ -72,7 +72,6 @@ import java.util.regex.Pattern;
* @author Jeff Suttor
* @author Neeraj Bajaj
*
- * @version $Revision: 1.13 $, $Date: 2010/03/11 23:10:53 $
* @since 1.5
*/
public abstract class DatatypeFactory {
diff --git a/jaxp/src/javax/xml/datatype/package.html b/jaxp/src/javax/xml/datatype/package.html
index af81454af96..de065acc664 100644
--- a/jaxp/src/javax/xml/datatype/package.html
+++ b/jaxp/src/javax/xml/datatype/package.html
@@ -31,7 +31,6 @@ questions.
javax.xml.xpath
-
diff --git a/jaxp/src/javax/xml/namespace/QName.java b/jaxp/src/javax/xml/namespace/QName.java
index 994b2a3816c..4792f772337 100644
--- a/jaxp/src/javax/xml/namespace/QName.java
+++ b/jaxp/src/javax/xml/namespace/QName.java
@@ -62,7 +62,6 @@ import javax.xml.XMLConstants;
* QName
is immutable.
*
* @author Jeff Suttor
- * @version $Revision: 1.8 $, $Date: 2010/03/18 03:06:17 $
* @see
* XML Schema Part2: Datatypes specification
* @see
diff --git a/jaxp/src/javax/xml/parsers/DocumentBuilder.java b/jaxp/src/javax/xml/parsers/DocumentBuilder.java
index 33c325d11af..95530bcdf73 100644
--- a/jaxp/src/javax/xml/parsers/DocumentBuilder.java
+++ b/jaxp/src/javax/xml/parsers/DocumentBuilder.java
@@ -57,6 +57,7 @@ import org.xml.sax.SAXException;
* communicate with the application using these existing APIs.
*
* @author Jeff Suttor
+ * @since 1.4
*/
public abstract class DocumentBuilder {
diff --git a/jaxp/src/javax/xml/parsers/DocumentBuilderFactory.java b/jaxp/src/javax/xml/parsers/DocumentBuilderFactory.java
index ed77da8a73f..0625b850986 100644
--- a/jaxp/src/javax/xml/parsers/DocumentBuilderFactory.java
+++ b/jaxp/src/javax/xml/parsers/DocumentBuilderFactory.java
@@ -34,8 +34,7 @@ import javax.xml.validation.Schema;
* @author Jeff Suttor
* @author Neeraj Bajaj
*
- * @version $Revision: 1.9 $, $Date: 2010/05/25 16:19:44 $
-
+ * @since 1.4
*/
public abstract class DocumentBuilderFactory {
@@ -440,6 +439,7 @@ public abstract class DocumentBuilderFactory {
* @throws ParserConfigurationException if this DocumentBuilderFactory
or the DocumentBuilder
s
* it creates cannot support this feature.
* @throws NullPointerException If the name
parameter is null.
+ * @since 1.5
*/
public abstract void setFeature(String name, boolean value)
throws ParserConfigurationException;
@@ -461,6 +461,7 @@ public abstract class DocumentBuilderFactory {
*
* @throws ParserConfigurationException if this DocumentBuilderFactory
* or the DocumentBuilder
s it creates cannot support this feature.
+ * @since 1.5
*/
public abstract boolean getFeature(String name)
throws ParserConfigurationException;
diff --git a/jaxp/src/javax/xml/parsers/FactoryConfigurationError.java b/jaxp/src/javax/xml/parsers/FactoryConfigurationError.java
index be008262124..0dc01a91aa9 100644
--- a/jaxp/src/javax/xml/parsers/FactoryConfigurationError.java
+++ b/jaxp/src/javax/xml/parsers/FactoryConfigurationError.java
@@ -32,7 +32,7 @@ package javax.xml.parsers;
* or instantiated.
*
* @author Jeff Suttor
- * @version $Revision: 1.7 $, $Date: 2010-11-01 04:36:09 $
+ * @since 1.4
*/
public class FactoryConfigurationError extends Error {
diff --git a/jaxp/src/javax/xml/parsers/ParserConfigurationException.java b/jaxp/src/javax/xml/parsers/ParserConfigurationException.java
index ed9ecfc03d2..587d4175784 100644
--- a/jaxp/src/javax/xml/parsers/ParserConfigurationException.java
+++ b/jaxp/src/javax/xml/parsers/ParserConfigurationException.java
@@ -29,6 +29,7 @@ package javax.xml.parsers;
* Indicates a serious configuration error.
*
* @author Jeff Suttor
+ * @since 1.4
*/
public class ParserConfigurationException extends Exception {
diff --git a/jaxp/src/javax/xml/parsers/SAXParser.java b/jaxp/src/javax/xml/parsers/SAXParser.java
index 8a58bee232a..9be9381f59e 100644
--- a/jaxp/src/javax/xml/parsers/SAXParser.java
+++ b/jaxp/src/javax/xml/parsers/SAXParser.java
@@ -75,6 +75,7 @@ import org.xml.sax.helpers.DefaultHandler;
* this revised class.
*
* @author Jeff Suttor
+ * @since 1.4
*/
public abstract class SAXParser {
diff --git a/jaxp/src/javax/xml/parsers/SAXParserFactory.java b/jaxp/src/javax/xml/parsers/SAXParserFactory.java
index b0a3bb67f8e..7de367e702e 100644
--- a/jaxp/src/javax/xml/parsers/SAXParserFactory.java
+++ b/jaxp/src/javax/xml/parsers/SAXParserFactory.java
@@ -37,8 +37,7 @@ import org.xml.sax.SAXNotSupportedException;
* @author Jeff Suttor
* @author Neeraj Bajaj
*
- * @version $Revision: 1.9 $, $Date: 2010/05/25 16:19:44 $
- *
+ * @since 1.4
*/
public abstract class SAXParserFactory {
diff --git a/jaxp/src/javax/xml/transform/ErrorListener.java b/jaxp/src/javax/xml/transform/ErrorListener.java
index b81e6119605..5d8d82c3662 100644
--- a/jaxp/src/javax/xml/transform/ErrorListener.java
+++ b/jaxp/src/javax/xml/transform/ErrorListener.java
@@ -49,6 +49,8 @@ package javax.xml.transform;
*
* Transformer
s may use this mechanism to report XML parsing
* errors as well as transformation errors.
+ *
+ * @since 1.4
*/
public interface ErrorListener {
diff --git a/jaxp/src/javax/xml/transform/OutputKeys.java b/jaxp/src/javax/xml/transform/OutputKeys.java
index 3c0fc35e049..ac1a0213239 100644
--- a/jaxp/src/javax/xml/transform/OutputKeys.java
+++ b/jaxp/src/javax/xml/transform/OutputKeys.java
@@ -33,6 +33,7 @@ package javax.xml.transform;
*
* @see
* section 16 of the XSL Transformations (XSLT) W3C Recommendation
+ * @since 1.4
*/
public class OutputKeys {
diff --git a/jaxp/src/javax/xml/transform/Result.java b/jaxp/src/javax/xml/transform/Result.java
index 47472852707..fb5a42ee923 100644
--- a/jaxp/src/javax/xml/transform/Result.java
+++ b/jaxp/src/javax/xml/transform/Result.java
@@ -30,6 +30,7 @@ package javax.xml.transform;
* needed to build a transformation result tree.
*
* @author Jeff Suttor
+ * @since 1.4
*/
public interface Result {
diff --git a/jaxp/src/javax/xml/transform/Source.java b/jaxp/src/javax/xml/transform/Source.java
index 3af6969d09f..fe3d7111439 100644
--- a/jaxp/src/javax/xml/transform/Source.java
+++ b/jaxp/src/javax/xml/transform/Source.java
@@ -28,6 +28,8 @@ package javax.xml.transform;
/**
* An object that implements this interface contains the information
* needed to act as source input (XML source or transformation instructions).
+ *
+ * @since 1.4
*/
public interface Source {
diff --git a/jaxp/src/javax/xml/transform/SourceLocator.java b/jaxp/src/javax/xml/transform/SourceLocator.java
index 475e6546392..e5cd840f686 100644
--- a/jaxp/src/javax/xml/transform/SourceLocator.java
+++ b/jaxp/src/javax/xml/transform/SourceLocator.java
@@ -28,6 +28,8 @@ package javax.xml.transform;
/**
* This interface is primarily for the purposes of reporting where
* an error occurred in the XML source or transformation instructions.
+ *
+ * @since 1.4
*/
public interface SourceLocator {
diff --git a/jaxp/src/javax/xml/transform/Templates.java b/jaxp/src/javax/xml/transform/Templates.java
index 9952368e7bc..9e3871800fe 100644
--- a/jaxp/src/javax/xml/transform/Templates.java
+++ b/jaxp/src/javax/xml/transform/Templates.java
@@ -37,6 +37,8 @@ import java.util.Properties;
* Templates must be threadsafe for a given instance
* over multiple threads running concurrently, and may
* be used multiple times in a given session.
+ *
+ * @since 1.4
*/
public interface Templates {
diff --git a/jaxp/src/javax/xml/transform/Transformer.java b/jaxp/src/javax/xml/transform/Transformer.java
index 783e87a73fb..96292803f2e 100644
--- a/jaxp/src/javax/xml/transform/Transformer.java
+++ b/jaxp/src/javax/xml/transform/Transformer.java
@@ -45,6 +45,7 @@ import java.util.Properties;
* output properties are preserved across transformations.
*
* @author Jeff Suttor
+ * @since 1.4
*/
public abstract class Transformer {
diff --git a/jaxp/src/javax/xml/transform/TransformerConfigurationException.java b/jaxp/src/javax/xml/transform/TransformerConfigurationException.java
index 7e24ac808b7..a81fde2989c 100644
--- a/jaxp/src/javax/xml/transform/TransformerConfigurationException.java
+++ b/jaxp/src/javax/xml/transform/TransformerConfigurationException.java
@@ -27,6 +27,8 @@ package javax.xml.transform;
/**
* Indicates a serious configuration error.
+ *
+ * @since 1.4
*/
public class TransformerConfigurationException extends TransformerException {
diff --git a/jaxp/src/javax/xml/transform/TransformerException.java b/jaxp/src/javax/xml/transform/TransformerException.java
index 0985ebb0594..dfd48246e27 100644
--- a/jaxp/src/javax/xml/transform/TransformerException.java
+++ b/jaxp/src/javax/xml/transform/TransformerException.java
@@ -31,6 +31,8 @@ import java.lang.reflect.InvocationTargetException;
/**
* This class specifies an exceptional condition that occured
* during the transformation process.
+ *
+ * @since 1.4
*/
public class TransformerException extends Exception {
diff --git a/jaxp/src/javax/xml/transform/TransformerFactoryConfigurationError.java b/jaxp/src/javax/xml/transform/TransformerFactoryConfigurationError.java
index b8ac36cd58a..3eda99138af 100644
--- a/jaxp/src/javax/xml/transform/TransformerFactoryConfigurationError.java
+++ b/jaxp/src/javax/xml/transform/TransformerFactoryConfigurationError.java
@@ -30,6 +30,8 @@ package javax.xml.transform;
* exists. This error will typically be thrown when the class of a
* transformation factory specified in the system properties cannot be found
* or instantiated.
+ *
+ * @since 1.4
*/
public class TransformerFactoryConfigurationError extends Error {
private static final long serialVersionUID = -6527718720676281516L;
diff --git a/jaxp/src/javax/xml/transform/URIResolver.java b/jaxp/src/javax/xml/transform/URIResolver.java
index a4ea4c052ad..d8a3ac090a2 100644
--- a/jaxp/src/javax/xml/transform/URIResolver.java
+++ b/jaxp/src/javax/xml/transform/URIResolver.java
@@ -28,6 +28,8 @@ package javax.xml.transform;
/**
* An object that implements this interface that can be called by the processor
* to turn a URI used in document(), xsl:import, or xsl:include into a Source object.
+ *
+ * @since 1.4
*/
public interface URIResolver {
diff --git a/jaxp/src/javax/xml/transform/dom/DOMLocator.java b/jaxp/src/javax/xml/transform/dom/DOMLocator.java
index 13a7446148f..a68c031b72b 100644
--- a/jaxp/src/javax/xml/transform/dom/DOMLocator.java
+++ b/jaxp/src/javax/xml/transform/dom/DOMLocator.java
@@ -37,6 +37,8 @@ import org.w3c.dom.Node;
* object returned by an exception. A {@link javax.xml.transform.Transformer}
* may use this object for purposes other than error reporting, for instance,
* to indicate the source node that originated a result node.
+ *
+ * @since 1.4
*/
public interface DOMLocator extends SourceLocator {
diff --git a/jaxp/src/javax/xml/transform/dom/DOMResult.java b/jaxp/src/javax/xml/transform/dom/DOMResult.java
index c7adfc4ef40..67ec2418740 100644
--- a/jaxp/src/javax/xml/transform/dom/DOMResult.java
+++ b/jaxp/src/javax/xml/transform/dom/DOMResult.java
@@ -35,6 +35,7 @@ import org.w3c.dom.Node;
* which may be retrieved with {@link #getNode()}.
*
* @author Jeff Suttor
+ * @since 1.4
*/
public class DOMResult implements Result {
diff --git a/jaxp/src/javax/xml/transform/dom/DOMSource.java b/jaxp/src/javax/xml/transform/dom/DOMSource.java
index 83e64fd471b..dc4e93e07f1 100644
--- a/jaxp/src/javax/xml/transform/dom/DOMSource.java
+++ b/jaxp/src/javax/xml/transform/dom/DOMSource.java
@@ -40,6 +40,7 @@ import org.w3c.dom.Node;
*
* @author Jeff Suttor
* @see Document Object Model (DOM) Level 2 Specification
+ * @since 1.4
*/
public class DOMSource implements Source {
diff --git a/jaxp/src/javax/xml/transform/sax/SAXResult.java b/jaxp/src/javax/xml/transform/sax/SAXResult.java
index b0158b3dcdc..bc88d6bd206 100644
--- a/jaxp/src/javax/xml/transform/sax/SAXResult.java
+++ b/jaxp/src/javax/xml/transform/sax/SAXResult.java
@@ -34,6 +34,7 @@ import org.xml.sax.ext.LexicalHandler;
* Acts as an holder for a transformation Result.
*
* @author Jeff Suttor
+ * @since 1.4
*/
public class SAXResult implements Result {
diff --git a/jaxp/src/javax/xml/transform/sax/SAXSource.java b/jaxp/src/javax/xml/transform/sax/SAXSource.java
index 52315646cf3..0d573780e56 100644
--- a/jaxp/src/javax/xml/transform/sax/SAXSource.java
+++ b/jaxp/src/javax/xml/transform/sax/SAXSource.java
@@ -41,6 +41,7 @@ import org.xml.sax.XMLReader;
* {@link javax.xml.parsers.SAXParserFactory#setNamespaceAware(boolean awareness)} method.
*
* @author Jeff Suttor
+ * @since 1.4
*/
public class SAXSource implements Source {
diff --git a/jaxp/src/javax/xml/transform/sax/SAXTransformerFactory.java b/jaxp/src/javax/xml/transform/sax/SAXTransformerFactory.java
index 777e0bf2420..cb419e20c37 100644
--- a/jaxp/src/javax/xml/transform/sax/SAXTransformerFactory.java
+++ b/jaxp/src/javax/xml/transform/sax/SAXTransformerFactory.java
@@ -39,6 +39,8 @@ import org.xml.sax.XMLFilter;
* for an XMLReader used during a transformation, it should use a URIResolver
* to return the SAXSource which provides (with getXMLReader) a reference to
* the XMLReader.
+ *
+ * @since 1.4
*/
public abstract class SAXTransformerFactory extends TransformerFactory {
diff --git a/jaxp/src/javax/xml/transform/sax/TemplatesHandler.java b/jaxp/src/javax/xml/transform/sax/TemplatesHandler.java
index 34b5ba2bec4..b2efea5d88c 100644
--- a/jaxp/src/javax/xml/transform/sax/TemplatesHandler.java
+++ b/jaxp/src/javax/xml/transform/sax/TemplatesHandler.java
@@ -34,6 +34,8 @@ import org.xml.sax.ContentHandler;
* parse events (parsing transformation instructions) into a Templates object.
*
* Note that TemplatesHandler does not need to implement LexicalHandler.
+ *
+ * @since 1.4
*/
public interface TemplatesHandler extends ContentHandler {
diff --git a/jaxp/src/javax/xml/transform/sax/TransformerHandler.java b/jaxp/src/javax/xml/transform/sax/TransformerHandler.java
index 8bced5e8649..3c15367f892 100644
--- a/jaxp/src/javax/xml/transform/sax/TransformerHandler.java
+++ b/jaxp/src/javax/xml/transform/sax/TransformerHandler.java
@@ -36,6 +36,8 @@ import org.xml.sax.ext.LexicalHandler;
* A TransformerHandler
* listens for SAX ContentHandler parse events and transforms
* them to a Result.
+ *
+ * @since 1.4
*/
public interface TransformerHandler
extends ContentHandler, LexicalHandler, DTDHandler {
diff --git a/jaxp/src/javax/xml/transform/stream/StreamResult.java b/jaxp/src/javax/xml/transform/stream/StreamResult.java
index 39df253fa12..57db8665801 100644
--- a/jaxp/src/javax/xml/transform/stream/StreamResult.java
+++ b/jaxp/src/javax/xml/transform/stream/StreamResult.java
@@ -37,6 +37,7 @@ import java.net.MalformedURLException;
* which may be XML, plain Text, HTML, or some other form of markup.
*
* @author Jeff Suttor
+ * @since 1.4
*/
public class StreamResult implements Result {
diff --git a/jaxp/src/javax/xml/transform/stream/StreamSource.java b/jaxp/src/javax/xml/transform/stream/StreamSource.java
index ad41b9d303d..7627d5e3b55 100644
--- a/jaxp/src/javax/xml/transform/stream/StreamSource.java
+++ b/jaxp/src/javax/xml/transform/stream/StreamSource.java
@@ -39,6 +39,7 @@ import javax.xml.transform.Source;
* StreamSource
instances may only be used once.
*
* @author Jeff Suttor
+ * @since 1.4
*/
public class StreamSource implements Source {
diff --git a/jaxp/src/javax/xml/validation/SchemaFactoryFinder.java b/jaxp/src/javax/xml/validation/SchemaFactoryFinder.java
index 907e67a66fa..16b84f636bd 100644
--- a/jaxp/src/javax/xml/validation/SchemaFactoryFinder.java
+++ b/jaxp/src/javax/xml/validation/SchemaFactoryFinder.java
@@ -40,7 +40,6 @@ import java.util.ServiceLoader;
* Implementation of {@link SchemaFactory#newInstance(String)}.
*
* @author Kohsuke Kawaguchi
- * @version $Revision: 1.8 $, $Date: 2010-11-01 04:36:13 $
* @since 1.5
*/
class SchemaFactoryFinder {
diff --git a/jaxp/src/javax/xml/xpath/XPathFactoryFinder.java b/jaxp/src/javax/xml/xpath/XPathFactoryFinder.java
index f99ddc8a0c2..bceeda854e8 100644
--- a/jaxp/src/javax/xml/xpath/XPathFactoryFinder.java
+++ b/jaxp/src/javax/xml/xpath/XPathFactoryFinder.java
@@ -40,7 +40,6 @@ import java.util.ServiceLoader;
* Implementation of {@link XPathFactory#newInstance(String)}.
*
* @author Kohsuke Kawaguchi
- * @version $Revision: 1.7 $, $Date: 2010-11-01 04:36:14 $
* @since 1.5
*/
class XPathFactoryFinder {
diff --git a/jaxp/src/javax/xml/xpath/package.html b/jaxp/src/javax/xml/xpath/package.html
index 6f49222a255..82415a2d407 100644
--- a/jaxp/src/javax/xml/xpath/package.html
+++ b/jaxp/src/javax/xml/xpath/package.html
@@ -32,7 +32,6 @@ questions.
-
diff --git a/jaxp/src/org/w3c/dom/Attr.java b/jaxp/src/org/w3c/dom/Attr.java
index 8231a54156a..8db99e9a6a1 100644
--- a/jaxp/src/org/w3c/dom/Attr.java
+++ b/jaxp/src/org/w3c/dom/Attr.java
@@ -239,7 +239,7 @@ public interface Attr extends Node {
/**
* The Element
node this attribute is attached to or
* null
if this attribute is not in use.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Element getOwnerElement();
@@ -249,7 +249,7 @@ public interface Attr extends Node {
* after loading the document or invoking
* Document.normalizeDocument()
, schemaTypeInfo
* may not be reliable if the node was moved.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public TypeInfo getSchemaTypeInfo();
@@ -297,7 +297,7 @@ public interface Attr extends Node {
* reevaluated in accordance to the schema used. As a consequence, if
* the Attr.schemaTypeInfo
attribute contains an ID type,
* isId
will always return true.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public boolean isId();
diff --git a/jaxp/src/org/w3c/dom/DOMConfiguration.java b/jaxp/src/org/w3c/dom/DOMConfiguration.java
index 4a3e66b020c..320ca42b592 100644
--- a/jaxp/src/org/w3c/dom/DOMConfiguration.java
+++ b/jaxp/src/org/w3c/dom/DOMConfiguration.java
@@ -383,7 +383,7 @@ package org.w3c.dom;
* set, Document.normalizeDocument()
will invoke the resource
* resolver instead of using Document.documentURI
.
* See also the Document Object Model (DOM) Level 3 Core Specification.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public interface DOMConfiguration {
/**
diff --git a/jaxp/src/org/w3c/dom/DOMError.java b/jaxp/src/org/w3c/dom/DOMError.java
index 15821c865d4..c0a00cd5c3c 100644
--- a/jaxp/src/org/w3c/dom/DOMError.java
+++ b/jaxp/src/org/w3c/dom/DOMError.java
@@ -44,7 +44,7 @@ package org.w3c.dom;
/**
* DOMError
is an interface that describes an error.
*
See also the Document Object Model (DOM) Level 3 Core Specification.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public interface DOMError {
// ErrorSeverity
diff --git a/jaxp/src/org/w3c/dom/DOMErrorHandler.java b/jaxp/src/org/w3c/dom/DOMErrorHandler.java
index 1de0cb9387e..82e9988deff 100644
--- a/jaxp/src/org/w3c/dom/DOMErrorHandler.java
+++ b/jaxp/src/org/w3c/dom/DOMErrorHandler.java
@@ -53,7 +53,7 @@ package org.w3c.dom;
*
The application that is using the DOM implementation is expected to
* implement this interface.
*
See also the Document Object Model (DOM) Level 3 Core Specification.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public interface DOMErrorHandler {
/**
diff --git a/jaxp/src/org/w3c/dom/DOMException.java b/jaxp/src/org/w3c/dom/DOMException.java
index b351b7b7362..679c6a7c363 100644
--- a/jaxp/src/org/w3c/dom/DOMException.java
+++ b/jaxp/src/org/w3c/dom/DOMException.java
@@ -116,29 +116,29 @@ public class DOMException extends RuntimeException {
/**
* If an attempt is made to use an object that is not, or is no longer,
* usable.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public static final short INVALID_STATE_ERR = 11;
/**
* If an invalid or illegal string is specified.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public static final short SYNTAX_ERR = 12;
/**
* If an attempt is made to modify the type of the underlying object.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public static final short INVALID_MODIFICATION_ERR = 13;
/**
* If an attempt is made to create or change an object in a way which is
* incorrect with regard to namespaces.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public static final short NAMESPACE_ERR = 14;
/**
* If a parameter or an operation is not supported by the underlying
* object.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public static final short INVALID_ACCESS_ERR = 15;
/**
@@ -147,13 +147,13 @@ public class DOMException extends RuntimeException {
* with respect to "partial validity", this exception would be raised
* and the operation would not be done. This code is used in [DOM Level 3 Validation]
* . Refer to this specification for further information.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public static final short VALIDATION_ERR = 16;
/**
* If the type of an object is incompatible with the expected type of the
* parameter associated to the object.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public static final short TYPE_MISMATCH_ERR = 17;
diff --git a/jaxp/src/org/w3c/dom/DOMImplementation.java b/jaxp/src/org/w3c/dom/DOMImplementation.java
index acf79fe9313..2bcd5f7d39c 100644
--- a/jaxp/src/org/w3c/dom/DOMImplementation.java
+++ b/jaxp/src/org/w3c/dom/DOMImplementation.java
@@ -77,7 +77,7 @@ public interface DOMImplementation {
*
NOT_SUPPORTED_ERR: May be raised if the implementation does not
* support the feature "XML" and the language exposed through the
* Document does not support XML Namespaces (such as [HTML 4.01]).
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public DocumentType createDocumentType(String qualifiedName,
String publicId,
@@ -129,7 +129,7 @@ public interface DOMImplementation {
*
NOT_SUPPORTED_ERR: May be raised if the implementation does not
* support the feature "XML" and the language exposed through the
* Document does not support XML Namespaces (such as [HTML 4.01]).
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Document createDocument(String namespaceURI,
String qualifiedName,
@@ -157,7 +157,7 @@ public interface DOMImplementation {
* return results inconsistent with the primary core
* DOMImplementation
such as hasFeature
,
* getFeature
, etc.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public Object getFeature(String feature,
String version);
diff --git a/jaxp/src/org/w3c/dom/DOMImplementationList.java b/jaxp/src/org/w3c/dom/DOMImplementationList.java
index d7712f2e3f0..1fb2caa9b7d 100644
--- a/jaxp/src/org/w3c/dom/DOMImplementationList.java
+++ b/jaxp/src/org/w3c/dom/DOMImplementationList.java
@@ -48,7 +48,7 @@ package org.w3c.dom;
* DOMImplementationList
are accessible via an integral index,
* starting from 0.
*
See also the Document Object Model (DOM) Level 3 Core Specification.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public interface DOMImplementationList {
/**
diff --git a/jaxp/src/org/w3c/dom/DOMImplementationSource.java b/jaxp/src/org/w3c/dom/DOMImplementationSource.java
index 41aa1ab01b0..317c4ba6600 100644
--- a/jaxp/src/org/w3c/dom/DOMImplementationSource.java
+++ b/jaxp/src/org/w3c/dom/DOMImplementationSource.java
@@ -49,7 +49,7 @@ package org.w3c.dom;
* listed in the binding-specific list of available sources so that its
* DOMImplementation
objects are made available.
*
See also the Document Object Model (DOM) Level 3 Core Specification.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public interface DOMImplementationSource {
/**
diff --git a/jaxp/src/org/w3c/dom/DOMLocator.java b/jaxp/src/org/w3c/dom/DOMLocator.java
index 9104976a56a..ece7db191b0 100644
--- a/jaxp/src/org/w3c/dom/DOMLocator.java
+++ b/jaxp/src/org/w3c/dom/DOMLocator.java
@@ -45,7 +45,7 @@ package org.w3c.dom;
* DOMLocator
is an interface that describes a location (e.g.
* where an error occurred).
*
See also the Document Object Model (DOM) Level 3 Core Specification.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public interface DOMLocator {
/**
diff --git a/jaxp/src/org/w3c/dom/DOMStringList.java b/jaxp/src/org/w3c/dom/DOMStringList.java
index 670bdd0e04e..50d045b9d81 100644
--- a/jaxp/src/org/w3c/dom/DOMStringList.java
+++ b/jaxp/src/org/w3c/dom/DOMStringList.java
@@ -48,7 +48,7 @@ package org.w3c.dom;
* DOMStringList
are accessible via an integral index, starting
* from 0.
*
See also the Document Object Model (DOM) Level 3 Core Specification.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public interface DOMStringList {
/**
diff --git a/jaxp/src/org/w3c/dom/Document.java b/jaxp/src/org/w3c/dom/Document.java
index 5e489ac98c4..ab2d6e4f17e 100644
--- a/jaxp/src/org/w3c/dom/Document.java
+++ b/jaxp/src/org/w3c/dom/Document.java
@@ -73,7 +73,7 @@ public interface Document extends Node {
* changing it afterwards is very unlikely to result in a change of the
* features supported.
*
- * @since DOM Level 3
+ * @since 1.4, DOM Level 3
*/
public DocumentType getDoctype();
@@ -337,7 +337,7 @@ public interface Document extends Node {
* Document.xmlVersion
attribute. This may happen when
* importing an XML 1.1 [XML 1.1] element
* into an XML 1.0 document, for instance.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Node importNode(Node importedNode,
boolean deep)
@@ -401,7 +401,7 @@ public interface Document extends Node {
*
NOT_SUPPORTED_ERR: Always thrown if the current document does not
* support the "XML"
feature, since namespaces were
* defined by XML.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Element createElementNS(String namespaceURI,
String qualifiedName)
@@ -470,7 +470,7 @@ public interface Document extends Node {
*
NOT_SUPPORTED_ERR: Always thrown if the current document does not
* support the "XML"
feature, since namespaces were
* defined by XML.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Attr createAttributeNS(String namespaceURI,
String qualifiedName)
@@ -485,7 +485,7 @@ public interface Document extends Node {
* special value "*" matches all local names.
* @return A new NodeList
object containing all the matched
* Elements
.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public NodeList getElementsByTagNameNS(String namespaceURI,
String localName);
@@ -501,7 +501,7 @@ public interface Document extends Node {
* ID unless so defined.
* @param elementId The unique id
value for an element.
* @return The matching element or null
if there is none.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Element getElementById(String elementId);
@@ -509,7 +509,7 @@ public interface Document extends Node {
* An attribute specifying the encoding used for this document at the time
* of the parsing. This is null
when it is not known, such
* as when the Document
was created in memory.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public String getInputEncoding();
@@ -517,7 +517,7 @@ public interface Document extends Node {
* An attribute specifying, as part of the XML declaration, the encoding of this document. This is null
when
* unspecified or when it is not known, such as when the
* Document
was created in memory.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public String getXmlEncoding();
@@ -529,7 +529,7 @@ public interface Document extends Node {
* Document.normalizeDocument()
with the "validate"
* parameter to verify if the value matches the validity
* constraint for standalone document declaration as defined in [XML 1.0].
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public boolean getXmlStandalone();
/**
@@ -543,7 +543,7 @@ public interface Document extends Node {
* @exception DOMException
* NOT_SUPPORTED_ERR: Raised if this document does not support the
* "XML" feature.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public void setXmlStandalone(boolean xmlStandalone)
throws DOMException;
@@ -570,7 +570,7 @@ public interface Document extends Node {
* objects supporting a version of the "XMLVersion" feature must not
* raise a NOT_SUPPORTED_ERR
exception for the same version
* number when using Document.xmlVersion
.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public String getXmlVersion();
/**
@@ -599,7 +599,7 @@ public interface Document extends Node {
* NOT_SUPPORTED_ERR: Raised if the version is set to a value that is
* not supported by this Document
or if this document
* does not support the "XML" feature.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public void setXmlVersion(String xmlVersion)
throws DOMException;
@@ -612,7 +612,7 @@ public interface Document extends Node {
* errors while using Document.normalizeDocument()
. In case
* of error, the behavior is undefined. This attribute is
* true
by default.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public boolean getStrictErrorChecking();
/**
@@ -623,7 +623,7 @@ public interface Document extends Node {
* errors while using Document.normalizeDocument()
. In case
* of error, the behavior is undefined. This attribute is
* true
by default.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public void setStrictErrorChecking(boolean strictErrorChecking);
@@ -638,7 +638,7 @@ public interface Document extends Node {
* "HTML" [DOM Level 2 HTML]
* , the href attribute of the HTML BASE element takes precedence over
* this attribute when computing Node.baseURI
.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public String getDocumentURI();
/**
@@ -652,7 +652,7 @@ public interface Document extends Node {
* "HTML" [DOM Level 2 HTML]
* , the href attribute of the HTML BASE element takes precedence over
* this attribute when computing Node.baseURI
.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public void setDocumentURI(String documentURI);
@@ -723,7 +723,7 @@ public interface Document extends Node {
* DOCUMENT
, DOCUMENT_TYPE
.
*
NO_MODIFICATION_ALLOWED_ERR: Raised when the source node is
* readonly.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public Node adoptNode(Node source)
throws DOMException;
@@ -731,7 +731,7 @@ public interface Document extends Node {
/**
* The configuration used when Document.normalizeDocument()
* is invoked.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public DOMConfiguration getDomConfig();
@@ -765,7 +765,7 @@ public interface Document extends Node {
* " parameter. Note this method might also report fatal errors (
* DOMError.SEVERITY_FATAL_ERROR
) if an implementation
* cannot recover from an error.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public void normalizeDocument();
@@ -834,7 +834,7 @@ public interface Document extends Node {
* . Also raised, when the node being renamed is an attribute, if the
* qualifiedName
, or its prefix, is "xmlns" and the
* namespaceURI
is different from "http://www.w3.org/2000/xmlns/".
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public Node renameNode(Node n,
String namespaceURI,
diff --git a/jaxp/src/org/w3c/dom/DocumentType.java b/jaxp/src/org/w3c/dom/DocumentType.java
index 3b687e3a1e4..b28bea811b6 100644
--- a/jaxp/src/org/w3c/dom/DocumentType.java
+++ b/jaxp/src/org/w3c/dom/DocumentType.java
@@ -87,14 +87,14 @@ public interface DocumentType extends Node {
/**
* The public identifier of the external subset.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public String getPublicId();
/**
* The system identifier of the external subset. This may be an absolute
* URI or not.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public String getSystemId();
@@ -105,7 +105,7 @@ public interface DocumentType extends Node {
* information is available to the implementation. This may vary
* depending on various parameters, including the XML processor used to
* build the document.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public String getInternalSubset();
diff --git a/jaxp/src/org/w3c/dom/Element.java b/jaxp/src/org/w3c/dom/Element.java
index 195c71f7a95..ab5087d2c52 100644
--- a/jaxp/src/org/w3c/dom/Element.java
+++ b/jaxp/src/org/w3c/dom/Element.java
@@ -203,7 +203,7 @@ public interface Element extends Node {
* NOT_SUPPORTED_ERR: May be raised if the implementation does not
* support the feature "XML"
and the language exposed
* through the Document does not support XML Namespaces (such as [HTML 4.01]).
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public String getAttributeNS(String namespaceURI,
String localName)
@@ -249,7 +249,7 @@ public interface Element extends Node {
*
NOT_SUPPORTED_ERR: May be raised if the implementation does not
* support the feature "XML"
and the language exposed
* through the Document does not support XML Namespaces (such as [HTML 4.01]).
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public void setAttributeNS(String namespaceURI,
String qualifiedName,
@@ -278,7 +278,7 @@ public interface Element extends Node {
*
NOT_SUPPORTED_ERR: May be raised if the implementation does not
* support the feature "XML"
and the language exposed
* through the Document does not support XML Namespaces (such as [HTML 4.01]).
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public void removeAttributeNS(String namespaceURI,
String localName)
@@ -299,7 +299,7 @@ public interface Element extends Node {
* NOT_SUPPORTED_ERR: May be raised if the implementation does not
* support the feature "XML"
and the language exposed
* through the Document does not support XML Namespaces (such as [HTML 4.01]).
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Attr getAttributeNodeNS(String namespaceURI,
String localName)
@@ -329,7 +329,7 @@ public interface Element extends Node {
*
NOT_SUPPORTED_ERR: May be raised if the implementation does not
* support the feature "XML"
and the language exposed
* through the Document does not support XML Namespaces (such as [HTML 4.01]).
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Attr setAttributeNodeNS(Attr newAttr)
throws DOMException;
@@ -348,7 +348,7 @@ public interface Element extends Node {
* NOT_SUPPORTED_ERR: May be raised if the implementation does not
* support the feature "XML"
and the language exposed
* through the Document does not support XML Namespaces (such as [HTML 4.01]).
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public NodeList getElementsByTagNameNS(String namespaceURI,
String localName)
@@ -362,7 +362,7 @@ public interface Element extends Node {
* @return true
if an attribute with the given name is
* specified on this element or has a default value, false
* otherwise.
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public boolean hasAttribute(String name);
@@ -383,7 +383,7 @@ public interface Element extends Node {
* NOT_SUPPORTED_ERR: May be raised if the implementation does not
* support the feature "XML"
and the language exposed
* through the Document does not support XML Namespaces (such as [HTML 4.01]).
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public boolean hasAttributeNS(String namespaceURI,
String localName)
@@ -391,7 +391,7 @@ public interface Element extends Node {
/**
* The type information associated with this element.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public TypeInfo getSchemaTypeInfo();
@@ -413,7 +413,7 @@ public interface Element extends Node {
* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
*
NOT_FOUND_ERR: Raised if the specified node is not an attribute
* of this element.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public void setIdAttribute(String name,
boolean isId)
@@ -436,7 +436,7 @@ public interface Element extends Node {
* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
*
NOT_FOUND_ERR: Raised if the specified node is not an attribute
* of this element.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public void setIdAttributeNS(String namespaceURI,
String localName,
@@ -459,7 +459,7 @@ public interface Element extends Node {
* NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
*
NOT_FOUND_ERR: Raised if the specified node is not an attribute
* of this element.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public void setIdAttributeNode(Attr idAttr,
boolean isId)
diff --git a/jaxp/src/org/w3c/dom/Entity.java b/jaxp/src/org/w3c/dom/Entity.java
index 2242fe1449e..c4e3b8930c7 100644
--- a/jaxp/src/org/w3c/dom/Entity.java
+++ b/jaxp/src/org/w3c/dom/Entity.java
@@ -96,7 +96,7 @@ public interface Entity extends Node {
* of parsing, when it is an external parsed entity. This is
* null
if it an entity from the internal subset or if it
* is not known.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public String getInputEncoding();
@@ -104,7 +104,7 @@ public interface Entity extends Node {
* An attribute specifying, as part of the text declaration, the encoding
* of this entity, when it is an external parsed entity. This is
* null
otherwise.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public String getXmlEncoding();
@@ -112,7 +112,7 @@ public interface Entity extends Node {
* An attribute specifying, as part of the text declaration, the version
* number of this entity, when it is an external parsed entity. This is
* null
otherwise.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public String getXmlVersion();
diff --git a/jaxp/src/org/w3c/dom/NameList.java b/jaxp/src/org/w3c/dom/NameList.java
index 01cfe10c9c0..92ee1814087 100644
--- a/jaxp/src/org/w3c/dom/NameList.java
+++ b/jaxp/src/org/w3c/dom/NameList.java
@@ -48,7 +48,7 @@ package org.w3c.dom;
* implemented. The items in the NameList
are accessible via an
* integral index, starting from 0.
*
See also the Document Object Model (DOM) Level 3 Core Specification.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public interface NameList {
/**
diff --git a/jaxp/src/org/w3c/dom/NamedNodeMap.java b/jaxp/src/org/w3c/dom/NamedNodeMap.java
index 00466c16bda..c9d3084f151 100644
--- a/jaxp/src/org/w3c/dom/NamedNodeMap.java
+++ b/jaxp/src/org/w3c/dom/NamedNodeMap.java
@@ -141,7 +141,7 @@ public interface NamedNodeMap {
* NOT_SUPPORTED_ERR: May be raised if the implementation does not
* support the feature "XML" and the language exposed through the
* Document does not support XML Namespaces (such as [HTML 4.01]).
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Node getNamedItemNS(String namespaceURI,
String localName)
@@ -177,7 +177,7 @@ public interface NamedNodeMap {
*
NOT_SUPPORTED_ERR: May be raised if the implementation does not
* support the feature "XML" and the language exposed through the
* Document does not support XML Namespaces (such as [HTML 4.01]).
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Node setNamedItemNS(Node arg)
throws DOMException;
@@ -203,7 +203,7 @@ public interface NamedNodeMap {
*
NOT_SUPPORTED_ERR: May be raised if the implementation does not
* support the feature "XML" and the language exposed through the
* Document does not support XML Namespaces (such as [HTML 4.01]).
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Node removeNamedItemNS(String namespaceURI,
String localName)
diff --git a/jaxp/src/org/w3c/dom/Node.java b/jaxp/src/org/w3c/dom/Node.java
index 68404b95ebb..a62ad94d91e 100644
--- a/jaxp/src/org/w3c/dom/Node.java
+++ b/jaxp/src/org/w3c/dom/Node.java
@@ -299,7 +299,7 @@ public interface Node {
* which is not used with any Document
yet, this is
* null
.
*
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public Document getOwnerDocument();
@@ -335,7 +335,7 @@ public interface Node {
* support the insertion of a DocumentType
or
* Element
node.
*
- * @since DOM Level 3
+ * @since 1.4, DOM Level 3
*/
public Node insertBefore(Node newChild,
Node refChild)
@@ -373,7 +373,7 @@ public interface Node {
* support the replacement of the DocumentType
child or
* Element
child.
*
- * @since DOM Level 3
+ * @since 1.4, DOM Level 3
*/
public Node replaceChild(Node newChild,
Node oldChild)
@@ -393,7 +393,7 @@ public interface Node {
* support the removal of the DocumentType
child or the
* Element
child.
*
- * @since DOM Level 3
+ * @since 1.4, DOM Level 3
*/
public Node removeChild(Node oldChild)
throws DOMException;
@@ -422,7 +422,7 @@ public interface Node {
* if the DOM implementation doesn't support the removal of the
* DocumentType
child or Element
child.
*
- * @since DOM Level 3
+ * @since 1.4, DOM Level 3
*/
public Node appendChild(Node newChild)
throws DOMException;
@@ -491,7 +491,7 @@ public interface Node {
* sufficient, since XPointers do not differentiate between
* Text
nodes and CDATASection
nodes.
*
- * @since DOM Level 3
+ * @since 1.4, DOM Level 3
*/
public void normalize();
@@ -503,7 +503,7 @@ public interface Node {
* @return Returns true
if the specified feature is
* supported on this node, false
otherwise.
*
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public boolean isSupported(String feature,
String version);
@@ -523,7 +523,7 @@ public interface Node {
* attached to. If an attribute is not explicitly given a namespace, it
* simply has no namespace.
*
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public String getNamespaceURI();
@@ -547,7 +547,7 @@ public interface Node {
* method, such as createElement
from the
* Document
interface, this is always null
.
*
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public String getPrefix();
/**
@@ -584,7 +584,7 @@ public interface Node {
* this node is "xmlns" [XML Namespaces]
* .
*
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public void setPrefix(String prefix)
throws DOMException;
@@ -596,7 +596,7 @@ public interface Node {
* method, such as Document.createElement()
, this is always
* null
.
*
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public String getLocalName();
@@ -605,7 +605,7 @@ public interface Node {
* @return Returns true
if this node has any attributes,
* false
otherwise.
*
- * @since DOM Level 2
+ * @since 1.4, DOM Level 2
*/
public boolean hasAttributes();
@@ -619,7 +619,7 @@ public interface Node {
* documentURI
attribute from the Document
* interface otherwise.
*
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public String getBaseURI();
@@ -666,7 +666,7 @@ public interface Node {
* implementations that do not coordinate to return consistent
* implementation-specific results.
*
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public short compareDocumentPosition(Node other)
throws DOMException;
@@ -717,7 +717,7 @@ public interface Node {
* fit in a DOMString
variable on the implementation
* platform.
*
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public String getTextContent()
throws DOMException;
@@ -765,7 +765,7 @@ public interface Node {
* @exception DOMException
* NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
*
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public void setTextContent(String textContent)
throws DOMException;
@@ -783,7 +783,7 @@ public interface Node {
* @return Returns true
if the nodes are the same,
* false
otherwise.
*
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public boolean isSameNode(Node other);
@@ -798,7 +798,7 @@ public interface Node {
* associated to the namespace prefix, the returned namespace prefix
* is implementation dependent.
*
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public String lookupPrefix(String namespaceURI);
@@ -810,7 +810,7 @@ public interface Node {
* namespaceURI
is the default namespace,
* false
otherwise.
*
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public boolean isDefaultNamespace(String namespaceURI);
@@ -824,7 +824,7 @@ public interface Node {
* @return Returns the associated namespace URI or null
if
* none is found.
*
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public String lookupNamespaceURI(String prefix);
@@ -890,7 +890,7 @@ public interface Node {
* @return Returns true
if the nodes are equal,
* false
otherwise.
*
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public boolean isEqualNode(Node arg);
@@ -915,7 +915,7 @@ public interface Node {
* with the primary core Node
such as attributes,
* childNodes, etc.
*
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public Object getFeature(String feature,
String version);
@@ -932,7 +932,7 @@ public interface Node {
* @return Returns the DOMUserData
previously associated to
* the given key on this node, or null
if there was none.
*
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public Object setUserData(String key,
Object data,
@@ -946,7 +946,7 @@ public interface Node {
* @return Returns the DOMUserData
associated to the given
* key on this node, or null
if there was none.
*
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public Object getUserData(String key);
diff --git a/jaxp/src/org/w3c/dom/Text.java b/jaxp/src/org/w3c/dom/Text.java
index f54d0ee8681..c603dac3ead 100644
--- a/jaxp/src/org/w3c/dom/Text.java
+++ b/jaxp/src/org/w3c/dom/Text.java
@@ -93,7 +93,7 @@ public interface Text extends CharacterData {
* determined to contain whitespace in element content during the load
* of the document or if validation occurs while using
* Document.normalizeDocument()
.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public boolean isElementContentWhitespace();
@@ -121,7 +121,7 @@ public interface Text extends CharacterData {
*
* Figure: barTextNode.wholeText value is "barfoo"
*
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public String getWholeText();
@@ -179,7 +179,7 @@ public interface Text extends CharacterData {
* @exception DOMException
* NO_MODIFICATION_ALLOWED_ERR: Raised if one of the Text
* nodes being replaced is readonly.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public Text replaceWholeText(String content)
throws DOMException;
diff --git a/jaxp/src/org/w3c/dom/TypeInfo.java b/jaxp/src/org/w3c/dom/TypeInfo.java
index 044ede0bccb..a67f1c3e8dc 100644
--- a/jaxp/src/org/w3c/dom/TypeInfo.java
+++ b/jaxp/src/org/w3c/dom/TypeInfo.java
@@ -118,7 +118,7 @@ package org.w3c.dom;
* and therefore should define how to represent their type systems using
* TypeInfo
.
*
See also the Document Object Model (DOM) Level 3 Core Specification.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public interface TypeInfo {
/**
diff --git a/jaxp/src/org/w3c/dom/UserDataHandler.java b/jaxp/src/org/w3c/dom/UserDataHandler.java
index a4ec6e89832..e6595abfc1f 100644
--- a/jaxp/src/org/w3c/dom/UserDataHandler.java
+++ b/jaxp/src/org/w3c/dom/UserDataHandler.java
@@ -49,7 +49,7 @@ package org.w3c.dom;
* implement various behaviors regarding the data it associates to the DOM
* nodes. This interface defines that handler.
*
See also the Document Object Model (DOM) Level 3 Core Specification.
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public interface UserDataHandler {
// OperationType
diff --git a/jaxp/src/org/w3c/dom/bootstrap/DOMImplementationRegistry.java b/jaxp/src/org/w3c/dom/bootstrap/DOMImplementationRegistry.java
index cfeeeea4907..48fda761e1e 100644
--- a/jaxp/src/org/w3c/dom/bootstrap/DOMImplementationRegistry.java
+++ b/jaxp/src/org/w3c/dom/bootstrap/DOMImplementationRegistry.java
@@ -79,7 +79,7 @@ import java.security.PrivilegedAction;
*
* @see DOMImplementation
* @see DOMImplementationSource
- * @since DOM Level 3
+ * @since 1.5, DOM Level 3
*/
public final class DOMImplementationRegistry {
/**
diff --git a/jaxp/src/org/w3c/dom/events/DocumentEvent.java b/jaxp/src/org/w3c/dom/events/DocumentEvent.java
index cdbbb367f43..2a5f62f10fd 100644
--- a/jaxp/src/org/w3c/dom/events/DocumentEvent.java
+++ b/jaxp/src/org/w3c/dom/events/DocumentEvent.java
@@ -50,7 +50,7 @@ import org.w3c.dom.DOMException;
* implemented on the same object which implements the Document
* interface in an implementation which supports the Event model.
*
See also the Document Object Model (DOM) Level 2 Events Specification.
- * @since DOM Level 2
+ * @since 1.5, DOM Level 2
*/
public interface DocumentEvent {
/**
diff --git a/jaxp/src/org/w3c/dom/events/Event.java b/jaxp/src/org/w3c/dom/events/Event.java
index b1351e9b8dd..efa68650104 100644
--- a/jaxp/src/org/w3c/dom/events/Event.java
+++ b/jaxp/src/org/w3c/dom/events/Event.java
@@ -51,7 +51,7 @@ package org.w3c.dom.events;
* type of event they accompany. These derived interfaces are also
* implemented by the object passed to the event listener.
*
See also the Document Object Model (DOM) Level 2 Events Specification.
- * @since DOM Level 2
+ * @since 1.5, DOM Level 2
*/
public interface Event {
// PhaseType
diff --git a/jaxp/src/org/w3c/dom/events/EventException.java b/jaxp/src/org/w3c/dom/events/EventException.java
index 6273f64063a..1d646b4f63c 100644
--- a/jaxp/src/org/w3c/dom/events/EventException.java
+++ b/jaxp/src/org/w3c/dom/events/EventException.java
@@ -45,7 +45,7 @@ package org.w3c.dom.events;
* Event operations may throw an EventException
as specified in
* their method descriptions.
*
See also the Document Object Model (DOM) Level 2 Events Specification.
- * @since DOM Level 2
+ * @since 1.5, DOM Level 2
*/
public class EventException extends RuntimeException {
public EventException(short code, String message) {
diff --git a/jaxp/src/org/w3c/dom/events/EventListener.java b/jaxp/src/org/w3c/dom/events/EventListener.java
index 2adfe58f647..a11dec1ef86 100644
--- a/jaxp/src/org/w3c/dom/events/EventListener.java
+++ b/jaxp/src/org/w3c/dom/events/EventListener.java
@@ -54,7 +54,7 @@ package org.w3c.dom.events;
* the user wishes the same EventListener
s to be added to the
* newly created copy the user must add them manually.
*
See also the Document Object Model (DOM) Level 2 Events Specification.
- * @since DOM Level 2
+ * @since 1.5, DOM Level 2
*/
public interface EventListener {
/**
diff --git a/jaxp/src/org/w3c/dom/events/EventTarget.java b/jaxp/src/org/w3c/dom/events/EventTarget.java
index 46ac1f62266..3fd5aefa458 100644
--- a/jaxp/src/org/w3c/dom/events/EventTarget.java
+++ b/jaxp/src/org/w3c/dom/events/EventTarget.java
@@ -50,7 +50,7 @@ package org.w3c.dom.events;
* EventListeners
on an EventTarget
and dispatch
* of events to that EventTarget
.
*
See also the Document Object Model (DOM) Level 2 Events Specification.
- * @since DOM Level 2
+ * @since 1.5, DOM Level 2
*/
public interface EventTarget {
/**
diff --git a/jaxp/src/org/w3c/dom/events/MouseEvent.java b/jaxp/src/org/w3c/dom/events/MouseEvent.java
index dee4cda5b5c..7a21af99b05 100644
--- a/jaxp/src/org/w3c/dom/events/MouseEvent.java
+++ b/jaxp/src/org/w3c/dom/events/MouseEvent.java
@@ -58,7 +58,7 @@ import org.w3c.dom.views.AbstractView;
* bubbling to obtain notification of mouse events which occur within its
* descendent elements.
*
See also the Document Object Model (DOM) Level 2 Events Specification.
- * @since DOM Level 2
+ * @since 1.5, DOM Level 2
*/
public interface MouseEvent extends UIEvent {
/**
diff --git a/jaxp/src/org/w3c/dom/events/MutationEvent.java b/jaxp/src/org/w3c/dom/events/MutationEvent.java
index a520b6f0a5c..1dc5c815991 100644
--- a/jaxp/src/org/w3c/dom/events/MutationEvent.java
+++ b/jaxp/src/org/w3c/dom/events/MutationEvent.java
@@ -47,7 +47,7 @@ import org.w3c.dom.Node;
* The MutationEvent
interface provides specific contextual
* information associated with Mutation events.
*
See also the Document Object Model (DOM) Level 2 Events Specification.
- * @since DOM Level 2
+ * @since 1.5, DOM Level 2
*/
public interface MutationEvent extends Event {
// attrChangeType
diff --git a/jaxp/src/org/w3c/dom/events/UIEvent.java b/jaxp/src/org/w3c/dom/events/UIEvent.java
index 0931c5ff874..01192194ced 100644
--- a/jaxp/src/org/w3c/dom/events/UIEvent.java
+++ b/jaxp/src/org/w3c/dom/events/UIEvent.java
@@ -47,7 +47,7 @@ import org.w3c.dom.views.AbstractView;
* The UIEvent
interface provides specific contextual information
* associated with User Interface events.
*
See also the Document Object Model (DOM) Level 2 Events Specification.
- * @since DOM Level 2
+ * @since 1.5, DOM Level 2
*/
public interface UIEvent extends Event {
/**
diff --git a/jaxp/src/org/w3c/dom/ls/DOMImplementationLS.java b/jaxp/src/org/w3c/dom/ls/DOMImplementationLS.java
index c876dafcd6b..13b863e7536 100644
--- a/jaxp/src/org/w3c/dom/ls/DOMImplementationLS.java
+++ b/jaxp/src/org/w3c/dom/ls/DOMImplementationLS.java
@@ -57,6 +57,8 @@ import org.w3c.dom.DOMException;
* "3.0"
(respectively).
*
See also the Document Object Model (DOM) Level 3 Load
and Save Specification.
+ *
+ * @since 1.5
*/
public interface DOMImplementationLS {
// DOMImplementationLSMode
diff --git a/jaxp/src/org/w3c/dom/ls/LSException.java b/jaxp/src/org/w3c/dom/ls/LSException.java
index f23d38a0a9c..fad53bafc1d 100644
--- a/jaxp/src/org/w3c/dom/ls/LSException.java
+++ b/jaxp/src/org/w3c/dom/ls/LSException.java
@@ -54,6 +54,8 @@ package org.w3c.dom.ls;
* implementation dependent.
*
See also the Document Object Model (DOM) Level 3 Load
and Save Specification.
+ *
+ * @since 1.5
*/
public class LSException extends RuntimeException {
public LSException(short code, String message) {
diff --git a/jaxp/src/org/w3c/dom/ls/LSInput.java b/jaxp/src/org/w3c/dom/ls/LSInput.java
index a9b08c17bf1..f6f69b986cb 100644
--- a/jaxp/src/org/w3c/dom/ls/LSInput.java
+++ b/jaxp/src/org/w3c/dom/ls/LSInput.java
@@ -82,6 +82,8 @@ package org.w3c.dom.ls;
* modify the copies, if necessary).
*
See also the Document Object Model (DOM) Level 3 Load
and Save Specification.
+ *
+ * @since 1.5
*/
public interface LSInput {
/**
diff --git a/jaxp/src/org/w3c/dom/ls/LSLoadEvent.java b/jaxp/src/org/w3c/dom/ls/LSLoadEvent.java
index 5c9b7671e75..a4f938d0c89 100644
--- a/jaxp/src/org/w3c/dom/ls/LSLoadEvent.java
+++ b/jaxp/src/org/w3c/dom/ls/LSLoadEvent.java
@@ -49,6 +49,8 @@ import org.w3c.dom.events.Event;
* of a document load.
*
See also the Document Object Model (DOM) Level 3 Load
and Save Specification.
+ *
+ * @since 1.5
*/
public interface LSLoadEvent extends Event {
/**
diff --git a/jaxp/src/org/w3c/dom/ls/LSOutput.java b/jaxp/src/org/w3c/dom/ls/LSOutput.java
index c6ace48cf3e..b69f8d8f367 100644
--- a/jaxp/src/org/w3c/dom/ls/LSOutput.java
+++ b/jaxp/src/org/w3c/dom/ls/LSOutput.java
@@ -74,6 +74,8 @@ package org.w3c.dom.ls;
* modify the copies, if necessary).
*
See also the Document Object Model (DOM) Level 3 Load
and Save Specification.
+ *
+ * @since 1.5
*/
public interface LSOutput {
/**
diff --git a/jaxp/src/org/w3c/dom/ls/LSParser.java b/jaxp/src/org/w3c/dom/ls/LSParser.java
index 72d7db2f89c..0ddbd49ddfb 100644
--- a/jaxp/src/org/w3c/dom/ls/LSParser.java
+++ b/jaxp/src/org/w3c/dom/ls/LSParser.java
@@ -166,6 +166,8 @@ import org.w3c.dom.DOMException;
* permission denied,...), XML well-formedness errors, and so on.
*
See also the Document Object Model (DOM) Level 3 Load
and Save Specification.
+ *
+ * @since 1.5
*/
public interface LSParser {
/**
diff --git a/jaxp/src/org/w3c/dom/ls/LSParserFilter.java b/jaxp/src/org/w3c/dom/ls/LSParserFilter.java
index 0638c382dd4..96797bbb3cf 100644
--- a/jaxp/src/org/w3c/dom/ls/LSParserFilter.java
+++ b/jaxp/src/org/w3c/dom/ls/LSParserFilter.java
@@ -73,6 +73,8 @@ import org.w3c.dom.Element;
* throwing exceptions from a filter is DOM implementation dependent.
*
See also the Document Object Model (DOM) Level 3 Load
and Save Specification.
+ *
+ * @since 1.5
*/
public interface LSParserFilter {
// Constants returned by startElement and acceptNode
diff --git a/jaxp/src/org/w3c/dom/ls/LSProgressEvent.java b/jaxp/src/org/w3c/dom/ls/LSProgressEvent.java
index 25a76a6a469..6e1b5653ef7 100644
--- a/jaxp/src/org/w3c/dom/ls/LSProgressEvent.java
+++ b/jaxp/src/org/w3c/dom/ls/LSProgressEvent.java
@@ -53,6 +53,8 @@ import org.w3c.dom.events.Event;
* input dependent.
*
See also the Document Object Model (DOM) Level 3 Load
and Save Specification.
+ *
+ * @since 1.5
*/
public interface LSProgressEvent extends Event {
/**
diff --git a/jaxp/src/org/w3c/dom/ls/LSResourceResolver.java b/jaxp/src/org/w3c/dom/ls/LSResourceResolver.java
index bcb57be01e1..2361c2dd5eb 100644
--- a/jaxp/src/org/w3c/dom/ls/LSResourceResolver.java
+++ b/jaxp/src/org/w3c/dom/ls/LSResourceResolver.java
@@ -63,6 +63,8 @@ package org.w3c.dom.ls;
* interface.
*
See also the Document Object Model (DOM) Level 3 Load
and Save Specification.
+ *
+ * @since 1.5
*/
public interface LSResourceResolver {
/**
diff --git a/jaxp/src/org/w3c/dom/ls/LSSerializer.java b/jaxp/src/org/w3c/dom/ls/LSSerializer.java
index 6553f2112eb..05b003a15a7 100644
--- a/jaxp/src/org/w3c/dom/ls/LSSerializer.java
+++ b/jaxp/src/org/w3c/dom/ls/LSSerializer.java
@@ -204,6 +204,8 @@ import org.w3c.dom.DOMException;
* permission denied,...) and so on.
*
See also the Document Object Model (DOM) Level 3 Load
and Save Specification.
+ *
+ * @since 1.5
*/
public interface LSSerializer {
/**
diff --git a/jaxp/src/org/w3c/dom/ls/LSSerializerFilter.java b/jaxp/src/org/w3c/dom/ls/LSSerializerFilter.java
index bc8e7241799..1263473c753 100644
--- a/jaxp/src/org/w3c/dom/ls/LSSerializerFilter.java
+++ b/jaxp/src/org/w3c/dom/ls/LSSerializerFilter.java
@@ -70,6 +70,8 @@ import org.w3c.dom.traversal.NodeFilter;
* document.
*
See also the Document Object Model (DOM) Level 3 Load
and Save Specification.
+ *
+ * @since 1.5
*/
public interface LSSerializerFilter extends NodeFilter {
/**
diff --git a/jaxp/src/org/w3c/dom/package.html b/jaxp/src/org/w3c/dom/package.html
index def37a39016..a95de6c6ea7 100644
--- a/jaxp/src/org/w3c/dom/package.html
+++ b/jaxp/src/org/w3c/dom/package.html
@@ -3,13 +3,11 @@
org.w3c.dom package
-Provides the interfaces for the Document Object Model (DOM) which is a
-component API of the Java API for XML
-Processing. The Document Object Model Level 2 Core API allows programs
-to dynamically access and update the content and structure of documents.
-See the specification
-for more information.
+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.
-@since JDK1.4
+@since 1.4