This commit is contained in:
Phil Race 2014-07-16 15:12:24 -07:00
commit faa69ed489
1672 changed files with 26230 additions and 15651 deletions

View File

@ -263,3 +263,5 @@ efe7dbc6088691757404e0c8745f894e3ca9c022 jdk9-b09
c5495e25c7258ab5f96a1ae14610887d76d2be63 jdk9-b18
2dcf544eb7ed5ac6a3f7813a32e33acea7442405 jdk9-b19
89731ae72a761afdf4262e8b9513f302f6563f89 jdk9-b20
28dd0c7beb3cad9cf95f17b4b5ad87eb447a4084 jdk9-b21
9678e0db8ff6ed845d4c2ee4a3baf7f386a777e5 jdk9-b22

View File

@ -263,3 +263,5 @@ cf22a728521f91a4692b433d39d730a0a1b23155 jdk9-b16
65abab59f783fcf02ff8e133431c252f9e5f07d5 jdk9-b18
75a08df650eb3126bab0c4d15241f5886162393c jdk9-b19
ee4fd72b2ec3d92497f37163352f294aa695c6fb jdk9-b20
9052803f4d01feda28b3d65f2b64dd457d21c7b6 jdk9-b21
8e4bdab4c362aadde2d321f968cd503a2f779e2f jdk9-b22

View File

@ -512,7 +512,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
)
AC_ARG_WITH(sysroot, [AS_HELP_STRING([--with-sysroot],
[use this directory as sysroot)])],
[use this directory as sysroot])],
[SYSROOT=$with_sysroot]
)
@ -531,6 +531,75 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
[BASIC_PREPEND_TO_PATH([EXTRA_PATH],$with_extra_path)]
)
if test "x$OPENJDK_BUILD_OS" = "xmacosx"; then
# detect if Xcode is installed by running xcodebuild -version
# if no Xcode installed, xcodebuild exits with 1
# if Xcode is installed, even if xcode-select is misconfigured, then it exits with 0
if /usr/bin/xcodebuild -version >/dev/null 2>&1; then
# We need to use xcodebuild in the toolchain dir provided by the user, this will
# fall back on the stub binary in /usr/bin/xcodebuild
AC_PATH_PROG([XCODEBUILD], [xcodebuild], [/usr/bin/xcodebuild], [$TOOLCHAIN_PATH])
else
# this should result in SYSROOT being empty, unless --with-sysroot is provided
# when only the command line tools are installed there are no SDKs, so headers
# are copied into the system frameworks
XCODEBUILD=
AC_SUBST(XCODEBUILD)
fi
AC_MSG_CHECKING([for sdk name])
AC_ARG_WITH([sdk-name], [AS_HELP_STRING([--with-sdk-name],
[use the platform SDK of the given name. @<:@macosx@:>@])],
[SDKNAME=$with_sdk_name]
)
AC_MSG_RESULT([$SDKNAME])
# if toolchain path is specified then don't rely on system headers, they may not compile
HAVE_SYSTEM_FRAMEWORK_HEADERS=0
test -z "$TOOLCHAIN_PATH" && \
HAVE_SYSTEM_FRAMEWORK_HEADERS=`test ! -f /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h; echo $?`
if test -z "$SYSROOT"; then
if test -n "$XCODEBUILD"; then
# if we don't have system headers, use default SDK name (last resort)
if test -z "$SDKNAME" -a $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then
SDKNAME=${SDKNAME:-macosx}
fi
if test -n "$SDKNAME"; then
# Call xcodebuild to determine SYSROOT
SYSROOT=`"$XCODEBUILD" -sdk $SDKNAME -version | grep '^Path: ' | sed 's/Path: //'`
fi
else
if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then
AC_MSG_ERROR([No xcodebuild tool and no system framework headers found, use --with-sysroot or --with-sdk-name to provide a path to a valid SDK])
fi
fi
else
# warn user if --with-sdk-name was also set
if test -n "$with_sdk_name"; then
AC_MSG_WARN([Both SYSROOT and --with-sdk-name are set, only SYSROOT will be used])
fi
fi
if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0 -a -z "$SYSROOT"; then
# If no system framework headers, then SYSROOT must be set, or we won't build
AC_MSG_ERROR([Unable to determine SYSROOT and no headers found in /System/Library/Frameworks. Check Xcode configuration, --with-sysroot or --with-sdk-name arguments.])
fi
# Perform a basic sanity test
if test ! -f "$SYSROOT/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then
if test -z "$SYSROOT"; then
AC_MSG_ERROR([Unable to find required framework headers, provide a path to an SDK via --with-sysroot or --with-sdk-name and be sure Xcode is installed properly])
else
AC_MSG_ERROR([Invalid SDK or SYSROOT path, dependent framework headers not found])
fi
fi
# set SDKROOT too, Xcode tools will pick it up
AC_SUBST(SDKROOT,$SYSROOT)
fi
# Prepend the extra path to the global path
BASIC_PREPEND_TO_PATH([PATH],$EXTRA_PATH)

View File

@ -131,6 +131,10 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
-L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
-L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
fi
elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
# Apple only wants -isysroot <path>, but we also need -iframework<path>/System/Library/Frameworks
SYSROOT_CFLAGS="-isysroot \"$SYSROOT\" -iframework\"$SYSROOT/System/Library/Frameworks\""
SYSROOT_LDFLAGS=$SYSROOT_CFLAGS
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
SYSROOT_CFLAGS="--sysroot=\"$SYSROOT\""
SYSROOT_LDFLAGS="--sysroot=\"$SYSROOT\""
@ -143,6 +147,14 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS"
LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS"
fi
# These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
# set this here so it doesn't have to be peppered throughout the forest
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
fi
AC_SUBST(SYSROOT_CFLAGS)
AC_SUBST(SYSROOT_LDFLAGS)
])
@ -644,23 +656,18 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
# Additional macosx handling
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
if test "x$TOOLCHAIN_TYPE" = xgcc; then
# FIXME: This needs to be exported in spec.gmk due to closed legacy code.
# FIXME: clean this up, and/or move it elsewhere.
# Setting these parameters makes it an error to link to macosx APIs that are
# newer than the given OS version and makes the linked binaries compatible
# even if built on a newer version of the OS.
# The expected format is X.Y.Z
MACOSX_VERSION_MIN=10.7.0
AC_SUBST(MACOSX_VERSION_MIN)
# Setting these parameters makes it an error to link to macosx APIs that are
# newer than the given OS version and makes the linked binaries compatible
# even if built on a newer version of the OS.
# The expected format is X.Y.Z
MACOSX_VERSION_MIN=10.7.0
AC_SUBST(MACOSX_VERSION_MIN)
# The macro takes the version with no dots, ex: 1070
# Let the flags variables get resolved in make for easier override on make
# command line.
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
fi
# The macro takes the version with no dots, ex: 1070
# Let the flags variables get resolved in make for easier override on make
# command line.
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
fi
# Setup some hard coded includes

View File

@ -874,6 +874,8 @@ PKGHANDLER
OUTPUT_ROOT
CONF_NAME
SPEC
SDKROOT
XCODEBUILD
BUILD_VARIANT_RELEASE
DEBUG_CLASSFILES
FASTDEBUG
@ -1040,6 +1042,7 @@ with_sysroot
with_tools_dir
with_toolchain_path
with_extra_path
with_sdk_name
with_conf_name
with_builddeps_conf
with_builddeps_server
@ -1074,7 +1077,6 @@ with_extra_cxxflags
with_extra_ldflags
enable_debug_symbols
enable_zip_debug_info
enable_macosx_runtime_support
with_x
with_cups
with_cups_include
@ -1085,6 +1087,7 @@ enable_freetype_bundling
with_alsa
with_alsa_include
with_alsa_lib
with_libjpeg
with_giflib
with_lcms
with_libpng
@ -1841,9 +1844,6 @@ Optional Features:
--disable-debug-symbols disable generation of debug symbols [enabled]
--disable-zip-debug-info
disable zipping of debug-info files [enabled]
--enable-macosx-runtime-support
Deprecated. Option is kept for backwards
compatibility and is ignored
--disable-freetype-bundling
disable bundling of the freetype library with the
build result [enabled on Windows or when using
@ -1872,12 +1872,13 @@ Optional Packages:
optimized (HotSpot build only)) [release]
--with-devkit use this devkit for compilers, tools and resources
--with-sys-root alias for --with-sysroot for backwards compatability
--with-sysroot use this directory as sysroot)
--with-sysroot use this directory as sysroot
--with-tools-dir alias for --with-toolchain-path for backwards
compatibility
--with-toolchain-path prepend these directories when searching for
toolchain binaries (compilers etc)
--with-extra-path prepend these directories to the default path
--with-sdk-name use the platform SDK of the given name. [macosx]
--with-conf-name use this as the name of the configuration [generated
from important configuration options]
--with-builddeps-conf use this configuration file for the builddeps
@ -1942,6 +1943,8 @@ Optional Packages:
headers under PATH/include)
--with-alsa-include specify directory for the alsa include files
--with-alsa-lib specify directory for the alsa library
--with-libjpeg use libjpeg from build system or OpenJDK source
(system, bundled) [bundled]
--with-giflib use giflib from build system or OpenJDK source
(system, bundled) [bundled]
--with-lcms use lcms2 from build system or OpenJDK source
@ -4308,7 +4311,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1402614845
DATE_WHEN_GENERATED=1403557683
###############################################################################
#
@ -13607,7 +13610,7 @@ test -n "$target_alias" &&
VAR_CPU_BITS=32
VAR_CPU_ENDIAN=big
;;
sparcv9)
sparcv9|sparc64)
VAR_CPU=sparcv9
VAR_CPU_ARCH=sparc
VAR_CPU_BITS=64
@ -13738,7 +13741,7 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; }
VAR_CPU_BITS=32
VAR_CPU_ENDIAN=big
;;
sparcv9)
sparcv9|sparc64)
VAR_CPU=sparcv9
VAR_CPU_ARCH=sparc
VAR_CPU_BITS=64
@ -14968,6 +14971,122 @@ if test "${with_extra_path+set}" = set; then :
fi
if test "x$OPENJDK_BUILD_OS" = "xmacosx"; then
# detect if Xcode is installed by running xcodebuild -version
# if no Xcode installed, xcodebuild exits with 1
# if Xcode is installed, even if xcode-select is misconfigured, then it exits with 0
if /usr/bin/xcodebuild -version >/dev/null 2>&1; then
# We need to use xcodebuild in the toolchain dir provided by the user, this will
# fall back on the stub binary in /usr/bin/xcodebuild
# Extract the first word of "xcodebuild", so it can be a program name with args.
set dummy xcodebuild; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_XCODEBUILD+:} false; then :
$as_echo_n "(cached) " >&6
else
case $XCODEBUILD in
[\\/]* | ?:[\\/]*)
ac_cv_path_XCODEBUILD="$XCODEBUILD" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $TOOLCHAIN_PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_XCODEBUILD="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_XCODEBUILD" && ac_cv_path_XCODEBUILD="/usr/bin/xcodebuild"
;;
esac
fi
XCODEBUILD=$ac_cv_path_XCODEBUILD
if test -n "$XCODEBUILD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XCODEBUILD" >&5
$as_echo "$XCODEBUILD" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
else
# this should result in SYSROOT being empty, unless --with-sysroot is provided
# when only the command line tools are installed there are no SDKs, so headers
# are copied into the system frameworks
XCODEBUILD=
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sdk name" >&5
$as_echo_n "checking for sdk name... " >&6; }
# Check whether --with-sdk-name was given.
if test "${with_sdk_name+set}" = set; then :
withval=$with_sdk_name; SDKNAME=$with_sdk_name
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDKNAME" >&5
$as_echo "$SDKNAME" >&6; }
# if toolchain path is specified then don't rely on system headers, they may not compile
HAVE_SYSTEM_FRAMEWORK_HEADERS=0
test -z "$TOOLCHAIN_PATH" && \
HAVE_SYSTEM_FRAMEWORK_HEADERS=`test ! -f /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h; echo $?`
if test -z "$SYSROOT"; then
if test -n "$XCODEBUILD"; then
# if we don't have system headers, use default SDK name (last resort)
if test -z "$SDKNAME" -a $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then
SDKNAME=${SDKNAME:-macosx}
fi
if test -n "$SDKNAME"; then
# Call xcodebuild to determine SYSROOT
SYSROOT=`"$XCODEBUILD" -sdk $SDKNAME -version | grep '^Path: ' | sed 's/Path: //'`
fi
else
if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0; then
as_fn_error $? "No xcodebuild tool and no system framework headers found, use --with-sysroot or --with-sdk-name to provide a path to a valid SDK" "$LINENO" 5
fi
fi
else
# warn user if --with-sdk-name was also set
if test -n "$with_sdk_name"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Both SYSROOT and --with-sdk-name are set, only SYSROOT will be used" >&5
$as_echo "$as_me: WARNING: Both SYSROOT and --with-sdk-name are set, only SYSROOT will be used" >&2;}
fi
fi
if test $HAVE_SYSTEM_FRAMEWORK_HEADERS -eq 0 -a -z "$SYSROOT"; then
# If no system framework headers, then SYSROOT must be set, or we won't build
as_fn_error $? "Unable to determine SYSROOT and no headers found in /System/Library/Frameworks. Check Xcode configuration, --with-sysroot or --with-sdk-name arguments." "$LINENO" 5
fi
# Perform a basic sanity test
if test ! -f "$SYSROOT/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then
if test -z "$SYSROOT"; then
as_fn_error $? "Unable to find required framework headers, provide a path to an SDK via --with-sysroot or --with-sdk-name and be sure Xcode is installed properly" "$LINENO" 5
else
as_fn_error $? "Invalid SDK or SYSROOT path, dependent framework headers not found" "$LINENO" 5
fi
fi
# set SDKROOT too, Xcode tools will pick it up
SDKROOT=$SYSROOT
fi
# Prepend the extra path to the global path
if test "x$EXTRA_PATH" != x; then
@ -26596,21 +26715,28 @@ fi
VALID_TOOLCHAINS=${!toolchain_var_name}
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
# On Mac OS X, default toolchain to clang after Xcode 5
XCODE_VERSION_OUTPUT=`xcodebuild -version 2>&1 | $HEAD -n 1`
$ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null
if test $? -ne 0; then
as_fn_error $? "Failed to determine Xcode version." "$LINENO" 5
fi
XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \
$SED -e 's/^Xcode \([1-9][0-9.]*\)/\1/' | \
$CUT -f 1 -d .`
{ $as_echo "$as_me:${as_lineno-$LINENO}: Xcode major version: $XCODE_MAJOR_VERSION" >&5
if test -n "$XCODEBUILD"; then
# On Mac OS X, default toolchain to clang after Xcode 5
XCODE_VERSION_OUTPUT=`"$XCODEBUILD" -version 2>&1 | $HEAD -n 1`
$ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null
if test $? -ne 0; then
as_fn_error $? "Failed to determine Xcode version." "$LINENO" 5
fi
XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \
$SED -e 's/^Xcode \([1-9][0-9.]*\)/\1/' | \
$CUT -f 1 -d .`
{ $as_echo "$as_me:${as_lineno-$LINENO}: Xcode major version: $XCODE_MAJOR_VERSION" >&5
$as_echo "$as_me: Xcode major version: $XCODE_MAJOR_VERSION" >&6;}
if test $XCODE_MAJOR_VERSION -ge 5; then
DEFAULT_TOOLCHAIN="clang"
if test $XCODE_MAJOR_VERSION -ge 5; then
DEFAULT_TOOLCHAIN="clang"
else
DEFAULT_TOOLCHAIN="gcc"
fi
else
DEFAULT_TOOLCHAIN="gcc"
# If Xcode is not installed, but the command line tools are
# then we can't run xcodebuild. On these systems we should
# default to clang
DEFAULT_TOOLCHAIN="clang"
fi
else
# First toolchain type in the list is the default
@ -41076,6 +41202,10 @@ $as_echo "$tool_specified" >&6; }
-L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
-L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
fi
elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
# Apple only wants -isysroot <path>, but we also need -iframework<path>/System/Library/Frameworks
SYSROOT_CFLAGS="-isysroot \"$SYSROOT\" -iframework\"$SYSROOT/System/Library/Frameworks\""
SYSROOT_LDFLAGS=$SYSROOT_CFLAGS
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
SYSROOT_CFLAGS="--sysroot=\"$SYSROOT\""
SYSROOT_LDFLAGS="--sysroot=\"$SYSROOT\""
@ -41089,6 +41219,14 @@ $as_echo "$tool_specified" >&6; }
LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS"
fi
# These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
# set this here so it doesn't have to be peppered throughout the forest
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
SYSROOT_CFLAGS="$SYSROOT_CFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -F\"$SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks\""
fi
@ -42135,23 +42273,18 @@ fi
# Additional macosx handling
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
if test "x$TOOLCHAIN_TYPE" = xgcc; then
# FIXME: This needs to be exported in spec.gmk due to closed legacy code.
# FIXME: clean this up, and/or move it elsewhere.
# Setting these parameters makes it an error to link to macosx APIs that are
# newer than the given OS version and makes the linked binaries compatible
# even if built on a newer version of the OS.
# The expected format is X.Y.Z
MACOSX_VERSION_MIN=10.7.0
# Setting these parameters makes it an error to link to macosx APIs that are
# newer than the given OS version and makes the linked binaries compatible
# even if built on a newer version of the OS.
# The expected format is X.Y.Z
MACOSX_VERSION_MIN=10.7.0
# The macro takes the version with no dots, ex: 1070
# Let the flags variables get resolved in make for easier override on make
# command line.
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
fi
# The macro takes the version with no dots, ex: 1070
# Let the flags variables get resolved in make for easier override on make
# command line.
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
fi
# Setup some hard coded includes
@ -42654,8 +42787,6 @@ $as_echo_n "checking what is not needed on MacOSX?... " >&6; }
ALSA_NOT_NEEDED=yes
PULSE_NOT_NEEDED=yes
X11_NOT_NEEDED=yes
# If the java runtime framework is disabled, then we need X11.
# This will be adjusted below.
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa pulse x11" >&5
$as_echo "alsa pulse x11" >&6; }
fi
@ -42676,33 +42807,6 @@ $as_echo "alsa" >&6; }
X11_NOT_NEEDED=yes
fi
###############################################################################
#
# Check for MacOSX support for OpenJDK.
#
# Check whether --enable-macosx-runtime-support was given.
if test "${enable_macosx_runtime_support+set}" = set; then :
enableval=$enable_macosx_runtime_support;
fi
if test "x$enable_macosx_runtime_support" != x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --enable-macosx-runtime-support is deprecated and will be ignored." >&5
$as_echo "$as_me: WARNING: Option --enable-macosx-runtime-support is deprecated and will be ignored." >&2;}
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mac OS X Java Framework" >&5
$as_echo_n "checking for Mac OS X Java Framework... " >&6; }
if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: /System/Library/Frameworks/JavaVM.framework" >&5
$as_echo "/System/Library/Frameworks/JavaVM.framework" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
###############################################################################
@ -47573,10 +47677,43 @@ done
# Check for the jpeg library
#
USE_EXTERNAL_LIBJPEG=true
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ljpeg" >&5
$as_echo_n "checking for main in -ljpeg... " >&6; }
if ${ac_cv_lib_jpeg_main+:} false; then :
# Check whether --with-libjpeg was given.
if test "${with_libjpeg+set}" = set; then :
withval=$with_libjpeg;
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for which libjpeg to use" >&5
$as_echo_n "checking for which libjpeg to use... " >&6; }
# default is bundled
DEFAULT_LIBJPEG=bundled
#
# if user didn't specify, use DEFAULT_LIBJPEG
#
if test "x${with_libjpeg}" = "x"; then
with_libjpeg=${DEFAULT_LIBJPEG}
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libjpeg}" >&5
$as_echo "${with_libjpeg}" >&6; }
if test "x${with_libjpeg}" = "xbundled"; then
USE_EXTERNAL_LIBJPEG=false
elif test "x${with_libjpeg}" = "xsystem"; then
ac_fn_cxx_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default"
if test "x$ac_cv_header_jpeglib_h" = xyes; then :
else
as_fn_error $? "--with-libjpeg=system specified, but jpeglib.h not found!" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_CreateDecompress in -ljpeg" >&5
$as_echo_n "checking for jpeg_CreateDecompress in -ljpeg... " >&6; }
if ${ac_cv_lib_jpeg_jpeg_CreateDecompress+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@ -47584,27 +47721,33 @@ LIBS="-ljpeg $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char jpeg_CreateDecompress ();
int
main ()
{
return main ();
return jpeg_CreateDecompress ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_jpeg_main=yes
ac_cv_lib_jpeg_jpeg_CreateDecompress=yes
else
ac_cv_lib_jpeg_main=no
ac_cv_lib_jpeg_jpeg_CreateDecompress=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_main" >&5
$as_echo "$ac_cv_lib_jpeg_main" >&6; }
if test "x$ac_cv_lib_jpeg_main" = xyes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_CreateDecompress" >&5
$as_echo "$ac_cv_lib_jpeg_jpeg_CreateDecompress" >&6; }
if test "x$ac_cv_lib_jpeg_jpeg_CreateDecompress" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBJPEG 1
_ACEOF
@ -47612,13 +47755,16 @@ _ACEOF
LIBS="-ljpeg $LIBS"
else
USE_EXTERNAL_LIBJPEG=false
{ $as_echo "$as_me:${as_lineno-$LINENO}: Will use jpeg decoder bundled with the OpenJDK source" >&5
$as_echo "$as_me: Will use jpeg decoder bundled with the OpenJDK source" >&6;}
as_fn_error $? "--with-libjpeg=system specified, but no libjpeg found" "$LINENO" 5
fi
USE_EXTERNAL_LIBJPEG=true
else
as_fn_error $? "Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'" "$LINENO" 5
fi
###############################################################################
#

View File

@ -69,8 +69,8 @@ ISA_DIR=$(OPENJDK_TARGET_CPU_ISADIR)
# Yet another name for arch used for an extra subdir below the jvm lib.
# Uses i386 and amd64, instead of x86 and x86_64.
LIBARCH=$(OPENJDK_TARGET_CPU_LEGACY_LIB)
# Old name for OPENJDK_TARGET_CPU, uses i586 and amd64, instead of x86 and x86_64.
ARCH=$(OPENJDK_TARGET_CPU_LEGACY)
# Set the cpu architecture
ARCH=$(OPENJDK_TARGET_CPU_ARCH)
# Legacy setting for building for a 64 bit machine.
# If yes then this expands to _LP64:=1
@LP64@

View File

@ -65,8 +65,6 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT],
ALSA_NOT_NEEDED=yes
PULSE_NOT_NEEDED=yes
X11_NOT_NEEDED=yes
# If the java runtime framework is disabled, then we need X11.
# This will be adjusted below.
AC_MSG_RESULT([alsa pulse x11])
fi
@ -83,20 +81,6 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT],
if test "x$SUPPORT_HEADFUL" = xno; then
X11_NOT_NEEDED=yes
fi
###############################################################################
#
# Check for MacOSX support for OpenJDK.
#
BASIC_DEPRECATED_ARG_ENABLE(macosx-runtime-support, macosx_runtime_support)
AC_MSG_CHECKING([for Mac OS X Java Framework])
if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then
AC_MSG_RESULT([/System/Library/Frameworks/JavaVM.framework])
else
AC_MSG_RESULT([no])
fi
])
AC_DEFUN_ONCE([LIB_SETUP_X11],
@ -620,11 +604,36 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
# Check for the jpeg library
#
USE_EXTERNAL_LIBJPEG=true
AC_CHECK_LIB(jpeg, main, [],
[ USE_EXTERNAL_LIBJPEG=false
AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source])
])
AC_ARG_WITH(libjpeg, [AS_HELP_STRING([--with-libjpeg],
[use libjpeg from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
AC_MSG_CHECKING([for which libjpeg to use])
# default is bundled
DEFAULT_LIBJPEG=bundled
#
# if user didn't specify, use DEFAULT_LIBJPEG
#
if test "x${with_libjpeg}" = "x"; then
with_libjpeg=${DEFAULT_LIBJPEG}
fi
AC_MSG_RESULT(${with_libjpeg})
if test "x${with_libjpeg}" = "xbundled"; then
USE_EXTERNAL_LIBJPEG=false
elif test "x${with_libjpeg}" = "xsystem"; then
AC_CHECK_HEADER(jpeglib.h, [],
[ AC_MSG_ERROR([--with-libjpeg=system specified, but jpeglib.h not found!])])
AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, [],
[ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])])
USE_EXTERNAL_LIBJPEG=true
else
AC_MSG_ERROR([Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'])
fi
AC_SUBST(USE_EXTERNAL_LIBJPEG)
###############################################################################

View File

@ -84,7 +84,7 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
VAR_CPU_BITS=32
VAR_CPU_ENDIAN=big
;;
sparcv9)
sparcv9|sparc64)
VAR_CPU=sparcv9
VAR_CPU_ARCH=sparc
VAR_CPU_BITS=64

View File

@ -347,6 +347,9 @@ CPP:=@FIXPATH@ @CPP@
# The linker can be gcc or ld on posix systems, or link.exe on windows systems.
LD:=@FIXPATH@ @LD@
# Xcode SDK path
SDKROOT:=@SDKROOT@
# The linker on older SuSE distros (e.g. on SLES 10) complains with:
# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
# if feeded with a version script which contains named tags.
@ -544,7 +547,7 @@ SETFILE:=@SETFILE@
XATTR:=@XATTR@
JT_HOME:=@JT_HOME@
JTREGEXE:=@JTREGEXE@
XCODEBUILD=@XCODEBUILD@
FIXPATH:=@FIXPATH@
# Where the build output is stored for your convenience.

View File

@ -98,20 +98,27 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE],
VALID_TOOLCHAINS=${!toolchain_var_name}
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
# On Mac OS X, default toolchain to clang after Xcode 5
XCODE_VERSION_OUTPUT=`xcodebuild -version 2>&1 | $HEAD -n 1`
$ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null
if test $? -ne 0; then
AC_MSG_ERROR([Failed to determine Xcode version.])
fi
XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \
$SED -e 's/^Xcode \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/' | \
$CUT -f 1 -d .`
AC_MSG_NOTICE([Xcode major version: $XCODE_MAJOR_VERSION])
if test $XCODE_MAJOR_VERSION -ge 5; then
DEFAULT_TOOLCHAIN="clang"
if test -n "$XCODEBUILD"; then
# On Mac OS X, default toolchain to clang after Xcode 5
XCODE_VERSION_OUTPUT=`"$XCODEBUILD" -version 2>&1 | $HEAD -n 1`
$ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null
if test $? -ne 0; then
AC_MSG_ERROR([Failed to determine Xcode version.])
fi
XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \
$SED -e 's/^Xcode \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/' | \
$CUT -f 1 -d .`
AC_MSG_NOTICE([Xcode major version: $XCODE_MAJOR_VERSION])
if test $XCODE_MAJOR_VERSION -ge 5; then
DEFAULT_TOOLCHAIN="clang"
else
DEFAULT_TOOLCHAIN="gcc"
fi
else
DEFAULT_TOOLCHAIN="gcc"
# If Xcode is not installed, but the command line tools are
# then we can't run xcodebuild. On these systems we should
# default to clang
DEFAULT_TOOLCHAIN="clang"
fi
else
# First toolchain type in the list is the default

View File

