mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
Merge
This commit is contained in:
commit
bb30bd7e0a
2229 changed files with 104752 additions and 17879 deletions
2
.hgtags
2
.hgtags
|
@ -282,3 +282,5 @@ a137992d750c72f6f944f341aa19b0d0d96afe0c jdk9-b35
|
|||
b409bc51bc23cfd51f2bd04ea919ec83535af9d0 jdk9-b37
|
||||
948cceef81ba4cb34bc233e7cc5952951ff04e88 jdk9-b38
|
||||
4e7c4d692e934cb9023af8201e7c2b510e9c4ee1 jdk9-b39
|
||||
82f4cb44b2d7af2352f48568a64b7b6a5ae960cd jdk9-b40
|
||||
9fffb959eb4197ff806e4ac12244761815b4deee jdk9-b41
|
||||
|
|
|
@ -282,3 +282,5 @@ c173ba994245380fb11ef077d1e59823386840eb jdk9-b35
|
|||
723a67b0c442391447b1d8aad8b249d06d1032e8 jdk9-b37
|
||||
d42c0a90afc3c66ca87543076ec9aafd4b4680de jdk9-b38
|
||||
512dbbeb1730edcebfec873fc3f1455660b32000 jdk9-b39
|
||||
cf136458ee747e151a27aa9ea0c1492ea55ef3e7 jdk9-b40
|
||||
67395f7ca2db3b52e3a62a84888487de5cb9210a jdk9-b41
|
||||
|
|
51
Makefile
51
Makefile
|
@ -33,7 +33,7 @@ default:
|
|||
|
||||
# The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU make.
|
||||
# /usr/ccs/bin/make lacks basically every other flow control mechanism.
|
||||
TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
|
||||
.TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
|
||||
|
||||
# Assume we have GNU make, but check version.
|
||||
ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), )
|
||||
|
@ -46,7 +46,17 @@ ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
|
|||
else
|
||||
makefile_path:=$(lastword $(MAKEFILE_LIST))
|
||||
endif
|
||||
root_dir:=$(dir $(makefile_path))
|
||||
root_dir:=$(patsubst %/,%,$(dir $(makefile_path)))
|
||||
|
||||
ifneq ($(findstring qp,$(MAKEFLAGS)),)
|
||||
# When called with -qp, assume an external part (e.g. bash completion) is trying
|
||||
# to understand our targets.
|
||||
# Duplication of global targets, needed before ParseConfAndSpec in case we have
|
||||
# no configurations.
|
||||
help:
|
||||
# If CONF is not set, look for all available configurations
|
||||
CONF?=
|
||||
endif
|
||||
|
||||
# ... and then we can include our helper functions
|
||||
include $(root_dir)/make/MakeHelpers.gmk
|
||||
|
@ -89,6 +99,7 @@ else
|
|||
# The wrapper target was called so we now have a single configuration. Load the spec file
|
||||
# and call the real Main.gmk.
|
||||
include $(SPEC)
|
||||
include $(SRC_ROOT)/make/common/MakeBase.gmk
|
||||
|
||||
### Clean up from previous run
|
||||
# Remove any build.log from a previous run, if they exist
|
||||
|
@ -143,31 +154,37 @@ help:
|
|||
$(info . make [default] # Compile all modules in langtools, hotspot, jaxp, jaxws,)
|
||||
$(info . # corba and jdk and create a runnable "exploded" image)
|
||||
$(info . make all # Compile everything, all repos, docs and images)
|
||||
$(info . make images # Create complete j2sdk and j2re images)
|
||||
$(info . make images # Create complete jdk and jre images)
|
||||
$(info . make <phase> # Compile the specified phase and everything it depends on)
|
||||
$(info . # (gensrc, java, copy, libs, launchers, gendata, rmic))
|
||||
$(info . make *-only # Applies to most targets and disables compling the)
|
||||
$(info . # dependencies for the target. This is faster but may)
|
||||
$(info . # result in incorrect build results!)
|
||||
$(info . make docs # Create all docs)
|
||||
$(info . make docs-javadoc # Create just javadocs, depends on less than full docs)
|
||||
$(info . make profiles # Create complete j2re compact profile images)
|
||||
$(info . make profiles # Create complete jre compact profile images)
|
||||
$(info . make bootcycle-images # Build images twice, second time with newly built JDK)
|
||||
$(info . make install # Install the generated images locally)
|
||||
$(info . make reconfigure # Rerun configure with the same arguments as last time)
|
||||
$(info . make clean # Remove all files generated by make, but not those)
|
||||
$(info . # generated by configure)
|
||||
$(info . make dist-clean # Remove all files, including configuration)
|
||||
$(info . make help # Give some help on using make)
|
||||
$(info . make test # Run tests, default is all tests (see TEST below))
|
||||
$(info )
|
||||
$(info Targets for cleaning)
|
||||
$(info . make clean # Remove all files generated by make, but not those)
|
||||
$(info . # generated by configure)
|
||||
$(info . make dist-clean # Remove all files, including configuration)
|
||||
$(info . make clean-<outputdir> # Remove the subdir in the output dir with the name)
|
||||
$(info . make clean-<phase> # Remove all build results related to a certain build)
|
||||
$(info . # phase (gensrc, java, libs, launchers))
|
||||
$(info . make clean-<module> # Remove all build results related to a certain module)
|
||||
$(info . make clean-<module>-<phase> # Remove all build results related to a certain)
|
||||
$(info . # module and phase)
|
||||
$(info )
|
||||
$(info Targets for specific modules)
|
||||
$(info . make <module> # Build <module> and everything it depends on. )
|
||||
$(info . make <module>-only # Build <module> only, without dependencies. This)
|
||||
$(info . # is faster but can result in incorrect build results!)
|
||||
$(info . make <module>-java # Compile java classes for <module> and everything it)
|
||||
$(info . # depends on)
|
||||
$(info . make <module>-libs # Build native libraries for <module> and everything it)
|
||||
$(info . # depends on)
|
||||
$(info . make <module>-launchers# Build native executables for <module> and everything it)
|
||||
$(info . # depends on)
|
||||
$(info . make <module>-gensrc # Execute the gensrc step for <module> and everything it)
|
||||
$(info . # depends on)
|
||||
$(info . make <module>-<phase> # Compile the specified phase for the specified module)
|
||||
$(info . # and everything it depends on)
|
||||
$(info . # (gensrc, java, copy, libs, launchers, gendata, rmic))
|
||||
$(info )
|
||||
$(info Useful make variables)
|
||||
$(info . make CONF= # Build all configurations (note, assignment is empty))
|
||||
|
|
|
@ -69,7 +69,7 @@ AC_DEFUN([BASIC_PREPEND_TO_PATH],
|
|||
|
||||
# This will make sure the given variable points to a full and proper
|
||||
# path. This means:
|
||||
# 1) There will be no spaces in the path. On posix platforms,
|
||||
# 1) There will be no spaces in the path. On unix platforms,
|
||||
# spaces in the path will result in an error. On Windows,
|
||||
# the path will be rewritten using short-style to be space-free.
|
||||
# 2) The path will be absolute, and it will be in unix-style (on
|
||||
|
@ -82,7 +82,7 @@ AC_DEFUN([BASIC_FIXUP_PATH],
|
|||
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
|
||||
BASIC_FIXUP_PATH_MSYS($1)
|
||||
else
|
||||
# We're on a posix platform. Hooray! :)
|
||||
# We're on a unix platform. Hooray! :)
|
||||
path="[$]$1"
|
||||
has_space=`$ECHO "$path" | $GREP " "`
|
||||
if test "x$has_space" != x; then
|
||||
|
@ -102,7 +102,7 @@ AC_DEFUN([BASIC_FIXUP_PATH],
|
|||
|
||||
# This will make sure the given variable points to a executable
|
||||
# with a full and proper path. This means:
|
||||
# 1) There will be no spaces in the path. On posix platforms,
|
||||
# 1) There will be no spaces in the path. On unix platforms,
|
||||
# spaces in the path will result in an error. On Windows,
|
||||
# the path will be rewritten using short-style to be space-free.
|
||||
# 2) The path will be absolute, and it will be in unix-style (on
|
||||
|
@ -118,7 +118,7 @@ AC_DEFUN([BASIC_FIXUP_EXECUTABLE],
|
|||
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
|
||||
BASIC_FIXUP_EXECUTABLE_MSYS($1)
|
||||
else
|
||||
# We're on a posix platform. Hooray! :)
|
||||
# We're on a unix platform. Hooray! :)
|
||||
# First separate the path from the arguments. This will split at the first
|
||||
# space.
|
||||
complete="[$]$1"
|
||||
|
|
|
@ -305,20 +305,6 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
|
|||
AC_MSG_ERROR([Cannot continue])
|
||||
fi
|
||||
|
||||
# Setup proper paths for what we found
|
||||
BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar"
|
||||
if test ! -f "$BOOT_RTJAR"; then
|
||||
# On MacOSX it is called classes.jar
|
||||
BOOT_RTJAR="$BOOT_JDK/../Classes/classes.jar"
|
||||
if test -f "$BOOT_RTJAR"; then
|
||||
# Remove the ..
|
||||
BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
|
||||
fi
|
||||
fi
|
||||
BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar"
|
||||
BOOT_JDK="$BOOT_JDK"
|
||||
AC_SUBST(BOOT_RTJAR)
|
||||
AC_SUBST(BOOT_TOOLSJAR)
|
||||
AC_SUBST(BOOT_JDK)
|
||||
|
||||
# Setup tools from the Boot JDK.
|
||||
|
|
|
@ -42,13 +42,12 @@ endif
|
|||
|
||||
# Override specific values to do a boot cycle build
|
||||
|
||||
# Use a different Boot JDK
|
||||
BOOT_JDK := $(JDK_IMAGE_DIR)
|
||||
|
||||
# The bootcycle build has a different output directory
|
||||
BUILD_OUTPUT:=@BUILD_OUTPUT@/bootcycle-build
|
||||
|
||||
# Use a different Boot JDK
|
||||
OLD_BOOT_JDK:=$(BOOT_JDK)
|
||||
BOOT_JDK:=@BUILD_OUTPUT@/images/j2sdk-image
|
||||
BOOT_RTJAR:=$(BOOT_JDK)/jre/lib/rt.jar
|
||||
SJAVAC_SERVER_DIR:=$(subst @BUILD_OUTPUT@,$(BUILD_OUTPUT),$(SJAVAC_SERVER_DIR))
|
||||
|
||||
JAVA_CMD:=$(BOOT_JDK)/bin/java
|
||||
JAVAC_CMD:=$(BOOT_JDK)/bin/javac
|
||||
|
@ -57,4 +56,3 @@ JAR_CMD:=$(BOOT_JDK)/bin/jar
|
|||
NATIVE2ASCII_CMD:=$(BOOT_JDK)/bin/native2ascii
|
||||
JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner
|
||||
SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD)
|
||||
|
||||
|
|
|
@ -46,7 +46,9 @@ FILE="@FILE@"
|
|||
FIND="@FIND@"
|
||||
GREP="@GREP@"
|
||||
JAVAP="@FIXPATH@ @BOOT_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
|
||||
JIMAGE="@FIXPATH@ @BUILD_OUTPUT@/jdk/bin/jimage"
|
||||
LDD="@LDD@"
|
||||
LN="@LN@"
|
||||
MKDIR="@MKDIR@"
|
||||
NAWK="@NAWK@"
|
||||
NM="@GNM@"
|
||||
|
|
|
@ -275,3 +275,4 @@ $CHMOD +x $OUTPUT_ROOT/compare.sh
|
|||
# Finally output some useful information to the user
|
||||
HELP_PRINT_SUMMARY_AND_WARNINGS
|
||||
CUSTOM_SUMMARY_AND_WARNINGS_HOOK
|
||||
HELP_REPEAT_WARNINGS
|
||||
|
|
|
@ -94,9 +94,9 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
|
|||
|
||||
# On Windows, we need to set RC flags.
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
RC_FLAGS="-nologo -l 0x409 -r"
|
||||
RC_FLAGS="-nologo -l0x409"
|
||||
if test "x$VARIANT" = xOPT; then
|
||||
RC_FLAGS="$RC_FLAGS -d NDEBUG"
|
||||
RC_FLAGS="$RC_FLAGS -DNDEBUG"
|
||||
fi
|
||||
|
||||
# The version variables used to create RC_FLAGS may be overridden
|
||||
|
@ -105,13 +105,13 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
|
|||
# The \$ are escaped to the shell, and the $(...) variables
|
||||
# are evaluated by make.
|
||||
RC_FLAGS="$RC_FLAGS \
|
||||
-d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \
|
||||
-d \"JDK_COMPANY=\$(COMPANY_NAME)\" \
|
||||
-d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
|
||||
-d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \
|
||||
-d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
|
||||
-d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \
|
||||
-d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\""
|
||||
-D\"JDK_BUILD_ID=\$(FULL_VERSION)\" \
|
||||
-D\"JDK_COMPANY=\$(COMPANY_NAME)\" \
|
||||
-D\"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
|
||||
-D\"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \
|
||||
-D\"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
|
||||
-D\"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \
|
||||
-D\"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\""
|
||||
fi
|
||||
AC_SUBST(RC_FLAGS)
|
||||
|
||||
|
@ -348,10 +348,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
|
|||
# Add runtime stack smashing and undefined behavior checks
|
||||
CFLAGS_DEBUG_OPTIONS="-fstack-protector-all --param ssp-buffer-size=1"
|
||||
CXXFLAGS_DEBUG_OPTIONS="-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_BEHAVIsOR_FLAG"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
@ -668,7 +664,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
|
|||
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
|
||||
-I${JDK_TOPDIR}/src/java.base/share/native/include \
|
||||
-I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS/native/include \
|
||||
-I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_API_DIR/native/include"
|
||||
-I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/include"
|
||||
|
||||
# The shared libraries are compiled using the picflag.
|
||||
CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
|
||||
|
@ -746,25 +742,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
|
|||
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}"
|
||||
|
@ -784,24 +761,24 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
|
|||
LDFLAGS_JDKLIB="${LDFLAGS_JDK}"
|
||||
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${JDK_OUTPUTDIR}/lib"
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
|
||||
LDFLAGS_JDKLIB_SUFFIX=""
|
||||
else
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS} \
|
||||
-L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
|
||||
-L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}"
|
||||
|
||||
# On some platforms (mac) the linker warns about non existing -L dirs.
|
||||
# Add server first if available. Linking aginst client does not always produce the same results.
|
||||
# Only add client dir if client is being built. Add minimal (note not minimal1) if only building minimal1.
|
||||
# Default to server for other variants.
|
||||
if test "x$JVM_VARIANT_SERVER" = xtrue; then
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/server"
|
||||
elif test "x$JVM_VARIANT_CLIENT" = xtrue; then
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client"
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/client"
|
||||
elif test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
|
||||
else
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/server"
|
||||
fi
|
||||
|
||||
LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm"
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -178,15 +178,15 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
|
|||
printf "====================================================\n"
|
||||
if test "x$no_create" != "xyes"; then
|
||||
if test "x$IS_RECONFIGURE" != "xyes"; then
|
||||
printf "A new configuration has been successfully created in\n %s\n" "$OUTPUT_ROOT"
|
||||
printf "A new configuration has been successfully created in\n%s\n" "$OUTPUT_ROOT"
|
||||
else
|
||||
printf "The existing configuration has been successfully updated in\n %s\n" "$OUTPUT_ROOT"
|
||||
printf "The existing configuration has been successfully updated in\n%s\n" "$OUTPUT_ROOT"
|
||||
fi
|
||||
else
|
||||
if test "x$IS_RECONFIGURE" != "xyes"; then
|
||||
printf "A configuration has been successfully checked but not created\n"
|
||||
else
|
||||
printf "The existing configuration has been successfully checked in\n %s\n" "$OUTPUT_ROOT"
|
||||
printf "The existing configuration has been successfully checked in\n%s\n" "$OUTPUT_ROOT"
|
||||
fi
|
||||
fi
|
||||
if test "x$CONFIGURE_COMMAND_LINE" != x; then
|
||||
|
@ -257,3 +257,17 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
|
|||
printf "\n"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS],
|
||||
[
|
||||
if test -e "$OUTPUT_ROOT/config.log"; then
|
||||
$GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" > /dev/null 2>&1
|
||||
if test $? -eq 0; then
|
||||
printf "The following warnings were produced. Repeated here for convenience:\n"
|
||||
# We must quote sed expression (using []) to stop m4 from eating the [].
|
||||
$GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ]
|
||||
printf "\n"
|
||||
fi
|
||||
fi
|
||||
|
||||
])
|
||||
|
|
|
@ -549,7 +549,15 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
|
|||
AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
|
||||
AC_SUBST(MACOSX_BUNDLE_ID_BASE)
|
||||
|
||||
AC_ARG_WITH(copyright-year, [AS_HELP_STRING([--with-copyright-year],
|
||||
[Set copyright year value for build @<:@current year@:>@])])
|
||||
if test "x$with_copyright_year" = xyes; then
|
||||
AC_MSG_ERROR([Copyright year must have a value])
|
||||
elif test "x$with_copyright_year" != x; then
|
||||
COPYRIGHT_YEAR="$with_copyright_year"
|
||||
else
|
||||
COPYRIGHT_YEAR=`date +'%Y'`
|
||||
fi
|
||||
AC_SUBST(COPYRIGHT_YEAR)
|
||||
|
||||
if test "x$JDK_UPDATE_VERSION" != x; then
|
||||
|
|
|
@ -98,44 +98,37 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
|
|||
|
||||
# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
|
||||
# Converts autoconf style OS name to OpenJDK style, into
|
||||
# VAR_OS and VAR_OS_API.
|
||||
# VAR_OS, VAR_OS_TYPE and VAR_OS_ENV.
|
||||
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS],
|
||||
[
|
||||
case "$1" in
|
||||
*linux*)
|
||||
VAR_OS=linux
|
||||
VAR_OS_API=posix
|
||||
VAR_OS_ENV=linux
|
||||
VAR_OS_TYPE=unix
|
||||
;;
|
||||
*solaris*)
|
||||
VAR_OS=solaris
|
||||
VAR_OS_API=posix
|
||||
VAR_OS_ENV=solaris
|
||||
VAR_OS_TYPE=unix
|
||||
;;
|
||||
*darwin*)
|
||||
VAR_OS=macosx
|
||||
VAR_OS_API=posix
|
||||
VAR_OS_ENV=macosx
|
||||
VAR_OS_TYPE=unix
|
||||
;;
|
||||
*bsd*)
|
||||
VAR_OS=bsd
|
||||
VAR_OS_API=posix
|
||||
VAR_OS_ENV=bsd
|
||||
VAR_OS_TYPE=unix
|
||||
;;
|
||||
*cygwin*)
|
||||
VAR_OS=windows
|
||||
VAR_OS_API=winapi
|
||||
VAR_OS_ENV=windows.cygwin
|
||||
;;
|
||||
*mingw*)
|
||||
VAR_OS=windows
|
||||
VAR_OS_API=winapi
|
||||
VAR_OS_ENV=windows.msys
|
||||
;;
|
||||
*aix*)
|
||||
VAR_OS=aix
|
||||
VAR_OS_API=posix
|
||||
VAR_OS_ENV=aix
|
||||
VAR_OS_TYPE=unix
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([unsupported operating system $1])
|
||||
|
@ -165,14 +158,22 @@ AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
|
|||
PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu)
|
||||
# ..and setup our own variables. (Do this explicitely to facilitate searching)
|
||||
OPENJDK_BUILD_OS="$VAR_OS"
|
||||
OPENJDK_BUILD_OS_API="$VAR_OS_API"
|
||||
if test "x$VAR_OS_TYPE" != x; then
|
||||
OPENJDK_BUILD_OS_TYPE="$VAR_OS_TYPE"
|
||||
else
|
||||
OPENJDK_BUILD_OS_TYPE="$VAR_OS"
|
||||
fi
|
||||
if test "x$VAR_OS_ENV" != x; then
|
||||
OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV"
|
||||
else
|
||||
OPENJDK_BUILD_OS_ENV="$VAR_OS"
|
||||
fi
|
||||
OPENJDK_BUILD_CPU="$VAR_CPU"
|
||||
OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH"
|
||||
OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS"
|
||||
OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN"
|
||||
AC_SUBST(OPENJDK_BUILD_OS)
|
||||
AC_SUBST(OPENJDK_BUILD_OS_API)
|
||||
AC_SUBST(OPENJDK_BUILD_OS_TYPE)
|
||||
AC_SUBST(OPENJDK_BUILD_OS_ENV)
|
||||
AC_SUBST(OPENJDK_BUILD_CPU)
|
||||
AC_SUBST(OPENJDK_BUILD_CPU_ARCH)
|
||||
|
@ -187,14 +188,22 @@ AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
|
|||
PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu)
|
||||
# ... and setup our own variables. (Do this explicitely to facilitate searching)
|
||||
OPENJDK_TARGET_OS="$VAR_OS"
|
||||
OPENJDK_TARGET_OS_API="$VAR_OS_API"
|
||||
if test "x$VAR_OS_TYPE" != x; then
|
||||
OPENJDK_TARGET_OS_TYPE="$VAR_OS_TYPE"
|
||||
else
|
||||
OPENJDK_TARGET_OS_TYPE="$VAR_OS"
|
||||
fi
|
||||
if test "x$VAR_OS_ENV" != x; then
|
||||
OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV"
|
||||
else
|
||||
OPENJDK_TARGET_OS_ENV="$VAR_OS"
|
||||
fi
|
||||
OPENJDK_TARGET_CPU="$VAR_CPU"
|
||||
OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH"
|
||||
OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS"
|
||||
OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN"
|
||||
AC_SUBST(OPENJDK_TARGET_OS)
|
||||
AC_SUBST(OPENJDK_TARGET_OS_API)
|
||||
AC_SUBST(OPENJDK_TARGET_OS_TYPE)
|
||||
AC_SUBST(OPENJDK_TARGET_OS_ENV)
|
||||
AC_SUBST(OPENJDK_TARGET_CPU)
|
||||
AC_SUBST(OPENJDK_TARGET_CPU_ARCH)
|
||||
|
@ -331,19 +340,10 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
|
|||
fi
|
||||
AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS)
|
||||
|
||||
# Setup OPENJDK_TARGET_OS_API_DIR, used in source paths.
|
||||
if test "x$OPENJDK_TARGET_OS_API" = xposix; then
|
||||
OPENJDK_TARGET_OS_API_DIR="unix"
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then
|
||||
OPENJDK_TARGET_OS_API_DIR="windows"
|
||||
fi
|
||||
AC_SUBST(OPENJDK_TARGET_OS_API_DIR)
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
OPENJDK_TARGET_OS_EXPORT_DIR=macosx
|
||||
else
|
||||
OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_API_DIR}
|
||||
OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_TYPE}
|
||||
fi
|
||||
AC_SUBST(OPENJDK_TARGET_OS_EXPORT_DIR)
|
||||
|
||||
|
@ -472,8 +472,8 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS],
|
|||
# And -q on AIX because otherwise the compiler produces 32-bit objects by default
|
||||
PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS
|
||||
elif test "x$COMPILE_TYPE" = xreduced; then
|
||||
if test "x$OPENJDK_TARGET_OS" != xwindows; then
|
||||
# Specify -m if running reduced on other Posix platforms
|
||||
if test "x$OPENJDK_TARGET_OS_TYPE" = xunix; then
|
||||
# Specify -m if running reduced on unix platforms
|
||||
PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
X:=
|
||||
SPACE:=$(X) $(X)
|
||||
COMMA:=,
|
||||
DOLLAR:=$$
|
||||
HASH:=\#
|
||||
LEFT_PAREN:=(
|
||||
RIGHT_PAREN:=)
|
||||
|
@ -82,7 +83,7 @@ CONF_NAME:=@CONF_NAME@
|
|||
|
||||
# The built jdk will run in this target system.
|
||||
OPENJDK_TARGET_OS:=@OPENJDK_TARGET_OS@
|
||||
OPENJDK_TARGET_OS_API:=@OPENJDK_TARGET_OS_API@
|
||||
OPENJDK_TARGET_OS_TYPE:=@OPENJDK_TARGET_OS_TYPE@
|
||||
OPENJDK_TARGET_OS_ENV:=@OPENJDK_TARGET_OS_ENV@
|
||||
|
||||
OPENJDK_TARGET_CPU:=@OPENJDK_TARGET_CPU@
|
||||
|
@ -99,13 +100,12 @@ OPENJDK_TARGET_CPU_LEGACY:=@OPENJDK_TARGET_CPU_LEGACY@
|
|||
OPENJDK_TARGET_CPU_LEGACY_LIB:=@OPENJDK_TARGET_CPU_LEGACY_LIB@
|
||||
OPENJDK_TARGET_CPU_OSARCH:=@OPENJDK_TARGET_CPU_OSARCH@
|
||||
OPENJDK_TARGET_CPU_JLI_CFLAGS:=@OPENJDK_TARGET_CPU_JLI_CFLAGS@
|
||||
OPENJDK_TARGET_OS_API_DIR:=@OPENJDK_TARGET_OS_API_DIR@
|
||||
OPENJDK_TARGET_OS_EXPORT_DIR:=@OPENJDK_TARGET_OS_EXPORT_DIR@
|
||||
|
||||
# We are building on this build system.
|
||||
# When not cross-compiling, it is the same as the target.
|
||||
OPENJDK_BUILD_OS:=@OPENJDK_BUILD_OS@
|
||||
OPENJDK_BUILD_OS_API:=@OPENJDK_BUILD_OS_API@
|
||||
OPENJDK_BUILD_OS_TYPE:=@OPENJDK_BUILD_OS_TYPE@
|
||||
OPENJDK_BUILD_OS_ENV:=@OPENJDK_BUILD_OS_ENV@
|
||||
|
||||
OPENJDK_BUILD_CPU:=@OPENJDK_BUILD_CPU@
|
||||
|
@ -236,31 +236,23 @@ BUILD_VARIANT_RELEASE:=@BUILD_VARIANT_RELEASE@
|
|||
|
||||
BUILD_OUTPUT:=@BUILD_OUTPUT@
|
||||
# Colon left out to be able to override IMAGES_OUTPUTDIR for bootcycle-images
|
||||
LANGTOOLS_OUTPUTDIR=$(BUILD_OUTPUT)/langtools
|
||||
CORBA_OUTPUTDIR=$(BUILD_OUTPUT)/corba
|
||||
JAXP_OUTPUTDIR=$(BUILD_OUTPUT)/jaxp
|
||||
JAXWS_OUTPUTDIR=$(BUILD_OUTPUT)/jaxws
|
||||
SUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/support
|
||||
BUILDTOOLS_OUTPUTDIR=$(BUILD_OUTPUT)/buildtools
|
||||
MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/makesupport
|
||||
|
||||
HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot
|
||||
JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk
|
||||
NASHORN_OUTPUTDIR=$(BUILD_OUTPUT)/nashorn
|
||||
IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
|
||||
TESTMAKE_OUTPUTDIR=$(BUILD_OUTPUT)/testmake
|
||||
MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/make-support
|
||||
|
||||
LANGTOOLS_DIST=$(LANGTOOLS_OUTPUTDIR)/dist
|
||||
CORBA_DIST=$(CORBA_OUTPUTDIR)/dist
|
||||
JAXP_DIST=$(JAXP_OUTPUTDIR)/dist
|
||||
JAXWS_DIST=$(JAXWS_OUTPUTDIR)/dist
|
||||
HOTSPOT_DIST=@HOTSPOT_DIST@
|
||||
NASHORN_DIST=$(NASHORN_OUTPUTDIR)/dist
|
||||
|
||||
BUILD_HOTSPOT=@BUILD_HOTSPOT@
|
||||
|
||||
# The boot jdk to use. These are overridden in bootcycle-spec.gmk. Make sure to keep
|
||||
# them in sync.
|
||||
# The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
|
||||
# it in sync.
|
||||
BOOT_JDK:=@BOOT_JDK@
|
||||
BOOT_RTJAR:=@BOOT_RTJAR@
|
||||
BOOT_TOOLSJAR=$(BOOT_JDK)/lib/tools.jar
|
||||
|
||||
# When compiling Java source to be run by the boot jdk
|
||||
# use these extra flags, eg -source 6 -target 6
|
||||
|
@ -351,7 +343,7 @@ OBJC:=@CCACHE@ @OBJC@
|
|||
CPP:=@FIXPATH@ @CPP@
|
||||
#CPPFLAGS:=@CPPFLAGS@
|
||||
|
||||
# The linker can be gcc or ld on posix systems, or link.exe on windows systems.
|
||||
# The linker can be gcc or ld on unix systems, or link.exe on windows systems.
|
||||
LD:=@FIXPATH@ @LD@
|
||||
|
||||
# Xcode SDK path
|
||||
|
@ -392,7 +384,7 @@ BUILD_LD:=@FIXPATH@ @BUILD_LD@
|
|||
|
||||
AS:=@FIXPATH@ @AS@
|
||||
|
||||
# AR is used to create a static library (is ar in posix, lib.exe in windows)
|
||||
# AR is used to create a static library (is ar in unix, lib.exe in windows)
|
||||
AR:=@FIXPATH@ @AR@
|
||||
ARFLAGS:=@ARFLAGS@
|
||||
|
||||
|
@ -484,13 +476,14 @@ SJAVAC_SERVER_JAVA=@FIXPATH@ $(SJAVAC_SERVER_JAVA_CMD) $(SJAVAC_SERVER_JAVA_FLAG
|
|||
JAVAC_FLAGS?=@JAVAC_FLAGS@
|
||||
|
||||
# You run the new javac using the boot jdk with $(BOOT_JDK)/bin/java $(NEW_JAVAC) ...
|
||||
INTERIM_LANGTOOLS_JAR := $(LANGTOOLS_OUTPUTDIR)/dist/interim_langtools.jar
|
||||
INTERIM_LANGTOOLS_ARGS := "-Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR)" -cp $(INTERIM_LANGTOOLS_JAR)
|
||||
# Use = assignment to be able to override in bootcycle-spec.gmk
|
||||
INTERIM_LANGTOOLS_JAR = $(BUILDTOOLS_OUTPUTDIR)/interim_langtools.jar
|
||||
INTERIM_LANGTOOLS_ARGS = "-Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR)" -cp $(INTERIM_LANGTOOLS_JAR)
|
||||
NEW_JAVAC = $(INTERIM_LANGTOOLS_ARGS) com.sun.tools.javac.Main
|
||||
NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) com.sun.tools.javadoc.Main
|
||||
|
||||
# The interim corba jar is needed for running rmic
|
||||
INTERIM_CORBA_JAR := $(CORBA_OUTPUTDIR)/dist/interim_corba.jar
|
||||
INTERIM_CORBA_JAR = $(BUILDTOOLS_OUTPUTDIR)/interim_corba.jar
|
||||
|
||||
# Base flags for RC
|
||||
# Guarding this against resetting value. Legacy make files include spec multiple
|
||||
|
@ -569,10 +562,10 @@ FIXPATH:=@FIXPATH@
|
|||
# Where the build output is stored for your convenience.
|
||||
BUILD_LOG:=@BUILD_LOG@
|
||||
BUILD_LOG_PREVIOUS:=@BUILD_LOG_PREVIOUS@
|
||||
# Disable the build log wrapper on sjavac+winapi until
|
||||
# Disable the build log wrapper on sjavac+windows until
|
||||
# we have solved how to prevent the log wrapper to wait
|
||||
# for the background sjavac server process.
|
||||
ifeq (@ENABLE_SJAVAC@X@OPENJDK_BUILD_OS_API@,yesXwinapi)
|
||||
ifeq (@ENABLE_SJAVAC@X@OPENJDK_BUILD_OS@,yesXwindows)
|
||||
BUILD_LOG_WRAPPER:=
|
||||
else
|
||||
BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@
|
||||
|
@ -695,19 +688,15 @@ OS_VERSION_MINOR:=@OS_VERSION_MINOR@
|
|||
OS_VERSION_MICRO:=@OS_VERSION_MICRO@
|
||||
|
||||
# Images directory definitions
|
||||
JDK_IMAGE_SUBDIR:=j2sdk-image
|
||||
JRE_IMAGE_SUBDIR:=j2re-image
|
||||
JDK_OVERLAY_IMAGE_SUBDIR:=j2sdk-overlay-image
|
||||
JRE_OVERLAY_IMAGE_SUBDIR:=j2re-overlay-image
|
||||
JDK_IMAGE_SUBDIR:=jdk
|
||||
JRE_IMAGE_SUBDIR:=jre
|
||||
# Colon left out to be able to override output dir for bootcycle-images
|
||||
JDK_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_IMAGE_SUBDIR)
|
||||
JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_IMAGE_SUBDIR)
|
||||
JDK_OVERLAY_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_OVERLAY_IMAGE_SUBDIR)
|
||||
JRE_OVERLAY_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_OVERLAY_IMAGE_SUBDIR)
|
||||
|
||||
# Macosx bundles directory definitions
|
||||
JDK_BUNDLE_SUBDIR=j2sdk-bundle/jdk$(JDK_VERSION).jdk/Contents
|
||||
JRE_BUNDLE_SUBDIR=j2re-bundle/jre$(JDK_VERSION).jre/Contents
|
||||
JDK_BUNDLE_SUBDIR=jdk-bundle/jdk$(JDK_VERSION).jdk/Contents
|
||||
JRE_BUNDLE_SUBDIR=jre-bundle/jre$(JDK_VERSION).jre/Contents
|
||||
JDK_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_BUNDLE_SUBDIR)
|
||||
JRE_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_BUNDLE_SUBDIR)
|
||||
|
||||
|
|
|
@ -712,12 +712,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
|
|||
[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],
|
||||
|
|
|
@ -103,8 +103,8 @@ diff_text() {
|
|||
-e '[0-9]\{2\}/[0-9]\{2\}/[0-9]\{4\}' \
|
||||
-e thePoint -e aPoint -e setItemsPtr \
|
||||
-e 'lambda\$[a-zA-Z0-9]*\$[0-9]' ${THIS_FILE} > /dev/null; then
|
||||
$JAVAP -c -constants -l -p ${OTHER_FILE} > ${OTHER_FILE}.javap
|
||||
$JAVAP -c -constants -l -p ${THIS_FILE} > ${THIS_FILE}.javap
|
||||
$JAVAP -c -constants -l -p "${OTHER_FILE}" > ${OTHER_FILE}.javap
|
||||
$JAVAP -c -constants -l -p "${THIS_FILE}" > ${THIS_FILE}.javap
|
||||
TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \
|
||||
$GREP '^[<>]' | \
|
||||
$SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \
|
||||
|
@ -298,7 +298,7 @@ compare_general_files() {
|
|||
WORK_DIR=$3
|
||||
|
||||
GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \
|
||||
! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
|
||||
! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" ! -name "*.jimage" \
|
||||
! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \
|
||||
! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \
|
||||
! -name "*.lib" ! -name "*.war" ! -name "JavaControlPanel" \
|
||||
|
@ -395,8 +395,14 @@ compare_zip_file() {
|
|||
$RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR
|
||||
$MKDIR -p $THIS_UNZIPDIR
|
||||
$MKDIR -p $OTHER_UNZIPDIR
|
||||
if [ "$TYPE" = "jimage" ]
|
||||
then
|
||||
(cd $THIS_UNZIPDIR && $JIMAGE extract $THIS_ZIP)
|
||||
(cd $OTHER_UNZIPDIR && $JIMAGE extract $OTHER_ZIP)
|
||||
else
|
||||
(cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
|
||||
(cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
|
||||
fi
|
||||
|
||||
# Find all archives inside and unzip them as well to compare the contents rather than
|
||||
# the archives. pie.jar.pack.gz i app3.war is corrupt, skip it.
|
||||
|
@ -525,7 +531,7 @@ compare_all_jar_files() {
|
|||
|
||||
# TODO filter?
|
||||
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.jar" -o -name "*.war" \
|
||||
| $SORT | $FILTER)
|
||||
-o -name "*.jimage" | $SORT | $FILTER)
|
||||
|
||||
if [ -n "$ZIPS" ]; then
|
||||
echo Jar files...
|
||||
|
@ -633,7 +639,7 @@ compare_bin_file() {
|
|||
if cmp $OTHER_FILE $THIS_FILE > /dev/null; then
|
||||
# The files were bytewise identical.
|
||||
if [ -n "$VERBOSE" ]; then
|
||||
echo " : : : : : $BIN_FILE"
|
||||
echo " : : : : : : $BIN_FILE"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
@ -1136,17 +1142,8 @@ fi
|
|||
|
||||
if [ "$SKIP_DEFAULT" != "true" ]; then
|
||||
if [ -z "$OTHER" ]; then
|
||||
OTHER="$THIS/../$LEGACY_BUILD_DIR"
|
||||
if [ -d "$OTHER" ]; then
|
||||
OTHER="$( cd "$OTHER" && pwd )"
|
||||
else
|
||||
echo "Default old build directory does not exist:"
|
||||
echo "$OTHER"
|
||||
echo "Nothing to compare to, set with -o"
|
||||
exit 1
|
||||
fi
|
||||
echo "Comparing to default old build:"
|
||||
echo "$OTHER"
|
||||
echo
|
||||
else
|
||||
if [ ! -d "$OTHER" ]; then
|
||||
echo "Other build directory does not exist:"
|
||||
|
@ -1160,90 +1157,36 @@ if [ "$SKIP_DEFAULT" != "true" ]; then
|
|||
fi
|
||||
|
||||
|
||||
# Figure out the layout of the this build. Which kinds of images have been produced
|
||||
if [ -d "$THIS/install/j2sdk-image" ]; then
|
||||
THIS_J2SDK="$THIS/install/j2sdk-image"
|
||||
THIS_J2RE="$THIS/install/j2re-image"
|
||||
echo "Selecting install images in this build"
|
||||
elif [ -d "$THIS/deploy/j2sdk-image" ]; then
|
||||
THIS_J2SDK="$THIS/deploy/j2sdk-image"
|
||||
THIS_J2RE="$THIS/deploy/j2re-image"
|
||||
echo "Selecting deploy images in this build"
|
||||
elif [ -d "$THIS/images/j2sdk-image" ]; then
|
||||
THIS_J2SDK="$THIS/images/j2sdk-image"
|
||||
THIS_J2RE="$THIS/images/j2re-image"
|
||||
echo "Selecting jdk images in this build"
|
||||
fi
|
||||
|
||||
if [ -d "$THIS/images/j2sdk-overlay-image" ]; then
|
||||
if [ -d "$THIS/install/j2sdk-image" ]; then
|
||||
# If there is an install image, prefer that, it's also overlay
|
||||
THIS_J2SDK_OVERLAY="$THIS/install/j2sdk-image"
|
||||
THIS_J2RE_OVERLAY="$THIS/install/j2re-image"
|
||||
echo "Selecting install overlay images in this build"
|
||||
# Find the common images to compare, prioritizing later build stages
|
||||
if [ -d "$THIS/install/jdk" ] && [ -d "$OTHER/install/jdk" ]; then
|
||||
THIS_J2SDK="$THIS/install/jdk"
|
||||
THIS_J2RE="$THIS/install/jre"
|
||||
OTHER_J2SDK="$OTHER/install/jdk"
|
||||
OTHER_J2RE="$OTHER/install/jre"
|
||||
echo "Selecting install images for compare"
|
||||
elif [ -d "$THIS/deploy/jdk" ] && [ -d "$OTHER/deploy/jdk" ]; then
|
||||
THIS_J2SDK="$THIS/deploy/jdk"
|
||||
THIS_J2RE="$THIS/deploy/jre"
|
||||
OTHER_J2SDK="$OTHER/deploy/jdk"
|
||||
OTHER_J2RE="$OTHER/deploy/jre"
|
||||
echo "Selecting deploy images for compare"
|
||||
elif [ -d "$THIS/images/jdk" ] && [ -d "$OTHER/images/jdk" ]; then
|
||||
THIS_J2SDK="$THIS/images/jdk"
|
||||
THIS_J2RE="$THIS/images/jre"
|
||||
OTHER_J2SDK="$OTHER/images/jdk"
|
||||
OTHER_J2RE="$OTHER/images/jre"
|
||||
echo "Selecting jdk images for compare"
|
||||
else
|
||||
THIS_J2SDK_OVERLAY="$THIS/images/j2sdk-overlay-image"
|
||||
THIS_J2RE_OVERLAY="$THIS/images/j2re-overlay-image"
|
||||
echo "Selecting jdk overlay images in this build"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d "$THIS/images/j2sdk-bundle" ]; then
|
||||
THIS_J2SDK_BUNDLE="$THIS/images/j2sdk-bundle"
|
||||
THIS_J2RE_BUNDLE="$THIS/images/j2re-bundle"
|
||||
echo "Selecting bundles in this build"
|
||||
fi
|
||||
|
||||
# Figure out the layout of the other build (old or new, normal or overlay image)
|
||||
if [ -d "$OTHER/j2sdk-image" ]; then
|
||||
if [ -f "$OTHER/j2sdk-image/LICENSE" ]; then
|
||||
OTHER_J2SDK="$OTHER/j2sdk-image"
|
||||
OTHER_J2RE="$OTHER/j2re-image"
|
||||
echo "Selecting old-style images in other build"
|
||||
else
|
||||
OTHER_J2SDK_OVERLAY="$OTHER/j2sdk-image"
|
||||
OTHER_J2RE_OVERLAY="$OTHER/j2re-image"
|
||||
echo "Selecting overlay images in other build"
|
||||
fi
|
||||
elif [ -d "$OTHER/install/j2sdk-image" ]; then
|
||||
OTHER_J2SDK="$OTHER/install/j2sdk-image"
|
||||
OTHER_J2RE="$OTHER/install/j2re-image"
|
||||
echo "Selecting install images in other build"
|
||||
elif [ -d "$OTHER/deploy/j2sdk-image" ]; then
|
||||
OTHER_J2SDK="$OTHER/deploy/j2sdk-image"
|
||||
OTHER_J2RE="$OTHER/deploy/j2re-image"
|
||||
echo "Selecting deploy images in other build"
|
||||
elif [ -d "$OTHER/images/j2sdk-image" ]; then
|
||||
OTHER_J2SDK="$OTHER/images/j2sdk-image"
|
||||
OTHER_J2RE="$OTHER/images/j2re-image"
|
||||
echo "Selecting jdk images in other build"
|
||||
fi
|
||||
|
||||
if [ -d "$OTHER/j2sdk-bundle" ]; then
|
||||
OTHER_J2SDK_BUNDLE="$OTHER/j2sdk-bundle"
|
||||
OTHER_J2RE_BUNDLE="$OTHER/j2re-bundle"
|
||||
echo "Selecting bundles in other build"
|
||||
elif [ -d "$OTHER/images/j2sdk-bundle" ]; then
|
||||
OTHER_J2SDK_BUNDLE="$OTHER/images/j2sdk-bundle"
|
||||
OTHER_J2RE_BUNDLE="$OTHER/images/j2re-bundle"
|
||||
echo "Selecting jdk bundles in other build"
|
||||
fi
|
||||
|
||||
if [ -z "$THIS_J2SDK" ] || [ -z "$THIS_J2RE" ]; then
|
||||
if [ -z "$THIS_J2SDK_OVERLAY" ]; then
|
||||
echo "Cannot locate images for this build. Are you sure you have run 'make images'?"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$OTHER_J2SDK" ] && [ -n "$OTHER_J2SDK_OVERLAY" ] && [ -z "$THIS_J2SDK_OVERLAY" ]; then
|
||||
echo "OTHER build only has an overlay image while this build does not. Nothing to compare!"
|
||||
echo "No common images found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
|
||||
echo "WARNING! OTHER build has bundles built while this build does not."
|
||||
echo "Skipping bundle compare!"
|
||||
if [ -d "$THIS/images/jdk-bundle" ] && [ -d "$OTHER/images/jdk-bundle" ]; then
|
||||
THIS_J2SDK_BUNDLE="$THIS/images/jdk-bundle"
|
||||
THIS_J2RE_BUNDLE="$THIS/images/jre-bundle"
|
||||
OTHER_J2SDK_BUNDLE="$OTHER/images/jdk-bundle"
|
||||
OTHER_J2RE_BUNDLE="$OTHER/images/jre-bundle"
|
||||
echo "Also comparing macosx bundles"
|
||||
fi
|
||||
|
||||
if [ -d "$OTHER/images" ]; then
|
||||
|
@ -1266,22 +1209,13 @@ if [ "$SKIP_DEFAULT" != "true" ]; then
|
|||
THIS_JGSS_WINDOWS_BIN="$THIS_SEC_DIR/$JGSS_WINDOWS_BIN"
|
||||
fi
|
||||
|
||||
if [ -d "$THIS/docs" ]; then
|
||||
if [ -d "$THIS/docs" ] && [ -d "$OTHER/docs" ]; then
|
||||
THIS_DOCS="$THIS/docs"
|
||||
fi
|
||||
|
||||
if [ -d "$OTHER/docs" ]; then
|
||||
OTHER_DOCS="$OTHER/docs"
|
||||
fi
|
||||
|
||||
if [ -z "$THIS_DOCS" ]; then
|
||||
echo "Also comparing docs"
|
||||
else
|
||||
echo "WARNING! Docs haven't been built and won't be compared."
|
||||
fi
|
||||
|
||||
if [ -z "$OTHER_DOCS" ]; then
|
||||
echo "WARNING! Other build doesn't contain docs, skipping doc compare."
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
##########################################################################################
|
||||
|
@ -1299,27 +1233,16 @@ if [ "$CMP_NAMES" = "true" ]; then
|
|||
echo -n "J2RE "
|
||||
compare_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
|
||||
fi
|
||||
if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
|
||||
echo -n "J2SDK Overlay "
|
||||
compare_dirs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
|
||||
echo -n "J2RE Overlay "
|
||||
compare_dirs $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
|
||||
|
||||
echo -n "J2SDK Overlay "
|
||||
compare_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
|
||||
echo -n "J2RE Overlay "
|
||||
compare_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
|
||||
fi
|
||||
if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
|
||||
echo -n "J2SDK Bundle "
|
||||
compare_dirs $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
|
||||
compare_dirs $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/jdk-bundle
|
||||
echo -n "J2RE Bundle "
|
||||
compare_dirs $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
|
||||
compare_dirs $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/jre-bundle
|
||||
|
||||
echo -n "J2SDK Bundle "
|
||||
compare_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
|
||||
compare_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/jdk-bundle
|
||||
echo -n "J2RE Bundle "
|
||||
compare_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
|
||||
compare_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/jre-bundle
|
||||
fi
|
||||
if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
|
||||
echo -n "Docs "
|
||||
|
@ -1340,18 +1263,6 @@ if [ "$CMP_PERMS" = "true" ]; then
|
|||
echo -n "J2RE "
|
||||
compare_permissions $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
|
||||
fi
|
||||
if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
|
||||
echo -n "J2SDK Overlay "
|
||||
compare_permissions $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
|
||||
echo -n "J2RE Overlay "
|
||||
compare_permissions $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
|
||||
fi
|
||||
if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
|
||||
echo -n "J2SDK Bundle "
|
||||
compare_permissions $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
|
||||
echo -n "J2RE Bundle "
|
||||
compare_permissions $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
|
||||
fi
|
||||
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
|
||||
compare_permissions $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
||||
fi
|
||||
|
@ -1364,17 +1275,11 @@ if [ "$CMP_TYPES" = "true" ]; then
|
|||
echo -n "J2RE "
|
||||
compare_file_types $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
|
||||
fi
|
||||
if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
|
||||
echo -n "J2SDK Overlay "
|
||||
compare_file_types $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
|
||||
echo -n "J2RE Overlay "
|
||||
compare_file_types $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
|
||||
fi
|
||||
if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
|
||||
echo -n "J2SDK Bundle "
|
||||
compare_file_types $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
|
||||
compare_file_types $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/jdk-bundle
|
||||
echo -n "J2RE Bundle "
|
||||
compare_file_types $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
|
||||
compare_file_types $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/jre-bundle
|
||||
fi
|
||||
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
|
||||
compare_file_types $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
||||
|
@ -1388,17 +1293,11 @@ if [ "$CMP_GENERAL" = "true" ]; then
|
|||
echo -n "J2RE "
|
||||
compare_general_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
|
||||
fi
|
||||
if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
|
||||
echo -n "J2SDK Overlay "
|
||||
compare_general_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
|
||||
echo -n "J2RE Overlay "
|
||||
compare_general_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
|
||||
fi
|
||||
if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then
|
||||
echo -n "J2SDK Bundle "
|
||||
compare_general_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle
|
||||
compare_general_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/jdk-bundle
|
||||
echo -n "J2RE Bundle "
|
||||
compare_general_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle
|
||||
compare_general_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/jre-bundle
|
||||
fi
|
||||
if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then
|
||||
echo -n "Docs "
|
||||
|
@ -1454,10 +1353,6 @@ if [ "$CMP_LIBS" = "true" ]; then
|
|||
compare_all_libs $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
|
||||
fi
|
||||
fi
|
||||
if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
|
||||
echo -n "Bundle "
|
||||
compare_all_libs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
|
||||
fi
|
||||
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
|
||||
compare_all_libs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
||||
fi
|
||||
|
@ -1467,10 +1362,6 @@ if [ "$CMP_EXECS" = "true" ]; then
|
|||
if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
|
||||
compare_all_execs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
|
||||
fi
|
||||
if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
|
||||
echo -n "Overlay "
|
||||
compare_all_execs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
|
||||
fi
|
||||
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
|
||||
compare_all_execs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
|
||||
fi
|
||||
|
|
|
@ -84,7 +84,9 @@ ACCEPTED_BIN_DIFF="
|
|||
./bin/jconsole
|
||||
./bin/jdb
|
||||
./bin/jhat
|
||||
./bin/jimage
|
||||
./bin/jinfo
|
||||
./bin/jjs
|
||||
./bin/jmap
|
||||
./bin/jps
|
||||
./bin/jrunscript
|
||||
|
@ -108,6 +110,7 @@ ACCEPTED_BIN_DIFF="
|
|||
./bin/wsimport
|
||||
./bin/xjc
|
||||
./jre/bin/java
|
||||
./jre/bin/jjs
|
||||
./jre/bin/keytool
|
||||
./jre/bin/orbd
|
||||
./jre/bin/pack200
|
||||
|
@ -171,7 +174,9 @@ ACCEPTED_BIN_DIFF="
|
|||
./bin/jconsole
|
||||
./bin/jdb
|
||||
./bin/jhat
|
||||
./bin/jimage
|
||||
./bin/jinfo
|
||||
./bin/jjs
|
||||
./bin/jmap
|
||||
./bin/jps
|
||||
./bin/jrunscript
|
||||
|
@ -195,6 +200,7 @@ ACCEPTED_BIN_DIFF="
|
|||
./bin/wsimport
|
||||
./bin/xjc
|
||||
./jre/bin/java
|
||||
./jre/bin/jjs
|
||||
./jre/bin/keytool
|
||||
./jre/bin/orbd
|
||||
./jre/bin/pack200
|
||||
|
@ -314,7 +320,9 @@ ACCEPTED_SMALL_SIZE_DIFF="
|
|||
./bin/jconsole
|
||||
./bin/jdb
|
||||
./bin/jhat
|
||||
./bin/jimage
|
||||
./bin/jinfo
|
||||
./bin/jjs
|
||||
./bin/jmap
|
||||
./bin/jps
|
||||
./bin/jrunscript
|
||||
|
@ -453,7 +461,9 @@ ACCEPTED_SMALL_SIZE_DIFF="
|
|||
./bin/amd64/jconsole
|
||||
./bin/amd64/jdb
|
||||
./bin/amd64/jhat
|
||||
./bin/amd64/jimage
|
||||
./bin/amd64/jinfo
|
||||
./bin/amd64/jjs
|
||||
./bin/amd64/jmap
|
||||
./bin/amd64/jps
|
||||
./bin/amd64/jrunscript
|
||||
|
@ -611,7 +621,9 @@ ACCEPTED_SMALL_SIZE_DIFF="
|
|||
./bin/jconsole
|
||||
./bin/jdb
|
||||
./bin/jhat
|
||||
./bin/jimage
|
||||
./bin/jinfo
|
||||
./bin/jjs
|
||||
./bin/jmap
|
||||
./bin/jps
|
||||
./bin/jrunscript
|
||||
|
@ -755,7 +767,9 @@ ACCEPTED_SMALL_SIZE_DIFF="
|
|||
./bin/sparcv9/jconsole
|
||||
./bin/sparcv9/jdb
|
||||
./bin/sparcv9/jhat
|
||||
./bin/sparcv9/jimage
|
||||
./bin/sparcv9/jinfo
|
||||
./bin/sparcv9/jjs
|
||||
./bin/sparcv9/jmap
|
||||
./bin/sparcv9/jps
|
||||
./bin/sparcv9/jrunscript
|
||||
|
@ -836,7 +850,9 @@ ACCEPTED_SMALL_SIZE_DIFF="
|
|||
./bin/jconsole.exe
|
||||
./bin/jdb.exe
|
||||
./bin/jhat.exe
|
||||
./bin/jimage.exe
|
||||
./bin/jinfo.exe
|
||||
./bin/jjs.exe
|
||||
./bin/jmap.exe
|
||||
./bin/jps.exe
|
||||
./bin/jrunscript.exe
|
||||
|
@ -910,11 +926,6 @@ ACCEPTED_JARZIP_CONTENTS="
|
|||
/META-INF/INDEX.LIST
|
||||
"
|
||||
|
||||
KNOWN_BIN_DIFF="
|
||||
./jre/lib/libJObjC.dylib
|
||||
./lib/libJObjC.dylib
|
||||
"
|
||||
|
||||
ACCEPTED_BIN_DIFF="
|
||||
./bin/appletviewer
|
||||
./bin/idlj
|
||||
|
@ -930,7 +941,9 @@ ACCEPTED_BIN_DIFF="
|
|||
./bin/jconsole
|
||||
./bin/jdb
|
||||
./bin/jhat
|
||||
./bin/jimage
|
||||
./bin/jinfo
|
||||
./bin/jjs
|
||||
./bin/jmap
|
||||
./bin/jps
|
||||
./bin/jrunscript
|
||||
|
@ -964,34 +977,82 @@ ACCEPTED_BIN_DIFF="
|
|||
./jre/bin/tnameserv
|
||||
./jre/lib/libsaproc.dylib
|
||||
./jre/lib/server/libjvm.dylib
|
||||
./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.dylib
|
||||
./demo/jvmti/gctest/lib/libgctest.dylib
|
||||
./demo/jvmti/heapTracker/lib/libheapTracker.dylib
|
||||
./demo/jvmti/heapViewer/lib/libheapViewer.dylib
|
||||
./demo/jvmti/minst/lib/libminst.dylib
|
||||
./demo/jvmti/mtrace/lib/libmtrace.dylib
|
||||
./demo/jvmti/versionCheck/lib/libversionCheck.dylib
|
||||
./demo/jvmti/waiters/lib/libwaiters.dylib
|
||||
./Contents/Home/lib/libAppleScriptEngine.dylib
|
||||
./Contents/Home/lib/libattach.dylib
|
||||
./Contents/Home/lib/libawt_lwawt.dylib
|
||||
./Contents/Home/lib/libdeploy.dylib
|
||||
./Contents/Home/lib/libdt_socket.dylib
|
||||
./Contents/Home/lib/libhprof.dylib
|
||||
./Contents/Home/lib/libinstrument.dylib
|
||||
./Contents/Home/lib/libjava_crw_demo.dylib
|
||||
./Contents/Home/lib/libjdwp.dylib
|
||||
./Contents/Home/lib/libjsdt.dylib
|
||||
./Contents/Home/lib/libjsig.dylib
|
||||
./Contents/Home/lib/libmanagement.dylib
|
||||
./Contents/Home/lib/libnpjp2.dylib
|
||||
./Contents/Home/lib/libosx.dylib
|
||||
./Contents/Home/lib/libosxapp.dylib
|
||||
./Contents/Home/lib/libsaproc.dylib
|
||||
./Contents/Home/lib/libsplashscreen.dylib
|
||||
./Contents/Home/lib/libverify.dylib
|
||||
./Contents/Home/lib/server/libjsig.dylib
|
||||
./Contents/Home/lib/server/libjvm.dylib
|
||||
./jre/lib/libAppleScriptEngine.dylib
|
||||
./jre/lib/libattach.dylib
|
||||
./jre/lib/libawt_lwawt.dylib
|
||||
./jre/lib/libdeploy.dylib
|
||||
./jre/lib/libdt_socket.dylib
|
||||
./jre/lib/libhprof.dylib
|
||||
./jre/lib/libinstrument.dylib
|
||||
./jre/lib/libjava_crw_demo.dylib
|
||||
./jre/lib/libjdwp.dylib
|
||||
./jre/lib/libjsdt.dylib
|
||||
./jre/lib/libjsig.dylib
|
||||
./jre/lib/libmanagement.dylib
|
||||
./jre/lib/libosx.dylib
|
||||
./jre/lib/libosxapp.dylib
|
||||
./jre/lib/libsaproc.dylib
|
||||
./jre/lib/libsplashscreen.dylib
|
||||
./jre/lib/libverify.dylib
|
||||
./jre/lib/server/libjvm.dylib
|
||||
./lib/libAppleScriptEngine.dylib
|
||||
./lib/libattach.dylib
|
||||
./lib/libawt_lwawt.dylib
|
||||
./lib/libdeploy.dylib
|
||||
./lib/libdt_socket.dylib
|
||||
./lib/libhprof.dylib
|
||||
./lib/libinstrument.dylib
|
||||
./lib/libjava_crw_demo.dylib
|
||||
./lib/libjdwp.dylib
|
||||
./lib/libjsdt.dylib
|
||||
./lib/libjsig.dylib
|
||||
./lib/libmanagement.dylib
|
||||
./lib/libnpjp2.dylib
|
||||
./lib/libosx.dylib
|
||||
./lib/libosxapp.dylib
|
||||
./lib/libverify.dylib
|
||||
./lib/libsaproc.dylib
|
||||
./lib/libsplashscreen.dylib
|
||||
./lib/server/libjvm.dylib
|
||||
./lib/deploy/JavaControlPanel.prefPane/Contents/MacOS/JavaControlPanel
|
||||
"
|
||||
|
||||
KNOWN_SIZE_DIFF="
|
||||
./jre/lib/libJObjC.dylib
|
||||
./lib/libJObjC.dylib
|
||||
"
|
||||
|
||||
SORT_SYMBOLS="
|
||||
./jre/lib/libJObjC.dylib
|
||||
./lib/libJObjC.dylib
|
||||
./Contents/Home/lib/libsaproc.dylib
|
||||
./jre/lib/libsaproc.dylib
|
||||
./lib/libsaproc.dylib
|
||||
"
|
||||
|
||||
KNOWN_SYM_DIFF="
|
||||
./jre/lib/libJObjC.dylib
|
||||
./lib/libJObjC.dylib
|
||||
ACCEPTED_SMALL_SIZE_DIFF="
|
||||
./bin/javaws
|
||||
./Contents/Home/bin/_javaws
|
||||
"
|
||||
|
||||
KNOWN_ELF_DIFF="
|
||||
./jre/lib/libJObjC.dylib
|
||||
./lib/libJObjC.dylib
|
||||
"
|
||||
|
||||
KNOWN_DIS_DIFF="
|
||||
./jre/lib/libJObjC.dylib
|
||||
./lib/libJObjC.dylib
|
||||
"
|
||||
|
||||
fi
|
||||
|
|
|
@ -181,4 +181,3 @@ checkErrors
|
|||
checkErrors
|
||||
|
||||
exit 0
|
||||
|
||||
|
|
|
@ -1212,6 +1212,7 @@ jdk/src/java.rmi/share/classes/sun/rmi/transport/tcp : jdk/src/share/classes/sun
|
|||
jdk/src/java.rmi/share/doc/stub/java/rmi/activation : jdk/src/share/doc/stub/java/rmi/activation
|
||||
jdk/src/java.rmi/unix/bin/java-rmi.cgi.sh : jdk/src/solaris/bin/java-rmi.cgi.sh
|
||||
jdk/src/java.scripting/share/classes/javax/script : jdk/src/share/classes/javax/script
|
||||
jdk/src/java.scripting/share/classes/com/sun/tools/script/shell : jdk/src/share/classes/com/sun/tools/script/shell
|
||||
jdk/src/java.security.acl/share/classes/java/security/acl : jdk/src/share/classes/java/security/acl
|
||||
jdk/src/java.security.acl/share/classes/sun/security/acl : jdk/src/share/classes/sun/security/acl
|
||||
jdk/src/java.security.jgss/macosx/native/libosxkrb5/nativeccache.c : jdk/src/share/native/sun/security/krb5/nativeccache.c
|
||||
|
@ -1301,7 +1302,6 @@ jdk/src/jdk.deploy.osx/macosx/native/libosx/JavaAppLauncher.m : jdk/src/macosx/n
|
|||
jdk/src/jdk.deploy.osx/macosx/native/libosx/KeystoreImpl.m : jdk/src/macosx/native/apple/security/KeystoreImpl.m
|
||||
jdk/src/jdk.dev/share/classes/com/sun/jarsigner : jdk/src/share/classes/com/sun/jarsigner
|
||||
jdk/src/jdk.dev/share/classes/com/sun/tools/hat : jdk/src/share/classes/com/sun/tools/hat
|
||||
jdk/src/jdk.dev/share/classes/com/sun/tools/script/shell : jdk/src/share/classes/com/sun/tools/script/shell
|
||||
jdk/src/jdk.dev/share/classes/sun/security/tools/jarsigner : jdk/src/share/classes/sun/security/tools/jarsigner
|
||||
jdk/src/jdk.dev/share/classes/sun/tools/jar : jdk/src/share/classes/sun/tools/jar
|
||||
jdk/src/jdk.dev/share/classes/sun/tools/native2ascii : jdk/src/share/classes/sun/tools/native2ascii
|
||||
|
|
|
@ -200,4 +200,3 @@ do
|
|||
printf "%s\n" "$line" >> $output
|
||||
fi
|
||||
done < "$input"
|
||||
|
||||
|
|
|
@ -282,3 +282,5 @@ ffd90c81d4ef9d94d880fc852e2fc482ecd9b374 jdk9-b36
|
|||
7e9add74ad50841fb39dae75db56374aefa1de4c jdk9-b37
|
||||
8acf056126e819cf536eef02aee0f61f207a6b52 jdk9-b38
|
||||
53bf36cb722db50815712258a77cb6bbe25a2f5f jdk9-b39
|
||||
e27c725d6c9d155667b35255f442d4ceb8c3c084 jdk9-b40
|
||||
1908b886ba1eda46fa725cf1160fe5d30fd1a7e5 jdk9-b41
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
#
|
||||
# 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. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# The Corba sources are old and generates a LOT of warnings.
|
||||
# Disable these using Xlint, until someone cares to fix them.
|
||||
DISABLE_CORBA_WARNINGS := -Xlint:all,-deprecation,-unchecked,-serial,-fallthrough,-cast,-rawtypes,-static,-dep-ann
|
||||
|
||||
# The "generate old bytecode" javac setup uses the new compiler to compile for the
|
||||
# boot jdk to generate tools that need to be run with the boot jdk.
|
||||
# Thus we force the target bytecode to the boot jdk bytecode.
|
||||
$(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \
|
||||
JVM := $(JAVA), \
|
||||
JAVAC := $(NEW_JAVAC), \
|
||||
FLAGS := $(BOOT_JDK_SOURCETARGET) \
|
||||
-bootclasspath "$(BOOT_RTJAR)$(PATH_SEP)$(BOOT_TOOLSJAR)" \
|
||||
$(DISABLE_CORBA_WARNINGS), \
|
||||
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
||||
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
|
||||
|
||||
# The "generate new bytecode" uses the new compiler to generate bytecode
|
||||
# for the new jdk that is being built. The code compiled by this setup
|
||||
# cannot necessarily be run with the boot jdk.
|
||||
$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE, \
|
||||
JVM := $(JAVA), \
|
||||
JAVAC := $(NEW_JAVAC), \
|
||||
FLAGS := -cp $(BOOT_TOOLSJAR) -XDignore.symbol.file=true $(DISABLE_CORBA_WARNINGS), \
|
||||
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
||||
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
|
||||
|
||||
################################################################################
|
|
@ -29,16 +29,16 @@ default: all
|
|||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
|
||||
include CommonCorba.gmk
|
||||
include SetupJavaCompilers.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJavaCompilation,BUILD_INTERIM_CORBA, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
SRC := $(CORBA_TOPDIR)/src/java.corba/share/classes \
|
||||
SRC := $(JDK_TOPDIR)/src/jdk.rmic/share/classes \
|
||||
$(CORBA_TOPDIR)/src/java.corba/share/classes \
|
||||
$(CORBA_TOPDIR)/src/jdk.rmic/share/classes \
|
||||
$(CORBA_OUTPUTDIR)/gensrc/java.corba, \
|
||||
$(SUPPORT_OUTPUTDIR)/gensrc/java.corba, \
|
||||
EXCLUDES := com/sun/corba/se/PortableActivationIDL, \
|
||||
EXCLUDE_FILES := com/sun/corba/se/impl/presentation/rmi/JNDIStateFactoryImpl.java \
|
||||
com/sun/corba/se/spi/presentation/rmi/StubWrapper.java \
|
||||
|
@ -47,16 +47,9 @@ $(eval $(call SetupJavaCompilation,BUILD_INTERIM_CORBA, \
|
|||
com/sun/corba/se/impl/presentation/rmi/jndi.properties, \
|
||||
COPY := .prp, \
|
||||
CLEAN := .properties, \
|
||||
BIN := $(CORBA_OUTPUTDIR)/interim_classes, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/corba_interim_classes, \
|
||||
JAR := $(INTERIM_CORBA_JAR)))
|
||||
|
||||
################################################################################
|
||||
# Copy idl files straight to jdk/include.
|
||||
$(JDK_OUTPUTDIR)/include/%: $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/%
|
||||
$(install-file)
|
||||
|
||||
IDL_TARGET_FILES := $(JDK_OUTPUTDIR)/include/orb.idl $(JDK_OUTPUTDIR)/include/ir.idl
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(BUILD_INTERIM_CORBA) $(IDL_TARGET_FILES)
|
||||
all: $(BUILD_INTERIM_CORBA)
|
|
@ -23,13 +23,12 @@
|
|||
# questions.
|
||||
#
|
||||
|
||||
# The BOOT_JAVAC setup uses the boot jdk compiler to compile the tools
|
||||
# and the interim javac, to be run by the boot jdk.
|
||||
$(eval $(call SetupJavaCompiler,BOOT_JAVAC, \
|
||||
JAVAC := $(JAVAC), \
|
||||
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
||||
SERVER_JVM := $(SJAVAC_SERVER_JAVA), \
|
||||
FLAGS := -XDignore.symbol.file=true -g -Xlint:all$(COMMA)-deprecation -Werror))
|
||||
################################################################################
|
||||
# Copy idl files to jdk/lib.
|
||||
$(eval $(call SetupCopyFiles,COPY_IDL, \
|
||||
SRC := $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl, \
|
||||
DEST := $(SUPPORT_OUTPUTDIR)/modules_include/$(MODULE), \
|
||||
FILES := $(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/orb.idl \
|
||||
$(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/tools/corba/se/idl/ir.idl))
|
||||
|
||||
# javax.tools.JavaCompilerTool isn't really a suffix but this gets the file copied.
|
||||
RESOURCE_SUFFIXES := .gif .xml .css .js javax.tools.JavaCompilerTool
|
||||
TARGETS := $(COPY_IDL)
|
|
@ -29,35 +29,37 @@ include $(SPEC)
|
|||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include IdlCompilation.gmk
|
||||
|
||||
include CommonCorba.gmk
|
||||
include SetupJavaCompilers.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJavaCompilation,BUILD_TOOLS_CORBA, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
SRC := $(CORBA_TOPDIR)/make/src/classes, \
|
||||
BIN := $(CORBA_OUTPUTDIR)/tools_classes))
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/corba_tools_classes))
|
||||
|
||||
TOOL_LOGUTIL_CMD := $(JAVA) -cp $(CORBA_OUTPUTDIR)/tools_classes \
|
||||
TOOL_LOGUTIL_CMD := $(JAVA) -cp $(BUILDTOOLS_OUTPUTDIR)/corba_tools_classes \
|
||||
build.tools.logutil.MC
|
||||
|
||||
$(eval $(call SetupJavaCompilation,BUILD_IDLJ, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
SRC := $(CORBA_TOPDIR)/src/java.corba/share/classes, \
|
||||
BIN := $(CORBA_OUTPUTDIR)/idlj_classes, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/idlj_classes, \
|
||||
COPY := .prp, \
|
||||
INCLUDES := com/sun/tools/corba/se/idl, \
|
||||
EXCLUDE_FILES := ResourceBundleUtil.java))
|
||||
|
||||
# Force the language to english for predictable source code generation.
|
||||
TOOL_IDLJ_CMD := $(JAVA) -cp $(CORBA_OUTPUTDIR)/idlj_classes \
|
||||
TOOL_IDLJ_CMD := $(JAVA) -cp $(BUILDTOOLS_OUTPUTDIR)/idlj_classes \
|
||||
-Duser.language=en com.sun.tools.corba.se.idl.toJavaPortable.Compile
|
||||
|
||||
################################################################################
|
||||
|
||||
EXCEPTION_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging
|
||||
LOGWRAPPER_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.corba/_logwrappers
|
||||
|
||||
# Generate LogWrapper classes
|
||||
$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/%SystemException.java: \
|
||||
$(EXCEPTION_DIR)/%SystemException.java: \
|
||||
$(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/%.mc \
|
||||
$(BUILD_TOOLS_CORBA)
|
||||
$(MKDIR) -p $(@D)
|
||||
|
@ -66,21 +68,21 @@ $(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/%SystemExcept
|
|||
$(TOOL_LOGUTIL_CMD) make-class $< $(@D)
|
||||
|
||||
# Generate LogWrapper properties file by concatening resource files
|
||||
$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/LogStrings.properties: \
|
||||
$(CORBA_OUTPUTDIR)/logwrappers/ActivationSystemException.resource \
|
||||
$(CORBA_OUTPUTDIR)/logwrappers/IORSystemException.resource \
|
||||
$(CORBA_OUTPUTDIR)/logwrappers/InterceptorsSystemException.resource \
|
||||
$(CORBA_OUTPUTDIR)/logwrappers/NamingSystemException.resource \
|
||||
$(CORBA_OUTPUTDIR)/logwrappers/OMGSystemException.resource \
|
||||
$(CORBA_OUTPUTDIR)/logwrappers/ORBUtilSystemException.resource \
|
||||
$(CORBA_OUTPUTDIR)/logwrappers/POASystemException.resource \
|
||||
$(CORBA_OUTPUTDIR)/logwrappers/UtilSystemException.resource
|
||||
$(EXCEPTION_DIR)/LogStrings.properties: \
|
||||
$(LOGWRAPPER_DIR)/ActivationSystemException.resource \
|
||||
$(LOGWRAPPER_DIR)/IORSystemException.resource \
|
||||
$(LOGWRAPPER_DIR)/InterceptorsSystemException.resource \
|
||||
$(LOGWRAPPER_DIR)/NamingSystemException.resource \
|
||||
$(LOGWRAPPER_DIR)/OMGSystemException.resource \
|
||||
$(LOGWRAPPER_DIR)/ORBUtilSystemException.resource \
|
||||
$(LOGWRAPPER_DIR)/POASystemException.resource \
|
||||
$(LOGWRAPPER_DIR)/UtilSystemException.resource
|
||||
$(MKDIR) -p $(@D)
|
||||
$(ECHO) $(LOG_INFO) Concatenating 8 resource files into $(@F)
|
||||
$(CAT) $^ > $@
|
||||
|
||||
# The resources files are generated from lisp-like .mc files.
|
||||
$(CORBA_OUTPUTDIR)/logwrappers/%SystemException.resource: \
|
||||
$(LOGWRAPPER_DIR)/%SystemException.resource: \
|
||||
$(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/spi/logging/data/%.mc \
|
||||
$(BUILD_TOOLS_CORBA)
|
||||
$(MKDIR) -p $(@D)
|
||||
|
@ -90,15 +92,15 @@ $(CORBA_OUTPUTDIR)/logwrappers/%SystemException.resource: \
|
|||
|
||||
|
||||
LOGWRAPPER_TARGETS := \
|
||||
$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/ActivationSystemException.java \
|
||||
$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/IORSystemException.java \
|
||||
$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/InterceptorsSystemException.java \
|
||||
$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/NamingSystemException.java \
|
||||
$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/OMGSystemException.java \
|
||||
$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/ORBUtilSystemException.java \
|
||||
$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/POASystemException.java \
|
||||
$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/UtilSystemException.java \
|
||||
$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/logging/LogStrings.properties
|
||||
$(EXCEPTION_DIR)/ActivationSystemException.java \
|
||||
$(EXCEPTION_DIR)/IORSystemException.java \
|
||||
$(EXCEPTION_DIR)/InterceptorsSystemException.java \
|
||||
$(EXCEPTION_DIR)/NamingSystemException.java \
|
||||
$(EXCEPTION_DIR)/OMGSystemException.java \
|
||||
$(EXCEPTION_DIR)/ORBUtilSystemException.java \
|
||||
$(EXCEPTION_DIR)/POASystemException.java \
|
||||
$(EXCEPTION_DIR)/UtilSystemException.java \
|
||||
$(EXCEPTION_DIR)/LogStrings.properties
|
||||
|
||||
################################################################################
|
||||
# Build the IDLs.
|
||||
|
@ -215,7 +217,7 @@ IDL_DELETES := \
|
|||
$(eval $(call SetupIdlCompilation,BUILD_IDLS, \
|
||||
IDLJ := $(TOOL_IDLJ_CMD), \
|
||||
SRC := $(CORBA_TOPDIR)/src/java.corba/share/classes, \
|
||||
BIN := $(CORBA_OUTPUTDIR)/gensrc/java.corba, \
|
||||
BIN := $(SUPPORT_OUTPUTDIR)/gensrc/java.corba, \
|
||||
EXCLUDES := com/sun/tools/corba/se/idl/% \
|
||||
org/omg/CORBA/% \
|
||||
com/sun/corba/se/GiopIDL/% \
|
||||
|
@ -230,12 +232,12 @@ $(BUILD_IDLS): $(BUILD_IDLJ)
|
|||
################################################################################
|
||||
# zh_HK is just a copy of zh_TW
|
||||
|
||||
$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_HK.properties: \
|
||||
$(SUPPORT_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_HK.properties: \
|
||||
$(CORBA_TOPDIR)/src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties
|
||||
$(install-file)
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(BUILD_IDLS) $(LOGWRAPPER_TARGETS) \
|
||||
$(CORBA_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_HK.properties
|
||||
$(SUPPORT_OUTPUTDIR)/gensrc/java.corba/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_HK.properties
|
||||
|
|
@ -352,7 +352,7 @@ public abstract class Generator implements sun.rmi.rmic.Generator,
|
|||
env.output(Main.getText("rmic.generated", file.getPath(), Long.toString(duration)));
|
||||
}
|
||||
if (sourceFile) {
|
||||
env.parseFile(new ClassFile(file));
|
||||
env.parseFile(ClassFile.newClassFile(file));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
env.error(0, "cant.write", file.toString());
|
||||
|
|
|
@ -443,3 +443,4 @@ b1c2dd843f247a1db19e1e85eb62ca405f72dc26 jdk9-b37
|
|||
c363a8b87e477ee45d6d3cb2a36cb365141bc596 jdk9-b38
|
||||
9cb75e5e394827ccbaf2e15524108a412dc4ddc5 jdk9-b39
|
||||
6b09b3193d731e3288e2a240c504a20d0a06c766 jdk9-b40
|
||||
1d29b13e8a515a7ea3b882f140576d5d675bc11f jdk9-b41
|
||||
|
|
|
@ -36,12 +36,9 @@ import sun.jvm.hotspot.runtime.*;
|
|||
<li> Generation
|
||||
<ul>
|
||||
<li> CardGeneration
|
||||
<ul>
|
||||
<li> OneContigSpaceCardGeneration
|
||||
<ul>
|
||||
<li> TenuredGeneration
|
||||
</ul>
|
||||
</ul>
|
||||
<li> DefNewGeneration
|
||||
</ul>
|
||||
</ul>
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.memory;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import sun.jvm.hotspot.debugger.*;
|
||||
import sun.jvm.hotspot.runtime.*;
|
||||
import sun.jvm.hotspot.types.*;
|
||||
|
||||
/** <P> OneSpaceOldGeneration models a heap of old objects contained
|
||||
in a single contiguous space. </P>
|
||||
|
||||
<P> Garbage collection is performed using mark-compact. </P> */
|
||||
|
||||
public abstract class OneContigSpaceCardGeneration extends CardGeneration {
|
||||
private static AddressField theSpaceField;
|
||||
|
||||
static {
|
||||
VM.registerVMInitializedObserver(new Observer() {
|
||||
public void update(Observable o, Object data) {
|
||||
initialize(VM.getVM().getTypeDataBase());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static synchronized void initialize(TypeDataBase db) {
|
||||
Type type = db.lookupType("OneContigSpaceCardGeneration");
|
||||
|
||||
theSpaceField = type.getAddressField("_the_space");
|
||||
}
|
||||
|
||||
public OneContigSpaceCardGeneration(Address addr) {
|
||||
super(addr);
|
||||
}
|
||||
|
||||
public ContiguousSpace theSpace() {
|
||||
return (ContiguousSpace) VMObjectFactory.newObject(ContiguousSpace.class, theSpaceField.getValue(addr));
|
||||
}
|
||||
|
||||
public boolean isIn(Address p) {
|
||||
return theSpace().contains(p);
|
||||
}
|
||||
|
||||
/** Space queries */
|
||||
public long capacity() { return theSpace().capacity(); }
|
||||
public long used() { return theSpace().used(); }
|
||||
public long free() { return theSpace().free(); }
|
||||
public long contiguousAvailable() { return theSpace().free() + virtualSpace().uncommittedSize(); }
|
||||
|
||||
public void spaceIterate(SpaceClosure blk, boolean usedOnly) {
|
||||
blk.doSpace(theSpace());
|
||||
}
|
||||
|
||||
public void printOn(PrintStream tty) {
|
||||
tty.print(" old ");
|
||||
theSpace().printOn(tty);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 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
|
||||
|
@ -24,13 +24,62 @@
|
|||
|
||||
package sun.jvm.hotspot.memory;
|
||||
|
||||
import sun.jvm.hotspot.debugger.*;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import sun.jvm.hotspot.debugger.*;
|
||||
import sun.jvm.hotspot.runtime.*;
|
||||
import sun.jvm.hotspot.types.*;
|
||||
|
||||
/** <P> TenuredGeneration models a heap of old objects contained
|
||||
in a single contiguous space. </P>
|
||||
|
||||
<P> Garbage collection is performed using mark-compact. </P> */
|
||||
|
||||
public class TenuredGeneration extends CardGeneration {
|
||||
private static AddressField theSpaceField;
|
||||
|
||||
static {
|
||||
VM.registerVMInitializedObserver(new Observer() {
|
||||
public void update(Observable o, Object data) {
|
||||
initialize(VM.getVM().getTypeDataBase());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static synchronized void initialize(TypeDataBase db) {
|
||||
Type type = db.lookupType("TenuredGeneration");
|
||||
|
||||
theSpaceField = type.getAddressField("_the_space");
|
||||
}
|
||||
|
||||
public class TenuredGeneration extends OneContigSpaceCardGeneration {
|
||||
public TenuredGeneration(Address addr) {
|
||||
super(addr);
|
||||
}
|
||||
|
||||
public ContiguousSpace theSpace() {
|
||||
return (ContiguousSpace) VMObjectFactory.newObject(ContiguousSpace.class, theSpaceField.getValue(addr));
|
||||
}
|
||||
|
||||
public boolean isIn(Address p) {
|
||||
return theSpace().contains(p);
|
||||
}
|
||||
|
||||
/** Space queries */
|
||||
public long capacity() { return theSpace().capacity(); }
|
||||
public long used() { return theSpace().used(); }
|
||||
public long free() { return theSpace().free(); }
|
||||
public long contiguousAvailable() { return theSpace().free() + virtualSpace().uncommittedSize(); }
|
||||
|
||||
public void spaceIterate(SpaceClosure blk, boolean usedOnly) {
|
||||
blk.doSpace(theSpace());
|
||||
}
|
||||
|
||||
public void printOn(PrintStream tty) {
|
||||
tty.print(" old ");
|
||||
theSpace().printOn(tty);
|
||||
}
|
||||
|
||||
public Generation.Name kind() {
|
||||
return Generation.Name.MARK_SWEEP_COMPACT;
|
||||
}
|
||||
|
|
|
@ -65,6 +65,10 @@ else
|
|||
SA_CLASSPATH=$(shell test -f $(ALT_SA_CLASSPATH) && echo $(ALT_SA_CLASSPATH))
|
||||
endif
|
||||
|
||||
ifneq ($(SA_CLASSPATH),)
|
||||
SA_CLASSPATH_ARG := -classpath $(SA_CLASSPATH)
|
||||
endif
|
||||
|
||||
# TODO: if it's a modules image, check if SA module is installed.
|
||||
MODULELIB_PATH= $(BOOT_JAVA_HOME)/lib/modules
|
||||
|
||||
|
@ -116,7 +120,7 @@ $(GENERATED)/sa-jdi.jar: $(AGENT_FILES)
|
|||
# are in AGENT_FILES, so use the shell to expand them.
|
||||
# Be extra carefull to not produce too long command lines in the shell!
|
||||
$(foreach file,$(AGENT_FILES),$(shell ls -1 $(file) >> $(AGENT_FILES_LIST)))
|
||||
$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)
|
||||
$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) $(SA_CLASSPATH_ARG) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)
|
||||
$(QUIETLY) $(REMOTE) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
|
||||
$(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
|
||||
$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js
|
||||
|
|
|
@ -214,7 +214,7 @@ ifeq ($(USE_CLANG), true)
|
|||
WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
|
||||
endif
|
||||
|
||||
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2
|
||||
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type
|
||||
|
||||
ifeq ($(USE_CLANG),)
|
||||
# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#define CPU_PPC_VM_MACROASSEMBLER_PPC_HPP
|
||||
|
||||
#include "asm/assembler.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
// MacroAssembler extends Assembler by a few frequently used macros.
|
||||
|
||||
|
|
|
@ -4813,6 +4813,7 @@ class StubGenerator: public StubCodeGenerator {
|
|||
StubRoutines::_atomic_add_entry = generate_atomic_add();
|
||||
StubRoutines::_atomic_xchg_ptr_entry = StubRoutines::_atomic_xchg_entry;
|
||||
StubRoutines::_atomic_cmpxchg_ptr_entry = StubRoutines::_atomic_cmpxchg_entry;
|
||||
StubRoutines::_atomic_cmpxchg_byte_entry = ShouldNotCallThisStub();
|
||||
StubRoutines::_atomic_cmpxchg_long_entry = generate_atomic_cmpxchg_long();
|
||||
StubRoutines::_atomic_add_ptr_entry = StubRoutines::_atomic_add_entry;
|
||||
#endif // COMPILER2 !=> _LP64
|
||||
|
|
|
@ -1297,6 +1297,17 @@ void Assembler::cmpxchgl(Register reg, Address adr) { // cmpxchg
|
|||
emit_operand(reg, adr);
|
||||
}
|
||||
|
||||
// The 8-bit cmpxchg compares the value at adr with the contents of rax,
|
||||
// and stores reg into adr if so; otherwise, the value at adr is loaded into rax,.
|
||||
// The ZF is set if the compared values were equal, and cleared otherwise.
|
||||
void Assembler::cmpxchgb(Register reg, Address adr) { // cmpxchg
|
||||
InstructionMark im(this);
|
||||
prefix(adr, reg, true);
|
||||
emit_int8(0x0F);
|
||||
emit_int8((unsigned char)0xB0);
|
||||
emit_operand(reg, adr);
|
||||
}
|
||||
|
||||
void Assembler::comisd(XMMRegister dst, Address src) {
|
||||
// NOTE: dbx seems to decode this as comiss even though the
|
||||
// 0x66 is there. Strangly ucomisd comes out correct
|
||||
|
|
|
@ -1006,6 +1006,7 @@ private:
|
|||
|
||||
void cmpxchg8 (Address adr);
|
||||
|
||||
void cmpxchgb(Register reg, Address adr);
|
||||
void cmpxchgl(Register reg, Address adr);
|
||||
|
||||
void cmpxchgq(Register reg, Address adr);
|
||||
|
|
|
@ -594,7 +594,33 @@ class StubGenerator: public StubCodeGenerator {
|
|||
return start;
|
||||
}
|
||||
|
||||
// Support for jint atomic::atomic_cmpxchg_long(jlong exchange_value,
|
||||
// Support for jbyte atomic::atomic_cmpxchg(jbyte exchange_value, volatile jbyte* dest,
|
||||
// jbyte compare_value)
|
||||
//
|
||||
// Arguments :
|
||||
// c_rarg0: exchange_value
|
||||
// c_rarg1: dest
|
||||
// c_rarg2: compare_value
|
||||
//
|
||||
// Result:
|
||||
// if ( compare_value == *dest ) {
|
||||
// *dest = exchange_value
|
||||
// return compare_value;
|
||||
// else
|
||||
// return *dest;
|
||||
address generate_atomic_cmpxchg_byte() {
|
||||
StubCodeMark mark(this, "StubRoutines", "atomic_cmpxchg_byte");
|
||||
address start = __ pc();
|
||||
|
||||
__ movsbq(rax, c_rarg2);
|
||||
if ( os::is_MP() ) __ lock();
|
||||
__ cmpxchgb(c_rarg0, Address(c_rarg1, 0));
|
||||
__ ret(0);
|
||||
|
||||
return start;
|
||||
}
|
||||
|
||||
// Support for jlong atomic::atomic_cmpxchg(jlong exchange_value,
|
||||
// volatile jlong* dest,
|
||||
// jlong compare_value)
|
||||
// Arguments :
|
||||
|
@ -3894,6 +3920,7 @@ class StubGenerator: public StubCodeGenerator {
|
|||
StubRoutines::_atomic_xchg_entry = generate_atomic_xchg();
|
||||
StubRoutines::_atomic_xchg_ptr_entry = generate_atomic_xchg_ptr();
|
||||
StubRoutines::_atomic_cmpxchg_entry = generate_atomic_cmpxchg();
|
||||
StubRoutines::_atomic_cmpxchg_byte_entry = generate_atomic_cmpxchg_byte();
|
||||
StubRoutines::_atomic_cmpxchg_long_entry = generate_atomic_cmpxchg_long();
|
||||
StubRoutines::_atomic_add_entry = generate_atomic_add();
|
||||
StubRoutines::_atomic_add_ptr_entry = generate_atomic_add_ptr();
|
||||
|
|
|
@ -1210,6 +1210,7 @@ uint MachSpillCopyNode::implementation( CodeBuffer *cbuf, PhaseRegAlloc *ra_, bo
|
|||
|
||||
|
||||
Unimplemented();
|
||||
return 0; // Mute compiler
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
|
|
@ -207,6 +207,7 @@ class StubGenerator: public StubCodeGenerator {
|
|||
StubRoutines::_atomic_xchg_ptr_entry = ShouldNotCallThisStub();
|
||||
StubRoutines::_atomic_cmpxchg_entry = ShouldNotCallThisStub();
|
||||
StubRoutines::_atomic_cmpxchg_ptr_entry = ShouldNotCallThisStub();
|
||||
StubRoutines::_atomic_cmpxchg_byte_entry = ShouldNotCallThisStub();
|
||||
StubRoutines::_atomic_cmpxchg_long_entry = ShouldNotCallThisStub();
|
||||
StubRoutines::_atomic_add_entry = ShouldNotCallThisStub();
|
||||
StubRoutines::_atomic_add_ptr_entry = ShouldNotCallThisStub();
|
||||
|
|
|
@ -518,15 +518,13 @@ void os::init_system_properties_values() {
|
|||
|
||||
#define DEFAULT_LIBPATH "/usr/lib:/lib"
|
||||
#define EXTENSIONS_DIR "/lib/ext"
|
||||
#define ENDORSED_DIR "/lib/endorsed"
|
||||
|
||||
// Buffer that fits several sprintfs.
|
||||
// Note that the space for the trailing null is provided
|
||||
// by the nulls included by the sizeof operator.
|
||||
const size_t bufsize =
|
||||
MAX3((size_t)MAXPATHLEN, // For dll_dir & friends.
|
||||
(size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR), // extensions dir
|
||||
(size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
|
||||
MAX2((size_t)MAXPATHLEN, // For dll_dir & friends.
|
||||
(size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR)); // extensions dir
|
||||
char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
|
||||
|
||||
// sysclasspath, java_home, dll_dir
|
||||
|
@ -577,15 +575,10 @@ void os::init_system_properties_values() {
|
|||
sprintf(buf, "%s" EXTENSIONS_DIR, Arguments::get_java_home());
|
||||
Arguments::set_ext_dirs(buf);
|
||||
|
||||
// Endorsed standards default directory.
|
||||
sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
|
||||
Arguments::set_endorsed_dirs(buf);
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, buf);
|
||||
|
||||
#undef DEFAULT_LIBPATH
|
||||
#undef EXTENSIONS_DIR
|
||||
#undef ENDORSED_DIR
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -2788,6 +2781,10 @@ size_t os::read(int fd, void *buf, unsigned int nBytes) {
|
|||
return ::read(fd, buf, nBytes);
|
||||
}
|
||||
|
||||
size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
|
||||
return ::pread(fd, buf, nBytes, offset);
|
||||
}
|
||||
|
||||
void os::naked_short_sleep(jlong ms) {
|
||||
struct timespec req;
|
||||
|
||||
|
|
|
@ -422,7 +422,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
|||
// return the name of the user that owns the JVM indicated by the given vmid.
|
||||
//
|
||||
static char* get_user_name(int vmid, TRAPS) {
|
||||
return get_user_name_slow(vmid, CHECK_NULL);
|
||||
return get_user_name_slow(vmid, THREAD);
|
||||
}
|
||||
|
||||
// return the file name of the backing store file for the named
|
||||
|
|
|
@ -353,7 +353,6 @@ void os::init_system_properties_values() {
|
|||
// Base path of extensions installed on the system.
|
||||
#define SYS_EXT_DIR "/usr/java/packages"
|
||||
#define EXTENSIONS_DIR "/lib/ext"
|
||||
#define ENDORSED_DIR "/lib/endorsed"
|
||||
|
||||
#ifndef __APPLE__
|
||||
|
||||
|
@ -361,9 +360,8 @@ void os::init_system_properties_values() {
|
|||
// Note that the space for the colon and the trailing null are provided
|
||||
// by the nulls included by the sizeof operator.
|
||||
const size_t bufsize =
|
||||
MAX3((size_t)MAXPATHLEN, // For dll_dir & friends.
|
||||
(size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR), // extensions dir
|
||||
(size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
|
||||
MAX2((size_t)MAXPATHLEN, // For dll_dir & friends.
|
||||
(size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
|
||||
char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
|
||||
|
||||
// sysclasspath, java_home, dll_dir
|
||||
|
@ -425,10 +423,6 @@ void os::init_system_properties_values() {
|
|||
sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
|
||||
Arguments::set_ext_dirs(buf);
|
||||
|
||||
// Endorsed standards default directory.
|
||||
sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
|
||||
Arguments::set_endorsed_dirs(buf);
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, buf);
|
||||
|
||||
#else // __APPLE__
|
||||
|
@ -445,9 +439,8 @@ void os::init_system_properties_values() {
|
|||
// Note that the space for the colon and the trailing null are provided
|
||||
// by the nulls included by the sizeof operator.
|
||||
const size_t bufsize =
|
||||
MAX3((size_t)MAXPATHLEN, // for dll_dir & friends.
|
||||
(size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + system_ext_size, // extensions dir
|
||||
(size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
|
||||
MAX2((size_t)MAXPATHLEN, // for dll_dir & friends.
|
||||
(size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + system_ext_size); // extensions dir
|
||||
char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
|
||||
|
||||
// sysclasspath, java_home, dll_dir
|
||||
|
@ -525,10 +518,6 @@ void os::init_system_properties_values() {
|
|||
user_home_dir, Arguments::get_java_home());
|
||||
Arguments::set_ext_dirs(buf);
|
||||
|
||||
// Endorsed standards default directory.
|
||||
sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
|
||||
Arguments::set_endorsed_dirs(buf);
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, buf);
|
||||
|
||||
#undef SYS_EXTENSIONS_DIR
|
||||
|
@ -538,7 +527,6 @@ void os::init_system_properties_values() {
|
|||
|
||||
#undef SYS_EXT_DIR
|
||||
#undef EXTENSIONS_DIR
|
||||
#undef ENDORSED_DIR
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -2576,6 +2564,10 @@ size_t os::read(int fd, void *buf, unsigned int nBytes) {
|
|||
RESTARTABLE_RETURN_INT(::read(fd, buf, nBytes));
|
||||
}
|
||||
|
||||
size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
|
||||
RESTARTABLE_RETURN_INT(::pread(fd, buf, nBytes, offset));
|
||||
}
|
||||
|
||||
void os::naked_short_sleep(jlong ms) {
|
||||
struct timespec req;
|
||||
|
||||
|
|
|
@ -422,7 +422,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
|||
// return the name of the user that owns the JVM indicated by the given vmid.
|
||||
//
|
||||
static char* get_user_name(int vmid, TRAPS) {
|
||||
return get_user_name_slow(vmid, CHECK_NULL);
|
||||
return get_user_name_slow(vmid, THREAD);
|
||||
}
|
||||
|
||||
// return the file name of the backing store file for the named
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
#include "utilities/events.hpp"
|
||||
#include "utilities/elfFile.hpp"
|
||||
#include "utilities/growableArray.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
#include "utilities/vmError.hpp"
|
||||
|
||||
// put OS-includes here
|
||||
|
@ -337,15 +338,13 @@ void os::init_system_properties_values() {
|
|||
// Base path of extensions installed on the system.
|
||||
#define SYS_EXT_DIR "/usr/java/packages"
|
||||
#define EXTENSIONS_DIR "/lib/ext"
|
||||
#define ENDORSED_DIR "/lib/endorsed"
|
||||
|
||||
// Buffer that fits several sprintfs.
|
||||
// Note that the space for the colon and the trailing null are provided
|
||||
// by the nulls included by the sizeof operator.
|
||||
const size_t bufsize =
|
||||
MAX3((size_t)MAXPATHLEN, // For dll_dir & friends.
|
||||
(size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR), // extensions dir
|
||||
(size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
|
||||
MAX2((size_t)MAXPATHLEN, // For dll_dir & friends.
|
||||
(size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
|
||||
char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
|
||||
|
||||
// sysclasspath, java_home, dll_dir
|
||||
|
@ -410,16 +409,11 @@ void os::init_system_properties_values() {
|
|||
sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
|
||||
Arguments::set_ext_dirs(buf);
|
||||
|
||||
// Endorsed standards default directory.
|
||||
sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
|
||||
Arguments::set_endorsed_dirs(buf);
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, buf);
|
||||
|
||||
#undef DEFAULT_LIBPATH
|
||||
#undef SYS_EXT_DIR
|
||||
#undef EXTENSIONS_DIR
|
||||
#undef ENDORSED_DIR
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -3783,6 +3777,10 @@ size_t os::read(int fd, void *buf, unsigned int nBytes) {
|
|||
return ::read(fd, buf, nBytes);
|
||||
}
|
||||
|
||||
size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
|
||||
return ::pread(fd, buf, nBytes, offset);
|
||||
}
|
||||
|
||||
// Short sleep, direct OS call.
|
||||
//
|
||||
// Note: certain versions of Linux CFS scheduler (since 2.6.23) do not guarantee
|
||||
|
|
|
@ -422,7 +422,7 @@ static char* get_user_name_slow(int vmid, TRAPS) {
|
|||
// return the name of the user that owns the JVM indicated by the given vmid.
|
||||
//
|
||||
static char* get_user_name(int vmid, TRAPS) {
|
||||
return get_user_name_slow(vmid, CHECK_NULL);
|
||||
return get_user_name_slow(vmid, THREAD);
|
||||
}
|
||||
|
||||
// return the file name of the backing store file for the named
|
||||
|
|
|
@ -609,17 +609,15 @@ void os::init_system_properties_values() {
|
|||
// Base path of extensions installed on the system.
|
||||
#define SYS_EXT_DIR "/usr/jdk/packages"
|
||||
#define EXTENSIONS_DIR "/lib/ext"
|
||||
#define ENDORSED_DIR "/lib/endorsed"
|
||||
|
||||
char cpu_arch[12];
|
||||
// Buffer that fits several sprintfs.
|
||||
// Note that the space for the colon and the trailing null are provided
|
||||
// by the nulls included by the sizeof operator.
|
||||
const size_t bufsize =
|
||||
MAX4((size_t)MAXPATHLEN, // For dll_dir & friends.
|
||||
MAX3((size_t)MAXPATHLEN, // For dll_dir & friends.
|
||||
sizeof(SYS_EXT_DIR) + sizeof("/lib/") + strlen(cpu_arch), // invariant ld_library_path
|
||||
(size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR), // extensions dir
|
||||
(size_t)MAXPATHLEN + sizeof(ENDORSED_DIR)); // endorsed dir
|
||||
(size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
|
||||
char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
|
||||
|
||||
// sysclasspath, java_home, dll_dir
|
||||
|
@ -765,15 +763,10 @@ void os::init_system_properties_values() {
|
|||
sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
|
||||
Arguments::set_ext_dirs(buf);
|
||||
|
||||
// Endorsed standards default directory.
|
||||
sprintf(buf, "%s" ENDORSED_DIR, Arguments::get_java_home());
|
||||
Arguments::set_endorsed_dirs(buf);
|
||||
|
||||
FREE_C_HEAP_ARRAY(char, buf);
|
||||
|
||||
#undef SYS_EXT_DIR
|
||||
#undef EXTENSIONS_DIR
|
||||
#undef ENDORSED_DIR
|
||||
}
|
||||
|
||||
void os::breakpoint() {
|
||||
|
@ -3167,6 +3160,15 @@ size_t os::read(int fd, void *buf, unsigned int nBytes) {
|
|||
return res;
|
||||
}
|
||||
|
||||
size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
|
||||
size_t res;
|
||||
JavaThread* thread = (JavaThread*)Thread::current();
|
||||
assert(thread->thread_state() == _thread_in_vm, "Assumed _thread_in_vm");
|
||||
ThreadBlockInVM tbiv(thread);
|
||||
RESTARTABLE(::pread(fd, buf, (size_t) nBytes, offset), res);
|
||||
return res;
|
||||
}
|
||||
|
||||
size_t os::restartable_read(int fd, void *buf, unsigned int nBytes) {
|
||||
size_t res;
|
||||
assert(((JavaThread*)Thread::current())->thread_state() == _thread_in_native,
|
||||
|
|
|
@ -461,7 +461,7 @@ static char* get_user_name(int vmid, TRAPS) {
|
|||
// since the structured procfs and old procfs interfaces can't be
|
||||
// mixed, we attempt to find the file through a directory search.
|
||||
|
||||
return get_user_name_slow(vmid, CHECK_NULL);
|
||||
return get_user_name_slow(vmid, THREAD);
|
||||
}
|
||||
|
||||
// return the file name of the backing store file for the named
|
||||
|
|
|
@ -292,19 +292,6 @@ void os::init_system_properties_values() {
|
|||
#undef BIN_DIR
|
||||
#undef PACKAGE_DIR
|
||||
|
||||
// Default endorsed standards directory.
|
||||
{
|
||||
#define ENDORSED_DIR "\\lib\\endorsed"
|
||||
size_t len = strlen(Arguments::get_java_home()) + sizeof(ENDORSED_DIR);
|
||||
char * buf = NEW_C_HEAP_ARRAY(char, len, mtInternal);
|
||||
sprintf(buf, "%s%s", Arguments::get_java_home(), ENDORSED_DIR);
|
||||
Arguments::set_endorsed_dirs(buf);
|
||||
// (Arguments::set_endorsed_dirs() calls SystemProperty::set_value(), which
|
||||
// duplicates the input.)
|
||||
FREE_C_HEAP_ARRAY(char, buf);
|
||||
#undef ENDORSED_DIR
|
||||
}
|
||||
|
||||
#ifndef _WIN64
|
||||
// set our UnhandledExceptionFilter and save any previous one
|
||||
prev_uef_handler = SetUnhandledExceptionFilter(Handle_FLT_Exception);
|
||||
|
@ -4391,6 +4378,23 @@ jlong os::lseek(int fd, jlong offset, int whence) {
|
|||
return (jlong) ::_lseeki64(fd, offset, whence);
|
||||
}
|
||||
|
||||
size_t os::read_at(int fd, void *buf, unsigned int nBytes, jlong offset) {
|
||||
OVERLAPPED ov;
|
||||
DWORD nread;
|
||||
BOOL result;
|
||||
|
||||
ZeroMemory(&ov, sizeof(ov));
|
||||
ov.Offset = (DWORD)offset;
|
||||
ov.OffsetHigh = (DWORD)(offset >> 32);
|
||||
|
||||
HANDLE h = (HANDLE)::_get_osfhandle(fd);
|
||||
|
||||
result = ReadFile(h, (LPVOID)buf, nBytes, &nread, &ov);
|
||||
|
||||
return result ? nread : 0;
|
||||
}
|
||||
|
||||
|
||||
// This method is a slightly reworked copy of JDK's sysNativePath
|
||||
// from src/windows/hpi/src/path_md.c
|
||||
|
||||
|
|
|
@ -88,6 +88,15 @@ inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* des
|
|||
return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest);
|
||||
}
|
||||
|
||||
#define VM_HAS_SPECIALIZED_CMPXCHG_BYTE
|
||||
inline jbyte Atomic::cmpxchg (jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) {
|
||||
int mp = os::is_MP();
|
||||
__asm__ volatile (LOCK_IF_MP(%4) "cmpxchgb %1,(%3)"
|
||||
: "=a" (exchange_value)
|
||||
: "q" (exchange_value), "a" (compare_value), "r" (dest), "r" (mp)
|
||||
: "cc", "memory");
|
||||
return exchange_value;
|
||||
}
|
||||
|
||||
inline jint Atomic::cmpxchg (jint exchange_value, volatile jint* dest, jint compare_value) {
|
||||
int mp = os::is_MP();
|
||||
|
|
|
@ -88,6 +88,15 @@ inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* des
|
|||
return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest);
|
||||
}
|
||||
|
||||
#define VM_HAS_SPECIALIZED_CMPXCHG_BYTE
|
||||
inline jbyte Atomic::cmpxchg (jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) {
|
||||
int mp = os::is_MP();
|
||||
__asm__ volatile (LOCK_IF_MP(%4) "cmpxchgb %1,(%3)"
|
||||
: "=a" (exchange_value)
|
||||
: "q" (exchange_value), "a" (compare_value), "r" (dest), "r" (mp)
|
||||
: "cc", "memory");
|
||||
return exchange_value;
|
||||
}
|
||||
|
||||
inline jint Atomic::cmpxchg (jint exchange_value, volatile jint* dest, jint compare_value) {
|
||||
int mp = os::is_MP();
|
||||
|
|
|
@ -542,6 +542,7 @@ JVM_handle_linux_signal(int sig,
|
|||
err.report_and_die();
|
||||
|
||||
ShouldNotReachHere();
|
||||
return true; // Mute compiler
|
||||
}
|
||||
|
||||
void os::Linux::init_thread_fpu_state(void) {
|
||||
|
|
|
@ -68,6 +68,8 @@ inline void Atomic::dec_ptr(volatile void* dest) { (void)add_ptr(-1, dest);
|
|||
extern "C" {
|
||||
jint _Atomic_add(jint add_value, volatile jint* dest IS_MP_DECL());
|
||||
jint _Atomic_xchg(jint exchange_value, volatile jint* dest);
|
||||
jbyte _Atomic_cmpxchg_byte(jbyte exchange_value, volatile jbyte* dest,
|
||||
jbyte compare_value IS_MP_DECL());
|
||||
jint _Atomic_cmpxchg(jint exchange_value, volatile jint* dest,
|
||||
jint compare_value IS_MP_DECL());
|
||||
jlong _Atomic_cmpxchg_long(jlong exchange_value, volatile jlong* dest,
|
||||
|
@ -82,6 +84,11 @@ inline jint Atomic::xchg (jint exchange_value, volatile jint*
|
|||
return _Atomic_xchg(exchange_value, dest);
|
||||
}
|
||||
|
||||
#define VM_HAS_SPECIALIZED_CMPXCHG_BYTE
|
||||
inline jbyte Atomic::cmpxchg (jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) {
|
||||
return _Atomic_cmpxchg_byte(exchange_value, dest, compare_value IS_MP_ARG());
|
||||
}
|
||||
|
||||
inline jint Atomic::cmpxchg (jint exchange_value, volatile jint* dest, jint compare_value) {
|
||||
return _Atomic_cmpxchg(exchange_value, dest, compare_value IS_MP_ARG());
|
||||
}
|
||||
|
@ -217,6 +224,15 @@ extern "C" {
|
|||
return exchange_value;
|
||||
}
|
||||
|
||||
|
||||
inline jbyte _Atomic_cmpxchg_byte(jbyte exchange_value, volatile jbyte* dest, jbyte compare_value, int mp) {
|
||||
__asm__ volatile (LOCK_IF_MP(%4) "cmpxchgb %1,(%3)"
|
||||
: "=a" (exchange_value)
|
||||
: "q" (exchange_value), "a" (compare_value), "r" (dest), "r" (mp)
|
||||
: "cc", "memory");
|
||||
return exchange_value;
|
||||
}
|
||||
|
||||
// This is the interface to the atomic instruction in solaris_i486.s.
|
||||
jlong _Atomic_cmpxchg_long_gcc(jlong exchange_value, volatile jlong* dest, jlong compare_value, int mp);
|
||||
|
||||
|
|
|
@ -76,6 +76,23 @@
|
|||
xchgl (%ecx), %eax
|
||||
.end
|
||||
|
||||
// Support for jbyte Atomic::cmpxchg(jbyte exchange_value,
|
||||
// volatile jbyte *dest,
|
||||
// jbyte compare_value)
|
||||
// An additional bool (os::is_MP()) is passed as the last argument.
|
||||
.inline _Atomic_cmpxchg_byte,4
|
||||
movb 8(%esp), %al // compare_value
|
||||
movb 0(%esp), %cl // exchange_value
|
||||
movl 4(%esp), %edx // dest
|
||||
cmp $0, 12(%esp) // MP test
|
||||
jne 1f
|
||||
cmpxchgb %cl, (%edx)
|
||||
jmp 2f
|
||||
1: lock
|
||||
cmpxchgb %cl, (%edx)
|
||||
2:
|
||||
.end
|
||||
|
||||
// Support for jint Atomic::cmpxchg(jint exchange_value,
|
||||
// volatile jint *dest,
|
||||
// jint compare_value)
|
||||
|
|
|
@ -77,6 +77,15 @@
|
|||
movq %rdi, %rax
|
||||
.end
|
||||
|
||||
// Support for jbyte Atomic::cmpxchg(jbyte exchange_value,
|
||||
// volatile jbyte *dest,
|
||||
// jbyte compare_value)
|
||||
.inline _Atomic_cmpxchg_byte,3
|
||||
movb %dl, %al // compare_value
|
||||
lock
|
||||
cmpxchgb %dil, (%rsi)
|
||||
.end
|
||||
|
||||
// Support for jint Atomic::cmpxchg(jint exchange_value,
|
||||
// volatile jint *dest,
|
||||
// jint compare_value)
|
||||
|
|
|
@ -123,6 +123,11 @@ inline jint Atomic::cmpxchg (jint exchange_value, volatile jint*
|
|||
return (*os::atomic_cmpxchg_func)(exchange_value, dest, compare_value);
|
||||
}
|
||||
|
||||
#define VM_HAS_SPECIALIZED_CMPXCHG_BYTE
|
||||
inline jbyte Atomic::cmpxchg (jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) {
|
||||
return (*os::atomic_cmpxchg_byte_func)(exchange_value, dest, compare_value);
|
||||
}
|
||||
|
||||
inline jlong Atomic::cmpxchg (jlong exchange_value, volatile jlong* dest, jlong compare_value) {
|
||||
return (*os::atomic_cmpxchg_long_func)(exchange_value, dest, compare_value);
|
||||
}
|
||||
|
@ -212,6 +217,19 @@ inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* des
|
|||
return (void*)xchg((jint)exchange_value, (volatile jint*)dest);
|
||||
}
|
||||
|
||||
#define VM_HAS_SPECIALIZED_CMPXCHG_BYTE
|
||||
inline jbyte Atomic::cmpxchg (jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) {
|
||||
// alternative for InterlockedCompareExchange
|
||||
int mp = os::is_MP();
|
||||
__asm {
|
||||
mov edx, dest
|
||||
mov cl, exchange_value
|
||||
mov al, compare_value
|
||||
LOCK_IF_MP(mp)
|
||||
cmpxchg byte ptr [edx], cl
|
||||
}
|
||||
}
|
||||
|
||||
inline jint Atomic::cmpxchg (jint exchange_value, volatile jint* dest, jint compare_value) {
|
||||
// alternative for InterlockedCompareExchange
|
||||
int mp = os::is_MP();
|
||||
|
|
|
@ -220,6 +220,7 @@ void os::initialize_thread(Thread* thr) {
|
|||
typedef jint xchg_func_t (jint, volatile jint*);
|
||||
typedef intptr_t xchg_ptr_func_t (intptr_t, volatile intptr_t*);
|
||||
typedef jint cmpxchg_func_t (jint, volatile jint*, jint);
|
||||
typedef jbyte cmpxchg_byte_func_t (jbyte, volatile jbyte*, jbyte);
|
||||
typedef jlong cmpxchg_long_func_t (jlong, volatile jlong*, jlong);
|
||||
typedef jint add_func_t (jint, volatile jint*);
|
||||
typedef intptr_t add_ptr_func_t (intptr_t, volatile intptr_t*);
|
||||
|
@ -272,6 +273,23 @@ jint os::atomic_cmpxchg_bootstrap(jint exchange_value, volatile jint* dest, jint
|
|||
*dest = exchange_value;
|
||||
return old_value;
|
||||
}
|
||||
|
||||
jbyte os::atomic_cmpxchg_byte_bootstrap(jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) {
|
||||
// try to use the stub:
|
||||
cmpxchg_byte_func_t* func = CAST_TO_FN_PTR(cmpxchg_byte_func_t*, StubRoutines::atomic_cmpxchg_byte_entry());
|
||||
|
||||
if (func != NULL) {
|
||||
os::atomic_cmpxchg_byte_func = func;
|
||||
return (*func)(exchange_value, dest, compare_value);
|
||||
}
|
||||
assert(Threads::number_of_threads() == 0, "for bootstrap only");
|
||||
|
||||
jbyte old_value = *dest;
|
||||
if (old_value == compare_value)
|
||||
*dest = exchange_value;
|
||||
return old_value;
|
||||
}
|
||||
|
||||
#endif // AMD64
|
||||
|
||||
jlong os::atomic_cmpxchg_long_bootstrap(jlong exchange_value, volatile jlong* dest, jlong compare_value) {
|
||||
|
@ -321,6 +339,7 @@ intptr_t os::atomic_add_ptr_bootstrap(intptr_t add_value, volatile intptr_t* des
|
|||
xchg_func_t* os::atomic_xchg_func = os::atomic_xchg_bootstrap;
|
||||
xchg_ptr_func_t* os::atomic_xchg_ptr_func = os::atomic_xchg_ptr_bootstrap;
|
||||
cmpxchg_func_t* os::atomic_cmpxchg_func = os::atomic_cmpxchg_bootstrap;
|
||||
cmpxchg_byte_func_t* os::atomic_cmpxchg_byte_func = os::atomic_cmpxchg_byte_bootstrap;
|
||||
add_func_t* os::atomic_add_func = os::atomic_add_bootstrap;
|
||||
add_ptr_func_t* os::atomic_add_ptr_func = os::atomic_add_ptr_bootstrap;
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
static intptr_t (*atomic_xchg_ptr_func) (intptr_t, volatile intptr_t*);
|
||||
|
||||
static jint (*atomic_cmpxchg_func) (jint, volatile jint*, jint);
|
||||
static jbyte (*atomic_cmpxchg_byte_func) (jbyte, volatile jbyte*, jbyte);
|
||||
static jlong (*atomic_cmpxchg_long_func) (jlong, volatile jlong*, jlong);
|
||||
|
||||
static jint (*atomic_add_func) (jint, volatile jint*);
|
||||
|
@ -42,6 +43,7 @@
|
|||
static intptr_t atomic_xchg_ptr_bootstrap (intptr_t, volatile intptr_t*);
|
||||
|
||||
static jint atomic_cmpxchg_bootstrap (jint, volatile jint*, jint);
|
||||
static jbyte atomic_cmpxchg_byte_bootstrap(jbyte, volatile jbyte*, jbyte);
|
||||
#else
|
||||
|
||||
static jlong (*atomic_cmpxchg_long_func) (jlong, volatile jlong*, jlong);
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#include "runtime/reflection.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/thread.inline.hpp"
|
||||
#include "trace/tracing.hpp"
|
||||
#include "utilities/dtrace.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
#ifdef COMPILER1
|
||||
|
@ -1141,6 +1142,16 @@ void ciEnv::record_failure(const char* reason) {
|
|||
}
|
||||
}
|
||||
|
||||
void ciEnv::report_failure(const char* reason) {
|
||||
// Create and fire JFR event
|
||||
EventCompilerFailure event;
|
||||
if (event.should_commit()) {
|
||||
event.set_compileID(compile_id());
|
||||
event.set_failure(reason);
|
||||
event.commit();
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciEnv::record_method_not_compilable()
|
||||
void ciEnv::record_method_not_compilable(const char* reason, bool all_tiers) {
|
||||
|
|
|
@ -450,7 +450,8 @@ public:
|
|||
// Check for changes to the system dictionary during compilation
|
||||
bool system_dictionary_modification_counter_changed();
|
||||
|
||||
void record_failure(const char* reason);
|
||||
void record_failure(const char* reason); // Record failure and report later
|
||||
void report_failure(const char* reason); // Report failure immediately
|
||||
void record_method_not_compilable(const char* reason, bool all_tiers = true);
|
||||
void record_out_of_memory_failure();
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/oop.inline2.hpp"
|
||||
#include "runtime/fieldType.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
#if INCLUDE_ALL_GCS
|
||||
# include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
|
||||
#endif
|
||||
|
|
|
@ -332,7 +332,7 @@ class CompileReplay : public StackObj {
|
|||
// Lookup a klass
|
||||
Klass* resolve_klass(const char* klass, TRAPS) {
|
||||
Symbol* klass_name = SymbolTable::lookup(klass, (int)strlen(klass), CHECK_NULL);
|
||||
return SystemDictionary::resolve_or_fail(klass_name, _loader, _protection_domain, true, CHECK_NULL);
|
||||
return SystemDictionary::resolve_or_fail(klass_name, _loader, _protection_domain, true, THREAD);
|
||||
}
|
||||
|
||||
// Parse the standard tuple of <klass> <name> <signature>
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
#include "interpreter/bytecode.hpp"
|
||||
#include "interpreter/bytecodes.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "opto/compile.hpp"
|
||||
#include "opto/node.hpp"
|
||||
#include "runtime/deoptimization.hpp"
|
||||
#include "utilities/growableArray.hpp"
|
||||
|
||||
|
@ -2646,7 +2648,7 @@ void ciTypeFlow::df_flow_types(Block* start,
|
|||
assert (!blk->has_pre_order(), "");
|
||||
blk->set_next_pre_order();
|
||||
|
||||
if (_next_pre_order >= MaxNodeLimit / 2) {
|
||||
if (_next_pre_order >= (int)Compile::current()->max_node_limit() / 2) {
|
||||
// Too many basic blocks. Bail out.
|
||||
// This can happen when try/finally constructs are nested to depth N,
|
||||
// and there is O(2**N) cloning of jsr bodies. See bug 4697245!
|
||||
|
|
|
@ -31,9 +31,6 @@
|
|||
#include "classfile/javaClasses.hpp"
|
||||
#include "classfile/symbolTable.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#if INCLUDE_CDS
|
||||
#include "classfile/systemDictionaryShared.hpp"
|
||||
#endif
|
||||
#include "classfile/verificationType.hpp"
|
||||
#include "classfile/verifier.hpp"
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
|
@ -63,7 +60,11 @@
|
|||
#include "services/threadService.hpp"
|
||||
#include "utilities/array.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
#include "utilities/ostream.hpp"
|
||||
#if INCLUDE_CDS
|
||||
#include "classfile/systemDictionaryShared.hpp"
|
||||
#endif
|
||||
|
||||
// We generally try to create the oops directly when parsing, rather than
|
||||
// allocating temporary data structures and copying the bytes twice. A
|
||||
|
|
|
@ -28,11 +28,8 @@
|
|||
#include "classfile/classLoader.hpp"
|
||||
#include "classfile/classLoaderExt.hpp"
|
||||
#include "classfile/classLoaderData.inline.hpp"
|
||||
#include "classfile/imageFile.hpp"
|
||||
#include "classfile/javaClasses.hpp"
|
||||
#if INCLUDE_CDS
|
||||
#include "classfile/sharedPathsMiscInfo.hpp"
|
||||
#include "classfile/sharedClassUtil.hpp"
|
||||
#endif
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
#include "compiler/compileBroker.hpp"
|
||||
|
@ -64,10 +61,15 @@
|
|||
#include "services/management.hpp"
|
||||
#include "services/threadService.hpp"
|
||||
#include "utilities/events.hpp"
|
||||
#include "utilities/hashtable.hpp"
|
||||
#include "utilities/hashtable.inline.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
#if INCLUDE_CDS
|
||||
#include "classfile/sharedPathsMiscInfo.hpp"
|
||||
#include "classfile/sharedClassUtil.hpp"
|
||||
#endif
|
||||
|
||||
// Entry points in zip.dll for loading zip/jar file entries
|
||||
|
||||
// Entry points in zip.dll for loading zip/jar file entries and image file entries
|
||||
|
||||
typedef void * * (JNICALL *ZipOpen_t)(const char *name, char **pmsg);
|
||||
typedef void (JNICALL *ZipClose_t)(jzfile *zip);
|
||||
|
@ -75,6 +77,7 @@ typedef jzentry* (JNICALL *FindEntry_t)(jzfile *zip, const char *name, jint *siz
|
|||
typedef jboolean (JNICALL *ReadEntry_t)(jzfile *zip, jzentry *entry, unsigned char *buf, char *namebuf);
|
||||
typedef jboolean (JNICALL *ReadMappedEntry_t)(jzfile *zip, jzentry *entry, unsigned char **buf, char *namebuf);
|
||||
typedef jzentry* (JNICALL *GetNextEntry_t)(jzfile *zip, jint n);
|
||||
typedef jboolean (JNICALL *ZipInflateFully_t)(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg);
|
||||
typedef jint (JNICALL *Crc32_t)(jint crc, const jbyte *buf, jint len);
|
||||
|
||||
static ZipOpen_t ZipOpen = NULL;
|
||||
|
@ -84,6 +87,7 @@ static ReadEntry_t ReadEntry = NULL;
|
|||
static ReadMappedEntry_t ReadMappedEntry = NULL;
|
||||
static GetNextEntry_t GetNextEntry = NULL;
|
||||
static canonicalize_fn_t CanonicalizeEntry = NULL;
|
||||
static ZipInflateFully_t ZipInflateFully = NULL;
|
||||
static Crc32_t Crc32 = NULL;
|
||||
|
||||
// Globals
|
||||
|
@ -322,6 +326,8 @@ LazyClassPathEntry::~LazyClassPathEntry() {
|
|||
}
|
||||
|
||||
bool LazyClassPathEntry::is_jar_file() {
|
||||
size_t len = strlen(_path);
|
||||
if (len < 4 || strcmp(_path + len - 4, ".jar") != 0) return false;
|
||||
return ((_st.st_mode & S_IFREG) == S_IFREG);
|
||||
}
|
||||
|
||||
|
@ -385,6 +391,78 @@ u1* LazyClassPathEntry::open_entry(const char* name, jint* filesize, bool nul_te
|
|||
}
|
||||
}
|
||||
|
||||
ClassPathImageEntry::ClassPathImageEntry(char* name) : ClassPathEntry(), _image(new ImageFile(name)) {
|
||||
bool opened = _image->open();
|
||||
if (!opened) {
|
||||
_image = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
ClassPathImageEntry::~ClassPathImageEntry() {
|
||||
if (_image) {
|
||||
_image->close();
|
||||
_image = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
const char* ClassPathImageEntry::name() {
|
||||
return _image ? _image->name() : "";
|
||||
}
|
||||
|
||||
ClassFileStream* ClassPathImageEntry::open_stream(const char* name, TRAPS) {
|
||||
u1* buffer;
|
||||
u8 size;
|
||||
_image->get_resource(name, buffer, size);
|
||||
|
||||
if (buffer) {
|
||||
if (UsePerfData) {
|
||||
ClassLoader::perf_sys_classfile_bytes_read()->inc(size);
|
||||
}
|
||||
return new ClassFileStream(buffer, (int)size, (char*)name); // Resource allocated
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
void ClassPathImageEntry::compile_the_world(Handle loader, TRAPS) {
|
||||
tty->print_cr("CompileTheWorld : Compiling all classes in %s", name());
|
||||
tty->cr();
|
||||
const ImageStrings strings = _image->get_strings();
|
||||
// Retrieve each path component string.
|
||||
u4 count = _image->get_location_count();
|
||||
for (u4 i = 0; i < count; i++) {
|
||||
u1* location_data = _image->get_location_data(i);
|
||||
|
||||
if (location_data) {
|
||||
ImageLocation location(location_data);
|
||||
const char* parent = location.get_attribute(ImageLocation::ATTRIBUTE_PARENT, strings);
|
||||
const char* base = location.get_attribute(ImageLocation::ATTRIBUTE_BASE, strings);
|
||||
const char* extension = location.get_attribute(ImageLocation::ATTRIBUTE_EXTENSION, strings);
|
||||
assert((strlen(parent) + strlen(base) + strlen(extension)) < JVM_MAXPATHLEN, "path exceeds buffer");
|
||||
char path[JVM_MAXPATHLEN];
|
||||
strcpy(path, parent);
|
||||
strcat(path, base);
|
||||
strcat(path, extension);
|
||||
ClassLoader::compile_the_world_in(path, loader, CHECK);
|
||||
}
|
||||
}
|
||||
if (HAS_PENDING_EXCEPTION) {
|
||||
if (PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())) {
|
||||
CLEAR_PENDING_EXCEPTION;
|
||||
tty->print_cr("\nCompileTheWorld : Ran out of memory\n");
|
||||
tty->print_cr("Increase class metadata storage if a limit was set");
|
||||
} else {
|
||||
tty->print_cr("\nCompileTheWorld : Unexpected exception occurred\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ClassPathImageEntry::is_jrt() {
|
||||
return string_ends_with(name(), "bootmodules.jimage");
|
||||
}
|
||||
#endif
|
||||
|
||||
static void print_meta_index(LazyClassPathEntry* entry,
|
||||
GrowableArray<char*>& meta_packages) {
|
||||
tty->print("[Meta index for %s=", entry->name());
|
||||
|
@ -634,7 +712,7 @@ ClassPathEntry* ClassLoader::create_class_path_entry(const char *path, const str
|
|||
}
|
||||
ClassPathEntry* new_entry = NULL;
|
||||
if ((st->st_mode & S_IFREG) == S_IFREG) {
|
||||
// Regular file, should be a zip file
|
||||
// Regular file, should be a zip or image file
|
||||
// Canonicalized filename
|
||||
char canonical_path[JVM_MAXPATHLEN];
|
||||
if (!get_canonical_path(path, canonical_path, JVM_MAXPATHLEN)) {
|
||||
|
@ -645,6 +723,11 @@ ClassPathEntry* ClassLoader::create_class_path_entry(const char *path, const str
|
|||
return NULL;
|
||||
}
|
||||
}
|
||||
// TODO - add proper criteria for selecting image file
|
||||
ClassPathImageEntry* entry = new ClassPathImageEntry(canonical_path);
|
||||
if (entry->is_open()) {
|
||||
new_entry = entry;
|
||||
} else {
|
||||
char* error_msg = NULL;
|
||||
jzfile* zip;
|
||||
{
|
||||
|
@ -655,9 +738,6 @@ ClassPathEntry* ClassLoader::create_class_path_entry(const char *path, const str
|
|||
}
|
||||
if (zip != NULL && error_msg == NULL) {
|
||||
new_entry = new ClassPathZipEntry(zip, path);
|
||||
if (TraceClassLoading || TraceClassPaths) {
|
||||
tty->print_cr("[Opened %s]", path);
|
||||
}
|
||||
} else {
|
||||
ResourceMark rm(thread);
|
||||
char *msg;
|
||||
|
@ -675,10 +755,14 @@ ClassPathEntry* ClassLoader::create_class_path_entry(const char *path, const str
|
|||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (TraceClassLoading || TraceClassPaths) {
|
||||
tty->print_cr("[Opened %s]", path);
|
||||
}
|
||||
} else {
|
||||
// Directory
|
||||
new_entry = new ClassPathDirEntry(path);
|
||||
if (TraceClassLoading || TraceClassPaths) {
|
||||
if (TraceClassLoading) {
|
||||
tty->print_cr("[Path %s]", path);
|
||||
}
|
||||
}
|
||||
|
@ -801,6 +885,7 @@ void ClassLoader::load_zip_library() {
|
|||
ReadEntry = CAST_TO_FN_PTR(ReadEntry_t, os::dll_lookup(handle, "ZIP_ReadEntry"));
|
||||
ReadMappedEntry = CAST_TO_FN_PTR(ReadMappedEntry_t, os::dll_lookup(handle, "ZIP_ReadMappedEntry"));
|
||||
GetNextEntry = CAST_TO_FN_PTR(GetNextEntry_t, os::dll_lookup(handle, "ZIP_GetNextEntry"));
|
||||
ZipInflateFully = CAST_TO_FN_PTR(ZipInflateFully_t, os::dll_lookup(handle, "ZIP_InflateFully"));
|
||||
Crc32 = CAST_TO_FN_PTR(Crc32_t, os::dll_lookup(handle, "ZIP_CRC32"));
|
||||
|
||||
// ZIP_Close is not exported on Windows in JDK5.0 so don't abort if ZIP_Close is NULL
|
||||
|
@ -809,12 +894,20 @@ void ClassLoader::load_zip_library() {
|
|||
vm_exit_during_initialization("Corrupted ZIP library", path);
|
||||
}
|
||||
|
||||
if (ZipInflateFully == NULL) {
|
||||
vm_exit_during_initialization("Corrupted ZIP library ZIP_InflateFully missing", path);
|
||||
}
|
||||
|
||||
// Lookup canonicalize entry in libjava.dll
|
||||
void *javalib_handle = os::native_java_library();
|
||||
CanonicalizeEntry = CAST_TO_FN_PTR(canonicalize_fn_t, os::dll_lookup(javalib_handle, "Canonicalize"));
|
||||
// This lookup only works on 1.3. Do not check for non-null here
|
||||
}
|
||||
|
||||
jboolean ClassLoader::decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg) {
|
||||
return (*ZipInflateFully)(in, inSize, out, outSize, pmsg);
|
||||
}
|
||||
|
||||
int ClassLoader::crc32(int crc, const char* buf, int len) {
|
||||
assert(Crc32 != NULL, "ZIP_CRC32 is not found");
|
||||
return (*Crc32)(crc, (const jbyte*)buf, len);
|
||||
|
@ -1367,8 +1460,7 @@ void ClassPathDirEntry::compile_the_world(Handle loader, TRAPS) {
|
|||
tty->cr();
|
||||
}
|
||||
|
||||
|
||||
bool ClassPathDirEntry::is_rt_jar() {
|
||||
bool ClassPathDirEntry::is_jrt() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1393,13 +1485,13 @@ void ClassPathZipEntry::compile_the_world(Handle loader, TRAPS) {
|
|||
}
|
||||
}
|
||||
|
||||
bool ClassPathZipEntry::is_rt_jar() {
|
||||
bool ClassPathZipEntry::is_jrt() {
|
||||
real_jzfile* zip = (real_jzfile*) _zip;
|
||||
int len = (int)strlen(zip->name);
|
||||
// Check whether zip name ends in "rt.jar"
|
||||
// This will match other archives named rt.jar as well, but this is
|
||||
// only used for debugging.
|
||||
return (len >= 6) && (strcasecmp(zip->name + len - 6, "rt.jar") == 0);
|
||||
return string_ends_with(zip->name, "rt.jar");
|
||||
}
|
||||
|
||||
void LazyClassPathEntry::compile_the_world(Handle loader, TRAPS) {
|
||||
|
@ -1409,7 +1501,7 @@ void LazyClassPathEntry::compile_the_world(Handle loader, TRAPS) {
|
|||
}
|
||||
}
|
||||
|
||||
bool LazyClassPathEntry::is_rt_jar() {
|
||||
bool LazyClassPathEntry::is_jrt() {
|
||||
Thread* THREAD = Thread::current();
|
||||
ClassPathEntry* cpe = resolve_entry(THREAD);
|
||||
return (cpe != NULL) ? cpe->is_jar_file() : false;
|
||||
|
@ -1428,7 +1520,7 @@ void ClassLoader::compile_the_world() {
|
|||
jlong start = os::javaTimeMillis();
|
||||
while (e != NULL) {
|
||||
// We stop at rt.jar, unless it is the first bootstrap path entry
|
||||
if (e->is_rt_jar() && e != _first_entry) break;
|
||||
if (e->is_jrt() && e != _first_entry) break;
|
||||
e->compile_the_world(system_class_loader, CATCH);
|
||||
e = e->next();
|
||||
}
|
||||
|
@ -1476,9 +1568,9 @@ static bool can_be_compiled(methodHandle m, int comp_level) {
|
|||
}
|
||||
|
||||
void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
|
||||
int len = (int)strlen(name);
|
||||
if (len > 6 && strcmp(".class", name + len - 6) == 0) {
|
||||
if (string_ends_with(name, ".class")) {
|
||||
// We have a .class file
|
||||
int len = (int)strlen(name);
|
||||
char buffer[2048];
|
||||
strncpy(buffer, name, len - 6);
|
||||
buffer[len-6] = 0;
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "classfile/classFileParser.hpp"
|
||||
#include "runtime/perfData.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
// The VM class loader.
|
||||
#include <sys/stat.h>
|
||||
|
@ -66,7 +67,7 @@ class ClassPathEntry: public CHeapObj<mtClass> {
|
|||
virtual ClassFileStream* open_stream(const char* name, TRAPS) = 0;
|
||||
// Debugging
|
||||
NOT_PRODUCT(virtual void compile_the_world(Handle loader, TRAPS) = 0;)
|
||||
NOT_PRODUCT(virtual bool is_rt_jar() = 0;)
|
||||
NOT_PRODUCT(virtual bool is_jrt() = 0;)
|
||||
};
|
||||
|
||||
|
||||
|
@ -80,7 +81,7 @@ class ClassPathDirEntry: public ClassPathEntry {
|
|||
ClassFileStream* open_stream(const char* name, TRAPS);
|
||||
// Debugging
|
||||
NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
|
||||
NOT_PRODUCT(bool is_rt_jar();)
|
||||
NOT_PRODUCT(bool is_jrt();)
|
||||
};
|
||||
|
||||
|
||||
|
@ -112,7 +113,7 @@ class ClassPathZipEntry: public ClassPathEntry {
|
|||
void contents_do(void f(const char* name, void* context), void* context);
|
||||
// Debugging
|
||||
NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
|
||||
NOT_PRODUCT(bool is_rt_jar();)
|
||||
NOT_PRODUCT(bool is_jrt();)
|
||||
};
|
||||
|
||||
|
||||
|
@ -138,7 +139,25 @@ class LazyClassPathEntry: public ClassPathEntry {
|
|||
virtual bool is_lazy();
|
||||
// Debugging
|
||||
NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
|
||||
NOT_PRODUCT(bool is_rt_jar();)
|
||||
NOT_PRODUCT(bool is_jrt();)
|
||||
};
|
||||
|
||||
// For java image files
|
||||
class ImageFile;
|
||||
class ClassPathImageEntry: public ClassPathEntry {
|
||||
private:
|
||||
ImageFile *_image;
|
||||
public:
|
||||
bool is_jar_file() { return false; }
|
||||
bool is_open() { return _image != NULL; }
|
||||
const char* name();
|
||||
ClassPathImageEntry(char* name);
|
||||
~ClassPathImageEntry();
|
||||
ClassFileStream* open_stream(const char* name, TRAPS);
|
||||
|
||||
// Debugging
|
||||
NOT_PRODUCT(void compile_the_world(Handle loader, TRAPS);)
|
||||
NOT_PRODUCT(bool is_jrt();)
|
||||
};
|
||||
|
||||
class PackageHashtable;
|
||||
|
@ -226,6 +245,7 @@ class ClassLoader: AllStatic {
|
|||
// to avoid confusing the zip library
|
||||
static bool get_canonical_path(const char* orig, char* out, int len);
|
||||
public:
|
||||
static jboolean decompress(void *in, u8 inSize, void *out, u8 outSize, char **pmsg);
|
||||
static int crc32(int crc, const char* buf, int len);
|
||||
static bool update_class_path_entry_list(const char *path,
|
||||
bool check_for_duplicates,
|
||||
|
|
|
@ -471,7 +471,7 @@ void ClassLoaderData::free_deallocate_list() {
|
|||
// These anonymous class loaders are to contain classes used for JSR292
|
||||
ClassLoaderData* ClassLoaderData::anonymous_class_loader_data(oop loader, TRAPS) {
|
||||
// Add a new class loader data to the graph.
|
||||
return ClassLoaderDataGraph::add(loader, true, CHECK_NULL);
|
||||
return ClassLoaderDataGraph::add(loader, true, THREAD);
|
||||
}
|
||||
|
||||
const char* ClassLoaderData::loader_name() {
|
||||
|
|
|
@ -493,7 +493,7 @@ class MethodFamily : public ResourceObj {
|
|||
};
|
||||
|
||||
Symbol* MethodFamily::generate_no_defaults_message(TRAPS) const {
|
||||
return SymbolTable::new_symbol("No qualifying defaults found", CHECK_NULL);
|
||||
return SymbolTable::new_symbol("No qualifying defaults found", THREAD);
|
||||
}
|
||||
|
||||
Symbol* MethodFamily::generate_method_message(Symbol *klass_name, Method* method, TRAPS) const {
|
||||
|
@ -506,7 +506,7 @@ Symbol* MethodFamily::generate_method_message(Symbol *klass_name, Method* method
|
|||
ss.write((const char*)name->bytes(), name->utf8_length());
|
||||
ss.write((const char*)signature->bytes(), signature->utf8_length());
|
||||
ss.print(" is abstract");
|
||||
return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL);
|
||||
return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD);
|
||||
}
|
||||
|
||||
Symbol* MethodFamily::generate_conflicts_message(GrowableArray<Method*>* methods, TRAPS) const {
|
||||
|
@ -521,7 +521,7 @@ Symbol* MethodFamily::generate_conflicts_message(GrowableArray<Method*>* methods
|
|||
ss.print(".");
|
||||
ss.write((const char*)name->bytes(), name->utf8_length());
|
||||
}
|
||||
return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL);
|
||||
return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD);
|
||||
}
|
||||
|
||||
|
||||
|
|
286
hotspot/src/share/vm/classfile/imageFile.cpp
Normal file
286
hotspot/src/share/vm/classfile/imageFile.cpp
Normal file
|
@ -0,0 +1,286 @@
|
|||
/*
|
||||
* 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 "classfile/imageFile.hpp"
|
||||
#include "runtime/os.inline.hpp"
|
||||
#include "utilities/bytes.hpp"
|
||||
|
||||
|
||||
// Compute the Perfect Hashing hash code for the supplied string.
|
||||
u4 ImageStrings::hash_code(const char* string, u4 seed) {
|
||||
u1* bytes = (u1*)string;
|
||||
|
||||
// Compute hash code.
|
||||
for (u1 byte = *bytes++; byte; byte = *bytes++) {
|
||||
seed = (seed * HASH_MULTIPLIER) ^ byte;
|
||||
}
|
||||
|
||||
// Ensure the result is unsigned.
|
||||
return seed & 0x7FFFFFFF;
|
||||
}
|
||||
|
||||
// Test to see if string begins with start. If so returns remaining portion
|
||||
// of string. Otherwise, NULL.
|
||||
const char* ImageStrings::starts_with(const char* string, const char* start) {
|
||||
char ch1, ch2;
|
||||
|
||||
// Match up the strings the best we can.
|
||||
while ((ch1 = *string) && (ch2 = *start)) {
|
||||
if (ch1 != ch2) {
|
||||
// Mismatch, return NULL.
|
||||
return NULL;
|
||||
}
|
||||
|
||||
string++, start++;
|
||||
}
|
||||
|
||||
// Return remainder of string.
|
||||
return string;
|
||||
}
|
||||
|
||||
ImageLocation::ImageLocation(u1* data) {
|
||||
// Deflate the attribute stream into an array of attributes.
|
||||
memset(_attributes, 0, sizeof(_attributes));
|
||||
u1 byte;
|
||||
|
||||
while ((byte = *data) != ATTRIBUTE_END) {
|
||||
u1 kind = attribute_kind(byte);
|
||||
u1 n = attribute_length(byte);
|
||||
assert(kind < ATTRIBUTE_COUNT, "invalid image location attribute");
|
||||
_attributes[kind] = attribute_value(data + 1, n);
|
||||
data += n + 1;
|
||||
}
|
||||
}
|
||||
|
||||
ImageFile::ImageFile(const char* name) {
|
||||
// Copy the image file name.
|
||||
_name = NEW_C_HEAP_ARRAY(char, strlen(name)+1, mtClass);
|
||||
strcpy(_name, name);
|
||||
|
||||
// Initialize for a closed file.
|
||||
_fd = -1;
|
||||
_memory_mapped = true;
|
||||
_index_data = NULL;
|
||||
}
|
||||
|
||||
ImageFile::~ImageFile() {
|
||||
// Ensure file is closed.
|
||||
close();
|
||||
|
||||
// Free up name.
|
||||
FREE_C_HEAP_ARRAY(char, _name);
|
||||
}
|
||||
|
||||
bool ImageFile::open() {
|
||||
// If file exists open for reading.
|
||||
struct stat st;
|
||||
if (os::stat(_name, &st) != 0 ||
|
||||
(st.st_mode & S_IFREG) != S_IFREG ||
|
||||
(_fd = os::open(_name, 0, O_RDONLY)) == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read image file header and verify.
|
||||
u8 header_size = sizeof(ImageHeader);
|
||||
if (os::read(_fd, &_header, header_size) != header_size ||
|
||||
_header._magic != IMAGE_MAGIC ||
|
||||
_header._major_version != MAJOR_VERSION ||
|
||||
_header._minor_version != MINOR_VERSION) {
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Memory map index.
|
||||
_index_size = index_size();
|
||||
_index_data = (u1*)os::map_memory(_fd, _name, 0, NULL, _index_size, true, false);
|
||||
|
||||
// Failing that, read index into C memory.
|
||||
if (_index_data == NULL) {
|
||||
_memory_mapped = false;
|
||||
_index_data = NEW_RESOURCE_ARRAY(u1, _index_size);
|
||||
|
||||
if (os::seek_to_file_offset(_fd, 0) == -1) {
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (os::read(_fd, _index_data, _index_size) != _index_size) {
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Used to advance a pointer, unstructured.
|
||||
#undef nextPtr
|
||||
#define nextPtr(base, fromType, count, toType) (toType*)((fromType*)(base) + (count))
|
||||
// Pull tables out from the index.
|
||||
_redirect_table = nextPtr(_index_data, u1, header_size, s4);
|
||||
_offsets_table = nextPtr(_redirect_table, s4, _header._location_count, u4);
|
||||
_location_bytes = nextPtr(_offsets_table, u4, _header._location_count, u1);
|
||||
_string_bytes = nextPtr(_location_bytes, u1, _header._locations_size, u1);
|
||||
#undef nextPtr
|
||||
|
||||
// Successful open.
|
||||
return true;
|
||||
}
|
||||
|
||||
void ImageFile::close() {
|
||||
// Dealllocate the index.
|
||||
if (_index_data) {
|
||||
if (_memory_mapped) {
|
||||
os::unmap_memory((char*)_index_data, _index_size);
|
||||
} else {
|
||||
FREE_RESOURCE_ARRAY(u1, _index_data, _index_size);
|
||||
}
|
||||
|
||||
_index_data = NULL;
|
||||
}
|
||||
|
||||
// close file.
|
||||
if (_fd != -1) {
|
||||
os::close(_fd);
|
||||
_fd = -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Return the attribute stream for a named resourced.
|
||||
u1* ImageFile::find_location_data(const char* path) const {
|
||||
// Compute hash.
|
||||
u4 hash = ImageStrings::hash_code(path) % _header._location_count;
|
||||
s4 redirect = _redirect_table[hash];
|
||||
|
||||
if (!redirect) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
u4 index;
|
||||
|
||||
if (redirect < 0) {
|
||||
// If no collision.
|
||||
index = -redirect - 1;
|
||||
} else {
|
||||
// If collision, recompute hash code.
|
||||
index = ImageStrings::hash_code(path, redirect) % _header._location_count;
|
||||
}
|
||||
|
||||
assert(index < _header._location_count, "index exceeds location count");
|
||||
u4 offset = _offsets_table[index];
|
||||
assert(offset < _header._locations_size, "offset exceeds location attributes size");
|
||||
|
||||
if (offset == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return _location_bytes + offset;
|
||||
}
|
||||
|
||||
// Verify that a found location matches the supplied path.
|
||||
bool ImageFile::verify_location(ImageLocation& location, const char* path) const {
|
||||
// Retrieve each path component string.
|
||||
ImageStrings strings(_string_bytes, _header._strings_size);
|
||||
// Match a path with each subcomponent without concatenation (copy).
|
||||
// Match up path parent.
|
||||
const char* parent = location.get_attribute(ImageLocation::ATTRIBUTE_PARENT, strings);
|
||||
const char* next = ImageStrings::starts_with(path, parent);
|
||||
// Continue only if a complete match.
|
||||
if (!next) return false;
|
||||
// Match up path base.
|
||||
const char* base = location.get_attribute(ImageLocation::ATTRIBUTE_BASE, strings);
|
||||
next = ImageStrings::starts_with(next, base);
|
||||
// Continue only if a complete match.
|
||||
if (!next) return false;
|
||||
// Match up path extension.
|
||||
const char* extension = location.get_attribute(ImageLocation::ATTRIBUTE_EXTENSION, strings);
|
||||
next = ImageStrings::starts_with(next, extension);
|
||||
|
||||
// True only if complete match and no more characters.
|
||||
return next && *next == '\0';
|
||||
}
|
||||
|
||||
// Return the resource for the supplied location.
|
||||
u1* ImageFile::get_resource(ImageLocation& location) const {
|
||||
// Retrieve the byte offset and size of the resource.
|
||||
u8 offset = _index_size + location.get_attribute(ImageLocation::ATTRIBUTE_OFFSET);
|
||||
u8 size = location.get_attribute(ImageLocation::ATTRIBUTE_UNCOMPRESSED);
|
||||
u8 compressed_size = location.get_attribute(ImageLocation::ATTRIBUTE_COMPRESSED);
|
||||
u8 read_size = compressed_size ? compressed_size : size;
|
||||
|
||||
// Allocate space for the resource.
|
||||
u1* data = NEW_RESOURCE_ARRAY(u1, read_size);
|
||||
|
||||
bool is_read = os::read_at(_fd, data, read_size, offset) == read_size;
|
||||
guarantee(is_read, "error reading from image or short read");
|
||||
|
||||
// If not compressed, just return the data.
|
||||
if (!compressed_size) {
|
||||
return data;
|
||||
}
|
||||
|
||||
u1* uncompressed = NEW_RESOURCE_ARRAY(u1, size);
|
||||
char* msg = NULL;
|
||||
jboolean res = ClassLoader::decompress(data, compressed_size, uncompressed, size, &msg);
|
||||
if (!res) warning("decompression failed due to %s\n", msg);
|
||||
guarantee(res, "decompression failed");
|
||||
|
||||
return uncompressed;
|
||||
}
|
||||
|
||||
void ImageFile::get_resource(const char* path, u1*& buffer, u8& size) const {
|
||||
buffer = NULL;
|
||||
size = 0;
|
||||
u1* data = find_location_data(path);
|
||||
if (data) {
|
||||
ImageLocation location(data);
|
||||
if (verify_location(location, path)) {
|
||||
size = location.get_attribute(ImageLocation::ATTRIBUTE_UNCOMPRESSED);
|
||||
buffer = get_resource(location);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GrowableArray<const char*>* ImageFile::packages(const char* name) {
|
||||
char entry[JVM_MAXPATHLEN];
|
||||
bool overflow = jio_snprintf(entry, sizeof(entry), "%s/packages.offsets", name) == -1;
|
||||
guarantee(!overflow, "package name overflow");
|
||||
|
||||
u1* buffer;
|
||||
u8 size;
|
||||
|
||||
get_resource(entry, buffer, size);
|
||||
guarantee(buffer, "missing module packages reource");
|
||||
ImageStrings strings(_string_bytes, _header._strings_size);
|
||||
GrowableArray<const char*>* pkgs = new GrowableArray<const char*>();
|
||||
int count = size / 4;
|
||||
for (int i = 0; i < count; i++) {
|
||||
u4 offset = Bytes::get_Java_u4(buffer + (i*4));
|
||||
const char* p = strings.get(offset);
|
||||
pkgs->append(p);
|
||||
}
|
||||
|
||||
return pkgs;
|
||||
}
|
343
hotspot/src/share/vm/classfile/imageFile.hpp
Normal file
343
hotspot/src/share/vm/classfile/imageFile.hpp
Normal file
|
@ -0,0 +1,343 @@
|
|||
/*
|
||||
* 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_CLASSFILE_IMAGEFILE_HPP
|
||||
#define SHARE_VM_CLASSFILE_IMAGEFILE_HPP
|
||||
|
||||
#include "classfile/classLoader.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
|
||||
// Image files are an alternate file format for storing classes and resources. The
|
||||
// goal is to supply file access which is faster and smaller that the jar format.
|
||||
// It should be noted that unlike jars information stored in an image is in native
|
||||
// endian format. This allows the image to be memory mapped into memory without
|
||||
// endian translation. This also means that images are platform dependent.
|
||||
//
|
||||
// Image files are structured as three sections;
|
||||
//
|
||||
// +-----------+
|
||||
// | Header |
|
||||
// +-----------+
|
||||
// | |
|
||||
// | Directory |
|
||||
// | |
|
||||
// +-----------+
|
||||
// | |
|
||||
// | |
|
||||
// | Resources |
|
||||
// | |
|
||||
// | |
|
||||
// +-----------+
|
||||
//
|
||||
// The header contains information related to identification and description of
|
||||
// contents.
|
||||
//
|
||||
// +-------------------------+
|
||||
// | Magic (0xCAFEDADA) |
|
||||
// +------------+------------+
|
||||
// | Major Vers | Minor Vers |
|
||||
// +------------+------------+
|
||||
// | Location Count |
|
||||
// +-------------------------+
|
||||
// | Attributes Size |
|
||||
// +-------------------------+
|
||||
// | Strings Size |
|
||||
// +-------------------------+
|
||||
//
|
||||
// Magic - means of identifying validity of the file. This avoids requiring a
|
||||
// special file extension.
|
||||
// Major vers, minor vers - differences in version numbers indicate structural
|
||||
// changes in the image.
|
||||
// Location count - number of locations/resources in the file. This count is also
|
||||
// the length of lookup tables used in the directory.
|
||||
// Attributes size - number of bytes in the region used to store location attribute
|
||||
// streams.
|
||||
// Strings size - the size of the region used to store strings used by the
|
||||
// directory and meta data.
|
||||
//
|
||||
// The directory contains information related to resource lookup. The algorithm
|
||||
// used for lookup is "A Practical Minimal Perfect Hashing Method"
|
||||
// (http://homepages.dcc.ufmg.br/~nivio/papers/wea05.pdf). Given a path string
|
||||
// in the form <package>/<base>.<extension> return the resource location
|
||||
// information;
|
||||
//
|
||||
// redirectIndex = hash(path, DEFAULT_SEED) % count;
|
||||
// redirect = redirectTable[redirectIndex];
|
||||
// if (redirect == 0) return not found;
|
||||
// locationIndex = redirect < 0 ? -1 - redirect : hash(path, redirect) % count;
|
||||
// location = locationTable[locationIndex];
|
||||
// if (!verify(location, path)) return not found;
|
||||
// return location;
|
||||
//
|
||||
// Note: The hash function takes an initial seed value. A different seed value
|
||||
// usually returns a different result for strings that would otherwise collide with
|
||||
// other seeds. The verify function guarantees the found resource location is
|
||||
// indeed the resource we are looking for.
|
||||
//
|
||||
// The following is the format of the directory;
|
||||
//
|
||||
// +-------------------+
|
||||
// | Redirect Table |
|
||||
// +-------------------+
|
||||
// | Attribute Offsets |
|
||||
// +-------------------+
|
||||
// | Attribute Data |
|
||||
// +-------------------+
|
||||
// | Strings |
|
||||
// +-------------------+
|
||||
//
|
||||
// Redirect Table - Array of 32-bit signed values representing actions that
|
||||
// should take place for hashed strings that map to that
|
||||
// value. Negative values indicate no hash collision and can be
|
||||
// quickly converted to indices into attribute offsets. Positive
|
||||
// values represent a new seed for hashing an index into attribute
|
||||
// offsets. Zero indicates not found.
|
||||
// Attribute Offsets - Array of 32-bit unsigned values representing offsets into
|
||||
// attribute data. Attribute offsets can be iterated to do a
|
||||
// full survey of resources in the image.
|
||||
// Attribute Data - Bytes representing compact attribute data for locations. (See
|
||||
// comments in ImageLocation.)
|
||||
// Strings - Collection of zero terminated UTF-8 strings used by the directory and
|
||||
// image meta data. Each string is accessed by offset. Each string is
|
||||
// unique. Offset zero is reserved for the empty string.
|
||||
//
|
||||
// Note that the memory mapped directory assumes 32 bit alignment of the image
|
||||
// header, the redirect table and the attribute offsets.
|
||||
//
|
||||
|
||||
|
||||
// Manage image file string table.
|
||||
class ImageStrings {
|
||||
private:
|
||||
// Data bytes for strings.
|
||||
u1* _data;
|
||||
// Number of bytes in the string table.
|
||||
u4 _size;
|
||||
|
||||
public:
|
||||
// Prime used to generate hash for Perfect Hashing.
|
||||
static const u4 HASH_MULTIPLIER = 0x01000193;
|
||||
|
||||
ImageStrings(u1* data, u4 size) : _data(data), _size(size) {}
|
||||
|
||||
// Return the UTF-8 string beginning at offset.
|
||||
inline const char* get(u4 offset) const {
|
||||
assert(offset < _size, "offset exceeds string table size");
|
||||
return (const char*)(_data + offset);
|
||||
}
|
||||
|
||||
// Compute the Perfect Hashing hash code for the supplied string.
|
||||
inline static u4 hash_code(const char* string) {
|
||||
return hash_code(string, HASH_MULTIPLIER);
|
||||
}
|
||||
|
||||
// Compute the Perfect Hashing hash code for the supplied string, starting at seed.
|
||||
static u4 hash_code(const char* string, u4 seed);
|
||||
|
||||
// Test to see if string begins with start. If so returns remaining portion
|
||||
// of string. Otherwise, NULL. Used to test sections of a path without
|
||||
// copying.
|
||||
static const char* starts_with(const char* string, const char* start);
|
||||
|
||||
};
|
||||
|
||||
// Manage image file location attribute streams. Within an image, a location's
|
||||
// attributes are compressed into a stream of bytes. An attribute stream is
|
||||
// composed of individual attribute sequences. Each attribute sequence begins with
|
||||
// a header byte containing the attribute 'kind' (upper 5 bits of header) and the
|
||||
// 'length' less 1 (lower 3 bits of header) of bytes that follow containing the
|
||||
// attribute value. Attribute values present as most significant byte first.
|
||||
//
|
||||
// Ex. Container offset (ATTRIBUTE_OFFSET) 0x33562 would be represented as 0x22
|
||||
// (kind = 4, length = 3), 0x03, 0x35, 0x62.
|
||||
//
|
||||
// An attribute stream is terminated with a header kind of ATTRIBUTE_END (header
|
||||
// byte of zero.)
|
||||
//
|
||||
// ImageLocation inflates the stream into individual values stored in the long
|
||||
// array _attributes. This allows an attribute value can be quickly accessed by
|
||||
// direct indexing. Unspecified values default to zero.
|
||||
//
|
||||
// Notes:
|
||||
// - Even though ATTRIBUTE_END is used to mark the end of the attribute stream,
|
||||
// streams will contain zero byte values to represent lesser significant bits.
|
||||
// Thus, detecting a zero byte is not sufficient to detect the end of an attribute
|
||||
// stream.
|
||||
// - ATTRIBUTE_OFFSET represents the number of bytes from the beginning of the region
|
||||
// storing the resources. Thus, in an image this represents the number of bytes
|
||||
// after the directory.
|
||||
// - Currently, compressed resources are represented by having a non-zero
|
||||
// ATTRIBUTE_COMPRESSED value. This represents the number of bytes stored in the
|
||||
// image, and the value of ATTRIBUTE_UNCOMPRESSED represents number of bytes of the
|
||||
// inflated resource in memory. If the ATTRIBUTE_COMPRESSED is zero then the value
|
||||
// of ATTRIBUTE_UNCOMPRESSED represents both the number of bytes in the image and
|
||||
// in memory. In the future, additional compression techniques will be used and
|
||||
// represented differently.
|
||||
// - Package strings include trailing slash and extensions include prefix period.
|
||||
//
|
||||
class ImageLocation {
|
||||
public:
|
||||
// Attribute kind enumeration.
|
||||
static const u1 ATTRIBUTE_END = 0; // End of attribute stream marker
|
||||
static const u1 ATTRIBUTE_BASE = 1; // String table offset of resource path base
|
||||
static const u1 ATTRIBUTE_PARENT = 2; // String table offset of resource path parent
|
||||
static const u1 ATTRIBUTE_EXTENSION = 3; // String table offset of resource path extension
|
||||
static const u1 ATTRIBUTE_OFFSET = 4; // Container byte offset of resource
|
||||
static const u1 ATTRIBUTE_COMPRESSED = 5; // In image byte size of the compressed resource
|
||||
static const u1 ATTRIBUTE_UNCOMPRESSED = 6; // In memory byte size of the uncompressed resource
|
||||
static const u1 ATTRIBUTE_COUNT = 7; // Number of attribute kinds
|
||||
|
||||
private:
|
||||
// Values of inflated attributes.
|
||||
u8 _attributes[ATTRIBUTE_COUNT];
|
||||
|
||||
// Return the attribute value number of bytes.
|
||||
inline static u1 attribute_length(u1 data) {
|
||||
return (data & 0x7) + 1;
|
||||
}
|
||||
|
||||
// Return the attribute kind.
|
||||
inline static u1 attribute_kind(u1 data) {
|
||||
u1 kind = data >> 3;
|
||||
assert(kind < ATTRIBUTE_COUNT, "invalid attribute kind");
|
||||
return kind;
|
||||
}
|
||||
|
||||
// Return the attribute length.
|
||||
inline static u8 attribute_value(u1* data, u1 n) {
|
||||
assert(0 < n && n <= 8, "invalid attribute value length");
|
||||
u8 value = 0;
|
||||
|
||||
// Most significant bytes first.
|
||||
for (u1 i = 0; i < n; i++) {
|
||||
value <<= 8;
|
||||
value |= data[i];
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public:
|
||||
ImageLocation(u1* data);
|
||||
|
||||
// Retrieve an attribute value from the inflated array.
|
||||
inline u8 get_attribute(u1 kind) const {
|
||||
assert(ATTRIBUTE_END < kind && kind < ATTRIBUTE_COUNT, "invalid attribute kind");
|
||||
return _attributes[kind];
|
||||
}
|
||||
|
||||
// Retrieve an attribute string value from the inflated array.
|
||||
inline const char* get_attribute(u4 kind, const ImageStrings& strings) const {
|
||||
return strings.get((u4)get_attribute(kind));
|
||||
}
|
||||
};
|
||||
|
||||
// Manage the image file.
|
||||
class ImageFile: public CHeapObj<mtClass> {
|
||||
private:
|
||||
// Image file marker.
|
||||
static const u4 IMAGE_MAGIC = 0xCAFEDADA;
|
||||
// Image file major version number.
|
||||
static const u2 MAJOR_VERSION = 0;
|
||||
// Image file minor version number.
|
||||
static const u2 MINOR_VERSION = 1;
|
||||
|
||||
struct ImageHeader {
|
||||
u4 _magic; // Image file marker
|
||||
u2 _major_version; // Image file major version number
|
||||
u2 _minor_version; // Image file minor version number
|
||||
u4 _location_count; // Number of locations managed in index.
|
||||
u4 _locations_size; // Number of bytes in attribute table.
|
||||
u4 _strings_size; // Number of bytes in string table.
|
||||
};
|
||||
|
||||
char* _name; // Name of image
|
||||
int _fd; // File descriptor
|
||||
bool _memory_mapped; // Is file memory mapped
|
||||
ImageHeader _header; // Image header
|
||||
u8 _index_size; // Total size of index
|
||||
u1* _index_data; // Raw index data
|
||||
s4* _redirect_table; // Perfect hash redirect table
|
||||
u4* _offsets_table; // Location offset table
|
||||
u1* _location_bytes; // Location attributes
|
||||
u1* _string_bytes; // String table
|
||||
|
||||
// Compute number of bytes in image file index.
|
||||
inline u8 index_size() {
|
||||
return sizeof(ImageHeader) +
|
||||
_header._location_count * sizeof(u4) * 2 +
|
||||
_header._locations_size +
|
||||
_header._strings_size;
|
||||
}
|
||||
|
||||
public:
|
||||
ImageFile(const char* name);
|
||||
~ImageFile();
|
||||
|
||||
// Open image file for access.
|
||||
bool open();
|
||||
// Close image file.
|
||||
void close();
|
||||
|
||||
// Retrieve name of image file.
|
||||
inline const char* name() const {
|
||||
return _name;
|
||||
}
|
||||
|
||||
// Return a string table accessor.
|
||||
inline const ImageStrings get_strings() const {
|
||||
return ImageStrings(_string_bytes, _header._strings_size);
|
||||
}
|
||||
|
||||
// Return number of locations in image file index.
|
||||
inline u4 get_location_count() const {
|
||||
return _header._location_count;
|
||||
}
|
||||
|
||||
// Return location attribute stream for location i.
|
||||
inline u1* get_location_data(u4 i) const {
|
||||
u4 offset = _offsets_table[i];
|
||||
|
||||
return offset != 0 ? _location_bytes + offset : NULL;
|
||||
}
|
||||
|
||||
// Return the attribute stream for a named resourced.
|
||||
u1* find_location_data(const char* path) const;
|
||||
|
||||
// Verify that a found location matches the supplied path.
|
||||
bool verify_location(ImageLocation& location, const char* path) const;
|
||||
|
||||
// Return the resource for the supplied location info.
|
||||
u1* get_resource(ImageLocation& location) const;
|
||||
|
||||
// Return the resource associated with the path else NULL if not found.
|
||||
void get_resource(const char* path, u1*& buffer, u8& size) const;
|
||||
|
||||
// Return an array of packages for a given module
|
||||
GrowableArray<const char*>* packages(const char* name);
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_CLASSFILE_IMAGEFILE_HPP
|
|
@ -1950,7 +1950,7 @@ Handle java_lang_reflect_Method::create(TRAPS) {
|
|||
// This class is eagerly initialized during VM initialization, since we keep a refence
|
||||
// to one of the methods
|
||||
assert(InstanceKlass::cast(klass)->is_initialized(), "must be initialized");
|
||||
return InstanceKlass::cast(klass)->allocate_instance_handle(CHECK_NH);
|
||||
return InstanceKlass::cast(klass)->allocate_instance_handle(THREAD);
|
||||
}
|
||||
|
||||
oop java_lang_reflect_Method::clazz(oop reflect) {
|
||||
|
@ -2128,7 +2128,7 @@ Handle java_lang_reflect_Constructor::create(TRAPS) {
|
|||
instanceKlassHandle klass (THREAD, k);
|
||||
// Ensure it is initialized
|
||||
klass->initialize(CHECK_NH);
|
||||
return klass->allocate_instance_handle(CHECK_NH);
|
||||
return klass->allocate_instance_handle(THREAD);
|
||||
}
|
||||
|
||||
oop java_lang_reflect_Constructor::clazz(oop reflect) {
|
||||
|
@ -2268,7 +2268,7 @@ Handle java_lang_reflect_Field::create(TRAPS) {
|
|||
instanceKlassHandle klass (THREAD, k);
|
||||
// Ensure it is initialized
|
||||
klass->initialize(CHECK_NH);
|
||||
return klass->allocate_instance_handle(CHECK_NH);
|
||||
return klass->allocate_instance_handle(THREAD);
|
||||
}
|
||||
|
||||
oop java_lang_reflect_Field::clazz(oop reflect) {
|
||||
|
@ -2395,7 +2395,7 @@ Handle java_lang_reflect_Parameter::create(TRAPS) {
|
|||
instanceKlassHandle klass (THREAD, k);
|
||||
// Ensure it is initialized
|
||||
klass->initialize(CHECK_NH);
|
||||
return klass->allocate_instance_handle(CHECK_NH);
|
||||
return klass->allocate_instance_handle(THREAD);
|
||||
}
|
||||
|
||||
oop java_lang_reflect_Parameter::name(oop param) {
|
||||
|
@ -2445,7 +2445,7 @@ Handle sun_reflect_ConstantPool::create(TRAPS) {
|
|||
instanceKlassHandle klass (THREAD, k);
|
||||
// Ensure it is initialized
|
||||
klass->initialize(CHECK_NH);
|
||||
return klass->allocate_instance_handle(CHECK_NH);
|
||||
return klass->allocate_instance_handle(THREAD);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ bool SharedPathsMiscInfo::check() {
|
|||
bool SharedPathsMiscInfo::check(jint type, const char* path) {
|
||||
switch (type) {
|
||||
case BOOT:
|
||||
if (strcmp(path, Arguments::get_sysclasspath()) != 0) {
|
||||
if (os::file_name_strcmp(path, Arguments::get_sysclasspath()) != 0) {
|
||||
return fail("[BOOT classpath mismatch, actual: -Dsun.boot.class.path=", Arguments::get_sysclasspath());
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "runtime/atomic.inline.hpp"
|
||||
#include "runtime/mutexLocker.hpp"
|
||||
#include "utilities/hashtable.inline.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
#if INCLUDE_ALL_GCS
|
||||
#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
|
||||
#include "gc_implementation/g1/g1StringDedup.hpp"
|
||||
|
|
|
@ -235,7 +235,7 @@ Symbol* SymbolTable::lookup(const char* name, int len, TRAPS) {
|
|||
MutexLocker ml(SymbolTable_lock, THREAD);
|
||||
|
||||
// Otherwise, add to symbol to table
|
||||
return the_table()->basic_add(index, (u1*)name, len, hashValue, true, CHECK_NULL);
|
||||
return the_table()->basic_add(index, (u1*)name, len, hashValue, true, THREAD);
|
||||
}
|
||||
|
||||
Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) {
|
||||
|
@ -274,7 +274,7 @@ Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) {
|
|||
// Grab SymbolTable_lock first.
|
||||
MutexLocker ml(SymbolTable_lock, THREAD);
|
||||
|
||||
return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, CHECK_NULL);
|
||||
return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, THREAD);
|
||||
}
|
||||
|
||||
Symbol* SymbolTable::lookup_only(const char* name, int len,
|
||||
|
|
|
@ -31,10 +31,6 @@
|
|||
#include "classfile/resolutionErrors.hpp"
|
||||
#include "classfile/stringTable.hpp"
|
||||
#include "classfile/systemDictionary.hpp"
|
||||
#if INCLUDE_CDS
|
||||
#include "classfile/sharedClassUtil.hpp"
|
||||
#include "classfile/systemDictionaryShared.hpp"
|
||||
#endif
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
#include "compiler/compileBroker.hpp"
|
||||
#include "interpreter/bytecodeStream.hpp"
|
||||
|
@ -65,6 +61,10 @@
|
|||
#include "services/threadService.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
#include "utilities/ticks.hpp"
|
||||
#if INCLUDE_CDS
|
||||
#include "classfile/sharedClassUtil.hpp"
|
||||
#include "classfile/systemDictionaryShared.hpp"
|
||||
#endif
|
||||
#if INCLUDE_TRACE
|
||||
#include "trace/tracing.hpp"
|
||||
#endif
|
||||
|
@ -122,7 +122,7 @@ void SystemDictionary::compute_java_system_loader(TRAPS) {
|
|||
|
||||
ClassLoaderData* SystemDictionary::register_loader(Handle class_loader, TRAPS) {
|
||||
if (class_loader() == NULL) return ClassLoaderData::the_null_class_loader_data();
|
||||
return ClassLoaderDataGraph::find_or_create(class_loader, CHECK_NULL);
|
||||
return ClassLoaderDataGraph::find_or_create(class_loader, THREAD);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -232,15 +232,15 @@ Klass* SystemDictionary::resolve_or_null(Symbol* class_name, Handle class_loader
|
|||
class_name->as_C_string(),
|
||||
class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string()));
|
||||
if (FieldType::is_array(class_name)) {
|
||||
return resolve_array_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL);
|
||||
return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD);
|
||||
} else if (FieldType::is_obj(class_name)) {
|
||||
ResourceMark rm(THREAD);
|
||||
// Ignore wrapping L and ;.
|
||||
TempNewSymbol name = SymbolTable::new_symbol(class_name->as_C_string() + 1,
|
||||
class_name->utf8_length() - 2, CHECK_NULL);
|
||||
return resolve_instance_class_or_null(name, class_loader, protection_domain, CHECK_NULL);
|
||||
return resolve_instance_class_or_null(name, class_loader, protection_domain, THREAD);
|
||||
} else {
|
||||
return resolve_instance_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL);
|
||||
return resolve_instance_class_or_null(class_name, class_loader, protection_domain, THREAD);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -289,7 +289,7 @@ class VerificationType VALUE_OBJ_CLASS_SPEC {
|
|||
if (is_reference() && from.is_reference()) {
|
||||
return is_reference_assignable_from(from, context,
|
||||
from_field_is_protected,
|
||||
CHECK_false);
|
||||
THREAD);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1927,7 +1927,7 @@ Klass* ClassVerifier::load_class(Symbol* name, TRAPS) {
|
|||
|
||||
return SystemDictionary::resolve_or_fail(
|
||||
name, Handle(THREAD, loader), Handle(THREAD, protection_domain),
|
||||
true, CHECK_NULL);
|
||||
true, THREAD);
|
||||
}
|
||||
|
||||
bool ClassVerifier::is_protected_access(instanceKlassHandle this_class,
|
||||
|
|
|
@ -912,6 +912,8 @@ class ClassHierarchyWalker {
|
|||
bool is_witness(Klass* k) {
|
||||
if (doing_subtype_search()) {
|
||||
return Dependencies::is_concrete_klass(k);
|
||||
} else if (!k->oop_is_instance()) {
|
||||
return false; // no methods to find in an array type
|
||||
} else {
|
||||
Method* m = InstanceKlass::cast(k)->find_method(_name, _signature);
|
||||
if (m == NULL || !Dependencies::is_concrete_method(m)) return false;
|
||||
|
@ -1118,7 +1120,7 @@ Klass* ClassHierarchyWalker::find_witness_anywhere(Klass* context_type,
|
|||
Klass* chain; // scratch variable
|
||||
#define ADD_SUBCLASS_CHAIN(k) { \
|
||||
assert(chaini < CHAINMAX, "oob"); \
|
||||
chain = InstanceKlass::cast(k)->subklass(); \
|
||||
chain = k->subklass(); \
|
||||
if (chain != NULL) chains[chaini++] = chain; }
|
||||
|
||||
// Look for non-abstract subclasses.
|
||||
|
@ -1129,6 +1131,7 @@ Klass* ClassHierarchyWalker::find_witness_anywhere(Klass* context_type,
|
|||
// (Their subclasses are additional indirect implementors.
|
||||
// See InstanceKlass::add_implementor.)
|
||||
// (Note: nof_implementors is always zero for non-interfaces.)
|
||||
if (top_level_call) {
|
||||
int nof_impls = InstanceKlass::cast(context_type)->nof_implementors();
|
||||
if (nof_impls > 1) {
|
||||
// Avoid this case: *I.m > { A.m, C }; B.m > C
|
||||
|
@ -1160,6 +1163,7 @@ Klass* ClassHierarchyWalker::find_witness_anywhere(Klass* context_type,
|
|||
ADD_SUBCLASS_CHAIN(impl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Recursively process each non-trivial sibling chain.
|
||||
while (chaini > 0) {
|
||||
|
|
|
@ -594,7 +594,7 @@ void CompileTask::log_task_done(CompileLog* log) {
|
|||
* Add a CompileTask to a CompileQueue.
|
||||
*/
|
||||
void CompileQueue::add(CompileTask* task) {
|
||||
assert(lock()->owned_by_self(), "must own lock");
|
||||
assert(MethodCompileQueue_lock->owned_by_self(), "must own lock");
|
||||
|
||||
task->set_next(NULL);
|
||||
task->set_prev(NULL);
|
||||
|
@ -625,7 +625,7 @@ void CompileQueue::add(CompileTask* task) {
|
|||
}
|
||||
|
||||
// Notify CompilerThreads that a task is available.
|
||||
lock()->notify_all();
|
||||
MethodCompileQueue_lock->notify_all();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -635,7 +635,7 @@ void CompileQueue::add(CompileTask* task) {
|
|||
* compilation is disabled.
|
||||
*/
|
||||
void CompileQueue::free_all() {
|
||||
MutexLocker mu(lock());
|
||||
MutexLocker mu(MethodCompileQueue_lock);
|
||||
CompileTask* next = _first;
|
||||
|
||||
// Iterate over all tasks in the compile queue
|
||||
|
@ -653,14 +653,14 @@ void CompileQueue::free_all() {
|
|||
_first = NULL;
|
||||
|
||||
// Wake up all threads that block on the queue.
|
||||
lock()->notify_all();
|
||||
MethodCompileQueue_lock->notify_all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next CompileTask from a CompileQueue
|
||||
*/
|
||||
CompileTask* CompileQueue::get() {
|
||||
MutexLocker locker(lock());
|
||||
MutexLocker locker(MethodCompileQueue_lock);
|
||||
// If _first is NULL we have no more compile jobs. There are two reasons for
|
||||
// having no compile jobs: First, we compiled everything we wanted. Second,
|
||||
// we ran out of code cache so compilation has been disabled. In the latter
|
||||
|
@ -681,7 +681,7 @@ CompileTask* CompileQueue::get() {
|
|||
// We need a timed wait here, since compiler threads can exit if compilation
|
||||
// is disabled forever. We use 5 seconds wait time; the exiting of compiler threads
|
||||
// is not critical and we do not want idle compiler threads to wake up too often.
|
||||
lock()->wait(!Mutex::_no_safepoint_check_flag, 5*1000);
|
||||
MethodCompileQueue_lock->wait(!Mutex::_no_safepoint_check_flag, 5*1000);
|
||||
}
|
||||
|
||||
if (CompileBroker::is_compilation_disabled_forever()) {
|
||||
|
@ -701,7 +701,7 @@ CompileTask* CompileQueue::get() {
|
|||
// Clean & deallocate stale compile tasks.
|
||||
// Temporarily releases MethodCompileQueue lock.
|
||||
void CompileQueue::purge_stale_tasks() {
|
||||
assert(lock()->owned_by_self(), "must own lock");
|
||||
assert(MethodCompileQueue_lock->owned_by_self(), "must own lock");
|
||||
if (_first_stale != NULL) {
|
||||
// Stale tasks are purged when MCQ lock is released,
|
||||
// but _first_stale updates are protected by MCQ lock.
|
||||
|
@ -710,7 +710,7 @@ void CompileQueue::purge_stale_tasks() {
|
|||
CompileTask* head = _first_stale;
|
||||
_first_stale = NULL;
|
||||
{
|
||||
MutexUnlocker ul(lock());
|
||||
MutexUnlocker ul(MethodCompileQueue_lock);
|
||||
for (CompileTask* task = head; task != NULL; ) {
|
||||
CompileTask* next_task = task->next();
|
||||
CompileTaskWrapper ctw(task); // Frees the task
|
||||
|
@ -722,7 +722,7 @@ void CompileQueue::purge_stale_tasks() {
|
|||
}
|
||||
|
||||
void CompileQueue::remove(CompileTask* task) {
|
||||
assert(lock()->owned_by_self(), "must own lock");
|
||||
assert(MethodCompileQueue_lock->owned_by_self(), "must own lock");
|
||||
if (task->prev() != NULL) {
|
||||
task->prev()->set_next(task->next());
|
||||
} else {
|
||||
|
@ -742,7 +742,7 @@ void CompileQueue::remove(CompileTask* task) {
|
|||
}
|
||||
|
||||
void CompileQueue::remove_and_mark_stale(CompileTask* task) {
|
||||
assert(lock()->owned_by_self(), "must own lock");
|
||||
assert(MethodCompileQueue_lock->owned_by_self(), "must own lock");
|
||||
remove(task);
|
||||
|
||||
// Enqueue the task for reclamation (should be done outside MCQ lock)
|
||||
|
@ -780,7 +780,7 @@ void CompileBroker::print_compile_queues(outputStream* st) {
|
|||
}
|
||||
|
||||
void CompileQueue::print(outputStream* st) {
|
||||
assert(lock()->owned_by_self(), "must own lock");
|
||||
assert(MethodCompileQueue_lock->owned_by_self(), "must own lock");
|
||||
st->print_cr("Contents of %s", name());
|
||||
st->print_cr("----------------------------");
|
||||
CompileTask* task = _first;
|
||||
|
@ -1066,11 +1066,11 @@ void CompileBroker::init_compiler_sweeper_threads(int c1_compiler_count, int c2_
|
|||
#endif // !ZERO && !SHARK
|
||||
// Initialize the compilation queue
|
||||
if (c2_compiler_count > 0) {
|
||||
_c2_compile_queue = new CompileQueue("C2 compile queue", MethodCompileQueue_lock);
|
||||
_c2_compile_queue = new CompileQueue("C2 compile queue");
|
||||
_compilers[1]->set_num_compiler_threads(c2_compiler_count);
|
||||
}
|
||||
if (c1_compiler_count > 0) {
|
||||
_c1_compile_queue = new CompileQueue("C1 compile queue", MethodCompileQueue_lock);
|
||||
_c1_compile_queue = new CompileQueue("C1 compile queue");
|
||||
_compilers[0]->set_num_compiler_threads(c1_compiler_count);
|
||||
}
|
||||
|
||||
|
@ -1214,7 +1214,7 @@ void CompileBroker::compile_method_base(methodHandle method,
|
|||
|
||||
// Acquire our lock.
|
||||
{
|
||||
MutexLocker locker(queue->lock(), thread);
|
||||
MutexLocker locker(MethodCompileQueue_lock, thread);
|
||||
|
||||
// Make sure the method has not slipped into the queues since
|
||||
// last we checked; note that those checks were "fast bail-outs".
|
||||
|
@ -1807,7 +1807,7 @@ void CompileBroker::init_compiler_thread_log() {
|
|||
os::file_separator(), thread_id, os::current_process_id());
|
||||
}
|
||||
|
||||
fp = fopen(file_name, "at");
|
||||
fp = fopen(file_name, "wt");
|
||||
if (fp != NULL) {
|
||||
if (LogCompilation && Verbose) {
|
||||
tty->print_cr("Opening compilation log %s", file_name);
|
||||
|
@ -1985,6 +1985,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
|||
|
||||
if (ci_env.failing()) {
|
||||
task->set_failure_reason(ci_env.failure_reason());
|
||||
ci_env.report_failure(ci_env.failure_reason());
|
||||
const char* retry_message = ci_env.retry_message();
|
||||
if (_compilation_log != NULL) {
|
||||
_compilation_log->log_failure(thread, task, ci_env.failure_reason(), retry_message);
|
||||
|
|
|
@ -195,7 +195,6 @@ class CompilerCounters : public CHeapObj<mtCompiler> {
|
|||
class CompileQueue : public CHeapObj<mtCompiler> {
|
||||
private:
|
||||
const char* _name;
|
||||
Monitor* _lock;
|
||||
|
||||
CompileTask* _first;
|
||||
CompileTask* _last;
|
||||
|
@ -206,9 +205,8 @@ class CompileQueue : public CHeapObj<mtCompiler> {
|
|||
|
||||
void purge_stale_tasks();
|
||||
public:
|
||||
CompileQueue(const char* name, Monitor* lock) {
|
||||
CompileQueue(const char* name) {
|
||||
_name = name;
|
||||
_lock = lock;
|
||||
_first = NULL;
|
||||
_last = NULL;
|
||||
_size = 0;
|
||||
|
@ -216,7 +214,6 @@ class CompileQueue : public CHeapObj<mtCompiler> {
|
|||
}
|
||||
|
||||
const char* name() const { return _name; }
|
||||
Monitor* lock() const { return _lock; }
|
||||
|
||||
void add(CompileTask* task);
|
||||
void remove(CompileTask* task);
|
||||
|
@ -418,6 +415,7 @@ class CompileBroker: AllStatic {
|
|||
shutdown_compilaton = 2
|
||||
};
|
||||
|
||||
static jint get_compilation_activity_mode() { return _should_compile_new_jobs; }
|
||||
static bool should_compile_new_jobs() { return UseCompiler && (_should_compile_new_jobs == run_compilation); }
|
||||
static bool set_should_compile_new_jobs(jint new_state) {
|
||||
// Return success if the current caller set it
|
||||
|
|
|
@ -56,7 +56,7 @@ CompileLog::CompileLog(const char* file_name, FILE* fp, intx thread_id)
|
|||
}
|
||||
|
||||
CompileLog::~CompileLog() {
|
||||
delete _out;
|
||||
delete _out; // Close fd in fileStream::~fileStream()
|
||||
_out = NULL;
|
||||
FREE_C_HEAP_ARRAY(char, _identities);
|
||||
FREE_C_HEAP_ARRAY(char, _file);
|
||||
|
@ -278,10 +278,9 @@ void CompileLog::finish_log_on_error(outputStream* file, char* buf, int buflen)
|
|||
}
|
||||
file->print_raw_cr("</compilation_log>");
|
||||
close(partial_fd);
|
||||
unlink(partial_file);
|
||||
}
|
||||
CompileLog* next_log = log->_next;
|
||||
delete log;
|
||||
delete log; // Removes partial file
|
||||
log = next_log;
|
||||
}
|
||||
_first = NULL;
|
||||
|
|
|
@ -52,21 +52,9 @@ void ConcurrentMarkSweepPolicy::initialize_alignments() {
|
|||
}
|
||||
|
||||
void ConcurrentMarkSweepPolicy::initialize_generations() {
|
||||
_generations = NEW_C_HEAP_ARRAY3(GenerationSpecPtr, number_of_generations(), mtGC,
|
||||
CURRENT_PC, AllocFailStrategy::RETURN_NULL);
|
||||
if (_generations == NULL)
|
||||
vm_exit_during_initialization("Unable to allocate gen spec");
|
||||
|
||||
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");
|
||||
}
|
||||
_generations = NEW_C_HEAP_ARRAY(GenerationSpecPtr, number_of_generations(), mtGC);
|
||||
_generations[0] = new GenerationSpec(Generation::ParNew, _initial_young_size, _max_young_size);
|
||||
_generations[1] = new GenerationSpec(Generation::ConcurrentMarkSweep, _initial_old_size, _max_old_size);
|
||||
}
|
||||
|
||||
void ConcurrentMarkSweepPolicy::initialize_size_policy(size_t init_eden_size,
|
||||
|
@ -82,10 +70,5 @@ void ConcurrentMarkSweepPolicy::initialize_size_policy(size_t init_eden_size,
|
|||
|
||||
void ConcurrentMarkSweepPolicy::initialize_gc_policy_counters() {
|
||||
// initialize the policy counters - 2 collectors, 3 generations
|
||||
if (UseParNewGC) {
|
||||
_gc_policy_counters = new GCPolicyCounters("ParNew:CMS", 2, 3);
|
||||
}
|
||||
else {
|
||||
_gc_policy_counters = new GCPolicyCounters("Copy:CMS", 2, 3);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,7 +90,8 @@ CompactibleFreeListSpace::CompactibleFreeListSpace(BlockOffsetSharedArray* bs,
|
|||
CMSRescanMultiple),
|
||||
_marking_task_size(CardTableModRefBS::card_size_in_words * BitsPerWord *
|
||||
CMSConcMarkMultiple),
|
||||
_collector(NULL)
|
||||
_collector(NULL),
|
||||
_preconsumptionDirtyCardClosure(NULL)
|
||||
{
|
||||
assert(sizeof(FreeChunk) / BytesPerWord <= MinChunkSize,
|
||||
"FreeChunk is larger than expected");
|
||||
|
|
|
@ -155,6 +155,9 @@ class CompactibleFreeListSpace: public CompactibleSpace {
|
|||
// Used to keep track of limit of sweep for the space
|
||||
HeapWord* _sweep_limit;
|
||||
|
||||
// Used to make the young collector update the mod union table
|
||||
MemRegionClosure* _preconsumptionDirtyCardClosure;
|
||||
|
||||
// Support for compacting cms
|
||||
HeapWord* cross_threshold(HeapWord* start, HeapWord* end);
|
||||
HeapWord* forward(oop q, size_t size, CompactPoint* cp, HeapWord* compact_top);
|
||||
|
@ -356,6 +359,14 @@ class CompactibleFreeListSpace: public CompactibleSpace {
|
|||
void initialize_sequential_subtasks_for_marking(int n_threads,
|
||||
HeapWord* low = NULL);
|
||||
|
||||
virtual MemRegionClosure* preconsumptionDirtyCardClosure() const {
|
||||
return _preconsumptionDirtyCardClosure;
|
||||
}
|
||||
|
||||
void setPreconsumptionDirtyCardClosure(MemRegionClosure* cl) {
|
||||
_preconsumptionDirtyCardClosure = cl;
|
||||
}
|
||||
|
||||
// Space enquiries
|
||||
size_t used() const;
|
||||
size_t free() const;
|
||||
|
|
|
@ -192,7 +192,6 @@ ConcurrentMarkSweepGeneration::ConcurrentMarkSweepGeneration(
|
|||
FreeBlockDictionary<FreeChunk>::DictionaryChoice dictionaryChoice) :
|
||||
CardGeneration(rs, initial_byte_size, level, ct),
|
||||
_dilatation_factor(((double)MinChunkSize)/((double)(CollectedHeap::min_fill_size()))),
|
||||
_debug_collection_type(Concurrent_collection_type),
|
||||
_did_compact(false)
|
||||
{
|
||||
HeapWord* bottom = (HeapWord*) _virtual_space.low();
|
||||
|
@ -612,8 +611,6 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
|
|||
// Clip CMSBootstrapOccupancy between 0 and 100.
|
||||
_bootstrap_occupancy = ((double)CMSBootstrapOccupancy)/(double)100;
|
||||
|
||||
_full_gcs_since_conc_gc = 0;
|
||||
|
||||
// Now tell CMS generations the identity of their collector
|
||||
ConcurrentMarkSweepGeneration::set_collector(this);
|
||||
|
||||
|
@ -626,7 +623,8 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
|
|||
|
||||
// Support for parallelizing young gen rescan
|
||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||
_young_gen = gch->prev_gen(_cmsGen);
|
||||
assert(gch->prev_gen(_cmsGen)->kind() == Generation::ParNew, "CMS can only be used with ParNew");
|
||||
_young_gen = (ParNewGeneration*)gch->prev_gen(_cmsGen);
|
||||
if (gch->supports_inline_contig_alloc()) {
|
||||
_top_addr = gch->top_addr();
|
||||
_end_addr = gch->end_addr();
|
||||
|
@ -1204,14 +1202,6 @@ ConcurrentMarkSweepGeneration::par_promote(int thread_num,
|
|||
return obj;
|
||||
}
|
||||
|
||||
void
|
||||
ConcurrentMarkSweepGeneration::
|
||||
par_promote_alloc_undo(int thread_num,
|
||||
HeapWord* obj, size_t word_sz) {
|
||||
// CMS does not support promotion undo.
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
void
|
||||
ConcurrentMarkSweepGeneration::
|
||||
par_promote_alloc_done(int thread_num) {
|
||||
|
@ -1247,20 +1237,6 @@ bool CMSCollector::shouldConcurrentCollect() {
|
|||
return true;
|
||||
}
|
||||
|
||||
// For debugging purposes, change the type of collection.
|
||||
// If the rotation is not on the concurrent collection
|
||||
// type, don't start a concurrent collection.
|
||||
NOT_PRODUCT(
|
||||
if (RotateCMSCollectionTypes &&
|
||||
(_cmsGen->debug_collection_type() !=
|
||||
ConcurrentMarkSweepGeneration::Concurrent_collection_type)) {
|
||||
assert(_cmsGen->debug_collection_type() !=
|
||||
ConcurrentMarkSweepGeneration::Unknown_collection_type,
|
||||
"Bad cms collection type");
|
||||
return false;
|
||||
}
|
||||
)
|
||||
|
||||
FreelistLocker x(this);
|
||||
// ------------------------------------------------------------------
|
||||
// Print out lots of information which affects the initiation of
|
||||
|
@ -1441,16 +1417,6 @@ void CMSCollector::collect(bool full,
|
|||
size_t size,
|
||||
bool tlab)
|
||||
{
|
||||
if (!UseCMSCollectionPassing && _collectorState > Idling) {
|
||||
// For debugging purposes skip the collection if the state
|
||||
// is not currently idle
|
||||
if (TraceCMSState) {
|
||||
gclog_or_tty->print_cr("Thread " INTPTR_FORMAT " skipped full:%d CMS state %d",
|
||||
Thread::current(), full, _collectorState);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// The following "if" branch is present for defensive reasons.
|
||||
// In the current uses of this interface, it can be replaced with:
|
||||
// assert(!GC_locker.is_active(), "Can't be called otherwise");
|
||||
|
@ -1466,7 +1432,6 @@ void CMSCollector::collect(bool full,
|
|||
return;
|
||||
}
|
||||
acquire_control_and_collect(full, clear_all_soft_refs);
|
||||
_full_gcs_since_conc_gc++;
|
||||
}
|
||||
|
||||
void CMSCollector::request_full_gc(unsigned int full_gc_count, GCCause::Cause cause) {
|
||||
|
@ -1636,31 +1601,21 @@ void CMSCollector::acquire_control_and_collect(bool full,
|
|||
gclog_or_tty->print_cr(" gets control with state %d", _collectorState);
|
||||
}
|
||||
|
||||
// Check if we need to do a compaction, or if not, whether
|
||||
// we need to start the mark-sweep from scratch.
|
||||
bool should_compact = false;
|
||||
bool should_start_over = false;
|
||||
decide_foreground_collection_type(clear_all_soft_refs,
|
||||
&should_compact, &should_start_over);
|
||||
|
||||
NOT_PRODUCT(
|
||||
if (RotateCMSCollectionTypes) {
|
||||
if (_cmsGen->debug_collection_type() ==
|
||||
ConcurrentMarkSweepGeneration::MSC_foreground_collection_type) {
|
||||
should_compact = true;
|
||||
} else if (_cmsGen->debug_collection_type() ==
|
||||
ConcurrentMarkSweepGeneration::MS_foreground_collection_type) {
|
||||
should_compact = false;
|
||||
// Inform cms gen if this was due to partial collection failing.
|
||||
// The CMS gen may use this fact to determine its expansion policy.
|
||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||
if (gch->incremental_collection_will_fail(false /* don't consult_young */)) {
|
||||
assert(!_cmsGen->incremental_collection_failed(),
|
||||
"Should have been noticed, reacted to and cleared");
|
||||
_cmsGen->set_incremental_collection_failed();
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
if (first_state > Idling) {
|
||||
report_concurrent_mode_interruption();
|
||||
}
|
||||
|
||||
set_did_compact(should_compact);
|
||||
if (should_compact) {
|
||||
set_did_compact(true);
|
||||
|
||||
// If the collection is being acquired from the background
|
||||
// collector, there may be references on the discovered
|
||||
// references lists that have NULL referents (being those
|
||||
|
@ -1679,23 +1634,18 @@ NOT_PRODUCT(
|
|||
do_compaction_work(clear_all_soft_refs);
|
||||
|
||||
// Has the GC time limit been exceeded?
|
||||
DefNewGeneration* young_gen = _young_gen->as_DefNewGeneration();
|
||||
size_t max_eden_size = young_gen->max_capacity() -
|
||||
young_gen->to()->capacity() -
|
||||
young_gen->from()->capacity();
|
||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||
size_t max_eden_size = _young_gen->max_capacity() -
|
||||
_young_gen->to()->capacity() -
|
||||
_young_gen->from()->capacity();
|
||||
GCCause::Cause gc_cause = gch->gc_cause();
|
||||
size_policy()->check_gc_overhead_limit(_young_gen->used(),
|
||||
young_gen->eden()->used(),
|
||||
_young_gen->eden()->used(),
|
||||
_cmsGen->max_capacity(),
|
||||
max_eden_size,
|
||||
full,
|
||||
gc_cause,
|
||||
gch->collector_policy());
|
||||
} else {
|
||||
do_mark_sweep_work(clear_all_soft_refs, first_state,
|
||||
should_start_over);
|
||||
}
|
||||
|
||||
// Reset the expansion cause, now that we just completed
|
||||
// a collection cycle.
|
||||
clear_expansion_cause();
|
||||
|
@ -1713,68 +1663,6 @@ void CMSCollector::compute_new_size() {
|
|||
_cmsGen->compute_new_size_free_list();
|
||||
}
|
||||
|
||||
// A work method used by foreground collection to determine
|
||||
// what type of collection (compacting or not, continuing or fresh)
|
||||
// it should do.
|
||||
// NOTE: the intent is to make UseCMSCompactAtFullCollection
|
||||
// and CMSCompactWhenClearAllSoftRefs the default in the future
|
||||
// and do away with the flags after a suitable period.
|
||||
void CMSCollector::decide_foreground_collection_type(
|
||||
bool clear_all_soft_refs, bool* should_compact,
|
||||
bool* should_start_over) {
|
||||
// Normally, we'll compact only if the UseCMSCompactAtFullCollection
|
||||
// flag is set, and we have either requested a System.gc() or
|
||||
// the number of full gc's since the last concurrent cycle
|
||||
// has exceeded the threshold set by CMSFullGCsBeforeCompaction,
|
||||
// or if an incremental collection has failed
|
||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||
assert(gch->collector_policy()->is_generation_policy(),
|
||||
"You may want to check the correctness of the following");
|
||||
// Inform cms gen if this was due to partial collection failing.
|
||||
// The CMS gen may use this fact to determine its expansion policy.
|
||||
if (gch->incremental_collection_will_fail(false /* don't consult_young */)) {
|
||||
assert(!_cmsGen->incremental_collection_failed(),
|
||||
"Should have been noticed, reacted to and cleared");
|
||||
_cmsGen->set_incremental_collection_failed();
|
||||
}
|
||||
*should_compact =
|
||||
UseCMSCompactAtFullCollection &&
|
||||
((_full_gcs_since_conc_gc >= CMSFullGCsBeforeCompaction) ||
|
||||
GCCause::is_user_requested_gc(gch->gc_cause()) ||
|
||||
gch->incremental_collection_will_fail(true /* consult_young */));
|
||||
*should_start_over = false;
|
||||
if (clear_all_soft_refs && !*should_compact) {
|
||||
// We are about to do a last ditch collection attempt
|
||||
// so it would normally make sense to do a compaction
|
||||
// to reclaim as much space as possible.
|
||||
if (CMSCompactWhenClearAllSoftRefs) {
|
||||
// Default: The rationale is that in this case either
|
||||
// we are past the final marking phase, in which case
|
||||
// we'd have to start over, or so little has been done
|
||||
// that there's little point in saving that work. Compaction
|
||||
// appears to be the sensible choice in either case.
|
||||
*should_compact = true;
|
||||
} else {
|
||||
// We have been asked to clear all soft refs, but not to
|
||||
// compact. Make sure that we aren't past the final checkpoint
|
||||
// phase, for that is where we process soft refs. If we are already
|
||||
// past that phase, we'll need to redo the refs discovery phase and
|
||||
// if necessary clear soft refs that weren't previously
|
||||
// cleared. We do so by remembering the phase in which
|
||||
// we came in, and if we are past the refs processing
|
||||
// phase, we'll choose to just redo the mark-sweep
|
||||
// collection from scratch.
|
||||
if (_collectorState > FinalMarking) {
|
||||
// We are past the refs processing phase;
|
||||
// start over and do a fresh synchronous CMS cycle
|
||||
_collectorState = Resetting; // skip to reset to start new cycle
|
||||
reset(false /* == !asynch */);
|
||||
*should_start_over = true;
|
||||
} // else we can continue a possibly ongoing current cycle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A work method used by the foreground collector to do
|
||||
// a mark-sweep-compact.
|
||||
void CMSCollector::do_compaction_work(bool clear_all_soft_refs) {
|
||||
|
@ -1787,10 +1675,6 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) {
|
|||
gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start());
|
||||
|
||||
GCTraceTime t("CMS:MSC ", PrintGCDetails && Verbose, true, NULL, gc_tracer->gc_id());
|
||||
if (PrintGC && Verbose && !(GCCause::is_user_requested_gc(gch->gc_cause()))) {
|
||||
gclog_or_tty->print_cr("Compact ConcurrentMarkSweepGeneration after %d "
|
||||
"collections passed to foreground collector", _full_gcs_since_conc_gc);
|
||||
}
|
||||
|
||||
// Temporarily widen the span of the weak reference processing to
|
||||
// the entire heap.
|
||||
|
@ -1852,7 +1736,7 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) {
|
|||
_collectorState = Resetting;
|
||||
assert(_restart_addr == NULL,
|
||||
"Should have been NULL'd before baton was passed");
|
||||
reset(false /* == !asynch */);
|
||||
reset(false /* == !concurrent */);
|
||||
_cmsGen->reset_after_compaction();
|
||||
_concurrent_cycles_since_last_unload = 0;
|
||||
|
||||
|
@ -1875,45 +1759,10 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) {
|
|||
// in the heap's do_collection() method.
|
||||
}
|
||||
|
||||
// A work method used by the foreground collector to do
|
||||
// a mark-sweep, after taking over from a possibly on-going
|
||||
// concurrent mark-sweep collection.
|
||||
void CMSCollector::do_mark_sweep_work(bool clear_all_soft_refs,
|
||||
CollectorState first_state, bool should_start_over) {
|
||||
if (PrintGC && Verbose) {
|
||||
gclog_or_tty->print_cr("Pass concurrent collection to foreground "
|
||||
"collector with count %d",
|
||||
_full_gcs_since_conc_gc);
|
||||
}
|
||||
switch (_collectorState) {
|
||||
case Idling:
|
||||
if (first_state == Idling || should_start_over) {
|
||||
// The background GC was not active, or should
|
||||
// restarted from scratch; start the cycle.
|
||||
_collectorState = InitialMarking;
|
||||
}
|
||||
// If first_state was not Idling, then a background GC
|
||||
// was in progress and has now finished. No need to do it
|
||||
// again. Leave the state as Idling.
|
||||
break;
|
||||
case Precleaning:
|
||||
// In the foreground case don't do the precleaning since
|
||||
// it is not done concurrently and there is extra work
|
||||
// required.
|
||||
_collectorState = FinalMarking;
|
||||
}
|
||||
collect_in_foreground(clear_all_soft_refs, GenCollectedHeap::heap()->gc_cause());
|
||||
|
||||
// For a mark-sweep, compute_new_size() will be called
|
||||
// in the heap's do_collection() method.
|
||||
}
|
||||
|
||||
|
||||
void CMSCollector::print_eden_and_survivor_chunk_arrays() {
|
||||
DefNewGeneration* dng = _young_gen->as_DefNewGeneration();
|
||||
ContiguousSpace* eden_space = dng->eden();
|
||||
ContiguousSpace* from_space = dng->from();
|
||||
ContiguousSpace* to_space = dng->to();
|
||||
ContiguousSpace* eden_space = _young_gen->eden();
|
||||
ContiguousSpace* from_space = _young_gen->from();
|
||||
ContiguousSpace* to_space = _young_gen->to();
|
||||
// Eden
|
||||
if (_eden_chunk_array != NULL) {
|
||||
gclog_or_tty->print_cr("eden " PTR_FORMAT "-" PTR_FORMAT "-" PTR_FORMAT "(" SIZE_FORMAT ")",
|
||||
|
@ -1989,13 +1838,7 @@ class ReleaseForegroundGC: public StackObj {
|
|||
}
|
||||
};
|
||||
|
||||
// There are separate collect_in_background and collect_in_foreground because of
|
||||
// the different locking requirements of the background collector and the
|
||||
// foreground collector. There was originally an attempt to share
|
||||
// one "collect" method between the background collector and the foreground
|
||||
// collector but the if-then-else required made it cleaner to have
|
||||
// separate methods.
|
||||
void CMSCollector::collect_in_background(bool clear_all_soft_refs, GCCause::Cause cause) {
|
||||
void CMSCollector::collect_in_background(GCCause::Cause cause) {
|
||||
assert(Thread::current()->is_ConcurrentGC_thread(),
|
||||
"A CMS asynchronous collection is only allowed on a CMS thread.");
|
||||
|
||||
|
@ -2036,7 +1879,7 @@ void CMSCollector::collect_in_background(bool clear_all_soft_refs, GCCause::Caus
|
|||
// Used for PrintGC
|
||||
size_t prev_used;
|
||||
if (PrintGC && Verbose) {
|
||||
prev_used = _cmsGen->used(); // XXXPERM
|
||||
prev_used = _cmsGen->used();
|
||||
}
|
||||
|
||||
// The change of the collection state is normally done at this level;
|
||||
|
@ -2116,7 +1959,7 @@ void CMSCollector::collect_in_background(bool clear_all_soft_refs, GCCause::Caus
|
|||
break;
|
||||
case Marking:
|
||||
// initial marking in checkpointRootsInitialWork has been completed
|
||||
if (markFromRoots(true)) { // we were successful
|
||||
if (markFromRoots()) { // we were successful
|
||||
assert(_collectorState == Precleaning, "Collector state should "
|
||||
"have changed");
|
||||
} else {
|
||||
|
@ -2146,10 +1989,9 @@ void CMSCollector::collect_in_background(bool clear_all_soft_refs, GCCause::Caus
|
|||
break;
|
||||
case Sweeping:
|
||||
// final marking in checkpointRootsFinal has been completed
|
||||
sweep(true);
|
||||
sweep();
|
||||
assert(_collectorState == Resizing, "Collector state change "
|
||||
"to Resizing must be done under the free_list_lock");
|
||||
_full_gcs_since_conc_gc = 0;
|
||||
|
||||
case Resizing: {
|
||||
// Sweeping has been completed...
|
||||
|
@ -2222,12 +2064,6 @@ void CMSCollector::collect_in_background(bool clear_all_soft_refs, GCCause::Caus
|
|||
}
|
||||
}
|
||||
|
||||
void CMSCollector::register_foreground_gc_start(GCCause::Cause cause) {
|
||||
if (!_cms_start_registered) {
|
||||
register_gc_start(cause);
|
||||
}
|
||||
}
|
||||
|
||||
void CMSCollector::register_gc_start(GCCause::Cause cause) {
|
||||
_cms_start_registered = true;
|
||||
_gc_timer_cm->register_gc_start();
|
||||
|
@ -2255,120 +2091,6 @@ void CMSCollector::report_heap_summary(GCWhen::Type when) {
|
|||
_gc_tracer_cm->report_metaspace_summary(when, _last_metaspace_summary);
|
||||
}
|
||||
|
||||
void CMSCollector::collect_in_foreground(bool clear_all_soft_refs, GCCause::Cause cause) {
|
||||
assert(_foregroundGCIsActive && !_foregroundGCShouldWait,
|
||||
"Foreground collector should be waiting, not executing");
|
||||
assert(Thread::current()->is_VM_thread(), "A foreground collection"
|
||||
"may only be done by the VM Thread with the world stopped");
|
||||
assert(ConcurrentMarkSweepThread::vm_thread_has_cms_token(),
|
||||
"VM thread should have CMS token");
|
||||
|
||||
// The gc id is created in register_foreground_gc_start if this collection is synchronous
|
||||
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);)
|
||||
COMPILER2_PRESENT(DerivedPointerTableDeactivate dpt_deact);
|
||||
|
||||
HandleMark hm; // Discard invalid handles created during verification
|
||||
|
||||
if (VerifyBeforeGC &&
|
||||
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
|
||||
Universe::verify();
|
||||
}
|
||||
|
||||
// Snapshot the soft reference policy to be used in this collection cycle.
|
||||
ref_processor()->setup_policy(clear_all_soft_refs);
|
||||
|
||||
// Decide if class unloading should be done
|
||||
update_should_unload_classes();
|
||||
|
||||
bool init_mark_was_synchronous = false; // until proven otherwise
|
||||
while (_collectorState != Idling) {
|
||||
if (TraceCMSState) {
|
||||
gclog_or_tty->print_cr("Thread " INTPTR_FORMAT " in CMS state %d",
|
||||
Thread::current(), _collectorState);
|
||||
}
|
||||
switch (_collectorState) {
|
||||
case InitialMarking:
|
||||
register_foreground_gc_start(cause);
|
||||
init_mark_was_synchronous = true; // fact to be exploited in re-mark
|
||||
checkpointRootsInitial(false);
|
||||
assert(_collectorState == Marking, "Collector state should have changed"
|
||||
" within checkpointRootsInitial()");
|
||||
break;
|
||||
case Marking:
|
||||
// initial marking in checkpointRootsInitialWork has been completed
|
||||
if (VerifyDuringGC &&
|
||||
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
|
||||
Universe::verify("Verify before initial mark: ");
|
||||
}
|
||||
{
|
||||
bool res = markFromRoots(false);
|
||||
assert(res && _collectorState == FinalMarking, "Collector state should "
|
||||
"have changed");
|
||||
break;
|
||||
}
|
||||
case FinalMarking:
|
||||
if (VerifyDuringGC &&
|
||||
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
|
||||
Universe::verify("Verify before re-mark: ");
|
||||
}
|
||||
checkpointRootsFinal(false, clear_all_soft_refs,
|
||||
init_mark_was_synchronous);
|
||||
assert(_collectorState == Sweeping, "Collector state should not "
|
||||
"have changed within checkpointRootsFinal()");
|
||||
break;
|
||||
case Sweeping:
|
||||
// final marking in checkpointRootsFinal has been completed
|
||||
if (VerifyDuringGC &&
|
||||
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
|
||||
Universe::verify("Verify before sweep: ");
|
||||
}
|
||||
sweep(false);
|
||||
assert(_collectorState == Resizing, "Incorrect state");
|
||||
break;
|
||||
case Resizing: {
|
||||
// Sweeping has been completed; the actual resize in this case
|
||||
// is done separately; nothing to be done in this state.
|
||||
_collectorState = Resetting;
|
||||
break;
|
||||
}
|
||||
case Resetting:
|
||||
// The heap has been resized.
|
||||
if (VerifyDuringGC &&
|
||||
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
|
||||
Universe::verify("Verify before reset: ");
|
||||
}
|
||||
save_heap_summary();
|
||||
reset(false);
|
||||
assert(_collectorState == Idling, "Collector state should "
|
||||
"have changed");
|
||||
break;
|
||||
case Precleaning:
|
||||
case AbortablePreclean:
|
||||
// Elide the preclean phase
|
||||
_collectorState = FinalMarking;
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
if (TraceCMSState) {
|
||||
gclog_or_tty->print_cr(" Thread " INTPTR_FORMAT " done - next CMS state %d",
|
||||
Thread::current(), _collectorState);
|
||||
}
|
||||
}
|
||||
|
||||
if (VerifyAfterGC &&
|
||||
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
|
||||
Universe::verify();
|
||||
}
|
||||
if (TraceCMSState) {
|
||||
gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT
|
||||
" exiting collection CMS state %d",
|
||||
Thread::current(), _collectorState);
|
||||
}
|
||||
}
|
||||
|
||||
bool CMSCollector::waitForForegroundGC() {
|
||||
bool res = false;
|
||||
assert(ConcurrentMarkSweepThread::cms_thread_has_cms_token(),
|
||||
|
@ -3090,7 +2812,7 @@ ConcurrentMarkSweepGeneration::expand_and_allocate(size_t word_size,
|
|||
}
|
||||
|
||||
// YSR: All of this generation expansion/shrinking stuff is an exact copy of
|
||||
// OneContigSpaceCardGeneration, which makes me wonder if we should move this
|
||||
// TenuredGeneration, which makes me wonder if we should move this
|
||||
// to CardGeneration and share it...
|
||||
bool ConcurrentMarkSweepGeneration::expand(size_t bytes, size_t expand_bytes) {
|
||||
return CardGeneration::expand(bytes, expand_bytes);
|
||||
|
@ -3345,7 +3067,7 @@ class CMSParInitialMarkTask: public CMSParMarkTask {
|
|||
// Checkpoint the roots into this generation from outside
|
||||
// this generation. [Note this initial checkpoint need only
|
||||
// be approximate -- we'll do a catch up phase subsequently.]
|
||||
void CMSCollector::checkpointRootsInitial(bool asynch) {
|
||||
void CMSCollector::checkpointRootsInitial() {
|
||||
assert(_collectorState == InitialMarking, "Wrong collector state");
|
||||
check_correct_thread_executing();
|
||||
TraceCMSMemoryManagerStats tms(_collectorState,GenCollectedHeap::heap()->gc_cause());
|
||||
|
@ -3356,32 +3078,19 @@ void CMSCollector::checkpointRootsInitial(bool asynch) {
|
|||
ReferenceProcessor* rp = ref_processor();
|
||||
SpecializationStats::clear();
|
||||
assert(_restart_addr == NULL, "Control point invariant");
|
||||
if (asynch) {
|
||||
{
|
||||
// acquire locks for subsequent manipulations
|
||||
MutexLockerEx x(bitMapLock(),
|
||||
Mutex::_no_safepoint_check_flag);
|
||||
checkpointRootsInitialWork(asynch);
|
||||
checkpointRootsInitialWork();
|
||||
// enable ("weak") refs discovery
|
||||
rp->enable_discovery(true /*verify_disabled*/, true /*check_no_refs*/);
|
||||
_collectorState = Marking;
|
||||
} else {
|
||||
// (Weak) Refs discovery: this is controlled from genCollectedHeap::do_collection
|
||||
// which recognizes if we are a CMS generation, and doesn't try to turn on
|
||||
// discovery; verify that they aren't meddling.
|
||||
assert(!rp->discovery_is_atomic(),
|
||||
"incorrect setting of discovery predicate");
|
||||
assert(!rp->discovery_enabled(), "genCollectedHeap shouldn't control "
|
||||
"ref discovery for this generation kind");
|
||||
// already have locks
|
||||
checkpointRootsInitialWork(asynch);
|
||||
// now enable ("weak") refs discovery
|
||||
rp->enable_discovery(true /*verify_disabled*/, false /*verify_no_refs*/);
|
||||
_collectorState = Marking;
|
||||
}
|
||||
SpecializationStats::print();
|
||||
}
|
||||
|
||||
void CMSCollector::checkpointRootsInitialWork(bool asynch) {
|
||||
void CMSCollector::checkpointRootsInitialWork() {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "world should be stopped");
|
||||
assert(_collectorState == InitialMarking, "just checking");
|
||||
|
||||
|
@ -3483,9 +3192,9 @@ void CMSCollector::checkpointRootsInitialWork(bool asynch) {
|
|||
verify_overflow_empty();
|
||||
}
|
||||
|
||||
bool CMSCollector::markFromRoots(bool asynch) {
|
||||
bool CMSCollector::markFromRoots() {
|
||||
// we might be tempted to assert that:
|
||||
// assert(asynch == !SafepointSynchronize::is_at_safepoint(),
|
||||
// assert(!SafepointSynchronize::is_at_safepoint(),
|
||||
// "inconsistent argument?");
|
||||
// However that wouldn't be right, because it's possible that
|
||||
// a safepoint is indeed in progress as a younger generation
|
||||
|
@ -3494,8 +3203,6 @@ bool CMSCollector::markFromRoots(bool asynch) {
|
|||
check_correct_thread_executing();
|
||||
verify_overflow_empty();
|
||||
|
||||
bool res;
|
||||
if (asynch) {
|
||||
// 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.
|
||||
|
@ -3503,7 +3210,7 @@ bool CMSCollector::markFromRoots(bool asynch) {
|
|||
CMSTokenSyncWithLocks ts(true, bitMapLock());
|
||||
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
||||
CMSPhaseAccounting pa(this, "mark", _gc_tracer_cm->gc_id(), !PrintGCDetails);
|
||||
res = markFromRootsWork(asynch);
|
||||
bool res = markFromRootsWork();
|
||||
if (res) {
|
||||
_collectorState = Precleaning;
|
||||
} else { // We failed and a foreground collection wants to take over
|
||||
|
@ -3513,18 +3220,11 @@ bool CMSCollector::markFromRoots(bool asynch) {
|
|||
gclog_or_tty->print_cr("bailing out to foreground collection");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
assert(SafepointSynchronize::is_at_safepoint(),
|
||||
"inconsistent with asynch == false");
|
||||
// already have locks
|
||||
res = markFromRootsWork(asynch);
|
||||
_collectorState = FinalMarking;
|
||||
}
|
||||
verify_overflow_empty();
|
||||
return res;
|
||||
}
|
||||
|
||||
bool CMSCollector::markFromRootsWork(bool asynch) {
|
||||
bool CMSCollector::markFromRootsWork() {
|
||||
// iterate over marked bits in bit map, doing a full scan and mark
|
||||
// from these roots using the following algorithm:
|
||||
// . if oop is to the right of the current scan pointer,
|
||||
|
@ -3549,9 +3249,9 @@ bool CMSCollector::markFromRootsWork(bool asynch) {
|
|||
verify_overflow_empty();
|
||||
bool result = false;
|
||||
if (CMSConcurrentMTEnabled && ConcGCThreads > 0) {
|
||||
result = do_marking_mt(asynch);
|
||||
result = do_marking_mt();
|
||||
} else {
|
||||
result = do_marking_st(asynch);
|
||||
result = do_marking_st();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -3591,7 +3291,6 @@ class CMSConcMarkingTerminatorTerminator: public TerminatorTerminator {
|
|||
class CMSConcMarkingTask: public YieldingFlexibleGangTask {
|
||||
CMSCollector* _collector;
|
||||
int _n_workers; // requested/desired # workers
|
||||
bool _asynch;
|
||||
bool _result;
|
||||
CompactibleFreeListSpace* _cms_space;
|
||||
char _pad_front[64]; // padding to ...
|
||||
|
@ -3612,13 +3311,12 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask {
|
|||
public:
|
||||
CMSConcMarkingTask(CMSCollector* collector,
|
||||
CompactibleFreeListSpace* cms_space,
|
||||
bool asynch,
|
||||
YieldingFlexibleWorkGang* workers,
|
||||
OopTaskQueueSet* task_queues):
|
||||
YieldingFlexibleGangTask("Concurrent marking done multi-threaded"),
|
||||
_collector(collector),
|
||||
_cms_space(cms_space),
|
||||
_asynch(asynch), _n_workers(0), _result(true),
|
||||
_n_workers(0), _result(true),
|
||||
_task_queues(task_queues),
|
||||
_term(_n_workers, task_queues, _collector),
|
||||
_bit_map_lock(collector->bitMapLock())
|
||||
|
@ -3645,8 +3343,7 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask {
|
|||
void work(uint worker_id);
|
||||
bool should_yield() {
|
||||
return ConcurrentMarkSweepThread::should_yield()
|
||||
&& !_collector->foregroundGCIsActive()
|
||||
&& _asynch;
|
||||
&& !_collector->foregroundGCIsActive();
|
||||
}
|
||||
|
||||
virtual void coordinator_yield(); // stuff done by coordinator
|
||||
|
@ -3878,8 +3575,7 @@ void CMSConcMarkingTask::do_scan_and_mark(int i, CompactibleFreeListSpace* sp) {
|
|||
Par_MarkFromRootsClosure cl(this, _collector, my_span,
|
||||
&_collector->_markBitMap,
|
||||
work_queue(i),
|
||||
&_collector->_markStack,
|
||||
_asynch);
|
||||
&_collector->_markStack);
|
||||
_collector->_markBitMap.iterate(&cl, my_span.start(), my_span.end());
|
||||
} // else nothing to do for this task
|
||||
} // else nothing to do for this task
|
||||
|
@ -4084,7 +3780,7 @@ void CMSConcMarkingTask::coordinator_yield() {
|
|||
_collector->startTimer();
|
||||
}
|
||||
|
||||
bool CMSCollector::do_marking_mt(bool asynch) {
|
||||
bool CMSCollector::do_marking_mt() {
|
||||
assert(ConcGCThreads > 0 && conc_workers() != NULL, "precondition");
|
||||
int num_workers = AdaptiveSizePolicy::calc_active_conc_workers(
|
||||
conc_workers()->total_workers(),
|
||||
|
@ -4096,7 +3792,6 @@ bool CMSCollector::do_marking_mt(bool asynch) {
|
|||
|
||||
CMSConcMarkingTask tsk(this,
|
||||
cms_space,
|
||||
asynch,
|
||||
conc_workers(),
|
||||
task_queues());
|
||||
|
||||
|
@ -4125,7 +3820,7 @@ bool CMSCollector::do_marking_mt(bool asynch) {
|
|||
// If _restart_addr is non-NULL, a marking stack overflow
|
||||
// occurred; we need to do a fresh marking iteration from the
|
||||
// indicated restart address.
|
||||
if (_foregroundGCIsActive && asynch) {
|
||||
if (_foregroundGCIsActive) {
|
||||
// We may be running into repeated stack overflows, having
|
||||
// reached the limit of the stack size, while making very
|
||||
// slow forward progress. It may be best to bail out and
|
||||
|
@ -4154,14 +3849,14 @@ bool CMSCollector::do_marking_mt(bool asynch) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CMSCollector::do_marking_st(bool asynch) {
|
||||
bool CMSCollector::do_marking_st() {
|
||||
ResourceMark rm;
|
||||
HandleMark hm;
|
||||
|
||||
// Temporarily make refs discovery single threaded (non-MT)
|
||||
ReferenceProcessorMTDiscoveryMutator rp_mut_discovery(ref_processor(), false);
|
||||
MarkFromRootsClosure markFromRootsClosure(this, _span, &_markBitMap,
|
||||
&_markStack, CMSYield && asynch);
|
||||
&_markStack, CMSYield);
|
||||
// the last argument to iterate indicates whether the iteration
|
||||
// should be incremental with periodic yields.
|
||||
_markBitMap.iterate(&markFromRootsClosure);
|
||||
|
@ -4169,7 +3864,7 @@ bool CMSCollector::do_marking_st(bool asynch) {
|
|||
// occurred; we need to do a fresh iteration from the
|
||||
// indicated restart address.
|
||||
while (_restart_addr != NULL) {
|
||||
if (_foregroundGCIsActive && asynch) {
|
||||
if (_foregroundGCIsActive) {
|
||||
// We may be running into repeated stack overflows, having
|
||||
// reached the limit of the stack size, while making very
|
||||
// slow forward progress. It may be best to bail out and
|
||||
|
@ -4390,10 +4085,6 @@ 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,
|
||||
"incorrect type for cast");
|
||||
DefNewGeneration* dng = (DefNewGeneration*)_young_gen;
|
||||
PushAndMarkClosure pam_cl(this, _span, ref_processor(),
|
||||
&_markBitMap, &_modUnionTable,
|
||||
&_markStack, true /* precleaning phase */);
|
||||
|
@ -4406,8 +4097,8 @@ size_t CMSCollector::preclean_work(bool clean_refs, bool clean_survivor) {
|
|||
SurvivorSpacePrecleanClosure
|
||||
sss_cl(this, _span, &_markBitMap, &_markStack,
|
||||
&pam_cl, before_count, CMSYield);
|
||||
dng->from()->object_iterate_careful(&sss_cl);
|
||||
dng->to()->object_iterate_careful(&sss_cl);
|
||||
_young_gen->from()->object_iterate_careful(&sss_cl);
|
||||
_young_gen->to()->object_iterate_careful(&sss_cl);
|
||||
}
|
||||
MarkRefsIntoAndScanClosure
|
||||
mrias_cl(_span, ref_processor(), &_markBitMap, &_modUnionTable,
|
||||
|
@ -4703,8 +4394,7 @@ void CMSCollector::preclean_klasses(MarkRefsIntoAndScanClosure* cl, Mutex* freel
|
|||
verify_overflow_empty();
|
||||
}
|
||||
|
||||
void CMSCollector::checkpointRootsFinal(bool asynch,
|
||||
bool clear_all_soft_refs, bool init_mark_was_synchronous) {
|
||||
void CMSCollector::checkpointRootsFinal() {
|
||||
assert(_collectorState == FinalMarking, "incorrect state transition?");
|
||||
check_correct_thread_executing();
|
||||
// world is stopped at this checkpoint
|
||||
|
@ -4721,7 +4411,7 @@ void CMSCollector::checkpointRootsFinal(bool asynch,
|
|||
_young_gen->used() / K,
|
||||
_young_gen->capacity() / K);
|
||||
}
|
||||
if (asynch) {
|
||||
{
|
||||
if (CMSScavengeBeforeRemark) {
|
||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||
// Temporarily set flag to false, GCH->do_collection will
|
||||
|
@ -4742,21 +4432,14 @@ void CMSCollector::checkpointRootsFinal(bool asynch,
|
|||
FreelistLocker x(this);
|
||||
MutexLockerEx y(bitMapLock(),
|
||||
Mutex::_no_safepoint_check_flag);
|
||||
assert(!init_mark_was_synchronous, "but that's impossible!");
|
||||
checkpointRootsFinalWork(asynch, clear_all_soft_refs, false);
|
||||
} else {
|
||||
// already have all the locks
|
||||
checkpointRootsFinalWork(asynch, clear_all_soft_refs,
|
||||
init_mark_was_synchronous);
|
||||
checkpointRootsFinalWork();
|
||||
}
|
||||
verify_work_stacks_empty();
|
||||
verify_overflow_empty();
|
||||
SpecializationStats::print();
|
||||
}
|
||||
|
||||
void CMSCollector::checkpointRootsFinalWork(bool asynch,
|
||||
bool clear_all_soft_refs, bool init_mark_was_synchronous) {
|
||||
|
||||
void CMSCollector::checkpointRootsFinalWork() {
|
||||
NOT_PRODUCT(GCTraceTime tr("checkpointRootsFinalWork", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());)
|
||||
|
||||
assert(haveFreelistLocks(), "must have free list locks");
|
||||
|
@ -4773,7 +4456,6 @@ void CMSCollector::checkpointRootsFinalWork(bool asynch,
|
|||
assert(haveFreelistLocks(), "must have free list locks");
|
||||
assert_lock_strong(bitMapLock());
|
||||
|
||||
if (!init_mark_was_synchronous) {
|
||||
// We might assume that we need not fill TLAB's when
|
||||
// CMSScavengeBeforeRemark is set, because we may have just done
|
||||
// a scavenge which would have filled all TLAB's -- and besides
|
||||
|
@ -4816,17 +4498,12 @@ void CMSCollector::checkpointRootsFinalWork(bool asynch,
|
|||
do_remark_non_parallel();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
assert(!asynch, "Can't have init_mark_was_synchronous in asynch mode");
|
||||
// The initial mark was stop-world, so there's no rescanning to
|
||||
// do; go straight on to the next step below.
|
||||
}
|
||||
verify_work_stacks_empty();
|
||||
verify_overflow_empty();
|
||||
|
||||
{
|
||||
NOT_PRODUCT(GCTraceTime ts("refProcessingWork", PrintGCDetails, false, _gc_timer_cm, _gc_tracer_cm->gc_id());)
|
||||
refProcessingWork(asynch, clear_all_soft_refs);
|
||||
refProcessingWork();
|
||||
}
|
||||
verify_work_stacks_empty();
|
||||
verify_overflow_empty();
|
||||
|
@ -5006,10 +4683,10 @@ class RemarkKlassClosure : public KlassClosure {
|
|||
};
|
||||
|
||||
void CMSParMarkTask::work_on_young_gen_roots(uint worker_id, OopsInGenClosure* cl) {
|
||||
DefNewGeneration* dng = _collector->_young_gen->as_DefNewGeneration();
|
||||
ContiguousSpace* eden_space = dng->eden();
|
||||
ContiguousSpace* from_space = dng->from();
|
||||
ContiguousSpace* to_space = dng->to();
|
||||
ParNewGeneration* young_gen = _collector->_young_gen;
|
||||
ContiguousSpace* eden_space = young_gen->eden();
|
||||
ContiguousSpace* from_space = young_gen->from();
|
||||
ContiguousSpace* to_space = young_gen->to();
|
||||
|
||||
HeapWord** eca = _collector->_eden_chunk_array;
|
||||
size_t ect = _collector->_eden_chunk_index;
|
||||
|
@ -5478,11 +5155,10 @@ void
|
|||
CMSCollector::
|
||||
initialize_sequential_subtasks_for_young_gen_rescan(int n_threads) {
|
||||
assert(n_threads > 0, "Unexpected n_threads argument");
|
||||
DefNewGeneration* dng = (DefNewGeneration*)_young_gen;
|
||||
|
||||
// Eden space
|
||||
if (!dng->eden()->is_empty()) {
|
||||
SequentialSubTasksDone* pst = dng->eden()->par_seq_tasks();
|
||||
if (!_young_gen->eden()->is_empty()) {
|
||||
SequentialSubTasksDone* pst = _young_gen->eden()->par_seq_tasks();
|
||||
assert(!pst->valid(), "Clobbering existing data?");
|
||||
// Each valid entry in [0, _eden_chunk_index) represents a task.
|
||||
size_t n_tasks = _eden_chunk_index + 1;
|
||||
|
@ -5495,14 +5171,14 @@ initialize_sequential_subtasks_for_young_gen_rescan(int n_threads) {
|
|||
|
||||
// Merge the survivor plab arrays into _survivor_chunk_array
|
||||
if (_survivor_plab_array != NULL) {
|
||||
merge_survivor_plab_arrays(dng->from(), n_threads);
|
||||
merge_survivor_plab_arrays(_young_gen->from(), n_threads);
|
||||
} else {
|
||||
assert(_survivor_chunk_index == 0, "Error");
|
||||
}
|
||||
|
||||
// To space
|
||||
{
|
||||
SequentialSubTasksDone* pst = dng->to()->par_seq_tasks();
|
||||
SequentialSubTasksDone* pst = _young_gen->to()->par_seq_tasks();
|
||||
assert(!pst->valid(), "Clobbering existing data?");
|
||||
// Sets the condition for completion of the subtask (how many threads
|
||||
// need to finish in order to be done).
|
||||
|
@ -5513,7 +5189,7 @@ initialize_sequential_subtasks_for_young_gen_rescan(int n_threads) {
|
|||
|
||||
// From space
|
||||
{
|
||||
SequentialSubTasksDone* pst = dng->from()->par_seq_tasks();
|
||||
SequentialSubTasksDone* pst = _young_gen->from()->par_seq_tasks();
|
||||
assert(!pst->valid(), "Clobbering existing data?");
|
||||
size_t n_tasks = _survivor_chunk_index + 1;
|
||||
assert(n_tasks == 1 || _survivor_chunk_array != NULL, "Error");
|
||||
|
@ -5872,8 +5548,7 @@ void CMSRefProcTaskExecutor::execute(EnqueueTask& task)
|
|||
workers->run_task(&enq_task);
|
||||
}
|
||||
|
||||
void CMSCollector::refProcessingWork(bool asynch, bool clear_all_soft_refs) {
|
||||
|
||||
void CMSCollector::refProcessingWork() {
|
||||
ResourceMark rm;
|
||||
HandleMark hm;
|
||||
|
||||
|
@ -5881,7 +5556,7 @@ void CMSCollector::refProcessingWork(bool asynch, bool clear_all_soft_refs) {
|
|||
assert(rp->span().equals(_span), "Spans should be equal");
|
||||
assert(!rp->enqueuing_is_done(), "Enqueuing should not be complete");
|
||||
// Process weak references.
|
||||
rp->setup_policy(clear_all_soft_refs);
|
||||
rp->setup_policy(false);
|
||||
verify_work_stacks_empty();
|
||||
|
||||
CMSKeepAliveClosure cmsKeepAliveClosure(this, _span, &_markBitMap,
|
||||
|
@ -6005,7 +5680,7 @@ void CMSCollector::check_correct_thread_executing() {
|
|||
}
|
||||
#endif
|
||||
|
||||
void CMSCollector::sweep(bool asynch) {
|
||||
void CMSCollector::sweep() {
|
||||
assert(_collectorState == Sweeping, "just checking");
|
||||
check_correct_thread_executing();
|
||||
verify_work_stacks_empty();
|
||||
|
@ -6019,14 +5694,14 @@ void CMSCollector::sweep(bool asynch) {
|
|||
assert(!_intra_sweep_timer.is_active(), "Should not be active");
|
||||
_intra_sweep_timer.reset();
|
||||
_intra_sweep_timer.start();
|
||||
if (asynch) {
|
||||
{
|
||||
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
||||
CMSPhaseAccounting pa(this, "sweep", _gc_tracer_cm->gc_id(), !PrintGCDetails);
|
||||
// First sweep the old gen
|
||||
{
|
||||
CMSTokenSyncWithLocks ts(true, _cmsGen->freelistLock(),
|
||||
bitMapLock());
|
||||
sweepWork(_cmsGen, asynch);
|
||||
sweepWork(_cmsGen);
|
||||
}
|
||||
|
||||
// Update Universe::_heap_*_at_gc figures.
|
||||
|
@ -6040,13 +5715,6 @@ void CMSCollector::sweep(bool asynch) {
|
|||
Universe::update_heap_info_at_gc();
|
||||
_collectorState = Resizing;
|
||||
}
|
||||
} else {
|
||||
// already have needed locks
|
||||
sweepWork(_cmsGen, asynch);
|
||||
// Update heap occupancy information which is used as
|
||||
// input to soft ref clearing policy at the next gc.
|
||||
Universe::update_heap_info_at_gc();
|
||||
_collectorState = Resizing;
|
||||
}
|
||||
verify_work_stacks_empty();
|
||||
verify_overflow_empty();
|
||||
|
@ -6139,20 +5807,7 @@ void ConcurrentMarkSweepGeneration::update_gc_stats(int current_level,
|
|||
}
|
||||
}
|
||||
|
||||
void ConcurrentMarkSweepGeneration::rotate_debug_collection_type() {
|
||||
if (PrintGCDetails && Verbose) {
|
||||
gclog_or_tty->print("Rotate from %d ", _debug_collection_type);
|
||||
}
|
||||
_debug_collection_type = (CollectionTypes) (_debug_collection_type + 1);
|
||||
_debug_collection_type =
|
||||
(CollectionTypes) (_debug_collection_type % Unknown_collection_type);
|
||||
if (PrintGCDetails && Verbose) {
|
||||
gclog_or_tty->print_cr("to %d ", _debug_collection_type);
|
||||
}
|
||||
}
|
||||
|
||||
void CMSCollector::sweepWork(ConcurrentMarkSweepGeneration* gen,
|
||||
bool asynch) {
|
||||
void CMSCollector::sweepWork(ConcurrentMarkSweepGeneration* gen) {
|
||||
// We iterate over the space(s) underlying this generation,
|
||||
// checking the mark bit map to see if the bits corresponding
|
||||
// to specific blocks are marked or not. Blocks that are
|
||||
|
@ -6180,9 +5835,7 @@ void CMSCollector::sweepWork(ConcurrentMarkSweepGeneration* gen,
|
|||
|
||||
// check that we hold the requisite locks
|
||||
assert(have_cms_token(), "Should hold cms token");
|
||||
assert( (asynch && ConcurrentMarkSweepThread::cms_thread_has_cms_token())
|
||||
|| (!asynch && ConcurrentMarkSweepThread::vm_thread_has_cms_token()),
|
||||
"Should possess CMS token to sweep");
|
||||
assert(ConcurrentMarkSweepThread::cms_thread_has_cms_token(), "Should possess CMS token to sweep");
|
||||
assert_lock_strong(gen->freelistLock());
|
||||
assert_lock_strong(bitMapLock());
|
||||
|
||||
|
@ -6194,8 +5847,7 @@ void CMSCollector::sweepWork(ConcurrentMarkSweepGeneration* gen,
|
|||
gen->setNearLargestChunk();
|
||||
|
||||
{
|
||||
SweepClosure sweepClosure(this, gen, &_markBitMap,
|
||||
CMSYield && asynch);
|
||||
SweepClosure sweepClosure(this, gen, &_markBitMap, CMSYield);
|
||||
gen->cmsSpace()->blk_iterate_careful(&sweepClosure);
|
||||
// We need to free-up/coalesce garbage/blocks from a
|
||||
// co-terminal free run. This is done in the SweepClosure
|
||||
|
@ -6213,8 +5865,8 @@ 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) {
|
||||
if (asynch) {
|
||||
void CMSCollector::reset(bool concurrent) {
|
||||
if (concurrent) {
|
||||
CMSTokenSyncWithLocks ts(true, bitMapLock());
|
||||
|
||||
// If the state is not "Resetting", the foreground thread
|
||||
|
@ -6275,17 +5927,10 @@ void CMSCollector::reset(bool asynch) {
|
|||
_collectorState = Idling;
|
||||
}
|
||||
|
||||
NOT_PRODUCT(
|
||||
if (RotateCMSCollectionTypes) {
|
||||
_cmsGen->rotate_debug_collection_type();
|
||||
}
|
||||
)
|
||||
|
||||
register_gc_end();
|
||||
}
|
||||
|
||||
void CMSCollector::do_CMS_operation(CMS_op_type op, GCCause::Cause gc_cause) {
|
||||
gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps);
|
||||
TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
|
||||
GCTraceTime t(GCCauseString("GC", gc_cause), PrintGC, !PrintGCDetails, NULL, _gc_tracer_cm->gc_id());
|
||||
TraceCollectorStats tcs(counters());
|
||||
|
@ -6293,7 +5938,7 @@ void CMSCollector::do_CMS_operation(CMS_op_type op, GCCause::Cause gc_cause) {
|
|||
switch (op) {
|
||||
case CMS_op_checkpointRootsInitial: {
|
||||
SvcGCMarker sgcm(SvcGCMarker::OTHER);
|
||||
checkpointRootsInitial(true); // asynch
|
||||
checkpointRootsInitial();
|
||||
if (PrintGC) {
|
||||
_cmsGen->printOccupancy("initial-mark");
|
||||
}
|
||||
|
@ -6301,9 +5946,7 @@ void CMSCollector::do_CMS_operation(CMS_op_type op, GCCause::Cause gc_cause) {
|
|||
}
|
||||
case CMS_op_checkpointRootsFinal: {
|
||||
SvcGCMarker sgcm(SvcGCMarker::OTHER);
|
||||
checkpointRootsFinal(true, // asynch
|
||||
false, // !clear_all_soft_refs
|
||||
false); // !init_mark_was_synchronous
|
||||
checkpointRootsFinal();
|
||||
if (PrintGC) {
|
||||
_cmsGen->printOccupancy("remark");
|
||||
}
|
||||
|
@ -7193,8 +6836,7 @@ Par_MarkFromRootsClosure::Par_MarkFromRootsClosure(CMSConcMarkingTask* task,
|
|||
CMSCollector* collector, MemRegion span,
|
||||
CMSBitMap* bit_map,
|
||||
OopTaskQueue* work_queue,
|
||||
CMSMarkStack* overflow_stack,
|
||||
bool should_yield):
|
||||
CMSMarkStack* overflow_stack):
|
||||
_collector(collector),
|
||||
_whole_span(collector->_span),
|
||||
_span(span),
|
||||
|
@ -7202,7 +6844,6 @@ Par_MarkFromRootsClosure::Par_MarkFromRootsClosure(CMSConcMarkingTask* task,
|
|||
_mut(&collector->_modUnionTable),
|
||||
_work_queue(work_queue),
|
||||
_overflow_stack(overflow_stack),
|
||||
_yield(should_yield),
|
||||
_skip_bits(0),
|
||||
_task(task)
|
||||
{
|
||||
|
|
|
@ -608,7 +608,6 @@ class CMSCollector: public CHeapObj<mtGC> {
|
|||
GCHeapSummary _last_heap_summary;
|
||||
MetaspaceSummary _last_metaspace_summary;
|
||||
|
||||
void register_foreground_gc_start(GCCause::Cause cause);
|
||||
void register_gc_start(GCCause::Cause cause);
|
||||
void register_gc_end();
|
||||
void save_heap_summary();
|
||||
|
@ -695,8 +694,6 @@ class CMSCollector: public CHeapObj<mtGC> {
|
|||
int _numYields;
|
||||
size_t _numDirtyCards;
|
||||
size_t _sweep_count;
|
||||
// Number of full gc's since the last concurrent gc.
|
||||
uint _full_gcs_since_conc_gc;
|
||||
|
||||
// Occupancy used for bootstrapping stats
|
||||
double _bootstrap_occupancy;
|
||||
|
@ -724,7 +721,8 @@ class CMSCollector: public CHeapObj<mtGC> {
|
|||
|
||||
private:
|
||||
// Support for parallelizing young gen rescan in CMS remark phase
|
||||
Generation* _young_gen; // the younger gen
|
||||
ParNewGeneration* _young_gen; // the younger gen
|
||||
|
||||
HeapWord** _top_addr; // ... Top of Eden
|
||||
HeapWord** _end_addr; // ... End of Eden
|
||||
Mutex* _eden_chunk_lock;
|
||||
|
@ -760,14 +758,14 @@ class CMSCollector: public CHeapObj<mtGC> {
|
|||
NOT_PRODUCT(bool par_simulate_overflow();) // MT version
|
||||
|
||||
// CMS work methods
|
||||
void checkpointRootsInitialWork(bool asynch); // Initial checkpoint work
|
||||
void checkpointRootsInitialWork(); // Initial checkpoint work
|
||||
|
||||
// A return value of false indicates failure due to stack overflow
|
||||
bool markFromRootsWork(bool asynch); // Concurrent marking work
|
||||
bool markFromRootsWork(); // Concurrent marking work
|
||||
|
||||
public: // FIX ME!!! only for testing
|
||||
bool do_marking_st(bool asynch); // Single-threaded marking
|
||||
bool do_marking_mt(bool asynch); // Multi-threaded marking
|
||||
bool do_marking_st(); // Single-threaded marking
|
||||
bool do_marking_mt(); // Multi-threaded marking
|
||||
|
||||
private:
|
||||
|
||||
|
@ -788,20 +786,19 @@ class CMSCollector: public CHeapObj<mtGC> {
|
|||
void reset_survivor_plab_arrays();
|
||||
|
||||
// Final (second) checkpoint work
|
||||
void checkpointRootsFinalWork(bool asynch, bool clear_all_soft_refs,
|
||||
bool init_mark_was_synchronous);
|
||||
void checkpointRootsFinalWork();
|
||||
// Work routine for parallel version of remark
|
||||
void do_remark_parallel();
|
||||
// Work routine for non-parallel version of remark
|
||||
void do_remark_non_parallel();
|
||||
// Reference processing work routine (during second checkpoint)
|
||||
void refProcessingWork(bool asynch, bool clear_all_soft_refs);
|
||||
void refProcessingWork();
|
||||
|
||||
// Concurrent sweeping work
|
||||
void sweepWork(ConcurrentMarkSweepGeneration* gen, bool asynch);
|
||||
void sweepWork(ConcurrentMarkSweepGeneration* gen);
|
||||
|
||||
// (Concurrent) resetting of support data structures
|
||||
void reset(bool asynch);
|
||||
void reset(bool concurrent);
|
||||
|
||||
// Clear _expansion_cause fields of constituent generations
|
||||
void clear_expansion_cause();
|
||||
|
@ -810,22 +807,10 @@ class CMSCollector: public CHeapObj<mtGC> {
|
|||
// used regions of each generation to limit the extent of sweep
|
||||
void save_sweep_limits();
|
||||
|
||||
// A work method used by foreground collection to determine
|
||||
// what type of collection (compacting or not, continuing or fresh)
|
||||
// it should do.
|
||||
void decide_foreground_collection_type(bool clear_all_soft_refs,
|
||||
bool* should_compact, bool* should_start_over);
|
||||
|
||||
// A work method used by the foreground collector to do
|
||||
// a mark-sweep-compact.
|
||||
void do_compaction_work(bool clear_all_soft_refs);
|
||||
|
||||
// A work method used by the foreground collector to do
|
||||
// a mark-sweep, after taking over from a possibly on-going
|
||||
// concurrent mark-sweep collection.
|
||||
void do_mark_sweep_work(bool clear_all_soft_refs,
|
||||
CollectorState first_state, bool should_start_over);
|
||||
|
||||
// Work methods for reporting concurrent mode interruption or failure
|
||||
bool is_external_interruption();
|
||||
void report_concurrent_mode_interruption();
|
||||
|
@ -868,15 +853,13 @@ class CMSCollector: public CHeapObj<mtGC> {
|
|||
// Locking checks
|
||||
NOT_PRODUCT(static bool have_cms_token();)
|
||||
|
||||
// XXXPERM bool should_collect(bool full, size_t size, bool tlab);
|
||||
bool shouldConcurrentCollect();
|
||||
|
||||
void collect(bool full,
|
||||
bool clear_all_soft_refs,
|
||||
size_t size,
|
||||
bool tlab);
|
||||
void collect_in_background(bool clear_all_soft_refs, GCCause::Cause cause);
|
||||
void collect_in_foreground(bool clear_all_soft_refs, GCCause::Cause cause);
|
||||
void collect_in_background(GCCause::Cause cause);
|
||||
|
||||
// In support of ExplicitGCInvokesConcurrent
|
||||
static void request_full_gc(unsigned int full_gc_count, GCCause::Cause cause);
|
||||
|
@ -928,18 +911,16 @@ class CMSCollector: public CHeapObj<mtGC> {
|
|||
void directAllocated(HeapWord* start, size_t size);
|
||||
|
||||
// Main CMS steps and related support
|
||||
void checkpointRootsInitial(bool asynch);
|
||||
bool markFromRoots(bool asynch); // a return value of false indicates failure
|
||||
void checkpointRootsInitial();
|
||||
bool markFromRoots(); // a return value of false indicates failure
|
||||
// due to stack overflow
|
||||
void preclean();
|
||||
void checkpointRootsFinal(bool asynch, bool clear_all_soft_refs,
|
||||
bool init_mark_was_synchronous);
|
||||
void sweep(bool asynch);
|
||||
void checkpointRootsFinal();
|
||||
void sweep();
|
||||
|
||||
// Check that the currently executing thread is the expected
|
||||
// one (foreground collector or background collector).
|
||||
static void check_correct_thread_executing() PRODUCT_RETURN;
|
||||
// XXXPERM void print_statistics() PRODUCT_RETURN;
|
||||
|
||||
bool is_cms_reachable(HeapWord* addr);
|
||||
|
||||
|
@ -1060,15 +1041,6 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
|
|||
// In support of MinChunkSize being larger than min object size
|
||||
const double _dilatation_factor;
|
||||
|
||||
enum CollectionTypes {
|
||||
Concurrent_collection_type = 0,
|
||||
MS_foreground_collection_type = 1,
|
||||
MSC_foreground_collection_type = 2,
|
||||
Unknown_collection_type = 3
|
||||
};
|
||||
|
||||
CollectionTypes _debug_collection_type;
|
||||
|
||||
// True if a compacting collection was done.
|
||||
bool _did_compact;
|
||||
bool did_compact() { return _did_compact; }
|
||||
|
@ -1152,7 +1124,7 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
|
|||
// hack to allow the collection of the younger gen first if the flag is
|
||||
// set.
|
||||
virtual bool full_collects_younger_generations() const {
|
||||
return UseCMSCompactAtFullCollection && !ScavengeBeforeFullGC;
|
||||
return !ScavengeBeforeFullGC;
|
||||
}
|
||||
|
||||
void space_iterate(SpaceClosure* blk, bool usedOnly = false);
|
||||
|
@ -1180,9 +1152,6 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
|
|||
// Overrides for parallel promotion.
|
||||
virtual oop par_promote(int thread_num,
|
||||
oop obj, markOop m, size_t word_sz);
|
||||
// This one should not be called for CMS.
|
||||
virtual void par_promote_alloc_undo(int thread_num,
|
||||
HeapWord* obj, size_t word_sz);
|
||||
virtual void par_promote_alloc_done(int thread_num);
|
||||
virtual void par_oop_since_save_marks_iterate_done(int thread_num);
|
||||
|
||||
|
@ -1285,8 +1254,6 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
|
|||
virtual const char* short_name() const { return "CMS"; }
|
||||
void print() const;
|
||||
void printOccupancy(const char* s);
|
||||
bool must_be_youngest() const { return false; }
|
||||
bool must_be_oldest() const { return true; }
|
||||
|
||||
// Resize the generation after a compacting GC. The
|
||||
// generation can be treated as a contiguous space
|
||||
|
@ -1295,9 +1262,6 @@ class ConcurrentMarkSweepGeneration: public CardGeneration {
|
|||
// Resize the generation after a non-compacting
|
||||
// collection.
|
||||
void compute_new_size_free_list();
|
||||
|
||||
CollectionTypes debug_collection_type() { return _debug_collection_type; }
|
||||
void rotate_debug_collection_type();
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -1344,7 +1308,6 @@ class Par_MarkFromRootsClosure: public BitMapClosure {
|
|||
CMSBitMap* _mut;
|
||||
OopTaskQueue* _work_queue;
|
||||
CMSMarkStack* _overflow_stack;
|
||||
bool _yield;
|
||||
int _skip_bits;
|
||||
HeapWord* _finger;
|
||||
HeapWord* _threshold;
|
||||
|
@ -1354,8 +1317,7 @@ class Par_MarkFromRootsClosure: public BitMapClosure {
|
|||
MemRegion span,
|
||||
CMSBitMap* bit_map,
|
||||
OopTaskQueue* work_queue,
|
||||
CMSMarkStack* overflow_stack,
|
||||
bool should_yield);
|
||||
CMSMarkStack* overflow_stack);
|
||||
bool do_bit(size_t offset);
|
||||
inline void do_yield_check();
|
||||
|
||||
|
|
|
@ -29,8 +29,9 @@
|
|||
#include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
|
||||
#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
|
||||
#include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
|
||||
#include "gc_implementation/parNew/parNewGeneration.hpp"
|
||||
#include "gc_implementation/shared/gcUtil.hpp"
|
||||
#include "memory/defNewGeneration.hpp"
|
||||
#include "memory/genCollectedHeap.hpp"
|
||||
|
||||
inline void CMSBitMap::clear_all() {
|
||||
assert_locked();
|
||||
|
@ -257,11 +258,11 @@ inline bool CMSCollector::should_abort_preclean() const {
|
|||
}
|
||||
|
||||
inline size_t CMSCollector::get_eden_used() const {
|
||||
return _young_gen->as_DefNewGeneration()->eden()->used();
|
||||
return _young_gen->eden()->used();
|
||||
}
|
||||
|
||||
inline size_t CMSCollector::get_eden_capacity() const {
|
||||
return _young_gen->as_DefNewGeneration()->eden()->capacity();
|
||||
return _young_gen->eden()->capacity();
|
||||
}
|
||||
|
||||
inline bool CMSStats::valid() const {
|
||||
|
@ -398,8 +399,7 @@ inline void MarkFromRootsClosure::do_yield_check() {
|
|||
|
||||
inline void Par_MarkFromRootsClosure::do_yield_check() {
|
||||
if (ConcurrentMarkSweepThread::should_yield() &&
|
||||
!_collector->foregroundGCIsActive() &&
|
||||
_yield) {
|
||||
!_collector->foregroundGCIsActive()) {
|
||||
do_yield_work();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ void ConcurrentMarkSweepThread::run() {
|
|||
if (_should_terminate) break;
|
||||
GCCause::Cause cause = _collector->_full_gc_requested ?
|
||||
_collector->_full_gc_cause : GCCause::_cms_concurrent_mark;
|
||||
_collector->collect_in_background(false, cause);
|
||||
_collector->collect_in_background(cause);
|
||||
}
|
||||
assert(_should_terminate, "just checking");
|
||||
// Check that the state of any protocol for synchronization
|
||||
|
|
|
@ -42,8 +42,12 @@ PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
|
|||
void VM_CMS_Operation::acquire_pending_list_lock() {
|
||||
// The caller may block while communicating
|
||||
// with the SLT thread in order to acquire/release the PLL.
|
||||
ConcurrentMarkSweepThread::slt()->
|
||||
manipulatePLL(SurrogateLockerThread::acquirePLL);
|
||||
SurrogateLockerThread* slt = ConcurrentMarkSweepThread::slt();
|
||||
if (slt != NULL) {
|
||||
slt->manipulatePLL(SurrogateLockerThread::acquirePLL);
|
||||
} else {
|
||||
SurrogateLockerThread::report_missing_slt();
|
||||
}
|
||||
}
|
||||
|
||||
void VM_CMS_Operation::release_and_notify_pending_list_lock() {
|
||||
|
|
|
@ -180,9 +180,32 @@ class ClearBitmapHRClosure : public HeapRegionClosure {
|
|||
}
|
||||
};
|
||||
|
||||
class ParClearNextMarkBitmapTask : public AbstractGangTask {
|
||||
ClearBitmapHRClosure* _cl;
|
||||
HeapRegionClaimer _hrclaimer;
|
||||
bool _suspendible; // If the task is suspendible, workers must join the STS.
|
||||
|
||||
public:
|
||||
ParClearNextMarkBitmapTask(ClearBitmapHRClosure *cl, uint n_workers, bool suspendible) :
|
||||
_cl(cl), _suspendible(suspendible), AbstractGangTask("Parallel Clear Bitmap Task"), _hrclaimer(n_workers) {}
|
||||
|
||||
void work(uint worker_id) {
|
||||
if (_suspendible) {
|
||||
SuspendibleThreadSet::join();
|
||||
}
|
||||
G1CollectedHeap::heap()->heap_region_par_iterate(_cl, worker_id, &_hrclaimer, true);
|
||||
if (_suspendible) {
|
||||
SuspendibleThreadSet::leave();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void CMBitMap::clearAll() {
|
||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||
ClearBitmapHRClosure cl(NULL, this, false /* may_yield */);
|
||||
G1CollectedHeap::heap()->heap_region_iterate(&cl);
|
||||
uint n_workers = g1h->workers()->active_workers();
|
||||
ParClearNextMarkBitmapTask task(&cl, n_workers, false);
|
||||
g1h->workers()->run_task(&task);
|
||||
guarantee(cl.complete(), "Must have completed iteration.");
|
||||
return;
|
||||
}
|
||||
|
@ -861,7 +884,8 @@ void ConcurrentMark::clearNextBitmap() {
|
|||
guarantee(!g1h->mark_in_progress(), "invariant");
|
||||
|
||||
ClearBitmapHRClosure cl(this, _nextMarkBitMap, true /* may_yield */);
|
||||
g1h->heap_region_iterate(&cl);
|
||||
ParClearNextMarkBitmapTask task(&cl, parallel_marking_threads(), true);
|
||||
_parallel_workers->run_task(&task);
|
||||
|
||||
// Clear the liveness counting data. If the marking has been aborted, the abort()
|
||||
// call already did that.
|
||||
|
@ -2099,6 +2123,7 @@ void ConcurrentMark::cleanup() {
|
|||
// 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->allocation_context_stats().update_after_mark();
|
||||
|
||||
g1h->trace_heap_after_concurrent_cycle();
|
||||
}
|
||||
|
@ -3219,7 +3244,6 @@ void ConcurrentMark::aggregate_count_data() {
|
|||
_g1h->set_par_threads(n_workers);
|
||||
_g1h->workers()->run_task(&g1_par_agg_task);
|
||||
_g1h->set_par_threads(0);
|
||||
_g1h->allocation_context_stats().update_at_remark();
|
||||
}
|
||||
|
||||
// Clear the per-worker arrays used to store the per-region counting data
|
||||
|
|
|
@ -280,7 +280,6 @@ void ConcurrentMarkThread::run() {
|
|||
// We may have aborted just before the remark. Do not bother clearing the
|
||||
// bitmap then, as it has been done during mark abort.
|
||||
if (!cm()->has_aborted()) {
|
||||
SuspendibleThreadSetJoiner sts;
|
||||
_cm->clearNextBitmap();
|
||||
} else {
|
||||
assert(!G1VerifyBitmaps || _cm->nextMarkBitmapIsClear(), "Next mark bitmap must be clear");
|
||||
|
|
|
@ -45,7 +45,7 @@ class AllocationContextStats: public StackObj {
|
|||
public:
|
||||
inline void clear() { }
|
||||
inline void update(bool full_gc) { }
|
||||
inline void update_at_remark() { }
|
||||
inline void update_after_mark() { }
|
||||
inline bool available() { return false; }
|
||||
};
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ void G1Allocator::reuse_retained_old_region(EvacuationInfo& evacuation_info,
|
|||
!(retained_region->top() == retained_region->end()) &&
|
||||
!retained_region->is_empty() &&
|
||||
!retained_region->is_humongous()) {
|
||||
retained_region->record_top_and_timestamp();
|
||||
retained_region->record_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
|
||||
|
@ -94,6 +94,9 @@ void G1DefaultAllocator::release_gc_alloc_regions(uint no_of_gc_workers, Evacuat
|
|||
// want either way so no reason to check explicitly for either
|
||||
// condition.
|
||||
_retained_old_gc_alloc_region = old_gc_alloc_region(context)->release();
|
||||
if (_retained_old_gc_alloc_region != NULL) {
|
||||
_retained_old_gc_alloc_region->record_retained_region();
|
||||
}
|
||||
|
||||
if (ResizePLAB) {
|
||||
_g1h->_survivor_plab_stats.adjust_desired_plab_sz(no_of_gc_workers);
|
||||
|
|
|
@ -1222,7 +1222,6 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
|
|||
|
||||
// Timing
|
||||
assert(gc_cause() != GCCause::_java_lang_system_gc || explicit_gc, "invariant");
|
||||
gclog_or_tty->date_stamp(G1Log::fine() && PrintGCDateStamps);
|
||||
TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
|
||||
|
||||
{
|
||||
|
@ -1888,7 +1887,7 @@ jint G1CollectedHeap::initialize() {
|
|||
initialize_reserved_region((HeapWord*)heap_rs.base(), (HeapWord*)(heap_rs.base() + heap_rs.size()));
|
||||
|
||||
// Create the gen rem set (and barrier set) for the entire reserved region.
|
||||
_rem_set = collector_policy()->create_rem_set(reserved_region(), 2);
|
||||
_rem_set = collector_policy()->create_rem_set(reserved_region());
|
||||
set_barrier_set(rem_set()->bs());
|
||||
if (!barrier_set()->is_a(BarrierSet::G1SATBCTLogging)) {
|
||||
vm_exit_during_initialization("G1 requires a G1SATBLoggingCardTableModRefBS");
|
||||
|
@ -2258,6 +2257,7 @@ bool G1CollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) {
|
|||
case GCCause::_java_lang_system_gc: return ExplicitGCInvokesConcurrent;
|
||||
case GCCause::_g1_humongous_allocation: return true;
|
||||
case GCCause::_update_allocation_context_stats_inc: return true;
|
||||
case GCCause::_wb_conc_mark: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
@ -2552,8 +2552,9 @@ void G1CollectedHeap::heap_region_iterate(HeapRegionClosure* cl) const {
|
|||
void
|
||||
G1CollectedHeap::heap_region_par_iterate(HeapRegionClosure* cl,
|
||||
uint worker_id,
|
||||
HeapRegionClaimer *hrclaimer) const {
|
||||
_hrm.par_iterate(cl, worker_id, hrclaimer);
|
||||
HeapRegionClaimer *hrclaimer,
|
||||
bool concurrent) const {
|
||||
_hrm.par_iterate(cl, worker_id, hrclaimer, concurrent);
|
||||
}
|
||||
|
||||
// Clear the cached CSet starting regions and (more importantly)
|
||||
|
@ -4270,10 +4271,11 @@ void G1ParCopyClosure<barrier, do_mark_object>::do_oop_work(T* p) {
|
|||
|
||||
if (state == G1CollectedHeap::InCSet) {
|
||||
oop forwardee;
|
||||
if (obj->is_forwarded()) {
|
||||
forwardee = obj->forwardee();
|
||||
markOop m = obj->mark();
|
||||
if (m->is_marked()) {
|
||||
forwardee = (oop) m->decode_pointer();
|
||||
} else {
|
||||
forwardee = _par_scan_state->copy_to_survivor_space(obj);
|
||||
forwardee = _par_scan_state->copy_to_survivor_space(obj, m);
|
||||
}
|
||||
assert(forwardee != NULL, "forwardee should not be NULL");
|
||||
oopDesc::encode_store_heap_oop(p, forwardee);
|
||||
|
@ -6529,7 +6531,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->record_top_and_timestamp();
|
||||
new_alloc_region->record_timestamp();
|
||||
if (survivor) {
|
||||
new_alloc_region->set_survivor();
|
||||
_hr_printer.alloc(new_alloc_region, G1HRPrinter::Survivor);
|
||||
|
|
|
@ -1380,10 +1380,13 @@ public:
|
|||
// in the range [0..max(ParallelGCThreads-1, 1)]. Applies "blk->doHeapRegion"
|
||||
// to each of the regions, by attempting to claim the region using the
|
||||
// HeapRegionClaimer and, if successful, applying the closure to the claimed
|
||||
// region.
|
||||
// region. The concurrent argument should be set to true if iteration is
|
||||
// performed concurrently, during which no assumptions are made for consistent
|
||||
// attributes of the heap regions (as they might be modified while iterating).
|
||||
void heap_region_par_iterate(HeapRegionClosure* cl,
|
||||
uint worker_id,
|
||||
HeapRegionClaimer* hrclaimer) const;
|
||||
HeapRegionClaimer* hrclaimer,
|
||||
bool concurrent = false) const;
|
||||
|
||||
// Clear the cached cset start regions and (more importantly)
|
||||
// the time stamps. Called when we reset the GC time stamp.
|
||||
|
|
|
@ -1425,6 +1425,18 @@ void G1CollectorPolicy::print_yg_surv_rate_info() const {
|
|||
#endif // PRODUCT
|
||||
}
|
||||
|
||||
bool G1CollectorPolicy::is_young_list_full() {
|
||||
uint young_list_length = _g1->young_list()->length();
|
||||
uint young_list_target_length = _young_list_target_length;
|
||||
return young_list_length >= young_list_target_length;
|
||||
}
|
||||
|
||||
bool G1CollectorPolicy::can_expand_young_list() {
|
||||
uint young_list_length = _g1->young_list()->length();
|
||||
uint young_list_max_length = _young_list_max_length;
|
||||
return young_list_length < young_list_max_length;
|
||||
}
|
||||
|
||||
uint G1CollectorPolicy::max_regions(int purpose) {
|
||||
switch (purpose) {
|
||||
case GCAllocForSurvived:
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#define SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTORPOLICY_HPP
|
||||
|
||||
#include "gc_implementation/g1/collectionSetChooser.hpp"
|
||||
#include "gc_implementation/g1/g1Allocator.hpp"
|
||||
#include "gc_implementation/g1/g1MMUTracker.hpp"
|
||||
#include "memory/collectorPolicy.hpp"
|
||||
|
||||
|
@ -807,7 +808,7 @@ public:
|
|||
|
||||
// If an expansion would be appropriate, because recent GC overhead had
|
||||
// exceeded the desired limit, return an amount to expand by.
|
||||
size_t expansion_amount();
|
||||
virtual size_t expansion_amount();
|
||||
|
||||
// Print tracing information.
|
||||
void print_tracing_info() const;
|
||||
|
@ -826,17 +827,9 @@ public:
|
|||
|
||||
size_t young_list_target_length() const { return _young_list_target_length; }
|
||||
|
||||
bool is_young_list_full() {
|
||||
uint young_list_length = _g1->young_list()->length();
|
||||
uint young_list_target_length = _young_list_target_length;
|
||||
return young_list_length >= young_list_target_length;
|
||||
}
|
||||
bool is_young_list_full();
|
||||
|
||||
bool can_expand_young_list() {
|
||||
uint young_list_length = _g1->young_list()->length();
|
||||
uint young_list_max_length = _young_list_max_length;
|
||||
return young_list_length < young_list_max_length;
|
||||
}
|
||||
bool can_expand_young_list();
|
||||
|
||||
uint young_list_max_length() {
|
||||
return _young_list_max_length;
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* 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_G1COLLECTORPOLICY_EXT_HPP
|
||||
#define SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTORPOLICY_EXT_HPP
|
||||
|
||||
#include "gc_implementation/g1/g1CollectorPolicy.hpp"
|
||||
|
||||
class G1CollectorPolicyExt : public G1CollectorPolicy { };
|
||||
|
||||
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTORPOLICY_EXT_HPP
|
|
@ -150,7 +150,8 @@ void G1ParScanThreadState::trim_queue() {
|
|||
} while (!_refs->is_empty());
|
||||
}
|
||||
|
||||
oop G1ParScanThreadState::copy_to_survivor_space(oop const old) {
|
||||
oop G1ParScanThreadState::copy_to_survivor_space(oop const old,
|
||||
markOop const old_mark) {
|
||||
size_t word_sz = old->size();
|
||||
HeapRegion* from_region = _g1h->heap_region_containing_raw(old);
|
||||
// +1 to make the -1 indexes valid...
|
||||
|
@ -158,9 +159,8 @@ oop G1ParScanThreadState::copy_to_survivor_space(oop const old) {
|
|||
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();
|
||||
uint age = old_mark->has_displaced_mark_helper() ? old_mark->displaced_mark_helper()->age()
|
||||
: old_mark->age();
|
||||
GCAllocPurpose alloc_purpose = g1p->evacuation_destination(from_region, age,
|
||||
word_sz);
|
||||
AllocationContext_t context = from_region->allocation_context();
|
||||
|
@ -196,30 +196,22 @@ oop G1ParScanThreadState::copy_to_survivor_space(oop const old) {
|
|||
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,
|
||||
if (age < markOopDesc::max_age) {
|
||||
age++;
|
||||
}
|
||||
if (old_mark->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();
|
||||
obj->set_mark(old_mark);
|
||||
markOop new_mark = old_mark->displaced_mark_helper()->set_age(age);
|
||||
old_mark->set_displaced_mark_helper(new_mark);
|
||||
} else {
|
||||
m = m->incr_age();
|
||||
obj->set_mark(m);
|
||||
obj->set_mark(old_mark->set_age(age));
|
||||
}
|
||||
age_table()->add(obj, word_sz);
|
||||
age_table()->add(age, word_sz);
|
||||
} else {
|
||||
obj->set_mark(m);
|
||||
obj->set_mark(old_mark);
|
||||
}
|
||||
|
||||
if (G1StringDedup::is_enabled()) {
|
||||
|
|
|
@ -195,7 +195,7 @@ class G1ParScanThreadState : public StackObj {
|
|||
inline void dispatch_reference(StarTask ref);
|
||||
public:
|
||||
|
||||
oop copy_to_survivor_space(oop const obj);
|
||||
oop copy_to_survivor_space(oop const obj, markOop const old_mark);
|
||||
|
||||
void trim_queue();
|
||||
|
||||
|
|
|
@ -41,10 +41,11 @@ template <class T> void G1ParScanThreadState::do_oop_evac(T* p, HeapRegion* from
|
|||
G1CollectedHeap::in_cset_state_t in_cset_state = _g1h->in_cset_state(obj);
|
||||
if (in_cset_state == G1CollectedHeap::InCSet) {
|
||||
oop forwardee;
|
||||
if (obj->is_forwarded()) {
|
||||
forwardee = obj->forwardee();
|
||||
markOop m = obj->mark();
|
||||
if (m->is_marked()) {
|
||||
forwardee = (oop) m->decode_pointer();
|
||||
} else {
|
||||
forwardee = copy_to_survivor_space(obj);
|
||||
forwardee = copy_to_survivor_space(obj, m);
|
||||
}
|
||||
oopDesc::encode_store_heap_oop(p, forwardee);
|
||||
} else if (in_cset_state == G1CollectedHeap::IsHumongous) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue