Merge
This commit is contained in:
commit
9a09c367d6
@ -379,3 +379,4 @@ be1218f792a450dfb5d4b1f82616b9d95a6a732e jdk-9+133
|
||||
065724348690eda41fc69112278d8da6dcde548c jdk-9+134
|
||||
82b94cb5f342319d2cda77f9fa59703ad7fde576 jdk-9+135
|
||||
3ec350f5f32af249b59620d7e37b54bdcd77b233 jdk-9+136
|
||||
d7f519b004254b19e384131d9f0d0e40e31a0fd3 jdk-9+137
|
||||
|
4
Makefile
4
Makefile
@ -28,8 +28,8 @@
|
||||
### It also performs some sanity checks on make.
|
||||
###
|
||||
|
||||
# The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU Make.
|
||||
# /usr/ccs/bin/make lacks basically every other flow control mechanism.
|
||||
# The shell code below will be executed on /usr/bin/make on Solaris, but not in GNU Make.
|
||||
# /usr/bin/make lacks basically every other flow control mechanism.
|
||||
.TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU Make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
|
||||
|
||||
# The .FEATURES variable is likely to be unique for GNU Make.
|
||||
|
@ -626,8 +626,7 @@ number of different configurations, e.g. debug, release, 32, 64, etc.</p>
|
||||
|
||||
<p>The Common UNIX Printing System (CUPS) Headers are required for building the
|
||||
OpenJDK on Solaris and Linux. The Solaris header files can be obtained by
|
||||
installing the package <strong>SFWcups</strong> from the Solaris Software Companion
|
||||
CD/DVD, these often will be installed into the directory <code>/opt/sfw/cups</code>.</p>
|
||||
installing the package <strong>print/cups</strong>.</p>
|
||||
|
||||
<p>The CUPS header files can always be downloaded from
|
||||
<a href="http://www.cups.org">www.cups.org</a>.</p>
|
||||
@ -1111,8 +1110,7 @@ version, see "<a href="#buildgmake">Building GNU make</a>".</li>
|
||||
<li>Place the location of the GNU make binary in the <code>PATH</code>.</li>
|
||||
<li><strong>Solaris:</strong> Do NOT use <code>/usr/bin/make</code> on Solaris. If your Solaris system
|
||||
has the software from the Solaris Developer Companion CD installed, you
|
||||
should try and use <code>gmake</code> which will be located in either the <code>/usr/bin</code>,
|
||||
<code>/opt/sfw/bin</code> or <code>/usr/sfw/bin</code> directory.</li>
|
||||
should try and use <code>/usr/bin/gmake</code> or <code>/usr/gnu/bin/make</code>.</li>
|
||||
<li><strong>Windows:</strong> Make sure you start your build inside a bash shell.</li>
|
||||
<li><strong>Mac OS X:</strong> The XCode "command line tools" must be installed on your Mac.</li>
|
||||
</ul>
|
||||
|
@ -560,8 +560,7 @@ Some of the more commonly used `configure` options are:
|
||||
|
||||
> The Common UNIX Printing System (CUPS) Headers are required for building the
|
||||
OpenJDK on Solaris and Linux. The Solaris header files can be obtained by
|
||||
installing the package **SFWcups** from the Solaris Software Companion
|
||||
CD/DVD, these often will be installed into the directory `/opt/sfw/cups`.
|
||||
installing the package **print/cups**.
|
||||
|
||||
> The CUPS header files can always be downloaded from
|
||||
[www.cups.org](http://www.cups.org).
|
||||
@ -1017,8 +1016,7 @@ about using GNU make:
|
||||
* Place the location of the GNU make binary in the `PATH`.
|
||||
* **Solaris:** Do NOT use `/usr/bin/make` on Solaris. If your Solaris system
|
||||
has the software from the Solaris Developer Companion CD installed, you
|
||||
should try and use `gmake` which will be located in either the `/usr/bin`,
|
||||
`/opt/sfw/bin` or `/usr/sfw/bin` directory.
|
||||
should try and use `/usr/bin/gmake` or `/usr/gnu/bin/make`.
|
||||
* **Windows:** Make sure you start your build inside a bash shell.
|
||||
* **Mac OS X:** The XCode "command line tools" must be installed on your Mac.
|
||||
|
||||
|
@ -750,11 +750,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
|
||||
# Prepend the extra path to the global path
|
||||
BASIC_PREPEND_TO_PATH([PATH],$EXTRA_PATH)
|
||||
|
||||
if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
|
||||
# Add extra search paths on solaris for utilities like ar, as, dtrace etc...
|
||||
PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin:/usr/sbin"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for sysroot])
|
||||
AC_MSG_RESULT([$SYSROOT])
|
||||
AC_MSG_CHECKING([for toolchain path])
|
||||
|
@ -88,8 +88,7 @@ AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS],
|
||||
# inlining of system functions and intrinsics.
|
||||
$1SYSROOT_CFLAGS="-I-xbuiltin -I[$]$1SYSROOT/usr/include"
|
||||
$1SYSROOT_LDFLAGS="-L[$]$1SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-L[$]$1SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-L[$]$1SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
|
||||
-L[$]$1SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR"
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
$1SYSROOT_CFLAGS="--sysroot=[$]$1SYSROOT"
|
||||
|
@ -926,9 +926,7 @@ COMPRESS_JARS
|
||||
INCLUDE_SA
|
||||
UNLIMITED_CRYPTO
|
||||
CACERTS_FILE
|
||||
BUILD_HEADLESS
|
||||
SUPPORT_HEADFUL
|
||||
SUPPORT_HEADLESS
|
||||
ENABLE_HEADLESS_ONLY
|
||||
DEFAULT_MAKE_TARGET
|
||||
OS_VERSION_MICRO
|
||||
OS_VERSION_MINOR
|
||||
@ -1153,7 +1151,7 @@ with_sdk_name
|
||||
with_conf_name
|
||||
with_output_sync
|
||||
with_default_make_target
|
||||
enable_headful
|
||||
enable_headless_only
|
||||
with_cacerts_file
|
||||
enable_unlimited_crypto
|
||||
with_copyright_year
|
||||
@ -1976,8 +1974,7 @@ Optional Features:
|
||||
[disabled]
|
||||
--enable-debug set the debug level to fastdebug (shorthand for
|
||||
--with-debug-level=fastdebug) [disabled]
|
||||
--disable-headful disable building headful support (graphical UI
|
||||
support) [enabled]
|
||||
--enable-headless-only only build headless (no GUI) support [disabled]
|
||||
--enable-unlimited-crypto
|
||||
Enable unlimited crypto policy [disabled]
|
||||
--disable-keep-packaged-modules
|
||||
@ -5095,7 +5092,7 @@ VS_SDK_PLATFORM_NAME_2013=
|
||||
#CUSTOM_AUTOCONF_INCLUDE
|
||||
|
||||
# Do not change or remove the following line, it is needed for consistency checks:
|
||||
DATE_WHEN_GENERATED=1472718471
|
||||
DATE_WHEN_GENERATED=1474894604
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@ -17213,11 +17210,6 @@ $as_echo "$as_me: WARNING: Both SYSROOT and --with-sdk-name are set, only SYSROO
|
||||
fi
|
||||
|
||||
|
||||
if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
|
||||
# Add extra search paths on solaris for utilities like ar, as, dtrace etc...
|
||||
PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin:/usr/sbin"
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
|
||||
$as_echo_n "checking for sysroot... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYSROOT" >&5
|
||||
@ -24197,37 +24189,31 @@ fi
|
||||
|
||||
# We need build & target for this.
|
||||
|
||||
# Should we build a JDK/JVM with headful support (ie a graphical ui)?
|
||||
# We always build headless support.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking headful support" >&5
|
||||
$as_echo_n "checking headful support... " >&6; }
|
||||
# Check whether --enable-headful was given.
|
||||
if test "${enable_headful+set}" = set; then :
|
||||
enableval=$enable_headful; SUPPORT_HEADFUL=${enable_headful}
|
||||
else
|
||||
SUPPORT_HEADFUL=yes
|
||||
# Should we build a JDK without a graphical UI?
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking headless only" >&5
|
||||
$as_echo_n "checking headless only... " >&6; }
|
||||
# Check whether --enable-headless-only was given.
|
||||
if test "${enable_headless_only+set}" = set; then :
|
||||
enableval=$enable_headless_only;
|
||||
fi
|
||||
|
||||
|
||||
SUPPORT_HEADLESS=yes
|
||||
BUILD_HEADLESS="BUILD_HEADLESS:=true"
|
||||
|
||||
if test "x$SUPPORT_HEADFUL" = xyes; then
|
||||
# We are building both headful and headless.
|
||||
headful_msg="include support for both headful and headless"
|
||||
if test "x$enable_headless_only" = "xyes"; then
|
||||
ENABLE_HEADLESS_ONLY="true"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
elif test "x$enable_headless_only" = "xno"; then
|
||||
ENABLE_HEADLESS_ONLY="false"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
elif test "x$enable_headless_only" = "x"; then
|
||||
ENABLE_HEADLESS_ONLY="false"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
else
|
||||
as_fn_error $? "--enable-headless-only can only take yes or no" "$LINENO" 5
|
||||
fi
|
||||
|
||||
if test "x$SUPPORT_HEADFUL" = xno; then
|
||||
# Thus we are building headless only.
|
||||
BUILD_HEADLESS="BUILD_HEADLESS:=true"
|
||||
headful_msg="headless only"
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $headful_msg" >&5
|
||||
$as_echo "$headful_msg" >&6; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Choose cacerts source file
|
||||
@ -31475,8 +31461,7 @@ fi
|
||||
# inlining of system functions and intrinsics.
|
||||
SYSROOT_CFLAGS="-I-xbuiltin -I$SYSROOT/usr/include"
|
||||
SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
|
||||
-L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR"
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
SYSROOT_CFLAGS="--sysroot=$SYSROOT"
|
||||
@ -32992,14 +32977,6 @@ $as_echo "$as_me: or run \"bash.exe -l\" from a VS command prompt and then run c
|
||||
fi
|
||||
|
||||
|
||||
# For solaris we really need solaris tools, and not the GNU equivalent.
|
||||
# The build tools on Solaris reside in /usr/ccs (C Compilation System),
|
||||
# so add that to path before starting to probe.
|
||||
# FIXME: This was originally only done for AS,NM,GNM,STRIP,OBJCOPY,OBJDUMP.
|
||||
if test "x$OPENJDK_BUILD_OS" = xsolaris; then
|
||||
PATH="/usr/ccs/bin:$PATH"
|
||||
fi
|
||||
|
||||
# Finally add TOOLCHAIN_PATH at the beginning, to allow --with-tools-dir to
|
||||
# override all other locations.
|
||||
if test "x$TOOLCHAIN_PATH" != x; then
|
||||
@ -44000,8 +43977,7 @@ $as_echo "$BUILD_DEVKIT_ROOT" >&6; }
|
||||
# inlining of system functions and intrinsics.
|
||||
BUILD_SYSROOT_CFLAGS="-I-xbuiltin -I$BUILD_SYSROOT/usr/include"
|
||||
BUILD_SYSROOT_LDFLAGS="-L$BUILD_SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-L$BUILD_SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-L$BUILD_SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
|
||||
-L$BUILD_SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR"
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
BUILD_SYSROOT_CFLAGS="--sysroot=$BUILD_SYSROOT"
|
||||
@ -53060,13 +53036,9 @@ $as_echo "yes" >&6; }
|
||||
# No X11 support on windows or macosx
|
||||
NEEDS_LIB_X11=false
|
||||
else
|
||||
if test "x$SUPPORT_HEADFUL" = xno; then
|
||||
# No X11 support if building headless-only
|
||||
NEEDS_LIB_X11=false
|
||||
else
|
||||
# All other instances need X11
|
||||
NEEDS_LIB_X11=true
|
||||
fi
|
||||
# All other instances need X11, even if building headless only, libawt still
|
||||
# needs X11 headers.
|
||||
NEEDS_LIB_X11=true
|
||||
fi
|
||||
|
||||
# Check if cups is needed
|
||||
@ -56730,9 +56702,7 @@ fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
OPENWIN_HOME="/usr/openwin"
|
||||
X_CFLAGS="-I$SYSROOT$OPENWIN_HOME/include -I$SYSROOT$OPENWIN_HOME/include/X11/extensions"
|
||||
X_LIBS="-L$SYSROOT$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-R$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
X_LIBS="-L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-R$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR"
|
||||
fi
|
||||
|
||||
@ -56909,23 +56879,6 @@ fi
|
||||
|
||||
done
|
||||
|
||||
fi
|
||||
if test "x$CUPS_FOUND" = xno; then
|
||||
# Getting nervous now? Lets poke around for standard Solaris third-party
|
||||
# package installation locations.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cups headers" >&5
|
||||
$as_echo_n "checking for cups headers... " >&6; }
|
||||
if test -s $SYSROOT/opt/sfw/cups/include/cups/cups.h; then
|
||||
# An SFW package seems to be installed!
|
||||
CUPS_FOUND=yes
|
||||
CUPS_CFLAGS="-I$SYSROOT/opt/sfw/cups/include"
|
||||
elif test -s $SYSROOT/opt/csw/include/cups/cups.h; then
|
||||
# A CSW package seems to be installed!
|
||||
CUPS_FOUND=yes
|
||||
CUPS_CFLAGS="-I$SYSROOT/opt/csw/include"
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUPS_FOUND" >&5
|
||||
$as_echo "$CUPS_FOUND" >&6; }
|
||||
fi
|
||||
if test "x$CUPS_FOUND" = xno; then
|
||||
|
||||
@ -61166,346 +61119,6 @@ $as_echo "$FREETYPE_LIB_PATH" >&6; }
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr/sfw"
|
||||
|
||||
POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include"
|
||||
POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib"
|
||||
METHOD="well-known location"
|
||||
|
||||
# Let's start with an optimistic view of the world :-)
|
||||
FOUND_FREETYPE=yes
|
||||
|
||||
# First look for the canonical freetype main include file ft2build.h.
|
||||
if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then
|
||||
# Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite.
|
||||
POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2"
|
||||
if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then
|
||||
# Fail.
|
||||
FOUND_FREETYPE=no
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$FOUND_FREETYPE" = xyes; then
|
||||
# Include file found, let's continue the sanity check.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5
|
||||
$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;}
|
||||
|
||||
# Reset to default value
|
||||
FREETYPE_BASE_NAME=freetype
|
||||
FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}"
|
||||
if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx \
|
||||
&& test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then
|
||||
# On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check
|
||||
# for the .6 version explicitly.
|
||||
FREETYPE_BASE_NAME=freetype.6
|
||||
FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5
|
||||
$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;}
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5
|
||||
$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;}
|
||||
FOUND_FREETYPE=no
|
||||
fi
|
||||
else
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
# On Windows, we will need both .lib and .dll file.
|
||||
if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5
|
||||
$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;}
|
||||
FOUND_FREETYPE=no
|
||||
fi
|
||||
elif test "x$OPENJDK_TARGET_OS" = xsolaris \
|
||||
&& test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
|
||||
# Found lib in isa dir, use that instead.
|
||||
POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5
|
||||
$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$FOUND_FREETYPE" = xyes; then
|
||||
|
||||
# Only process if variable expands to non-empty
|
||||
|
||||
if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then
|
||||
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
|
||||
|
||||
# Input might be given as Windows format, start by converting to
|
||||
# unix format.
|
||||
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
|
||||
new_path=`$CYGPATH -u "$path"`
|
||||
|
||||
# Cygwin tries to hide some aspects of the Windows file system, such that binaries are
|
||||
# named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
|
||||
# the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
|
||||
# "foo.exe" is OK but "foo" is an error.
|
||||
#
|
||||
# This test is therefore slightly more accurate than "test -f" to check for file precense.
|
||||
# It is also a way to make sure we got the proper file name for the real test later on.
|
||||
test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
|
||||
if test "x$test_shortpath" = x; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
|
||||
$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
|
||||
as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5
|
||||
fi
|
||||
|
||||
# Call helper function which possibly converts this using DOS-style short mode.
|
||||
# If so, the updated path is stored in $new_path.
|
||||
|
||||
input_path="$new_path"
|
||||
# Check if we need to convert this using DOS-style short mode. If the path
|
||||
# contains just simple characters, use it. Otherwise (spaces, weird characters),
|
||||
# take no chances and rewrite it.
|
||||
# Note: m4 eats our [], so we need to use [ and ] instead.
|
||||
has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
|
||||
if test "x$has_forbidden_chars" != x; then
|
||||
# Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
|
||||
shortmode_path=`$CYGPATH -s -m -a "$input_path"`
|
||||
path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
|
||||
if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
|
||||
# Going to short mode and back again did indeed matter. Since short mode is
|
||||
# case insensitive, let's make it lowercase to improve readability.
|
||||
shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
# Now convert it back to Unix-style (cygpath)
|
||||
input_path=`$CYGPATH -u "$shortmode_path"`
|
||||
new_path="$input_path"
|
||||
fi
|
||||
fi
|
||||
|
||||
test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
|
||||
if test "x$test_cygdrive_prefix" = x; then
|
||||
# As a simple fix, exclude /usr/bin since it's not a real path.
|
||||
if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
|
||||
# The path is in a Cygwin special directory (e.g. /home). We need this converted to
|
||||
# a path prefixed by /cygdrive for fixpath to work.
|
||||
new_path="$CYGWIN_ROOT_PATH$input_path"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if test "x$path" != "x$new_path"; then
|
||||
POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5
|
||||
$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
|
||||
fi
|
||||
|
||||
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
|
||||
|
||||
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
|
||||
has_colon=`$ECHO $path | $GREP ^.:`
|
||||
new_path="$path"
|
||||
if test "x$has_colon" = x; then
|
||||
# Not in mixed or Windows style, start by that.
|
||||
new_path=`cmd //c echo $path`
|
||||
fi
|
||||
|
||||
|
||||
input_path="$new_path"
|
||||
# Check if we need to convert this using DOS-style short mode. If the path
|
||||
# contains just simple characters, use it. Otherwise (spaces, weird characters),
|
||||
# take no chances and rewrite it.
|
||||
# Note: m4 eats our [], so we need to use [ and ] instead.
|
||||
has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
|
||||
if test "x$has_forbidden_chars" != x; then
|
||||
# Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
|
||||
new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
fi
|
||||
|
||||
|
||||
windows_path="$new_path"
|
||||
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
|
||||
unix_path=`$CYGPATH -u "$windows_path"`
|
||||
new_path="$unix_path"
|
||||
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
|
||||
unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
|
||||
new_path="$unix_path"
|
||||
fi
|
||||
|
||||
if test "x$path" != "x$new_path"; then
|
||||
POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5
|
||||
$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
|
||||
fi
|
||||
|
||||
# Save the first 10 bytes of this path to the storage, so fixpath can work.
|
||||
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
|
||||
|
||||
else
|
||||
# We're on a unix platform. Hooray! :)
|
||||
path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
|
||||
has_space=`$ECHO "$path" | $GREP " "`
|
||||
if test "x$has_space" != x; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
|
||||
$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
|
||||
as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
|
||||
fi
|
||||
|
||||
# Use eval to expand a potential ~
|
||||
eval path="$path"
|
||||
if test ! -f "$path" && test ! -d "$path"; then
|
||||
as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
|
||||
fi
|
||||
|
||||
if test -d "$path"; then
|
||||
POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
|
||||
else
|
||||
dir="`$DIRNAME "$path"`"
|
||||
base="`$BASENAME "$path"`"
|
||||
POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Only process if variable expands to non-empty
|
||||
|
||||
if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
|
||||
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
|
||||
|
||||
# Input might be given as Windows format, start by converting to
|
||||
# unix format.
|
||||
path="$POTENTIAL_FREETYPE_LIB_PATH"
|
||||
new_path=`$CYGPATH -u "$path"`
|
||||
|
||||
# Cygwin tries to hide some aspects of the Windows file system, such that binaries are
|
||||
# named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
|
||||
# the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
|
||||
# "foo.exe" is OK but "foo" is an error.
|
||||
#
|
||||
# This test is therefore slightly more accurate than "test -f" to check for file precense.
|
||||
# It is also a way to make sure we got the proper file name for the real test later on.
|
||||
test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
|
||||
if test "x$test_shortpath" = x; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
|
||||
$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
|
||||
as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5
|
||||
fi
|
||||
|
||||
# Call helper function which possibly converts this using DOS-style short mode.
|
||||
# If so, the updated path is stored in $new_path.
|
||||
|
||||
input_path="$new_path"
|
||||
# Check if we need to convert this using DOS-style short mode. If the path
|
||||
# contains just simple characters, use it. Otherwise (spaces, weird characters),
|
||||
# take no chances and rewrite it.
|
||||
# Note: m4 eats our [], so we need to use [ and ] instead.
|
||||
has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
|
||||
if test "x$has_forbidden_chars" != x; then
|
||||
# Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
|
||||
shortmode_path=`$CYGPATH -s -m -a "$input_path"`
|
||||
path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
|
||||
if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
|
||||
# Going to short mode and back again did indeed matter. Since short mode is
|
||||
# case insensitive, let's make it lowercase to improve readability.
|
||||
shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
# Now convert it back to Unix-style (cygpath)
|
||||
input_path=`$CYGPATH -u "$shortmode_path"`
|
||||
new_path="$input_path"
|
||||
fi
|
||||
fi
|
||||
|
||||
test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
|
||||
if test "x$test_cygdrive_prefix" = x; then
|
||||
# As a simple fix, exclude /usr/bin since it's not a real path.
|
||||
if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
|
||||
# The path is in a Cygwin special directory (e.g. /home). We need this converted to
|
||||
# a path prefixed by /cygdrive for fixpath to work.
|
||||
new_path="$CYGWIN_ROOT_PATH$input_path"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if test "x$path" != "x$new_path"; then
|
||||
POTENTIAL_FREETYPE_LIB_PATH="$new_path"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5
|
||||
$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
|
||||
fi
|
||||
|
||||
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
|
||||
|
||||
path="$POTENTIAL_FREETYPE_LIB_PATH"
|
||||
has_colon=`$ECHO $path | $GREP ^.:`
|
||||
new_path="$path"
|
||||
if test "x$has_colon" = x; then
|
||||
# Not in mixed or Windows style, start by that.
|
||||
new_path=`cmd //c echo $path`
|
||||
fi
|
||||
|
||||
|
||||
input_path="$new_path"
|
||||
# Check if we need to convert this using DOS-style short mode. If the path
|
||||
# contains just simple characters, use it. Otherwise (spaces, weird characters),
|
||||
# take no chances and rewrite it.
|
||||
# Note: m4 eats our [], so we need to use [ and ] instead.
|
||||
has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
|
||||
if test "x$has_forbidden_chars" != x; then
|
||||
# Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
|
||||
new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
fi
|
||||
|
||||
|
||||
windows_path="$new_path"
|
||||
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
|
||||
unix_path=`$CYGPATH -u "$windows_path"`
|
||||
new_path="$unix_path"
|
||||
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
|
||||
unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
|
||||
new_path="$unix_path"
|
||||
fi
|
||||
|
||||
if test "x$path" != "x$new_path"; then
|
||||
POTENTIAL_FREETYPE_LIB_PATH="$new_path"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5
|
||||
$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
|
||||
fi
|
||||
|
||||
# Save the first 10 bytes of this path to the storage, so fixpath can work.
|
||||
all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
|
||||
|
||||
else
|
||||
# We're on a unix platform. Hooray! :)
|
||||
path="$POTENTIAL_FREETYPE_LIB_PATH"
|
||||
has_space=`$ECHO "$path" | $GREP " "`
|
||||
if test "x$has_space" != x; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
|
||||
$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
|
||||
as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
|
||||
fi
|
||||
|
||||
# Use eval to expand a potential ~
|
||||
eval path="$path"
|
||||
if test ! -f "$path" && test ! -d "$path"; then
|
||||
as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
|
||||
fi
|
||||
|
||||
if test -d "$path"; then
|
||||
POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
|
||||
else
|
||||
dir="`$DIRNAME "$path"`"
|
||||
base="`$BASENAME "$path"`"
|
||||
POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5
|
||||
$as_echo_n "checking for freetype includes... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5
|
||||
$as_echo "$FREETYPE_INCLUDE_PATH" >&6; }
|
||||
FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5
|
||||
$as_echo_n "checking for freetype libraries... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5
|
||||
$as_echo "$FREETYPE_LIB_PATH" >&6; }
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr"
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
|
@ -134,32 +134,25 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM],
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
[
|
||||
# Should we build a JDK/JVM with headful support (ie a graphical ui)?
|
||||
# We always build headless support.
|
||||
AC_MSG_CHECKING([headful support])
|
||||
AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful],
|
||||
[disable building headful support (graphical UI support) @<:@enabled@:>@])],
|
||||
[SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes])
|
||||
# Should we build a JDK without a graphical UI?
|
||||
AC_MSG_CHECKING([headless only])
|
||||
AC_ARG_ENABLE([headless-only], [AS_HELP_STRING([--enable-headless-only],
|
||||
[only build headless (no GUI) support @<:@disabled@:>@])])
|
||||
|
||||
SUPPORT_HEADLESS=yes
|
||||
BUILD_HEADLESS="BUILD_HEADLESS:=true"
|
||||
|
||||
if test "x$SUPPORT_HEADFUL" = xyes; then
|
||||
# We are building both headful and headless.
|
||||
headful_msg="include support for both headful and headless"
|
||||
if test "x$enable_headless_only" = "xyes"; then
|
||||
ENABLE_HEADLESS_ONLY="true"
|
||||
AC_MSG_RESULT([yes])
|
||||
elif test "x$enable_headless_only" = "xno"; then
|
||||
ENABLE_HEADLESS_ONLY="false"
|
||||
AC_MSG_RESULT([no])
|
||||
elif test "x$enable_headless_only" = "x"; then
|
||||
ENABLE_HEADLESS_ONLY="false"
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_ERROR([--enable-headless-only can only take yes or no])
|
||||
fi
|
||||
|
||||
if test "x$SUPPORT_HEADFUL" = xno; then
|
||||
# Thus we are building headless only.
|
||||
BUILD_HEADLESS="BUILD_HEADLESS:=true"
|
||||
headful_msg="headless only"
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$headful_msg])
|
||||
|
||||
AC_SUBST(SUPPORT_HEADLESS)
|
||||
AC_SUBST(SUPPORT_HEADFUL)
|
||||
AC_SUBST(BUILD_HEADLESS)
|
||||
AC_SUBST(ENABLE_HEADLESS_ONLY)
|
||||
|
||||
# Choose cacerts source file
|
||||
AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
|
||||
|
@ -75,21 +75,6 @@ AC_DEFUN_ONCE([LIB_SETUP_CUPS],
|
||||
DEFAULT_CUPS=yes
|
||||
])
|
||||
fi
|
||||
if test "x$CUPS_FOUND" = xno; then
|
||||
# Getting nervous now? Lets poke around for standard Solaris third-party
|
||||
# package installation locations.
|
||||
AC_MSG_CHECKING([for cups headers])
|
||||
if test -s $SYSROOT/opt/sfw/cups/include/cups/cups.h; then
|
||||
# An SFW package seems to be installed!
|
||||
CUPS_FOUND=yes
|
||||
CUPS_CFLAGS="-I$SYSROOT/opt/sfw/cups/include"
|
||||
elif test -s $SYSROOT/opt/csw/include/cups/cups.h; then
|
||||
# A CSW package seems to be installed!
|
||||
CUPS_FOUND=yes
|
||||
CUPS_CFLAGS="-I$SYSROOT/opt/csw/include"
|
||||
fi
|
||||
AC_MSG_RESULT([$CUPS_FOUND])
|
||||
fi
|
||||
if test "x$CUPS_FOUND" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([cups])
|
||||
AC_MSG_ERROR([Could not find cups! $HELP_MSG ])
|
||||
|
@ -357,11 +357,6 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr/sfw"
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
fi
|
||||
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr"
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
|
@ -91,9 +91,7 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
OPENWIN_HOME="/usr/openwin"
|
||||
X_CFLAGS="-I$SYSROOT$OPENWIN_HOME/include -I$SYSROOT$OPENWIN_HOME/include/X11/extensions"
|
||||
X_LIBS="-L$SYSROOT$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-R$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
X_LIBS="-L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-R$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR"
|
||||
fi
|
||||
|
||||
|
@ -42,13 +42,9 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
|
||||
# No X11 support on windows or macosx
|
||||
NEEDS_LIB_X11=false
|
||||
else
|
||||
if test "x$SUPPORT_HEADFUL" = xno; then
|
||||
# No X11 support if building headless-only
|
||||
NEEDS_LIB_X11=false
|
||||
else
|
||||
# All other instances need X11
|
||||
NEEDS_LIB_X11=true
|
||||
fi
|
||||
# All other instances need X11, even if building headless only, libawt still
|
||||
# needs X11 headers.
|
||||
NEEDS_LIB_X11=true
|
||||
fi
|
||||
|
||||
# Check if cups is needed
|
||||
|
@ -241,12 +241,8 @@ BUILD_GTEST := @BUILD_GTEST@
|
||||
# Control use of precompiled header in hotspot libjvm build
|
||||
USE_PRECOMPILED_HEADER := @USE_PRECOMPILED_HEADER@
|
||||
|
||||
# Should we compile support for running with a graphical UI? (ie headful)
|
||||
# Should we compile support for running without? (ie headless)
|
||||
SUPPORT_HEADFUL:=@SUPPORT_HEADFUL@
|
||||
SUPPORT_HEADLESS:=@SUPPORT_HEADLESS@
|
||||
# Legacy defines controlled by the SUPPORT_HEADLESS and SUPPORT_HEADFUL options.
|
||||
@BUILD_HEADLESS@
|
||||
# Only build headless support or not
|
||||
ENABLE_HEADLESS_ONLY := @ENABLE_HEADLESS_ONLY@
|
||||
|
||||
# Legacy support
|
||||
USE_NEW_HOTSPOT_BUILD:=@USE_NEW_HOTSPOT_BUILD@
|
||||
|
@ -294,14 +294,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
|
||||
fi
|
||||
AC_SUBST(TOOLCHAIN_VERSION)
|
||||
|
||||
# For solaris we really need solaris tools, and not the GNU equivalent.
|
||||
# The build tools on Solaris reside in /usr/ccs (C Compilation System),
|
||||
# so add that to path before starting to probe.
|
||||
# FIXME: This was originally only done for AS,NM,GNM,STRIP,OBJCOPY,OBJDUMP.
|
||||
if test "x$OPENJDK_BUILD_OS" = xsolaris; then
|
||||
PATH="/usr/ccs/bin:$PATH"
|
||||
fi
|
||||
|
||||
# Finally add TOOLCHAIN_PATH at the beginning, to allow --with-tools-dir to
|
||||
# override all other locations.
|
||||
if test "x$TOOLCHAIN_PATH" != x; then
|
||||
|
@ -224,6 +224,23 @@ var getJibProfilesCommon = function (input) {
|
||||
common.configure_args_slowdebug = ["--with-debug-level=slowdebug"],
|
||||
common.organization = "jpg.infra.builddeps"
|
||||
|
||||
var boot_jdk_revision = "8";
|
||||
var boot_jdk_subdirpart = "1.8.0";
|
||||
// JDK 8 does not work on sparc M7 cpus, need a newer update when building
|
||||
// on such hardware.
|
||||
if (input.build_cpu == "sparcv9") {
|
||||
var cpu_brand = $EXEC("bash -c \"kstat -m cpu_info | grep brand | head -n1 | awk '{ print \$2 }'\"");
|
||||
if (cpu_brand.trim() == 'SPARC-M7') {
|
||||
boot_jdk_revision = "8u20";
|
||||
boot_jdk_subdirpart = "1.8.0_20";
|
||||
}
|
||||
}
|
||||
common.boot_jdk_revision = boot_jdk_revision;
|
||||
common.boot_jdk_subdirpart = boot_jdk_subdirpart;
|
||||
common.boot_jdk_home = input.get("boot_jdk", "home_path") + "/jdk"
|
||||
+ common.boot_jdk_subdirpart
|
||||
+ (input.build_os == "macosx" ? ".jdk/Contents/Home" : "");
|
||||
|
||||
return common;
|
||||
};
|
||||
|
||||
@ -333,8 +350,11 @@ var getJibProfilesProfiles = function (input, common) {
|
||||
"run-test": {
|
||||
target_os: input.build_os,
|
||||
target_cpu: input.build_cpu,
|
||||
dependencies: [ "jtreg", "gnumake" ],
|
||||
labels: "test"
|
||||
dependencies: [ "jtreg", "gnumake", "boot_jdk" ],
|
||||
labels: "test",
|
||||
environment: {
|
||||
"JT_JAVA": common.boot_jdk_home
|
||||
}
|
||||
}
|
||||
};
|
||||
profiles = concatObjects(profiles, testOnlyProfiles);
|
||||
@ -357,18 +377,6 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
var boot_jdk_platform = input.build_os + "-"
|
||||
+ (input.build_cpu == "x86" ? "i586" : input.build_cpu);
|
||||
|
||||
var boot_jdk_revision = "8";
|
||||
var boot_jdk_subdirpart = "1.8.0";
|
||||
// JDK 8 does not work on sparc M7 cpus, need a newer update when building
|
||||
// on such hardware.
|
||||
if (input.build_cpu == "sparcv9") {
|
||||
var cpu_brand = $EXEC("bash -c \"kstat -m cpu_info | grep brand | head -n1 | awk '{ print \$2 }'\"");
|
||||
if (cpu_brand.trim() == 'SPARC-M7') {
|
||||
boot_jdk_revision = "8u20";
|
||||
boot_jdk_subdirpart = "1.8.0_20";
|
||||
}
|
||||
}
|
||||
|
||||
var devkit_platform_revisions = {
|
||||
linux_x64: "gcc4.9.2-OEL6.4+1.0",
|
||||
macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
|
||||
@ -386,12 +394,12 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
boot_jdk: {
|
||||
server: "javare",
|
||||
module: "jdk",
|
||||
revision: boot_jdk_revision,
|
||||
revision: common.boot_jdk_revision,
|
||||
checksum_file: boot_jdk_platform + "/MD5_VALUES",
|
||||
file: boot_jdk_platform + "/jdk-" + boot_jdk_revision + "-" + boot_jdk_platform + ".tar.gz",
|
||||
configure_args: (input.build_os == "macosx"
|
||||
? "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk" + boot_jdk_subdirpart + ".jdk/Contents/Home"
|
||||
: "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk" + boot_jdk_subdirpart)
|
||||
file: boot_jdk_platform + "/jdk-" + common.boot_jdk_revision
|
||||
+ "-" + boot_jdk_platform + ".tar.gz",
|
||||
configure_args: "--with-boot-jdk=" + common.boot_jdk_home,
|
||||
environment_path: common.boot_jdk_home
|
||||
},
|
||||
|
||||
devkit: {
|
||||
@ -420,7 +428,8 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
build_number: "b03",
|
||||
checksum_file: "MD5_VALUES",
|
||||
file: "jtreg_bin-4.2.zip",
|
||||
environment_name: "JT_HOME"
|
||||
environment_name: "JT_HOME",
|
||||
environment_path: input.get("jtreg", "install_path") + "/jtreg/bin"
|
||||
},
|
||||
|
||||
gnumake: {
|
||||
|
@ -539,3 +539,4 @@ a25e0fb6033245ab075136e744d362ce765464cd jdk-9+133
|
||||
b8b694c6b4d2ab0939aed7adaf0eec1ac321a085 jdk-9+134
|
||||
3b1c4562953db47e36b237a500f368d5c9746d47 jdk-9+135
|
||||
a20da289f646ee44440695b81abc0548330e4ca7 jdk-9+136
|
||||
dfcbf839e299e7e2bba1da69bdb347617ea4c7e8 jdk-9+137
|
||||
|
@ -44,6 +44,7 @@ BUILD_HOTSPOT_JTREG_NATIVE_SRC := \
|
||||
$(HOTSPOT_TOPDIR)/test/native_sanity \
|
||||
$(HOTSPOT_TOPDIR)/test/runtime/jni/8025979 \
|
||||
$(HOTSPOT_TOPDIR)/test/runtime/jni/8033445 \
|
||||
$(HOTSPOT_TOPDIR)/test/runtime/jni/checked \
|
||||
$(HOTSPOT_TOPDIR)/test/runtime/jni/ToStringInInterfaceTest \
|
||||
$(HOTSPOT_TOPDIR)/test/runtime/modules/getModuleJNI \
|
||||
$(HOTSPOT_TOPDIR)/test/runtime/SameObject \
|
||||
|
@ -326,7 +326,8 @@ void InterpreterMacroAssembler::push_i(Register r) {
|
||||
}
|
||||
|
||||
void InterpreterMacroAssembler::push_l(Register r) {
|
||||
str(r, pre(esp, 2 * -wordSize));
|
||||
str(zr, pre(esp, -wordSize));
|
||||
str(r, pre(esp, -wordsize));
|
||||
}
|
||||
|
||||
void InterpreterMacroAssembler::pop_f(FloatRegister r) {
|
||||
|
@ -2041,6 +2041,11 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
__ verify_oop(r0);
|
||||
}
|
||||
|
||||
if (CheckJNICalls) {
|
||||
// clear_pending_jni_exception_check
|
||||
__ str(zr, Address(rthread, JavaThread::pending_jni_exception_check_fn_offset()));
|
||||
}
|
||||
|
||||
if (!is_critical_native) {
|
||||
// reset handle block
|
||||
__ ldr(r2, Address(rthread, JavaThread::active_handles_offset()));
|
||||
|
@ -1355,6 +1355,11 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
// reset_last_Java_frame
|
||||
__ reset_last_Java_frame(true);
|
||||
|
||||
if (CheckJNICalls) {
|
||||
// clear_pending_jni_exception_check
|
||||
__ str(zr, Address(rthread, JavaThread::pending_jni_exception_check_fn_offset()));
|
||||
}
|
||||
|
||||
// reset handle block
|
||||
__ ldr(t, Address(rthread, JavaThread::active_handles_offset()));
|
||||
__ str(zr, Address(t, JNIHandleBlock::top_offset_in_bytes()));
|
||||
|
@ -57,10 +57,12 @@ define_pd_global(intx, InlineSmallCode, 1500);
|
||||
|
||||
#ifdef _LP64
|
||||
// Stack slots are 2X larger in LP64 than in the 32 bit VM.
|
||||
define_pd_global(intx, CompilerThreadStackSize, 1024);
|
||||
define_pd_global(intx, ThreadStackSize, 1024);
|
||||
define_pd_global(intx, VMThreadStackSize, 1024);
|
||||
#define DEFAULT_STACK_SHADOW_PAGES (20 DEBUG_ONLY(+2))
|
||||
#else
|
||||
define_pd_global(intx, CompilerThreadStackSize, 512);
|
||||
define_pd_global(intx, ThreadStackSize, 512);
|
||||
define_pd_global(intx, VMThreadStackSize, 512);
|
||||
#define DEFAULT_STACK_SHADOW_PAGES (6 DEBUG_ONLY(+2))
|
||||
|
@ -359,7 +359,7 @@ void InterpreterMacroAssembler::store_unaligned_long(Register l, Register r1, in
|
||||
#ifdef _LP64
|
||||
stx(l, r1, offset);
|
||||
// store something more useful here
|
||||
debug_only(stx(G0, r1, offset+Interpreter::stackElementSize);)
|
||||
stx(G0, r1, offset+Interpreter::stackElementSize);
|
||||
#else
|
||||
st(l, r1, offset);
|
||||
st(l->successor(), r1, offset + Interpreter::stackElementSize);
|
||||
|
@ -2765,6 +2765,11 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
__ verify_oop(I0);
|
||||
}
|
||||
|
||||
if (CheckJNICalls) {
|
||||
// clear_pending_jni_exception_check
|
||||
__ st_ptr(G0, G2_thread, JavaThread::pending_jni_exception_check_fn_offset());
|
||||
}
|
||||
|
||||
if (!is_critical_native) {
|
||||
// reset handle block
|
||||
__ ld_ptr(G2_thread, in_bytes(JavaThread::active_handles_offset()), L5);
|
||||
|
@ -2921,6 +2921,26 @@ enc_class Fast_Unlock(iRegP oop, iRegP box, o7RegP scratch, iRegP scratch2) %{
|
||||
__ cmp( Rold, O7 );
|
||||
%}
|
||||
|
||||
// raw int cas without using tmp register for compareAndExchange
|
||||
enc_class enc_casi_exch( iRegP mem, iRegL old, iRegL new) %{
|
||||
Register Rmem = reg_to_register_object($mem$$reg);
|
||||
Register Rold = reg_to_register_object($old$$reg);
|
||||
Register Rnew = reg_to_register_object($new$$reg);
|
||||
|
||||
MacroAssembler _masm(&cbuf);
|
||||
__ cas(Rmem, Rold, Rnew);
|
||||
%}
|
||||
|
||||
// 64-bit cas without using tmp register for compareAndExchange
|
||||
enc_class enc_casx_exch( iRegP mem, iRegL old, iRegL new) %{
|
||||
Register Rmem = reg_to_register_object($mem$$reg);
|
||||
Register Rold = reg_to_register_object($old$$reg);
|
||||
Register Rnew = reg_to_register_object($new$$reg);
|
||||
|
||||
MacroAssembler _masm(&cbuf);
|
||||
__ casx(Rmem, Rold, Rnew);
|
||||
%}
|
||||
|
||||
enc_class enc_lflags_ne_to_boolean( iRegI res ) %{
|
||||
Register Rres = reg_to_register_object($res$$reg);
|
||||
|
||||
@ -7105,6 +7125,7 @@ instruct storeLConditional( iRegP mem_ptr, iRegL oldval, g3RegL newval, flagsReg
|
||||
instruct compareAndSwapL_bool(iRegP mem_ptr, iRegL oldval, iRegL newval, iRegI res, o7RegI tmp1, flagsReg ccr ) %{
|
||||
predicate(VM_Version::supports_cx8());
|
||||
match(Set res (CompareAndSwapL mem_ptr (Binary oldval newval)));
|
||||
match(Set res (WeakCompareAndSwapL mem_ptr (Binary oldval newval)));
|
||||
effect( USE mem_ptr, KILL ccr, KILL tmp1);
|
||||
format %{
|
||||
"MOV $newval,O7\n\t"
|
||||
@ -7121,6 +7142,7 @@ instruct compareAndSwapL_bool(iRegP mem_ptr, iRegL oldval, iRegL newval, iRegI r
|
||||
|
||||
instruct compareAndSwapI_bool(iRegP mem_ptr, iRegI oldval, iRegI newval, iRegI res, o7RegI tmp1, flagsReg ccr ) %{
|
||||
match(Set res (CompareAndSwapI mem_ptr (Binary oldval newval)));
|
||||
match(Set res (WeakCompareAndSwapI mem_ptr (Binary oldval newval)));
|
||||
effect( USE mem_ptr, KILL ccr, KILL tmp1);
|
||||
format %{
|
||||
"MOV $newval,O7\n\t"
|
||||
@ -7139,6 +7161,7 @@ instruct compareAndSwapP_bool(iRegP mem_ptr, iRegP oldval, iRegP newval, iRegI r
|
||||
predicate(VM_Version::supports_cx8());
|
||||
#endif
|
||||
match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval)));
|
||||
match(Set res (WeakCompareAndSwapP mem_ptr (Binary oldval newval)));
|
||||
effect( USE mem_ptr, KILL ccr, KILL tmp1);
|
||||
format %{
|
||||
"MOV $newval,O7\n\t"
|
||||
@ -7159,6 +7182,7 @@ instruct compareAndSwapP_bool(iRegP mem_ptr, iRegP oldval, iRegP newval, iRegI r
|
||||
|
||||
instruct compareAndSwapN_bool(iRegP mem_ptr, iRegN oldval, iRegN newval, iRegI res, o7RegI tmp1, flagsReg ccr ) %{
|
||||
match(Set res (CompareAndSwapN mem_ptr (Binary oldval newval)));
|
||||
match(Set res (WeakCompareAndSwapN mem_ptr (Binary oldval newval)));
|
||||
effect( USE mem_ptr, KILL ccr, KILL tmp1);
|
||||
format %{
|
||||
"MOV $newval,O7\n\t"
|
||||
@ -7172,6 +7196,54 @@ instruct compareAndSwapN_bool(iRegP mem_ptr, iRegN oldval, iRegN newval, iRegI r
|
||||
ins_pipe( long_memory_op );
|
||||
%}
|
||||
|
||||
instruct compareAndExchangeI(iRegP mem_ptr, iRegI oldval, iRegI newval)
|
||||
%{
|
||||
match(Set newval (CompareAndExchangeI mem_ptr (Binary oldval newval)));
|
||||
effect( USE mem_ptr );
|
||||
|
||||
format %{
|
||||
"CASA [$mem_ptr],$oldval,$newval\t! If $oldval==[$mem_ptr] Then store $newval into [$mem_ptr] and set $newval=[$mem_ptr]\n\t"
|
||||
%}
|
||||
ins_encode( enc_casi_exch(mem_ptr, oldval, newval) );
|
||||
ins_pipe( long_memory_op );
|
||||
%}
|
||||
|
||||
instruct compareAndExchangeL(iRegP mem_ptr, iRegL oldval, iRegL newval)
|
||||
%{
|
||||
match(Set newval (CompareAndExchangeL mem_ptr (Binary oldval newval)));
|
||||
effect( USE mem_ptr );
|
||||
|
||||
format %{
|
||||
"CASXA [$mem_ptr],$oldval,$newval\t! If $oldval==[$mem_ptr] Then store $newval into [$mem_ptr] and set $newval=[$mem_ptr]\n\t"
|
||||
%}
|
||||
ins_encode( enc_casx_exch(mem_ptr, oldval, newval) );
|
||||
ins_pipe( long_memory_op );
|
||||
%}
|
||||
|
||||
instruct compareAndExchangeP(iRegP mem_ptr, iRegP oldval, iRegP newval)
|
||||
%{
|
||||
match(Set newval (CompareAndExchangeP mem_ptr (Binary oldval newval)));
|
||||
effect( USE mem_ptr );
|
||||
|
||||
format %{
|
||||
"CASXA [$mem_ptr],$oldval,$newval\t! If $oldval==[$mem_ptr] Then store $newval into [$mem_ptr] and set $newval=[$mem_ptr]\n\t"
|
||||
%}
|
||||
ins_encode( enc_casx_exch(mem_ptr, oldval, newval) );
|
||||
ins_pipe( long_memory_op );
|
||||
%}
|
||||
|
||||
instruct compareAndExchangeN(iRegP mem_ptr, iRegN oldval, iRegN newval)
|
||||
%{
|
||||
match(Set newval (CompareAndExchangeN mem_ptr (Binary oldval newval)));
|
||||
effect( USE mem_ptr );
|
||||
|
||||
format %{
|
||||
"CASA [$mem_ptr],$oldval,$newval\t! If $oldval==[$mem_ptr] Then store $newval into [$mem_ptr] and set $newval=[$mem_ptr]\n\t"
|
||||
%}
|
||||
ins_encode( enc_casi_exch(mem_ptr, oldval, newval) );
|
||||
ins_pipe( long_memory_op );
|
||||
%}
|
||||
|
||||
instruct xchgI( memory mem, iRegI newval) %{
|
||||
match(Set newval (GetAndSetI mem newval));
|
||||
format %{ "SWAP [$mem],$newval" %}
|
||||
|
@ -1487,6 +1487,11 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
__ set(_thread_in_Java, G3_scratch);
|
||||
__ st(G3_scratch, thread_state);
|
||||
|
||||
if (CheckJNICalls) {
|
||||
// clear_pending_jni_exception_check
|
||||
__ st_ptr(G0, G2_thread, JavaThread::pending_jni_exception_check_fn_offset());
|
||||
}
|
||||
|
||||
// reset handle block
|
||||
__ ld_ptr(G2_thread, JavaThread::active_handles_offset(), G3_scratch);
|
||||
__ st(G0, G3_scratch, JNIHandleBlock::top_offset_in_bytes());
|
||||
|
@ -611,7 +611,8 @@ void InterpreterMacroAssembler::pop_l(Register r) {
|
||||
|
||||
void InterpreterMacroAssembler::push_l(Register r) {
|
||||
subptr(rsp, 2 * wordSize);
|
||||
movq(Address(rsp, 0), r);
|
||||
movptr(Address(rsp, Interpreter::expr_offset_in_bytes(0)), r );
|
||||
movptr(Address(rsp, Interpreter::expr_offset_in_bytes(1)), NULL_WORD );
|
||||
}
|
||||
|
||||
void InterpreterMacroAssembler::pop(TosState state) {
|
||||
|
@ -8131,8 +8131,7 @@ void MacroAssembler::has_negatives(Register ary1, Register len,
|
||||
jmp(FALSE_LABEL);
|
||||
|
||||
clear_vector_masking(); // closing of the stub context for programming mask registers
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
movl(result, len); // copy
|
||||
|
||||
if (UseAVX == 2 && UseSSE >= 2) {
|
||||
@ -8169,8 +8168,7 @@ void MacroAssembler::has_negatives(Register ary1, Register len,
|
||||
bind(COMPARE_TAIL); // len is zero
|
||||
movl(len, result);
|
||||
// Fallthru to tail compare
|
||||
}
|
||||
else if (UseSSE42Intrinsics) {
|
||||
} else if (UseSSE42Intrinsics) {
|
||||
// With SSE4.2, use double quad vector compare
|
||||
Label COMPARE_WIDE_VECTORS, COMPARE_TAIL;
|
||||
|
||||
@ -10748,7 +10746,10 @@ void MacroAssembler::char_array_compress(Register src, Register dst, Register le
|
||||
// save length for return
|
||||
push(len);
|
||||
|
||||
// 8165287: EVEX version disabled for now, needs to be refactored as
|
||||
// it is returning incorrect results.
|
||||
if ((UseAVX > 2) && // AVX512
|
||||
0 &&
|
||||
VM_Version::supports_avx512vlbw() &&
|
||||
VM_Version::supports_bmi2()) {
|
||||
|
||||
@ -11067,10 +11068,11 @@ void MacroAssembler::byte_array_inflate(Register src, Register dst, Register len
|
||||
|
||||
bind(below_threshold);
|
||||
bind(copy_new_tail);
|
||||
if (UseAVX > 2) {
|
||||
if ((UseAVX > 2) &&
|
||||
VM_Version::supports_avx512vlbw() &&
|
||||
VM_Version::supports_bmi2()) {
|
||||
movl(tmp2, len);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
movl(len, tmp2);
|
||||
}
|
||||
andl(tmp2, 0x00000007);
|
||||
|
@ -2236,6 +2236,11 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
__ verify_oop(rax);
|
||||
}
|
||||
|
||||
if (CheckJNICalls) {
|
||||
// clear_pending_jni_exception_check
|
||||
__ movptr(Address(thread, JavaThread::pending_jni_exception_check_fn_offset()), NULL_WORD);
|
||||
}
|
||||
|
||||
if (!is_critical_native) {
|
||||
// reset handle block
|
||||
__ movptr(rcx, Address(thread, JavaThread::active_handles_offset()));
|
||||
|
@ -2589,6 +2589,11 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
__ verify_oop(rax);
|
||||
}
|
||||
|
||||
if (CheckJNICalls) {
|
||||
// clear_pending_jni_exception_check
|
||||
__ movptr(Address(r15_thread, JavaThread::pending_jni_exception_check_fn_offset()), NULL_WORD);
|
||||
}
|
||||
|
||||
if (!is_critical_native) {
|
||||
// reset handle block
|
||||
__ movptr(rcx, Address(r15_thread, JavaThread::active_handles_offset()));
|
||||
|
@ -1169,6 +1169,11 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
// reset_last_Java_frame
|
||||
__ reset_last_Java_frame(thread, true);
|
||||
|
||||
if (CheckJNICalls) {
|
||||
// clear_pending_jni_exception_check
|
||||
__ movptr(Address(thread, JavaThread::pending_jni_exception_check_fn_offset()), NULL_WORD);
|
||||
}
|
||||
|
||||
// reset handle block
|
||||
__ movptr(t, Address(thread, JavaThread::active_handles_offset()));
|
||||
__ movl(Address(t, JNIHandleBlock::top_offset_in_bytes()), (int32_t)NULL_WORD);
|
||||
|
@ -65,4 +65,7 @@ public class GrowableArray<T> extends GenericGrowableArray {
|
||||
super(addr);
|
||||
virtualConstructor = v;
|
||||
}
|
||||
public Address getData() {
|
||||
return dataField.getValue(getAddress());
|
||||
}
|
||||
}
|
||||
|
@ -366,8 +366,8 @@ final class CompilerToVM {
|
||||
* {@code exactReceiver}.
|
||||
*
|
||||
* @param caller the caller or context type used to perform access checks
|
||||
* @return the link-time resolved method (might be abstract) or {@code 0} if it can not be
|
||||
* linked
|
||||
* @return the link-time resolved method (might be abstract) or {@code null} if it is either a
|
||||
* signature polymorphic method or can not be linked.
|
||||
*/
|
||||
native HotSpotResolvedJavaMethodImpl resolveMethod(HotSpotResolvedObjectTypeImpl exactReceiver, HotSpotResolvedJavaMethodImpl method, HotSpotResolvedObjectTypeImpl caller);
|
||||
|
||||
|
@ -722,7 +722,7 @@ final class HotSpotConstantPool implements ConstantPool, MetaspaceWrapperObject
|
||||
/**
|
||||
* Determines if {@code type} contains signature polymorphic methods.
|
||||
*/
|
||||
private static boolean isSignaturePolymorphicHolder(final HotSpotResolvedObjectTypeImpl type) {
|
||||
static boolean isSignaturePolymorphicHolder(final ResolvedJavaType type) {
|
||||
String name = type.getName();
|
||||
if (signaturePolymorphicHolders == null) {
|
||||
signaturePolymorphicHolders = compilerToVM().getSignaturePolymorphicHolders();
|
||||
|
@ -24,6 +24,7 @@ package jdk.vm.ci.hotspot;
|
||||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM;
|
||||
import static jdk.vm.ci.hotspot.HotSpotConstantPool.isSignaturePolymorphicHolder;
|
||||
import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
|
||||
import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
|
||||
import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
|
||||
@ -426,7 +427,7 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem
|
||||
// Methods can only be resolved against concrete types
|
||||
return null;
|
||||
}
|
||||
if (method.isConcrete() && method.getDeclaringClass().equals(this) && method.isPublic()) {
|
||||
if (method.isConcrete() && method.getDeclaringClass().equals(this) && method.isPublic() && !isSignaturePolymorphicHolder(method.getDeclaringClass())) {
|
||||
return method;
|
||||
}
|
||||
if (!method.getDeclaringClass().isAssignableFrom(this)) {
|
||||
|
@ -209,8 +209,8 @@ public interface ResolvedJavaType extends JavaType, ModifiersProvider, Annotated
|
||||
*
|
||||
* @param method the method to select the implementation of
|
||||
* @param callerType the caller or context type used to perform access checks
|
||||
* @return the method that would be selected at runtime (might be abstract) or {@code null} if
|
||||
* it can not be resolved
|
||||
* @return the link-time resolved method (might be abstract) or {@code null} if it is either a
|
||||
* signature polymorphic method or can not be linked.
|
||||
*/
|
||||
ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method, ResolvedJavaType callerType);
|
||||
|
||||
|
@ -847,7 +847,8 @@ static void *thread_native_entry(Thread *thread) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) {
|
||||
bool os::create_thread(Thread* thread, ThreadType thr_type,
|
||||
size_t req_stack_size) {
|
||||
|
||||
assert(thread->osthread() == NULL, "caller responsible");
|
||||
|
||||
@ -880,37 +881,12 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) {
|
||||
guarantee(pthread_attr_setsuspendstate_np(&attr, PTHREAD_CREATE_SUSPENDED_NP) == 0, "???");
|
||||
|
||||
// calculate stack size if it's not specified by caller
|
||||
if (stack_size == 0) {
|
||||
stack_size = os::Aix::default_stack_size(thr_type);
|
||||
|
||||
switch (thr_type) {
|
||||
case os::java_thread:
|
||||
// Java threads use ThreadStackSize whose default value can be changed with the flag -Xss.
|
||||
assert(JavaThread::stack_size_at_create() > 0, "this should be set");
|
||||
stack_size = JavaThread::stack_size_at_create();
|
||||
break;
|
||||
case os::compiler_thread:
|
||||
if (CompilerThreadStackSize > 0) {
|
||||
stack_size = (size_t)(CompilerThreadStackSize * K);
|
||||
break;
|
||||
} // else fall through:
|
||||
// use VMThreadStackSize if CompilerThreadStackSize is not defined
|
||||
case os::vm_thread:
|
||||
case os::pgc_thread:
|
||||
case os::cgc_thread:
|
||||
case os::watcher_thread:
|
||||
if (VMThreadStackSize > 0) stack_size = (size_t)(VMThreadStackSize * K);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
stack_size = MAX2(stack_size, os::Aix::min_stack_allowed);
|
||||
size_t stack_size = os::Posix::get_initial_stack_size(thr_type, req_stack_size);
|
||||
pthread_attr_setstacksize(&attr, stack_size);
|
||||
|
||||
pthread_t tid;
|
||||
int ret = pthread_create(&tid, &attr, (void* (*)(void*)) thread_native_entry, thread);
|
||||
|
||||
|
||||
char buf[64];
|
||||
if (ret == 0) {
|
||||
log_info(os, thread)("Thread started (pthread id: " UINTX_FORMAT ", attributes: %s). ",
|
||||
@ -3593,32 +3569,11 @@ jint os::init_2(void) {
|
||||
Aix::signal_sets_init();
|
||||
Aix::install_signal_handlers();
|
||||
|
||||
// Check minimum allowable stack size for thread creation and to initialize
|
||||
// the java system classes, including StackOverflowError - depends on page
|
||||
// size. Add two 4K pages for compiler2 recursion in main thread.
|
||||
// Add in 4*BytesPerWord 4K pages to account for VM stack during
|
||||
// class initialization depending on 32 or 64 bit VM.
|
||||
os::Aix::min_stack_allowed = MAX2(os::Aix::min_stack_allowed,
|
||||
JavaThread::stack_guard_zone_size() +
|
||||
JavaThread::stack_shadow_zone_size() +
|
||||
(4*BytesPerWord COMPILER2_PRESENT(+2)) * 4 * K);
|
||||
|
||||
os::Aix::min_stack_allowed = align_size_up(os::Aix::min_stack_allowed, os::vm_page_size());
|
||||
|
||||
size_t threadStackSizeInBytes = ThreadStackSize * K;
|
||||
if (threadStackSizeInBytes != 0 &&
|
||||
threadStackSizeInBytes < os::Aix::min_stack_allowed) {
|
||||
tty->print_cr("\nThe stack size specified is too small, "
|
||||
"Specify at least %dk",
|
||||
os::Aix::min_stack_allowed / K);
|
||||
// Check and sets minimum stack sizes against command line options
|
||||
if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
|
||||
return JNI_ERR;
|
||||
}
|
||||
|
||||
// Make the stack size a multiple of the page size so that
|
||||
// the yellow/red zones can be guarded.
|
||||
// Note that this can be 0, if no default stacksize was set.
|
||||
JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes, vm_page_size()));
|
||||
|
||||
if (UseNUMA) {
|
||||
UseNUMA = false;
|
||||
warning("NUMA optimizations are not available on this OS.");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2016 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -140,14 +140,6 @@ class Aix {
|
||||
// libpthread version string
|
||||
static void libpthread_init();
|
||||
|
||||
// Minimum stack size a thread can be created with (allowing
|
||||
// the VM to completely create the thread and enter user code)
|
||||
static size_t min_stack_allowed;
|
||||
|
||||
// Return default stack size or guard size for the specified thread type
|
||||
static size_t default_stack_size(os::ThreadType thr_type);
|
||||
static size_t default_guard_size(os::ThreadType thr_type);
|
||||
|
||||
// Function returns true if we run on OS/400 (pase), false if we run
|
||||
// on AIX.
|
||||
static bool on_pase() {
|
||||
|
@ -734,7 +734,8 @@ static void *thread_native_entry(Thread *thread) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) {
|
||||
bool os::create_thread(Thread* thread, ThreadType thr_type,
|
||||
size_t req_stack_size) {
|
||||
assert(thread->osthread() == NULL, "caller responsible");
|
||||
|
||||
// Allocate the OSThread object
|
||||
@ -757,32 +758,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) {
|
||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||
|
||||
// calculate stack size if it's not specified by caller
|
||||
if (stack_size == 0) {
|
||||
stack_size = os::Bsd::default_stack_size(thr_type);
|
||||
|
||||
switch (thr_type) {
|
||||
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");
|
||||
stack_size = JavaThread::stack_size_at_create();
|
||||
break;
|
||||
case os::compiler_thread:
|
||||
if (CompilerThreadStackSize > 0) {
|
||||
stack_size = (size_t)(CompilerThreadStackSize * K);
|
||||
break;
|
||||
} // else fall through:
|
||||
// use VMThreadStackSize if CompilerThreadStackSize is not defined
|
||||
case os::vm_thread:
|
||||
case os::pgc_thread:
|
||||
case os::cgc_thread:
|
||||
case os::watcher_thread:
|
||||
if (VMThreadStackSize > 0) stack_size = (size_t)(VMThreadStackSize * K);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
stack_size = MAX2(stack_size, os::Bsd::min_stack_allowed);
|
||||
size_t stack_size = os::Posix::get_initial_stack_size(thr_type, req_stack_size);
|
||||
pthread_attr_setstacksize(&attr, stack_size);
|
||||
|
||||
ThreadState state;
|
||||
@ -3502,32 +3478,11 @@ jint os::init_2(void) {
|
||||
Bsd::signal_sets_init();
|
||||
Bsd::install_signal_handlers();
|
||||
|
||||
// Check minimum allowable stack size for thread creation and to initialize
|
||||
// the java system classes, including StackOverflowError - depends on page
|
||||
// size. Add two 4K pages for compiler2 recursion in main thread.
|
||||
// Add in 4*BytesPerWord 4K pages to account for VM stack during
|
||||
// class initialization depending on 32 or 64 bit VM.
|
||||
os::Bsd::min_stack_allowed = MAX2(os::Bsd::min_stack_allowed,
|
||||
JavaThread::stack_guard_zone_size() +
|
||||
JavaThread::stack_shadow_zone_size() +
|
||||
(4*BytesPerWord COMPILER2_PRESENT(+2)) * 4 * K);
|
||||
|
||||
os::Bsd::min_stack_allowed = align_size_up(os::Bsd::min_stack_allowed, os::vm_page_size());
|
||||
|
||||
size_t threadStackSizeInBytes = ThreadStackSize * K;
|
||||
if (threadStackSizeInBytes != 0 &&
|
||||
threadStackSizeInBytes < os::Bsd::min_stack_allowed) {
|
||||
tty->print_cr("\nThe stack size specified is too small, "
|
||||
"Specify at least %dk",
|
||||
os::Bsd::min_stack_allowed/ K);
|
||||
// Check and sets minimum stack sizes against command line options
|
||||
if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
|
||||
return JNI_ERR;
|
||||
}
|
||||
|
||||
// Make the stack size a multiple of the page size so that
|
||||
// the yellow/red zones can be guarded.
|
||||
JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes,
|
||||
vm_page_size()));
|
||||
|
||||
if (MaxFDLimit) {
|
||||
// set the number of file descriptors to max. print out error
|
||||
// if getrlimit/setrlimit fails but continue regardless.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -120,14 +120,6 @@ class Bsd {
|
||||
static struct sigaction *get_chained_signal_action(int sig);
|
||||
static bool chained_handler(int sig, siginfo_t* siginfo, void* context);
|
||||
|
||||
// Minimum stack size a thread can be created with (allowing
|
||||
// the VM to completely create the thread and enter user code)
|
||||
static size_t min_stack_allowed;
|
||||
|
||||
// Return default stack size or guard size for the specified thread type
|
||||
static size_t default_stack_size(os::ThreadType thr_type);
|
||||
static size_t default_guard_size(os::ThreadType thr_type);
|
||||
|
||||
// Real-time clock functions
|
||||
static void clock_init(void);
|
||||
|
||||
|
@ -701,7 +701,7 @@ static void *thread_native_entry(Thread *thread) {
|
||||
}
|
||||
|
||||
bool os::create_thread(Thread* thread, ThreadType thr_type,
|
||||
size_t stack_size) {
|
||||
size_t req_stack_size) {
|
||||
assert(thread->osthread() == NULL, "caller responsible");
|
||||
|
||||
// Allocate the OSThread object
|
||||
@ -723,34 +723,8 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
|
||||
pthread_attr_init(&attr);
|
||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||
|
||||
// stack size
|
||||
// calculate stack size if it's not specified by caller
|
||||
if (stack_size == 0) {
|
||||
stack_size = os::Linux::default_stack_size(thr_type);
|
||||
|
||||
switch (thr_type) {
|
||||
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");
|
||||
stack_size = JavaThread::stack_size_at_create();
|
||||
break;
|
||||
case os::compiler_thread:
|
||||
if (CompilerThreadStackSize > 0) {
|
||||
stack_size = (size_t)(CompilerThreadStackSize * K);
|
||||
break;
|
||||
} // else fall through:
|
||||
// use VMThreadStackSize if CompilerThreadStackSize is not defined
|
||||
case os::vm_thread:
|
||||
case os::pgc_thread:
|
||||
case os::cgc_thread:
|
||||
case os::watcher_thread:
|
||||
if (VMThreadStackSize > 0) stack_size = (size_t)(VMThreadStackSize * K);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
stack_size = MAX2(stack_size, os::Linux::min_stack_allowed);
|
||||
size_t stack_size = os::Posix::get_initial_stack_size(thr_type, req_stack_size);
|
||||
pthread_attr_setstacksize(&attr, stack_size);
|
||||
|
||||
// glibc guard page
|
||||
@ -956,10 +930,9 @@ static bool find_vma(address addr, address* vma_low, address* vma_high) {
|
||||
// bogus value for initial thread.
|
||||
void os::Linux::capture_initial_stack(size_t max_size) {
|
||||
// stack size is the easy part, get it from RLIMIT_STACK
|
||||
size_t stack_size;
|
||||
struct rlimit rlim;
|
||||
getrlimit(RLIMIT_STACK, &rlim);
|
||||
stack_size = rlim.rlim_cur;
|
||||
size_t stack_size = rlim.rlim_cur;
|
||||
|
||||
// 6308388: a bug in ld.so will relocate its own .data section to the
|
||||
// lower end of primordial stack; reduce ulimit -s value a little bit
|
||||
@ -4793,32 +4766,10 @@ jint os::init_2(void) {
|
||||
Linux::signal_sets_init();
|
||||
Linux::install_signal_handlers();
|
||||
|
||||
// Check minimum allowable stack size for thread creation and to initialize
|
||||
// the java system classes, including StackOverflowError - depends on page
|
||||
// size. Add two 4K pages for compiler2 recursion in main thread.
|
||||
// Add in 4*BytesPerWord 4K pages to account for VM stack during
|
||||
// class initialization depending on 32 or 64 bit VM.
|
||||
os::Linux::min_stack_allowed = MAX2(os::Linux::min_stack_allowed,
|
||||
JavaThread::stack_guard_zone_size() +
|
||||
JavaThread::stack_shadow_zone_size() +
|
||||
(4*BytesPerWord COMPILER2_PRESENT(+2)) * 4 * K);
|
||||
|
||||
os::Linux::min_stack_allowed = align_size_up(os::Linux::min_stack_allowed, os::vm_page_size());
|
||||
|
||||
size_t threadStackSizeInBytes = ThreadStackSize * K;
|
||||
if (threadStackSizeInBytes != 0 &&
|
||||
threadStackSizeInBytes < os::Linux::min_stack_allowed) {
|
||||
tty->print_cr("\nThe stack size specified is too small, "
|
||||
"Specify at least " SIZE_FORMAT "k",
|
||||
os::Linux::min_stack_allowed/ K);
|
||||
// Check and sets minimum stack sizes against command line options
|
||||
if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
|
||||
return JNI_ERR;
|
||||
}
|
||||
|
||||
// Make the stack size a multiple of the page size so that
|
||||
// the yellow/red zones can be guarded.
|
||||
JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes,
|
||||
vm_page_size()));
|
||||
|
||||
Linux::capture_initial_stack(JavaThread::stack_size_at_create());
|
||||
|
||||
#if defined(IA32)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -170,12 +170,8 @@ class Linux {
|
||||
static void libpthread_init();
|
||||
static bool libnuma_init();
|
||||
static void* libnuma_dlsym(void* handle, const char* name);
|
||||
// Minimum stack size a thread can be created with (allowing
|
||||
// the VM to completely create the thread and enter user code)
|
||||
static size_t min_stack_allowed;
|
||||
|
||||
// Return default stack size or guard size for the specified thread type
|
||||
static size_t default_stack_size(os::ThreadType thr_type);
|
||||
// Return default guard size for the specified thread type
|
||||
static size_t default_guard_size(os::ThreadType thr_type);
|
||||
|
||||
static void capture_initial_stack(size_t max_size);
|
||||
|
@ -1099,6 +1099,123 @@ char* os::Posix::describe_pthread_attr(char* buf, size_t buflen, const pthread_a
|
||||
return buf;
|
||||
}
|
||||
|
||||
// Check minimum allowable stack sizes for thread creation and to initialize
|
||||
// the java system classes, including StackOverflowError - depends on page
|
||||
// size. Add two 4K pages for compiler2 recursion in main thread.
|
||||
// Add in 4*BytesPerWord 4K pages to account for VM stack during
|
||||
// class initialization depending on 32 or 64 bit VM.
|
||||
jint os::Posix::set_minimum_stack_sizes() {
|
||||
_java_thread_min_stack_allowed = MAX2(_java_thread_min_stack_allowed,
|
||||
JavaThread::stack_guard_zone_size() +
|
||||
JavaThread::stack_shadow_zone_size() +
|
||||
(4 * BytesPerWord COMPILER2_PRESENT(+ 2)) * 4 * K);
|
||||
|
||||
_java_thread_min_stack_allowed = align_size_up(_java_thread_min_stack_allowed, vm_page_size());
|
||||
|
||||
size_t stack_size_in_bytes = ThreadStackSize * K;
|
||||
if (stack_size_in_bytes != 0 &&
|
||||
stack_size_in_bytes < _java_thread_min_stack_allowed) {
|
||||
// The '-Xss' and '-XX:ThreadStackSize=N' options both set
|
||||
// ThreadStackSize so we go with "Java thread stack size" instead
|
||||
// of "ThreadStackSize" to be more friendly.
|
||||
tty->print_cr("\nThe Java thread stack size specified is too small. "
|
||||
"Specify at least " SIZE_FORMAT "k",
|
||||
_java_thread_min_stack_allowed / K);
|
||||
return JNI_ERR;
|
||||
}
|
||||
|
||||
#ifdef SOLARIS
|
||||
// For 64kbps there will be a 64kb page size, which makes
|
||||
// the usable default stack size quite a bit less. Increase the
|
||||
// stack for 64kb (or any > than 8kb) pages, this increases
|
||||
// virtual memory fragmentation (since we're not creating the
|
||||
// stack on a power of 2 boundary. The real fix for this
|
||||
// should be to fix the guard page mechanism.
|
||||
|
||||
if (vm_page_size() > 8*K) {
|
||||
stack_size_in_bytes = (stack_size_in_bytes != 0)
|
||||
? stack_size_in_bytes +
|
||||
JavaThread::stack_red_zone_size() +
|
||||
JavaThread::stack_yellow_zone_size()
|
||||
: 0;
|
||||
ThreadStackSize = stack_size_in_bytes/K;
|
||||
}
|
||||
#endif // SOLARIS
|
||||
|
||||
// Make the stack size a multiple of the page size so that
|
||||
// the yellow/red zones can be guarded.
|
||||
JavaThread::set_stack_size_at_create(round_to(stack_size_in_bytes,
|
||||
vm_page_size()));
|
||||
|
||||
_compiler_thread_min_stack_allowed = align_size_up(_compiler_thread_min_stack_allowed, vm_page_size());
|
||||
|
||||
stack_size_in_bytes = CompilerThreadStackSize * K;
|
||||
if (stack_size_in_bytes != 0 &&
|
||||
stack_size_in_bytes < _compiler_thread_min_stack_allowed) {
|
||||
tty->print_cr("\nThe CompilerThreadStackSize specified is too small. "
|
||||
"Specify at least " SIZE_FORMAT "k",
|
||||
_compiler_thread_min_stack_allowed / K);
|
||||
return JNI_ERR;
|
||||
}
|
||||
|
||||
_vm_internal_thread_min_stack_allowed = align_size_up(_vm_internal_thread_min_stack_allowed, vm_page_size());
|
||||
|
||||
stack_size_in_bytes = VMThreadStackSize * K;
|
||||
if (stack_size_in_bytes != 0 &&
|
||||
stack_size_in_bytes < _vm_internal_thread_min_stack_allowed) {
|
||||
tty->print_cr("\nThe VMThreadStackSize specified is too small. "
|
||||
"Specify at least " SIZE_FORMAT "k",
|
||||
_vm_internal_thread_min_stack_allowed / K);
|
||||
return JNI_ERR;
|
||||
}
|
||||
return JNI_OK;
|
||||
}
|
||||
|
||||
// Called when creating the thread. The minimum stack sizes have already been calculated
|
||||
size_t os::Posix::get_initial_stack_size(ThreadType thr_type, size_t req_stack_size) {
|
||||
size_t stack_size;
|
||||
if (req_stack_size == 0) {
|
||||
stack_size = default_stack_size(thr_type);
|
||||
} else {
|
||||
stack_size = req_stack_size;
|
||||
}
|
||||
|
||||
switch (thr_type) {
|
||||
case os::java_thread:
|
||||
// Java threads use ThreadStackSize which default value can be
|
||||
// changed with the flag -Xss
|
||||
if (req_stack_size == 0 && JavaThread::stack_size_at_create() > 0) {
|
||||
// no requested size and we have a more specific default value
|
||||
stack_size = JavaThread::stack_size_at_create();
|
||||
}
|
||||
stack_size = MAX2(stack_size,
|
||||
_java_thread_min_stack_allowed);
|
||||
break;
|
||||
case os::compiler_thread:
|
||||
if (req_stack_size == 0 && CompilerThreadStackSize > 0) {
|
||||
// no requested size and we have a more specific default value
|
||||
stack_size = (size_t)(CompilerThreadStackSize * K);
|
||||
}
|
||||
stack_size = MAX2(stack_size,
|
||||
_compiler_thread_min_stack_allowed);
|
||||
break;
|
||||
case os::vm_thread:
|
||||
case os::pgc_thread:
|
||||
case os::cgc_thread:
|
||||
case os::watcher_thread:
|
||||
default: // presume the unknown thr_type is a VM internal
|
||||
if (req_stack_size == 0 && VMThreadStackSize > 0) {
|
||||
// no requested size and we have a more specific default value
|
||||
stack_size = (size_t)(VMThreadStackSize * K);
|
||||
}
|
||||
|
||||
stack_size = MAX2(stack_size,
|
||||
_vm_internal_thread_min_stack_allowed);
|
||||
break;
|
||||
}
|
||||
|
||||
return stack_size;
|
||||
}
|
||||
|
||||
os::WatcherThreadCrashProtection::WatcherThreadCrashProtection() {
|
||||
assert(Thread::current()->is_Watcher_thread(), "Must be WatcherThread");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -42,7 +42,18 @@ protected:
|
||||
static void print_libversion_info(outputStream* st);
|
||||
static void print_load_average(outputStream* st);
|
||||
|
||||
// Minimum stack size a thread can be created with (allowing
|
||||
// the VM to completely create the thread and enter user code)
|
||||
static size_t _compiler_thread_min_stack_allowed;
|
||||
static size_t _java_thread_min_stack_allowed;
|
||||
static size_t _vm_internal_thread_min_stack_allowed;
|
||||
|
||||
public:
|
||||
// Return default stack size for the specified thread type
|
||||
static size_t default_stack_size(os::ThreadType thr_type);
|
||||
// Check and sets minimum stack sizes
|
||||
static jint set_minimum_stack_sizes();
|
||||
static size_t get_initial_stack_size(ThreadType thr_type, size_t req_stack_size);
|
||||
|
||||
// Returns true if signal is valid.
|
||||
static bool is_valid_signal(int sig);
|
||||
|
@ -917,8 +917,15 @@ static char* describe_thr_create_attributes(char* buf, size_t buflen,
|
||||
return buf;
|
||||
}
|
||||
|
||||
// return default stack size for thr_type
|
||||
size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
|
||||
// default stack size when not specified by caller is 1M (2M for LP64)
|
||||
size_t s = (BytesPerWord >> 2) * K * K;
|
||||
return s;
|
||||
}
|
||||
|
||||
bool os::create_thread(Thread* thread, ThreadType thr_type,
|
||||
size_t stack_size) {
|
||||
size_t req_stack_size) {
|
||||
// Allocate the OSThread object
|
||||
OSThread* osthread = new OSThread(NULL, NULL);
|
||||
if (osthread == NULL) {
|
||||
@ -953,31 +960,8 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
|
||||
tty->print_cr("In create_thread, creating a %s thread\n", thrtyp);
|
||||
}
|
||||
|
||||
// Calculate stack size if it's not specified by caller.
|
||||
if (stack_size == 0) {
|
||||
// The default stack size 1M (2M for LP64).
|
||||
stack_size = (BytesPerWord >> 2) * K * K;
|
||||
|
||||
switch (thr_type) {
|
||||
case os::java_thread:
|
||||
// Java threads use ThreadStackSize which default value can be changed with the flag -Xss
|
||||
if (JavaThread::stack_size_at_create() > 0) stack_size = JavaThread::stack_size_at_create();
|
||||
break;
|
||||
case os::compiler_thread:
|
||||
if (CompilerThreadStackSize > 0) {
|
||||
stack_size = (size_t)(CompilerThreadStackSize * K);
|
||||
break;
|
||||
} // else fall through:
|
||||
// use VMThreadStackSize if CompilerThreadStackSize is not defined
|
||||
case os::vm_thread:
|
||||
case os::pgc_thread:
|
||||
case os::cgc_thread:
|
||||
case os::watcher_thread:
|
||||
if (VMThreadStackSize > 0) stack_size = (size_t)(VMThreadStackSize * K);
|
||||
break;
|
||||
}
|
||||
}
|
||||
stack_size = MAX2(stack_size, os::Solaris::min_stack_allowed);
|
||||
// calculate stack size if it's not specified by caller
|
||||
size_t stack_size = os::Posix::get_initial_stack_size(thr_type, req_stack_size);
|
||||
|
||||
// Initial state is ALLOCATED but not INITIALIZED
|
||||
osthread->set_state(ALLOCATED);
|
||||
@ -4400,7 +4384,12 @@ void os::init(void) {
|
||||
// Constant minimum stack size allowed. It must be at least
|
||||
// the minimum of what the OS supports (thr_min_stack()), and
|
||||
// enough to allow the thread to get to user bytecode execution.
|
||||
Solaris::min_stack_allowed = MAX2(thr_min_stack(), Solaris::min_stack_allowed);
|
||||
Posix::_compiler_thread_min_stack_allowed = MAX2(thr_min_stack(),
|
||||
Posix::_compiler_thread_min_stack_allowed);
|
||||
Posix::_java_thread_min_stack_allowed = MAX2(thr_min_stack(),
|
||||
Posix::_java_thread_min_stack_allowed);
|
||||
Posix::_vm_internal_thread_min_stack_allowed = MAX2(thr_min_stack(),
|
||||
Posix::_vm_internal_thread_min_stack_allowed);
|
||||
|
||||
// dynamic lookup of functions that may not be available in our lowest
|
||||
// supported Solaris release
|
||||
@ -4445,47 +4434,11 @@ jint os::init_2(void) {
|
||||
log_info(os)("Memory Serialize Page address: " INTPTR_FORMAT, p2i(mem_serialize_page));
|
||||
}
|
||||
|
||||
// Check minimum allowable stack size for thread creation and to initialize
|
||||
// the java system classes, including StackOverflowError - depends on page
|
||||
// size. Add two 4K pages for compiler2 recursion in main thread.
|
||||
// Add in 4*BytesPerWord 4K pages to account for VM stack during
|
||||
// class initialization depending on 32 or 64 bit VM.
|
||||
os::Solaris::min_stack_allowed = MAX2(os::Solaris::min_stack_allowed,
|
||||
JavaThread::stack_guard_zone_size() +
|
||||
JavaThread::stack_shadow_zone_size() +
|
||||
(4*BytesPerWord COMPILER2_PRESENT(+2)) * 4 * K);
|
||||
|
||||
os::Solaris::min_stack_allowed = align_size_up(os::Solaris::min_stack_allowed, os::vm_page_size());
|
||||
|
||||
size_t threadStackSizeInBytes = ThreadStackSize * K;
|
||||
if (threadStackSizeInBytes != 0 &&
|
||||
threadStackSizeInBytes < os::Solaris::min_stack_allowed) {
|
||||
tty->print_cr("\nThe stack size specified is too small, Specify at least %dk",
|
||||
os::Solaris::min_stack_allowed/K);
|
||||
// Check and sets minimum stack sizes against command line options
|
||||
if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
|
||||
return JNI_ERR;
|
||||
}
|
||||
|
||||
// For 64kbps there will be a 64kb page size, which makes
|
||||
// the usable default stack size quite a bit less. Increase the
|
||||
// stack for 64kb (or any > than 8kb) pages, this increases
|
||||
// virtual memory fragmentation (since we're not creating the
|
||||
// stack on a power of 2 boundary. The real fix for this
|
||||
// should be to fix the guard page mechanism.
|
||||
|
||||
if (vm_page_size() > 8*K) {
|
||||
threadStackSizeInBytes = (threadStackSizeInBytes != 0)
|
||||
? threadStackSizeInBytes +
|
||||
JavaThread::stack_red_zone_size() +
|
||||
JavaThread::stack_yellow_zone_size()
|
||||
: 0;
|
||||
ThreadStackSize = threadStackSizeInBytes/K;
|
||||
}
|
||||
|
||||
// Make the stack size a multiple of the page size so that
|
||||
// the yellow/red zones can be guarded.
|
||||
JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes,
|
||||
vm_page_size()));
|
||||
|
||||
Solaris::libthread_init();
|
||||
|
||||
if (UseNUMA) {
|
||||
|
@ -292,10 +292,6 @@ class Solaris {
|
||||
static jint _os_thread_limit;
|
||||
static volatile jint _os_thread_count;
|
||||
|
||||
// Minimum stack size a thread can be created with (allowing
|
||||
// the VM to completely create the thread and enter user code)
|
||||
|
||||
static size_t min_stack_allowed;
|
||||
|
||||
// Stack overflow handling
|
||||
|
||||
|
@ -4215,7 +4215,7 @@ jint os::init_2(void) {
|
||||
min_stack_allowed = align_size_up(min_stack_allowed, os::vm_page_size());
|
||||
|
||||
if (actual_reserve_size < min_stack_allowed) {
|
||||
tty->print_cr("\nThe stack size specified is too small, "
|
||||
tty->print_cr("\nThe Java thread stack size specified is too small. "
|
||||
"Specify at least %dk",
|
||||
min_stack_allowed / K);
|
||||
return JNI_ERR;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -33,10 +33,6 @@ define_pd_global(bool, DontYieldALot, false);
|
||||
define_pd_global(intx, ThreadStackSize, 2048); // 0 => use system default
|
||||
define_pd_global(intx, VMThreadStackSize, 2048);
|
||||
|
||||
// if we set CompilerThreadStackSize to a value different than 0, it will
|
||||
// be used in os::create_thread(). Otherwise, due the strange logic in os::create_thread(),
|
||||
// the stack size for compiler threads will default to VMThreadStackSize, although it
|
||||
// is defined to 4M in os::Aix::default_stack_size()!
|
||||
define_pd_global(intx, CompilerThreadStackSize, 4096);
|
||||
|
||||
// Allow extra space in DEBUG builds for asserts.
|
||||
|
@ -192,8 +192,10 @@ frame os::current_frame() {
|
||||
intptr_t* csp = (intptr_t*) *((intptr_t*) os::current_stack_pointer());
|
||||
// hack.
|
||||
frame topframe(csp, (address)0x8);
|
||||
// return sender of current topframe which hopefully has pc != NULL.
|
||||
return os::get_sender_for_C_frame(&topframe);
|
||||
// Return sender of sender of current topframe which hopefully
|
||||
// both have pc != NULL.
|
||||
frame tmp = os::get_sender_for_C_frame(&topframe);
|
||||
return os::get_sender_for_C_frame(&tmp);
|
||||
}
|
||||
|
||||
// Utility functions
|
||||
@ -533,23 +535,17 @@ void os::Aix::init_thread_fpu_state(void) {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// thread stack
|
||||
|
||||
size_t os::Aix::min_stack_allowed = 128*K;
|
||||
size_t os::Posix::_compiler_thread_min_stack_allowed = 128 * K;
|
||||
size_t os::Posix::_java_thread_min_stack_allowed = 128 * K;
|
||||
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 128 * K;
|
||||
|
||||
// return default stack size for thr_type
|
||||
size_t os::Aix::default_stack_size(os::ThreadType thr_type) {
|
||||
size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
|
||||
// default stack size (compiler thread needs larger stack)
|
||||
// Notice that the setting for compiler threads here have no impact
|
||||
// because of the strange 'fallback logic' in os::create_thread().
|
||||
// Better set CompilerThreadStackSize in globals_<os_cpu>.hpp if you want to
|
||||
// specify a different stack size for compiler threads!
|
||||
size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
|
||||
return s;
|
||||
}
|
||||
|
||||
size_t os::Aix::default_guard_size(os::ThreadType thr_type) {
|
||||
return 2 * page_size();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// helper functions for fatal error handler
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -31,9 +31,11 @@
|
||||
//
|
||||
define_pd_global(bool, DontYieldALot, false);
|
||||
#ifdef AMD64
|
||||
define_pd_global(intx, CompilerThreadStackSize, 1024);
|
||||
define_pd_global(intx, ThreadStackSize, 1024); // 0 => use system default
|
||||
define_pd_global(intx, VMThreadStackSize, 1024);
|
||||
#else
|
||||
define_pd_global(intx, CompilerThreadStackSize, 512);
|
||||
// ThreadStackSize 320 allows a couple of test cases to run while
|
||||
// keeping the number of threads that can be created high. System
|
||||
// default ThreadStackSize appears to be 512 which is too big.
|
||||
@ -41,7 +43,6 @@ define_pd_global(intx, ThreadStackSize, 320);
|
||||
define_pd_global(intx, VMThreadStackSize, 512);
|
||||
#endif // AMD64
|
||||
|
||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||
|
||||
define_pd_global(size_t, JVMInvokeMethodSlack, 8192);
|
||||
|
||||
|
@ -838,9 +838,13 @@ bool os::is_allocatable(size_t bytes) {
|
||||
// thread stack
|
||||
|
||||
#ifdef AMD64
|
||||
size_t os::Bsd::min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_compiler_thread_min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_java_thread_min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * K;
|
||||
#else
|
||||
size_t os::Bsd::min_stack_allowed = (48 DEBUG_ONLY(+4))*K;
|
||||
size_t os::Posix::_compiler_thread_min_stack_allowed = (48 DEBUG_ONLY(+ 4)) * K;
|
||||
size_t os::Posix::_java_thread_min_stack_allowed = (48 DEBUG_ONLY(+ 4)) * K;
|
||||
size_t os::Posix::_vm_internal_thread_min_stack_allowed = (48 DEBUG_ONLY(+ 4)) * K;
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define GET_GS() ({int gs; __asm__ volatile("movw %%gs, %w0":"=q"(gs)); gs&0xffff;})
|
||||
@ -849,7 +853,7 @@ size_t os::Bsd::min_stack_allowed = (48 DEBUG_ONLY(+4))*K;
|
||||
#endif // AMD64
|
||||
|
||||
// return default stack size for thr_type
|
||||
size_t os::Bsd::default_stack_size(os::ThreadType thr_type) {
|
||||
size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
|
||||
// default stack size (compiler thread needs larger stack)
|
||||
#ifdef AMD64
|
||||
size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
|
||||
@ -859,11 +863,6 @@ size_t os::Bsd::default_stack_size(os::ThreadType thr_type) {
|
||||
return s;
|
||||
}
|
||||
|
||||
size_t os::Bsd::default_guard_size(os::ThreadType thr_type) {
|
||||
// Creating guard page is very expensive. Java thread has HotSpot
|
||||
// guard page, only enable glibc guard page for non-Java threads.
|
||||
return (thr_type == java_thread ? 0 : page_size());
|
||||
}
|
||||
|
||||
// Java thread:
|
||||
//
|
||||
|
@ -282,9 +282,11 @@ bool os::is_allocatable(size_t bytes) {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// thread stack
|
||||
|
||||
size_t os::Bsd::min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_compiler_thread_min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_java_thread_min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * K;
|
||||
|
||||
size_t os::Bsd::default_stack_size(os::ThreadType thr_type) {
|
||||
size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
|
||||
#ifdef _LP64
|
||||
size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
|
||||
#else
|
||||
@ -293,12 +295,6 @@ size_t os::Bsd::default_stack_size(os::ThreadType thr_type) {
|
||||
return s;
|
||||
}
|
||||
|
||||
size_t os::Bsd::default_guard_size(os::ThreadType thr_type) {
|
||||
// Only enable glibc guard pages for non-Java threads
|
||||
// (Java threads have HotSpot guard pages)
|
||||
return (thr_type == java_thread ? 0 : page_size());
|
||||
}
|
||||
|
||||
static void current_stack_region(address *bottom, size_t *size) {
|
||||
address stack_bottom;
|
||||
address stack_top;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -33,7 +33,7 @@ define_pd_global(bool, DontYieldALot, false);
|
||||
define_pd_global(intx, ThreadStackSize, 2048); // 0 => use system default
|
||||
define_pd_global(intx, VMThreadStackSize, 2048);
|
||||
|
||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||
define_pd_global(intx, CompilerThreadStackSize, 2048);
|
||||
|
||||
define_pd_global(uintx,JVMInvokeMethodSlack, 8192);
|
||||
|
||||
|
@ -473,10 +473,12 @@ bool os::is_allocatable(size_t bytes) {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// thread stack
|
||||
|
||||
size_t os::Linux::min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_compiler_thread_min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_java_thread_min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * K;
|
||||
|
||||
// return default stack size for thr_type
|
||||
size_t os::Linux::default_stack_size(os::ThreadType thr_type) {
|
||||
size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
|
||||
// default stack size (compiler thread needs larger stack)
|
||||
size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
|
||||
return s;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -33,10 +33,6 @@ define_pd_global(bool, DontYieldALot, false);
|
||||
define_pd_global(intx, ThreadStackSize, 2048); // 0 => use system default
|
||||
define_pd_global(intx, VMThreadStackSize, 2048);
|
||||
|
||||
// if we set CompilerThreadStackSize to a value different than 0, it will
|
||||
// be used in os::create_thread(). Otherwise, due the strange logic in os::create_thread(),
|
||||
// the stack size for compiler threads will default to VMThreadStackSize, although it
|
||||
// is defined to 4M in os::Linux::default_stack_size()!
|
||||
define_pd_global(intx, CompilerThreadStackSize, 4096);
|
||||
|
||||
// Allow extra space in DEBUG builds for asserts.
|
||||
|
@ -205,8 +205,10 @@ frame os::current_frame() {
|
||||
intptr_t* csp = (intptr_t*) *((intptr_t*) os::current_stack_pointer());
|
||||
// hack.
|
||||
frame topframe(csp, (address)0x8);
|
||||
// return sender of current topframe which hopefully has pc != NULL.
|
||||
return os::get_sender_for_C_frame(&topframe);
|
||||
// Return sender of sender of current topframe which hopefully
|
||||
// both have pc != NULL.
|
||||
frame tmp = os::get_sender_for_C_frame(&topframe);
|
||||
return os::get_sender_for_C_frame(&tmp);
|
||||
}
|
||||
|
||||
// Utility functions
|
||||
@ -533,15 +535,13 @@ void os::Linux::set_fpu_control_word(int fpu_control) {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// thread stack
|
||||
|
||||
size_t os::Linux::min_stack_allowed = 128*K;
|
||||
size_t os::Posix::_compiler_thread_min_stack_allowed = 128 * K;
|
||||
size_t os::Posix::_java_thread_min_stack_allowed = 128 * K;
|
||||
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 128 * K;
|
||||
|
||||
// return default stack size for thr_type
|
||||
size_t os::Linux::default_stack_size(os::ThreadType thr_type) {
|
||||
size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
|
||||
// default stack size (compiler thread needs larger stack)
|
||||
// Notice that the setting for compiler threads here have no impact
|
||||
// because of the strange 'fallback logic' in os::create_thread().
|
||||
// Better set CompilerThreadStackSize in globals_<os_cpu>.hpp if you want to
|
||||
// specify a different stack size for compiler threads!
|
||||
size_t s = (thr_type == os::compiler_thread ? 4 * M : 1024 * K);
|
||||
return s;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -31,7 +31,6 @@
|
||||
//
|
||||
|
||||
define_pd_global(size_t, JVMInvokeMethodSlack, 12288);
|
||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||
|
||||
// Used on 64 bit platforms for UseCompressedOops base address
|
||||
define_pd_global(size_t, HeapBaseMinAddress, CONST64(4)*G);
|
||||
|
@ -726,10 +726,12 @@ bool os::is_allocatable(size_t bytes) {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// thread stack
|
||||
|
||||
size_t os::Linux::min_stack_allowed = 128 * K;
|
||||
size_t os::Posix::_compiler_thread_min_stack_allowed = 128 * K;
|
||||
size_t os::Posix::_java_thread_min_stack_allowed = 128 * K;
|
||||
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 128 * K;
|
||||
|
||||
// return default stack size for thr_type
|
||||
size_t os::Linux::default_stack_size(os::ThreadType thr_type) {
|
||||
size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
|
||||
// default stack size (compiler thread needs larger stack)
|
||||
size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
|
||||
return s;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -30,9 +30,11 @@
|
||||
|
||||
define_pd_global(bool, DontYieldALot, false);
|
||||
#ifdef AMD64
|
||||
define_pd_global(intx, CompilerThreadStackSize, 1024);
|
||||
define_pd_global(intx, ThreadStackSize, 1024); // 0 => use system default
|
||||
define_pd_global(intx, VMThreadStackSize, 1024);
|
||||
#else
|
||||
define_pd_global(intx, CompilerThreadStackSize, 512);
|
||||
// ThreadStackSize 320 allows a couple of test cases to run while
|
||||
// keeping the number of threads that can be created high. System
|
||||
// default ThreadStackSize appears to be 512 which is too big.
|
||||
@ -40,8 +42,6 @@ define_pd_global(intx, ThreadStackSize, 320);
|
||||
define_pd_global(intx, VMThreadStackSize, 512);
|
||||
#endif // AMD64
|
||||
|
||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||
|
||||
define_pd_global(size_t, JVMInvokeMethodSlack, 8192);
|
||||
|
||||
// Used on 64 bit platforms for UseCompressedOops base address
|
||||
|
@ -676,13 +676,17 @@ bool os::is_allocatable(size_t bytes) {
|
||||
// thread stack
|
||||
|
||||
#ifdef AMD64
|
||||
size_t os::Linux::min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_compiler_thread_min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_java_thread_min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * K;
|
||||
#else
|
||||
size_t os::Linux::min_stack_allowed = (48 DEBUG_ONLY(+4))*K;
|
||||
size_t os::Posix::_compiler_thread_min_stack_allowed = (48 DEBUG_ONLY(+ 4)) * K;
|
||||
size_t os::Posix::_java_thread_min_stack_allowed = (48 DEBUG_ONLY(+ 4)) * K;
|
||||
size_t os::Posix::_vm_internal_thread_min_stack_allowed = (48 DEBUG_ONLY(+ 4)) * K;
|
||||
#endif // AMD64
|
||||
|
||||
// return default stack size for thr_type
|
||||
size_t os::Linux::default_stack_size(os::ThreadType thr_type) {
|
||||
size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
|
||||
// default stack size (compiler thread needs larger stack)
|
||||
#ifdef AMD64
|
||||
size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
|
||||
|
@ -307,9 +307,11 @@ bool os::is_allocatable(size_t bytes) {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// thread stack
|
||||
|
||||
size_t os::Linux::min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_compiler_thread_min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_java_thread_min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * K;
|
||||
|
||||
size_t os::Linux::default_stack_size(os::ThreadType thr_type) {
|
||||
size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
|
||||
#ifdef _LP64
|
||||
size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
|
||||
#else
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -31,7 +31,6 @@
|
||||
//
|
||||
|
||||
define_pd_global(size_t, JVMInvokeMethodSlack, 12288);
|
||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||
|
||||
// Used on 64 bit platforms for UseCompressedOops base address
|
||||
#ifdef _LP64
|
||||
|
@ -84,9 +84,13 @@
|
||||
// Minimum stack size for the VM. It's easier to document a constant
|
||||
// but it's different for x86 and sparc because the page sizes are different.
|
||||
#ifdef _LP64
|
||||
size_t os::Solaris::min_stack_allowed = 128*K;
|
||||
size_t os::Posix::_compiler_thread_min_stack_allowed = 128 * K;
|
||||
size_t os::Posix::_java_thread_min_stack_allowed = 128 * K;
|
||||
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 128 * K;
|
||||
#else
|
||||
size_t os::Solaris::min_stack_allowed = 96*K;
|
||||
size_t os::Posix::_compiler_thread_min_stack_allowed = 96 * K;
|
||||
size_t os::Posix::_java_thread_min_stack_allowed = 96 * K;
|
||||
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 96 * K;
|
||||
#endif
|
||||
|
||||
int os::Solaris::max_register_window_saves_before_flushing() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -30,10 +30,12 @@
|
||||
|
||||
define_pd_global(bool, DontYieldALot, true); // Determined in the design center
|
||||
#ifdef AMD64
|
||||
define_pd_global(intx, CompilerThreadStackSize, 1024);
|
||||
define_pd_global(intx, ThreadStackSize, 1024); // 0 => use system default
|
||||
define_pd_global(intx, VMThreadStackSize, 1024);
|
||||
define_pd_global(size_t, JVMInvokeMethodSlack, 8*K);
|
||||
#else
|
||||
define_pd_global(intx, CompilerThreadStackSize, 512);
|
||||
// ThreadStackSize 320 allows a couple of test cases to run while
|
||||
// keeping the number of threads that can be created high.
|
||||
define_pd_global(intx, ThreadStackSize, 320);
|
||||
@ -41,7 +43,6 @@ define_pd_global(intx, VMThreadStackSize, 512);
|
||||
define_pd_global(size_t, JVMInvokeMethodSlack, 10*K);
|
||||
#endif // AMD64
|
||||
|
||||
define_pd_global(intx, CompilerThreadStackSize, 0);
|
||||
|
||||
// Used on 64 bit platforms for UseCompressedOops base address
|
||||
define_pd_global(size_t, HeapBaseMinAddress, 2*G);
|
||||
|
@ -86,15 +86,19 @@
|
||||
|
||||
#define MAX_PATH (2 * K)
|
||||
|
||||
// Minimum stack size for the VM. It's easier to document a constant value
|
||||
// Minimum stack sizes for the VM. It's easier to document a constant value
|
||||
// but it's different for x86 and sparc because the page sizes are different.
|
||||
#ifdef AMD64
|
||||
size_t os::Solaris::min_stack_allowed = 224*K;
|
||||
size_t os::Posix::_compiler_thread_min_stack_allowed = 394 * K;
|
||||
size_t os::Posix::_java_thread_min_stack_allowed = 224 * K;
|
||||
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 224 * K;
|
||||
#define REG_SP REG_RSP
|
||||
#define REG_PC REG_RIP
|
||||
#define REG_FP REG_RBP
|
||||
#else
|
||||
size_t os::Solaris::min_stack_allowed = 64*K;
|
||||
size_t os::Posix::_compiler_thread_min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_java_thread_min_stack_allowed = 64 * K;
|
||||
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * K;
|
||||
#define REG_SP UESP
|
||||
#define REG_PC EIP
|
||||
#define REG_FP EBP
|
||||
|
@ -2410,6 +2410,15 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) {
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
|
||||
if (x->is_volatile() && os::is_MP()) __ membar_acquire();
|
||||
|
||||
/* Normalize boolean value returned by unsafe operation, i.e., value != 0 ? value = true : value false. */
|
||||
if (type == T_BOOLEAN) {
|
||||
LabelObj* equalZeroLabel = new LabelObj();
|
||||
__ cmp(lir_cond_equal, value, 0);
|
||||
__ branch(lir_cond_equal, T_BOOLEAN, equalZeroLabel->label());
|
||||
__ move(LIR_OprFact::intConst(1), value);
|
||||
__ branch_destination(equalZeroLabel->label());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -576,9 +576,8 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
||||
// normal bytecode execution.
|
||||
thread->clear_exception_oop_and_pc();
|
||||
|
||||
Handle original_exception(thread, exception());
|
||||
|
||||
continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false);
|
||||
bool recursive_exception = false;
|
||||
continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false, recursive_exception);
|
||||
// If an exception was thrown during exception dispatch, the exception oop may have changed
|
||||
thread->set_exception_oop(exception());
|
||||
thread->set_exception_pc(pc);
|
||||
@ -586,8 +585,9 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
||||
// the exception cache is used only by non-implicit exceptions
|
||||
// Update the exception cache only when there didn't happen
|
||||
// another exception during the computation of the compiled
|
||||
// exception handler.
|
||||
if (continuation != NULL && original_exception() == exception()) {
|
||||
// exception handler. Checking for exception oop equality is not
|
||||
// sufficient because some exceptions are pre-allocated and reused.
|
||||
if (continuation != NULL && !recursive_exception) {
|
||||
nm->add_handler_for_exception_and_pc(exception, pc, continuation);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -95,7 +95,8 @@ class VerificationType VALUE_OBJ_CLASS_SPEC {
|
||||
Category2_2nd = (Category2_2ndFlag << 1 * BitsPerByte) | Primitive,
|
||||
|
||||
// Primitive values (type descriminator stored in most-signifcant bytes)
|
||||
Bogus = (ITEM_Bogus << 2 * BitsPerByte) | Category1,
|
||||
// Bogus needs the " | Primitive". Else, is_reference(Bogus) returns TRUE.
|
||||
Bogus = (ITEM_Bogus << 2 * BitsPerByte) | Primitive,
|
||||
Boolean = (ITEM_Boolean << 2 * BitsPerByte) | Category1,
|
||||
Byte = (ITEM_Byte << 2 * BitsPerByte) | Category1,
|
||||
Short = (ITEM_Short << 2 * BitsPerByte) | Category1,
|
||||
|
@ -1305,7 +1305,7 @@ void CodeCache::report_codemem_full(int code_blob_type, bool print) {
|
||||
event.set_entryCount(heap->blob_count());
|
||||
event.set_methodCount(heap->nmethod_count());
|
||||
event.set_adaptorCount(heap->adapter_count());
|
||||
event.set_unallocatedCapacity(heap->unallocated_capacity()/K);
|
||||
event.set_unallocatedCapacity(heap->unallocated_capacity());
|
||||
event.set_fullCount(heap->full_count());
|
||||
event.commit();
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "gc/g1/heapRegionSet.hpp"
|
||||
#include "logging/logStream.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
#include "utilities/quickSort.hpp"
|
||||
|
||||
G1CollectorState* G1CollectionSet::collector_state() {
|
||||
return _g1->collector_state();
|
||||
@ -396,6 +397,16 @@ double G1CollectionSet::finalize_young_part(double target_pause_time_ms, G1Survi
|
||||
return time_remaining_ms;
|
||||
}
|
||||
|
||||
static int compare_region_idx(const uint a, const uint b) {
|
||||
if (a > b) {
|
||||
return 1;
|
||||
} else if (a == b) {
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
void G1CollectionSet::finalize_old_part(double time_remaining_ms) {
|
||||
double non_young_start_time_sec = os::elapsedTime();
|
||||
double predicted_old_time_ms = 0.0;
|
||||
@ -493,6 +504,8 @@ void G1CollectionSet::finalize_old_part(double time_remaining_ms) {
|
||||
|
||||
double non_young_end_time_sec = os::elapsedTime();
|
||||
phase_times()->record_non_young_cset_choice_time_ms((non_young_end_time_sec - non_young_start_time_sec) * 1000.0);
|
||||
|
||||
QuickSort::sort<uint>(_collection_set_regions, (int)_collection_set_cur_length, compare_region_idx, true);
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
|
@ -1904,7 +1904,8 @@ G1ConcurrentMark::claim_region(uint worker_id) {
|
||||
assert(_g1h->is_in_g1_reserved(finger), "invariant");
|
||||
|
||||
HeapRegion* curr_region = _g1h->heap_region_containing(finger);
|
||||
|
||||
// Make sure that the reads below do not float before loading curr_region.
|
||||
OrderAccess::loadload();
|
||||
// Above heap_region_containing may return NULL as we always scan claim
|
||||
// until the end of the heap. In this case, just jump to the next region.
|
||||
HeapWord* end = curr_region != NULL ? curr_region->end() : finger + HeapRegion::GrainWords;
|
||||
|
@ -132,9 +132,16 @@ void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading,
|
||||
MarkingCodeBlobClosure follow_code_closure(&GenMarkSweep::follow_root_closure, !CodeBlobToOopClosure::FixRelocations);
|
||||
{
|
||||
G1RootProcessor root_processor(g1h, 1);
|
||||
root_processor.process_strong_roots(&GenMarkSweep::follow_root_closure,
|
||||
&GenMarkSweep::follow_cld_closure,
|
||||
&follow_code_closure);
|
||||
if (ClassUnloading) {
|
||||
root_processor.process_strong_roots(&GenMarkSweep::follow_root_closure,
|
||||
&GenMarkSweep::follow_cld_closure,
|
||||
&follow_code_closure);
|
||||
} else {
|
||||
root_processor.process_all_roots_no_string_table(
|
||||
&GenMarkSweep::follow_root_closure,
|
||||
&GenMarkSweep::follow_cld_closure,
|
||||
&follow_code_closure);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
@ -157,7 +164,7 @@ void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading,
|
||||
// This is the point where the entire marking should have completed.
|
||||
assert(GenMarkSweep::_marking_stack.is_empty(), "Marking should have completed");
|
||||
|
||||
{
|
||||
if (ClassUnloading) {
|
||||
GCTraceTime(Debug, gc, phases) trace("Class Unloading", gc_timer());
|
||||
|
||||
// Unload classes and purge the SystemDictionary.
|
||||
|
@ -83,6 +83,7 @@ void G1RootProcessor::evacuate_roots(G1EvacuationRootClosures* closures, uint wo
|
||||
}
|
||||
|
||||
process_vm_roots(closures, phase_times, worker_i);
|
||||
process_string_table_roots(closures, phase_times, worker_i);
|
||||
|
||||
{
|
||||
// Now the CM ref_processor roots.
|
||||
@ -191,19 +192,34 @@ public:
|
||||
|
||||
void G1RootProcessor::process_all_roots(OopClosure* oops,
|
||||
CLDClosure* clds,
|
||||
CodeBlobClosure* blobs) {
|
||||
CodeBlobClosure* blobs,
|
||||
bool process_string_table) {
|
||||
AllRootsClosures closures(oops, clds);
|
||||
|
||||
process_java_roots(&closures, NULL, 0);
|
||||
process_vm_roots(&closures, NULL, 0);
|
||||
|
||||
if (!_process_strong_tasks.is_task_claimed(G1RP_PS_CodeCache_oops_do)) {
|
||||
CodeCache::blobs_do(blobs);
|
||||
if (process_string_table) {
|
||||
process_string_table_roots(&closures, NULL, 0);
|
||||
}
|
||||
process_code_cache_roots(blobs, NULL, 0);
|
||||
|
||||
_process_strong_tasks.all_tasks_completed(n_workers());
|
||||
}
|
||||
|
||||
void G1RootProcessor::process_all_roots(OopClosure* oops,
|
||||
CLDClosure* clds,
|
||||
CodeBlobClosure* blobs) {
|
||||
process_all_roots(oops, clds, blobs, true);
|
||||
}
|
||||
|
||||
void G1RootProcessor::process_all_roots_no_string_table(OopClosure* oops,
|
||||
CLDClosure* clds,
|
||||
CodeBlobClosure* blobs) {
|
||||
assert(!ClassUnloading, "Should only be used when class unloading is disabled");
|
||||
process_all_roots(oops, clds, blobs, false);
|
||||
}
|
||||
|
||||
void G1RootProcessor::process_java_roots(G1RootClosures* closures,
|
||||
G1GCPhaseTimes* phase_times,
|
||||
uint worker_i) {
|
||||
@ -280,14 +296,23 @@ void G1RootProcessor::process_vm_roots(G1RootClosures* closures,
|
||||
SystemDictionary::roots_oops_do(strong_roots, weak_roots);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::StringTableRoots, worker_i);
|
||||
// All threads execute the following. A specific chunk of buckets
|
||||
// from the StringTable are the individual tasks.
|
||||
if (weak_roots != NULL) {
|
||||
StringTable::possibly_parallel_oops_do(weak_roots);
|
||||
}
|
||||
void G1RootProcessor::process_string_table_roots(G1RootClosures* closures,
|
||||
G1GCPhaseTimes* phase_times,
|
||||
uint worker_i) {
|
||||
assert(closures->weak_oops() != NULL, "Should only be called when all roots are processed");
|
||||
G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::StringTableRoots, worker_i);
|
||||
// All threads execute the following. A specific chunk of buckets
|
||||
// from the StringTable are the individual tasks.
|
||||
StringTable::possibly_parallel_oops_do(closures->weak_oops());
|
||||
}
|
||||
|
||||
void G1RootProcessor::process_code_cache_roots(CodeBlobClosure* code_closure,
|
||||
G1GCPhaseTimes* phase_times,
|
||||
uint worker_i) {
|
||||
if (!_process_strong_tasks.is_task_claimed(G1RP_PS_CodeCache_oops_do)) {
|
||||
CodeCache::blobs_do(code_closure);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,6 +73,11 @@ class G1RootProcessor : public StackObj {
|
||||
void worker_has_discovered_all_strong_classes();
|
||||
void wait_until_all_strong_classes_discovered();
|
||||
|
||||
void process_all_roots(OopClosure* oops,
|
||||
CLDClosure* clds,
|
||||
CodeBlobClosure* blobs,
|
||||
bool process_string_table);
|
||||
|
||||
void process_java_roots(G1RootClosures* closures,
|
||||
G1GCPhaseTimes* phase_times,
|
||||
uint worker_i);
|
||||
@ -81,6 +86,14 @@ class G1RootProcessor : public StackObj {
|
||||
G1GCPhaseTimes* phase_times,
|
||||
uint worker_i);
|
||||
|
||||
void process_string_table_roots(G1RootClosures* closures,
|
||||
G1GCPhaseTimes* phase_times,
|
||||
uint worker_i);
|
||||
|
||||
void process_code_cache_roots(CodeBlobClosure* code_closure,
|
||||
G1GCPhaseTimes* phase_times,
|
||||
uint worker_i);
|
||||
|
||||
public:
|
||||
G1RootProcessor(G1CollectedHeap* g1h, uint n_workers);
|
||||
|
||||
@ -99,6 +112,13 @@ public:
|
||||
CLDClosure* clds,
|
||||
CodeBlobClosure* blobs);
|
||||
|
||||
// Apply oops, clds and blobs to strongly and weakly reachable roots in the system,
|
||||
// the only thing different from process_all_roots is that we skip the string table
|
||||
// to avoid keeping every string live when doing class unloading.
|
||||
void process_all_roots_no_string_table(OopClosure* oops,
|
||||
CLDClosure* clds,
|
||||
CodeBlobClosure* blobs);
|
||||
|
||||
// Number of worker threads used by the root processor.
|
||||
uint n_workers() const;
|
||||
};
|
||||
|
@ -123,6 +123,7 @@ void HeapRegionManager::make_regions_available(uint start, uint num_regions) {
|
||||
for (uint i = start; i < start + num_regions; i++) {
|
||||
if (_regions.get_by_index(i) == NULL) {
|
||||
HeapRegion* new_hr = new_heap_region(i);
|
||||
OrderAccess::storestore();
|
||||
_regions.set_by_index(i, new_hr);
|
||||
_allocated_heapregions_length = MAX2(_allocated_heapregions_length, i + 1);
|
||||
}
|
||||
|
@ -185,8 +185,10 @@ void OldGCTracer::report_concurrent_mode_failure() {
|
||||
}
|
||||
|
||||
#if INCLUDE_ALL_GCS
|
||||
void G1MMUTracer::report_mmu(double timeSlice, double gcTime, double maxTime) {
|
||||
send_g1_mmu_event(timeSlice, gcTime, maxTime);
|
||||
void G1MMUTracer::report_mmu(double time_slice_sec, double gc_time_sec, double max_time_sec) {
|
||||
send_g1_mmu_event(time_slice_sec * MILLIUNITS,
|
||||
gc_time_sec * MILLIUNITS,
|
||||
max_time_sec * MILLIUNITS);
|
||||
}
|
||||
|
||||
void G1NewTracer::report_yc_type(G1YCType type) {
|
||||
|
@ -235,10 +235,10 @@ class ParNewTracer : public YoungGCTracer {
|
||||
|
||||
#if INCLUDE_ALL_GCS
|
||||
class G1MMUTracer : public AllStatic {
|
||||
static void send_g1_mmu_event(double timeSlice, double gcTime, double maxTime);
|
||||
static void send_g1_mmu_event(double time_slice_ms, double gc_time_ms, double max_time_ms);
|
||||
|
||||
public:
|
||||
static void report_mmu(double timeSlice, double gcTime, double maxTime);
|
||||
static void report_mmu(double time_slice_sec, double gc_time_sec, double max_time_sec);
|
||||
};
|
||||
|
||||
class G1NewTracer : public YoungGCTracer {
|
||||
|
@ -200,13 +200,13 @@ void G1NewTracer::send_g1_young_gc_event() {
|
||||
}
|
||||
}
|
||||
|
||||
void G1MMUTracer::send_g1_mmu_event(double timeSlice, double gcTime, double maxTime) {
|
||||
void G1MMUTracer::send_g1_mmu_event(double time_slice_ms, double gc_time_ms, double max_time_ms) {
|
||||
EventG1MMU e;
|
||||
if (e.should_commit()) {
|
||||
e.set_gcId(GCId::current());
|
||||
e.set_timeSlice(timeSlice);
|
||||
e.set_gcTime(gcTime);
|
||||
e.set_maxGcTime(maxTime);
|
||||
e.set_timeSlice(time_slice_ms);
|
||||
e.set_gcTime(gc_time_ms);
|
||||
e.set_pauseTarget(max_time_ms);
|
||||
e.commit();
|
||||
}
|
||||
}
|
||||
@ -281,10 +281,10 @@ void G1NewTracer::send_basic_ihop_statistics(size_t threshold,
|
||||
evt.set_targetOccupancy(target_occupancy);
|
||||
evt.set_thresholdPercentage(target_occupancy > 0 ? ((double)threshold / target_occupancy) : 0.0);
|
||||
evt.set_currentOccupancy(current_occupancy);
|
||||
evt.set_lastAllocationSize(last_allocation_size);
|
||||
evt.set_lastAllocationDuration(last_allocation_duration);
|
||||
evt.set_lastAllocationRate(last_allocation_duration != 0.0 ? last_allocation_size / last_allocation_duration : 0.0);
|
||||
evt.set_lastMarkingLength(last_marking_length);
|
||||
evt.set_recentMutatorAllocationSize(last_allocation_size);
|
||||
evt.set_recentMutatorDuration(last_allocation_duration * MILLIUNITS);
|
||||
evt.set_recentAllocationRate(last_allocation_duration != 0.0 ? last_allocation_size / last_allocation_duration : 0.0);
|
||||
evt.set_lastMarkingDuration(last_marking_length * MILLIUNITS);
|
||||
evt.commit();
|
||||
}
|
||||
}
|
||||
@ -301,11 +301,11 @@ void G1NewTracer::send_adaptive_ihop_statistics(size_t threshold,
|
||||
evt.set_gcId(GCId::current());
|
||||
evt.set_threshold(threshold);
|
||||
evt.set_thresholdPercentage(internal_target_occupancy > 0 ? ((double)threshold / internal_target_occupancy) : 0.0);
|
||||
evt.set_internalTargetOccupancy(internal_target_occupancy);
|
||||
evt.set_ihopTargetOccupancy(internal_target_occupancy);
|
||||
evt.set_currentOccupancy(current_occupancy);
|
||||
evt.set_additionalBufferSize(additional_buffer_size);
|
||||
evt.set_predictedAllocationRate(predicted_allocation_rate);
|
||||
evt.set_predictedMarkingLength(predicted_marking_length);
|
||||
evt.set_predictedMarkingDuration(predicted_marking_length * MILLIUNITS);
|
||||
evt.set_predictionActive(prediction_active);
|
||||
evt.commit();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -576,27 +576,39 @@ void InterpreterRuntime::resolve_get_put(JavaThread* thread, Bytecodes::Code byt
|
||||
// compute auxiliary field attributes
|
||||
TosState state = as_TosState(info.field_type());
|
||||
|
||||
// Put instructions on final fields are not resolved. This is required so we throw
|
||||
// exceptions at the correct place (when the instruction is actually invoked).
|
||||
// Resolution of put instructions on final fields is delayed. That is required so that
|
||||
// exceptions are thrown at the correct place (when the instruction is actually invoked).
|
||||
// If we do not resolve an instruction in the current pass, leaving the put_code
|
||||
// set to zero will cause the next put instruction to the same field to reresolve.
|
||||
|
||||
// Resolution of put instructions to final instance fields with invalid updates (i.e.,
|
||||
// to final instance fields with updates originating from a method different than <init>)
|
||||
// is inhibited. A putfield instruction targeting an instance final field must throw
|
||||
// an IllegalAccessError if the instruction is not in an instance
|
||||
// initializer method <init>. If resolution were not inhibited, a putfield
|
||||
// in an initializer method could be resolved in the initializer. Subsequent
|
||||
// putfield instructions to the same field would then use cached information.
|
||||
// As a result, those instructions would not pass through the VM. That is,
|
||||
// checks in resolve_field_access() would not be executed for those instructions
|
||||
// and the required IllegalAccessError would not be thrown.
|
||||
//
|
||||
// Also, we need to delay resolving getstatic and putstatic instructions until the
|
||||
// class is initialized. This is required so that access to the static
|
||||
// field will call the initialization function every time until the class
|
||||
// is completely initialized ala. in 2.17.5 in JVM Specification.
|
||||
InstanceKlass* klass = InstanceKlass::cast(info.field_holder());
|
||||
bool uninitialized_static = ((bytecode == Bytecodes::_getstatic || bytecode == Bytecodes::_putstatic) &&
|
||||
!klass->is_initialized());
|
||||
|
||||
Bytecodes::Code put_code = (Bytecodes::Code)0;
|
||||
if (is_put && !info.access_flags().is_final() && !uninitialized_static) {
|
||||
put_code = ((is_static) ? Bytecodes::_putstatic : Bytecodes::_putfield);
|
||||
}
|
||||
bool uninitialized_static = is_static && !klass->is_initialized();
|
||||
bool has_initialized_final_update = info.field_holder()->major_version() >= 53 &&
|
||||
info.has_initialized_final_update();
|
||||
assert(!(has_initialized_final_update && !info.access_flags().is_final()), "Fields with initialized final updates must be final");
|
||||
|
||||
Bytecodes::Code get_code = (Bytecodes::Code)0;
|
||||
Bytecodes::Code put_code = (Bytecodes::Code)0;
|
||||
if (!uninitialized_static) {
|
||||
get_code = ((is_static) ? Bytecodes::_getstatic : Bytecodes::_getfield);
|
||||
if ((is_put && !has_initialized_final_update) || !info.access_flags().is_final()) {
|
||||
put_code = ((is_static) ? Bytecodes::_putstatic : Bytecodes::_putfield);
|
||||
}
|
||||
}
|
||||
|
||||
cp_cache_entry->set_field(
|
||||
|
@ -768,6 +768,11 @@ C2V_VMENTRY(jobject, resolveMethod, (JNIEnv *, jobject, jobject receiver_jvmci_t
|
||||
Symbol* h_name = method->name();
|
||||
Symbol* h_signature = method->signature();
|
||||
|
||||
if (MethodHandles::is_signature_polymorphic_method(method())) {
|
||||
// Signature polymorphic methods are already resolved, JVMCI just returns NULL in this case.
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LinkInfo link_info(h_resolved, h_name, h_signature, caller_klass);
|
||||
methodHandle m;
|
||||
// Only do exact lookup if receiver klass has been linked. Otherwise,
|
||||
@ -782,7 +787,7 @@ C2V_VMENTRY(jobject, resolveMethod, (JNIEnv *, jobject, jobject receiver_jvmci_t
|
||||
}
|
||||
|
||||
if (m.is_null()) {
|
||||
// Return NULL only if there was a problem with lookup (uninitialized class, etc.)
|
||||
// Return NULL if there was a problem with lookup (uninitialized class, etc.)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -313,13 +313,18 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t
|
||||
// normal bytecode execution.
|
||||
thread->clear_exception_oop_and_pc();
|
||||
|
||||
continuation = SharedRuntime::compute_compiled_exc_handler(cm, pc, exception, false, false);
|
||||
bool recursive_exception = false;
|
||||
continuation = SharedRuntime::compute_compiled_exc_handler(cm, pc, exception, false, false, recursive_exception);
|
||||
// If an exception was thrown during exception dispatch, the exception oop may have changed
|
||||
thread->set_exception_oop(exception());
|
||||
thread->set_exception_pc(pc);
|
||||
|
||||
// the exception cache is used only by non-implicit exceptions
|
||||
if (continuation != NULL && !SharedRuntime::deopt_blob()->contains(continuation)) {
|
||||
// Update the exception cache only when there didn't happen
|
||||
// another exception during the computation of the compiled
|
||||
// exception handler. Checking for exception oop equality is not
|
||||
// sufficient because some exceptions are pre-allocated and reused.
|
||||
if (continuation != NULL && !recursive_exception && !SharedRuntime::deopt_blob()->contains(continuation)) {
|
||||
cm->add_handler_for_exception_and_pc(exception, pc, continuation);
|
||||
}
|
||||
}
|
||||
|
@ -431,6 +431,12 @@ void Klass::clean_weak_klass_links(BoolObjectClosure* is_alive, bool clean_alive
|
||||
if (clean_alive_klasses && current->is_instance_klass()) {
|
||||
InstanceKlass* ik = InstanceKlass::cast(current);
|
||||
ik->clean_weak_instanceklass_links(is_alive);
|
||||
|
||||
// JVMTI RedefineClasses creates previous versions that are not in
|
||||
// the class hierarchy, so process them here.
|
||||
while ((ik = ik->previous_versions()) != NULL) {
|
||||
ik->clean_weak_instanceklass_links(is_alive);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2172,10 +2172,9 @@ Node* GraphKit::record_profiled_receiver_for_speculation(Node* n) {
|
||||
java_bc() == Bytecodes::_instanceof ||
|
||||
java_bc() == Bytecodes::_aastore) {
|
||||
ciProfileData* data = method()->method_data()->bci_to_data(bci());
|
||||
bool maybe_null = data == NULL ? true : data->as_BitData()->null_seen();
|
||||
maybe_null = data == NULL ? true : data->as_BitData()->null_seen();
|
||||
}
|
||||
return record_profile_for_speculation(n, exact_kls, maybe_null);
|
||||
return n;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2475,6 +2475,28 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
|
||||
// load value
|
||||
switch (type) {
|
||||
case T_BOOLEAN:
|
||||
{
|
||||
// Normalize the value returned by getBoolean in the following cases
|
||||
if (mismatched ||
|
||||
heap_base_oop == top() || // - heap_base_oop is NULL or
|
||||
(can_access_non_heap && alias_type->field() == NULL) // - heap_base_oop is potentially NULL
|
||||
// and the unsafe access is made to large offset
|
||||
// (i.e., larger than the maximum offset necessary for any
|
||||
// field access)
|
||||
) {
|
||||
IdealKit ideal = IdealKit(this);
|
||||
#define __ ideal.
|
||||
IdealVariable normalized_result(ideal);
|
||||
__ declarations_done();
|
||||
__ set(normalized_result, p);
|
||||
__ if_then(p, BoolTest::ne, ideal.ConI(0));
|
||||
__ set(normalized_result, ideal.ConI(1));
|
||||
ideal.end_if();
|
||||
final_sync(ideal);
|
||||
p = __ value(normalized_result);
|
||||
#undef __
|
||||
}
|
||||
}
|
||||
case T_CHAR:
|
||||
case T_BYTE:
|
||||
case T_SHORT:
|
||||
|
@ -1349,17 +1349,23 @@ JRT_ENTRY_NO_ASYNC(address, OptoRuntime::handle_exception_C_helper(JavaThread* t
|
||||
force_unwind ? NULL : nm->handler_for_exception_and_pc(exception, pc);
|
||||
|
||||
if (handler_address == NULL) {
|
||||
Handle original_exception(thread, exception());
|
||||
handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true);
|
||||
bool recursive_exception = false;
|
||||
handler_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true, recursive_exception);
|
||||
assert (handler_address != NULL, "must have compiled handler");
|
||||
// Update the exception cache only when the unwind was not forced
|
||||
// and there didn't happen another exception during the computation of the
|
||||
// compiled exception handler.
|
||||
if (!force_unwind && original_exception() == exception()) {
|
||||
// compiled exception handler. Checking for exception oop equality is not
|
||||
// sufficient because some exceptions are pre-allocated and reused.
|
||||
if (!force_unwind && !recursive_exception) {
|
||||
nm->add_handler_for_exception_and_pc(exception,pc,handler_address);
|
||||
}
|
||||
} else {
|
||||
assert(handler_address == SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true), "Must be the same");
|
||||
#ifdef ASSERT
|
||||
bool recursive_exception = false;
|
||||
address computed_address = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, force_unwind, true, recursive_exception);
|
||||
vmassert(recursive_exception || (handler_address == computed_address), "Handler address inconsistency: " PTR_FORMAT " != " PTR_FORMAT,
|
||||
p2i(handler_address), p2i(computed_address));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,8 @@ JVM_GetStackTraceElements(JNIEnv *env, jobject throwable, jobjectArray elements)
|
||||
* java.lang.StackWalker
|
||||
*/
|
||||
enum {
|
||||
JVM_STACKWALK_FILL_CLASS_REFS_ONLY = 0x2,
|
||||
JVM_STACKWALK_FILL_CLASS_REFS_ONLY = 0x02,
|
||||
JVM_STACKWALK_GET_CALLER_CLASS = 0x04,
|
||||
JVM_STACKWALK_SHOW_HIDDEN_FRAMES = 0x20,
|
||||
JVM_STACKWALK_FILL_LIVE_STACK_FRAMES = 0x100
|
||||
};
|
||||
|
@ -96,7 +96,7 @@ static const jlong INTERP_EVENT_BITS = SINGLE_STEP_BIT | METHOD_ENTRY_BIT | ME
|
||||
static const jlong THREAD_FILTERED_EVENT_BITS = INTERP_EVENT_BITS | EXCEPTION_BITS | MONITOR_BITS |
|
||||
BREAKPOINT_BIT | CLASS_LOAD_BIT | CLASS_PREPARE_BIT | THREAD_END_BIT;
|
||||
static const jlong NEED_THREAD_LIFE_EVENTS = THREAD_FILTERED_EVENT_BITS | THREAD_START_BIT;
|
||||
static const jlong EARLY_EVENT_BITS = CLASS_FILE_LOAD_HOOK_BIT |
|
||||
static const jlong EARLY_EVENT_BITS = CLASS_FILE_LOAD_HOOK_BIT | CLASS_LOAD_BIT | CLASS_PREPARE_BIT |
|
||||
VM_START_BIT | VM_INIT_BIT | VM_DEATH_BIT | NATIVE_METHOD_BIND_BIT |
|
||||
THREAD_START_BIT | THREAD_END_BIT |
|
||||
COMPILED_METHOD_LOAD_BIT | COMPILED_METHOD_UNLOAD_BIT |
|
||||
|
@ -113,7 +113,10 @@ int StackWalk::fill_in_frames(jlong mode, JavaFrameStream& stream,
|
||||
int bci = stream.bci();
|
||||
|
||||
if (method == NULL) continue;
|
||||
if (!ShowHiddenFrames && StackWalk::skip_hidden_frames(mode)) {
|
||||
|
||||
// skip hidden frames for default StackWalker option (i.e. SHOW_HIDDEN_FRAMES
|
||||
// not set) and when StackWalker::getCallerClass is called
|
||||
if (!ShowHiddenFrames && (skip_hidden_frames(mode) || get_caller_class(mode))) {
|
||||
if (method->is_hidden()) {
|
||||
if (TraceStackWalk) {
|
||||
tty->print(" hidden method: "); method->print_short_name();
|
||||
@ -139,7 +142,14 @@ int StackWalk::fill_in_frames(jlong mode, JavaFrameStream& stream,
|
||||
Handle stackFrame(frames_array->obj_at(index));
|
||||
fill_stackframe(stackFrame, method, bci);
|
||||
} else {
|
||||
assert (use_frames_array(mode) == false, "Bad mode for get caller class");
|
||||
assert (use_frames_array(mode) == false, "Bad mode for filling in Class object");
|
||||
if (get_caller_class(mode) && index == start_index && method->caller_sensitive()) {
|
||||
ResourceMark rm(THREAD);
|
||||
THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(),
|
||||
err_msg("StackWalker::getCallerClass called from @CallerSensitive %s method",
|
||||
method->name_and_sig_as_C_string()));
|
||||
}
|
||||
|
||||
frames_array->obj_at_put(index, method->method_holder()->java_mirror());
|
||||
}
|
||||
if (++frames_decoded >= max_nframes) break;
|
||||
|
@ -82,6 +82,9 @@ private:
|
||||
static void fill_live_stackframe(Handle stackFrame, const methodHandle& method, int bci,
|
||||
javaVFrame* jvf, TRAPS);
|
||||
|
||||
static inline bool get_caller_class(int mode) {
|
||||
return (mode & JVM_STACKWALK_GET_CALLER_CLASS) != 0;
|
||||
}
|
||||
static inline bool skip_hidden_frames(int mode) {
|
||||
return (mode & JVM_STACKWALK_SHOW_HIDDEN_FRAMES) == 0;
|
||||
}
|
||||
|
@ -150,14 +150,23 @@ class MemoryAccess : StackObj {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T normalize(T x) {
|
||||
T normalize_for_write(T x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
jboolean normalize(jboolean x) {
|
||||
jboolean normalize_for_write(jboolean x) {
|
||||
return x & 1;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T normalize_for_read(T x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
jboolean normalize_for_read(jboolean x) {
|
||||
return x != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper class to wrap memory accesses in JavaThread::doing_unsafe_access()
|
||||
*/
|
||||
@ -196,7 +205,7 @@ public:
|
||||
|
||||
T* p = (T*)addr();
|
||||
|
||||
T x = *p;
|
||||
T x = normalize_for_read(*p);
|
||||
|
||||
return x;
|
||||
}
|
||||
@ -207,7 +216,7 @@ public:
|
||||
|
||||
T* p = (T*)addr();
|
||||
|
||||
*p = normalize(x);
|
||||
*p = normalize_for_write(x);
|
||||
}
|
||||
|
||||
|
||||
@ -223,7 +232,7 @@ public:
|
||||
|
||||
T x = OrderAccess::load_acquire((volatile T*)p);
|
||||
|
||||
return x;
|
||||
return normalize_for_read(x);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -232,7 +241,7 @@ public:
|
||||
|
||||
T* p = (T*)addr();
|
||||
|
||||
OrderAccess::release_store_fence((volatile T*)p, normalize(x));
|
||||
OrderAccess::release_store_fence((volatile T*)p, normalize_for_write(x));
|
||||
}
|
||||
|
||||
|
||||
@ -256,7 +265,7 @@ public:
|
||||
|
||||
jlong* p = (jlong*)addr();
|
||||
|
||||
Atomic::store(normalize(x), p);
|
||||
Atomic::store(normalize_for_write(x), p);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
@ -894,6 +894,7 @@ static bool GetVMFlag(JavaThread* thread, JNIEnv* env, jstring name, T* value, F
|
||||
}
|
||||
ThreadToNativeFromVM ttnfv(thread); // can't be in VM when we call JNI
|
||||
const char* flag_name = env->GetStringUTFChars(name, NULL);
|
||||
CHECK_JNI_EXCEPTION_(env, false);
|
||||
Flag::Error result = (*TAt)(flag_name, value, true, true);
|
||||
env->ReleaseStringUTFChars(name, flag_name);
|
||||
return (result == Flag::SUCCESS);
|
||||
@ -906,6 +907,7 @@ static bool SetVMFlag(JavaThread* thread, JNIEnv* env, jstring name, T* value, F
|
||||
}
|
||||
ThreadToNativeFromVM ttnfv(thread); // can't be in VM when we call JNI
|
||||
const char* flag_name = env->GetStringUTFChars(name, NULL);
|
||||
CHECK_JNI_EXCEPTION_(env, false);
|
||||
Flag::Error result = (*TAtPut)(flag_name, value, Flag::INTERNAL);
|
||||
env->ReleaseStringUTFChars(name, flag_name);
|
||||
return (result == Flag::SUCCESS);
|
||||
@ -944,6 +946,7 @@ static jobject doubleBox(JavaThread* thread, JNIEnv* env, jdouble value) {
|
||||
static Flag* getVMFlag(JavaThread* thread, JNIEnv* env, jstring name) {
|
||||
ThreadToNativeFromVM ttnfv(thread); // can't be in VM when we call JNI
|
||||
const char* flag_name = env->GetStringUTFChars(name, NULL);
|
||||
CHECK_JNI_EXCEPTION_(env, NULL);
|
||||
Flag* result = Flag::find_flag(flag_name, strlen(flag_name), true, true);
|
||||
env->ReleaseStringUTFChars(name, flag_name);
|
||||
return result;
|
||||
@ -1084,7 +1087,14 @@ WB_END
|
||||
|
||||
WB_ENTRY(void, WB_SetStringVMFlag(JNIEnv* env, jobject o, jstring name, jstring value))
|
||||
ThreadToNativeFromVM ttnfv(thread); // can't be in VM when we call JNI
|
||||
const char* ccstrValue = (value == NULL) ? NULL : env->GetStringUTFChars(value, NULL);
|
||||
const char* ccstrValue;
|
||||
if (value == NULL) {
|
||||
ccstrValue = NULL;
|
||||
}
|
||||
else {
|
||||
ccstrValue = env->GetStringUTFChars(value, NULL);
|
||||
CHECK_JNI_EXCEPTION(env);
|
||||
}
|
||||
ccstr ccstrResult = ccstrValue;
|
||||
bool needFree;
|
||||
{
|
||||
@ -1308,6 +1318,7 @@ WB_ENTRY(jobjectArray, WB_GetCodeHeapEntries(JNIEnv* env, jobject o, jint blob_t
|
||||
jclass clazz = env->FindClass(vmSymbols::java_lang_Object()->as_C_string());
|
||||
CHECK_JNI_EXCEPTION_(env, NULL);
|
||||
result = env->NewObjectArray(blobs.length(), clazz, NULL);
|
||||
CHECK_JNI_EXCEPTION_(env, NULL);
|
||||
if (result == NULL) {
|
||||
return result;
|
||||
}
|
||||
@ -1317,6 +1328,7 @@ WB_ENTRY(jobjectArray, WB_GetCodeHeapEntries(JNIEnv* env, jobject o, jint blob_t
|
||||
jobjectArray obj = codeBlob2objectArray(thread, env, *it);
|
||||
CHECK_JNI_EXCEPTION_(env, NULL);
|
||||
env->SetObjectArrayElement(result, i, obj);
|
||||
CHECK_JNI_EXCEPTION_(env, NULL);
|
||||
++i;
|
||||
}
|
||||
return result;
|
||||
@ -1523,6 +1535,7 @@ static bool GetMethodOption(JavaThread* thread, JNIEnv* env, jobject method, jst
|
||||
// can't be in VM when we call JNI
|
||||
ThreadToNativeFromVM ttnfv(thread);
|
||||
const char* flag_name = env->GetStringUTFChars(name, NULL);
|
||||
CHECK_JNI_EXCEPTION_(env, false);
|
||||
bool result = CompilerOracle::has_option_value(mh, flag_name, *value);
|
||||
env->ReleaseStringUTFChars(name, flag_name);
|
||||
return result;
|
||||
@ -1678,6 +1691,7 @@ WB_ENTRY(jint, WB_AddCompilerDirective(JNIEnv* env, jobject o, jstring compDirec
|
||||
// can't be in VM when we call JNI
|
||||
ThreadToNativeFromVM ttnfv(thread);
|
||||
const char* dir = env->GetStringUTFChars(compDirect, NULL);
|
||||
CHECK_JNI_EXCEPTION_(env, 0);
|
||||
int ret;
|
||||
{
|
||||
ThreadInVMfromNative ttvfn(thread); // back to VM
|
||||
|
@ -33,9 +33,22 @@
|
||||
#include "oops/symbol.hpp"
|
||||
#include "runtime/interfaceSupport.hpp"
|
||||
|
||||
// Unconditionally clear pedantic pending JNI checks
|
||||
class ClearPendingJniExcCheck : public StackObj {
|
||||
private:
|
||||
JavaThread* _thread;
|
||||
public:
|
||||
ClearPendingJniExcCheck(JNIEnv* env) : _thread(JavaThread::thread_from_jni_environment(env)) {}
|
||||
~ClearPendingJniExcCheck() {
|
||||
_thread->clear_pending_jni_exception_check();
|
||||
}
|
||||
};
|
||||
|
||||
// Entry macro to transition from JNI to VM state.
|
||||
|
||||
#define WB_ENTRY(result_type, header) JNI_ENTRY(result_type, header)
|
||||
#define WB_ENTRY(result_type, header) JNI_ENTRY(result_type, header) \
|
||||
ClearPendingJniExcCheck _clearCheck(env);
|
||||
|
||||
#define WB_END JNI_END
|
||||
#define WB_METHOD_DECLARE(result_type) extern "C" result_type JNICALL
|
||||
|
||||
|
@ -1308,35 +1308,13 @@ bool Arguments::add_property(const char* prop, PropertyWriteable writeable, Prop
|
||||
return true;
|
||||
}
|
||||
|
||||
// sets or adds a module name to the jdk.module.addmods property
|
||||
bool Arguments::append_to_addmods_property(const char* module_name) {
|
||||
const char* key = "jdk.module.addmods";
|
||||
const char* old_value = Arguments::get_property(key);
|
||||
size_t buf_len = strlen(key) + strlen(module_name) + 2;
|
||||
if (old_value != NULL) {
|
||||
buf_len += strlen(old_value) + 1;
|
||||
}
|
||||
char* new_value = AllocateHeap(buf_len, mtArguments);
|
||||
if (new_value == NULL) {
|
||||
return false;
|
||||
}
|
||||
if (old_value == NULL) {
|
||||
jio_snprintf(new_value, buf_len, "%s=%s", key, module_name);
|
||||
} else {
|
||||
jio_snprintf(new_value, buf_len, "%s=%s,%s", key, old_value, module_name);
|
||||
}
|
||||
bool added = add_property(new_value, UnwriteableProperty, InternalProperty);
|
||||
FreeHeap(new_value);
|
||||
return added;
|
||||
}
|
||||
|
||||
#if INCLUDE_CDS
|
||||
void Arguments::check_unsupported_dumping_properties() {
|
||||
assert(DumpSharedSpaces, "this function is only used with -Xshare:dump");
|
||||
const char* unsupported_properties[5] = { "jdk.module.main",
|
||||
"jdk.module.path",
|
||||
"jdk.module.upgrade.path",
|
||||
"jdk.module.addmods",
|
||||
"jdk.module.addmods.0",
|
||||
"jdk.module.limitmods" };
|
||||
const char* unsupported_options[5] = { "-m",
|
||||
"--module-path",
|
||||
@ -1687,11 +1665,6 @@ void Arguments::set_cms_and_parnew_gc_flags() {
|
||||
CompactibleFreeListSpaceLAB::modify_initialization(OldPLABSize, OldPLABWeight);
|
||||
}
|
||||
|
||||
if (!ClassUnloading) {
|
||||
FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false);
|
||||
FLAG_SET_CMDLINE(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false);
|
||||
}
|
||||
|
||||
log_trace(gc)("MarkStackSize: %uk MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
|
||||
}
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
@ -2019,6 +1992,13 @@ void Arguments::set_gc_specific_flags() {
|
||||
// Keeping the heap 100% free is hard ;-) so limit it to 99%.
|
||||
FLAG_SET_ERGO(uintx, MinHeapFreeRatio, 99);
|
||||
}
|
||||
|
||||
// If class unloading is disabled, also disable concurrent class unloading.
|
||||
if (!ClassUnloading) {
|
||||
FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false);
|
||||
FLAG_SET_CMDLINE(bool, ClassUnloadingWithConcurrentMark, false);
|
||||
FLAG_SET_CMDLINE(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false);
|
||||
}
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
}
|
||||
|
||||
@ -2566,8 +2546,8 @@ bool Arguments::parse_uintx(const char* value,
|
||||
|
||||
unsigned int addreads_count = 0;
|
||||
unsigned int addexports_count = 0;
|
||||
unsigned int addmods_count = 0;
|
||||
unsigned int patch_mod_count = 0;
|
||||
const char* add_modules_value = NULL;
|
||||
|
||||
bool Arguments::create_property(const char* prop_name, const char* prop_value, PropertyInternal internal) {
|
||||
size_t prop_len = strlen(prop_name) + strlen(prop_value) + 2;
|
||||
@ -2821,7 +2801,9 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
|
||||
return JNI_ENOMEM;
|
||||
}
|
||||
} else if (match_option(option, "--add-modules=", &tail)) {
|
||||
add_modules_value = tail;
|
||||
if (!create_numbered_property("jdk.module.addmods", tail, addmods_count++)) {
|
||||
return JNI_ENOMEM;
|
||||
}
|
||||
} else if (match_option(option, "--limit-modules=", &tail)) {
|
||||
if (!create_property("jdk.module.limitmods", tail, InternalProperty)) {
|
||||
return JNI_ENOMEM;
|
||||
@ -2873,7 +2855,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
|
||||
char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtArguments), tail);
|
||||
add_init_agent("instrument", options, false);
|
||||
// java agents need module java.instrument
|
||||
if (!Arguments::append_to_addmods_property("java.instrument")) {
|
||||
if (!create_numbered_property("jdk.module.addmods", "java.instrument", addmods_count++)) {
|
||||
return JNI_ENOMEM;
|
||||
}
|
||||
}
|
||||
@ -3149,7 +3131,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
|
||||
return JNI_EINVAL;
|
||||
}
|
||||
// management agent in module java.management
|
||||
if (!Arguments::append_to_addmods_property("java.management")) {
|
||||
if (!create_numbered_property("jdk.module.addmods", "java.management", addmods_count++)) {
|
||||
return JNI_ENOMEM;
|
||||
}
|
||||
#else
|
||||
@ -3560,15 +3542,6 @@ jint Arguments::finalize_vm_init_args() {
|
||||
return JNI_ERR;
|
||||
}
|
||||
|
||||
// Append the value of the last --add-modules option specified on the command line.
|
||||
// This needs to be done here, to prevent overwriting possible values written
|
||||
// to the jdk.module.addmods property by -javaagent and other options.
|
||||
if (add_modules_value != NULL) {
|
||||
if (!append_to_addmods_property(add_modules_value)) {
|
||||
return JNI_ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
// This must be done after all arguments have been processed.
|
||||
// java_compiler() true means set to "NONE" or empty.
|
||||
if (java_compiler() && !xdebug_mode()) {
|
||||
@ -3617,7 +3590,8 @@ jint Arguments::finalize_vm_init_args() {
|
||||
#endif
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
if (EnableJVMCI && !append_to_addmods_property("jdk.vm.ci")) {
|
||||
if (EnableJVMCI &&
|
||||
!create_numbered_property("jdk.module.addmods", "jdk.vm.ci", addmods_count++)) {
|
||||
return JNI_ENOMEM;
|
||||
}
|
||||
#endif
|
||||
|
@ -489,9 +489,6 @@ class Arguments : AllStatic {
|
||||
|
||||
static int process_patch_mod_option(const char* patch_mod_tail, bool* patch_mod_javabase);
|
||||
|
||||
// Miscellaneous system property setter
|
||||
static bool append_to_addmods_property(const char* module_name);
|
||||
|
||||
// Aggressive optimization flags.
|
||||
static jint set_aggressive_opts_flags();
|
||||
|
||||
|
@ -280,6 +280,7 @@ class ThreadToNativeFromVM : public ThreadStateTransition {
|
||||
|
||||
~ThreadToNativeFromVM() {
|
||||
trans_from_native(_thread_in_vm);
|
||||
assert(!_thread->is_pending_jni_exception_check(), "Pending JNI Exception Check");
|
||||
// We don't need to clear_walkable because it will happen automagically when we return to java
|
||||
}
|
||||
};
|
||||
|
@ -443,7 +443,7 @@ class os: AllStatic {
|
||||
|
||||
static bool create_thread(Thread* thread,
|
||||
ThreadType thr_type,
|
||||
size_t stack_size = 0);
|
||||
size_t req_stack_size = 0);
|
||||
static bool create_main_thread(JavaThread* thread);
|
||||
static bool create_attached_thread(JavaThread* thread);
|
||||
static void pd_start_thread(Thread* thread);
|
||||
|
@ -621,7 +621,7 @@ JRT_END
|
||||
// ret_pc points into caller; we are returning caller's exception handler
|
||||
// for given exception
|
||||
address SharedRuntime::compute_compiled_exc_handler(CompiledMethod* cm, address ret_pc, Handle& exception,
|
||||
bool force_unwind, bool top_frame_only) {
|
||||
bool force_unwind, bool top_frame_only, bool& recursive_exception_occurred) {
|
||||
assert(cm != NULL, "must exist");
|
||||
ResourceMark rm;
|
||||
|
||||
@ -677,6 +677,7 @@ address SharedRuntime::compute_compiled_exc_handler(CompiledMethod* cm, address
|
||||
// BCI of the exception handler which caused the exception to be
|
||||
// thrown (bugs 4307310 and 4546590). Set "exception" reference
|
||||
// argument to ensure that the correct exception is thrown (4870175).
|
||||
recursive_exception_occurred = true;
|
||||
exception = Handle(THREAD, PENDING_EXCEPTION);
|
||||
CLEAR_PENDING_EXCEPTION;
|
||||
if (handler_bci >= 0) {
|
||||
|
@ -189,7 +189,7 @@ class SharedRuntime: AllStatic {
|
||||
|
||||
// exception handling and implicit exceptions
|
||||
static address compute_compiled_exc_handler(CompiledMethod* nm, address ret_pc, Handle& exception,
|
||||
bool force_unwind, bool top_frame_only);
|
||||
bool force_unwind, bool top_frame_only, bool& recursive_exception_occurred);
|
||||
enum ImplicitExceptionKind {
|
||||
IMPLICIT_NULL,
|
||||
IMPLICIT_DIVIDE_BY_ZERO,
|
||||
|
@ -1542,6 +1542,9 @@ class JavaThread: public Thread {
|
||||
static ByteSize jmp_ring_offset() { return byte_offset_of(JavaThread, _jmp_ring); }
|
||||
#endif // PRODUCT
|
||||
static ByteSize jni_environment_offset() { return byte_offset_of(JavaThread, _jni_environment); }
|
||||
static ByteSize pending_jni_exception_check_fn_offset() {
|
||||
return byte_offset_of(JavaThread, _pending_jni_exception_check_fn);
|
||||
}
|
||||
static ByteSize last_Java_sp_offset() {
|
||||
return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_sp_offset();
|
||||
}
|
||||
@ -1615,7 +1618,11 @@ class JavaThread: public Thread {
|
||||
assert(_jni_active_critical >= 0, "JNI critical nesting problem?");
|
||||
}
|
||||
|
||||
// Checked JNI, is the programmer required to check for exceptions, specify which function name
|
||||
// Checked JNI: is the programmer required to check for exceptions, if so specify
|
||||
// which function name. Returning to a Java frame should implicitly clear the
|
||||
// pending check, this is done for Native->Java transitions (i.e. user JNI code).
|
||||
// VM->Java transistions are not cleared, it is expected that JNI code enclosed
|
||||
// within ThreadToNativeFromVM makes proper exception checks (i.e. VM internal).
|
||||
bool is_pending_jni_exception_check() const { return _pending_jni_exception_check_fn != NULL; }
|
||||
void clear_pending_jni_exception_check() { _pending_jni_exception_check_fn = NULL; }
|
||||
const char* get_pending_jni_exception_check() const { return _pending_jni_exception_check_fn; }
|
||||
|
@ -315,9 +315,9 @@ Declares a structure type that can be used in other events.
|
||||
|
||||
<event id="G1MMU" path="vm/gc/detailed/g1_mmu_info" label="G1 MMU Information" is_instant="true">
|
||||
<value type="UINT" field="gcId" label="GC Identifier" relation="GcId"/>
|
||||
<value type="DOUBLE" field="timeSlice" label="Time Slice" description="Time slice used to calculate MMU"/>
|
||||
<value type="DOUBLE" field="gcTime" label="GC Time" description="Time spent on GC during last time slice"/>
|
||||
<value type="DOUBLE" field="maxGcTime" label="Max GC Time" description="Max time allowed to be spent on GC during last time slice"/>
|
||||
<value type="MILLIS" field="timeSlice" label="Time Slice" description="Time slice used to calculate MMU"/>
|
||||
<value type="MILLIS" field="gcTime" label="GC Time" description="Time stopped because of GC during last time slice"/>
|
||||
<value type="MILLIS" field="pauseTarget" label="Pause Target" description="Max time allowed to be spent on GC during last time slice"/>
|
||||
</event>
|
||||
|
||||
<event id="EvacuationInformation" path="vm/gc/detailed/evacuation_info" label="Evacuation Information" is_instant="true">
|
||||
@ -377,29 +377,29 @@ Declares a structure type that can be used in other events.
|
||||
<structvalue type="G1EvacuationStatistics" field="statistics" label="Evacuation Statistics"/>
|
||||
</event>
|
||||
|
||||
<event id="G1BasicIHOP" path="vm/gc/detailed/g1_basic_ihop_status" label="G1 Basic IHOP statistics"
|
||||
<event id="G1BasicIHOP" path="vm/gc/detailed/g1_basic_ihop_status" label="G1 Basic IHOP Statistics"
|
||||
is_instant="true" description="Basic statistics related to current IHOP calculation">
|
||||
<value type="UINT" field="gcId" label="GC Identifier" relation="GcId"/>
|
||||
<value type="BYTES64" field="threshold" label="Current IHOP threshold" description="Current IHOP threshold in bytes"/>
|
||||
<value type="PERCENTAGE" field="thresholdPercentage" label="Current IHOP threshold in percent" description="Current IHOP threshold in percent of old gen"/>
|
||||
<value type="BYTES64" field="targetOccupancy" label="Target Occupancy" description="Target old gen occupancy to reach at the start of mixed GC in bytes"/>
|
||||
<value type="BYTES64" field="currentOccupancy" label="Current Occupancy" description="Current old generation occupancy in bytes"/>
|
||||
<value type="BYTES64" field="lastAllocationSize" label="Last Mutator Allocation" description="Mutator allocation during mutator operation since last GC in bytes"/>
|
||||
<value type="DOUBLE" field="lastAllocationDuration" label="Last Mutator Operation" description="Time the mutator ran since last GC in seconds"/>
|
||||
<value type="DOUBLE" field="lastAllocationRate" label="Last Mutator Allocation Rate" description="Allocation rate of the mutator since last GC in bytes/second"/>
|
||||
<value type="DOUBLE" field="lastMarkingLength" label="Last Marking Length" description="Last time from the end of the last initial mark to the first mixed GC in seconds"/>
|
||||
<value type="BYTES64" field="threshold" label="Current IHOP Threshold" description="Current IHOP threshold"/>
|
||||
<value type="PERCENTAGE" field="thresholdPercentage" label="Current IHOP Threshold" description="Current IHOP threshold in percent of old generation"/>
|
||||
<value type="BYTES64" field="targetOccupancy" label="Target Occupancy" description="Target old generation occupancy to reach at the start of mixed GC"/>
|
||||
<value type="BYTES64" field="currentOccupancy" label="Current Occupancy" description="Current old generation occupancy"/>
|
||||
<value type="BYTES64" field="recentMutatorAllocationSize" label="Recent Mutator Allocation Size" description="Mutator allocation during mutator operation in the most recent interval"/>
|
||||
<value type="MILLIS" field="recentMutatorDuration" label="Recent Mutator Duration" description="Time the mutator ran in the most recent interval"/>
|
||||
<value type="DOUBLE" field="recentAllocationRate" label="Recent Allocation Rate" description="Allocation rate of the mutator in the most recent interval in bytes/second"/>
|
||||
<value type="MILLIS" field="lastMarkingDuration" label="Last Marking Duration" description="Last time from the end of the last initial mark to the first mixed GC"/>
|
||||
</event>
|
||||
|
||||
<event id="G1AdaptiveIHOP" path="vm/gc/detailed/g1_adaptive_ihop_status" label="G1 Adaptive IHOP statistics"
|
||||
<event id="G1AdaptiveIHOP" path="vm/gc/detailed/g1_adaptive_ihop_status" label="G1 Adaptive IHOP Statistics"
|
||||
is_instant="true" description="Statistics related to current adaptive IHOP calculation">
|
||||
<value type="UINT" field="gcId" label="GC Identifier" relation="GcId"/>
|
||||
<value type="BYTES64" field="threshold" label="Threshold" description="Current IHOP threshold in bytes"/>
|
||||
<value type="PERCENTAGE" field="thresholdPercentage" label="Threshold Percentage" description="Current IHOP threshold in percent of the internal target occupancy"/>
|
||||
<value type="BYTES64" field="internalTargetOccupancy" label="Target Occupancy" description="Internal target old generation occupancy to reach at the start of mixed GC in bytes"/>
|
||||
<value type="BYTES64" field="currentOccupancy" label="Current Occupancy" description="Current old generation occupancy in bytes"/>
|
||||
<value type="BYTES64" field="additionalBufferSize" label="Additional Buffer" description="Additional buffer size in bytes"/>
|
||||
<value type="BYTES64" field="threshold" label="Threshold" description="Current IHOP Threshold"/>
|
||||
<value type="PERCENTAGE" field="thresholdPercentage" label="Threshold" description="Current IHOP threshold in percent of the internal target occupancy"/>
|
||||
<value type="BYTES64" field="ihopTargetOccupancy" label="IHOP Target Occupancy" description="Internal target old generation occupancy to reach at the start of mixed GC"/>
|
||||
<value type="BYTES64" field="currentOccupancy" label="Current Occupancy" description="Current old generation occupancy"/>
|
||||
<value type="BYTES64" field="additionalBufferSize" label="Additional Buffer" description="Additional buffer size" experimental="true"/>
|
||||
<value type="DOUBLE" field="predictedAllocationRate" label="Predicted Allocation Rate" description="Current predicted allocation rate for the mutator in bytes/second"/>
|
||||
<value type="DOUBLE" field="predictedMarkingLength" label="Predicted Marking Length" description="Current predicted time from the end of the last initial mark to the first mixed GC in seconds"/>
|
||||
<value type="MILLIS" field="predictedMarkingDuration" label="Predicted Marking Duration" description="Current predicted time from the end of the last initial mark to the first mixed GC"/>
|
||||
<value type="BOOLEAN" field="predictionActive" label="Prediction Active" description="Indicates whether the adaptive IHOP prediction is active"/>
|
||||
</event>
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user