@ -263,3 +263,5 @@ e54022d0dd92106fff7f7fe670010cd7e6517ee3 jdk9-b15
77565aaaa2bb814e94817e92d680168052a25395 jdk9-b18
eecc1b6adc7e193d00a0641eb0963add5a4c06e8 jdk9-b19
87f36eecb1665012d01c5cf102494e591c943ea6 jdk9-b20
3615a4e7f0542ca7552ad6454b742c73ee211d8e jdk9-b21
ddc07abf4307855c0dc904cc5c96cc764023a930 jdk9-b22

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -35,7 +35,8 @@ import java.io.IOException;
import java.io.OutputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectOutput;
import java.util.Hashtable;
import java.util.Map;
import java.util.HashMap;
import org.omg.CORBA.INTERNAL;
@ -49,7 +50,7 @@ public abstract class OutputStreamHook extends ObjectOutputStream
*/
private class HookPutFields extends ObjectOutputStream.PutField
{
private Hashtable fields = new Hashtable();
private Map<String,Object> fields = new HashMap<>();
/**
* Put the value of the named boolean field into the persistent field.
@ -140,7 +141,6 @@ public abstract class OutputStreamHook extends ObjectOutputStream
public OutputStreamHook()
throws java.io.IOException {
super();
}
public void defaultWriteObject() throws IOException {

View File

@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -25,9 +25,76 @@
# questions.
#
# Get clones of all nested repositories
sh ./common/bin/hgforest.sh clone "$@" || exit 1
to_stderr() {
echo "$@" >&2
}
error() {
to_stderr "ERROR: $1"
exit ${2:-126}
}
warning() {
to_stderr "WARNING: $1"
}
version_field() {
# rev is typically omitted for minor and major releases
field=`echo ${1}.0 | cut -f ${2} -d .`
if expr 1 + $field >/dev/null 2> /dev/null; then
echo $field
else
echo -1
fi
}
# Version check
# required
reqdmajor=1
reqdminor=4
reqdrev=0
# requested
rqstmajor=2
rqstminor=6
rqstrev=3
# installed
hgwhere="`command -v hg`"
if [ "x$hgwhere" = "x" ]; then
error "Could not locate Mercurial command"
fi
hgversion="`hg --version 2> /dev/null | sed -n -e 's@^Mercurial Distributed SCM (version \([^+]*\).*)\$@\1@p'`"
if [ "x${hgversion}" = "x" ] ; then
error "Could not determine Mercurial version of $hgwhere"
fi
hgmajor="`version_field $hgversion 1`"
hgminor="`version_field $hgversion 2`"
hgrev="`version_field $hgversion 3`"
if [ $hgmajor -eq -1 -o $hgminor -eq -1 -o $hgrev -eq -1 ] ; then
error "Could not determine Mercurial version of $hgwhere from \"$hgversion\""
fi
# Require
if [ $hgmajor -lt $reqdmajor -o \( $hgmajor -eq $reqdmajor -a $hgminor -lt $reqdminor \) -o \( $hgmajor -eq $reqdmajor -a $hgminor -eq $reqdminor -a $hgrev -lt $reqdrev \) ] ; then
error "Mercurial version $reqdmajor.$reqdminor.$reqdrev or later is required. $hgwhere is version $hgversion"
fi
# Request
if [ $hgmajor -lt $rqstmajor -o \( $hgmajor -eq $rqstmajor -a $hgminor -lt $rqstminor \) -o \( $hgmajor -eq $rqstmajor -a $hgminor -eq $rqstminor -a $hgrev -lt $rqstrev \) ] ; then
warning "Mercurial version $rqstmajor.$rqstminor.$rqstrev or later is recommended. $hgwhere is version $hgversion"
fi
# Get clones of all absent nested repositories (harmless if already exist)
sh ./common/bin/hgforest.sh clone "$@" || exit $?
# Update all existing repositories to the latest sources
sh ./common/bin/hgforest.sh pull -u

View File

@ -423,3 +423,5 @@ b14e7c0b7d3ec04127f565cda1d84122e205680c jdk9-b16
871fd128548480095e0dc3fc34c422666baeec75 jdk9-b18
d4cffb3ae6213c66c7522ebffe0349360a45f0ef jdk9-b19
c1af79d122ec9f715fa29312b5e91763f3a4dfc4 jdk9-b20
17b4a5e831b398738feedb0afe75245744510153 jdk9-b21
518d1fcc0799494f013e00e0a94a91b6f212d54f jdk9-b22

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,7 +26,7 @@
#import <Foundation/Foundation.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h>
#include <JavaVM/jni.h>
#include <jni.h>
#import <mach/mach.h>
#import <mach/mach_types.h>

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 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
@ -50,9 +50,9 @@ SOURCES = symtab.c \
ps_core.c
OBJS = $(SOURCES:.c=.o)
OBJSPLUS = MacosxDebuggerLocal.o sadis.o $(OBJS)
EXTINCLUDE = -I/System/Library/Frameworks/JavaVM.framework/Headers -I.
EXTINCLUDE = -I.
EXTCFLAGS = -m64 -D__APPLE__ -framework JavaNativeFoundation
FOUNDATIONFLAGS = -framework Foundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework JavaNativeFoundation -framework Security -framework CoreFoundation
FOUNDATIONFLAGS = -framework Foundation -framework JavaNativeFoundation -framework Security -framework CoreFoundation
LIBSA = $(ARCH)/libsaproc.dylib
endif # Darwin

View File

@ -34,7 +34,7 @@
#include "libproc_md.h"
#endif
#include <linux/ptrace.h>
#include <sys/ptrace.h>
/************************************************************************************

View File

@ -263,7 +263,7 @@ static bool add_new_thread(struct ps_prochandle* ph, pthread_t pthread_id, lwpid
static bool read_lib_info(struct ps_prochandle* ph) {
char fname[32];
char buf[256];
char buf[PATH_MAX];
FILE *fp = NULL;
sprintf(fname, "/proc/%d/maps", ph->pid);
@ -273,10 +273,41 @@ static bool read_lib_info(struct ps_prochandle* ph) {
return false;
}
while(fgets_no_cr(buf, 256, fp)){
char * word[6];
int nwords = split_n_str(buf, 6, word, ' ', '\0');
if (nwords > 5 && find_lib(ph, word[5]) == false) {
while(fgets_no_cr(buf, PATH_MAX, fp)){
char * word[7];
int nwords = split_n_str(buf, 7, word, ' ', '\0');
if (nwords < 6) {
// not a shared library entry. ignore.
continue;
}
// SA does not handle the lines with patterns:
// "[stack]", "[heap]", "[vdso]", "[vsyscall]", etc.
if (word[5][0] == '[') {
// not a shared library entry. ignore.
continue;
}
if (nwords > 6) {
// prelink altered mapfile when the program is running.
// Entries like one below have to be skipped
// /lib64/libc-2.15.so (deleted)
// SO name in entries like one below have to be stripped.
// /lib64/libpthread-2.15.so.#prelink#.EECVts
char *s = strstr(word[5],".#prelink#");
if (s == NULL) {
// No prelink keyword. skip deleted library
print_debug("skip shared object %s deleted by prelink\n", word[5]);
continue;
}
// Fall through
print_debug("rectifying shared object name %s changed by prelink\n", word[5]);
*s = 0;
}
if (find_lib(ph, word[5]) == false) {
intptr_t base;
lib_info* lib;
#ifdef _LP64

View File

@ -0,0 +1,45 @@
/*
* 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.
*
*/
package sun.jvm.hotspot.gc_interface;
//These definitions should be kept in sync with the definitions in the HotSpot
//code.
public enum G1YCType {
Normal ("Normal"),
InitialMark ("Initial Mark"),
DuringMark ("During Mark"),
Mixed ("Mixed"),
G1YCTypeEndSentinel ("Unknown");
private final String value;
G1YCType(String val) {
this.value = val;
}
public String value() {
return value;
}
}

View File

@ -0,0 +1,69 @@
/*
* 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.
*
*/
package sun.jvm.hotspot.gc_interface;
//These definitions should be kept in sync with the definitions in the HotSpot code.
public enum GCCause {
_java_lang_system_gc ("System.gc()"),
_full_gc_alot ("FullGCAlot"),
_scavenge_alot ("ScavengeAlot"),
_allocation_profiler ("Allocation Profiler"),
_jvmti_force_gc ("JvmtiEnv ForceGarbageCollection"),
_gc_locker ("GCLocker Initiated GC"),
_heap_inspection ("Heap Inspection Initiated GC"),
_heap_dump ("Heap Dump Initiated GC"),
_no_gc ("No GC"),
_no_cause_specified ("Unknown GCCause"),
_allocation_failure ("Allocation Failure"),
_tenured_generation_full ("Tenured Generation Full"),
_metadata_GC_threshold ("Metadata GC Threshold"),
_cms_generation_full ("CMS Generation Full"),
_cms_initial_mark ("CMS Initial Mark"),
_cms_final_remark ("CMS Final Remark"),
_cms_concurrent_mark ("CMS Concurrent Mark"),
_old_generation_expanded_on_last_scavenge ("Old Generation Expanded On Last Scavenge"),
_old_generation_too_full_to_scavenge ("Old Generation Too Full To Scavenge"),
_adaptive_size_policy ("Ergonomics"),
_g1_inc_collection_pause ("G1 Evacuation Pause"),
_g1_humongous_allocation ("G1 Humongous Allocation"),
_last_ditch_collection ("Last ditch collection"),
_last_gc_cause ("ILLEGAL VALUE - last gc cause - ILLEGAL VALUE");
private final String value;
GCCause(String val) {
this.value = val;
}
public String value() {
return value;
}
}

View File

@ -0,0 +1,50 @@
/*
* 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.
*
*/
package sun.jvm.hotspot.gc_interface;
//These definitions should be kept in sync with the definitions in the HotSpot code.
public enum GCName {
ParallelOld ("ParallelOld"),
SerialOld ("SerialOld"),
PSMarkSweep ("PSMarkSweep"),
ParallelScavenge ("ParallelScavenge"),
DefNew ("DefNew"),
ParNew ("ParNew"),
G1New ("G1New"),
ConcurrentMarkSweep ("ConcurrentMarkSweep"),
G1Old ("G1Old"),
GCNameEndSentinel ("GCNameEndSentinel");
private final String value;
GCName(String val) {
this.value = val;
}
public String value() {
return value;
}
}

View File

@ -0,0 +1,45 @@
/*
* 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.
*
*/
package sun.jvm.hotspot.gc_interface;
//These definitions should be kept in sync with the definitions in the HotSpot code.
public enum GCWhen {
BeforeGC ("Before GC"),
AfterGC ("After GC"),
GCWhenEndSentinel ("GCWhenEndSentinel");
private final String value;
GCWhen(String val) {
this.value = val;
}
public String value() {
return value;
}
}

View File

@ -0,0 +1,45 @@
/*
* 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.
*
*/
package sun.jvm.hotspot.gc_interface;
//These definitions should be kept in sync with the definitions in the HotSpot code.
public enum ReferenceType {
REF_NONE ("None reference"), // Regular class
REF_OTHER ("Other reference"), // Subclass of java/lang/ref/Reference, but not subclass of one of the classes below
REF_SOFT ("Soft reference"), // Subclass of java/lang/ref/SoftReference
REF_WEAK ("Weak reference"), // Subclass of java/lang/ref/WeakReference
REF_FINAL ("Final reference"), // Subclass of java/lang/ref/FinalReference
REF_PHANTOM ("Phantom reference"); // Subclass of java/lang/ref/PhantomReference
private final String value;
ReferenceType(String val) {
this.value = val;
}
public String value() {
return value;
}
}

View File

@ -56,6 +56,12 @@ public class Universe {
private static AddressField narrowKlassBaseField;
private static CIntegerField narrowKlassShiftField;
public enum NARROW_OOP_MODE {
UnscaledNarrowOop,
ZeroBasedNarrowOop,
HeapBasedNarrowOop
}
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@ -94,7 +100,17 @@ public class Universe {
public Universe() {
}
public static String narrowOopModeToString(NARROW_OOP_MODE mode) {
switch (mode) {
case UnscaledNarrowOop:
return "32-bits Oops";
case ZeroBasedNarrowOop:
return "zero based Compressed Oops";
case HeapBasedNarrowOop:
return "Compressed Oops with base";
}
return "";
}
public CollectedHeap heap() {
try {
return (CollectedHeap) heapConstructor.instantiateWrapperFor(collectedHeapField.getValue());

View File

@ -55,6 +55,7 @@ public class Klass extends Metadata implements ClassConstants {
layoutHelper = new IntField(type.getJIntField("_layout_helper"), 0);
name = type.getAddressField("_name");
accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0);
traceIDField = type.getField("_trace_id");
subklass = new MetadataField(type.getAddressField("_subklass"), 0);
nextSibling = new MetadataField(type.getAddressField("_next_sibling"), 0);
@ -86,6 +87,7 @@ public class Klass extends Metadata implements ClassConstants {
private static CIntField accessFlags;
private static MetadataField subklass;
private static MetadataField nextSibling;
private static sun.jvm.hotspot.types.Field traceIDField;
private Address getValue(AddressField field) {
return addr.getAddressAt(field.getOffset());
@ -106,6 +108,7 @@ public class Klass extends Metadata implements ClassConstants {
public AccessFlags getAccessFlagsObj(){ return new AccessFlags(getAccessFlags()); }
public Klass getSubklassKlass() { return (Klass) subklass.getValue(this); }
public Klass getNextSiblingKlass() { return (Klass) nextSibling.getValue(this); }
public long traceID() { return traceIDField.getJLong(addr); }
// computed access flags - takes care of inner classes etc.
// This is closer to actual source level than getAccessFlags() etc.

View File

@ -54,6 +54,8 @@ public class OopUtilities implements /* imports */ JVMTIThreadState {
private static OopField threadNameField;
private static OopField threadGroupField;
private static LongField threadEETopField;
//tid field is new since 1.5
private static LongField threadTIDField;
// threadStatus field is new since 1.5
private static IntField threadStatusField;
// parkBlocker field is new since 1.6
@ -220,6 +222,7 @@ public class OopUtilities implements /* imports */ JVMTIThreadState {
threadNameField = (OopField) k.findField("name", "[C");
threadGroupField = (OopField) k.findField("group", "Ljava/lang/ThreadGroup;");
threadEETopField = (LongField) k.findField("eetop", "J");
threadTIDField = (LongField) k.findField("tid", "J");
threadStatusField = (IntField) k.findField("threadStatus", "I");
threadParkBlockerField = (OopField) k.findField("parkBlocker",
"Ljava/lang/Object;");
@ -268,6 +271,15 @@ public class OopUtilities implements /* imports */ JVMTIThreadState {
return VM.getVM().getThreads().createJavaThreadWrapper(addr);
}
public static long threadOopGetTID(Oop threadOop) {
initThreadFields();
if (threadTIDField != null) {
return threadTIDField.getValue(threadOop);
} else {
return 0;
}
}
/** returns value of java.lang.Thread.threadStatus field */
public static int threadOopGetThreadStatus(Oop threadOop) {
initThreadFields();

View File

@ -0,0 +1,67 @@
/*
* 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.
*
*/
package sun.jvm.hotspot.opto;
//These definitions should be kept in sync with the definitions in the HotSpot code.
public enum CompilerPhaseType {
PHASE_BEFORE_STRINGOPTS ("Before StringOpts"),
PHASE_AFTER_STRINGOPTS ("After StringOpts"),
PHASE_BEFORE_REMOVEUSELESS ("Before RemoveUseless"),
PHASE_AFTER_PARSING ("After Parsing"),
PHASE_ITER_GVN1 ("Iter GVN 1"),
PHASE_PHASEIDEAL_BEFORE_EA ("PhaseIdealLoop before EA"),
PHASE_ITER_GVN_AFTER_EA ("Iter GVN after EA"),
PHASE_ITER_GVN_AFTER_ELIMINATION ("Iter GVN after eliminating allocations and locks"),
PHASE_PHASEIDEALLOOP1 ("PhaseIdealLoop 1"),
PHASE_PHASEIDEALLOOP2 ("PhaseIdealLoop 2"),
PHASE_PHASEIDEALLOOP3 ("PhaseIdealLoop 3"),
PHASE_CPP1 ("PhaseCPP 1"),
PHASE_ITER_GVN2 ("Iter GVN 2"),
PHASE_PHASEIDEALLOOP_ITERATIONS ("PhaseIdealLoop iterations"),
PHASE_OPTIMIZE_FINISHED ("Optimize finished"),
PHASE_GLOBAL_CODE_MOTION ("Global code motion"),
PHASE_FINAL_CODE ("Final Code"),
PHASE_AFTER_EA ("After Escape Analysis"),
PHASE_BEFORE_CLOOPS ("Before CountedLoop"),
PHASE_AFTER_CLOOPS ("After CountedLoop"),
PHASE_BEFORE_BEAUTIFY_LOOPS ("Before beautify loops"),
PHASE_AFTER_BEAUTIFY_LOOPS ("After beautify loops"),
PHASE_BEFORE_MATCHING ("Before Matching"),
PHASE_INCREMENTAL_INLINE ("Incremental Inline"),
PHASE_INCREMENTAL_BOXING_INLINE ("Incremental Boxing Inline"),
PHASE_END ("End"),
PHASE_FAILURE ("Failure"),
PHASE_NUM_TYPES ("Number of Phase Types");
private final String value;
CompilerPhaseType(String val) {
this.value = val;
}
public String value() {
return value;
}
}

View File

@ -0,0 +1,48 @@
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.runtime;
//These definitions should be kept in sync with the definitions in the HotSpot code.
public enum Flags {
// value origin
DEFAULT ("Default"),
COMMAND_LINE ("Command line"),
ENVIRON_VAR ("Environment variable"),
CONFIG_FILE ("Config file"),
MANAGEMENT ("Management"),
ERGONOMIC ("Ergonomic"),
ATTACH_ON_DEMAND ("Attach on demand"),
INTERNAL ("Internal");
private final String value;
Flags(String val) {
this.value = val;
}
public String value() {
return value;
}
}

View File

@ -41,6 +41,8 @@ public class Thread extends VMObject {
private static AddressField currentPendingMonitorField;
private static AddressField currentWaitingMonitorField;
private static JLongField allocatedBytesField;
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@ -61,6 +63,7 @@ public class Thread extends VMObject {
activeHandlesField = type.getAddressField("_active_handles");
currentPendingMonitorField = type.getAddressField("_current_pending_monitor");
currentWaitingMonitorField = type.getAddressField("_current_waiting_monitor");
allocatedBytesField = type.getJLongField("_allocated_bytes");
}
public Thread(Address addr) {
@ -104,6 +107,10 @@ public class Thread extends VMObject {
return new JNIHandleBlock(a);
}
public long allocatedBytes() {
return allocatedBytesField.getValue(addr);
}
public boolean isVMThread() { return false; }
public boolean isJavaThread() { return false; }
public boolean isCompilerThread() { return false; }

View File

@ -0,0 +1,86 @@
/*
* 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.
*
*/
package sun.jvm.hotspot.runtime;
//These definitions should be kept in sync with the definitions in the HotSpot code.
public enum VMOps {
Dummy,
ThreadStop,
ThreadDump,
PrintThreads,
FindDeadlocks,
ForceSafepoint,
ForceAsyncSafepoint,
Deoptimize,
DeoptimizeFrame,
DeoptimizeAll,
ZombieAll,
UnlinkSymbols,
Verify,
PrintJNI,
HeapDumper,
DeoptimizeTheWorld,
CollectForMetadataAllocation,
GC_HeapInspection,
GenCollectFull,
GenCollectFullConcurrent,
GenCollectForAllocation,
ParallelGCFailedAllocation,
ParallelGCSystemGC,
CGC_Operation,
CMS_Initial_Mark,
CMS_Final_Remark,
G1CollectFull,
G1CollectForAllocation,
G1IncCollectionPause,
EnableBiasedLocking,
RevokeBias,
BulkRevokeBias,
PopulateDumpSharedSpace,
JNIFunctionTableCopier,
RedefineClasses,
GetOwnedMonitorInfo,
GetObjectMonitorUsage,
GetCurrentContendedMonitor,
GetStackTrace,
GetMultipleStackTraces,
GetAllStackTraces,
GetThreadListStackTraces,
GetFrameCount,
GetFrameLocation,
ChangeBreakpoints,
GetOrSetLocal,
GetCurrentLocation,
EnterInterpOnlyMode,
ChangeSingleStep,
HeapWalkOperation,
HeapIterateOperation,
ReportJavaOutOfMemory,
JFRCheckpoint,
Exit,
LinuxDllLoad,
Terminating
}

View File

@ -82,14 +82,12 @@ VM_VER_DEFS = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \
-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \
$(JDK_VER_DEFS)
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
CXXFLAGS = \
${SYSDEFS} \
${INCLUDES} \
${BUILD_TARGET} \
${BUILD_USER} \
${HS_LIB_ARCH} \
${VM_DISTRO}

View File

@ -280,7 +280,10 @@ endif
# optimization control flags (Used by fastdebug and release variants)
OPT_CFLAGS/NOOPT=-O0
ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
ifeq ($(USE_CLANG), true)
# Clang does not support -Og
OPT_CFLAGS/DEBUG=-O0
else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
# Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
OPT_CFLAGS/DEBUG=-Og
else
@ -319,9 +322,20 @@ endif
# Work around some compiler bugs.
ifeq ($(USE_CLANG), true)
# Clang 4.2
ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
OPT_CFLAGS/unsafe.o += -O1
# Clang 5.0
else ifeq ($(shell expr $(CC_VER_MAJOR) = 5 \& $(CC_VER_MINOR) = 0), 1)
OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
OPT_CFLAGS/unsafe.o += -O1
# Clang 5.1
else ifeq ($(shell expr $(CC_VER_MAJOR) = 5 \& $(CC_VER_MINOR) = 1), 1)
OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
OPT_CFLAGS/unsafe.o += -O1
else
$(error "Update compiler workarounds for Clang $(CC_VER_MAJOR).$(CC_VER_MINOR)")
endif
else
# 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
@ -443,7 +457,10 @@ ifeq ($(USE_CLANG), true)
CFLAGS += -flimit-debug-info
endif
ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
ifeq ($(USE_CLANG), true)
# Clang does not support -Og
DEBUG_CFLAGS=-O0
else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
# Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
DEBUG_CFLAGS=-Og
else

View File

@ -64,9 +64,23 @@ ifeq ($(OS_VENDOR), FreeBSD)
else
ifeq ($(OS_VENDOR), Darwin)
SASRCFILES = $(DARWIN_NON_STUB_SASRCFILES)
SALIBS = -g -framework Foundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework JavaNativeFoundation -framework Security -framework CoreFoundation
SALIBS = -g \
-framework Foundation \
-framework JavaNativeFoundation \
-framework Security \
-framework CoreFoundation
#objc compiler blows up on -march=i586, perhaps it should not be included in the macosx intel 32-bit C++ compiles?
SAARCH = $(subst -march=i586,,$(ARCHFLAG))
# This is needed to locate JavaNativeFoundation.framework
ifeq ($(SYSROOT_CFLAGS),)
# this will happen when building without spec.gmk, set SDKROOT to a valid SDK
# path if your system does not have headers installed in the system frameworks
SA_SYSROOT_FLAGS = -F"$(SDKROOT)/System/Library/Frameworks/JavaVM.framework/Frameworks"
else
# Just use SYSROOT_CFLAGS
SA_SYSROOT_FLAGS=$(SYSROOT_CFLAGS)
endif
else
SASRCFILES = $(SASRCDIR)/StubDebuggerLocal.c
SALIBS =
@ -100,14 +114,8 @@ SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
endif
SA_LFLAGS += $(LDFLAGS_HASH_STYLE)
ifeq ($(OS_VENDOR), Darwin)
BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \
-I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") \
-I/System/Library/Frameworks/JavaVM.framework/Headers
else
BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \
-I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]")
endif
BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \
-I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]")
$(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
@ -116,6 +124,7 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
fi
@echo Making SA debugger back-end...
$(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \
$(SA_SYSROOT_FLAGS) \
$(SYMFLAG) $(SAARCH) $(SHARED_FLAG) $(PICFLAG) \
-I$(SASRCDIR) \
-I$(GENERATED) \

View File

@ -81,14 +81,12 @@ VM_VER_DEFS = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \
-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \
$(JDK_VER_DEFS)
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
CXXFLAGS = \
${SYSDEFS} \
${INCLUDES} \
${BUILD_TARGET} \
${BUILD_USER} \
${HS_LIB_ARCH} \
${VM_DISTRO}
@ -295,6 +293,7 @@ endif
$(PRECOMPILED_HEADER):
$(QUIETLY) echo Generating precompiled header $@
$(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)
$(QUIETLY) rm -f $@
$(QUIETLY) $(COMPILE.CXX) $(DEPFLAGS) -x c++-header $(PRECOMPILED_HEADER_SRC) -o $@ $(COMPILE_DONE)
# making the library:

View File

@ -135,8 +135,12 @@ endif
ifeq ($(JDK_MKTG_VERSION),)
JDK_MKTG_VERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
endif
ifeq ($(JDK_VERSION),)
JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
ifeq ($(JDK_VERSION),)
ifeq ($(BUILD_FLAVOR), product)
JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
else
JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)-$(BUILD_FLAVOR)
endif
endif
ifeq ($(FULL_VERSION),)
FULL_VERSION="$(JDK_VERSION)"

View File

@ -69,7 +69,7 @@ ifeq ($(ARCH), ia64)
endif
# sparc
ifeq ($(ARCH), sparc64)
ifneq (,$(findstring $(ARCH), sparc))
ifeq ($(ARCH_DATA_MODEL), 64)
ARCH_DATA_MODEL = 64
MAKE_ARGS += LP64=1
@ -83,30 +83,20 @@ ifeq ($(ARCH), sparc64)
HS_ARCH = sparc
endif
# amd64/x86_64
ifneq (,$(findstring $(ARCH), amd64 x86_64))
# i686/i586 and amd64/x86_64
ifneq (,$(findstring $(ARCH), amd64 x86_64 i686 i586))
ifeq ($(ARCH_DATA_MODEL), 64)
ARCH_DATA_MODEL = 64
MAKE_ARGS += LP64=1
PLATFORM = linux-amd64
VM_PLATFORM = linux_amd64
HS_ARCH = x86
else
ARCH_DATA_MODEL = 32
PLATFORM = linux-i586
VM_PLATFORM = linux_i486
HS_ARCH = x86
# We have to reset ARCH to i686 since SRCARCH relies on it
ARCH = i686
endif
endif
# i686/i586 ie 32-bit x86
ifneq (,$(findstring $(ARCH), i686 i586))
ARCH_DATA_MODEL = 32
PLATFORM = linux-i586
VM_PLATFORM = linux_i486
HS_ARCH = x86
HS_ARCH = x86
endif
# ARM
@ -118,20 +108,18 @@ ifeq ($(ARCH), arm)
endif
# PPC
ifeq ($(ARCH), ppc)
ARCH_DATA_MODEL = 32
PLATFORM = linux-ppc
VM_PLATFORM = linux_ppc
HS_ARCH = ppc
endif
ifneq (,$(findstring $(ARCH), ppc))
ifeq ($(ARCH_DATA_MODEL), 64)
MAKE_ARGS += LP64=1
PLATFORM = linux-ppc64
VM_PLATFORM = linux_ppc64
else
ARCH_DATA_MODEL = 32
PLATFORM = linux-ppc
VM_PLATFORM = linux_ppc
endif
# PPC64
ifeq ($(ARCH), ppc64)
ARCH_DATA_MODEL = 64
MAKE_ARGS += LP64=1
PLATFORM = linux-ppc64
VM_PLATFORM = linux_ppc64
HS_ARCH = ppc
HS_ARCH = ppc
endif
# On 32 bit linux we build server and client, on 64 bit just server.

View File

@ -82,14 +82,12 @@ VM_VER_DEFS = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \
-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \
$(JDK_VER_DEFS)
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
CXXFLAGS = \
${SYSDEFS} \
${INCLUDES} \
${BUILD_TARGET} \
${BUILD_USER} \
${HS_LIB_ARCH} \
${VM_DISTRO}
@ -290,6 +288,7 @@ LINK_VM = $(LINK_LIB.CC)
$(PRECOMPILED_HEADER):
$(QUIETLY) echo Generating precompiled header $@
$(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)
$(QUIETLY) rm -f $@
$(QUIETLY) $(COMPILE.CXX) $(DEPFLAGS) -x c++-header $(PRECOMPILED_HEADER_SRC) -o $@ $(COMPILE_DONE)
# making the library:

View File

@ -29,8 +29,12 @@
# and generate JNI header file for native methods.
include $(GAMMADIR)/make/solaris/makefiles/rules.make
include $(GAMMADIR)/make/defs.make
AGENT_DIR = $(GAMMADIR)/agent
include $(GAMMADIR)/make/sa.files
-include $(HS_ALT_MAKE)/solaris/makefiles/sa.make
GENERATED = ../generated
# tools.jar is needed by the JDI - SA binding

View File

@ -77,14 +77,12 @@ VM_VER_DEFS = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \
-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \
$(JDK_VER_DEFS)
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
CXXFLAGS = \
${SYSDEFS} \
${INCLUDES} \
${BUILD_TARGET} \
${BUILD_USER} \
${HS_LIB_ARCH} \
${VM_DISTRO}

View File

@ -1,6 +1,6 @@
@echo off
REM
REM Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
REM Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
REM
REM This code is free software; you can redistribute it and/or modify it
@ -81,33 +81,8 @@ REM figure out MSC version
for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i
echo **************************************************************
set ProjectFile=%HotSpotBuildSpace%\jvm.vcproj
echo MSC_VER = "%MSC_VER%"
if "%MSC_VER%" == "1200" (
set ProjectFile=%HotSpotBuildSpace%\jvm.dsp
echo Will generate VC6 project {unsupported}
) else (
if "%MSC_VER%" == "1400" (
echo Will generate VC8 {Visual Studio 2005}
) else (
if "%MSC_VER%" == "1500" (
echo Will generate VC9 {Visual Studio 2008}
) else (
if "%MSC_VER%" == "1600" (
echo Will generate VC10 {Visual Studio 2010}
set ProjectFile=%HotSpotBuildSpace%\jvm.vcxproj
) else (
if "%MSC_VER%" == "1700" (
echo Will generate VC10 {compatible with Visual Studio 2012}
echo After opening in VS 2012, click "Update" when prompted.
set ProjectFile=%HotSpotBuildSpace%\jvm.vcxproj
) else (
echo Will generate VC7 project {Visual Studio 2003 .NET}
)
)
)
)
)
echo %ProjectFile%
echo **************************************************************

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -63,28 +63,20 @@ CXX_FLAGS=$(CXX_FLAGS) /Zi
# Based on BUILDARCH we add some flags and select the default compiler name
!if "$(BUILDARCH)" == "ia64"
MACHINE=IA64
DEFAULT_COMPILER_NAME=VS2003
CXX_FLAGS=$(CXX_FLAGS) /D "CC_INTERP" /D "_LP64" /D "IA64"
!endif
!if "$(BUILDARCH)" == "amd64"
MACHINE=AMD64
DEFAULT_COMPILER_NAME=VS2005
CXX_FLAGS=$(CXX_FLAGS) /D "_LP64" /D "AMD64"
LP64=1
!endif
!if "$(BUILDARCH)" == "i486"
MACHINE=I386
DEFAULT_COMPILER_NAME=VS2003
CXX_FLAGS=$(CXX_FLAGS) /D "IA32"
!endif
# Sanity check, this is the default if not amd64, ia64, or i486
!ifndef DEFAULT_COMPILER_NAME
CXX=ARCH_ERROR
!endif
CXX_FLAGS=$(CXX_FLAGS) /D "WIN32" /D "_WINDOWS"
# Must specify this for sharedRuntimeTrig.cpp
CXX_FLAGS=$(CXX_FLAGS) /D "VM_LITTLE_ENDIAN"
@ -112,6 +104,7 @@ CXX_FLAGS=$(CXX_FLAGS) /D TARGET_COMPILER_visCPP
# 1500 is for VS2008
# 1600 is for VS2010
# 1700 is for VS2012
# 1800 is for VS2013
# Do not confuse this MSC_VER with the predefined macro _MSC_VER that the
# compiler provides, when MSC_VER==1399, _MSC_VER will be 1400.
# Normally they are the same, but a pre-release of the VS2005 compilers
@ -119,35 +112,6 @@ CXX_FLAGS=$(CXX_FLAGS) /D TARGET_COMPILER_visCPP
# closer to VS2003 in terms of option spellings, so we use 1399 for that
# 1400 version that really isn't 1400.
# See the file get_msc_ver.sh for more info.
!if "x$(MSC_VER)" == "x"
COMPILER_NAME=$(DEFAULT_COMPILER_NAME)
!else
!if "$(MSC_VER)" == "1200"
COMPILER_NAME=VC6
!endif
!if "$(MSC_VER)" == "1300"
COMPILER_NAME=VS2003
!endif
!if "$(MSC_VER)" == "1310"
COMPILER_NAME=VS2003
!endif
!if "$(MSC_VER)" == "1399"
# Compiler might say 1400, but if it's 14.00.30701, it isn't really VS2005
COMPILER_NAME=VS2003
!endif
!if "$(MSC_VER)" == "1400"
COMPILER_NAME=VS2005
!endif
!if "$(MSC_VER)" == "1500"
COMPILER_NAME=VS2008
!endif
!if "$(MSC_VER)" == "1600"
COMPILER_NAME=VS2010
!endif
!if "$(MSC_VER)" == "1700"
COMPILER_NAME=VS2012
!endif
!endif
# By default, we do not want to use the debug version of the msvcrt.dll file
# but if MFC_DEBUG is defined in the environment it will be used.
@ -165,60 +129,6 @@ MS_RUNTIME_OPTION = $(MS_RUNTIME_OPTION) $(STATIC_CPPLIB_OPTION)
!endif
CXX_FLAGS=$(CXX_FLAGS) $(MS_RUNTIME_OPTION)
# How /GX option is spelled
GX_OPTION = /GX
# Optimization settings for various versions of the compilers and types of
# builds. Three basic sets of settings: product, fastdebug, and debug.
# These get added into CXX_FLAGS as needed by other makefiles.
!if "$(COMPILER_NAME)" == "VC6"
PRODUCT_OPT_OPTION = /Ox /Os /Gy /GF
FASTDEBUG_OPT_OPTION = /Ox /Os /Gy /GF
DEBUG_OPT_OPTION = /Od
!endif
!if "$(COMPILER_NAME)" == "VS2003"
PRODUCT_OPT_OPTION = /O2 /Oy-
FASTDEBUG_OPT_OPTION = /O2 /Oy-
DEBUG_OPT_OPTION = /Od
SAFESEH_FLAG = /SAFESEH
!endif
!if "$(COMPILER_NAME)" == "VS2005"
PRODUCT_OPT_OPTION = /O2 /Oy-
FASTDEBUG_OPT_OPTION = /O2 /Oy-
DEBUG_OPT_OPTION = /Od
GX_OPTION = /EHsc
# This VS2005 compiler has /GS as a default and requires bufferoverflowU.lib
# on the link command line, otherwise we get missing __security_check_cookie
# externals at link time. Even with /GS-, you need bufferoverflowU.lib.
# NOTE: Currently we decided to not use /GS-
BUFFEROVERFLOWLIB = bufferoverflowU.lib
LD_FLAGS = /manifest $(LD_FLAGS) $(BUFFEROVERFLOWLIB)
# Manifest Tool - used in VS2005 and later to adjust manifests stored
# as resources inside build artifacts.
!if "x$(MT)" == "x"
MT=mt.exe
!endif
SAFESEH_FLAG = /SAFESEH
!endif
!if "$(COMPILER_NAME)" == "VS2008"
PRODUCT_OPT_OPTION = /O2 /Oy-
FASTDEBUG_OPT_OPTION = /O2 /Oy-
DEBUG_OPT_OPTION = /Od
GX_OPTION = /EHsc
LD_FLAGS = /manifest $(LD_FLAGS)
MP_FLAG = /MP
# Manifest Tool - used in VS2005 and later to adjust manifests stored
# as resources inside build artifacts.
!if "x$(MT)" == "x"
MT=mt.exe
!endif
SAFESEH_FLAG = /SAFESEH
!endif
!if "$(COMPILER_NAME)" == "VS2010"
PRODUCT_OPT_OPTION = /O2 /Oy-
FASTDEBUG_OPT_OPTION = /O2 /Oy-
DEBUG_OPT_OPTION = /Od
@ -233,26 +143,6 @@ MT=mt.exe
!if "$(BUILDARCH)" == "i486"
LD_FLAGS = /SAFESEH $(LD_FLAGS)
!endif
!endif
!if "$(COMPILER_NAME)" == "VS2012"
PRODUCT_OPT_OPTION = /O2 /Oy-
FASTDEBUG_OPT_OPTION = /O2 /Oy-
DEBUG_OPT_OPTION = /Od
GX_OPTION = /EHsc
LD_FLAGS = /manifest $(LD_FLAGS)
MP_FLAG = /MP
# Manifest Tool - used in VS2005 and later to adjust manifests stored
# as resources inside build artifacts.
!if "x$(MT)" == "x"
MT=mt.exe
!endif
SAFESEH_FLAG = /SAFESEH
!endif
!if "$(BUILDARCH)" == "i486"
LD_FLAGS = $(SAFESEH_FLAG) $(LD_FLAGS)
!endif
CXX_FLAGS = $(CXX_FLAGS) $(MP_FLAG)

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2003, 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
@ -49,35 +49,8 @@ BOOT_TARGET_CLASS_VERSION=6
JAVAC_FLAGS=-g -encoding ascii
BOOTSTRAP_JAVAC_FLAGS=$(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
ProjectFile=jvm.vcproj
!if "$(MSC_VER)" == "1200"
VcVersion=VC6
ProjectFile=jvm.dsp
!elseif "$(MSC_VER)" == "1400"
VcVersion=VC8
!elseif "$(MSC_VER)" == "1500"
VcVersion=VC9
!elseif "$(MSC_VER)" == "1600"
VcVersion=VC10
ProjectFile=jvm.vcxproj
!elseif "$(MSC_VER)" == "1700"
# This is VS2012, but it loads VS10 projects just fine (and will
# VS2012 and VS2013 loads VS10 projects just fine (and will
# upgrade them automatically to VS2012 format).
VcVersion=VC10
ProjectFile=jvm.vcxproj
!else
VcVersion=VC7
!endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2003, 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
@ -38,6 +38,22 @@ checkAndBuildSA::
GENERATED = ../generated
HS_COMMON_SRC_REL = src
!if "$(OPENJDK)" != "true"
HS_ALT_SRC_REL=src/closed
HS_ALT_SRC = $(WorkSpace)/$(HS_ALT_SRC_REL)
!ifndef HS_ALT_MAKE
HS_ALT_MAKE=$(WorkSpace)/make/closed
!endif
!endif
HS_COMMON_SRC = $(WorkSpace)/$(HS_COMMON_SRC_REL)
!ifdef HS_ALT_MAKE
!include $(HS_ALT_MAKE)/windows/makefiles/sa.make
!endif
# tools.jar is needed by the JDI - SA binding
SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
@ -85,14 +101,9 @@ checkAndBuildSA:: $(SAWINDBG)
# will be useful to have the assertion checks in place
!if "$(BUILDARCH)" == "ia64"
SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -c
SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -FD -c
!elseif "$(BUILDARCH)" == "amd64"
SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -YX -FD -c
!if "$(COMPILER_NAME)" == "VS2005"
# On amd64, VS2005 compiler requires bufferoverflowU.lib on the link command line,
# otherwise we get missing __security_check_cookie externals at link time.
SA_LD_FLAGS = bufferoverflowU.lib
!endif
SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -FD -c
!else
SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -FD -RTC1 -c
!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 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
@ -27,9 +27,9 @@
all: checkCL checkLink
checkCL:
@ if "$(MSC_VER)" NEQ "1310" if "$(MSC_VER)" NEQ "1399" if "$(MSC_VER)" NEQ "1400" if "$(MSC_VER)" NEQ "1500" if "$(MSC_VER)" NEQ "1600" if "$(MSC_VER)" NEQ "1700" \
echo *** WARNING *** unrecognized cl.exe version $(MSC_VER) ($(RAW_MSC_VER)). Use FORCE_MSC_VER to override automatic detection.
@ if "$(MSC_VER)" NEQ "1600" if "$(MSC_VER)" NEQ "1700" if "$(MSC_VER)" NEQ "1800" \
echo *** WARNING *** Unsupported cl.exe version detected: $(MSC_VER) ($(RAW_MSC_VER)), only 1600/1700/1800 (Visual Studio 2010/2012/2013) are supported.
checkLink:
@ if "$(LD_VER)" NEQ "710" if "$(LD_VER)" NEQ "800" if "$(LD_VER)" NEQ "900" if "$(LD_VER)" NEQ "1000" if "$(LD_VER)" NEQ "1100" \
echo *** WARNING *** unrecognized link.exe version $(LD_VER) ($(RAW_LD_VER)). Use FORCE_LD_VER to override automatic detection.
@ if "$(LD_VER)" NEQ "1000" if "$(LD_VER)" NEQ "1100" if "$(LD_VER)" NEQ "1200" \
echo *** WARNING *** Unsupported link.exe version detected: $(LD_VER) ($(RAW_LD_VER)), only 1000/1100/1200 (Visual Studio 2010/2012/2013) are supported.

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -132,7 +132,7 @@ CXX_DONT_USE_PCH=/D DONT_USE_PRECOMPILED_HEADER
!if "$(USE_PRECOMPILED_HEADER)" != "0"
CXX_USE_PCH=/Fp"vm.pch" /Yu"precompiled.hpp"
!if "$(COMPILER_NAME)" == "VS2012"
!if "$(MSC_VER)" > "1600"
# VS2012 requires this object file to be listed:
LD_FLAGS=$(LD_FLAGS) _build_pch_file.obj
!endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -116,11 +116,10 @@ JDK_MAJOR_VERSION="\\\"$(JDK_MAJOR_VER)\\\""
JDK_MINOR_VERSION="\\\"$(JDK_MINOR_VER)\\\""
JDK_MICRO_VERSION="\\\"$(JDK_MICRO_VER)\\\""
ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -define JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) -define HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO) -define JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) -define JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) -define JDK_MICRO_VERSION=$(JDK_MICRO_VERSION) -define JDK_BUILD_NUMBER=$(JDK_BUILD_NUMBER)
ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -define JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) -define HOTSPOT_VM_DISTRO=$(HOTSPOT_VM_DISTRO) -define JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) -define JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) -define JDK_MICRO_VERSION=$(JDK_MICRO_VERSION) -define JDK_BUILD_NUMBER=$(JDK_BUILD_NUMBER) -define VISUAL_STUDIO_BUILD=true
ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) $(ReleaseOptions)
$(HOTSPOTBUILDSPACE)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
@if "$(MSC_VER)"=="1500" echo Make sure you have VS2008 SP1 or later, or you may see 'expanded command line too long'
@$(RUN_JAVA) -Djava.class.path="$(HOTSPOTBUILDSPACE)/classes" ProjectCreator WinGammaPlatform$(VcVersion) $(ProjectCreatorIDEOptions)
clean:

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2014 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -693,7 +693,7 @@ void Assembler::test_asm() {
// PPC 1, section 4.6.7 Floating-Point Compare Instructions
fcmpu( CCR7, F24, F25);
tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", code()->insts_begin(), code()->insts_end());
tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", p2i(code()->insts_begin()), p2i(code()->insts_end()));
code()->decode();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -50,34 +50,6 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
return is_icholder_entry(call->destination());
}
//-----------------------------------------------------------------------------
// High-level access to an inline cache. Guaranteed to be MT-safe.
CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)
: _ic_call(call)
{
address ic_call = call->instruction_address();
assert(ic_call != NULL, "ic_call address must be set");
assert(nm != NULL, "must pass nmethod");
assert(nm->contains(ic_call), "must be in nmethod");
// Search for the ic_call at the given address.
RelocIterator iter(nm, ic_call, ic_call+1);
bool ret = iter.next();
assert(ret == true, "relocInfo must exist at this address");
assert(iter.addr() == ic_call, "must find ic_call");
if (iter.type() == relocInfo::virtual_call_type) {
virtual_call_Relocation* r = iter.virtual_call_reloc();
_is_optimized = false;
_value = nativeMovConstReg_at(r->cached_value());
} else {
assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
_is_optimized = true;
_value = NULL;
}
}
// ----------------------------------------------------------------------------
// A PPC CompiledStaticCall looks like this:
@ -203,7 +175,7 @@ void CompiledStaticCall::set_to_interpreted(methodHandle callee, address entry)
if (TraceICs) {
ResourceMark rm;
tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
instruction_address(),
p2i(instruction_address()),
callee->name_and_sig_as_C_string());
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2014 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -140,7 +140,7 @@ frame frame::sender(RegisterMap* map) const {
void frame::patch_pc(Thread* thread, address pc) {
if (TracePcPatching) {
tty->print_cr("patch_pc at address " PTR_FORMAT " [" PTR_FORMAT " -> " PTR_FORMAT "]",
&((address*) _sp)[-1], ((address*) _sp)[-1], pc);
p2i(&((address*) _sp)[-1]), p2i(((address*) _sp)[-1]), p2i(pc));
}
own_abi()->lr = (uint64_t)pc;
_cb = CodeCache::find_blob(pc);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2014 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -3099,7 +3099,7 @@ const char* stop_types[] = {
};
static void stop_on_request(int tp, const char* msg) {
tty->print("PPC assembly code requires stop: (%s) %s\n", (void *)stop_types[tp%/*stop_end*/4], msg);
tty->print("PPC assembly code requires stop: (%s) %s\n", stop_types[tp%/*stop_end*/4], msg);
guarantee(false, err_msg("PPC assembly code requires stop: %s", msg));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2014 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -464,7 +464,7 @@ void trace_method_handle_stub(const char* adaptername,
strstr(adaptername, "linkTo") == NULL); // static linkers don't have MH
const char* mh_reg_name = has_mh ? "R23_method_handle" : "G23";
tty->print_cr("MH %s %s="INTPTR_FORMAT " sp=" INTPTR_FORMAT,
adaptername, mh_reg_name, (intptr_t) mh, entry_sp);
adaptername, mh_reg_name, (intptr_t) mh, (intptr_t) entry_sp);
if (Verbose) {
tty->print_cr("Registers:");

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2013 SAP AG. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2014 SAP AG. 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
@ -147,9 +147,9 @@ void NativeCall::verify() {
address addr = addr_at(0);
if (!NativeCall::is_call_at(addr)) {
tty->print_cr("not a NativeCall at " PTR_FORMAT, addr);
tty->print_cr("not a NativeCall at " PTR_FORMAT, p2i(addr));
// TODO: PPC port: Disassembler::decode(addr - 20, addr + 20, tty);
fatal(err_msg("not a NativeCall at " PTR_FORMAT, addr));
fatal(err_msg("not a NativeCall at " PTR_FORMAT, p2i(addr)));
}
}
#endif // ASSERT
@ -160,9 +160,9 @@ void NativeFarCall::verify() {
NativeInstruction::verify();
if (!NativeFarCall::is_far_call_at(addr)) {
tty->print_cr("not a NativeFarCall at " PTR_FORMAT, addr);
tty->print_cr("not a NativeFarCall at " PTR_FORMAT, p2i(addr));
// TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
fatal(err_msg("not a NativeFarCall at " PTR_FORMAT, addr));
fatal(err_msg("not a NativeFarCall at " PTR_FORMAT, p2i(addr)));
}
}
#endif // ASSERT
@ -306,9 +306,9 @@ void NativeMovConstReg::verify() {
if (! (cb != NULL && MacroAssembler::is_calculate_address_from_global_toc_at(addr, cb->content_begin())) &&
! (cb != NULL && MacroAssembler::is_set_narrow_oop(addr, cb->content_begin())) &&
! MacroAssembler::is_bl(*((int*) addr))) {
tty->print_cr("not a NativeMovConstReg at " PTR_FORMAT, addr);
tty->print_cr("not a NativeMovConstReg at " PTR_FORMAT, p2i(addr));
// TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
fatal(err_msg("not a NativeMovConstReg at " PTR_FORMAT, addr));
fatal(err_msg("not a NativeMovConstReg at " PTR_FORMAT, p2i(addr)));
}
}
}
@ -344,9 +344,9 @@ void NativeJump::verify() {
NativeInstruction::verify();
if (!NativeJump::is_jump_at(addr)) {
tty->print_cr("not a NativeJump at " PTR_FORMAT, addr);
tty->print_cr("not a NativeJump at " PTR_FORMAT, p2i(addr));
// TODO: PPC port: Disassembler::decode(addr, 20, 20, tty);
fatal(err_msg("not a NativeJump at " PTR_FORMAT, addr));
fatal(err_msg("not a NativeJump at " PTR_FORMAT, p2i(addr)));
}
}
#endif // ASSERT

View File

@ -1329,7 +1329,7 @@ void MachPrologNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
if (!false /* TODO: PPC port C->is_frameless_method()*/) {
st->print("save return pc\n\t");
st->print("push frame %d\n\t", -framesize);
st->print("push frame %ld\n\t", -framesize);
}
}
#endif

View File

@ -352,7 +352,7 @@ void VM_Version::determine_section_size() {
if (PrintAssembly) {
ttyLocker ttyl;
tty->print_cr("Decoding section size detection stub at " INTPTR_FORMAT " before execution:", code);
tty->print_cr("Decoding section size detection stub at " INTPTR_FORMAT " before execution:", p2i(code));
Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
tty->print_cr("Time loop1 :%f", loop1_seconds);
tty->print_cr("Time loop2 :%f", loop2_seconds);
@ -435,7 +435,7 @@ void VM_Version::determine_features() {
// Print the detection code.
if (PrintAssembly) {
ttyLocker ttyl;
tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " before execution:", code);
tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " before execution:", p2i(code));
Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
}
@ -468,7 +468,7 @@ void VM_Version::determine_features() {
// Print the detection code.
if (PrintAssembly) {
ttyLocker ttyl;
tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " after execution:", code);
tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " after execution:", p2i(code));
Disassembler::decode((u_char*)code, (u_char*)code_end, tty);
}

View File

@ -50,34 +50,6 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
return is_icholder_entry(call->destination());
}
//-----------------------------------------------------------------------------
// High-level access to an inline cache. Guaranteed to be MT-safe.
CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)
: _ic_call(call)
{
address ic_call = call->instruction_address();
assert(ic_call != NULL, "ic_call address must be set");
assert(nm != NULL, "must pass nmethod");
assert(nm->contains(ic_call), "must be in nmethod");
// Search for the ic_call at the given address.
RelocIterator iter(nm, ic_call, ic_call+1);
bool ret = iter.next();
assert(ret == true, "relocInfo must exist at this address");
assert(iter.addr() == ic_call, "must find ic_call");
if (iter.type() == relocInfo::virtual_call_type) {
virtual_call_Relocation* r = iter.virtual_call_reloc();
_is_optimized = false;
_value = nativeMovConstReg_at(r->cached_value());
} else {
assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
_is_optimized = true;
_value = NULL;
}
}
// ----------------------------------------------------------------------------
#define __ _masm.

View File

@ -436,32 +436,6 @@ void frame::set_interpreter_frame_sender_sp(intptr_t* sender_sp) {
}
#endif // CC_INTERP
#ifdef ASSERT
// Debugging aid
static frame nth_sender(int n) {
frame f = JavaThread::current()->last_frame();
for(int i = 0; i < n; ++i)
f = f.sender((RegisterMap*)NULL);
printf("first frame %d\n", f.is_first_frame() ? 1 : 0);
printf("interpreted frame %d\n", f.is_interpreted_frame() ? 1 : 0);
printf("java frame %d\n", f.is_java_frame() ? 1 : 0);
printf("entry frame %d\n", f.is_entry_frame() ? 1 : 0);
printf("native frame %d\n", f.is_native_frame() ? 1 : 0);
if (f.is_compiled_frame()) {
if (f.is_deoptimized_frame())
printf("deoptimized frame 1\n");
else
printf("compiled frame 1\n");
}
return f;
}
#endif
frame frame::sender_for_entry_frame(RegisterMap *map) const {
assert(map != NULL, "map must be set");
// Java frame called from C; skip all C frames and return top C

View File

@ -625,6 +625,7 @@ int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) {
__ lea(rscratch1, polling_page);
offset = __ offset();
add_debug_info_for_branch(info);
__ relocate(relocInfo::poll_type);
__ testl(rax, Address(rscratch1, 0));
} else {
add_debug_info_for_branch(info);

View File

@ -47,34 +47,6 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
return is_icholder_entry(call->destination());
}
//-----------------------------------------------------------------------------
// High-level access to an inline cache. Guaranteed to be MT-safe.
CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)
: _ic_call(call)
{
address ic_call = call->instruction_address();
assert(ic_call != NULL, "ic_call address must be set");
assert(nm != NULL, "must pass nmethod");
assert(nm->contains(ic_call), "must be in nmethod");
// Search for the ic_call at the given address.
RelocIterator iter(nm, ic_call, ic_call+1);
bool ret = iter.next();
assert(ret == true, "relocInfo must exist at this address");
assert(iter.addr() == ic_call, "must find ic_call");
if (iter.type() == relocInfo::virtual_call_type) {
virtual_call_Relocation* r = iter.virtual_call_reloc();
_is_optimized = false;
_value = nativeMovConstReg_at(r->cached_value());
} else {
assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
_is_optimized = true;
_value = NULL;
}
}
// ----------------------------------------------------------------------------
#define __ _masm.

View File

@ -280,6 +280,8 @@ address TemplateInterpreterGenerator::generate_result_handler_for(BasicType type
case T_BYTE : __ sign_extend_byte (rax); break;
case T_SHORT : __ sign_extend_short(rax); break;
case T_INT : /* nothing to do */ break;
case T_LONG : /* nothing to do */ break;
case T_VOID : /* nothing to do */ break;
case T_DOUBLE :
case T_FLOAT :
{ const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp();

View File

@ -1,31 +0,0 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2009 Red Hat, Inc.
* 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 CPU_ZERO_VM_BYTECODES_ZERO_HPP
#define CPU_ZERO_VM_BYTECODES_ZERO_HPP
// This file is intentionally empty
#endif // CPU_ZERO_VM_BYTECODES_ZERO_HPP

View File

@ -58,34 +58,6 @@ bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
return is_icholder_entry(call->destination());
}
//-----------------------------------------------------------------------------
// High-level access to an inline cache. Guaranteed to be MT-safe.
CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)
: _ic_call(call)
{
address ic_call = call->instruction_address();
assert(ic_call != NULL, "ic_call address must be set");
assert(nm != NULL, "must pass nmethod");
assert(nm->contains(ic_call), "must be in nmethod");
// Search for the ic_call at the given address.
RelocIterator iter(nm, ic_call, ic_call+1);
bool ret = iter.next();
assert(ret == true, "relocInfo must exist at this address");
assert(iter.addr() == ic_call, "must find ic_call");
if (iter.type() == relocInfo::virtual_call_type) {
virtual_call_Relocation* r = iter.virtual_call_reloc();
_is_optimized = false;
_value = nativeMovConstReg_at(r->cached_value());
} else {
assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
_is_optimized = true;
_value = NULL;
}
}
// ----------------------------------------------------------------------------
void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {

View File

@ -37,6 +37,7 @@
#include "prims/jvmtiExport.hpp"
#include "prims/jvmtiThreadState.hpp"
#include "runtime/arguments.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/interfaceSupport.hpp"

View File

@ -24,17 +24,13 @@
*/
// no precompiled headers
#include "runtime/atomic.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/os.hpp"
#include "runtime/osThread.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/vmThread.hpp"
#ifdef TARGET_ARCH_ppc
# include "assembler_ppc.inline.hpp"
#endif
void OSThread::pd_initialize() {
assert(this != NULL, "check");

View File

@ -48,6 +48,7 @@
#include "prims/jvm.h"
#include "prims/jvm_misc.hpp"
#include "runtime/arguments.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/extendedPC.hpp"
#include "runtime/globals.hpp"
#include "runtime/interfaceSupport.hpp"
@ -2812,13 +2813,6 @@ void os::yield() {
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
void os::yield_all() {
// Yields to all threads, including threads with lower priorities
// Threads on Linux are all with same priority. The Solaris style
// os::yield_all() with nanosleep(1ms) is not necessary.
sched_yield();
}
////////////////////////////////////////////////////////////////////////////////
// thread priority support
@ -3075,7 +3069,7 @@ static bool do_suspend(OSThread* osthread) {
for (int n = 0; !osthread->sr.is_suspended(); n++) {
for (int i = 0; i < RANDOMLY_LARGE_INTEGER2 && !osthread->sr.is_suspended(); i++) {
os::yield_all();
os::yield();
}
// timeout, try to cancel the request
@ -3109,7 +3103,7 @@ static void do_resume(OSThread* osthread) {
if (sr_notify(osthread) == 0) {
for (int n = 0; n < RANDOMLY_LARGE_INTEGER && !osthread->sr.is_running(); n++) {
for (int i = 0; i < 100 && !osthread->sr.is_running(); i++) {
os::yield_all();
os::yield();
}
}
} else {

View File

@ -41,6 +41,7 @@
#include "prims/jvm.h"
#include "prims/jvm_misc.hpp"
#include "runtime/arguments.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/extendedPC.hpp"
#include "runtime/globals.hpp"
#include "runtime/interfaceSupport.hpp"
@ -786,7 +787,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) {
case os::java_thread:
// Java threads use ThreadStackSize which default value can be
// changed with the flag -Xss
assert (JavaThread::stack_size_at_create() > 0, "this should be set");
assert(JavaThread::stack_size_at_create() > 0, "this should be set");
stack_size = JavaThread::stack_size_at_create();
break;
case os::compiler_thread:
@ -1303,7 +1304,7 @@ bool os::dll_build_name(char* buffer, size_t buflen,
if (pelements == NULL) {
return false;
}
for (int i = 0 ; i < n ; i++) {
for (int i = 0; i < n; i++) {
// Really shouldn't be NULL, but check can't hurt
if (pelements[i] == NULL || strlen(pelements[i]) == 0) {
continue; // skip the empty path values
@ -1316,7 +1317,7 @@ bool os::dll_build_name(char* buffer, size_t buflen,
}
}
// release the storage
for (int i = 0 ; i < n ; i++) {
for (int i = 0; i < n; i++) {
if (pelements[i] != NULL) {
FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal);
}
@ -1467,7 +1468,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
bool failed_to_read_elf_head=
(sizeof(elf_head)!=
(::read(file_descriptor, &elf_head,sizeof(elf_head)))) ;
(::read(file_descriptor, &elf_head,sizeof(elf_head))));
::close(file_descriptor);
if (failed_to_read_elf_head) {
@ -1565,7 +1566,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
arch_t lib_arch={elf_head.e_machine,0,elf_head.e_ident[EI_CLASS], elf_head.e_ident[EI_DATA], NULL};
int running_arch_index=-1;
for (unsigned int i=0 ; i < ARRAY_SIZE(arch_array) ; i++ ) {
for (unsigned int i=0; i < ARRAY_SIZE(arch_array); i++) {
if (running_arch_code == arch_array[i].code) {
running_arch_index = i;
}
@ -1596,7 +1597,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
#endif // !S390
if (lib_arch.compat_class != arch_array[running_arch_index].compat_class) {
if ( lib_arch.name!=NULL ) {
if (lib_arch.name!=NULL) {
::snprintf(diag_msg_buf, diag_msg_max_length-1,
" (Possible cause: can't load %s-bit .so on a %s-bit platform)",
lib_arch.name, arch_array[running_arch_index].name);
@ -2598,14 +2599,7 @@ void os::yield() {
sched_yield();
}
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN ;}
void os::yield_all() {
// Yields to all threads, including threads with lower priorities
// Threads on Bsd are all with same priority. The Solaris style
// os::yield_all() with nanosleep(1ms) is not necessary.
sched_yield();
}
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
////////////////////////////////////////////////////////////////////////////////
// thread priority support
@ -2686,7 +2680,7 @@ static int prio_init() {
}
OSReturn os::set_native_priority(Thread* thread, int newpri) {
if ( !UseThreadPriorities || ThreadPriorityPolicy == 0 ) return OS_OK;
if (!UseThreadPriorities || ThreadPriorityPolicy == 0) return OS_OK;
#ifdef __OpenBSD__
// OpenBSD pthread_setprio starves low priority threads
@ -2713,7 +2707,7 @@ OSReturn os::set_native_priority(Thread* thread, int newpri) {
}
OSReturn os::get_native_priority(const Thread* const thread, int *priority_ptr) {
if ( !UseThreadPriorities || ThreadPriorityPolicy == 0 ) {
if (!UseThreadPriorities || ThreadPriorityPolicy == 0) {
*priority_ptr = java_to_os_priority[NormPriority];
return OS_OK;
}
@ -3079,7 +3073,7 @@ bool os::Bsd::chained_handler(int sig, siginfo_t* siginfo, void* context) {
}
struct sigaction* os::Bsd::get_preinstalled_handler(int sig) {
if ((( (unsigned int)1 << sig ) & sigs) != 0) {
if ((((unsigned int)1 << sig) & sigs) != 0) {
return &sigact[sig];
}
return NULL;
@ -3300,7 +3294,7 @@ static void print_signal_handler(outputStream* st, int sig,
address rh = VMError::get_resetted_sighandler(sig);
// May be, handler was resetted by VMError?
if(rh != NULL) {
if (rh != NULL) {
handler = rh;
sa.sa_flags = VMError::get_resetted_sigflags(sig) & SIGNIFICANT_SIGNAL_MASK;
}
@ -3309,11 +3303,11 @@ static void print_signal_handler(outputStream* st, int sig,
os::Posix::print_sa_flags(st, sa.sa_flags);
// Check: is it our handler?
if(handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)signalHandler) ||
if (handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)signalHandler) ||
handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)SR_handler)) {
// It is our signal handler
// check for flags, reset system-used one!
if((int)sa.sa_flags != os::Bsd::get_our_sigflags(sig)) {
if ((int)sa.sa_flags != os::Bsd::get_our_sigflags(sig)) {
st->print(
", flags was changed from " PTR32_FORMAT ", consider using jsig library",
os::Bsd::get_our_sigflags(sig));
@ -3382,10 +3376,10 @@ void os::Bsd::check_signal_handler(int sig) {
address thisHandler = (act.sa_flags & SA_SIGINFO)
? CAST_FROM_FN_PTR(address, act.sa_sigaction)
: CAST_FROM_FN_PTR(address, act.sa_handler) ;
: CAST_FROM_FN_PTR(address, act.sa_handler);
switch(sig) {
switch (sig) {
case SIGSEGV:
case SIGBUS:
case SIGFPE:
@ -3515,22 +3509,22 @@ jint os::init_2(void)
{
// Allocate a single page and mark it as readable for safepoint polling
address polling_page = (address) ::mmap(NULL, Bsd::page_size(), PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
guarantee( polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page" );
guarantee(polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page");
os::set_polling_page( polling_page );
os::set_polling_page(polling_page);
#ifndef PRODUCT
if(Verbose && PrintMiscellaneous)
if (Verbose && PrintMiscellaneous)
tty->print("[SafePoint Polling address: " INTPTR_FORMAT "]\n", (intptr_t)polling_page);
#endif
if (!UseMembar) {
address mem_serialize_page = (address) ::mmap(NULL, Bsd::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
guarantee( mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page");
os::set_memory_serialize_page( mem_serialize_page );
guarantee(mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page");
os::set_memory_serialize_page(mem_serialize_page);
#ifndef PRODUCT
if(Verbose && PrintMiscellaneous)
if (Verbose && PrintMiscellaneous)
tty->print("[Memory Serialize Page address: " INTPTR_FORMAT "]\n", (intptr_t)mem_serialize_page);
#endif
}
@ -3631,13 +3625,13 @@ void os::init_3(void) { }
// Mark the polling page as unreadable
void os::make_polling_page_unreadable(void) {
if( !guard_memory((char*)_polling_page, Bsd::page_size()) )
if (!guard_memory((char*)_polling_page, Bsd::page_size()))
fatal("Could not disable polling page");
};
// Mark the polling page as readable
void os::make_polling_page_readable(void) {
if( !bsd_mprotect((char *)_polling_page, Bsd::page_size(), PROT_READ)) {
if (!bsd_mprotect((char *)_polling_page, Bsd::page_size(), PROT_READ)) {
fatal("Could not enable polling page");
}
};
@ -4229,9 +4223,9 @@ static struct timespec* compute_abstime(struct timespec* abstime, jlong millis)
int os::PlatformEvent::TryPark() {
for (;;) {
const int v = _Event ;
guarantee ((v == 0) || (v == 1), "invariant") ;
if (Atomic::cmpxchg (0, &_Event, v) == v) return v ;
const int v = _Event;
guarantee((v == 0) || (v == 1), "invariant");
if (Atomic::cmpxchg(0, &_Event, v) == v) return v;
}
}
@ -4239,18 +4233,18 @@ void os::PlatformEvent::park() { // AKA "down()"
// Invariant: Only the thread associated with the Event/PlatformEvent
// may call park().
// TODO: assert that _Assoc != NULL or _Assoc == Self
int v ;
int v;
for (;;) {
v = _Event ;
if (Atomic::cmpxchg (v-1, &_Event, v) == v) break ;
v = _Event;
if (Atomic::cmpxchg(v-1, &_Event, v) == v) break;
}
guarantee (v >= 0, "invariant") ;
guarantee(v >= 0, "invariant");
if (v == 0) {
// Do this the hard way by blocking ...
int status = pthread_mutex_lock(_mutex);
assert_status(status == 0, status, "mutex_lock");
guarantee (_nParked == 0, "invariant") ;
++ _nParked ;
guarantee(_nParked == 0, "invariant");
++_nParked;
while (_Event < 0) {
status = pthread_cond_wait(_cond, _mutex);
// for some reason, under 2.7 lwp_cond_wait() may return ETIME ...
@ -4258,28 +4252,28 @@ void os::PlatformEvent::park() { // AKA "down()"
if (status == ETIMEDOUT) { status = EINTR; }
assert_status(status == 0 || status == EINTR, status, "cond_wait");
}
-- _nParked ;
--_nParked;
_Event = 0 ;
_Event = 0;
status = pthread_mutex_unlock(_mutex);
assert_status(status == 0, status, "mutex_unlock");
// Paranoia to ensure our locked and lock-free paths interact
// correctly with each other.
OrderAccess::fence();
}
guarantee (_Event >= 0, "invariant") ;
guarantee(_Event >= 0, "invariant");
}
int os::PlatformEvent::park(jlong millis) {
guarantee (_nParked == 0, "invariant") ;
guarantee(_nParked == 0, "invariant");
int v ;
int v;
for (;;) {
v = _Event ;
if (Atomic::cmpxchg (v-1, &_Event, v) == v) break ;
v = _Event;
if (Atomic::cmpxchg(v-1, &_Event, v) == v) break;
}
guarantee (v >= 0, "invariant") ;
if (v != 0) return OS_OK ;
guarantee(v >= 0, "invariant");
if (v != 0) return OS_OK;
// We do this the hard way, by blocking the thread.
// Consider enforcing a minimum timeout value.
@ -4289,8 +4283,8 @@ int os::PlatformEvent::park(jlong millis) {
int ret = OS_TIMEOUT;
int status = pthread_mutex_lock(_mutex);
assert_status(status == 0, status, "mutex_lock");
guarantee (_nParked == 0, "invariant") ;
++_nParked ;
guarantee(_nParked == 0, "invariant");
++_nParked;
// Object.wait(timo) will return because of
// (a) notification
@ -4308,24 +4302,24 @@ int os::PlatformEvent::park(jlong millis) {
while (_Event < 0) {
status = os::Bsd::safe_cond_timedwait(_cond, _mutex, &abst);
if (status != 0 && WorkAroundNPTLTimedWaitHang) {
pthread_cond_destroy (_cond);
pthread_cond_init (_cond, NULL) ;
pthread_cond_destroy(_cond);
pthread_cond_init(_cond, NULL);
}
assert_status(status == 0 || status == EINTR ||
status == ETIMEDOUT,
status, "cond_timedwait");
if (!FilterSpuriousWakeups) break ; // previous semantics
if (status == ETIMEDOUT) break ;
if (!FilterSpuriousWakeups) break; // previous semantics
if (status == ETIMEDOUT) break;
// We consume and ignore EINTR and spurious wakeups.
}
--_nParked ;
--_nParked;
if (_Event >= 0) {
ret = OS_OK;
}
_Event = 0 ;
_Event = 0;
status = pthread_mutex_unlock(_mutex);
assert_status(status == 0, status, "mutex_unlock");
assert (_nParked == 0, "invariant") ;
assert(_nParked == 0, "invariant");
// Paranoia to ensure our locked and lock-free paths interact
// correctly with each other.
OrderAccess::fence();
@ -4409,7 +4403,7 @@ void os::PlatformEvent::unpark() {
*/
static void unpackTime(struct timespec* absTime, bool isAbsolute, jlong time) {
assert (time > 0, "convertTime");
assert(time > 0, "convertTime");
struct timeval now;
int status = gettimeofday(&now, NULL);
@ -4470,7 +4464,7 @@ void Parker::park(bool isAbsolute, jlong time) {
// Next, demultiplex/decode time arguments
struct timespec absTime;
if (time < 0 || (isAbsolute && time == 0) ) { // don't wait at all
if (time < 0 || (isAbsolute && time == 0)) { // don't wait at all
return;
}
if (time > 0) {
@ -4492,11 +4486,11 @@ void Parker::park(bool isAbsolute, jlong time) {
return;
}
int status ;
int status;
if (_counter > 0) { // no wait needed
_counter = 0;
status = pthread_mutex_unlock(_mutex);
assert (status == 0, "invariant") ;
assert(status == 0, "invariant");
// Paranoia to ensure our locked and lock-free paths interact
// correctly with each other and Java-level accesses.
OrderAccess::fence();
@ -4516,12 +4510,12 @@ void Parker::park(bool isAbsolute, jlong time) {
// cleared by handle_special_suspend_equivalent_condition() or java_suspend_self()
if (time == 0) {
status = pthread_cond_wait (_cond, _mutex) ;
status = pthread_cond_wait(_cond, _mutex);
} else {
status = os::Bsd::safe_cond_timedwait (_cond, _mutex, &absTime) ;
status = os::Bsd::safe_cond_timedwait(_cond, _mutex, &absTime);
if (status != 0 && WorkAroundNPTLTimedWaitHang) {
pthread_cond_destroy (_cond) ;
pthread_cond_init (_cond, NULL);
pthread_cond_destroy(_cond);
pthread_cond_init(_cond, NULL);
}
}
assert_status(status == 0 || status == EINTR ||
@ -4532,9 +4526,9 @@ void Parker::park(bool isAbsolute, jlong time) {
pthread_sigmask(SIG_SETMASK, &oldsigs, NULL);
#endif
_counter = 0 ;
status = pthread_mutex_unlock(_mutex) ;
assert_status(status == 0, status, "invariant") ;
_counter = 0;
status = pthread_mutex_unlock(_mutex);
assert_status(status == 0, status, "invariant");
// Paranoia to ensure our locked and lock-free paths interact
// correctly with each other and Java-level accesses.
OrderAccess::fence();
@ -4546,26 +4540,26 @@ void Parker::park(bool isAbsolute, jlong time) {
}
void Parker::unpark() {
int s, status ;
int s, status;
status = pthread_mutex_lock(_mutex);
assert (status == 0, "invariant") ;
assert(status == 0, "invariant");
s = _counter;
_counter = 1;
if (s < 1) {
if (WorkAroundNPTLTimedWaitHang) {
status = pthread_cond_signal (_cond) ;
assert (status == 0, "invariant") ;
status = pthread_cond_signal(_cond);
assert(status == 0, "invariant");
status = pthread_mutex_unlock(_mutex);
assert (status == 0, "invariant") ;
assert(status == 0, "invariant");
} else {
status = pthread_mutex_unlock(_mutex);
assert (status == 0, "invariant") ;
status = pthread_cond_signal (_cond) ;
assert (status == 0, "invariant") ;
assert(status == 0, "invariant");
status = pthread_cond_signal(_cond);
assert(status == 0, "invariant");
}
} else {
pthread_mutex_unlock(_mutex);
assert (status == 0, "invariant") ;
assert(status == 0, "invariant");
}
}

View File

@ -191,16 +191,16 @@ public:
class PlatformEvent : public CHeapObj<mtInternal> {
private:
double CachePad [4] ; // increase odds that _mutex is sole occupant of cache line
volatile int _Event ;
volatile int _nParked ;
pthread_mutex_t _mutex [1] ;
pthread_cond_t _cond [1] ;
double PostPad [2] ;
Thread * _Assoc ;
double CachePad[4]; // increase odds that _mutex is sole occupant of cache line
volatile int _Event;
volatile int _nParked;
pthread_mutex_t _mutex[1];
pthread_cond_t _cond[1];
double PostPad[2];
Thread * _Assoc;
public: // TODO-FIXME: make dtor private
~PlatformEvent() { guarantee (0, "invariant") ; }
~PlatformEvent() { guarantee(0, "invariant"); }
public:
PlatformEvent() {
@ -209,28 +209,28 @@ class PlatformEvent : public CHeapObj<mtInternal> {
assert_status(status == 0, status, "cond_init");
status = pthread_mutex_init (_mutex, NULL);
assert_status(status == 0, status, "mutex_init");
_Event = 0 ;
_nParked = 0 ;
_Assoc = NULL ;
_Event = 0;
_nParked = 0;
_Assoc = NULL;
}
// Use caution with reset() and fired() -- they may require MEMBARs
void reset() { _Event = 0 ; }
void reset() { _Event = 0; }
int fired() { return _Event; }
void park () ;
void unpark () ;
int TryPark () ;
int park (jlong millis) ;
void SetAssociation (Thread * a) { _Assoc = a ; }
void park();
void unpark();
int TryPark();
int park(jlong millis);
void SetAssociation(Thread * a) { _Assoc = a; }
};
class PlatformParker : public CHeapObj<mtInternal> {
protected:
pthread_mutex_t _mutex [1] ;
pthread_cond_t _cond [1] ;
pthread_mutex_t _mutex[1];
pthread_cond_t _cond[1];
public: // TODO-FIXME: make dtor private
~PlatformParker() { guarantee (0, "invariant") ; }
~PlatformParker() { guarantee(0, "invariant"); }
public:
PlatformParker() {

View File

@ -41,6 +41,7 @@
#include "prims/jvm.h"
#include "prims/jvm_misc.hpp"
#include "runtime/arguments.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/extendedPC.hpp"
#include "runtime/globals.hpp"
#include "runtime/interfaceSupport.hpp"
@ -862,7 +863,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) {
case os::java_thread:
// Java threads use ThreadStackSize which default value can be
// changed with the flag -Xss
assert (JavaThread::stack_size_at_create() > 0, "this should be set");
assert(JavaThread::stack_size_at_create() > 0, "this should be set");
stack_size = JavaThread::stack_size_at_create();
break;
case os::compiler_thread:
@ -1097,7 +1098,7 @@ static bool find_vma(address addr, address* vma_low, address* vma_high) {
if (low <= addr && addr < high) {
if (vma_low) *vma_low = low;
if (vma_high) *vma_high = high;
fclose (fp);
fclose(fp);
return true;
}
}
@ -1420,7 +1421,7 @@ void os::Linux::fast_thread_clock_init() {
// must return at least tp.tv_sec == 0 which means a resolution
// better than 1 sec. This is extra check for reliability.
if(pthread_getcpuclockid_func &&
if (pthread_getcpuclockid_func &&
pthread_getcpuclockid_func(_main_thread, &clockid) == 0 &&
sys_clock_getres(clockid, &tp) == 0 && tp.tv_sec == 0) {
@ -1630,7 +1631,7 @@ bool os::dll_build_name(char* buffer, size_t buflen,
if (pelements == NULL) {
return false;
}
for (int i = 0 ; i < n ; i++) {
for (int i = 0; i < n; i++) {
// Really shouldn't be NULL, but check can't hurt
if (pelements[i] == NULL || strlen(pelements[i]) == 0) {
continue; // skip the empty path values
@ -1642,7 +1643,7 @@ bool os::dll_build_name(char* buffer, size_t buflen,
}
}
// release the storage
for (int i = 0 ; i < n ; i++) {
for (int i = 0; i < n; i++) {
if (pelements[i] != NULL) {
FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal);
}
@ -1906,7 +1907,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
bool failed_to_read_elf_head=
(sizeof(elf_head)!=
(::read(file_descriptor, &elf_head,sizeof(elf_head)))) ;
(::read(file_descriptor, &elf_head,sizeof(elf_head))));
::close(file_descriptor);
if (failed_to_read_elf_head) {
@ -1988,7 +1989,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
arch_t lib_arch={elf_head.e_machine,0,elf_head.e_ident[EI_CLASS], elf_head.e_ident[EI_DATA], NULL};
int running_arch_index=-1;
for (unsigned int i=0 ; i < ARRAY_SIZE(arch_array) ; i++ ) {
for (unsigned int i=0; i < ARRAY_SIZE(arch_array); i++) {
if (running_arch_code == arch_array[i].code) {
running_arch_index = i;
}
@ -2019,7 +2020,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
#endif // !S390
if (lib_arch.compat_class != arch_array[running_arch_index].compat_class) {
if ( lib_arch.name!=NULL ) {
if (lib_arch.name!=NULL) {
::snprintf(diag_msg_buf, diag_msg_max_length-1,
" (Possible cause: can't load %s-bit .so on a %s-bit platform)",
lib_arch.name, arch_array[running_arch_index].name);
@ -3793,14 +3794,7 @@ void os::yield() {
sched_yield();
}
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN ;}
void os::yield_all() {
// Yields to all threads, including threads with lower priorities
// Threads on Linux are all with same priority. The Solaris style
// os::yield_all() with nanosleep(1ms) is not necessary.
sched_yield();
}
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
////////////////////////////////////////////////////////////////////////////////
// thread priority support
@ -3858,14 +3852,14 @@ static int prio_init() {
}
OSReturn os::set_native_priority(Thread* thread, int newpri) {
if ( !UseThreadPriorities || ThreadPriorityPolicy == 0 ) return OS_OK;
if (!UseThreadPriorities || ThreadPriorityPolicy == 0) return OS_OK;
int ret = setpriority(PRIO_PROCESS, thread->osthread()->thread_id(), newpri);
return (ret == 0) ? OS_OK : OS_ERR;
}
OSReturn os::get_native_priority(const Thread* const thread, int *priority_ptr) {
if ( !UseThreadPriorities || ThreadPriorityPolicy == 0 ) {
if (!UseThreadPriorities || ThreadPriorityPolicy == 0) {
*priority_ptr = java_to_os_priority[NormPriority];
return OS_OK;
}
@ -4219,7 +4213,7 @@ bool os::Linux::chained_handler(int sig, siginfo_t* siginfo, void* context) {
}
struct sigaction* os::Linux::get_preinstalled_handler(int sig) {
if ((( (unsigned int)1 << sig ) & sigs) != 0) {
if ((((unsigned int)1 << sig) & sigs) != 0) {
return &sigact[sig];
}
return NULL;
@ -4423,7 +4417,7 @@ static void print_signal_handler(outputStream* st, int sig,
address rh = VMError::get_resetted_sighandler(sig);
// May be, handler was resetted by VMError?
if(rh != NULL) {
if (rh != NULL) {
handler = rh;
sa.sa_flags = VMError::get_resetted_sigflags(sig) & SIGNIFICANT_SIGNAL_MASK;
}
@ -4432,11 +4426,11 @@ static void print_signal_handler(outputStream* st, int sig,
os::Posix::print_sa_flags(st, sa.sa_flags);
// Check: is it our handler?
if(handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)signalHandler) ||
if (handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)signalHandler) ||
handler == CAST_FROM_FN_PTR(address, (sa_sigaction_t)SR_handler)) {
// It is our signal handler
// check for flags, reset system-used one!
if((int)sa.sa_flags != os::Linux::get_our_sigflags(sig)) {
if ((int)sa.sa_flags != os::Linux::get_our_sigflags(sig)) {
st->print(
", flags was changed from " PTR32_FORMAT ", consider using jsig library",
os::Linux::get_our_sigflags(sig));
@ -4507,10 +4501,10 @@ void os::Linux::check_signal_handler(int sig) {
address thisHandler = (act.sa_flags & SA_SIGINFO)
? CAST_FROM_FN_PTR(address, act.sa_sigaction)
: CAST_FROM_FN_PTR(address, act.sa_handler) ;
: CAST_FROM_FN_PTR(address, act.sa_handler);
switch(sig) {
switch (sig) {
case SIGSEGV:
case SIGBUS:
case SIGFPE:
@ -4662,22 +4656,22 @@ jint os::init_2(void)
// Allocate a single page and mark it as readable for safepoint polling
address polling_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
guarantee( polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page" );
guarantee(polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page");
os::set_polling_page( polling_page );
os::set_polling_page(polling_page);
#ifndef PRODUCT
if(Verbose && PrintMiscellaneous)
if (Verbose && PrintMiscellaneous)
tty->print("[SafePoint Polling address: " INTPTR_FORMAT "]\n", (intptr_t)polling_page);
#endif
if (!UseMembar) {
address mem_serialize_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
guarantee( mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page");
os::set_memory_serialize_page( mem_serialize_page );
guarantee(mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page");
os::set_memory_serialize_page(mem_serialize_page);
#ifndef PRODUCT
if(Verbose && PrintMiscellaneous)
if (Verbose && PrintMiscellaneous)
tty->print("[Memory Serialize Page address: " INTPTR_FORMAT "]\n", (intptr_t)mem_serialize_page);
#endif
}
@ -4819,13 +4813,13 @@ void os::init_3(void) {
// Mark the polling page as unreadable
void os::make_polling_page_unreadable(void) {
if( !guard_memory((char*)_polling_page, Linux::page_size()) )
if (!guard_memory((char*)_polling_page, Linux::page_size()))
fatal("Could not disable polling page");
};
// Mark the polling page as readable
void os::make_polling_page_readable(void) {
if( !linux_mprotect((char *)_polling_page, Linux::page_size(), PROT_READ)) {
if (!linux_mprotect((char *)_polling_page, Linux::page_size(), PROT_READ)) {
fatal("Could not enable polling page");
}
};
@ -5288,7 +5282,7 @@ static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
snprintf(proc_name, 64, "/proc/self/task/%d/stat", tid);
fp = fopen(proc_name, "r");
if ( fp == NULL ) return -1;
if (fp == NULL) return -1;
statlen = fread(stat, 1, 2047, fp);
stat[statlen] = '\0';
fclose(fp);
@ -5300,7 +5294,7 @@ static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
// We don't really need to know the command string, just find the last
// occurrence of ")" and then start parsing from there. See bug 4726580.
s = strrchr(stat, ')');
if (s == NULL ) return -1;
if (s == NULL) return -1;
// Skip blank chars
do s++; while (isspace(*s));
@ -5309,7 +5303,7 @@ static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
&cdummy, &idummy, &idummy, &idummy, &idummy, &idummy,
&ldummy, &ldummy, &ldummy, &ldummy, &ldummy,
&user_time, &sys_time);
if ( count != 13 ) return -1;
if (count != 13) return -1;
if (user_sys_cpu_time) {
return ((jlong)sys_time + (jlong)user_time) * (1000000000 / clock_tics_per_sec);
} else {
@ -5468,9 +5462,9 @@ static struct timespec* compute_abstime(timespec* abstime, jlong millis) {
int os::PlatformEvent::TryPark() {
for (;;) {
const int v = _Event ;
guarantee ((v == 0) || (v == 1), "invariant") ;
if (Atomic::cmpxchg (0, &_Event, v) == v) return v ;
const int v = _Event;
guarantee((v == 0) || (v == 1), "invariant");
if (Atomic::cmpxchg(0, &_Event, v) == v) return v;
}
}
@ -5478,18 +5472,18 @@ void os::PlatformEvent::park() { // AKA "down()"
// Invariant: Only the thread associated with the Event/PlatformEvent
// may call park().
// TODO: assert that _Assoc != NULL or _Assoc == Self
int v ;
int v;
for (;;) {
v = _Event ;
if (Atomic::cmpxchg (v-1, &_Event, v) == v) break ;
v = _Event;
if (Atomic::cmpxchg(v-1, &_Event, v) == v) break;
}
guarantee (v >= 0, "invariant") ;
guarantee(v >= 0, "invariant");
if (v == 0) {
// Do this the hard way by blocking ...
int status = pthread_mutex_lock(_mutex);
assert_status(status == 0, status, "mutex_lock");
guarantee (_nParked == 0, "invariant") ;
++ _nParked ;
guarantee(_nParked == 0, "invariant");
++_nParked;
while (_Event < 0) {
status = pthread_cond_wait(_cond, _mutex);
// for some reason, under 2.7 lwp_cond_wait() may return ETIME ...
@ -5497,28 +5491,28 @@ void os::PlatformEvent::park() { // AKA "down()"
if (status == ETIME) { status = EINTR; }
assert_status(status == 0 || status == EINTR, status, "cond_wait");
}
-- _nParked ;
--_nParked;
_Event = 0 ;
_Event = 0;
status = pthread_mutex_unlock(_mutex);
assert_status(status == 0, status, "mutex_unlock");
// Paranoia to ensure our locked and lock-free paths interact
// correctly with each other.
OrderAccess::fence();
}
guarantee (_Event >= 0, "invariant") ;
guarantee(_Event >= 0, "invariant");
}
int os::PlatformEvent::park(jlong millis) {
guarantee (_nParked == 0, "invariant") ;
guarantee(_nParked == 0, "invariant");
int v ;
int v;
for (;;) {
v = _Event ;
if (Atomic::cmpxchg (v-1, &_Event, v) == v) break ;
v = _Event;
if (Atomic::cmpxchg(v-1, &_Event, v) == v) break;
}
guarantee (v >= 0, "invariant") ;
if (v != 0) return OS_OK ;
guarantee(v >= 0, "invariant");
if (v != 0) return OS_OK;
// We do this the hard way, by blocking the thread.
// Consider enforcing a minimum timeout value.
@ -5528,8 +5522,8 @@ int os::PlatformEvent::park(jlong millis) {
int ret = OS_TIMEOUT;
int status = pthread_mutex_lock(_mutex);
assert_status(status == 0, status, "mutex_lock");
guarantee (_nParked == 0, "invariant") ;
++_nParked ;
guarantee(_nParked == 0, "invariant");
++_nParked;
// Object.wait(timo) will return because of
// (a) notification
@ -5547,24 +5541,24 @@ int os::PlatformEvent::park(jlong millis) {
while (_Event < 0) {
status = os::Linux::safe_cond_timedwait(_cond, _mutex, &abst);
if (status != 0 && WorkAroundNPTLTimedWaitHang) {
pthread_cond_destroy (_cond);
pthread_cond_init (_cond, os::Linux::condAttr()) ;
pthread_cond_destroy(_cond);
pthread_cond_init(_cond, os::Linux::condAttr());
}
assert_status(status == 0 || status == EINTR ||
status == ETIME || status == ETIMEDOUT,
status, "cond_timedwait");
if (!FilterSpuriousWakeups) break ; // previous semantics
if (status == ETIME || status == ETIMEDOUT) break ;
if (!FilterSpuriousWakeups) break; // previous semantics
if (status == ETIME || status == ETIMEDOUT) break;
// We consume and ignore EINTR and spurious wakeups.
}
--_nParked ;
--_nParked;
if (_Event >= 0) {
ret = OS_OK;
}
_Event = 0 ;
_Event = 0;
status = pthread_mutex_unlock(_mutex);
assert_status(status == 0, status, "mutex_unlock");
assert (_nParked == 0, "invariant") ;
assert(_nParked == 0, "invariant");
// Paranoia to ensure our locked and lock-free paths interact
// correctly with each other.
OrderAccess::fence();
@ -5647,7 +5641,7 @@ void os::PlatformEvent::unpark() {
*/
static void unpackTime(timespec* absTime, bool isAbsolute, jlong time) {
assert (time > 0, "convertTime");
assert(time > 0, "convertTime");
time_t max_secs = 0;
if (!os::supports_monotonic_clock() || isAbsolute) {
@ -5726,7 +5720,7 @@ void Parker::park(bool isAbsolute, jlong time) {
// Next, demultiplex/decode time arguments
timespec absTime;
if (time < 0 || (isAbsolute && time == 0) ) { // don't wait at all
if (time < 0 || (isAbsolute && time == 0)) { // don't wait at all
return;
}
if (time > 0) {
@ -5748,11 +5742,11 @@ void Parker::park(bool isAbsolute, jlong time) {
return;
}
int status ;
int status;
if (_counter > 0) { // no wait needed
_counter = 0;
status = pthread_mutex_unlock(_mutex);
assert (status == 0, "invariant") ;
assert(status == 0, "invariant");
// Paranoia to ensure our locked and lock-free paths interact
// correctly with each other and Java-level accesses.
OrderAccess::fence();
@ -5774,13 +5768,13 @@ void Parker::park(bool isAbsolute, jlong time) {
assert(_cur_index == -1, "invariant");
if (time == 0) {
_cur_index = REL_INDEX; // arbitrary choice when not timed
status = pthread_cond_wait (&_cond[_cur_index], _mutex) ;
status = pthread_cond_wait(&_cond[_cur_index], _mutex);
} else {
_cur_index = isAbsolute ? ABS_INDEX : REL_INDEX;
status = os::Linux::safe_cond_timedwait (&_cond[_cur_index], _mutex, &absTime) ;
status = os::Linux::safe_cond_timedwait(&_cond[_cur_index], _mutex, &absTime);
if (status != 0 && WorkAroundNPTLTimedWaitHang) {
pthread_cond_destroy (&_cond[_cur_index]) ;
pthread_cond_init (&_cond[_cur_index], isAbsolute ? NULL : os::Linux::condAttr());
pthread_cond_destroy(&_cond[_cur_index]);
pthread_cond_init(&_cond[_cur_index], isAbsolute ? NULL : os::Linux::condAttr());
}
}
_cur_index = -1;
@ -5792,9 +5786,9 @@ void Parker::park(bool isAbsolute, jlong time) {
pthread_sigmask(SIG_SETMASK, &oldsigs, NULL);
#endif
_counter = 0 ;
status = pthread_mutex_unlock(_mutex) ;
assert_status(status == 0, status, "invariant") ;
_counter = 0;
status = pthread_mutex_unlock(_mutex);
assert_status(status == 0, status, "invariant");
// Paranoia to ensure our locked and lock-free paths interact
// correctly with each other and Java-level accesses.
OrderAccess::fence();
@ -5806,9 +5800,9 @@ void Parker::park(bool isAbsolute, jlong time) {
}
void Parker::unpark() {
int s, status ;
int s, status;
status = pthread_mutex_lock(_mutex);
assert (status == 0, "invariant") ;
assert(status == 0, "invariant");
s = _counter;
_counter = 1;
if (s < 1) {
@ -5817,22 +5811,22 @@ void Parker::unpark() {
// thread is definitely parked
if (WorkAroundNPTLTimedWaitHang) {
status = pthread_cond_signal (&_cond[_cur_index]);
assert (status == 0, "invariant");
assert(status == 0, "invariant");
status = pthread_mutex_unlock(_mutex);
assert (status == 0, "invariant");
assert(status == 0, "invariant");
} else {
status = pthread_mutex_unlock(_mutex);
assert (status == 0, "invariant");
assert(status == 0, "invariant");
status = pthread_cond_signal (&_cond[_cur_index]);
assert (status == 0, "invariant");
assert(status == 0, "invariant");
}
} else {
pthread_mutex_unlock(_mutex);
assert (status == 0, "invariant") ;
assert(status == 0, "invariant");
}
} else {
pthread_mutex_unlock(_mutex);
assert (status == 0, "invariant") ;
assert(status == 0, "invariant");
}
}

View File

@ -287,16 +287,16 @@ public:
class PlatformEvent : public CHeapObj<mtInternal> {
private:
double CachePad [4] ; // increase odds that _mutex is sole occupant of cache line
volatile int _Event ;
volatile int _nParked ;
pthread_mutex_t _mutex [1] ;
pthread_cond_t _cond [1] ;
double PostPad [2] ;
Thread * _Assoc ;
double CachePad[4]; // increase odds that _mutex is sole occupant of cache line
volatile int _Event;
volatile int _nParked;
pthread_mutex_t _mutex[1];
pthread_cond_t _cond[1];
double PostPad[2];
Thread * _Assoc;
public: // TODO-FIXME: make dtor private
~PlatformEvent() { guarantee (0, "invariant") ; }
~PlatformEvent() { guarantee(0, "invariant"); }
public:
PlatformEvent() {
@ -305,20 +305,20 @@ class PlatformEvent : public CHeapObj<mtInternal> {
assert_status(status == 0, status, "cond_init");
status = pthread_mutex_init (_mutex, NULL);
assert_status(status == 0, status, "mutex_init");
_Event = 0 ;
_nParked = 0 ;
_Assoc = NULL ;
_Event = 0;
_nParked = 0;
_Assoc = NULL;
}
// Use caution with reset() and fired() -- they may require MEMBARs
void reset() { _Event = 0 ; }
void reset() { _Event = 0; }
int fired() { return _Event; }
void park () ;
void unpark () ;
int TryPark () ;
int park (jlong millis) ; // relative timed-wait only
void SetAssociation (Thread * a) { _Assoc = a ; }
} ;
void park();
void unpark();
int TryPark();
int park(jlong millis); // relative timed-wait only
void SetAssociation(Thread * a) { _Assoc = a; }
};
class PlatformParker : public CHeapObj<mtInternal> {
protected:
@ -327,11 +327,11 @@ class PlatformParker : public CHeapObj<mtInternal> {
ABS_INDEX = 1
};
int _cur_index; // which cond is in use: -1, 0, 1
pthread_mutex_t _mutex [1] ;
pthread_cond_t _cond [2] ; // one for relative times and one for abs.
pthread_mutex_t _mutex[1];
pthread_cond_t _cond[2]; // one for relative times and one for abs.
public: // TODO-FIXME: make dtor private
~PlatformParker() { guarantee (0, "invariant") ; }
~PlatformParker() { guarantee(0, "invariant"); }
public:
PlatformParker() {

View File

@ -23,7 +23,6 @@
*/
// no precompiled headers
#include "runtime/atomic.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/os.hpp"

View File

@ -41,6 +41,7 @@
#include "prims/jvm.h"
#include "prims/jvm_misc.hpp"
#include "runtime/arguments.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/extendedPC.hpp"
#include "runtime/globals.hpp"
#include "runtime/interfaceSupport.hpp"
@ -212,13 +213,13 @@ Thread* ThreadLocalStorage::get_thread_via_cache_slowly(uintptr_t raw_id,
"sp must be inside of selected thread stack");
thread->set_self_raw_id(raw_id); // mark for quick retrieval
_get_thread_cache[ index ] = thread;
_get_thread_cache[index] = thread;
}
return thread;
}
static const double all_zero[ sizeof(Thread) / sizeof(double) + 1 ] = {0};
static const double all_zero[sizeof(Thread) / sizeof(double) + 1] = {0};
#define NO_CACHED_THREAD ((Thread*)all_zero)
void ThreadLocalStorage::pd_set_thread(Thread* thread) {
@ -270,8 +271,8 @@ static inline stack_t get_stack_info() {
}
address os::current_stack_base() {
int r = thr_main() ;
guarantee (r == 0 || r == 1, "CR6501650 or CR6493689") ;
int r = thr_main();
guarantee(r == 0 || r == 1, "CR6501650 or CR6493689");
bool is_primordial_thread = r;
// Workaround 4352906, avoid calls to thr_stksegment by
@ -293,9 +294,9 @@ address os::current_stack_base() {
size_t os::current_stack_size() {
size_t size;
int r = thr_main() ;
guarantee (r == 0 || r == 1, "CR6501650 or CR6493689") ;
if(!r) {
int r = thr_main();
guarantee(r == 0 || r == 1, "CR6501650 or CR6493689");
if (!r) {
size = get_stack_info().ss_size;
} else {
struct rlimit limits;
@ -409,7 +410,7 @@ static bool find_processors_in_pset(psetid_t pset,
static bool find_processors_online(processorid_t** id_array,
uint* id_length) {
const processorid_t MAX_PROCESSOR_ID = 100000 ;
const processorid_t MAX_PROCESSOR_ID = 100000;
// Find the number of processors online.
*id_length = sysconf(_SC_NPROCESSORS_ONLN);
// Make up an array to hold their ids.
@ -436,7 +437,7 @@ static bool find_processors_online(processorid_t** id_array,
// we've got. Note that in the worst case find_processors_online() could
// return an empty set. (As a fall-back in the case of the empty set we
// could just return the ID of the current processor).
*id_length = found ;
*id_length = found;
}
return true;
@ -552,13 +553,13 @@ bool os::bind_to_processor(uint processor_id) {
}
bool os::getenv(const char* name, char* buffer, int len) {
char* val = ::getenv( name );
if ( val == NULL
char* val = ::getenv(name);
if (val == NULL
|| strlen(val) + 1 > len ) {
if (len > 0) buffer[0] = 0; // return a null string
return false;
}
strcpy( buffer, val );
strcpy(buffer, val);
return true;
}
@ -672,7 +673,7 @@ void os::init_system_properties_values() {
// Determine search path count and required buffer size.
if (dlinfo(RTLD_SELF, RTLD_DI_SERINFOSIZE, (void *)info) == -1) {
FREE_C_HEAP_ARRAY(char, buf, mtInternal);
FREE_C_HEAP_ARRAY(char, buf, mtInternal);
vm_exit_during_initialization("dlinfo SERINFOSIZE request", dlerror());
}
@ -683,7 +684,7 @@ void os::init_system_properties_values() {
// Obtain search path information.
if (dlinfo(RTLD_SELF, RTLD_DI_SERINFO, (void *)info) == -1) {
FREE_C_HEAP_ARRAY(char, buf, mtInternal);
FREE_C_HEAP_ARRAY(char, buf, mtInternal);
FREE_C_HEAP_ARRAY(char, info, mtInternal);
vm_exit_during_initialization("dlinfo SERINFO request", dlerror());
}
@ -794,7 +795,7 @@ bool os::obsolete_option(const JavaVMOption *option)
bool os::Solaris::valid_stack_address(Thread* thread, address sp) {
address stackStart = (address)thread->stack_base();
address stackEnd = (address)(stackStart - (address)thread->stack_size());
if (sp < stackStart && sp >= stackEnd ) return true;
if (sp < stackStart && sp >= stackEnd) return true;
return false;
}
@ -819,8 +820,8 @@ extern "C" void* java_start(void* thread_addr) {
Thread* thread = (Thread*)thread_addr;
OSThread* osthr = thread->osthread();
osthr->set_lwp_id( _lwp_self() ); // Store lwp in case we are bound
thread->_schedctl = (void *) schedctl_init () ;
osthr->set_lwp_id(_lwp_self()); // Store lwp in case we are bound
thread->_schedctl = (void *) schedctl_init();
if (UseNUMA) {
int lgrp_id = os::numa_get_group_id();
@ -839,8 +840,8 @@ extern "C" void* java_start(void* thread_addr) {
// in java_to_os_priority. So we save the native priority
// in the osThread and recall it here.
if ( osthr->thread_id() != -1 ) {
if ( UseThreadPriorities ) {
if (osthr->thread_id() != -1) {
if (UseThreadPriorities) {
int prio = osthr->native_priority();
if (ThreadPriorityVerbose) {
tty->print_cr("Starting Thread " INTPTR_FORMAT ", LWP is "
@ -882,7 +883,7 @@ static OSThread* create_os_thread(Thread* thread, thread_t thread_id) {
// Store info on the Solaris thread into the OSThread
osthread->set_thread_id(thread_id);
osthread->set_lwp_id(_lwp_self());
thread->_schedctl = (void *) schedctl_init () ;
thread->_schedctl = (void *) schedctl_init();
if (UseNUMA) {
int lgrp_id = os::numa_get_group_id();
@ -891,9 +892,9 @@ static OSThread* create_os_thread(Thread* thread, thread_t thread_id) {
}
}
if ( ThreadPriorityVerbose ) {
if (ThreadPriorityVerbose) {
tty->print_cr("In create_os_thread, Thread " INTPTR_FORMAT ", LWP is " INTPTR_FORMAT "\n",
osthread->thread_id(), osthread->lwp_id() );
osthread->thread_id(), osthread->lwp_id());
}
// Initial thread state is INITIALIZED, not SUSPENDED
@ -974,9 +975,9 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) {
return false;
}
if ( ThreadPriorityVerbose ) {
if (ThreadPriorityVerbose) {
char *thrtyp;
switch ( thr_type ) {
switch (thr_type) {
case vm_thread:
thrtyp = (char *)"vm";
break;
@ -1207,11 +1208,11 @@ void _handle_uncaught_cxx_exception() {
// First crack at OS-specific initialization, from inside the new thread.
void os::initialize_thread(Thread* thr) {
int r = thr_main() ;
guarantee (r == 0 || r == 1, "CR6501650 or CR6493689") ;
int r = thr_main();
guarantee(r == 0 || r == 1, "CR6501650 or CR6493689");
if (r) {
JavaThread* jt = (JavaThread *)thr;
assert(jt != NULL,"Sanity check");
assert(jt != NULL, "Sanity check");
size_t stack_size;
address base = jt->stack_base();
if (Arguments::created_by_java_launcher()) {
@ -1322,7 +1323,7 @@ int os::allocate_thread_local_storage() {
// JavaThread in Java code, and have stubs simply
// treat %g2 as a caller-save register, preserving it in a %lN.
thread_key_t tk;
if (thr_keycreate( &tk, NULL ) )
if (thr_keycreate( &tk, NULL))
fatal(err_msg("os::allocate_thread_local_storage: thr_keycreate failed "
"(%s)", strerror(errno)));
return int(tk);
@ -1347,7 +1348,7 @@ void os::thread_local_storage_at_put(int index, void* value) {
"(%s)", strerror(errno)));
}
} else {
ThreadLocalStorage::set_thread_in_slot ((Thread *) value) ;
ThreadLocalStorage::set_thread_in_slot((Thread *) value);
}
}
@ -1579,7 +1580,7 @@ bool os::dll_build_name(char* buffer, size_t buflen,
if (pelements == NULL) {
return false;
}
for (int i = 0 ; i < n ; i++) {
for (int i = 0; i < n; i++) {
// really shouldn't be NULL but what the heck, check can't hurt
if (pelements[i] == NULL || strlen(pelements[i]) == 0) {
continue; // skip the empty path values
@ -1591,7 +1592,7 @@ bool os::dll_build_name(char* buffer, size_t buflen,
}
}
// release the storage
for (int i = 0 ; i < n ; i++) {
for (int i = 0; i < n; i++) {
if (pelements[i] != NULL) {
FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal);
}
@ -1795,7 +1796,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
bool failed_to_read_elf_head=
(sizeof(elf_head)!=
(::read(file_descriptor, &elf_head,sizeof(elf_head)))) ;
(::read(file_descriptor, &elf_head,sizeof(elf_head))));
::close(file_descriptor);
if (failed_to_read_elf_head) {
@ -1851,7 +1852,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
arch_t lib_arch={elf_head.e_machine,0,elf_head.e_ident[EI_CLASS], elf_head.e_ident[EI_DATA], NULL};
int running_arch_index=-1;
for (unsigned int i=0 ; i < ARRAY_SIZE(arch_array) ; i++ ) {
for (unsigned int i=0; i < ARRAY_SIZE(arch_array); i++) {
if (running_arch_code == arch_array[i].code) {
running_arch_index = i;
}
@ -1880,7 +1881,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
}
if (lib_arch.compat_class != arch_array[running_arch_index].compat_class) {
if ( lib_arch.name!=NULL ) {
if (lib_arch.name!=NULL) {
::snprintf(diag_msg_buf, diag_msg_max_length-1,
" (Possible cause: can't load %s-bit .so on a %s-bit platform)",
lib_arch.name, arch_array[running_arch_index].name);
@ -1969,7 +1970,7 @@ static bool check_addr0(outputStream* st) {
int fd = ::open("/proc/self/map",O_RDONLY);
if (fd >= 0) {
prmap_t p;
while(::read(fd, &p, sizeof(p)) > 0) {
while (::read(fd, &p, sizeof(p)) > 0) {
if (p.pr_vaddr == 0x0) {
st->print("Warning: Address: 0x%x, Size: %dK, ",p.pr_vaddr, p.pr_size/1024, p.pr_mapname);
st->print("Mapped file: %s, ", p.pr_mapname[0] == '\0' ? "None" : p.pr_mapname);
@ -2079,7 +2080,7 @@ static void print_signal_handler(outputStream* st, int sig,
address rh = VMError::get_resetted_sighandler(sig);
// May be, handler was resetted by VMError?
if(rh != NULL) {
if (rh != NULL) {
handler = rh;
sa.sa_flags = VMError::get_resetted_sigflags(sig);
}
@ -2088,11 +2089,11 @@ static void print_signal_handler(outputStream* st, int sig,
os::Posix::print_sa_flags(st, sa.sa_flags);
// Check: is it our handler?
if(handler == CAST_FROM_FN_PTR(address, signalHandler) ||
if (handler == CAST_FROM_FN_PTR(address, signalHandler) ||
handler == CAST_FROM_FN_PTR(address, sigINTRHandler)) {
// It is our signal handler
// check for flags
if(sa.sa_flags != os::Solaris::get_our_sigflags(sig)) {
if (sa.sa_flags != os::Solaris::get_our_sigflags(sig)) {
st->print(
", flags was changed from " PTR32_FORMAT ", consider using jsig library",
os::Solaris::get_our_sigflags(sig));
@ -2403,7 +2404,7 @@ static int check_pending_signals(bool wait_for_signal) {
do {
thread->set_suspend_equivalent();
// cleared by handle_special_suspend_equivalent_condition() or java_suspend_self()
while((ret = ::sema_wait(&sig_sem)) == EINTR)
while ((ret = ::sema_wait(&sig_sem)) == EINTR)
;
assert(ret == 0, "sema_wait() failed");
@ -2635,7 +2636,7 @@ size_t os::numa_get_leaf_groups(int *ids, size_t size) {
}
if (!r) {
// That's a leaf node.
assert (bottom <= cur, "Sanity check");
assert(bottom <= cur, "Sanity check");
// Check if the node has memory
if (Solaris::lgrp_resources(Solaris::lgrp_cookie(), ids[cur],
NULL, 0, LGRP_RSRC_MEM) > 0) {
@ -3051,7 +3052,7 @@ bool os::Solaris::mpss_sanity_check(bool warn, size_t* page_size) {
const size_t size_limit =
FLAG_IS_DEFAULT(LargePageSizeInBytes) ? 4 * M : LargePageSizeInBytes;
int beg;
for (beg = 0; beg < n && _page_sizes[beg] > size_limit; ++beg) /* empty */ ;
for (beg = 0; beg < n && _page_sizes[beg] > size_limit; ++beg) /* empty */;
const int end = MIN2((int)usable_count, n) - 1;
for (int cur = 0; cur < end; ++cur, ++beg) {
_page_sizes[cur] = _page_sizes[beg];
@ -3186,11 +3187,6 @@ void os::yield() {
os::YieldResult os::NakedYield() { thr_yield(); return os::YIELD_UNKNOWN; }
void os::yield_all() {
// Yields to all threads, including threads with lower priorities
os::sleep(Thread::current(), 1, false);
}
// Interface for setting lwp priorities. If we are using T2 libthread,
// which forces the use of BoundThreads or we manually set UseBoundThreads,
// all of our threads will be assigned to real lwp's. Using the thr_setprio
@ -3264,7 +3260,7 @@ static int java_MaxPriority_to_os_priority = 0; // Saved mapping
//
// Return errno or 0 if OK.
//
static int lwp_priocntl_init () {
static int lwp_priocntl_init() {
int rslt;
pcinfo_t ClassInfo;
pcparms_t ParmInfo;
@ -3274,7 +3270,7 @@ static int lwp_priocntl_init () {
// If ThreadPriorityPolicy is 1, switch tables
if (ThreadPriorityPolicy == 1) {
for (i = 0 ; i < CriticalPriority+1; i++)
for (i = 0; i < CriticalPriority+1; i++)
os::java_to_os_priority[i] = prio_policy1[i];
}
if (UseCriticalJavaThreadPriority) {
@ -3373,12 +3369,12 @@ static int lwp_priocntl_init () {
} else {
// No clue - punt
if (ThreadPriorityVerbose)
tty->print_cr ("Unknown scheduling class: %s ... \n", ClassInfo.pc_clname);
tty->print_cr("Unknown scheduling class: %s ... \n", ClassInfo.pc_clname);
return EINVAL; // no clue, punt
}
if (ThreadPriorityVerbose) {
tty->print_cr ("Thread priority Range: [%d..%d]\n", myMin, myMax);
tty->print_cr("Thread priority Range: [%d..%d]\n", myMin, myMax);
}
priocntl_enable = true; // Enable changing priorities
@ -3424,7 +3420,7 @@ int set_lwp_class_and_priority(int ThreadID, int lwpid,
// TODO: elide set-to-same-value
// If something went wrong on init, don't change priorities.
if ( !priocntl_enable ) {
if (!priocntl_enable) {
if (ThreadPriorityVerbose)
tty->print_cr("Trying to set priority but init failed, ignoring");
return EINVAL;
@ -3432,9 +3428,9 @@ int set_lwp_class_and_priority(int ThreadID, int lwpid,
// If lwp hasn't started yet, just return
// the _start routine will call us again.
if ( lwpid <= 0 ) {
if (lwpid <= 0) {
if (ThreadPriorityVerbose) {
tty->print_cr ("deferring the set_lwp_class_and_priority of thread "
tty->print_cr("deferring the set_lwp_class_and_priority of thread "
INTPTR_FORMAT " to %d, lwpid not set",
ThreadID, newPrio);
}
@ -3653,7 +3649,7 @@ OSReturn os::set_native_priority(Thread* thread, int newpri) {
OSReturn os::get_native_priority(const Thread* const thread, int *priority_ptr) {
int p;
if ( !UseThreadPriorities ) {
if (!UseThreadPriorities) {
*priority_ptr = NormalPriority;
return OS_OK;
}
@ -4099,7 +4095,7 @@ void os::Solaris::set_signal_handler(int sig, bool set_installed, bool oktochain
void os::run_periodic_checks() {
// A big source of grief is hijacking virt. addr 0x0 on Solaris,
// thereby preventing a NULL checks.
if(!check_addr0_done) check_addr0_done = check_addr0(tty);
if (!check_addr0_done) check_addr0_done = check_addr0(tty);
if (check_signals == false) return;
@ -4148,10 +4144,10 @@ void os::Solaris::check_signal_handler(int sig) {
address thisHandler = (act.sa_flags & SA_SIGINFO)
? CAST_FROM_FN_PTR(address, act.sa_sigaction)
: CAST_FROM_FN_PTR(address, act.sa_handler) ;
: CAST_FROM_FN_PTR(address, act.sa_handler);
switch(sig) {
switch (sig) {
case SIGSEGV:
case SIGBUS:
case SIGFPE:
@ -4332,7 +4328,7 @@ os::Solaris::meminfo_func_t os::Solaris::_meminfo = 0;
static address resolve_symbol_lazy(const char* name) {
address addr = (address) dlsym(RTLD_DEFAULT, name);
if(addr == NULL) {
if (addr == NULL) {
// RTLD_DEFAULT was not defined on some early versions of 2.5.1
addr = (address) dlsym(RTLD_NEXT, name);
}
@ -4341,7 +4337,7 @@ static address resolve_symbol_lazy(const char* name) {
static address resolve_symbol(const char* name) {
address addr = resolve_symbol_lazy(name);
if(addr == NULL) {
if (addr == NULL) {
fatal(dlerror());
}
return addr;
@ -4353,7 +4349,7 @@ void os::Solaris::libthread_init() {
lwp_priocntl_init();
// RTLD_DEFAULT was not defined on some early versions of 5.5.1
if(func == NULL) {
if (func == NULL) {
func = (address) dlsym(RTLD_NEXT, "_thr_suspend_allmutators");
// Guarantee that this VM is running on an new enough OS (5.6 or
// later) that it will have a new enough libthread.so.
@ -4384,7 +4380,7 @@ int_fnP_cond_tP os::Solaris::_cond_destroy;
int os::Solaris::_cond_scope = USYNC_THREAD;
void os::Solaris::synchronization_init() {
if(UseLWPSynchronization) {
if (UseLWPSynchronization) {
os::Solaris::set_mutex_lock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("_lwp_mutex_lock")));
os::Solaris::set_mutex_trylock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("_lwp_mutex_trylock")));
os::Solaris::set_mutex_unlock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("_lwp_mutex_unlock")));
@ -4404,7 +4400,7 @@ void os::Solaris::synchronization_init() {
os::Solaris::set_mutex_scope(USYNC_THREAD);
os::Solaris::set_cond_scope(USYNC_THREAD);
if(UsePthreads) {
if (UsePthreads) {
os::Solaris::set_mutex_lock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("pthread_mutex_lock")));
os::Solaris::set_mutex_trylock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("pthread_mutex_trylock")));
os::Solaris::set_mutex_unlock(CAST_TO_FN_PTR(int_fnP_mutex_tP, resolve_symbol("pthread_mutex_unlock")));
@ -4576,17 +4572,17 @@ jint os::init_2(void) {
os::set_polling_page(polling_page);
#ifndef PRODUCT
if( Verbose && PrintMiscellaneous )
if (Verbose && PrintMiscellaneous)
tty->print("[SafePoint Polling address: " INTPTR_FORMAT "]\n", (intptr_t)polling_page);
#endif
if (!UseMembar) {
address mem_serialize_page = (address)Solaris::mmap_chunk( NULL, page_size, MAP_PRIVATE, PROT_READ | PROT_WRITE );
guarantee( mem_serialize_page != NULL, "mmap Failed for memory serialize page");
os::set_memory_serialize_page( mem_serialize_page );
address mem_serialize_page = (address)Solaris::mmap_chunk(NULL, page_size, MAP_PRIVATE, PROT_READ | PROT_WRITE);
guarantee(mem_serialize_page != NULL, "mmap Failed for memory serialize page");
os::set_memory_serialize_page(mem_serialize_page);
#ifndef PRODUCT
if(Verbose && PrintMiscellaneous)
if (Verbose && PrintMiscellaneous)
tty->print("[Memory Serialize Page address: " INTPTR_FORMAT "]\n", (intptr_t)mem_serialize_page);
#endif
}
@ -4725,13 +4721,13 @@ void os::init_3(void) {
// Mark the polling page as unreadable
void os::make_polling_page_unreadable(void) {
if( mprotect((char *)_polling_page, page_size, PROT_NONE) != 0 )
if (mprotect((char *)_polling_page, page_size, PROT_NONE) != 0)
fatal("Could not disable polling page");
};
// Mark the polling page as readable
void os::make_polling_page_readable(void) {
if( mprotect((char *)_polling_page, page_size, PROT_READ) != 0 )
if (mprotect((char *)_polling_page, page_size, PROT_READ) != 0)
fatal("Could not enable polling page");
};
@ -5221,7 +5217,7 @@ jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
getpid(),
thread->osthread()->lwp_id());
fd = ::open(proc_name, O_RDONLY);
if ( fd == -1 ) return -1;
if (fd == -1) return -1;
do {
count = ::pread(fd,
@ -5230,7 +5226,7 @@ jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
thr_time_off);
} while (count < 0 && errno == EINTR);
::close(fd);
if ( count < 0 ) return -1;
if (count < 0) return -1;
if (user_sys_cpu_time) {
// user + system CPU time
@ -5244,7 +5240,7 @@ jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
(jlong)prusage.pr_utime.tv_nsec;
}
return(lwp_time);
return (lwp_time);
}
void os::current_thread_cpu_time_info(jvmtiTimerInfo *info_ptr) {
@ -5448,43 +5444,43 @@ static timestruc_t* compute_abstime(timestruc_t* abstime, jlong millis) {
int os::PlatformEvent::TryPark() {
for (;;) {
const int v = _Event ;
guarantee ((v == 0) || (v == 1), "invariant") ;
if (Atomic::cmpxchg (0, &_Event, v) == v) return v ;
const int v = _Event;
guarantee((v == 0) || (v == 1), "invariant");
if (Atomic::cmpxchg(0, &_Event, v) == v) return v;
}
}
void os::PlatformEvent::park() { // AKA: down()
// Invariant: Only the thread associated with the Event/PlatformEvent
// may call park().
int v ;
int v;
for (;;) {
v = _Event ;
if (Atomic::cmpxchg (v-1, &_Event, v) == v) break ;
v = _Event;
if (Atomic::cmpxchg(v-1, &_Event, v) == v) break;
}
guarantee (v >= 0, "invariant") ;
guarantee(v >= 0, "invariant");
if (v == 0) {
// Do this the hard way by blocking ...
// See http://monaco.sfbay/detail.jsf?cr=5094058.
// TODO-FIXME: for Solaris SPARC set fprs.FEF=0 prior to parking.
// Only for SPARC >= V8PlusA
#if defined(__sparc) && defined(COMPILER2)
if (ClearFPUAtPark) { _mark_fpu_nosave() ; }
if (ClearFPUAtPark) { _mark_fpu_nosave(); }
#endif
int status = os::Solaris::mutex_lock(_mutex);
assert_status(status == 0, status, "mutex_lock");
guarantee (_nParked == 0, "invariant") ;
++ _nParked ;
assert_status(status == 0, status, "mutex_lock");
guarantee(_nParked == 0, "invariant");
++_nParked;
while (_Event < 0) {
// for some reason, under 2.7 lwp_cond_wait() may return ETIME ...
// Treat this the same as if the wait was interrupted
// With usr/lib/lwp going to kernel, always handle ETIME
status = os::Solaris::cond_wait(_cond, _mutex);
if (status == ETIME) status = EINTR ;
if (status == ETIME) status = EINTR;
assert_status(status == 0 || status == EINTR, status, "cond_wait");
}
-- _nParked ;
_Event = 0 ;
--_nParked;
_Event = 0;
status = os::Solaris::mutex_unlock(_mutex);
assert_status(status == 0, status, "mutex_unlock");
// Paranoia to ensure our locked and lock-free paths interact
@ -5494,41 +5490,41 @@ void os::PlatformEvent::park() { // AKA: down()
}
int os::PlatformEvent::park(jlong millis) {
guarantee (_nParked == 0, "invariant") ;
int v ;
guarantee(_nParked == 0, "invariant");
int v;
for (;;) {
v = _Event ;
if (Atomic::cmpxchg (v-1, &_Event, v) == v) break ;
v = _Event;
if (Atomic::cmpxchg(v-1, &_Event, v) == v) break;
}
guarantee (v >= 0, "invariant") ;
if (v != 0) return OS_OK ;
guarantee(v >= 0, "invariant");
if (v != 0) return OS_OK;
int ret = OS_TIMEOUT;
timestruc_t abst;
compute_abstime (&abst, millis);
compute_abstime(&abst, millis);
// See http://monaco.sfbay/detail.jsf?cr=5094058.
// For Solaris SPARC set fprs.FEF=0 prior to parking.
// Only for SPARC >= V8PlusA
#if defined(__sparc) && defined(COMPILER2)
if (ClearFPUAtPark) { _mark_fpu_nosave() ; }
if (ClearFPUAtPark) { _mark_fpu_nosave(); }
#endif
int status = os::Solaris::mutex_lock(_mutex);
assert_status(status == 0, status, "mutex_lock");
guarantee (_nParked == 0, "invariant") ;
++ _nParked ;
guarantee(_nParked == 0, "invariant");
++_nParked;
while (_Event < 0) {
int status = os::Solaris::cond_timedwait(_cond, _mutex, &abst);
assert_status(status == 0 || status == EINTR ||
status == ETIME || status == ETIMEDOUT,
status, "cond_timedwait");
if (!FilterSpuriousWakeups) break ; // previous semantics
if (status == ETIME || status == ETIMEDOUT) break ;
if (!FilterSpuriousWakeups) break; // previous semantics
if (status == ETIME || status == ETIMEDOUT) break;
// We consume and ignore EINTR and spurious wakeups.
}
-- _nParked ;
if (_Event >= 0) ret = OS_OK ;
_Event = 0 ;
--_nParked;
if (_Event >= 0) ret = OS_OK;
_Event = 0;
status = os::Solaris::mutex_unlock(_mutex);
assert_status(status == 0, status, "mutex_unlock");
// Paranoia to ensure our locked and lock-free paths interact
@ -5605,7 +5601,7 @@ void os::PlatformEvent::unpark() {
* years from "now".
*/
static void unpackTime(timespec* absTime, bool isAbsolute, jlong time) {
assert (time > 0, "convertTime");
assert(time > 0, "convertTime");
struct timeval now;
int status = gettimeofday(&now, NULL);
@ -5664,7 +5660,7 @@ void Parker::park(bool isAbsolute, jlong time) {
// First, demultiplex/decode time arguments
timespec absTime;
if (time < 0 || (isAbsolute && time == 0) ) { // don't wait at all
if (time < 0 || (isAbsolute && time == 0)) { // don't wait at all
return;
}
if (time > 0) {
@ -5688,12 +5684,12 @@ void Parker::park(bool isAbsolute, jlong time) {
return;
}
int status ;
int status;
if (_counter > 0) { // no wait needed
_counter = 0;
status = os::Solaris::mutex_unlock(_mutex);
assert (status == 0, "invariant") ;
assert(status == 0, "invariant");
// Paranoia to ensure our locked and lock-free paths interact
// correctly with each other and Java-level accesses.
OrderAccess::fence();
@ -5717,11 +5713,11 @@ void Parker::park(bool isAbsolute, jlong time) {
// TODO-FIXME: for Solaris SPARC set fprs.FEF=0 prior to parking.
// Only for SPARC >= V8PlusA
#if defined(__sparc) && defined(COMPILER2)
if (ClearFPUAtPark) { _mark_fpu_nosave() ; }
if (ClearFPUAtPark) { _mark_fpu_nosave(); }
#endif
if (time == 0) {
status = os::Solaris::cond_wait (_cond, _mutex) ;
status = os::Solaris::cond_wait(_cond, _mutex);
} else {
status = os::Solaris::cond_timedwait (_cond, _mutex, &absTime);
}
@ -5734,9 +5730,9 @@ void Parker::park(bool isAbsolute, jlong time) {
#ifdef ASSERT
thr_sigsetmask(SIG_SETMASK, &oldsigs, NULL);
#endif
_counter = 0 ;
_counter = 0;
status = os::Solaris::mutex_unlock(_mutex);
assert_status(status == 0, status, "mutex_unlock") ;
assert_status(status == 0, status, "mutex_unlock");
// Paranoia to ensure our locked and lock-free paths interact
// correctly with each other and Java-level accesses.
OrderAccess::fence();
@ -5748,17 +5744,17 @@ void Parker::park(bool isAbsolute, jlong time) {
}
void Parker::unpark() {
int s, status ;
status = os::Solaris::mutex_lock (_mutex) ;
assert (status == 0, "invariant") ;
int s, status;
status = os::Solaris::mutex_lock(_mutex);
assert(status == 0, "invariant");
s = _counter;
_counter = 1;
status = os::Solaris::mutex_unlock (_mutex) ;
assert (status == 0, "invariant") ;
status = os::Solaris::mutex_unlock(_mutex);
assert(status == 0, "invariant");
if (s < 1) {
status = os::Solaris::cond_signal (_cond) ;
assert (status == 0, "invariant") ;
status = os::Solaris::cond_signal(_cond);
assert(status == 0, "invariant");
}
}
@ -5925,14 +5921,14 @@ int os::timeout(int fd, long timeout) {
gettimeofday(&t, &aNull);
prevtime = ((julong)t.tv_sec * 1000) + t.tv_usec / 1000;
for(;;) {
for (;;) {
res = ::poll(&pfd, 1, timeout);
if(res == OS_ERR && errno == EINTR) {
if(timeout != -1) {
if (res == OS_ERR && errno == EINTR) {
if (timeout != -1) {
gettimeofday(&t, &aNull);
newtime = ((julong)t.tv_sec * 1000) + t.tv_usec /1000;
timeout -= newtime - prevtime;
if(timeout <= 0)
if (timeout <= 0)
return OS_OK;
prevtime = newtime;
}

View File

@ -301,48 +301,48 @@ class Solaris {
class PlatformEvent : public CHeapObj<mtInternal> {
private:
double CachePad [4] ; // increase odds that _mutex is sole occupant of cache line
volatile int _Event ;
int _nParked ;
int _pipev [2] ;
mutex_t _mutex [1] ;
cond_t _cond [1] ;
double PostPad [2] ;
double CachePad[4]; // increase odds that _mutex is sole occupant of cache line
volatile int _Event;
int _nParked;
int _pipev[2];
mutex_t _mutex[1];
cond_t _cond[1];
double PostPad[2];
protected:
// Defining a protected ctor effectively gives us an abstract base class.
// That is, a PlatformEvent can never be instantiated "naked" but only
// as a part of a ParkEvent (recall that ParkEvent extends PlatformEvent).
// TODO-FIXME: make dtor private
~PlatformEvent() { guarantee (0, "invariant") ; }
~PlatformEvent() { guarantee(0, "invariant"); }
PlatformEvent() {
int status;
status = os::Solaris::cond_init(_cond);
assert_status(status == 0, status, "cond_init");
status = os::Solaris::mutex_init(_mutex);
assert_status(status == 0, status, "mutex_init");
_Event = 0 ;
_nParked = 0 ;
_pipev[0] = _pipev[1] = -1 ;
_Event = 0;
_nParked = 0;
_pipev[0] = _pipev[1] = -1;
}
public:
// Exercise caution using reset() and fired() -- they may require MEMBARs
void reset() { _Event = 0 ; }
void reset() { _Event = 0; }
int fired() { return _Event; }
void park () ;
int park (jlong millis) ;
int TryPark () ;
void unpark () ;
} ;
void park();
int park(jlong millis);
int TryPark();
void unpark();
};
class PlatformParker : public CHeapObj<mtInternal> {
protected:
mutex_t _mutex [1] ;
cond_t _cond [1] ;
mutex_t _mutex[1];
cond_t _cond[1];
public: // TODO-FIXME: make dtor private
~PlatformParker() { guarantee (0, "invariant") ; }
~PlatformParker() { guarantee(0, "invariant"); }
public:
PlatformParker() {
@ -352,6 +352,6 @@ class PlatformParker : public CHeapObj<mtInternal> {
status = os::Solaris::mutex_init(_mutex);
assert_status(status == 0, status, "mutex_init");
}
} ;
};
#endif // OS_SOLARIS_VM_OS_SOLARIS_HPP

View File

@ -29,7 +29,6 @@
#error "This file should only be included from thread.inline.hpp"
#endif
#include "runtime/atomic.inline.hpp"
#include "runtime/thread.hpp"
#include "runtime/threadLocalStorage.hpp"

View File

@ -23,7 +23,6 @@
*/
// no precompiled headers
#include "runtime/atomic.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/os.hpp"

View File

@ -44,6 +44,7 @@
#include "prims/jvm.h"
#include "prims/jvm_misc.hpp"
#include "runtime/arguments.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/extendedPC.hpp"
#include "runtime/globals.hpp"
#include "runtime/interfaceSupport.hpp"
@ -125,11 +126,11 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) {
switch (reason) {
case DLL_PROCESS_ATTACH:
vm_lib_handle = hinst;
if(ForceTimeHighResolution)
if (ForceTimeHighResolution)
timeBeginPeriod(1L);
break;
case DLL_PROCESS_DETACH:
if(ForceTimeHighResolution)
if (ForceTimeHighResolution)
timeEndPeriod(1L);
// Workaround for issue when a custom launcher doesn't call
@ -318,7 +319,7 @@ extern "C" void breakpoint() {
*/
address os::get_caller_pc(int n) {
#ifdef _NMT_NOINLINE_
n ++;
n++;
#endif
address pc;
if (os::Kernel32Dll::RtlCaptureStackBackTrace(n + 1, 1, (PVOID*)&pc, NULL) == 1) {
@ -345,10 +346,10 @@ address os::current_stack_base() {
// Add up the sizes of all the regions with the same
// AllocationBase.
while( 1 )
while (1)
{
VirtualQuery(stack_bottom+stack_size, &minfo, sizeof(minfo));
if ( stack_bottom == (address)minfo.AllocationBase )
if (stack_bottom == (address)minfo.AllocationBase)
stack_size += minfo.RegionSize;
else
break;
@ -644,7 +645,7 @@ static jlong performance_frequency;
jlong as_long(LARGE_INTEGER x) {
jlong result = 0; // initialization to avoid warning
set_high(&result, x.HighPart);
set_low(&result, x.LowPart);
set_low(&result, x.LowPart);
return result;
}
@ -999,7 +1000,7 @@ void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char*
#endif
cwd = get_current_directory(NULL, 0);
jio_snprintf(buffer, bufferSize, "%s\\hs_err_pid%u.mdmp",cwd, current_process_id());
jio_snprintf(buffer, bufferSize, "%s\\hs_err_pid%u.mdmp", cwd, current_process_id());
dumpFile = CreateFile(buffer, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (dumpFile == INVALID_HANDLE_VALUE) {
@ -1217,7 +1218,7 @@ bool os::dll_build_name(char *buffer, size_t buflen,
if (pelements == NULL) {
return false;
}
for (int i = 0 ; i < n ; i++) {
for (int i = 0; i < n; i++) {
char* path = pelements[i];
// Really shouldn't be NULL, but check can't hurt
size_t plen = (path == NULL) ? 0 : strlen(path);
@ -1236,7 +1237,7 @@ bool os::dll_build_name(char *buffer, size_t buflen,
}
}
// release the storage
for (int i = 0 ; i < n ; i++) {
for (int i = 0; i < n; i++) {
if (pelements[i] != NULL) {
FREE_C_HEAP_ARRAY(char, pelements[i], mtInternal);
}
@ -1271,12 +1272,12 @@ static bool _addr_in_ntdll( address addr )
MODULEINFO minfo;
hmod = GetModuleHandle("NTDLL.DLL");
if ( hmod == NULL ) return false;
if ( !os::PSApiDll::GetModuleInformation( GetCurrentProcess(), hmod,
if (hmod == NULL) return false;
if (!os::PSApiDll::GetModuleInformation( GetCurrentProcess(), hmod,
&minfo, sizeof(MODULEINFO)) )
return false;
if ( (addr >= minfo.lpBaseOfDll) &&
if ((addr >= minfo.lpBaseOfDll) &&
(addr < (address)((uintptr_t)minfo.lpBaseOfDll + (uintptr_t)minfo.SizeOfImage)))
return true;
else
@ -1304,11 +1305,11 @@ typedef int (*EnumModulesCallbackFunc)(int, char *, address, unsigned, void *);
// enumerate_modules for Windows NT, using PSAPI
static int _enumerate_modules_winnt( int pid, EnumModulesCallbackFunc func, void * param)
{
HANDLE hProcess ;
HANDLE hProcess;
# define MAX_NUM_MODULES 128
HMODULE modules[MAX_NUM_MODULES];
static char filename[ MAX_PATH ];
static char filename[MAX_PATH];
int result = 0;
if (!os::PSApiDll::PSApiAvailable()) {
@ -1316,13 +1317,13 @@ static int _enumerate_modules_winnt( int pid, EnumModulesCallbackFunc func, void
}
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
FALSE, pid ) ;
FALSE, pid);
if (hProcess == NULL) return 0;
DWORD size_needed;
if (!os::PSApiDll::EnumProcessModules(hProcess, modules,
sizeof(modules), &size_needed)) {
CloseHandle( hProcess );
CloseHandle(hProcess);
return 0;
}
@ -1331,7 +1332,7 @@ static int _enumerate_modules_winnt( int pid, EnumModulesCallbackFunc func, void
for (int i = 0; i < MIN2(num_modules, MAX_NUM_MODULES); i++) {
// Get Full pathname:
if(!os::PSApiDll::GetModuleFileNameEx(hProcess, modules[i],
if (!os::PSApiDll::GetModuleFileNameEx(hProcess, modules[i],
filename, sizeof(filename))) {
filename[0] = '\0';
}
@ -1349,7 +1350,7 @@ static int _enumerate_modules_winnt( int pid, EnumModulesCallbackFunc func, void
if (result) break;
}
CloseHandle( hProcess ) ;
CloseHandle(hProcess);
return result;
}
@ -1357,8 +1358,8 @@ static int _enumerate_modules_winnt( int pid, EnumModulesCallbackFunc func, void
// enumerate_modules for Windows 95/98/ME, using TOOLHELP
static int _enumerate_modules_windows( int pid, EnumModulesCallbackFunc func, void *param)
{
HANDLE hSnapShot ;
static MODULEENTRY32 modentry ;
HANDLE hSnapShot;
static MODULEENTRY32 modentry;
int result = 0;
if (!os::Kernel32Dll::HelpToolsAvailable()) {
@ -1366,22 +1367,22 @@ static int _enumerate_modules_windows( int pid, EnumModulesCallbackFunc func, vo
}
// Get a handle to a Toolhelp snapshot of the system
hSnapShot = os::Kernel32Dll::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pid ) ;
if( hSnapShot == INVALID_HANDLE_VALUE ) {
return FALSE ;
hSnapShot = os::Kernel32Dll::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pid);
if (hSnapShot == INVALID_HANDLE_VALUE) {
return FALSE;
}
// iterate through all modules
modentry.dwSize = sizeof(MODULEENTRY32) ;
modentry.dwSize = sizeof(MODULEENTRY32);
bool not_done = os::Kernel32Dll::Module32First( hSnapShot, &modentry ) != 0;
while( not_done ) {
while (not_done) {
// invoke the callback
result=func(pid, modentry.szExePath, (address)modentry.modBaseAddr,
modentry.modBaseSize, param);
if (result) break;
modentry.dwSize = sizeof(MODULEENTRY32) ;
modentry.dwSize = sizeof(MODULEENTRY32);
not_done = os::Kernel32Dll::Module32Next( hSnapShot, &modentry ) != 0;
}
@ -1941,7 +1942,7 @@ void os::signal_raise(int signal_number) {
// that raises SIGTERM for the latter cases.
//
static BOOL WINAPI consoleHandler(DWORD event) {
switch(event) {
switch (event) {
case CTRL_C_EVENT:
if (is_error_reported()) {
// Ctrl-C is pressed during error reporting, likely because the error
@ -1965,7 +1966,7 @@ static BOOL WINAPI consoleHandler(DWORD event) {
HANDLE handle = GetProcessWindowStation();
if (handle != NULL &&
GetUserObjectInformation(handle, UOI_FLAGS, &flags,
sizeof( USEROBJECTFLAGS), NULL)) {
sizeof(USEROBJECTFLAGS), NULL)) {
// If it is a non-interactive session, let next handler to deal
// with it.
if ((flags.dwFlags & WSF_VISIBLE) == 0) {
@ -1991,7 +1992,7 @@ static BOOL WINAPI consoleHandler(DWORD event) {
// Return maximum OS signal used + 1 for internal use only
// Used as exit signal for signal_thread
int os::sigexitnum_pd(){
int os::sigexitnum_pd() {
return NSIG;
}
@ -2422,11 +2423,11 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
// process of write protecting the memory serialization page.
// It write enables the page immediately after protecting it
// so just return.
if ( exception_code == EXCEPTION_ACCESS_VIOLATION ) {
if (exception_code == EXCEPTION_ACCESS_VIOLATION) {
JavaThread* thread = (JavaThread*) t;
PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord;
address addr = (address) exceptionRecord->ExceptionInformation[1];
if ( os::is_memory_serialize_page(thread, addr) ) {
if (os::is_memory_serialize_page(thread, addr)) {
// Block current thread until the memory serialize page permission restored.
os::block_on_serialize_page_trap();
return EXCEPTION_CONTINUE_EXECUTION;
@ -2543,7 +2544,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
//
PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord;
address addr = (address) exceptionRecord->ExceptionInformation[1];
if (addr > thread->stack_yellow_zone_base() && addr < thread->stack_base() ) {
if (addr > thread->stack_yellow_zone_base() && addr < thread->stack_base()) {
addr = (address)((uintptr_t)addr &
(~((uintptr_t)os::vm_page_size() - (uintptr_t)1)));
os::commit_memory((char *)addr, thread->stack_base() - addr,
@ -2623,7 +2624,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
// Compiled method patched to be non entrant? Following conditions must apply:
// 1. must be first instruction in bundle
// 2. must be a break instruction with appropriate code
if((((uint64_t) pc & 0x0F) == 0) &&
if ((((uint64_t) pc & 0x0F) == 0) &&
(((IPF_Bundle*) pc)->get_slot0() == handle_wrong_method_break.bits())) {
return Handle_Exception(exceptionInfo,
(address)SharedRuntime::get_handle_wrong_method_stub());
@ -2794,7 +2795,7 @@ public:
return (_numa_used_node_count > 1);
}
int get_count() {return _numa_used_node_count;}
int get_count() { return _numa_used_node_count; }
int get_node_list_entry(int n) {
// for indexes out of range, returns -1
return (n < _numa_used_node_count ? _numa_used_node_list[n] : -1);
@ -3112,14 +3113,14 @@ char* os::pd_reserve_memory(size_t bytes, char* addr, size_t alignment_hint) {
res = (char*)VirtualAlloc(addr, bytes, MEM_RESERVE, PAGE_READWRITE);
} else {
elapsedTimer reserveTimer;
if( Verbose && PrintMiscellaneous ) reserveTimer.start();
if (Verbose && PrintMiscellaneous) reserveTimer.start();
// in numa interleaving, we have to allocate pages individually
// (well really chunks of NUMAInterleaveGranularity size)
res = allocate_pages_individually(bytes, addr, MEM_RESERVE, PAGE_READWRITE);
if (res == NULL) {
warning("NUMA page allocation failed");
}
if( Verbose && PrintMiscellaneous ) {
if (Verbose && PrintMiscellaneous) {
reserveTimer.stop();
tty->print_cr("reserve_memory of %Ix bytes took " JLONG_FORMAT " ms (" JLONG_FORMAT " ticks)", bytes,
reserveTimer.milliseconds(), reserveTimer.ticks());
@ -3450,14 +3451,14 @@ public:
int os::sleep(Thread* thread, jlong ms, bool interruptable) {
jlong limit = (jlong) MAXDWORD;
while(ms > limit) {
while (ms > limit) {
int res;
if ((res = sleep(thread, limit, interruptable)) != OS_TIMEOUT)
return res;
ms -= limit;
}
assert(thread == Thread::current(), "thread consistency check");
assert(thread == Thread::current(), "thread consistency check");
OSThread* osthread = thread->osthread();
OSThreadWaitState osts(osthread, false /* not Object.wait() */);
int result;
@ -3473,8 +3474,8 @@ int os::sleep(Thread* thread, jlong ms, bool interruptable) {
HANDLE events[1];
events[0] = osthread->interrupt_event();
HighResolutionInterval *phri=NULL;
if(!ForceTimeHighResolution)
phri = new HighResolutionInterval( ms );
if (!ForceTimeHighResolution)
phri = new HighResolutionInterval(ms);
if (WaitForMultipleObjects(1, events, FALSE, (DWORD)ms) == WAIT_TIMEOUT) {
result = OS_TIMEOUT;
} else {
@ -3511,26 +3512,21 @@ void os::infinite_sleep() {
}
}
typedef BOOL (WINAPI * STTSignature)(void) ;
typedef BOOL (WINAPI * STTSignature)(void);
os::YieldResult os::NakedYield() {
// Use either SwitchToThread() or Sleep(0)
// Consider passing back the return value from SwitchToThread().
if (os::Kernel32Dll::SwitchToThreadAvailable()) {
return SwitchToThread() ? os::YIELD_SWITCHED : os::YIELD_NONEREADY ;
return SwitchToThread() ? os::YIELD_SWITCHED : os::YIELD_NONEREADY;
} else {
Sleep(0);
}
return os::YIELD_UNKNOWN ;
return os::YIELD_UNKNOWN;
}
void os::yield() { os::NakedYield(); }
void os::yield_all() {
// Yields to all threads, including threads with lower priorities
Sleep(1);
}
// Win32 only gives you access to seven real priorities at a time,
// so we compress Java's ten down to seven. It would be better
// if we dynamically adjusted relative priorities.
@ -3574,7 +3570,7 @@ static int prio_init() {
}
}
if (UseCriticalJavaThreadPriority) {
os::java_to_os_priority[MaxPriority] = os::java_to_os_priority[CriticalPriority] ;
os::java_to_os_priority[MaxPriority] = os::java_to_os_priority[CriticalPriority];
}
return 0;
}
@ -3586,7 +3582,7 @@ OSReturn os::set_native_priority(Thread* thread, int priority) {
}
OSReturn os::get_native_priority(const Thread* const thread, int* priority_ptr) {
if ( !UseThreadPriorities ) {
if (!UseThreadPriorities) {
*priority_ptr = java_to_os_priority[NormPriority];
return OS_OK;
}
@ -3620,8 +3616,8 @@ void os::interrupt(Thread* thread) {
if (thread->is_Java_thread())
((JavaThread*)thread)->parker()->unpark();
ParkEvent * ev = thread->_ParkEvent ;
if (ev != NULL) ev->unpark() ;
ParkEvent * ev = thread->_ParkEvent;
if (ev != NULL) ev->unpark();
}
@ -3715,7 +3711,7 @@ void os::win32::initialize_system_info() {
OSVERSIONINFOEX oi;
oi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
GetVersionEx((OSVERSIONINFO*)&oi);
switch(oi.dwPlatformId) {
switch (oi.dwPlatformId) {
case VER_PLATFORM_WIN32_WINDOWS: _is_nt = false; break;
case VER_PLATFORM_WIN32_NT:
_is_nt = true;
@ -3898,29 +3894,29 @@ static jint initSock();
jint os::init_2(void) {
// Allocate a single page and mark it as readable for safepoint polling
address polling_page = (address)VirtualAlloc(NULL, os::vm_page_size(), MEM_RESERVE, PAGE_READONLY);
guarantee( polling_page != NULL, "Reserve Failed for polling page");
guarantee(polling_page != NULL, "Reserve Failed for polling page");
address return_page = (address)VirtualAlloc(polling_page, os::vm_page_size(), MEM_COMMIT, PAGE_READONLY);
guarantee( return_page != NULL, "Commit Failed for polling page");
guarantee(return_page != NULL, "Commit Failed for polling page");
os::set_polling_page( polling_page );
os::set_polling_page(polling_page);
#ifndef PRODUCT
if( Verbose && PrintMiscellaneous )
if (Verbose && PrintMiscellaneous)
tty->print("[SafePoint Polling address: " INTPTR_FORMAT "]\n", (intptr_t)polling_page);
#endif
if (!UseMembar) {
address mem_serialize_page = (address)VirtualAlloc(NULL, os::vm_page_size(), MEM_RESERVE, PAGE_READWRITE);
guarantee( mem_serialize_page != NULL, "Reserve Failed for memory serialize page");
guarantee(mem_serialize_page != NULL, "Reserve Failed for memory serialize page");
return_page = (address)VirtualAlloc(mem_serialize_page, os::vm_page_size(), MEM_COMMIT, PAGE_READWRITE);
guarantee( return_page != NULL, "Commit Failed for memory serialize page");
guarantee(return_page != NULL, "Commit Failed for memory serialize page");
os::set_memory_serialize_page( mem_serialize_page );
os::set_memory_serialize_page(mem_serialize_page);
#ifndef PRODUCT
if(Verbose && PrintMiscellaneous)
if (Verbose && PrintMiscellaneous)
tty->print("[Memory Serialize Page address: " INTPTR_FORMAT "]\n", (intptr_t)mem_serialize_page);
#endif
}
@ -4036,14 +4032,14 @@ void os::init_3(void) {
// Mark the polling page as unreadable
void os::make_polling_page_unreadable(void) {
DWORD old_status;
if( !VirtualProtect((char *)_polling_page, os::vm_page_size(), PAGE_NOACCESS, &old_status) )
if (!VirtualProtect((char *)_polling_page, os::vm_page_size(), PAGE_NOACCESS, &old_status))
fatal("Could not disable polling page");
};
// Mark the polling page as readable
void os::make_polling_page_readable(void) {
DWORD old_status;
if( !VirtualProtect((char *)_polling_page, os::vm_page_size(), PAGE_READONLY, &old_status) )
if (!VirtualProtect((char *)_polling_page, os::vm_page_size(), PAGE_READONLY, &old_status))
fatal("Could not enable polling page");
};
@ -4121,7 +4117,7 @@ jlong os::thread_cpu_time(Thread* thread, bool user_sys_cpu_time) {
FILETIME KernelTime;
FILETIME UserTime;
if ( GetThreadTimes(thread->osthread()->thread_handle(),
if (GetThreadTimes(thread->osthread()->thread_handle(),
&CreationTime, &ExitTime, &KernelTime, &UserTime) == 0)
return -1;
else
@ -4157,7 +4153,7 @@ bool os::is_thread_cpu_time_supported() {
FILETIME KernelTime;
FILETIME UserTime;
if ( GetThreadTimes(GetCurrentThread(),
if (GetThreadTimes(GetCurrentThread(),
&CreationTime, &ExitTime, &KernelTime, &UserTime) == 0)
return false;
else
@ -4391,7 +4387,7 @@ int os::ftruncate(int fd, jlong length) {
int os::fsync(int fd) {
HANDLE handle = (HANDLE)::_get_osfhandle(fd);
if ( (!::FlushFileBuffers(handle)) &&
if ((!::FlushFileBuffers(handle)) &&
(GetLastError() != ERROR_ACCESS_DENIED) ) {
/* from winerror.h */
return -1;
@ -4512,7 +4508,7 @@ static int stdinAvailable(int fd, long *pbytes) {
}
/* Examine input records for the number of bytes available */
for(i=0; i<numEvents; i++) {
for (i=0; i<numEvents; i++) {
if (lpBuffer[i].EventType == KEY_EVENT) {
KEY_EVENT_RECORD *keyRecord = (KEY_EVENT_RECORD *)
@ -4527,7 +4523,7 @@ static int stdinAvailable(int fd, long *pbytes) {
}
}
if(lpBuffer != NULL) {
if (lpBuffer != NULL) {
os::free(lpBuffer, mtInternal);
}
@ -4790,19 +4786,19 @@ bool os::WatcherThreadCrashProtection::call(os::CrashProtectionCallback& cb) {
// with explicit "PARKED" and "SIGNALED" bits.
int os::PlatformEvent::park (jlong Millis) {
guarantee (_ParkHandle != NULL , "Invariant") ;
guarantee (Millis > 0 , "Invariant") ;
int v ;
guarantee(_ParkHandle != NULL , "Invariant");
guarantee(Millis > 0 , "Invariant");
int v;
// CONSIDER: defer assigning a CreateEvent() handle to the Event until
// the initial park() operation.
for (;;) {
v = _Event ;
if (Atomic::cmpxchg (v-1, &_Event, v) == v) break ;
v = _Event;
if (Atomic::cmpxchg(v-1, &_Event, v) == v) break;
}
guarantee ((v == 0) || (v == 1), "invariant") ;
if (v != 0) return OS_OK ;
guarantee((v == 0) || (v == 1), "invariant");
if (v != 0) return OS_OK;
// Do this the hard way by blocking ...
// TODO: consider a brief spin here, gated on the success of recent
@ -4820,59 +4816,59 @@ int os::PlatformEvent::park (jlong Millis) {
// In the future, however, we might want to track the accumulated wait time and
// adjust Millis accordingly if we encounter a spurious wakeup.
const int MAXTIMEOUT = 0x10000000 ;
DWORD rv = WAIT_TIMEOUT ;
const int MAXTIMEOUT = 0x10000000;
DWORD rv = WAIT_TIMEOUT;
while (_Event < 0 && Millis > 0) {
DWORD prd = Millis ; // set prd = MAX (Millis, MAXTIMEOUT)
DWORD prd = Millis; // set prd = MAX (Millis, MAXTIMEOUT)
if (Millis > MAXTIMEOUT) {
prd = MAXTIMEOUT ;
prd = MAXTIMEOUT;
}
rv = ::WaitForSingleObject (_ParkHandle, prd) ;
assert (rv == WAIT_OBJECT_0 || rv == WAIT_TIMEOUT, "WaitForSingleObject failed") ;
rv = ::WaitForSingleObject(_ParkHandle, prd);
assert(rv == WAIT_OBJECT_0 || rv == WAIT_TIMEOUT, "WaitForSingleObject failed");
if (rv == WAIT_TIMEOUT) {
Millis -= prd ;
Millis -= prd;
}
}
v = _Event ;
_Event = 0 ;
v = _Event;
_Event = 0;
// see comment at end of os::PlatformEvent::park() below:
OrderAccess::fence() ;
OrderAccess::fence();
// If we encounter a nearly simultanous timeout expiry and unpark()
// we return OS_OK indicating we awoke via unpark().
// Implementor's license -- returning OS_TIMEOUT would be equally valid, however.
return (v >= 0) ? OS_OK : OS_TIMEOUT ;
return (v >= 0) ? OS_OK : OS_TIMEOUT;
}
void os::PlatformEvent::park () {
guarantee (_ParkHandle != NULL, "Invariant") ;
void os::PlatformEvent::park() {
guarantee(_ParkHandle != NULL, "Invariant");
// Invariant: Only the thread associated with the Event/PlatformEvent
// may call park().
int v ;
int v;
for (;;) {
v = _Event ;
if (Atomic::cmpxchg (v-1, &_Event, v) == v) break ;
v = _Event;
if (Atomic::cmpxchg(v-1, &_Event, v) == v) break;
}
guarantee ((v == 0) || (v == 1), "invariant") ;
if (v != 0) return ;
guarantee((v == 0) || (v == 1), "invariant");
if (v != 0) return;
// Do this the hard way by blocking ...
// TODO: consider a brief spin here, gated on the success of recent
// spin attempts by this thread.
while (_Event < 0) {
DWORD rv = ::WaitForSingleObject (_ParkHandle, INFINITE) ;
assert (rv == WAIT_OBJECT_0, "WaitForSingleObject failed") ;
DWORD rv = ::WaitForSingleObject(_ParkHandle, INFINITE);
assert(rv == WAIT_OBJECT_0, "WaitForSingleObject failed");
}
// Usually we'll find _Event == 0 at this point, but as
// an optional optimization we clear it, just in case can
// multiple unpark() operations drove _Event up to 1.
_Event = 0 ;
OrderAccess::fence() ;
guarantee (_Event >= 0, "invariant") ;
_Event = 0;
OrderAccess::fence();
guarantee(_Event >= 0, "invariant");
}
void os::PlatformEvent::unpark() {
guarantee (_ParkHandle != NULL, "Invariant") ;
guarantee(_ParkHandle != NULL, "Invariant");
// Transitions for _Event:
// 0 :=> 1
@ -4907,7 +4903,7 @@ void os::PlatformEvent::unpark() {
void Parker::park(bool isAbsolute, jlong time) {
guarantee (_ParkEvent != NULL, "invariant") ;
guarantee(_ParkEvent != NULL, "invariant");
// First, demultiplex/decode time arguments
if (time < 0) { // don't wait
return;
@ -4941,7 +4937,7 @@ void Parker::park(bool isAbsolute, jlong time) {
OSThreadWaitState osts(thread->osthread(), false /* not Object.wait() */);
jt->set_suspend_equivalent();
WaitForSingleObject(_ParkEvent, time);
WaitForSingleObject(_ParkEvent, time);
ResetEvent(_ParkEvent);
// If externally suspended while waiting, re-suspend
@ -4952,7 +4948,7 @@ void Parker::park(bool isAbsolute, jlong time) {
}
void Parker::unpark() {
guarantee (_ParkEvent != NULL, "invariant") ;
guarantee(_ParkEvent != NULL, "invariant");
SetEvent(_ParkEvent);
}
@ -5040,7 +5036,7 @@ bool os::find(address addr, outputStream* st) {
LONG WINAPI os::win32::serialize_fault_filter(struct _EXCEPTION_POINTERS* e) {
DWORD exception_code = e->ExceptionRecord->ExceptionCode;
if ( exception_code == EXCEPTION_ACCESS_VIOLATION ) {
if (exception_code == EXCEPTION_ACCESS_VIOLATION) {
JavaThread* thread = (JavaThread*)ThreadLocalStorage::get_thread_slow();
PEXCEPTION_RECORD exceptionRecord = e->ExceptionRecord;
address addr = (address) exceptionRecord->ExceptionInformation[1];

View File

@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/thread.inline.hpp"
#include "runtime/threadCritical.hpp"

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2013 SAP AG. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2014 SAP AG. 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
@ -307,7 +307,7 @@ JVM_handle_linux_signal(int sig,
// doesn't work for us. We use:
((NativeInstruction*)pc)->is_safepoint_poll()) {
if (TraceTraps) {
tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", pc);
tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
}
stub = SharedRuntime::get_poll_stub(pc);
}
@ -316,7 +316,7 @@ JVM_handle_linux_signal(int sig,
else if (sig == SIGTRAP && TrapBasedICMissChecks &&
nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) {
if (TraceTraps) {
tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
}
stub = SharedRuntime::get_ic_miss_stub();
}
@ -325,7 +325,7 @@ JVM_handle_linux_signal(int sig,
else if (sig == SIGTRAP && TrapBasedNullChecks &&
nativeInstruction_at(pc)->is_sigtrap_null_check()) {
if (TraceTraps) {
tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
}
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
}
@ -335,7 +335,7 @@ JVM_handle_linux_signal(int sig,
CodeCache::contains((void*) pc) &&
!MacroAssembler::needs_explicit_null_check((intptr_t) info->si_addr)) {
if (TraceTraps) {
tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", pc);
tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
}
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
}
@ -345,7 +345,7 @@ JVM_handle_linux_signal(int sig,
else if (sig == SIGTRAP && TrapBasedRangeChecks &&
nativeInstruction_at(pc)->is_sigtrap_range_check()) {
if (TraceTraps) {
tty->print_cr("trap: range_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
tty->print_cr("trap: range_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
}
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
}
@ -572,7 +572,7 @@ void os::print_context(outputStream *st, void *context) {
st->cr();
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", sp);
st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", p2i(sp));
print_hex_dump(st, (address)sp, (address)(sp + 128), sizeof(intptr_t));
st->cr();
@ -580,7 +580,7 @@ void os::print_context(outputStream *st, void *context) {
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Linux::ucontext_get_pc(uc);
st->print_cr("Instructions: (pc=" PTR_FORMAT ")", pc);
st->print_cr("Instructions: (pc=" PTR_FORMAT ")", p2i(pc));
print_hex_dump(st, pc - 64, pc + 64, /*instrsize=*/4);
st->cr();
}

View File

@ -55,7 +55,7 @@ int VM_Version::platform_features(int features) {
if (detect_niagara()) {
NOT_PRODUCT(if (PrintMiscellaneous && Verbose) tty->print_cr("Detected Linux on Niagara");)
features = niagara1_m;
features = niagara1_m | T_family_m;
}
return features;

View File

@ -38,6 +38,7 @@
#include "prims/jvm.h"
#include "prims/jvm_misc.hpp"
#include "runtime/arguments.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/extendedPC.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/interfaceSupport.hpp"

View File

@ -26,7 +26,6 @@
#include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "asm/codeBuffer.hpp"
#include "runtime/atomic.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/icache.hpp"
#include "runtime/os.hpp"

View File

@ -47,6 +47,7 @@
#include "memory/resourceArea.hpp"
#include "oops/objArrayKlass.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/compilationPolicy.hpp"
#include "runtime/interfaceSupport.hpp"

View File

@ -38,7 +38,7 @@ ciConstantPoolCache::ciConstantPoolCache(Arena* arena,
int expected_size) {
_elements =
new (arena) GrowableArray<void*>(arena, expected_size, 0, 0);
_keys = new (arena) GrowableArray<intptr_t>(arena, expected_size, 0, 0);
_keys = new (arena) GrowableArray<int>(arena, expected_size, 0, 0);
}
// ------------------------------------------------------------------

View File

@ -35,7 +35,7 @@
// Usage note: this klass has nothing to do with ConstantPoolCache*.
class ciConstantPoolCache : public ResourceObj {
private:
GrowableArray<intptr_t>* _keys;
GrowableArray<int>* _keys;
GrowableArray<void*>* _elements;
int find(int index);

View File

@ -512,24 +512,9 @@ ciKlass* ciEnv::get_klass_by_index_impl(constantPoolHandle cpool,
} else {
// Check if it's resolved if it's not a symbol constant pool entry.
klass = KlassHandle(THREAD, ConstantPool::klass_at_if_loaded(cpool, index));
if (klass.is_null()) {
// The klass has not been inserted into the constant pool.
// Try to look it up by name.
{
// We have to lock the cpool to keep the oop from being resolved
// while we are accessing it.
MonitorLockerEx ml(cpool->lock());
constantTag tag = cpool->tag_at(index);
if (tag.is_klass()) {
// The klass has been inserted into the constant pool
// very recently.
klass = KlassHandle(THREAD, cpool->resolved_klass_at(index));
} else {
assert(cpool->tag_at(index).is_unresolved_klass(), "wrong tag");
klass_name = cpool->unresolved_klass_at(index);
}
}
if (klass.is_null()) {
klass_name = cpool->klass_name_at(index);
}
}

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2013, 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
@ -686,7 +686,7 @@ class CompileReplay : public StackObj {
switch (cp->tag_at(i).value()) {
case JVM_CONSTANT_UnresolvedClass: {
if (tag == JVM_CONSTANT_Class) {
tty->print_cr("Resolving klass %s at %d", cp->unresolved_klass_at(i)->as_utf8(), i);
tty->print_cr("Resolving klass %s at %d", cp->klass_name_at(i)->as_utf8(), i);
Klass* k = cp->klass_at(i, CHECK);
}
break;

View File

@ -510,7 +510,7 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) {
jbyte tag = cp->tag_at(index).value();
switch (tag) {
case JVM_CONSTANT_UnresolvedClass: {
Symbol* class_name = cp->unresolved_klass_at(index);
Symbol* class_name = cp->klass_name_at(index);
// check the name, even if _cp_patches will overwrite it
verify_legal_class_name(class_name, CHECK_(nullHandle));
break;
@ -2984,9 +2984,12 @@ void ClassFileParser::parse_classfile_attributes(ClassFileParser::ClassAnnotatio
} else if (tag == vmSymbols::tag_enclosing_method()) {
if (parsed_enclosingmethod_attribute) {
classfile_parse_error("Multiple EnclosingMethod attributes in class file %s", CHECK);
} else {
} else {
parsed_enclosingmethod_attribute = true;
}
guarantee_property(attribute_length == 4,
"Wrong EnclosingMethod attribute length %u in class file %s",
attribute_length, CHECK);
cfs->guarantee_more(4, CHECK); // class_index, method_index
enclosing_method_class_index = cfs->get_u2_fast();
enclosing_method_method_index = cfs->get_u2_fast();
@ -3158,7 +3161,7 @@ instanceKlassHandle ClassFileParser::parse_super_class(int super_class_index,
if (_need_verify)
is_array = super_klass->oop_is_array();
} else if (_need_verify) {
is_array = (_cp->unresolved_klass_at(super_class_index)->byte_at(0) == JVM_SIGNATURE_ARRAY);
is_array = (_cp->klass_name_at(super_class_index)->byte_at(0) == JVM_SIGNATURE_ARRAY);
}
if (_need_verify) {
guarantee_property(!is_array,
@ -3852,7 +3855,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
"Invalid this class index %u in constant pool in class file %s",
this_class_index, CHECK_(nullHandle));
Symbol* class_name = cp->unresolved_klass_at(this_class_index);
Symbol* class_name = cp->klass_name_at(this_class_index);
assert(class_name != NULL, "class_name can't be null");
// It's important to set parsed_name *before* resolving the super class.
@ -4067,6 +4070,11 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
this_klass->set_major_version(major_version);
this_klass->set_has_default_methods(has_default_methods);
if (!host_klass.is_null()) {
assert (this_klass->is_anonymous(), "should be the same");
this_klass->set_host_klass(host_klass());
}
// Set up Method*::intrinsic_id as soon as we know the names of methods.
// (We used to do this lazily, but now we query it in Rewriter,
// which is eagerly done for every method, so we might as well do it now,
@ -4131,8 +4139,8 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
}
// Allocate mirror and initialize static fields
java_lang_Class::create_mirror(this_klass, protection_domain, CHECK_(nullHandle));
java_lang_Class::create_mirror(this_klass, class_loader, protection_domain,
CHECK_(nullHandle));
// Generate any default methods - default methods are interface methods
// that have a default implementation. This is new with Lambda project.
@ -4664,9 +4672,7 @@ bool ClassFileParser::has_illegal_visibility(jint flags) {
}
bool ClassFileParser::is_supported_version(u2 major, u2 minor) {
u2 max_version =
JDK_Version::is_gte_jdk17x_version() ? JAVA_MAX_SUPPORTED_VERSION :
(JDK_Version::is_gte_jdk16x_version() ? JAVA_6_VERSION : JAVA_1_5_VERSION);
u2 max_version = JAVA_MAX_SUPPORTED_VERSION;
return (major >= JAVA_MIN_SUPPORTED_VERSION) &&
(major <= max_version) &&
((major != max_version) ||

View File

@ -1126,7 +1126,7 @@ void ClassLoader::verify() {
// JDK 1.3 version
typedef struct real_jzentry13 { /* Zip file entry */
typedef struct real_jzentry { /* Zip file entry */
char *name; /* entry name */
jint time; /* modification time */
jint size; /* size of uncompressed data */
@ -1135,9 +1135,9 @@ typedef struct real_jzentry13 { /* Zip file entry */
char *comment; /* optional zip file comment */
jbyte *extra; /* optional extra data */
jint pos; /* position of LOC header (if negative) or data */
} real_jzentry13;
} real_jzentry;
typedef struct real_jzfile13 { /* Zip file */
typedef struct real_jzfile { /* Zip file */
char *name; /* zip file name */
jint refs; /* number of active references */
jint fd; /* open file descriptor */
@ -1148,42 +1148,14 @@ typedef struct real_jzfile13 { /* Zip file */
jint total; /* total number of entries */
unsigned short *table; /* Hash chain heads: indexes into entries */
jint tablelen; /* number of hash eads */
real_jzfile13 *next; /* next zip file in search list */
real_jzfile *next; /* next zip file in search list */
jzentry *cache; /* we cache the most recently freed jzentry */
/* Information on metadata names in META-INF directory */
char **metanames; /* array of meta names (may have null names) */
jint metacount; /* number of slots in metanames array */
/* If there are any per-entry comments, they are in the comments array */
char **comments;
} real_jzfile13;
// JDK 1.2 version
typedef struct real_jzentry12 { /* Zip file entry */
char *name; /* entry name */
jint time; /* modification time */
jint size; /* size of uncompressed data */
jint csize; /* size of compressed data (zero if uncompressed) */
jint crc; /* crc of uncompressed data */
char *comment; /* optional zip file comment */
jbyte *extra; /* optional extra data */
jint pos; /* position of LOC header (if negative) or data */
struct real_jzentry12 *next; /* next entry in hash table */
} real_jzentry12;
typedef struct real_jzfile12 { /* Zip file */
char *name; /* zip file name */
jint refs; /* number of active references */
jint fd; /* open file descriptor */
void *lock; /* read lock */
char *comment; /* zip file comment */
char *msg; /* zip error message */
real_jzentry12 *entries; /* array of zip entries */
jint total; /* total number of entries */
real_jzentry12 **table; /* hash table of entries */
jint tablelen; /* number of buckets */
jzfile *next; /* next zip file in search list */
} real_jzfile12;
} real_jzfile;
void ClassPathDirEntry::compile_the_world(Handle loader, TRAPS) {
// For now we only compile all methods in all classes in zip/jar files
@ -1197,10 +1169,14 @@ bool ClassPathDirEntry::is_rt_jar() {
}
void ClassPathZipEntry::compile_the_world(Handle loader, TRAPS) {
if (JDK_Version::is_jdk12x_version()) {
compile_the_world12(loader, THREAD);
} else {
compile_the_world13(loader, THREAD);
real_jzfile* zip = (real_jzfile*) _zip;
tty->print_cr("CompileTheWorld : Compiling all classes in %s", zip->name);
tty->cr();
// Iterate over all entries in zip file
for (int n = 0; ; n++) {
real_jzentry * ze = (real_jzentry *)((*GetNextEntry)(_zip, n));
if (ze == NULL) break;
ClassLoader::compile_the_world_in(ze->name, loader, CHECK);
}
if (HAS_PENDING_EXCEPTION) {
if (PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())) {
@ -1213,54 +1189,8 @@ void ClassPathZipEntry::compile_the_world(Handle loader, TRAPS) {
}
}
// Version that works for JDK 1.3.x
void ClassPathZipEntry::compile_the_world13(Handle loader, TRAPS) {
real_jzfile13* zip = (real_jzfile13*) _zip;
tty->print_cr("CompileTheWorld : Compiling all classes in %s", zip->name);
tty->cr();
// Iterate over all entries in zip file
for (int n = 0; ; n++) {
real_jzentry13 * ze = (real_jzentry13 *)((*GetNextEntry)(_zip, n));
if (ze == NULL) break;
ClassLoader::compile_the_world_in(ze->name, loader, CHECK);
}
}
// Version that works for JDK 1.2.x
void ClassPathZipEntry::compile_the_world12(Handle loader, TRAPS) {
real_jzfile12* zip = (real_jzfile12*) _zip;
tty->print_cr("CompileTheWorld : Compiling all classes in %s", zip->name);
tty->cr();
// Iterate over all entries in zip file
for (int n = 0; ; n++) {
real_jzentry12 * ze = (real_jzentry12 *)((*GetNextEntry)(_zip, n));
if (ze == NULL) break;
ClassLoader::compile_the_world_in(ze->name, loader, CHECK);
}
}
bool ClassPathZipEntry::is_rt_jar() {
if (JDK_Version::is_jdk12x_version()) {
return is_rt_jar12();
} else {
return is_rt_jar13();
}
}
// JDK 1.3 version
bool ClassPathZipEntry::is_rt_jar13() {
real_jzfile13* zip = (real_jzfile13*) _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);
}
// JDK 1.2 version
bool ClassPathZipEntry::is_rt_jar12() {
real_jzfile12* zip = (real_jzfile12*) _zip;
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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -111,11 +111,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(void compile_the_world12(Handle loader, TRAPS);) // JDK 1.2 version
NOT_PRODUCT(void compile_the_world13(Handle loader, TRAPS);) // JDK 1.3 version
NOT_PRODUCT(bool is_rt_jar();)
NOT_PRODUCT(bool is_rt_jar12();)
NOT_PRODUCT(bool is_rt_jar13();)
};

View File

@ -57,6 +57,7 @@
#include "memory/metadataFactory.hpp"
#include "memory/metaspaceShared.hpp"
#include "memory/oopFactory.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/jniHandles.hpp"
#include "runtime/mutex.hpp"
#include "runtime/safepoint.hpp"
@ -549,6 +550,7 @@ bool ClassLoaderData::contains_klass(Klass* klass) {
// GC root of class loader data created.
ClassLoaderData* ClassLoaderDataGraph::_head = NULL;
ClassLoaderData* ClassLoaderDataGraph::_unloading = NULL;
ClassLoaderData* ClassLoaderDataGraph::_saved_unloading = NULL;
ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL;
bool ClassLoaderDataGraph::_should_purge = false;
@ -624,6 +626,12 @@ void ClassLoaderDataGraph::always_strong_oops_do(OopClosure* f, KlassClosure* kl
}
}
void ClassLoaderDataGraph::cld_do(CLDClosure* cl) {
for (ClassLoaderData* cld = _head; cl != NULL && cld != NULL; cld = cld->next()) {
cl->do_cld(cld);
}
}
void ClassLoaderDataGraph::classes_do(KlassClosure* klass_closure) {
for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) {
cld->classes_do(klass_closure);
@ -650,7 +658,9 @@ void ClassLoaderDataGraph::loaded_classes_do(KlassClosure* klass_closure) {
void ClassLoaderDataGraph::classes_unloading_do(void f(Klass* const)) {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
for (ClassLoaderData* cld = _unloading; cld != NULL; cld = cld->next()) {
// Only walk the head until any clds not purged from prior unloading
// (CMS doesn't purge right away).
for (ClassLoaderData* cld = _unloading; cld != _saved_unloading; cld = cld->next()) {
cld->classes_do(f);
}
}
@ -698,6 +708,11 @@ bool ClassLoaderDataGraph::do_unloading(BoolObjectClosure* is_alive_closure) {
ClassLoaderData* data = _head;
ClassLoaderData* prev = NULL;
bool seen_dead_loader = false;
// Save previous _unloading pointer for CMS which may add to unloading list before
// purging and we don't want to rewalk the previously unloaded class loader data.
_saved_unloading = _unloading;
// mark metadata seen on the stack and code cache so we can delete
// unneeded entries.
bool has_redefined_a_class = JvmtiExport::has_redefined_a_class();

View File

@ -66,6 +66,7 @@ class ClassLoaderDataGraph : public AllStatic {
static ClassLoaderData* _unloading;
// CMS support.
static ClassLoaderData* _saved_head;
static ClassLoaderData* _saved_unloading;
static bool _should_purge;
static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS);
@ -77,6 +78,7 @@ class ClassLoaderDataGraph : public AllStatic {
static void oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim);
static void always_strong_oops_do(OopClosure* blk, KlassClosure* klass_closure, bool must_claim);
static void keep_alive_oops_do(OopClosure* blk, KlassClosure* klass_closure, bool must_claim);
static void cld_do(CLDClosure* cl);
static void classes_do(KlassClosure* klass_closure);
static void classes_do(void f(Klass* const));
static void methods_do(void f(Method*));
@ -186,8 +188,6 @@ class ClassLoaderData : public CHeapObj<mtClass> {
JNIHandleBlock* handles() const;
void set_handles(JNIHandleBlock* handles);
Mutex* metaspace_lock() const { return _metaspace_lock; }
// GC interface.
void clear_claimed() { _claimed = 0; }
bool claimed() const { return _claimed == 1; }
@ -215,6 +215,8 @@ class ClassLoaderData : public CHeapObj<mtClass> {
return _the_null_class_loader_data;
}
Mutex* metaspace_lock() const { return _metaspace_lock; }
bool is_anonymous() const { return _is_anonymous; }
static void init_null_class_loader_data() {

View File

@ -0,0 +1,167 @@
/*
* 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/classLoaderStats.hpp"
#include "utilities/globalDefinitions.hpp"
class ClassStatsClosure : public KlassClosure {
public:
int _num_classes;
ClassStatsClosure() :
_num_classes(0) {
}
virtual void do_klass(Klass* k) {
_num_classes++;
}
};
void ClassLoaderStatsClosure::do_cld(ClassLoaderData* cld) {
oop cl = cld->class_loader();
ClassLoaderStats* cls;
// The hashtable key is the ClassLoader oop since we want to account
// for "real" classes and anonymous classes together
ClassLoaderStats** cls_ptr = _stats->get(cl);
if (cls_ptr == NULL) {
cls = new ClassLoaderStats();
_stats->put(cl, cls);
_total_loaders++;
} else {
cls = *cls_ptr;
}
if (!cld->is_anonymous()) {
cls->_cld = cld;
}
cls->_class_loader = cl;
if (cl != NULL) {
cls->_parent = java_lang_ClassLoader::parent(cl);
addEmptyParents(cls->_parent);
}
ClassStatsClosure csc;
cld->classes_do(&csc);
if(cld->is_anonymous()) {
cls->_anon_classes_count += csc._num_classes;
} else {
cls->_classes_count = csc._num_classes;
}
_total_classes += csc._num_classes;
Metaspace* ms = cld->metaspace_or_null();
if (ms != NULL) {
if(cld->is_anonymous()) {
cls->_anon_chunk_sz += ms->allocated_chunks_bytes();
cls->_anon_block_sz += ms->allocated_blocks_bytes();
} else {
cls->_chunk_sz = ms->allocated_chunks_bytes();
cls->_block_sz = ms->allocated_blocks_bytes();
}
_total_chunk_sz += ms->allocated_chunks_bytes();
_total_block_sz += ms->allocated_blocks_bytes();
}
}
// Handles the difference in pointer width on 32 and 64 bit platforms
#ifdef _LP64
#define SPACE "%8s"
#else
#define SPACE "%s"
#endif
bool ClassLoaderStatsClosure::do_entry(oop const& key, ClassLoaderStats* const& cls) {
Klass* class_loader_klass = (cls->_class_loader == NULL ? NULL : cls->_class_loader->klass());
Klass* parent_klass = (cls->_parent == NULL ? NULL : cls->_parent->klass());
_out->print(INTPTR_FORMAT " " INTPTR_FORMAT " " INTPTR_FORMAT " " UINTX_FORMAT_W(6) " " SIZE_FORMAT_W(8) " " SIZE_FORMAT_W(8) " ",
p2i(class_loader_klass), p2i(parent_klass), p2i(cls->_cld),
cls->_classes_count,
cls->_chunk_sz, cls->_block_sz);
if (class_loader_klass != NULL) {
_out->print("%s", class_loader_klass->external_name());
} else {
_out->print("<boot class loader>");
}
_out->cr();
if (cls->_anon_classes_count > 0) {
_out->print_cr(SPACE SPACE SPACE " " UINTX_FORMAT_W(6) " " SIZE_FORMAT_W(8) " " SIZE_FORMAT_W(8) " + unsafe anonymous classes",
"", "", "",
cls->_anon_classes_count,
cls->_anon_chunk_sz, cls->_anon_block_sz);
}
return true;
}
void ClassLoaderStatsClosure::print() {
_out->print_cr("ClassLoader" SPACE " Parent" SPACE " CLD*" SPACE " Classes ChunkSz BlockSz Type", "", "", "");
_stats->iterate(this);
_out->print("Total = " UINTX_FORMAT_W(-6), _total_loaders);
_out->print(SPACE SPACE SPACE " ", "", "", "");
_out->print_cr(UINTX_FORMAT_W(6) " " SIZE_FORMAT_W(8) " " SIZE_FORMAT_W(8) " ",
_total_classes,
_total_chunk_sz,
_total_block_sz);
_out->print_cr("ChunkSz: Total size of all allocated metaspace chunks");
_out->print_cr("BlockSz: Total size of all allocated metaspace blocks (each chunk has several blocks)");
}
void ClassLoaderStatsClosure::addEmptyParents(oop cl) {
while (cl != NULL && java_lang_ClassLoader::loader_data(cl) == NULL) {
// This classloader has not loaded any classes
ClassLoaderStats** cls_ptr = _stats->get(cl);
if (cls_ptr == NULL) {
// It does not exist in our table - add it
ClassLoaderStats* cls = new ClassLoaderStats();
cls->_class_loader = cl;
cls->_parent = java_lang_ClassLoader::parent(cl);
_stats->put(cl, cls);
_total_loaders++;
}
cl = java_lang_ClassLoader::parent(cl);
}
}
void ClassLoaderStatsVMOperation::doit() {
ClassLoaderStatsClosure clsc (_out);
ClassLoaderDataGraph::cld_do(&clsc);
clsc.print();
}
void ClassLoaderStatsDCmd::execute(DCmdSource source, TRAPS) {
ClassLoaderStatsVMOperation op(output());
VMThread::execute(&op);
}

View File

@ -0,0 +1,152 @@
/*
* 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_CLASSLOADERSTATS_HPP
#define SHARE_VM_CLASSFILE_CLASSLOADERSTATS_HPP
#include "classfile/classLoaderData.hpp"
#include "oops/klass.hpp"
#include "oops/oopsHierarchy.hpp"
#include "runtime/vm_operations.hpp"
#include "services/diagnosticCommand.hpp"
#include "utilities/resourceHash.hpp"
class ClassLoaderStatsDCmd : public DCmd {
public:
ClassLoaderStatsDCmd(outputStream* output, bool heap) :
DCmd(output, heap) {
}
static const char* name() {
return "VM.classloader_stats";
}
static const char* description() {
return "Print statistics about all ClassLoaders.";
}
static const char* impact() {
return "Low";
}
virtual void execute(DCmdSource source, TRAPS);
static int num_arguments() {
return 0;
}
static const JavaPermission permission() {
JavaPermission p = {"java.lang.management.ManagementPermission",
"monitor", NULL};
return p;
}
};
class ClassLoaderStats : public ResourceObj {
public:
ClassLoaderData* _cld;
oop _class_loader;
oop _parent;
size_t _chunk_sz;
size_t _block_sz;
uintx _classes_count;
size_t _anon_chunk_sz;
size_t _anon_block_sz;
uintx _anon_classes_count;
ClassLoaderStats() :
_cld(0),
_class_loader(0),
_parent(0),
_chunk_sz(0),
_block_sz(0),
_classes_count(0),
_anon_block_sz(0),
_anon_chunk_sz(0),
_anon_classes_count(0) {
}
};
class ClassLoaderStatsClosure : public CLDClosure {
protected:
static bool oop_equals(oop const& s1, oop const& s2) {
return s1 == s2;
}
static unsigned oop_hash(oop const& s1) {
unsigned hash = (unsigned)((uintptr_t)&s1);
return hash ^ (hash >> LogMinObjAlignment);
}
typedef ResourceHashtable<oop, ClassLoaderStats*,
ClassLoaderStatsClosure::oop_hash, ClassLoaderStatsClosure::oop_equals> StatsTable;
outputStream* _out;
StatsTable* _stats;
uintx _total_loaders;
uintx _total_classes;
size_t _total_chunk_sz;
size_t _total_block_sz;
public:
ClassLoaderStatsClosure(outputStream* out) :
_out(out),
_total_loaders(0),
_total_block_sz(0),
_total_chunk_sz(0),
_total_classes(0),
_stats(new StatsTable()) {
}
virtual void do_cld(ClassLoaderData* cld);
virtual bool do_entry(oop const& key, ClassLoaderStats* const& cls);
void print();
private:
void addEmptyParents(oop cl);
};
class ClassLoaderStatsVMOperation : public VM_Operation {
outputStream* _out;
public:
ClassLoaderStatsVMOperation(outputStream* out) :
_out(out) {
}
VMOp_Type type() const {
return VMOp_ClassLoaderStatsOperation;
}
void doit();
};
#endif // SHARE_VM_CLASSFILE_CLASSLOADERSTATS_HPP

View File

@ -558,7 +558,7 @@ void java_lang_Class::fixup_mirror(KlassHandle k, TRAPS) {
}
}
}
create_mirror(k, Handle(NULL), CHECK);
create_mirror(k, Handle(NULL), Handle(NULL), CHECK);
}
void java_lang_Class::initialize_mirror_fields(KlassHandle k,
@ -578,7 +578,8 @@ void java_lang_Class::initialize_mirror_fields(KlassHandle k,
InstanceKlass::cast(k())->do_local_static_fields(&initialize_static_field, mirror, CHECK);
}
void java_lang_Class::create_mirror(KlassHandle k, Handle protection_domain, TRAPS) {
void java_lang_Class::create_mirror(KlassHandle k, Handle class_loader,
Handle protection_domain, TRAPS) {
assert(k->java_mirror() == NULL, "should only assign mirror once");
// Use this moment of initialization to cache modifier_flags also,
// to support Class.getModifiers(). Instance classes recalculate
@ -633,6 +634,9 @@ void java_lang_Class::create_mirror(KlassHandle k, Handle protection_domain, TRA
}
}
// set the classLoader field in the java_lang_Class instance
set_class_loader(mirror(), class_loader());
// Setup indirection from klass->mirror last
// after any exceptions can happen during allocations.
if (!k.is_null()) {
@ -694,6 +698,18 @@ void java_lang_Class::set_signers(oop java_class, objArrayOop signers) {
}
void java_lang_Class::set_class_loader(oop java_class, oop loader) {
// jdk7 runs Queens in bootstrapping and jdk8-9 has no coordinated pushes yet.
if (_class_loader_offset != 0) {
java_class->obj_field_put(_class_loader_offset, loader);
}
}
oop java_lang_Class::class_loader(oop java_class) {
assert(_class_loader_offset != 0, "must be set");
return java_class->obj_field(_class_loader_offset);
}
oop java_lang_Class::create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS) {
// This should be improved by adding a field at the Java level or by
// introducing a new VM klass (see comment in ClassFileParser)
@ -853,13 +869,17 @@ void java_lang_Class::compute_offsets() {
compute_optional_offset(classRedefinedCount_offset,
klass_oop, vmSymbols::classRedefinedCount_name(), vmSymbols::int_signature());
// Needs to be optional because the old build runs Queens during bootstrapping
// and jdk8-9 doesn't have coordinated pushes yet.
compute_optional_offset(_class_loader_offset,
klass_oop, vmSymbols::classLoader_name(),
vmSymbols::classloader_signature());
CLASS_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET);
}
int java_lang_Class::classRedefinedCount(oop the_class_mirror) {
if (!JDK_Version::is_gte_jdk15x_version()
|| classRedefinedCount_offset == -1) {
// The classRedefinedCount field is only present starting in 1.5.
if (classRedefinedCount_offset == -1) {
// If we don't have an offset for it then just return -1 as a marker.
return -1;
}
@ -868,9 +888,7 @@ int java_lang_Class::classRedefinedCount(oop the_class_mirror) {
}
void java_lang_Class::set_classRedefinedCount(oop the_class_mirror, int value) {
if (!JDK_Version::is_gte_jdk15x_version()
|| classRedefinedCount_offset == -1) {
// The classRedefinedCount field is only present starting in 1.5.
if (classRedefinedCount_offset == -1) {
// If we don't have an offset for it then nothing to set.
return;
}
@ -1000,9 +1018,7 @@ oop java_lang_Thread::inherited_access_control_context(oop java_thread) {
jlong java_lang_Thread::stackSize(oop java_thread) {
// The stackSize field is only present starting in 1.4
if (_stackSize_offset > 0) {
assert(JDK_Version::is_gte_jdk14x_version(), "sanity check");
return java_thread->long_field(_stackSize_offset);
} else {
return 0;
@ -1078,7 +1094,7 @@ bool java_lang_Thread::set_park_event(oop java_thread, jlong ptr) {
const char* java_lang_Thread::thread_status_name(oop java_thread) {
assert(JDK_Version::is_gte_jdk15x_version() && _thread_status_offset != 0, "Must have thread status");
assert(_thread_status_offset != 0, "Must have thread status");
ThreadStatus status = (java_lang_Thread::ThreadStatus)java_thread->int_field(_thread_status_offset);
switch (status) {
case NEW : return "NEW";
@ -1217,7 +1233,6 @@ void java_lang_Throwable::set_stacktrace(oop throwable, oop st_element_array) {
}
void java_lang_Throwable::clear_stacktrace(oop throwable) {
assert(JDK_Version::is_gte_jdk14x_version(), "should only be called in >= 1.4");
set_stacktrace(throwable, NULL);
}
@ -1548,12 +1563,9 @@ void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle met
// Start out by clearing the backtrace for this object, in case the VM
// runs out of memory while allocating the stack trace
set_backtrace(throwable(), NULL);
if (JDK_Version::is_gte_jdk14x_version()) {
// New since 1.4, clear lazily constructed Java level stacktrace if
// refilling occurs
// This is unnecessary in 1.7+ but harmless
clear_stacktrace(throwable());
}
// Clear lazily constructed Java level stacktrace if refilling occurs
// This is unnecessary in 1.7+ but harmless
clear_stacktrace(throwable());
int max_depth = MaxJavaStackTraceDepth;
JavaThread* thread = (JavaThread*)THREAD;
@ -1739,13 +1751,9 @@ void java_lang_Throwable::fill_in_stack_trace_of_preallocated_backtrace(Handle t
if (chunk_count >= max_chunks) break;
}
// For Java 7+ we support the Throwable immutability protocol defined for Java 7. This support
// was missing in 7u0 so in 7u0 there is a workaround in the Throwable class. That workaround
// can be removed in a JDK using this JVM version
if (JDK_Version::is_gte_jdk17x_version()) {
java_lang_Throwable::set_stacktrace(throwable(), java_lang_Throwable::unassigned_stacktrace());
assert(java_lang_Throwable::unassigned_stacktrace() != NULL, "not initialized");
}
// We support the Throwable immutability protocol defined for Java 7.
java_lang_Throwable::set_stacktrace(throwable(), java_lang_Throwable::unassigned_stacktrace());
assert(java_lang_Throwable::unassigned_stacktrace() != NULL, "not initialized");
}
@ -3022,8 +3030,7 @@ bool java_lang_ClassLoader::isAncestor(oop loader, oop cl) {
// based on non-null field
// Written to by java.lang.ClassLoader, vm only reads this field, doesn't set it
bool java_lang_ClassLoader::parallelCapable(oop class_loader) {
if (!JDK_Version::is_gte_jdk17x_version()
|| parallelCapable_offset == -1) {
if (parallelCapable_offset == -1) {
// Default for backward compatibility is false
return false;
}
@ -3088,6 +3095,7 @@ int java_lang_Class::_klass_offset;
int java_lang_Class::_array_klass_offset;
int java_lang_Class::_oop_size_offset;
int java_lang_Class::_static_oop_field_count_offset;
int java_lang_Class::_class_loader_offset;
int java_lang_Class::_protection_domain_offset;
int java_lang_Class::_init_lock_offset;
int java_lang_Class::_signers_offset;
@ -3219,7 +3227,6 @@ void java_nio_Buffer::compute_offsets() {
void java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(TRAPS) {
if (_owner_offset != 0) return;
assert(JDK_Version::is_gte_jdk16x_version(), "Must be JDK 1.6 or later");
SystemDictionary::load_abstract_ownable_synchronizer_klass(CHECK);
Klass* k = SystemDictionary::abstract_ownable_synchronizer_klass();
compute_offset(_owner_offset, k,
@ -3309,15 +3316,10 @@ void JavaClasses::compute_offsets() {
java_lang_reflect_Method::compute_offsets();
java_lang_reflect_Constructor::compute_offsets();
java_lang_reflect_Field::compute_offsets();
if (JDK_Version::is_gte_jdk14x_version()) {
java_nio_Buffer::compute_offsets();
}
if (JDK_Version::is_gte_jdk15x_version()) {
sun_reflect_ConstantPool::compute_offsets();
sun_reflect_UnsafeStaticFieldAccessorImpl::compute_offsets();
}
if (JDK_Version::is_gte_jdk18x_version())
java_lang_reflect_Parameter::compute_offsets();
java_nio_Buffer::compute_offsets();
sun_reflect_ConstantPool::compute_offsets();
sun_reflect_UnsafeStaticFieldAccessorImpl::compute_offsets();
java_lang_reflect_Parameter::compute_offsets();
// generated interpreter code wants to know about the offsets we just computed:
AbstractAssembler::update_delayed_values();
@ -3502,7 +3504,7 @@ void JavaClasses::check_offsets() {
// into merlin "for some time." Without it, the vm will fail with early
// merlin builds.
if (CheckAssertionStatusDirectives && JDK_Version::is_gte_jdk14x_version()) {
if (CheckAssertionStatusDirectives) {
const char* nm = "java/lang/AssertionStatusDirectives";
const char* sig = "[Ljava/lang/String;";
CHECK_OFFSET(nm, java_lang_AssertionStatusDirectives, classes, sig);

View File

@ -240,19 +240,23 @@ class java_lang_Class : AllStatic {
static int _protection_domain_offset;
static int _init_lock_offset;
static int _signers_offset;
static int _class_loader_offset;
static bool offsets_computed;
static int classRedefinedCount_offset;
static GrowableArray<Klass*>* _fixup_mirror_list;
static void set_init_lock(oop java_class, oop init_lock);
static void set_protection_domain(oop java_class, oop protection_domain);
static void set_class_loader(oop java_class, oop class_loader);
static void initialize_mirror_fields(KlassHandle k, Handle mirror, Handle protection_domain, TRAPS);
public:
static void compute_offsets();
// Instance creation
static void create_mirror(KlassHandle k, Handle protection_domain, TRAPS);
static void create_mirror(KlassHandle k, Handle class_loader,
Handle protection_domain, TRAPS);
static void fixup_mirror(KlassHandle k, TRAPS);
static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS);
// Conversion
@ -290,6 +294,8 @@ class java_lang_Class : AllStatic {
static objArrayOop signers(oop java_class);
static void set_signers(oop java_class, objArrayOop signers);
static oop class_loader(oop java_class);
static int oop_size(oop java_class);
static void set_oop_size(oop java_class, int size);
static int static_oop_field_count(oop java_class);

View File

@ -33,6 +33,7 @@
#include "memory/gcLocker.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.inline2.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/mutexLocker.hpp"
#include "utilities/hashtable.inline.hpp"
#if INCLUDE_ALL_GCS

View File

@ -33,6 +33,7 @@
#include "memory/gcLocker.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.inline2.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/mutexLocker.hpp"
#include "utilities/hashtable.inline.hpp"

View File

@ -997,7 +997,6 @@ Klass* SystemDictionary::parse_stream(Symbol* class_name,
if (host_klass.not_null() && k.not_null()) {
k->set_host_klass(host_klass());
// If it's anonymous, initialize it now, since nobody else will.
{
@ -1754,8 +1753,6 @@ void SystemDictionary::methods_do(void f(Method*)) {
// Lazily load klasses
void SystemDictionary::load_abstract_ownable_synchronizer_klass(TRAPS) {
assert(JDK_Version::is_gte_jdk16x_version(), "Must be JDK 1.6 or later");
// if multiple threads calling this function, only one thread will load
// the class. The other threads will find the loaded version once the
// class is loaded.

View File

@ -139,14 +139,13 @@ class Ticks;
do_klass(reflect_Constructor_klass, java_lang_reflect_Constructor, Pre ) \
\
/* NOTE: needed too early in bootstrapping process to have checks based on JDK version */ \
/* Universe::is_gte_jdk14x_version() is not set up by this point. */ \
/* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \
do_klass(reflect_MagicAccessorImpl_klass, sun_reflect_MagicAccessorImpl, Opt ) \
do_klass(reflect_MethodAccessorImpl_klass, sun_reflect_MethodAccessorImpl, Opt_Only_JDK14NewRef) \
do_klass(reflect_ConstructorAccessorImpl_klass, sun_reflect_ConstructorAccessorImpl, Opt_Only_JDK14NewRef) \
do_klass(reflect_MethodAccessorImpl_klass, sun_reflect_MethodAccessorImpl, Pre ) \
do_klass(reflect_ConstructorAccessorImpl_klass, sun_reflect_ConstructorAccessorImpl, Pre ) \
do_klass(reflect_DelegatingClassLoader_klass, sun_reflect_DelegatingClassLoader, Opt ) \
do_klass(reflect_ConstantPool_klass, sun_reflect_ConstantPool, Opt_Only_JDK15 ) \
do_klass(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15 ) \
do_klass(reflect_ConstantPool_klass, sun_reflect_ConstantPool, Opt ) \
do_klass(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt ) \
do_klass(reflect_CallerSensitive_klass, sun_reflect_CallerSensitive, Opt ) \
\
/* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \
@ -169,7 +168,6 @@ class Ticks;
\
/* It's NULL in non-1.4 JDKs. */ \
do_klass(StackTraceElement_klass, java_lang_StackTraceElement, Opt ) \
/* Universe::is_gte_jdk14x_version() is not set up by this point. */ \
/* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \
do_klass(nio_Buffer_klass, java_nio_Buffer, Opt ) \
\
@ -209,10 +207,8 @@ class SystemDictionary : AllStatic {
// Options after this point will use resolve_or_null instead.
Opt, // preload tried; NULL if not present
Opt_Only_JDK14NewRef, // preload tried; use only with NewReflection
Opt_Only_JDK15, // preload tried; use only with JDK1.5+
OPTION_LIMIT,
CEIL_LG_OPTION_LIMIT = 4 // OPTION_LIMIT <= (1<<CEIL_LG_OPTION_LIMIT)
CEIL_LG_OPTION_LIMIT = 2 // OPTION_LIMIT <= (1<<CEIL_LG_OPTION_LIMIT)
};
@ -385,15 +381,6 @@ public:
static Klass* check_klass_Pre( Klass* k) { return check_klass(k); }
static Klass* check_klass_Opt( Klass* k) { return k; }
static Klass* check_klass_Opt_Only_JDK15(Klass* k) {
assert(JDK_Version::is_gte_jdk15x_version(), "JDK 1.5 only");
return k;
}
static Klass* check_klass_Opt_Only_JDK14NewRef(Klass* k) {
assert(JDK_Version::is_gte_jdk14x_version(), "JDK 1.4 only");
// despite the optional loading, if you use this it must be present:
return check_klass(k);
}
static bool initialize_wk_klass(WKID id, int init_opt, TRAPS);
static void initialize_wk_klasses_until(WKID limit_id, WKID &start_id, TRAPS);

View File

@ -320,7 +320,6 @@
template(reference_discovered_name, "discovered") \
template(run_finalization_name, "runFinalization") \
template(run_finalizers_on_exit_name, "runFinalizersOnExit") \
template(uncaughtException_name, "uncaughtException") \
template(dispatchUncaughtException_name, "dispatchUncaughtException") \
template(initializeSystemClass_name, "initializeSystemClass") \
template(loadClass_name, "loadClass") \
@ -573,6 +572,7 @@
template(serializePropertiesToByteArray_signature, "()[B") \
template(serializeAgentPropertiesToByteArray_name, "serializeAgentPropertiesToByteArray") \
template(classRedefinedCount_name, "classRedefinedCount") \
template(classLoader_name, "classLoader") \
\
/* trace signatures */ \
TRACE_TEMPLATES(template) \

View File

@ -159,6 +159,30 @@ address CompiledIC::stub_address() const {
//-----------------------------------------------------------------------------
// High-level access to an inline cache. Guaranteed to be MT-safe.
CompiledIC::CompiledIC(nmethod* nm, NativeCall* call)
: _ic_call(call)
{
address ic_call = call->instruction_address();
assert(ic_call != NULL, "ic_call address must be set");
assert(nm != NULL, "must pass nmethod");
assert(nm->contains(ic_call), "must be in nmethod");
// Search for the ic_call at the given address.
RelocIterator iter(nm, ic_call, ic_call+1);
bool ret = iter.next();
assert(ret == true, "relocInfo must exist at this address");
assert(iter.addr() == ic_call, "must find ic_call");
if (iter.type() == relocInfo::virtual_call_type) {
virtual_call_Relocation* r = iter.virtual_call_reloc();
_is_optimized = false;
_value = nativeMovConstReg_at(r->cached_value());
} else {
assert(iter.type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
_is_optimized = true;
_value = NULL;
}
}
bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecode, TRAPS) {
assert(CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");

View File

@ -37,6 +37,7 @@
#include "oops/methodData.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "prims/jvmtiImpl.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/orderAccess.inline.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/sweeper.hpp"
@ -363,26 +364,29 @@ void nmethod::add_exception_cache_entry(ExceptionCache* new_entry) {
set_exception_cache(new_entry);
}
void nmethod::remove_from_exception_cache(ExceptionCache* ec) {
void nmethod::clean_exception_cache(BoolObjectClosure* is_alive) {
ExceptionCache* prev = NULL;
ExceptionCache* curr = exception_cache();
assert(curr != NULL, "nothing to remove");
// find the previous and next entry of ec
while (curr != ec) {
prev = curr;
curr = curr->next();
assert(curr != NULL, "ExceptionCache not found");
}
// now: curr == ec
ExceptionCache* next = curr->next();
if (prev == NULL) {
set_exception_cache(next);
} else {
prev->set_next(next);
}
delete curr;
}
while (curr != NULL) {
ExceptionCache* next = curr->next();
Klass* ex_klass = curr->exception_type();
if (ex_klass != NULL && !ex_klass->is_loader_alive(is_alive)) {
if (prev == NULL) {
set_exception_cache(next);
} else {
prev->set_next(next);
}
delete curr;
// prev stays the same.
} else {
prev = curr;
}
curr = next;
}
}
// public method for accessing the exception cache
// These are the public access methods.
@ -668,8 +672,10 @@ nmethod::nmethod(
_hotness_counter = NMethodSweeper::hotness_counter_reset_val();
code_buffer->copy_values_to(this);
if (ScavengeRootsInCode && detect_scavenge_root_oops()) {
CodeCache::add_scavenge_root_nmethod(this);
if (ScavengeRootsInCode) {
if (detect_scavenge_root_oops()) {
CodeCache::add_scavenge_root_nmethod(this);
}
Universe::heap()->register_nmethod(this);
}
debug_only(verify_scavenge_root_oops());
@ -753,8 +759,10 @@ nmethod::nmethod(
_hotness_counter = NMethodSweeper::hotness_counter_reset_val();
code_buffer->copy_values_to(this);
if (ScavengeRootsInCode && detect_scavenge_root_oops()) {
CodeCache::add_scavenge_root_nmethod(this);
if (ScavengeRootsInCode) {
if (detect_scavenge_root_oops()) {
CodeCache::add_scavenge_root_nmethod(this);
}
Universe::heap()->register_nmethod(this);
}
DEBUG_ONLY(verify_scavenge_root_oops();)
@ -869,8 +877,10 @@ nmethod::nmethod(
code_buffer->copy_values_to(this);
debug_info->copy_to(this);
dependencies->copy_to(this);
if (ScavengeRootsInCode && detect_scavenge_root_oops()) {
CodeCache::add_scavenge_root_nmethod(this);
if (ScavengeRootsInCode) {
if (detect_scavenge_root_oops()) {
CodeCache::add_scavenge_root_nmethod(this);
}
Universe::heap()->register_nmethod(this);
}
debug_only(verify_scavenge_root_oops());
@ -1612,15 +1622,7 @@ void nmethod::do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred)
}
// Exception cache
ExceptionCache* ec = exception_cache();
while (ec != NULL) {
Klass* ex_klass = ec->exception_type();
ExceptionCache* next_ec = ec->next();
if (ex_klass != NULL && !ex_klass->is_loader_alive(is_alive)) {
remove_from_exception_cache(ec);
}
ec = next_ec;
}
clean_exception_cache(is_alive);
// If class unloading occurred we first iterate over all inline caches and
// clear ICs where the cached oop is referring to an unloaded klass or method.

Some files were not shown because too many files have changed in this diff Show More