mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-05 13:40:18 +00:00
Merge
This commit is contained in:
commit
ea3671c0ba
1
.hgtags
1
.hgtags
@ -379,3 +379,4 @@ e17429a7e843c4a4ed3651458d0f950970edcbcc jdk-9+133
|
||||
a71210c0d9800eb6925b61ecd6198abd554f90ee jdk-9+134
|
||||
e384420383a5b79fa0012ebcb25d8f83cff7f777 jdk-9+135
|
||||
1b4b5d01aa11edf24b6fadbe3d2f3e411e3b02cd jdk-9+136
|
||||
9cb87c88ed851c0575b8ead753ea238ed5b544e9 jdk-9+137
|
||||
|
||||
@ -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: {
|
||||
|
||||
@ -379,3 +379,4 @@ f7e1d5337c2e550fe553df7a3886bbed80292ecd jdk-9+131
|
||||
1a497f5ca0cfd88115cc7daa8af8a62b8741caf2 jdk-9+134
|
||||
094d0db606db976045f594dba47d4593b715cc81 jdk-9+135
|
||||
aa053a3faf266c12b4fd5272da431a3e08e4a3e3 jdk-9+136
|
||||
258cf18fa7fc59359b874f8743b7168dc48baf73 jdk-9+137
|
||||
|
||||
@ -539,3 +539,5 @@ a25e0fb6033245ab075136e744d362ce765464cd jdk-9+133
|
||||
b8b694c6b4d2ab0939aed7adaf0eec1ac321a085 jdk-9+134
|
||||
3b1c4562953db47e36b237a500f368d5c9746d47 jdk-9+135
|
||||
a20da289f646ee44440695b81abc0548330e4ca7 jdk-9+136
|
||||
dfcbf839e299e7e2bba1da69bdb347617ea4c7e8 jdk-9+137
|
||||
fc0956308c7a586267c5dd35dff74f773aa9c3eb jdk-9+138
|
||||
|
||||
@ -1575,6 +1575,9 @@ class Assembler : public AbstractAssembler {
|
||||
inline void stdu( Register d, int si16, Register s1);
|
||||
inline void stdux(Register s, Register a, Register b);
|
||||
|
||||
inline void st_ptr(Register d, int si16, Register s1);
|
||||
DEBUG_ONLY(inline void st_ptr(Register d, ByteSize b, Register s1);)
|
||||
|
||||
// PPC 1, section 3.3.13 Move To/From System Register Instructions
|
||||
inline void mtlr( Register s1);
|
||||
inline void mflr( Register d);
|
||||
|
||||
@ -349,6 +349,9 @@ inline void Assembler::stdx( Register d, Register s1, Register s2) { emit_int32(
|
||||
inline void Assembler::stdu( Register d, int si16, Register s1) { emit_int32(STDU_OPCODE | rs(d) | ds(si16) | rta0mem(s1));}
|
||||
inline void Assembler::stdux(Register s, Register a, Register b) { emit_int32(STDUX_OPCODE| rs(s) | rta0mem(a) | rb(b));}
|
||||
|
||||
inline void Assembler::st_ptr(Register d, int b, Register s1) { std(d, b, s1); }
|
||||
DEBUG_ONLY(inline void Assembler::st_ptr(Register d, ByteSize b, Register s1) { std(d, in_bytes(b), s1); })
|
||||
|
||||
// PPC 1, section 3.3.13 Move To/From System Register Instructions
|
||||
inline void Assembler::mtlr( Register s1) { emit_int32(MTLR_OPCODE | rs(s1)); }
|
||||
inline void Assembler::mflr( Register d ) { emit_int32(MFLR_OPCODE | rt(d)); }
|
||||
|
||||
@ -261,6 +261,9 @@ void InterpreterMacroAssembler::push_ptr(Register r) {
|
||||
}
|
||||
|
||||
void InterpreterMacroAssembler::push_l(Register r) {
|
||||
// Clear unused slot.
|
||||
load_const_optimized(R0, 0L);
|
||||
std(R0, 0, R15_esp);
|
||||
std(r, - Interpreter::stackElementSize, R15_esp);
|
||||
addi(R15_esp, R15_esp, - 2 * Interpreter::stackElementSize );
|
||||
}
|
||||
|
||||
@ -2489,6 +2489,11 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
|
||||
__ verify_oop(R3_RET);
|
||||
}
|
||||
|
||||
if (CheckJNICalls) {
|
||||
// clear_pending_jni_exception_check
|
||||
__ load_const_optimized(R0, 0L);
|
||||
__ st_ptr(R0, JavaThread::pending_jni_exception_check_fn_offset(), R16_thread);
|
||||
}
|
||||
|
||||
// Reset handle block.
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
@ -1544,6 +1544,12 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
__ fence();
|
||||
}
|
||||
|
||||
if (CheckJNICalls) {
|
||||
// clear_pending_jni_exception_check
|
||||
__ load_const_optimized(R0, 0L);
|
||||
__ st_ptr(R0, JavaThread::pending_jni_exception_check_fn_offset(), R16_thread);
|
||||
}
|
||||
|
||||
__ reset_last_Java_frame();
|
||||
|
||||
// Jvmdi/jvmpi support. Whether we've got an exception pending or
|
||||
|
||||
@ -2366,7 +2366,9 @@ bool os::win32::get_frame_at_stack_banging_point(JavaThread* thread,
|
||||
if (Interpreter::contains(pc)) {
|
||||
*fr = os::fetch_frame_from_context((void*)exceptionInfo->ContextRecord);
|
||||
if (!fr->is_first_java_frame()) {
|
||||
assert(fr->safe_for_sender(thread), "Safety check");
|
||||
// get_frame_at_stack_banging_point() is only called when we
|
||||
// have well defined stacks so java_sender() calls do not need
|
||||
// to assert safe_for_sender() first.
|
||||
*fr = fr->java_sender();
|
||||
}
|
||||
} else {
|
||||
@ -2383,7 +2385,7 @@ bool os::win32::get_frame_at_stack_banging_point(JavaThread* thread,
|
||||
// has been pushed on the stack
|
||||
*fr = frame(fr->sp() + 1, fr->fp(), (address)*(fr->sp()));
|
||||
if (!fr->is_java_frame()) {
|
||||
assert(fr->safe_for_sender(thread), "Safety check");
|
||||
// See java_sender() comment above.
|
||||
*fr = fr->java_sender();
|
||||
}
|
||||
}
|
||||
|
||||
@ -378,7 +378,9 @@ bool os::Bsd::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* u
|
||||
// method returns the Java sender of the current frame.
|
||||
*fr = os::fetch_frame_from_ucontext(thread, uc);
|
||||
if (!fr->is_first_java_frame()) {
|
||||
assert(fr->safe_for_sender(thread), "Safety check");
|
||||
// get_frame_at_stack_banging_point() is only called when we
|
||||
// have well defined stacks so java_sender() calls do not need
|
||||
// to assert safe_for_sender() first.
|
||||
*fr = fr->java_sender();
|
||||
}
|
||||
} else {
|
||||
@ -395,7 +397,7 @@ bool os::Bsd::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* u
|
||||
// has been pushed on the stack
|
||||
*fr = frame(fr->sp() + 1, fr->fp(), (address)*(fr->sp()));
|
||||
if (!fr->is_java_frame()) {
|
||||
assert(fr->safe_for_sender(thread), "Safety check");
|
||||
// See java_sender() comment above.
|
||||
*fr = fr->java_sender();
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,7 +191,9 @@ bool os::Linux::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t*
|
||||
// method returns the Java sender of the current frame.
|
||||
*fr = os::fetch_frame_from_ucontext(thread, uc);
|
||||
if (!fr->is_first_java_frame()) {
|
||||
assert(fr->safe_for_sender(thread), "Safety check");
|
||||
// get_frame_at_stack_banging_point() is only called when we
|
||||
// have well defined stacks so java_sender() calls do not need
|
||||
// to assert safe_for_sender() first.
|
||||
*fr = fr->java_sender();
|
||||
}
|
||||
} else {
|
||||
@ -209,8 +211,8 @@ bool os::Linux::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t*
|
||||
intptr_t* sp = os::Linux::ucontext_get_sp(uc);
|
||||
*fr = frame(sp + 1, fp, (address)*sp);
|
||||
if (!fr->is_java_frame()) {
|
||||
assert(fr->safe_for_sender(thread), "Safety check");
|
||||
assert(!fr->is_first_frame(), "Safety check");
|
||||
// See java_sender() comment above.
|
||||
*fr = fr->java_sender();
|
||||
}
|
||||
}
|
||||
|
||||
@ -255,7 +255,9 @@ bool os::Solaris::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_
|
||||
// method returns the Java sender of the current frame.
|
||||
*fr = os::fetch_frame_from_ucontext(thread, uc);
|
||||
if (!fr->is_first_java_frame()) {
|
||||
assert(fr->safe_for_sender(thread), "Safety check");
|
||||
// get_frame_at_stack_banging_point() is only called when we
|
||||
// have well defined stacks so java_sender() calls do not need
|
||||
// to assert safe_for_sender() first.
|
||||
*fr = fr->java_sender();
|
||||
}
|
||||
} else {
|
||||
@ -273,7 +275,7 @@ bool os::Solaris::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_
|
||||
intptr_t* sp = os::Solaris::ucontext_get_sp(uc);
|
||||
*fr = frame(sp + 1, fp, (address)*sp);
|
||||
if (!fr->is_java_frame()) {
|
||||
assert(fr->safe_for_sender(thread), "Safety check");
|
||||
// See java_sender() comment above.
|
||||
*fr = fr->java_sender();
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,7 +81,6 @@ typedef void * * (JNICALL *ZipOpen_t)(const char *name, char **pmsg);
|
||||
typedef void (JNICALL *ZipClose_t)(jzfile *zip);
|
||||
typedef jzentry* (JNICALL *FindEntry_t)(jzfile *zip, const char *name, jint *sizeP, jint *nameLen);
|
||||
typedef jboolean (JNICALL *ReadEntry_t)(jzfile *zip, jzentry *entry, unsigned char *buf, char *namebuf);
|
||||
typedef jboolean (JNICALL *ReadMappedEntry_t)(jzfile *zip, jzentry *entry, unsigned char **buf, char *namebuf);
|
||||
typedef jzentry* (JNICALL *GetNextEntry_t)(jzfile *zip, jint n);
|
||||
typedef jboolean (JNICALL *ZipInflateFully_t)(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg);
|
||||
typedef jint (JNICALL *Crc32_t)(jint crc, const jbyte *buf, jint len);
|
||||
@ -91,7 +90,6 @@ static ZipOpen_t ZipOpen = NULL;
|
||||
static ZipClose_t ZipClose = NULL;
|
||||
static FindEntry_t FindEntry = NULL;
|
||||
static ReadEntry_t ReadEntry = NULL;
|
||||
static ReadMappedEntry_t ReadMappedEntry = NULL;
|
||||
static GetNextEntry_t GetNextEntry = NULL;
|
||||
static canonicalize_fn_t CanonicalizeEntry = NULL;
|
||||
static ZipInflateFully_t ZipInflateFully = NULL;
|
||||
@ -353,15 +351,10 @@ u1* ClassPathZipEntry::open_entry(const char* name, jint* filesize, bool nul_ter
|
||||
filename = NEW_RESOURCE_ARRAY(char, name_len + 1);
|
||||
}
|
||||
|
||||
// file found, get pointer to the entry in mmapped jar file.
|
||||
if (ReadMappedEntry == NULL ||
|
||||
!(*ReadMappedEntry)(_zip, entry, &buffer, filename)) {
|
||||
// mmapped access not available, perhaps due to compression,
|
||||
// read contents into resource array
|
||||
int size = (*filesize) + ((nul_terminate) ? 1 : 0);
|
||||
buffer = NEW_RESOURCE_ARRAY(u1, size);
|
||||
if (!(*ReadEntry)(_zip, entry, buffer, filename)) return NULL;
|
||||
}
|
||||
// read contents into resource array
|
||||
int size = (*filesize) + ((nul_terminate) ? 1 : 0);
|
||||
buffer = NEW_RESOURCE_ARRAY(u1, size);
|
||||
if (!(*ReadEntry)(_zip, entry, buffer, filename)) return NULL;
|
||||
|
||||
// return result
|
||||
if (nul_terminate) {
|
||||
@ -1079,7 +1072,6 @@ void ClassLoader::load_zip_library() {
|
||||
ZipClose = CAST_TO_FN_PTR(ZipClose_t, os::dll_lookup(handle, "ZIP_Close"));
|
||||
FindEntry = CAST_TO_FN_PTR(FindEntry_t, os::dll_lookup(handle, "ZIP_FindEntry"));
|
||||
ReadEntry = CAST_TO_FN_PTR(ReadEntry_t, os::dll_lookup(handle, "ZIP_ReadEntry"));
|
||||
ReadMappedEntry = CAST_TO_FN_PTR(ReadMappedEntry_t, os::dll_lookup(handle, "ZIP_ReadMappedEntry"));
|
||||
GetNextEntry = CAST_TO_FN_PTR(GetNextEntry_t, os::dll_lookup(handle, "ZIP_GetNextEntry"));
|
||||
ZipInflateFully = CAST_TO_FN_PTR(ZipInflateFully_t, os::dll_lookup(handle, "ZIP_InflateFully"));
|
||||
Crc32 = CAST_TO_FN_PTR(Crc32_t, os::dll_lookup(handle, "ZIP_CRC32"));
|
||||
|
||||
@ -540,7 +540,7 @@ class CMSCollector: public CHeapObj<mtGC> {
|
||||
|
||||
// Overflow list of grey objects, threaded through mark-word
|
||||
// Manipulated with CAS in the parallel/multi-threaded case.
|
||||
oop _overflow_list;
|
||||
oopDesc* volatile _overflow_list;
|
||||
// The following array-pair keeps track of mark words
|
||||
// displaced for accommodating overflow list above.
|
||||
// This code will likely be revisited under RFE#4922830.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -323,7 +323,7 @@ class ParNewGeneration: public DefNewGeneration {
|
||||
// A list of from-space images of to-be-scanned objects, threaded through
|
||||
// klass-pointers (klass information already copied to the forwarded
|
||||
// image.) Manipulated with CAS.
|
||||
oop _overflow_list;
|
||||
oopDesc* volatile _overflow_list;
|
||||
NOT_PRODUCT(ssize_t _num_par_pushes;)
|
||||
|
||||
// This closure is used by the reference processor to filter out
|
||||
|
||||
@ -81,47 +81,6 @@ G1StaticIHOPControl::G1StaticIHOPControl(double ihop_percent) :
|
||||
_last_marking_length_s(0.0) {
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
static void test_update(G1IHOPControl* ctrl, double alloc_time, size_t alloc_amount, size_t young_size, double mark_time) {
|
||||
for (int i = 0; i < 100; i++) {
|
||||
ctrl->update_allocation_info(alloc_time, alloc_amount, young_size);
|
||||
ctrl->update_marking_length(mark_time);
|
||||
}
|
||||
}
|
||||
|
||||
void G1StaticIHOPControl::test() {
|
||||
size_t const initial_ihop = 45;
|
||||
|
||||
G1StaticIHOPControl ctrl(initial_ihop);
|
||||
ctrl.update_target_occupancy(100);
|
||||
|
||||
size_t threshold = ctrl.get_conc_mark_start_threshold();
|
||||
assert(threshold == initial_ihop,
|
||||
"Expected IHOP threshold of " SIZE_FORMAT " but is " SIZE_FORMAT, initial_ihop, threshold);
|
||||
|
||||
ctrl.update_allocation_info(100.0, 100, 100);
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
assert(threshold == initial_ihop,
|
||||
"Expected IHOP threshold of " SIZE_FORMAT " but is " SIZE_FORMAT, initial_ihop, threshold);
|
||||
|
||||
ctrl.update_marking_length(1000.0);
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
assert(threshold == initial_ihop,
|
||||
"Expected IHOP threshold of " SIZE_FORMAT " but is " SIZE_FORMAT, initial_ihop, threshold);
|
||||
|
||||
// Whatever we pass, the IHOP value must stay the same.
|
||||
test_update(&ctrl, 2, 10, 10, 3);
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
assert(threshold == initial_ihop,
|
||||
"Expected IHOP threshold of " SIZE_FORMAT " but is " SIZE_FORMAT, initial_ihop, threshold);
|
||||
|
||||
test_update(&ctrl, 12, 10, 10, 3);
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
assert(threshold == initial_ihop,
|
||||
"Expected IHOP threshold of " SIZE_FORMAT " but is " SIZE_FORMAT, initial_ihop, threshold);
|
||||
}
|
||||
#endif
|
||||
|
||||
G1AdaptiveIHOPControl::G1AdaptiveIHOPControl(double ihop_percent,
|
||||
G1Predictions const* predictor,
|
||||
size_t heap_reserve_percent,
|
||||
@ -224,79 +183,3 @@ void G1AdaptiveIHOPControl::send_trace_event(G1NewTracer* tracer) {
|
||||
_predictor->get_new_prediction(&_marking_times_s),
|
||||
have_enough_data_for_prediction());
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
void G1AdaptiveIHOPControl::test() {
|
||||
size_t const initial_threshold = 45;
|
||||
size_t const young_size = 10;
|
||||
size_t const target_size = 100;
|
||||
|
||||
// The final IHOP value is always
|
||||
// target_size - (young_size + alloc_amount/alloc_time * marking_time)
|
||||
|
||||
G1Predictions pred(0.95);
|
||||
G1AdaptiveIHOPControl ctrl(initial_threshold, &pred, 0, 0);
|
||||
ctrl.update_target_occupancy(target_size);
|
||||
|
||||
// First "load".
|
||||
size_t const alloc_time1 = 2;
|
||||
size_t const alloc_amount1 = 10;
|
||||
size_t const marking_time1 = 2;
|
||||
size_t const settled_ihop1 = target_size - (young_size + alloc_amount1/alloc_time1 * marking_time1);
|
||||
|
||||
size_t threshold;
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
assert(threshold == initial_threshold,
|
||||
"Expected IHOP threshold of " SIZE_FORMAT " but is " SIZE_FORMAT, initial_threshold, threshold);
|
||||
for (size_t i = 0; i < G1AdaptiveIHOPNumInitialSamples - 1; i++) {
|
||||
ctrl.update_allocation_info(alloc_time1, alloc_amount1, young_size);
|
||||
ctrl.update_marking_length(marking_time1);
|
||||
// Not enough data yet.
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
assert(threshold == initial_threshold,
|
||||
"Expected IHOP threshold of " SIZE_FORMAT " but is " SIZE_FORMAT, initial_threshold, threshold);
|
||||
}
|
||||
|
||||
test_update(&ctrl, alloc_time1, alloc_amount1, young_size, marking_time1);
|
||||
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
assert(threshold == settled_ihop1,
|
||||
"Expected IHOP threshold to settle at " SIZE_FORMAT " but is " SIZE_FORMAT, settled_ihop1, threshold);
|
||||
|
||||
// Second "load". A bit higher allocation rate.
|
||||
size_t const alloc_time2 = 2;
|
||||
size_t const alloc_amount2 = 30;
|
||||
size_t const marking_time2 = 2;
|
||||
size_t const settled_ihop2 = target_size - (young_size + alloc_amount2/alloc_time2 * marking_time2);
|
||||
|
||||
test_update(&ctrl, alloc_time2, alloc_amount2, young_size, marking_time2);
|
||||
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
assert(threshold < settled_ihop1,
|
||||
"Expected IHOP threshold to settle at a value lower than " SIZE_FORMAT " but is " SIZE_FORMAT, settled_ihop1, threshold);
|
||||
|
||||
// Third "load". Very high (impossible) allocation rate.
|
||||
size_t const alloc_time3 = 1;
|
||||
size_t const alloc_amount3 = 50;
|
||||
size_t const marking_time3 = 2;
|
||||
size_t const settled_ihop3 = 0;
|
||||
|
||||
test_update(&ctrl, alloc_time3, alloc_amount3, young_size, marking_time3);
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
|
||||
assert(threshold == settled_ihop3,
|
||||
"Expected IHOP threshold to settle at " SIZE_FORMAT " but is " SIZE_FORMAT, settled_ihop3, threshold);
|
||||
|
||||
// And back to some arbitrary value.
|
||||
test_update(&ctrl, alloc_time2, alloc_amount2, young_size, marking_time2);
|
||||
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
assert(threshold > settled_ihop3,
|
||||
"Expected IHOP threshold to settle at value larger than " SIZE_FORMAT " but is " SIZE_FORMAT, settled_ihop3, threshold);
|
||||
}
|
||||
|
||||
void IHOP_test() {
|
||||
G1StaticIHOPControl::test();
|
||||
G1AdaptiveIHOPControl::test();
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -99,10 +99,6 @@ class G1StaticIHOPControl : public G1IHOPControl {
|
||||
assert(marking_length_s > 0.0, "Marking length must be larger than zero but is %.3f", marking_length_s);
|
||||
_last_marking_length_s = marking_length_s;
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
static void test();
|
||||
#endif
|
||||
};
|
||||
|
||||
// This algorithm tries to return a concurrent mark starting occupancy value that
|
||||
@ -148,9 +144,6 @@ class G1AdaptiveIHOPControl : public G1IHOPControl {
|
||||
|
||||
virtual void print();
|
||||
virtual void send_trace_event(G1NewTracer* tracer);
|
||||
#ifndef PRODUCT
|
||||
static void test();
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_GC_G1_G1IHOPCONTROL_HPP
|
||||
|
||||
@ -668,20 +668,18 @@ bool G1RemSet::refine_card(jbyte* card_ptr,
|
||||
// fail arbitrarily). We tell the iteration code to perform this
|
||||
// filtering when it has been determined that there has been an actual
|
||||
// allocation in this region and making it safe to check the young type.
|
||||
bool filter_young = true;
|
||||
|
||||
HeapWord* stop_point =
|
||||
bool card_processed =
|
||||
r->oops_on_card_seq_iterate_careful(dirtyRegion,
|
||||
&filter_then_update_rs_oop_cl,
|
||||
filter_young,
|
||||
card_ptr);
|
||||
|
||||
// If stop_point is non-null, then we encountered an unallocated region
|
||||
// (perhaps the unfilled portion of a TLAB.) For now, we'll dirty the
|
||||
// card and re-enqueue: if we put off the card until a GC pause, then the
|
||||
// unallocated portion will be filled in. Alternatively, we might try
|
||||
// the full complexity of the technique used in "regular" precleaning.
|
||||
if (stop_point != NULL) {
|
||||
// If unable to process the card then we encountered an unparsable
|
||||
// part of the heap (e.g. a partially allocated object). Redirty
|
||||
// and re-enqueue: if we put off the card until a GC pause, then the
|
||||
// allocation will have completed.
|
||||
if (!card_processed) {
|
||||
assert(!_g1->is_gc_active(), "Unparsable heap during GC");
|
||||
// The card might have gotten re-dirtied and re-enqueued while we
|
||||
// worked. (In fact, it's pretty likely.)
|
||||
if (*card_ptr != CardTableModRefBS::dirty_card_val()) {
|
||||
|
||||
@ -352,19 +352,10 @@ void HeapRegion::note_self_forwarding_removal_end(bool during_initial_mark,
|
||||
_prev_marked_bytes = marked_bytes;
|
||||
}
|
||||
|
||||
HeapWord*
|
||||
HeapRegion::
|
||||
oops_on_card_seq_iterate_careful(MemRegion mr,
|
||||
FilterOutOfRegionClosure* cl,
|
||||
bool filter_young,
|
||||
jbyte* card_ptr) {
|
||||
// Currently, we should only have to clean the card if filter_young
|
||||
// is true and vice versa.
|
||||
if (filter_young) {
|
||||
assert(card_ptr != NULL, "pre-condition");
|
||||
} else {
|
||||
assert(card_ptr == NULL, "pre-condition");
|
||||
}
|
||||
bool HeapRegion::oops_on_card_seq_iterate_careful(MemRegion mr,
|
||||
FilterOutOfRegionClosure* cl,
|
||||
jbyte* card_ptr) {
|
||||
assert(card_ptr != NULL, "pre-condition");
|
||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||
|
||||
// If we're within a stop-world GC, then we might look at a card in a
|
||||
@ -375,7 +366,9 @@ oops_on_card_seq_iterate_careful(MemRegion mr,
|
||||
} else {
|
||||
mr = mr.intersection(used_region());
|
||||
}
|
||||
if (mr.is_empty()) return NULL;
|
||||
if (mr.is_empty()) {
|
||||
return true;
|
||||
}
|
||||
// Otherwise, find the obj that extends onto mr.start().
|
||||
|
||||
// The intersection of the incoming mr (for the card) and the
|
||||
@ -384,27 +377,21 @@ oops_on_card_seq_iterate_careful(MemRegion mr,
|
||||
// G1CollectedHeap.cpp that allocates a new region sets the
|
||||
// is_young tag on the region before allocating. Thus we
|
||||
// safely know if this region is young.
|
||||
if (is_young() && filter_young) {
|
||||
return NULL;
|
||||
if (is_young()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
assert(!is_young(), "check value of filter_young");
|
||||
|
||||
// We can only clean the card here, after we make the decision that
|
||||
// the card is not young. And we only clean the card if we have been
|
||||
// asked to (i.e., card_ptr != NULL).
|
||||
if (card_ptr != NULL) {
|
||||
*card_ptr = CardTableModRefBS::clean_card_val();
|
||||
// We must complete this write before we do any of the reads below.
|
||||
OrderAccess::storeload();
|
||||
}
|
||||
// the card is not young.
|
||||
*card_ptr = CardTableModRefBS::clean_card_val();
|
||||
// We must complete this write before we do any of the reads below.
|
||||
OrderAccess::storeload();
|
||||
|
||||
// Cache the boundaries of the memory region in some const locals
|
||||
HeapWord* const start = mr.start();
|
||||
HeapWord* const end = mr.end();
|
||||
|
||||
// We used to use "block_start_careful" here. But we're actually happy
|
||||
// to update the BOT while we do this...
|
||||
// Update BOT as needed while finding start of (potential) object.
|
||||
HeapWord* cur = block_start(start);
|
||||
assert(cur <= start, "Postcondition");
|
||||
|
||||
@ -416,7 +403,9 @@ oops_on_card_seq_iterate_careful(MemRegion mr,
|
||||
obj = oop(cur);
|
||||
if (obj->klass_or_null() == NULL) {
|
||||
// Ran into an unparseable point.
|
||||
return cur;
|
||||
assert(!g1h->is_gc_active(),
|
||||
"Unparsable heap during GC at " PTR_FORMAT, p2i(cur));
|
||||
return false;
|
||||
}
|
||||
// Otherwise...
|
||||
next = cur + block_size(cur);
|
||||
@ -433,7 +422,9 @@ oops_on_card_seq_iterate_careful(MemRegion mr,
|
||||
assert((cur + block_size(cur)) > (HeapWord*)obj, "Loop invariant");
|
||||
if (obj->klass_or_null() == NULL) {
|
||||
// Ran into an unparseable point.
|
||||
return cur;
|
||||
assert(!g1h->is_gc_active(),
|
||||
"Unparsable heap during GC at " PTR_FORMAT, p2i(cur));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Advance the current pointer. "obj" still points to the object to iterate.
|
||||
@ -452,7 +443,7 @@ oops_on_card_seq_iterate_careful(MemRegion mr,
|
||||
}
|
||||
} while (cur < end);
|
||||
|
||||
return NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Code roots support
|
||||
|
||||
@ -653,16 +653,17 @@ class HeapRegion: public G1ContiguousSpace {
|
||||
}
|
||||
}
|
||||
|
||||
// filter_young: if true and the region is a young region then we
|
||||
// skip the iteration.
|
||||
// card_ptr: if not NULL, and we decide that the card is not young
|
||||
// and we iterate over it, we'll clean the card before we start the
|
||||
// iteration.
|
||||
HeapWord*
|
||||
oops_on_card_seq_iterate_careful(MemRegion mr,
|
||||
FilterOutOfRegionClosure* cl,
|
||||
bool filter_young,
|
||||
jbyte* card_ptr);
|
||||
// Iterate over the card in the card designated by card_ptr,
|
||||
// applying cl to all references in the region.
|
||||
// mr: the memory region covered by the card.
|
||||
// card_ptr: if we decide that the card is not young and we iterate
|
||||
// over it, we'll clean the card before we start the iteration.
|
||||
// Returns true if card was successfully processed, false if an
|
||||
// unparsable part of the heap was encountered, which should only
|
||||
// happen when invoked concurrently with the mutator.
|
||||
bool oops_on_card_seq_iterate_careful(MemRegion mr,
|
||||
FilterOutOfRegionClosure* cl,
|
||||
jbyte* card_ptr);
|
||||
|
||||
size_t recorded_rs_length() const { return _recorded_rs_length; }
|
||||
double predicted_elapsed_time_ms() const { return _predicted_elapsed_time_ms; }
|
||||
|
||||
@ -482,8 +482,9 @@ void HeapRegionManager::verify_optional() {
|
||||
HeapRegionClaimer::HeapRegionClaimer(uint n_workers) :
|
||||
_n_workers(n_workers), _n_regions(G1CollectedHeap::heap()->_hrm._allocated_heapregions_length), _claims(NULL) {
|
||||
assert(n_workers > 0, "Need at least one worker.");
|
||||
_claims = NEW_C_HEAP_ARRAY(uint, _n_regions, mtGC);
|
||||
memset(_claims, Unclaimed, sizeof(*_claims) * _n_regions);
|
||||
uint* new_claims = NEW_C_HEAP_ARRAY(uint, _n_regions, mtGC);
|
||||
memset(new_claims, Unclaimed, sizeof(*_claims) * _n_regions);
|
||||
_claims = new_claims;
|
||||
}
|
||||
|
||||
HeapRegionClaimer::~HeapRegionClaimer() {
|
||||
|
||||
@ -259,9 +259,9 @@ public:
|
||||
// The HeapRegionClaimer is used during parallel iteration over heap regions,
|
||||
// allowing workers to claim heap regions, gaining exclusive rights to these regions.
|
||||
class HeapRegionClaimer : public StackObj {
|
||||
uint _n_workers;
|
||||
uint _n_regions;
|
||||
uint* _claims;
|
||||
uint _n_workers;
|
||||
uint _n_regions;
|
||||
volatile uint* _claims;
|
||||
|
||||
static const uint Unclaimed = 0;
|
||||
static const uint Claimed = 1;
|
||||
@ -285,4 +285,3 @@ class HeapRegionClaimer : public StackObj {
|
||||
bool claim_region(uint region_index);
|
||||
};
|
||||
#endif // SHARE_VM_GC_G1_HEAPREGIONMANAGER_HPP
|
||||
|
||||
|
||||
@ -97,11 +97,7 @@ static bool is_regular_file(const char* filename) {
|
||||
if (ret != 0) {
|
||||
return false;
|
||||
}
|
||||
#ifdef _WINDOWS
|
||||
return (st.st_mode & S_IFMT) == _S_IFREG;
|
||||
#else
|
||||
return S_ISREG(st.st_mode);
|
||||
#endif
|
||||
return (st.st_mode & S_IFMT) == S_IFREG;
|
||||
}
|
||||
|
||||
// Try to find the next number that should be used for file rotation.
|
||||
|
||||
@ -105,6 +105,7 @@
|
||||
LOG_TAG(scavenge) \
|
||||
LOG_TAG(scrub) \
|
||||
LOG_TAG(stacktrace) \
|
||||
LOG_TAG(stackwalk) \
|
||||
LOG_TAG(start) \
|
||||
LOG_TAG(startuptime) \
|
||||
LOG_TAG(state) \
|
||||
|
||||
@ -263,7 +263,7 @@ void FileMapInfo::allocate_classpath_entry_table() {
|
||||
} else {
|
||||
struct stat st;
|
||||
if (os::stat(name, &st) == 0) {
|
||||
if ((st.st_mode & S_IFDIR) == S_IFDIR) {
|
||||
if ((st.st_mode & S_IFMT) == S_IFDIR) {
|
||||
if (!os::dir_is_empty(name)) {
|
||||
ClassLoader::exit_with_path_failure(
|
||||
"Cannot have non-empty directory in archived classpaths", name);
|
||||
|
||||
@ -83,6 +83,7 @@ class oopDesc {
|
||||
|
||||
inline Klass* klass() const;
|
||||
inline Klass* klass_or_null() const volatile;
|
||||
inline Klass* klass_or_null_acquire() const volatile;
|
||||
inline Klass** klass_addr();
|
||||
inline narrowKlass* compressed_klass_addr();
|
||||
|
||||
|
||||
@ -109,7 +109,6 @@ Klass* oopDesc::klass() const {
|
||||
}
|
||||
|
||||
Klass* oopDesc::klass_or_null() const volatile {
|
||||
// can be NULL in CMS
|
||||
if (UseCompressedClassPointers) {
|
||||
return Klass::decode_klass(_metadata._compressed_klass);
|
||||
} else {
|
||||
@ -117,6 +116,17 @@ Klass* oopDesc::klass_or_null() const volatile {
|
||||
}
|
||||
}
|
||||
|
||||
Klass* oopDesc::klass_or_null_acquire() const volatile {
|
||||
if (UseCompressedClassPointers) {
|
||||
// Workaround for non-const load_acquire parameter.
|
||||
const volatile narrowKlass* addr = &_metadata._compressed_klass;
|
||||
volatile narrowKlass* xaddr = const_cast<volatile narrowKlass*>(addr);
|
||||
return Klass::decode_klass(OrderAccess::load_acquire(xaddr));
|
||||
} else {
|
||||
return (Klass*)OrderAccess::load_ptr_acquire(&_metadata._klass);
|
||||
}
|
||||
}
|
||||
|
||||
Klass** oopDesc::klass_addr() {
|
||||
// Only used internally and with CMS and will not work with
|
||||
// UseCompressedOops
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
#include "classfile/javaClasses.hpp"
|
||||
#include "classfile/javaClasses.inline.hpp"
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "memory/oopFactory.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/objArrayOop.inline.hpp"
|
||||
@ -105,10 +106,8 @@ int StackWalk::fill_in_frames(jlong mode, BaseFrameStream& stream,
|
||||
int max_nframes, int start_index,
|
||||
objArrayHandle frames_array,
|
||||
int& end_index, TRAPS) {
|
||||
if (TraceStackWalk) {
|
||||
tty->print_cr("fill_in_frames limit=%d start=%d frames length=%d",
|
||||
max_nframes, start_index, frames_array->length());
|
||||
}
|
||||
log_debug(stackwalk)("fill_in_frames limit=%d start=%d frames length=%d",
|
||||
max_nframes, start_index, frames_array->length());
|
||||
assert(max_nframes > 0, "invalid max_nframes");
|
||||
assert(start_index + max_nframes <= frames_array->length(), "oob");
|
||||
|
||||
@ -122,18 +121,24 @@ int StackWalk::fill_in_frames(jlong mode, BaseFrameStream& stream,
|
||||
// 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();
|
||||
tty->print("\n");
|
||||
if (log_is_enabled(Debug, stackwalk)) {
|
||||
ResourceMark rm(THREAD);
|
||||
outputStream* st = Log(stackwalk)::debug_stream();
|
||||
st->print(" hidden method: ");
|
||||
method->print_short_name(st);
|
||||
st->cr();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
int index = end_index++;
|
||||
if (TraceStackWalk) {
|
||||
tty->print(" %d: frame method: ", index); method->print_short_name();
|
||||
tty->print_cr(" bci=%d", stream.bci());
|
||||
if (log_is_enabled(Debug, stackwalk)) {
|
||||
ResourceMark rm(THREAD);
|
||||
outputStream* st = Log(stackwalk)::debug_stream();
|
||||
st->print(" %d: frame method: ", index);
|
||||
method->print_short_name(st);
|
||||
st->print_cr(" bci=%d", stream.bci());
|
||||
}
|
||||
|
||||
if (!need_method_info(mode) && get_caller_class(mode) &&
|
||||
@ -317,10 +322,8 @@ oop StackWalk::walk(Handle stackStream, jlong mode,
|
||||
TRAPS) {
|
||||
ResourceMark rm(THREAD);
|
||||
JavaThread* jt = (JavaThread*)THREAD;
|
||||
if (TraceStackWalk) {
|
||||
tty->print_cr("Start walking: mode " JLONG_FORMAT " skip %d frames batch size %d",
|
||||
mode, skip_frames, frame_count);
|
||||
}
|
||||
log_debug(stackwalk)("Start walking: mode " JLONG_FORMAT " skip %d frames batch size %d",
|
||||
mode, skip_frames, frame_count);
|
||||
|
||||
if (frames_array.is_null()) {
|
||||
THROW_MSG_(vmSymbols::java_lang_NullPointerException(), "frames_array is NULL", NULL);
|
||||
@ -355,8 +358,12 @@ oop StackWalk::fetchFirstBatch(BaseFrameStream& stream, Handle stackStream,
|
||||
break;
|
||||
}
|
||||
|
||||
if (TraceStackWalk) {
|
||||
tty->print(" skip "); stream.method()->print_short_name(); tty->print("\n");
|
||||
if (log_is_enabled(Debug, stackwalk)) {
|
||||
ResourceMark rm(THREAD);
|
||||
outputStream* st = Log(stackwalk)::debug_stream();
|
||||
st->print(" skip ");
|
||||
stream.method()->print_short_name(st);
|
||||
st->cr();
|
||||
}
|
||||
stream.next();
|
||||
}
|
||||
@ -364,8 +371,12 @@ oop StackWalk::fetchFirstBatch(BaseFrameStream& stream, Handle stackStream,
|
||||
// stack frame has been traversed individually and resume stack walk
|
||||
// from the stack frame at depth == skip_frames.
|
||||
for (int n=0; n < skip_frames && !stream.at_end(); stream.next(), n++) {
|
||||
if (TraceStackWalk) {
|
||||
tty->print(" skip "); stream.method()->print_short_name(); tty->cr();
|
||||
if (log_is_enabled(Debug, stackwalk)) {
|
||||
ResourceMark rm(THREAD);
|
||||
outputStream* st = Log(stackwalk)::debug_stream();
|
||||
st->print(" skip ");
|
||||
stream.method()->print_short_name(st);
|
||||
st->cr();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -438,10 +449,9 @@ jint StackWalk::fetchNextBatch(Handle stackStream, jlong mode, jlong magic,
|
||||
THROW_MSG_(vmSymbols::java_lang_NullPointerException(), "frames_array is NULL", 0L);
|
||||
}
|
||||
|
||||
if (TraceStackWalk) {
|
||||
tty->print_cr("StackWalk::fetchNextBatch frame_count %d existing_stream " PTR_FORMAT " start %d frames %d",
|
||||
frame_count, p2i(existing_stream), start_index, frames_array->length());
|
||||
}
|
||||
log_debug(stackwalk)("StackWalk::fetchNextBatch frame_count %d existing_stream "
|
||||
PTR_FORMAT " start %d frames %d",
|
||||
frame_count, p2i(existing_stream), start_index, frames_array->length());
|
||||
int end_index = start_index;
|
||||
if (frame_count <= 0) {
|
||||
return end_index; // No operation.
|
||||
|
||||
@ -2887,9 +2887,6 @@ public:
|
||||
"exceptions (0 means all)") \
|
||||
range(0, max_jint/2) \
|
||||
\
|
||||
develop(bool, TraceStackWalk, false, \
|
||||
"Trace stack walking") \
|
||||
\
|
||||
/* notice: the max range value here is max_jint, not max_intx */ \
|
||||
/* because of overflow issue */ \
|
||||
diagnostic(intx, GuaranteedSafepointInterval, 1000, \
|
||||
|
||||
@ -60,7 +60,6 @@ void InternalVMTests::run() {
|
||||
run_unit_test(TestBitMap_test);
|
||||
run_unit_test(TestResourcehash_test);
|
||||
run_unit_test(ObjectMonitor_test);
|
||||
run_unit_test(TestChunkedList_test);
|
||||
run_unit_test(Test_log_tag_combinations_limit);
|
||||
run_unit_test(Test_logtarget);
|
||||
run_unit_test(Test_logstream);
|
||||
@ -86,7 +85,6 @@ void InternalVMTests::run() {
|
||||
run_unit_test(TestBufferingOopClosure_test);
|
||||
if (UseG1GC) {
|
||||
run_unit_test(FreeRegionList_test);
|
||||
run_unit_test(IHOP_test);
|
||||
}
|
||||
run_unit_test(WorkerDataArray_test);
|
||||
run_unit_test(ParallelCompact_test);
|
||||
|
||||
@ -86,12 +86,12 @@ case "${osname}" in
|
||||
fi
|
||||
|
||||
# Add basic solaris system paths
|
||||
path4sdk=/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
|
||||
path4sdk=/usr/bin
|
||||
|
||||
# Find GNU make
|
||||
make=/usr/sfw/bin/gmake
|
||||
make=/usr/bin/gmake
|
||||
if [ ! -f ${make} ] ; then
|
||||
make=/opt/sfw/bin/gmake
|
||||
make=/usr/gnu/bin/make
|
||||
if [ ! -f ${make} ] ; then
|
||||
make=${slashjava}/devtools/${solaris_arch}/bin/gnumake
|
||||
fi
|
||||
|
||||
149
hotspot/test/native/gc/g1/test_g1IHOPControl.cpp
Normal file
149
hotspot/test/native/gc/g1/test_g1IHOPControl.cpp
Normal file
@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/g1/g1CollectedHeap.inline.hpp"
|
||||
#include "gc/g1/g1IHOPControl.hpp"
|
||||
#include "gc/g1/g1Predictions.hpp"
|
||||
#include "unittest.hpp"
|
||||
|
||||
static void test_update(G1IHOPControl* ctrl, double alloc_time,
|
||||
size_t alloc_amount, size_t young_size,
|
||||
double mark_time) {
|
||||
for (int i = 0; i < 100; i++) {
|
||||
ctrl->update_allocation_info(alloc_time, alloc_amount, young_size);
|
||||
ctrl->update_marking_length(mark_time);
|
||||
}
|
||||
}
|
||||
|
||||
// @requires UseG1GC
|
||||
TEST_VM(G1StaticIHOPControl, simple) {
|
||||
// Test requires G1
|
||||
if (!UseG1GC) {
|
||||
return;
|
||||
}
|
||||
|
||||
const size_t initial_ihop = 45;
|
||||
|
||||
G1StaticIHOPControl ctrl(initial_ihop);
|
||||
ctrl.update_target_occupancy(100);
|
||||
|
||||
size_t threshold = ctrl.get_conc_mark_start_threshold();
|
||||
EXPECT_EQ(initial_ihop, threshold);
|
||||
|
||||
ctrl.update_allocation_info(100.0, 100, 100);
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
EXPECT_EQ(initial_ihop, threshold);
|
||||
|
||||
ctrl.update_marking_length(1000.0);
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
EXPECT_EQ(initial_ihop, threshold);
|
||||
|
||||
// Whatever we pass, the IHOP value must stay the same.
|
||||
test_update(&ctrl, 2, 10, 10, 3);
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
|
||||
EXPECT_EQ(initial_ihop, threshold);
|
||||
|
||||
test_update(&ctrl, 12, 10, 10, 3);
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
|
||||
EXPECT_EQ(initial_ihop, threshold);
|
||||
}
|
||||
|
||||
// @requires UseG1GC
|
||||
TEST_VM(G1AdaptiveIHOPControl, simple) {
|
||||
// Test requires G1
|
||||
if (!UseG1GC) {
|
||||
return;
|
||||
}
|
||||
|
||||
const size_t initial_threshold = 45;
|
||||
const size_t young_size = 10;
|
||||
const size_t target_size = 100;
|
||||
|
||||
// The final IHOP value is always
|
||||
// target_size - (young_size + alloc_amount/alloc_time * marking_time)
|
||||
|
||||
G1Predictions pred(0.95);
|
||||
G1AdaptiveIHOPControl ctrl(initial_threshold, &pred, 0, 0);
|
||||
ctrl.update_target_occupancy(target_size);
|
||||
|
||||
// First "load".
|
||||
const size_t alloc_time1 = 2;
|
||||
const size_t alloc_amount1 = 10;
|
||||
const size_t marking_time1 = 2;
|
||||
const size_t settled_ihop1 = target_size
|
||||
- (young_size + alloc_amount1 / alloc_time1 * marking_time1);
|
||||
|
||||
size_t threshold;
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
|
||||
EXPECT_EQ(initial_threshold, threshold);
|
||||
|
||||
for (size_t i = 0; i < G1AdaptiveIHOPNumInitialSamples - 1; i++) {
|
||||
ctrl.update_allocation_info(alloc_time1, alloc_amount1, young_size);
|
||||
ctrl.update_marking_length(marking_time1);
|
||||
// Not enough data yet.
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
|
||||
ASSERT_EQ(initial_threshold, threshold) << "on step " << i;
|
||||
}
|
||||
|
||||
test_update(&ctrl, alloc_time1, alloc_amount1, young_size, marking_time1);
|
||||
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
|
||||
EXPECT_EQ(settled_ihop1, threshold);
|
||||
|
||||
// Second "load". A bit higher allocation rate.
|
||||
const size_t alloc_time2 = 2;
|
||||
const size_t alloc_amount2 = 30;
|
||||
const size_t marking_time2 = 2;
|
||||
const size_t settled_ihop2 = target_size
|
||||
- (young_size + alloc_amount2 / alloc_time2 * marking_time2);
|
||||
|
||||
test_update(&ctrl, alloc_time2, alloc_amount2, young_size, marking_time2);
|
||||
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
|
||||
EXPECT_LT(threshold, settled_ihop1);
|
||||
|
||||
// Third "load". Very high (impossible) allocation rate.
|
||||
const size_t alloc_time3 = 1;
|
||||
const size_t alloc_amount3 = 50;
|
||||
const size_t marking_time3 = 2;
|
||||
const size_t settled_ihop3 = 0;
|
||||
|
||||
test_update(&ctrl, alloc_time3, alloc_amount3, young_size, marking_time3);
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
|
||||
EXPECT_EQ(settled_ihop3, threshold);
|
||||
|
||||
// And back to some arbitrary value.
|
||||
test_update(&ctrl, alloc_time2, alloc_amount2, young_size, marking_time2);
|
||||
|
||||
threshold = ctrl.get_conc_mark_start_threshold();
|
||||
|
||||
EXPECT_GT(threshold, settled_ihop3);
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -19,42 +19,40 @@
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "unittest.hpp"
|
||||
#include "utilities/chunkedList.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
|
||||
/////////////// Unit tests ///////////////
|
||||
|
||||
#ifndef PRODUCT
|
||||
class Metadata;
|
||||
|
||||
template <typename T>
|
||||
class TestChunkedList {
|
||||
typedef ChunkedList<T, mtOther> ChunkedListT;
|
||||
|
||||
public:
|
||||
|
||||
static void testEmpty() {
|
||||
ChunkedListT buffer;
|
||||
assert(buffer.size() == 0, "assert");
|
||||
ASSERT_EQ((size_t) 0, buffer.size());
|
||||
}
|
||||
|
||||
static void testFull() {
|
||||
ChunkedListT buffer;
|
||||
for (uintptr_t i = 0; i < ChunkedListT::BufferSize; i++) {
|
||||
buffer.push((T)i);
|
||||
buffer.push((T) i);
|
||||
}
|
||||
assert(buffer.size() == ChunkedListT::BufferSize, "assert");
|
||||
assert(buffer.is_full(), "assert");
|
||||
ASSERT_EQ((size_t) ChunkedListT::BufferSize, buffer.size());
|
||||
ASSERT_TRUE(buffer.is_full());
|
||||
}
|
||||
|
||||
static void testSize() {
|
||||
ChunkedListT buffer;
|
||||
for (uintptr_t i = 0; i < ChunkedListT::BufferSize; i++) {
|
||||
assert(buffer.size() == i, "assert");
|
||||
buffer.push((T)i);
|
||||
assert(buffer.size() == i + 1, "assert");
|
||||
ASSERT_EQ((size_t) i, buffer.size());
|
||||
buffer.push((T) i);
|
||||
ASSERT_EQ((size_t) (i + 1), buffer.size());
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,48 +60,71 @@ class TestChunkedList {
|
||||
ChunkedListT buffer;
|
||||
|
||||
buffer.clear();
|
||||
assert(buffer.size() == 0, "assert");
|
||||
ASSERT_EQ((size_t) 0, buffer.size());
|
||||
|
||||
for (uintptr_t i = 0; i < ChunkedListT::BufferSize / 2; i++) {
|
||||
buffer.push((T)i);
|
||||
buffer.push((T) i);
|
||||
}
|
||||
buffer.clear();
|
||||
assert(buffer.size() == 0, "assert");
|
||||
ASSERT_EQ((size_t) 0, buffer.size());
|
||||
|
||||
for (uintptr_t i = 0; i < ChunkedListT::BufferSize; i++) {
|
||||
buffer.push((T)i);
|
||||
buffer.push((T) i);
|
||||
}
|
||||
buffer.clear();
|
||||
assert(buffer.size() == 0, "assert");
|
||||
ASSERT_EQ((size_t) 0, buffer.size());
|
||||
}
|
||||
|
||||
static void testAt() {
|
||||
ChunkedListT buffer;
|
||||
|
||||
for (uintptr_t i = 0; i < ChunkedListT::BufferSize; i++) {
|
||||
buffer.push((T)i);
|
||||
assert(buffer.at(i) == (T)i, "assert");
|
||||
buffer.push((T) i);
|
||||
ASSERT_EQ((T) i, buffer.at(i));
|
||||
}
|
||||
|
||||
for (uintptr_t i = 0; i < ChunkedListT::BufferSize; i++) {
|
||||
assert(buffer.at(i) == (T)i, "assert");
|
||||
ASSERT_EQ((T) i, buffer.at(i));
|
||||
}
|
||||
}
|
||||
|
||||
static void test() {
|
||||
testEmpty();
|
||||
testFull();
|
||||
testSize();
|
||||
testClear();
|
||||
testAt();
|
||||
}
|
||||
};
|
||||
|
||||
class Metadata;
|
||||
|
||||
void TestChunkedList_test() {
|
||||
TestChunkedList<Metadata*>::test();
|
||||
TestChunkedList<size_t>::test();
|
||||
TEST(ChunkedList, metadata_empty) {
|
||||
TestChunkedList<Metadata*>::testEmpty();
|
||||
}
|
||||
|
||||
#endif
|
||||
TEST(ChunkedList, metadata_full) {
|
||||
TestChunkedList<Metadata*>::testFull();
|
||||
}
|
||||
|
||||
TEST(ChunkedList, metadata_size) {
|
||||
TestChunkedList<Metadata*>::testSize();
|
||||
}
|
||||
|
||||
TEST(ChunkedList, metadata_clear) {
|
||||
TestChunkedList<Metadata*>::testSize();
|
||||
}
|
||||
|
||||
TEST(ChunkedList, metadata_at) {
|
||||
TestChunkedList<Metadata*>::testAt();
|
||||
}
|
||||
|
||||
TEST(ChunkedList, size_t_empty) {
|
||||
TestChunkedList<size_t>::testEmpty();
|
||||
}
|
||||
|
||||
TEST(ChunkedList, size_t_full) {
|
||||
TestChunkedList<size_t>::testFull();
|
||||
}
|
||||
|
||||
TEST(ChunkedList, size_t_size) {
|
||||
TestChunkedList<size_t>::testSize();
|
||||
}
|
||||
|
||||
TEST(ChunkedList, size_t_clear) {
|
||||
TestChunkedList<size_t>::testSize();
|
||||
}
|
||||
|
||||
TEST(ChunkedList, size_t_at) {
|
||||
TestChunkedList<size_t>::testAt();
|
||||
}
|
||||
@ -34,14 +34,17 @@
|
||||
* jdk.hotspot.agent/sun.jvm.hotspot.runtime
|
||||
* jdk.hotspot.agent/sun.jvm.hotspot.tools
|
||||
* java.management
|
||||
* @build SASymbolTableTestAgent SASymbolTableTestAttachee
|
||||
* @build SASymbolTableTestAgent
|
||||
* @run main SASymbolTableTest
|
||||
*/
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import jdk.test.lib.process.ProcessTools;
|
||||
import jdk.test.lib.process.OutputAnalyzer;
|
||||
import jdk.test.lib.JDKToolFinder;
|
||||
import jdk.test.lib.Platform;
|
||||
import jdk.test.lib.apps.LingeredApp;
|
||||
|
||||
/*
|
||||
* The purpose of this test is to validate that we can use SA to
|
||||
@ -53,6 +56,7 @@ import jdk.test.lib.Platform;
|
||||
*/
|
||||
public class SASymbolTableTest {
|
||||
static String jsaName = "./SASymbolTableTest.jsa";
|
||||
private static LingeredApp theApp = null;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (!Platform.shouldSAAttach()) {
|
||||
@ -78,50 +82,44 @@ public class SASymbolTableTest {
|
||||
private static void run(boolean useArchive) throws Exception {
|
||||
String flag = useArchive ? "auto" : "off";
|
||||
|
||||
// (1) Launch the attachee process
|
||||
ProcessBuilder attachee = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:SharedArchiveFile=" + jsaName,
|
||||
"-Xshare:" + flag,
|
||||
"-showversion", // so we can see "sharing" in the output
|
||||
"SASymbolTableTestAttachee");
|
||||
try {
|
||||
// (1) Launch the attachee process
|
||||
System.out.println("Starting LingeredApp");
|
||||
List<String> vmOpts = Arrays.asList(
|
||||
"-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:SharedArchiveFile=" + jsaName,
|
||||
"-Xshare:" + flag,
|
||||
"-showversion"); // so we can see "sharing" in the output
|
||||
|
||||
final Process p = attachee.start();
|
||||
theApp = LingeredApp.startApp(vmOpts);
|
||||
|
||||
// (2) Launch the agent process
|
||||
long pid = p.getPid();
|
||||
System.out.println("Attaching agent " + pid);
|
||||
ProcessBuilder tool = ProcessTools.createJavaProcessBuilder(
|
||||
"--add-modules=jdk.hotspot.agent",
|
||||
"--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.oops=ALL-UNNAMED",
|
||||
"--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.memory=ALL-UNNAMED",
|
||||
"--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.runtime=ALL-UNNAMED",
|
||||
"--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.tools=ALL-UNNAMED",
|
||||
"SASymbolTableTestAgent",
|
||||
Long.toString(pid));
|
||||
OutputAnalyzer output = ProcessTools.executeProcess(tool);
|
||||
System.out.println(output.getOutput());
|
||||
output.shouldHaveExitValue(0);
|
||||
|
||||
Thread t = new Thread() {
|
||||
public void run() {
|
||||
try {
|
||||
OutputAnalyzer output = new OutputAnalyzer(p);
|
||||
System.out.println("STDOUT[");
|
||||
System.out.print(output.getStdout());
|
||||
System.out.println("]");
|
||||
System.out.println("STDERR[");
|
||||
System.out.print(output.getStderr());
|
||||
System.out.println("]");
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
t.start();
|
||||
|
||||
Thread.sleep(2 * 1000);
|
||||
p.destroy();
|
||||
t.join();
|
||||
// (2) Launch the agent process
|
||||
long pid = theApp.getPid();
|
||||
System.out.println("Attaching agent to " + pid );
|
||||
ProcessBuilder tool = ProcessTools.createJavaProcessBuilder(
|
||||
"--add-modules=jdk.hotspot.agent",
|
||||
"--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.oops=ALL-UNNAMED",
|
||||
"--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.memory=ALL-UNNAMED",
|
||||
"--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.runtime=ALL-UNNAMED",
|
||||
"--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.tools=ALL-UNNAMED",
|
||||
"SASymbolTableTestAgent",
|
||||
Long.toString(pid));
|
||||
OutputAnalyzer output = ProcessTools.executeProcess(tool);
|
||||
System.out.println("STDOUT[");
|
||||
System.out.println(output.getOutput());
|
||||
if (output.getStdout().contains("connected too early")) {
|
||||
System.out.println("SymbolTable not created by VM - test skipped");
|
||||
return;
|
||||
}
|
||||
System.out.println("]");
|
||||
System.out.println("STDERR[");
|
||||
System.out.print(output.getStderr());
|
||||
System.out.println("]");
|
||||
output.shouldHaveExitValue(0);
|
||||
} catch (Exception ex) {
|
||||
throw new RuntimeException("Test ERROR " + ex, ex);
|
||||
} finally {
|
||||
LingeredApp.stopApp(theApp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,31 +112,35 @@ public class SASymbolTableTestAgent extends Tool {
|
||||
|
||||
public void run() {
|
||||
System.out.println("SASymbolTableTestAgent: starting");
|
||||
VM vm = VM.getVM();
|
||||
SymbolTable table = vm.getSymbolTable();
|
||||
try {
|
||||
VM vm = VM.getVM();
|
||||
SymbolTable table = vm.getSymbolTable();
|
||||
|
||||
// (a) These are names that are likely to exist in the symbol table
|
||||
// of a JVM after start-up. They were taken from vmSymbols.hpp
|
||||
// during the middle of JDK9 development.
|
||||
//
|
||||
// The purpose is not to check that each name must exist (a future
|
||||
// version of JDK may not preload some of the classes).
|
||||
//
|
||||
// The purpose of this loops is to ensure that we check a lot of symbols,
|
||||
// so we will (most likely) hit on both VALUE_ONLY_BUCKET_TYPE and normal bucket type
|
||||
// in CompactHashTable.probe().
|
||||
for (String n : commonNames) {
|
||||
Symbol s = table.probe(n);
|
||||
System.out.format("%-40s = %s\n", n, s);
|
||||
}
|
||||
// (a) These are names that are likely to exist in the symbol table
|
||||
// of a JVM after start-up. They were taken from vmSymbols.hpp
|
||||
// during the middle of JDK9 development.
|
||||
//
|
||||
// The purpose is not to check that each name must exist (a future
|
||||
// version of JDK may not preload some of the classes).
|
||||
//
|
||||
// The purpose of this loops is to ensure that we check a lot of symbols,
|
||||
// so we will (most likely) hit on both VALUE_ONLY_BUCKET_TYPE and normal bucket type
|
||||
// in CompactHashTable.probe().
|
||||
for (String n : commonNames) {
|
||||
Symbol s = table.probe(n);
|
||||
System.out.format("%-40s = %s\n", n, s);
|
||||
}
|
||||
|
||||
System.out.println("======================================================================");
|
||||
System.out.println("======================================================================");
|
||||
|
||||
// (b) Also test a few strings that are known to not exist in the table. This will
|
||||
// both the compact table (if it exists) and the regular table to be walked.
|
||||
for (String n : badNames) {
|
||||
Symbol s = table.probe(n);
|
||||
System.out.format("%-40s = %s\n", n, s);
|
||||
// (b) Also test a few strings that are known to not exist in the table. This will
|
||||
// both the compact table (if it exists) and the regular table to be walked.
|
||||
for (String n : badNames) {
|
||||
Symbol s = table.probe(n);
|
||||
System.out.format("%-40s = %s\n", n, s);
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
System.out.println("connected too early -- please try again");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
67
hotspot/test/runtime/logging/StackWalkTest.java
Normal file
67
hotspot/test/runtime/logging/StackWalkTest.java
Normal file
@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* @test StackWalkTest
|
||||
* @bug 8160064
|
||||
* @summary -Xlog:stackwalk should produce logging from the source code
|
||||
* @library /test/lib
|
||||
* @run driver StackWalkTest
|
||||
*/
|
||||
|
||||
import jdk.test.lib.process.ProcessTools;
|
||||
import jdk.test.lib.process.OutputAnalyzer;
|
||||
|
||||
public class StackWalkTest {
|
||||
static void analyzeOutputOn(ProcessBuilder pb) throws Exception {
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Start walking");
|
||||
output.shouldContain("fill_in_frames");
|
||||
output.shouldHaveExitValue(0);
|
||||
}
|
||||
|
||||
static void analyzeOutputOff(ProcessBuilder pb) throws Exception {
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldNotContain("[stackwalk]");
|
||||
output.shouldHaveExitValue(0);
|
||||
}
|
||||
|
||||
public static void main(String... args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:stackwalk=debug",
|
||||
InnerClass.class.getName());
|
||||
analyzeOutputOn(pb);
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xlog:stackwalk=off",
|
||||
InnerClass.class.getName());
|
||||
analyzeOutputOff(pb);
|
||||
}
|
||||
|
||||
public static class InnerClass {
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.out.println("Testing stackwalk.");
|
||||
StackWalker sw = StackWalker.getInstance();
|
||||
sw.forEach(System.out::println);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -379,3 +379,4 @@ e66cdc2de6b02443911d386fc9217b0d824d0686 jdk-9+130
|
||||
1c6c21d87aa459d82425e1fddc9ce8647aebde34 jdk-9+134
|
||||
f695240370c77a25fed88225a392e7d530cb4d78 jdk-9+135
|
||||
f1eafcb0eb7182b937bc93f214d8cabd01ec4d59 jdk-9+136
|
||||
a8d5fe567ae72b4931040e59dd4478363f9004f5 jdk-9+137
|
||||
|
||||
@ -1033,12 +1033,12 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver {
|
||||
staxInputSource = new StaxXMLInputSource(xmlInputSource, fISCreatedByResolver);
|
||||
}
|
||||
|
||||
if (staxInputSource == null) {
|
||||
if (staxInputSource == null && fUseCatalog) {
|
||||
if (fCatalogFeatures == null) {
|
||||
fCatalogFeatures = JdkXmlUtils.getCatalogFeatures(fDefer, fCatalogFile, fPrefer, fResolve);
|
||||
}
|
||||
fCatalogFile = fCatalogFeatures.get(Feature.FILES);
|
||||
if (fUseCatalog && fCatalogFile != null) {
|
||||
if (fCatalogFile != null) {
|
||||
try {
|
||||
if (fCatalogResolver == null) {
|
||||
fCatalogResolver = CatalogManager.catalogResolver(fCatalogFeatures);
|
||||
@ -1133,12 +1133,12 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver {
|
||||
xmlInputSource = fEntityResolver.resolveEntity(resourceIdentifier);
|
||||
}
|
||||
|
||||
if (xmlInputSource == null) {
|
||||
if (xmlInputSource == null && fUseCatalog) {
|
||||
if (fCatalogFeatures == null) {
|
||||
fCatalogFeatures = JdkXmlUtils.getCatalogFeatures(fDefer, fCatalogFile, fPrefer, fResolve);
|
||||
}
|
||||
fCatalogFile = fCatalogFeatures.get(Feature.FILES);
|
||||
if (fUseCatalog && fCatalogFile != null) {
|
||||
if (fCatalogFile != null) {
|
||||
/*
|
||||
since the method can be called from various processors, both
|
||||
EntityResolver and URIResolver are used to attempt to find
|
||||
|
||||
@ -34,6 +34,8 @@ import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
|
||||
import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
|
||||
import com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException;
|
||||
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
|
||||
import com.sun.org.apache.xerces.internal.parsers.XIncludeParserConfiguration;
|
||||
import com.sun.org.apache.xerces.internal.parsers.XPointerParserConfiguration;
|
||||
import com.sun.org.apache.xerces.internal.util.AugmentationsImpl;
|
||||
import com.sun.org.apache.xerces.internal.util.HTTPInputSource;
|
||||
import com.sun.org.apache.xerces.internal.util.IntStack;
|
||||
@ -129,8 +131,6 @@ import org.xml.sax.InputSource;
|
||||
public class XIncludeHandler
|
||||
implements XMLComponent, XMLDocumentFilter, XMLDTDFilter {
|
||||
|
||||
public final static String XINCLUDE_DEFAULT_CONFIGURATION =
|
||||
"com.sun.org.apache.xerces.internal.parsers.XIncludeParserConfiguration";
|
||||
public final static String HTTP_ACCEPT = "Accept";
|
||||
public final static String HTTP_ACCEPT_LANGUAGE = "Accept-Language";
|
||||
public final static String XPOINTER = "xpointer";
|
||||
@ -1624,12 +1624,12 @@ public class XIncludeHandler
|
||||
includedSource =
|
||||
fEntityResolver.resolveEntity(resourceIdentifier);
|
||||
|
||||
if (includedSource == null) {
|
||||
if (includedSource == null && fUseCatalog) {
|
||||
if (fCatalogFeatures == null) {
|
||||
fCatalogFeatures = JdkXmlUtils.getCatalogFeatures(fDefer, fCatalogFile, fPrefer, fResolve);
|
||||
}
|
||||
fCatalogFile = fCatalogFeatures.get(CatalogFeatures.Feature.FILES);
|
||||
if (fUseCatalog && fCatalogFile != null) {
|
||||
if (fCatalogFile != null) {
|
||||
/*
|
||||
Although URI entry is preferred for resolving XInclude, system entry
|
||||
is allowed as well.
|
||||
@ -1690,14 +1690,11 @@ public class XIncludeHandler
|
||||
if ((xpointer != null && fXPointerChildConfig == null)
|
||||
|| (xpointer == null && fXIncludeChildConfig == null) ) {
|
||||
|
||||
String parserName = XINCLUDE_DEFAULT_CONFIGURATION;
|
||||
if (xpointer != null)
|
||||
parserName = "com.sun.org.apache.xerces.internal.parsers.XPointerParserConfiguration";
|
||||
|
||||
fChildConfig =
|
||||
(XMLParserConfiguration)ObjectFactory.newInstance(
|
||||
parserName,
|
||||
true);
|
||||
if (xpointer == null) {
|
||||
fChildConfig = new XIncludeParserConfiguration();
|
||||
} else {
|
||||
fChildConfig = new XPointerParserConfiguration();
|
||||
}
|
||||
|
||||
// use the same symbol table, error reporter, entity resolver, security manager and buffer size.
|
||||
if (fSymbolTable != null) fChildConfig.setProperty(SYMBOL_TABLE, fSymbolTable);
|
||||
|
||||
@ -32,7 +32,6 @@ import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.sax.SAXSource;
|
||||
import javax.xml.transform.stax.StAXSource;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Listeners;
|
||||
@ -42,7 +41,7 @@ import org.xml.sax.InputSource;
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 8158084 8162438 8162442 8166220
|
||||
* @bug 8158084 8162438 8162442 8166220 8166398
|
||||
* @library /javax/xml/jaxp/libs /javax/xml/jaxp/unittest
|
||||
* @run testng/othervm -DrunSecMngr=true catalog.CatalogSupport
|
||||
* @run testng/othervm catalog.CatalogSupport
|
||||
@ -51,7 +50,7 @@ import org.xml.sax.InputSource;
|
||||
* A custom resolver is used whether or not there's a Catalog;
|
||||
* A Catalog is used when there's no custom resolver, and the USE_CATALOG
|
||||
* is true (which is the case by default).
|
||||
*/
|
||||
*/
|
||||
|
||||
/**
|
||||
* Support Catalog:
|
||||
@ -177,13 +176,13 @@ public class CatalogSupport extends CatalogSupportBase {
|
||||
*/
|
||||
@DataProvider(name = "data_SAXA")
|
||||
public Object[][] getDataSAX() {
|
||||
String[] systemIds = {"system.xsd"};
|
||||
InputSource[] returnValues = {new InputSource(new StringReader(dtd_systemResolved))};
|
||||
MyEntityHandler entityHandler = new MyEntityHandler(systemIds, returnValues, elementInSystem);
|
||||
String[] systemIds = {"system.dtd"};
|
||||
return new Object[][]{
|
||||
{false, true, xml_catalog, xml_system, new MyHandler(elementInSystem), expectedWCatalog},
|
||||
{false, true, xml_catalog, xml_system, entityHandler, expectedWResolver},
|
||||
{true, true, xml_catalog, xml_system, entityHandler, expectedWResolver}
|
||||
{false, true, xml_catalog, xml_system, getMyEntityHandler(elementInSystem, systemIds,
|
||||
new InputSource(new StringReader(dtd_systemResolved))), expectedWResolver},
|
||||
{true, true, xml_catalog, xml_system, getMyEntityHandler(elementInSystem, systemIds,
|
||||
new InputSource(new StringReader(dtd_systemResolved))), expectedWResolver}
|
||||
};
|
||||
}
|
||||
|
||||
@ -209,7 +208,7 @@ public class CatalogSupport extends CatalogSupportBase {
|
||||
*/
|
||||
@DataProvider(name = "data_DOMA")
|
||||
public Object[][] getDataDOM() {
|
||||
String[] systemIds = {"system.xsd"};
|
||||
String[] systemIds = {"system.dtd"};
|
||||
InputSource[] returnValues = {new InputSource(new StringReader(dtd_systemResolved))};
|
||||
MyEntityHandler entityHandler = new MyEntityHandler(systemIds, returnValues, elementInSystem);
|
||||
return new Object[][]{
|
||||
@ -230,8 +229,8 @@ public class CatalogSupport extends CatalogSupportBase {
|
||||
|
||||
return new Object[][]{
|
||||
{false, true, xml_catalog, xml_system, null, expectedWCatalog},
|
||||
{false, true, xml_catalog, xml_system, null, expectedWResolver},
|
||||
{true, true, xml_catalog, xml_system, null, expectedWResolver}
|
||||
{false, true, xml_catalog, xml_system, new MyStaxEntityResolver(), expectedWResolver},
|
||||
{true, true, xml_catalog, xml_system, new MyStaxEntityResolver(), expectedWResolver}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
<system systemId="XI_utf8.xml" uri="XI_utf8.xml"/>
|
||||
<system systemId="XI_utf8Catalog.xml" uri="XI_utf8Catalog.xml"/>
|
||||
<system systemId="XI_test2.xml" uri="XI_test2.xml"/>
|
||||
<system systemId="XI_test2Catalog.xml" uri="XI_test2Catalog.xml"/>
|
||||
<system systemId="XI_red.dtd" uri="XI_red.dtd"/>
|
||||
|
||||
<!-- xsd import can be mapped using the namespace or systemId -->
|
||||
|
||||
@ -276,7 +276,7 @@ public class CatalogSupportBase {
|
||||
SAXParser parser = getSAXParser(setUseCatalog, useCatalog, catalog);
|
||||
|
||||
parser.parse(xml, handler);
|
||||
assertEquals(expected, handler.getResult().trim(), "");
|
||||
Assert.assertEquals(handler.getResult().trim(), expected);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -287,8 +287,9 @@ public class CatalogSupportBase {
|
||||
XMLReader reader = getXMLReader(setUseCatalog, useCatalog, catalog);
|
||||
|
||||
reader.setContentHandler(handler);
|
||||
reader.setEntityResolver(handler);
|
||||
reader.parse(xml);
|
||||
assertEquals(expected, handler.getResult().trim(), "");
|
||||
Assert.assertEquals(handler.getResult().trim(), expected);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -300,7 +301,7 @@ public class CatalogSupportBase {
|
||||
|
||||
parser.parse(new InputSource(new StringReader(xml)), handler);
|
||||
debugPrint("handler.result:" + handler.getResult());
|
||||
assertEquals(expected, handler.getResult(), "Catalog support for XInclude");
|
||||
Assert.assertEquals(handler.getResult().trim(), expected);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -314,8 +315,7 @@ public class CatalogSupportBase {
|
||||
|
||||
Node node = doc.getElementsByTagName(elementInSystem).item(0);
|
||||
String result = node.getFirstChild().getTextContent();
|
||||
|
||||
assertEquals(expected, result.trim(), "Catalog support for DOM");
|
||||
Assert.assertEquals(result.trim(), expected);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -327,7 +327,7 @@ public class CatalogSupportBase {
|
||||
XMLStreamReader streamReader = getStreamReader(
|
||||
setUseCatalog, useCatalog, catalog, xml, resolver);
|
||||
String text = getText(streamReader, XMLStreamConstants.CHARACTERS);
|
||||
assertEquals(expected, text.trim(), "Catalog support for StAX");
|
||||
Assert.assertEquals(text.trim(), expected);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -340,7 +340,7 @@ public class CatalogSupportBase {
|
||||
XMLStreamReader streamReader = getStreamReader(
|
||||
setUseCatalog, useCatalog, catalog, xml, resolver);
|
||||
String text = getText(streamReader, XMLStreamConstants.ENTITY_REFERENCE);
|
||||
assertEquals(expected, text.trim(), "Catalog support for StAX");
|
||||
Assert.assertEquals(text.trim(), expected);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -601,9 +601,11 @@ public class CatalogSupportBase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the text of the first element found by the reader.
|
||||
* Returns the accumulated text of an event type.
|
||||
*
|
||||
* @param streamReader the XMLStreamReader
|
||||
* @return the text of the first element
|
||||
* @param type the type of event requested
|
||||
* @return the text of the accumulated text for the request type
|
||||
* @throws XMLStreamException
|
||||
*/
|
||||
String getText(XMLStreamReader streamReader, int type) throws XMLStreamException {
|
||||
@ -662,24 +664,6 @@ public class CatalogSupportBase {
|
||||
return factory;
|
||||
}
|
||||
|
||||
void assertNotNull(Object obj, String msg) {
|
||||
if (obj == null) {
|
||||
debugPrint("Test failed: " + msg);
|
||||
} else {
|
||||
debugPrint("Test passed: " + obj + " is not null");
|
||||
}
|
||||
}
|
||||
|
||||
void assertEquals(String expected, String actual, String msg) {
|
||||
if (!expected.equals(actual)) {
|
||||
debugPrint("Test failed: " + msg);
|
||||
} else {
|
||||
debugPrint("Test passed: ");
|
||||
}
|
||||
debugPrint("Expected: " + expected);
|
||||
debugPrint("Actual: " + actual);
|
||||
}
|
||||
|
||||
void fail(String msg) {
|
||||
System.out.println("Test failed:");
|
||||
System.out.println(msg);
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
</another>
|
||||
</latin1>
|
||||
<test2>
|
||||
<xinclude:include href="XI_test2.xml"/>
|
||||
<xinclude:include href="XI_test2Catalog.xml"/>
|
||||
</test2>
|
||||
<test3>
|
||||
<!-- <xinclude:include href="XI_roottest.xml"/> -->
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- comment before root -->
|
||||
<!DOCTYPE red SYSTEM "XI_red.dtd">
|
||||
<red xmlns:xinclude="http://www.w3.org/2001/XInclude">
|
||||
<blue>
|
||||
<xinclude:include href="XI_utf8Catalog.xml" parse="text"/>
|
||||
</blue>
|
||||
</red>
|
||||
<!-- comment after root -->
|
||||
|
||||
@ -382,3 +382,4 @@ fe4e11bd2423635dc0f5f5cb9a64eb2f2cce7f4c jdk-9+128
|
||||
ab1d78d395d4cb8be426ff181211da1a4085cf01 jdk-9+134
|
||||
22631824f55128a7ab6605493b3001a37af6a168 jdk-9+135
|
||||
09ec13a99f50a4a346180d1e3b0fd8bc1ee399ce jdk-9+136
|
||||
297c16d401c534cb879809d2a746d21ca99d2954 jdk-9+137
|
||||
|
||||
@ -379,3 +379,4 @@ d5c70818cd8a82e76632c8c815bdb4f75f53aeaf jdk-9+132
|
||||
803adcd526d74ae0b64948d1f8260c2dbe514779 jdk-9+134
|
||||
021369229cfd0b5feb76834b2ea498f47f43c0f3 jdk-9+135
|
||||
54c5931849a33a363e03fdffa141503f5cc4779d jdk-9+136
|
||||
e72df94364e3686e7d62059ce0d6b187b82da713 jdk-9+137
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,7 @@ include LauncherCommon.gmk
|
||||
# Hook to include the corresponding custom file, if present.
|
||||
$(eval $(call IncludeCustomExtension, jdk, launcher/Launcher-java.desktop.gmk))
|
||||
|
||||
ifndef BUILD_HEADLESS_ONLY
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
$(eval $(call SetupBuildLauncher, appletviewer, \
|
||||
MAIN_CLASS := sun.applet.Main, \
|
||||
JAVA_ARGS := --add-modules ALL-DEFAULT, \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
include LauncherCommon.gmk
|
||||
|
||||
ifndef BUILD_HEADLESS_ONLY
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
$(eval $(call SetupBuildLauncher, policytool, \
|
||||
MAIN_CLASS := sun.security.tools.policytool.PolicyTool, \
|
||||
LIBS_unix := $(X_LIBS), \
|
||||
|
||||
@ -280,7 +280,7 @@ TARGETS += $(BUILD_LIBAWT)
|
||||
################################################################################
|
||||
|
||||
ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),)
|
||||
ifndef BUILD_HEADLESS_ONLY
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
|
||||
LIBAWT_XAWT_DIRS := \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt_xawt \
|
||||
@ -511,77 +511,75 @@ TARGETS += $(BUILD_LIBJAVAJPEG)
|
||||
|
||||
################################################################################
|
||||
|
||||
ifeq ($(BUILD_HEADLESS), true)
|
||||
# Mac and Windows only use the native AWT lib, do not build libawt_headless
|
||||
ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
|
||||
# Mac and Windows only use the native AWT lib, do not build libawt_headless
|
||||
ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
|
||||
|
||||
LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_headless/awt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/x11 \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
|
||||
#
|
||||
LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_headless/awt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
|
||||
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/x11 \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
|
||||
#
|
||||
|
||||
LIBAWT_HEADLESS_EXCLUDES := medialib
|
||||
LIBAWT_HEADLESS_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
$(addprefix -I, $(LIBAWT_HEADLESS_DIRS)) \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsunwjdga/ \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
#
|
||||
LIBAWT_HEADLESS_EXCLUDES := medialib
|
||||
LIBAWT_HEADLESS_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
|
||||
$(addprefix -I, $(LIBAWT_HEADLESS_DIRS)) \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
|
||||
-I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsunwjdga/ \
|
||||
$(LIBJAVA_HEADER_FLAGS) \
|
||||
#
|
||||
|
||||
LIBAWT_HEADLESS_REORDER :=
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
ifneq ($(OPENJDK_TARGET_CPU), x86_64)
|
||||
LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
|
||||
endif
|
||||
LIBAWT_HEADLESS_REORDER :=
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
ifneq ($(OPENJDK_TARGET_CPU), x86_64)
|
||||
LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
|
||||
endif
|
||||
|
||||
$(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
|
||||
LIBRARY := awt_headless, \
|
||||
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
|
||||
SRC := $(LIBAWT_HEADLESS_DIRS), \
|
||||
EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
-DHEADLESS=true \
|
||||
-DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
|
||||
$(CUPS_CFLAGS) \
|
||||
$(X_CFLAGS) \
|
||||
$(LIBAWT_HEADLESS_CFLAGS), \
|
||||
DISABLED_WARNINGS_xlc := 1506-356, \
|
||||
DISABLED_WARNINGS_solstudio := E_EMPTY_TRANSLATION_UNIT, \
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
|
||||
LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
|
||||
REORDER := $(LIBAWT_HEADLESS_REORDER), \
|
||||
LIBS_unix := -lawt -ljvm -ljava, \
|
||||
LIBS_linux := $(LIBM) $(LIBDL), \
|
||||
LIBS_solaris := $(LIBM) $(LIBDL) $(LIBCXX) -lc, \
|
||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_headless, \
|
||||
))
|
||||
|
||||
# AIX warning explanation:
|
||||
# 1506-356 : (W) Compilation unit is empty.
|
||||
# This happens during the headless build
|
||||
|
||||
$(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT_HEADLESS)
|
||||
|
||||
endif
|
||||
|
||||
$(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
|
||||
LIBRARY := awt_headless, \
|
||||
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
|
||||
SRC := $(LIBAWT_HEADLESS_DIRS), \
|
||||
EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB) \
|
||||
-DHEADLESS=true \
|
||||
-DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
|
||||
$(CUPS_CFLAGS) \
|
||||
$(X_CFLAGS) \
|
||||
$(LIBAWT_HEADLESS_CFLAGS), \
|
||||
DISABLED_WARNINGS_xlc := 1506-356, \
|
||||
DISABLED_WARNINGS_solstudio := E_EMPTY_TRANSLATION_UNIT, \
|
||||
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
|
||||
LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
|
||||
REORDER := $(LIBAWT_HEADLESS_REORDER), \
|
||||
LIBS_unix := -lawt -ljvm -ljava, \
|
||||
LIBS_linux := $(LIBM) $(LIBDL), \
|
||||
LIBS_solaris := $(LIBM) $(LIBDL) $(LIBCXX) -lc, \
|
||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_headless, \
|
||||
))
|
||||
|
||||
# AIX warning explanation:
|
||||
# 1506-356 : (W) Compilation unit is empty.
|
||||
# This happens during the headless build
|
||||
|
||||
$(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
|
||||
|
||||
TARGETS += $(BUILD_LIBAWT_HEADLESS)
|
||||
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
@ -780,7 +778,7 @@ else # OPENJDK_TARGET_OS not windows
|
||||
ifneq ($(OPENJDK_TARGET_OS), solaris)
|
||||
JAWT_LIBS += -lawt
|
||||
endif
|
||||
ifndef BUILD_HEADLESS_ONLY
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
JAWT_LIBS += -lawt_xawt
|
||||
else
|
||||
JAWT_LIBS += -lawt_headless
|
||||
@ -809,7 +807,7 @@ else # OPENJDK_TARGET_OS not windows
|
||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjawt, \
|
||||
))
|
||||
|
||||
ifndef BUILD_HEADLESS_ONLY
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
$(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
|
||||
else
|
||||
$(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
|
||||
@ -825,7 +823,7 @@ TARGETS += $(BUILD_LIBJAWT)
|
||||
|
||||
################################################################################
|
||||
|
||||
ifndef BUILD_HEADLESS_ONLY
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
|
||||
LIBSPLASHSCREEN_DIRS := \
|
||||
$(JDK_TOPDIR)/src/java.desktop/share/native/libjavajpeg \
|
||||
|
||||
85
jdk/src/java.base/aix/native/libjli/java_md_aix.c
Normal file
85
jdk/src/java.base/aix/native/libjli/java_md_aix.c
Normal file
@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright (c) 2016 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <sys/ldr.h>
|
||||
|
||||
#include "java_md_aix.h"
|
||||
|
||||
static unsigned char dladdr_buffer[0x4000];
|
||||
|
||||
static int fill_dll_info(void) {
|
||||
return loadquery(L_GETINFO, dladdr_buffer, sizeof(dladdr_buffer));
|
||||
}
|
||||
|
||||
static int dladdr_dont_reload(void *addr, Dl_info *info) {
|
||||
const struct ld_info *p = (struct ld_info *)dladdr_buffer;
|
||||
memset((void *)info, 0, sizeof(Dl_info));
|
||||
for (;;) {
|
||||
if (addr >= p->ldinfo_textorg &&
|
||||
addr < (((char*)p->ldinfo_textorg) + p->ldinfo_textsize))
|
||||
{
|
||||
info->dli_fname = p->ldinfo_filename;
|
||||
return 1;
|
||||
}
|
||||
if (!p->ldinfo_next) {
|
||||
break;
|
||||
}
|
||||
p = (struct ld_info *)(((char *)p) + p->ldinfo_next);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dladdr(void *addr, Dl_info *info) {
|
||||
static int loaded = 0;
|
||||
int rc = 0;
|
||||
void *addr0;
|
||||
if (!addr) {
|
||||
return rc;
|
||||
}
|
||||
if (!loaded) {
|
||||
if (fill_dll_info() == -1)
|
||||
return rc;
|
||||
loaded = 1;
|
||||
}
|
||||
|
||||
// first try with addr on cached data
|
||||
rc = dladdr_dont_reload(addr, info);
|
||||
|
||||
// addr could be an AIX function descriptor, so try dereferenced version
|
||||
if (rc == 0) {
|
||||
addr0 = *((void **)addr);
|
||||
rc = dladdr_dont_reload(addr0, info);
|
||||
}
|
||||
|
||||
// if we had no success until now, maybe loadquery info is outdated.
|
||||
// refresh and retry
|
||||
if (rc == 0) {
|
||||
if (fill_dll_info() == -1)
|
||||
return rc;
|
||||
rc = dladdr_dont_reload(addr, info);
|
||||
if (rc == 0) {
|
||||
rc = dladdr_dont_reload(addr0, info);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
47
jdk/src/java.base/aix/native/libjli/java_md_aix.h
Normal file
47
jdk/src/java.base/aix/native/libjli/java_md_aix.h
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2016 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
#ifndef JAVA_MD_AIX_H
|
||||
#define JAVA_MD_AIX_H
|
||||
|
||||
/*
|
||||
* Very limited AIX port of dladdr() for libjli.so.
|
||||
*
|
||||
* We try to mimick dladdr(3) on Linux (see http://linux.die.net/man/3/dladdr)
|
||||
* dladdr(3) is not POSIX but a GNU extension, and is not available on AIX.
|
||||
*
|
||||
* We only support Dl_info.dli_fname here as this is the only thing that is
|
||||
* used of it by libjli.so. A more comprehensive port of dladdr can be found
|
||||
* in the hotspot implementation which is not available at this place, though.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
const char *dli_fname; /* file path of loaded library */
|
||||
void *dli_fbase; /* unsupported */
|
||||
const char *dli_sname; /* unsupported */
|
||||
void *dli_saddr; /* unsupported */
|
||||
} Dl_info;
|
||||
|
||||
int dladdr(void *addr, Dl_info *info);
|
||||
|
||||
#endif /* JAVA_MD_AIX_H */
|
||||
@ -71,6 +71,7 @@ final class StackStreamFactory {
|
||||
// These flags must match the values maintained in the VM
|
||||
@Native private static final int DEFAULT_MODE = 0x0;
|
||||
@Native private static final int FILL_CLASS_REFS_ONLY = 0x2;
|
||||
@Native private static final int GET_CALLER_CLASS = 0x4;
|
||||
@Native private static final int SHOW_HIDDEN_FRAMES = 0x20; // LambdaForms are hidden by the VM
|
||||
@Native private static final int FILL_LIVE_STACK_FRAMES = 0x100;
|
||||
/*
|
||||
@ -614,9 +615,7 @@ final class StackStreamFactory {
|
||||
private Class<?> caller;
|
||||
|
||||
CallerClassFinder(StackWalker walker) {
|
||||
super(walker, FILL_CLASS_REFS_ONLY);
|
||||
assert (mode & FILL_CLASS_REFS_ONLY) == FILL_CLASS_REFS_ONLY
|
||||
: "mode should contain FILL_CLASS_REFS_ONLY";
|
||||
super(walker, FILL_CLASS_REFS_ONLY|GET_CALLER_CLASS);
|
||||
}
|
||||
|
||||
final class ClassBuffer extends FrameBuffer<Class<?>> {
|
||||
|
||||
@ -869,5 +869,4 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
static SpeciesData speciesData_LLL() { return checkCache(3, "LLL"); }
|
||||
static SpeciesData speciesData_LLLL() { return checkCache(4, "LLLL"); }
|
||||
static SpeciesData speciesData_LLLLL() { return checkCache(5, "LLLLL"); }
|
||||
static SpeciesData speciesData_LLLLLL() { return checkCache(6, "LLLLLL"); }
|
||||
}
|
||||
|
||||
@ -39,14 +39,14 @@ import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.lang.invoke.LambdaForm.*;
|
||||
import static java.lang.invoke.LambdaForm.BasicType;
|
||||
import static java.lang.invoke.LambdaForm.BasicType.*;
|
||||
import static java.lang.invoke.LambdaForm.Kind.*;
|
||||
import static java.lang.invoke.LambdaForm.*;
|
||||
import static java.lang.invoke.MethodHandleNatives.Constants.*;
|
||||
import static java.lang.invoke.MethodHandleStatics.*;
|
||||
|
||||
@ -65,6 +65,9 @@ class InvokerBytecodeGenerator {
|
||||
private static final String OBJ = "java/lang/Object";
|
||||
private static final String OBJARY = "[Ljava/lang/Object;";
|
||||
|
||||
private static final String LOOP_CLAUSES = MHI + "$LoopClauses";
|
||||
private static final String MHARY2 = "[[L" + MH + ";";
|
||||
|
||||
private static final String LF_SIG = "L" + LF + ";";
|
||||
private static final String LFN_SIG = "L" + LFN + ";";
|
||||
private static final String LL_SIG = "(L" + OBJ + ";)L" + OBJ + ";";
|
||||
@ -1319,38 +1322,43 @@ class InvokerBytecodeGenerator {
|
||||
* The pattern looks like (Cf. MethodHandleImpl.loop):
|
||||
* <blockquote><pre>{@code
|
||||
* // a0: BMH
|
||||
* // a1: inits, a2: steps, a3: preds, a4: finis
|
||||
* // a5: box, a6: unbox
|
||||
* // a7 (and following): arguments
|
||||
* loop=Lambda(a0:L,a1:L,a2:L,a3:L,a4:L,a5:L,a6:L,a7:L)=>{
|
||||
* t8:L=MethodHandle.invokeBasic(a5:L,a7:L); // box the arguments into an Object[]
|
||||
* t9:L=MethodHandleImpl.loop(bt:L,a1:L,a2:L,a3:L,a4:L,t8:L); // call the loop executor (with supplied types in bt)
|
||||
* t10:L=MethodHandle.invokeBasic(a6:L,t9:L);t10:L} // unbox the result; return the result
|
||||
* // a1: LoopClauses (containing an array of arrays: inits, steps, preds, finis)
|
||||
* // a2: box, a3: unbox
|
||||
* // a4 (and following): arguments
|
||||
* loop=Lambda(a0:L,a1:L,a2:L,a3:L,a4:L)=>{
|
||||
* t5:L=MethodHandle.invokeBasic(a2:L,a4:L); // box the arguments into an Object[]
|
||||
* t6:L=MethodHandleImpl.loop(bt:L,a1:L,t5:L); // call the loop executor (with supplied types in bt)
|
||||
* t7:L=MethodHandle.invokeBasic(a3:L,t6:L);t7:L} // unbox the result; return the result
|
||||
* }</pre></blockquote>
|
||||
* <p>
|
||||
* It is compiled into bytecode equivalent to the code seen in {@link MethodHandleImpl#loop(BasicType[],
|
||||
* MethodHandle[], MethodHandle[], MethodHandle[], MethodHandle[], Object...)}, with the difference that no arrays
|
||||
* MethodHandleImpl.LoopClauses, Object...)}, with the difference that no arrays
|
||||
* will be used for local state storage. Instead, the local state will be mapped to actual stack slots.
|
||||
* <p>
|
||||
* Bytecode generation applies an unrolling scheme to enable better bytecode generation regarding local state type
|
||||
* handling. The generated bytecode will have the following form ({@code void} types are ignored for convenience).
|
||||
* Assume there are {@code C} clauses in the loop.
|
||||
* <blockquote><pre>{@code
|
||||
* INIT: (INIT_SEQ for clause 1)
|
||||
* ...
|
||||
* (INIT_SEQ for clause C)
|
||||
* LOOP: (LOOP_SEQ for clause 1)
|
||||
* ...
|
||||
* (LOOP_SEQ for clause C)
|
||||
* GOTO LOOP
|
||||
* DONE: ...
|
||||
* PREINIT: ALOAD_1
|
||||
* CHECKCAST LoopClauses
|
||||
* GETFIELD LoopClauses.clauses
|
||||
* ASTORE clauseDataIndex // place the clauses 2-dimensional array on the stack
|
||||
* INIT: (INIT_SEQ for clause 1)
|
||||
* ...
|
||||
* (INIT_SEQ for clause C)
|
||||
* LOOP: (LOOP_SEQ for clause 1)
|
||||
* ...
|
||||
* (LOOP_SEQ for clause C)
|
||||
* GOTO LOOP
|
||||
* DONE: ...
|
||||
* }</pre></blockquote>
|
||||
* <p>
|
||||
* The {@code INIT_SEQ_x} sequence for clause {@code x} (with {@code x} ranging from {@code 0} to {@code C-1}) has
|
||||
* the following shape. Assume slot {@code vx} is used to hold the state for clause {@code x}.
|
||||
* <blockquote><pre>{@code
|
||||
* INIT_SEQ_x: ALOAD inits
|
||||
* CHECKCAST MethodHandle[]
|
||||
* INIT_SEQ_x: ALOAD clauseDataIndex
|
||||
* ICONST_0
|
||||
* AALOAD // load the inits array
|
||||
* ICONST x
|
||||
* AALOAD // load the init handle for clause x
|
||||
* load args
|
||||
@ -1361,24 +1369,27 @@ class InvokerBytecodeGenerator {
|
||||
* The {@code LOOP_SEQ_x} sequence for clause {@code x} (with {@code x} ranging from {@code 0} to {@code C-1}) has
|
||||
* the following shape. Again, assume slot {@code vx} is used to hold the state for clause {@code x}.
|
||||
* <blockquote><pre>{@code
|
||||
* LOOP_SEQ_x: ALOAD steps
|
||||
* CHECKCAST MethodHandle[]
|
||||
* LOOP_SEQ_x: ALOAD clauseDataIndex
|
||||
* ICONST_1
|
||||
* AALOAD // load the steps array
|
||||
* ICONST x
|
||||
* AALOAD // load the step handle for clause x
|
||||
* load locals
|
||||
* load args
|
||||
* INVOKEVIRTUAL MethodHandle.invokeBasic
|
||||
* store vx
|
||||
* ALOAD preds
|
||||
* CHECKCAST MethodHandle[]
|
||||
* ALOAD clauseDataIndex
|
||||
* ICONST_2
|
||||
* AALOAD // load the preds array
|
||||
* ICONST x
|
||||
* AALOAD // load the pred handle for clause x
|
||||
* load locals
|
||||
* load args
|
||||
* INVOKEVIRTUAL MethodHandle.invokeBasic
|
||||
* IFNE LOOP_SEQ_x+1 // predicate returned false -> jump to next clause
|
||||
* ALOAD finis
|
||||
* CHECKCAST MethodHandle[]
|
||||
* ALOAD clauseDataIndex
|
||||
* ICONST_3
|
||||
* AALOAD // load the finis array
|
||||
* ICONST x
|
||||
* AALOAD // load the fini handle for clause x
|
||||
* load locals
|
||||
@ -1397,8 +1408,12 @@ class InvokerBytecodeGenerator {
|
||||
BasicType[] loopClauseTypes = (BasicType[]) invoker.arguments[0];
|
||||
Class<?>[] loopLocalStateTypes = Stream.of(loopClauseTypes).
|
||||
filter(bt -> bt != BasicType.V_TYPE).map(BasicType::basicTypeClass).toArray(Class<?>[]::new);
|
||||
Class<?>[] localTypes = new Class<?>[loopLocalStateTypes.length + 1];
|
||||
localTypes[0] = MethodHandleImpl.LoopClauses.class;
|
||||
System.arraycopy(loopLocalStateTypes, 0, localTypes, 1, loopLocalStateTypes.length);
|
||||
|
||||
final int firstLoopStateIndex = extendLocalsMap(loopLocalStateTypes);
|
||||
final int clauseDataIndex = extendLocalsMap(localTypes);
|
||||
final int firstLoopStateIndex = clauseDataIndex + 1;
|
||||
|
||||
Class<?> returnType = result.function.resolvedHandle().type().returnType();
|
||||
MethodType loopType = args.function.resolvedHandle().type()
|
||||
@ -1420,10 +1435,16 @@ class InvokerBytecodeGenerator {
|
||||
Label lDone = new Label();
|
||||
Label lNext;
|
||||
|
||||
// PREINIT:
|
||||
emitPushArgument(MethodHandleImpl.LoopClauses.class, invoker.arguments[1]);
|
||||
mv.visitFieldInsn(Opcodes.GETFIELD, LOOP_CLAUSES, "clauses", MHARY2);
|
||||
emitAstoreInsn(clauseDataIndex);
|
||||
|
||||
// INIT:
|
||||
for (int c = 0, state = 0; c < nClauses; ++c) {
|
||||
MethodType cInitType = loopType.changeReturnType(loopClauseTypes[c].basicTypeClass());
|
||||
emitLoopHandleInvoke(invoker, inits, c, args, false, cInitType, loopLocalStateTypes, firstLoopStateIndex);
|
||||
emitLoopHandleInvoke(invoker, inits, c, args, false, cInitType, loopLocalStateTypes, clauseDataIndex,
|
||||
firstLoopStateIndex);
|
||||
if (cInitType.returnType() != void.class) {
|
||||
emitStoreInsn(BasicType.basicType(cInitType.returnType()), firstLoopStateIndex + state);
|
||||
++state;
|
||||
@ -1440,18 +1461,21 @@ class InvokerBytecodeGenerator {
|
||||
boolean isVoid = stepType.returnType() == void.class;
|
||||
|
||||
// invoke loop step
|
||||
emitLoopHandleInvoke(invoker, steps, c, args, true, stepType, loopLocalStateTypes, firstLoopStateIndex);
|
||||
emitLoopHandleInvoke(invoker, steps, c, args, true, stepType, loopLocalStateTypes, clauseDataIndex,
|
||||
firstLoopStateIndex);
|
||||
if (!isVoid) {
|
||||
emitStoreInsn(BasicType.basicType(stepType.returnType()), firstLoopStateIndex + state);
|
||||
++state;
|
||||
}
|
||||
|
||||
// invoke loop predicate
|
||||
emitLoopHandleInvoke(invoker, preds, c, args, true, predType, loopLocalStateTypes, firstLoopStateIndex);
|
||||
emitLoopHandleInvoke(invoker, preds, c, args, true, predType, loopLocalStateTypes, clauseDataIndex,
|
||||
firstLoopStateIndex);
|
||||
mv.visitJumpInsn(Opcodes.IFNE, lNext);
|
||||
|
||||
// invoke fini
|
||||
emitLoopHandleInvoke(invoker, finis, c, args, true, finiType, loopLocalStateTypes, firstLoopStateIndex);
|
||||
emitLoopHandleInvoke(invoker, finis, c, args, true, finiType, loopLocalStateTypes, clauseDataIndex,
|
||||
firstLoopStateIndex);
|
||||
mv.visitJumpInsn(Opcodes.GOTO, lDone);
|
||||
|
||||
// this is the beginning of the next loop clause
|
||||
@ -1483,9 +1507,10 @@ class InvokerBytecodeGenerator {
|
||||
}
|
||||
|
||||
private void emitLoopHandleInvoke(Name holder, int handles, int clause, Name args, boolean pushLocalState,
|
||||
MethodType type, Class<?>[] loopLocalStateTypes, int firstLoopStateSlot) {
|
||||
MethodType type, Class<?>[] loopLocalStateTypes, int clauseDataSlot,
|
||||
int firstLoopStateSlot) {
|
||||
// load handle for clause
|
||||
emitPushArgument(holder, handles);
|
||||
emitPushClauseArray(clauseDataSlot, handles);
|
||||
emitIconstInsn(clause);
|
||||
mv.visitInsn(Opcodes.AALOAD);
|
||||
// load loop state (preceding the other arguments)
|
||||
@ -1499,6 +1524,12 @@ class InvokerBytecodeGenerator {
|
||||
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, MH, "invokeBasic", type.toMethodDescriptorString(), false);
|
||||
}
|
||||
|
||||
private void emitPushClauseArray(int clauseDataSlot, int which) {
|
||||
emitAloadInsn(clauseDataSlot);
|
||||
emitIconstInsn(which - 1);
|
||||
mv.visitInsn(Opcodes.AALOAD);
|
||||
}
|
||||
|
||||
private void emitZero(BasicType type) {
|
||||
switch (type) {
|
||||
case I_TYPE: mv.visitInsn(Opcodes.ICONST_0); break;
|
||||
|
||||
@ -41,7 +41,6 @@ import java.util.HashMap;
|
||||
import static java.lang.invoke.LambdaForm.BasicType.*;
|
||||
import static java.lang.invoke.MethodHandleNatives.Constants.REF_invokeStatic;
|
||||
import static java.lang.invoke.MethodHandleStatics.*;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* The symbolic, non-executable form of a method handle's invocation semantics.
|
||||
@ -732,9 +731,9 @@ class LambdaForm {
|
||||
boolean isLoop(int pos) {
|
||||
// loop idiom:
|
||||
// t_{n}:L=MethodHandle.invokeBasic(...)
|
||||
// t_{n+1}:L=MethodHandleImpl.loop(types, *, *, *, *, t_{n})
|
||||
// t_{n+1}:L=MethodHandleImpl.loop(types, *, t_{n})
|
||||
// t_{n+2}:?=MethodHandle.invokeBasic(*, t_{n+1})
|
||||
return isMatchingIdiom(pos, "loop", 5);
|
||||
return isMatchingIdiom(pos, "loop", 2);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -1689,8 +1689,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
NF_tryFinally = new NamedFunction(MethodHandleImpl.class
|
||||
.getDeclaredMethod("tryFinally", MethodHandle.class, MethodHandle.class, Object[].class));
|
||||
NF_loop = new NamedFunction(MethodHandleImpl.class
|
||||
.getDeclaredMethod("loop", BasicType[].class, MethodHandle[].class, MethodHandle[].class,
|
||||
MethodHandle[].class, MethodHandle[].class, Object[].class));
|
||||
.getDeclaredMethod("loop", BasicType[].class, LoopClauses.class, Object[].class));
|
||||
NF_throwException = new NamedFunction(MethodHandleImpl.class
|
||||
.getDeclaredMethod("throwException", Throwable.class));
|
||||
NF_profileBoolean = new NamedFunction(MethodHandleImpl.class
|
||||
@ -1794,12 +1793,13 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
MethodHandle collectArgs = varargsArray(type.parameterCount()).asType(varargsType);
|
||||
MethodHandle unboxResult = unboxResultHandle(tloop);
|
||||
|
||||
BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLLLLL();
|
||||
LoopClauses clauseData =
|
||||
new LoopClauses(new MethodHandle[][]{toArray(init), toArray(step), toArray(pred), toArray(fini)});
|
||||
BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLL();
|
||||
BoundMethodHandle mh;
|
||||
try {
|
||||
mh = (BoundMethodHandle) data.constructor().invokeBasic(type, form, (Object) toArray(init),
|
||||
(Object) toArray(step), (Object) toArray(pred), (Object) toArray(fini), (Object) collectArgs,
|
||||
(Object) unboxResult);
|
||||
mh = (BoundMethodHandle) data.constructor().invokeBasic(type, form, (Object) clauseData,
|
||||
(Object) collectArgs, (Object) unboxResult);
|
||||
} catch (Throwable ex) {
|
||||
throw uncaughtException(ex);
|
||||
}
|
||||
@ -1818,23 +1818,20 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
* {@code t12}):
|
||||
* <blockquote><pre>{@code
|
||||
* loop=Lambda(a0:L,a1:L)=>{
|
||||
* t2:L=BoundMethodHandle$Species_L6.argL0(a0:L); // array of init method handles
|
||||
* t3:L=BoundMethodHandle$Species_L6.argL1(a0:L); // array of step method handles
|
||||
* t4:L=BoundMethodHandle$Species_L6.argL2(a0:L); // array of pred method handles
|
||||
* t5:L=BoundMethodHandle$Species_L6.argL3(a0:L); // array of fini method handles
|
||||
* t6:L=BoundMethodHandle$Species_L6.argL4(a0:L); // helper handle to box the arguments into an Object[]
|
||||
* t7:L=BoundMethodHandle$Species_L6.argL5(a0:L); // helper handle to unbox the result
|
||||
* t8:L=MethodHandle.invokeBasic(t6:L,a1:L); // box the arguments into an Object[]
|
||||
* t9:L=MethodHandleImpl.loop(null,t2:L,t3:L,t4:L,t5:L,t6:L); // call the loop executor
|
||||
* t10:L=MethodHandle.invokeBasic(t7:L,t9:L);t10:L} // unbox the result; return the result
|
||||
* t2:L=BoundMethodHandle$Species_L3.argL0(a0:L); // LoopClauses holding init, step, pred, fini handles
|
||||
* t3:L=BoundMethodHandle$Species_L3.argL1(a0:L); // helper handle to box the arguments into an Object[]
|
||||
* t4:L=BoundMethodHandle$Species_L3.argL2(a0:L); // helper handle to unbox the result
|
||||
* t5:L=MethodHandle.invokeBasic(t3:L,a1:L); // box the arguments into an Object[]
|
||||
* t6:L=MethodHandleImpl.loop(null,t2:L,t3:L); // call the loop executor
|
||||
* t7:L=MethodHandle.invokeBasic(t4:L,t6:L);t7:L} // unbox the result; return the result
|
||||
* }</pre></blockquote>
|
||||
* <p>
|
||||
* {@code argL0} through {@code argL3} are the arrays of init, step, pred, and fini method handles.
|
||||
* {@code argL4} and {@code argL5} are auxiliary method handles: {@code argL2} boxes arguments and wraps them into
|
||||
* {@code Object[]} ({@code ValueConversions.array()}), and {@code argL3} unboxes the result if necessary
|
||||
* {@code argL0} is a LoopClauses instance holding, in a 2-dimensional array, the init, step, pred, and fini method
|
||||
* handles. {@code argL1} and {@code argL2} are auxiliary method handles: {@code argL1} boxes arguments and wraps
|
||||
* them into {@code Object[]} ({@code ValueConversions.array()}), and {@code argL2} unboxes the result if necessary
|
||||
* ({@code ValueConversions.unbox()}).
|
||||
* <p>
|
||||
* Having {@code t6} and {@code t7} passed in via a BMH and not hardcoded in the lambda form allows to share lambda
|
||||
* Having {@code t3} and {@code t4} passed in via a BMH and not hardcoded in the lambda form allows to share lambda
|
||||
* forms among loop combinators with the same basic type.
|
||||
* <p>
|
||||
* The above template is instantiated by using the {@link LambdaFormEditor} to replace the {@code null} argument to
|
||||
@ -1845,15 +1842,12 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
private static LambdaForm makeLoopForm(MethodType basicType, BasicType[] localVarTypes) {
|
||||
MethodType lambdaType = basicType.invokerType();
|
||||
|
||||
final int THIS_MH = 0; // the BMH_LLLLLL
|
||||
final int THIS_MH = 0; // the BMH_LLL
|
||||
final int ARG_BASE = 1; // start of incoming arguments
|
||||
final int ARG_LIMIT = ARG_BASE + basicType.parameterCount();
|
||||
|
||||
int nameCursor = ARG_LIMIT;
|
||||
final int GET_INITS = nameCursor++;
|
||||
final int GET_STEPS = nameCursor++;
|
||||
final int GET_PREDS = nameCursor++;
|
||||
final int GET_FINIS = nameCursor++;
|
||||
final int GET_CLAUSE_DATA = nameCursor++;
|
||||
final int GET_COLLECT_ARGS = nameCursor++;
|
||||
final int GET_UNBOX_RESULT = nameCursor++;
|
||||
final int BOXED_ARGS = nameCursor++;
|
||||
@ -1864,14 +1858,11 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
if (lform == null) {
|
||||
Name[] names = arguments(nameCursor - ARG_LIMIT, lambdaType);
|
||||
|
||||
BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLLLLL();
|
||||
BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLL();
|
||||
names[THIS_MH] = names[THIS_MH].withConstraint(data);
|
||||
names[GET_INITS] = new Name(data.getterFunction(0), names[THIS_MH]);
|
||||
names[GET_STEPS] = new Name(data.getterFunction(1), names[THIS_MH]);
|
||||
names[GET_PREDS] = new Name(data.getterFunction(2), names[THIS_MH]);
|
||||
names[GET_FINIS] = new Name(data.getterFunction(3), names[THIS_MH]);
|
||||
names[GET_COLLECT_ARGS] = new Name(data.getterFunction(4), names[THIS_MH]);
|
||||
names[GET_UNBOX_RESULT] = new Name(data.getterFunction(5), names[THIS_MH]);
|
||||
names[GET_CLAUSE_DATA] = new Name(data.getterFunction(0), names[THIS_MH]);
|
||||
names[GET_COLLECT_ARGS] = new Name(data.getterFunction(1), names[THIS_MH]);
|
||||
names[GET_UNBOX_RESULT] = new Name(data.getterFunction(2), names[THIS_MH]);
|
||||
|
||||
// t_{i}:L=MethodHandle.invokeBasic(collectArgs:L,a1:L,...);
|
||||
MethodType collectArgsType = basicType.changeReturnType(Object.class);
|
||||
@ -1881,10 +1872,10 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
System.arraycopy(names, ARG_BASE, args, 1, ARG_LIMIT - ARG_BASE);
|
||||
names[BOXED_ARGS] = new Name(makeIntrinsic(invokeBasic, Intrinsic.LOOP), args);
|
||||
|
||||
// t_{i+1}:L=MethodHandleImpl.loop(localTypes:L,inits:L,steps:L,preds:L,finis:L,t_{i}:L);
|
||||
// t_{i+1}:L=MethodHandleImpl.loop(localTypes:L,clauses:L,t_{i}:L);
|
||||
Object[] lArgs =
|
||||
new Object[]{null, // placeholder for BasicType[] localTypes - will be added by LambdaFormEditor
|
||||
names[GET_INITS], names[GET_STEPS], names[GET_PREDS], names[GET_FINIS], names[BOXED_ARGS]};
|
||||
names[GET_CLAUSE_DATA], names[BOXED_ARGS]};
|
||||
names[LOOP] = new Name(NF_loop, lArgs);
|
||||
|
||||
// t_{i+2}:I=MethodHandle.invokeBasic(unbox:L,t_{i+1}:L);
|
||||
@ -1900,22 +1891,52 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
return lform.editor().noteLoopLocalTypesForm(BOXED_ARGS, localVarTypes);
|
||||
}
|
||||
|
||||
static class LoopClauses {
|
||||
@Stable final MethodHandle[][] clauses;
|
||||
LoopClauses(MethodHandle[][] clauses) {
|
||||
assert clauses.length == 4;
|
||||
this.clauses = clauses;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer("LoopClauses -- ");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
if (i > 0) {
|
||||
sb.append(" ");
|
||||
}
|
||||
sb.append('<').append(i).append(">: ");
|
||||
MethodHandle[] hs = clauses[i];
|
||||
for (int j = 0; j < hs.length; ++j) {
|
||||
if (j > 0) {
|
||||
sb.append(" ");
|
||||
}
|
||||
sb.append('*').append(j).append(": ").append(hs[j]).append('\n');
|
||||
}
|
||||
}
|
||||
sb.append(" --\n");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Intrinsified during LambdaForm compilation
|
||||
* (see {@link InvokerBytecodeGenerator#emitLoop(int)}).
|
||||
*/
|
||||
@LambdaForm.Hidden
|
||||
static Object loop(BasicType[] localTypes, MethodHandle[] init, MethodHandle[] step, MethodHandle[] pred,
|
||||
MethodHandle[] fini, Object... av) throws Throwable {
|
||||
static Object loop(BasicType[] localTypes, LoopClauses clauseData, Object... av) throws Throwable {
|
||||
final MethodHandle[] init = clauseData.clauses[0];
|
||||
final MethodHandle[] step = clauseData.clauses[1];
|
||||
final MethodHandle[] pred = clauseData.clauses[2];
|
||||
final MethodHandle[] fini = clauseData.clauses[3];
|
||||
int varSize = (int) Stream.of(init).filter(h -> h.type().returnType() != void.class).count();
|
||||
int nArgs = init[0].type().parameterCount();
|
||||
Object[] varsAndArgs = new Object[varSize + nArgs];
|
||||
for (int i = 0, v = 0; i < init.length; ++i) {
|
||||
if (init[i].type().returnType() == void.class) {
|
||||
init[i].asFixedArity().invokeWithArguments(av);
|
||||
MethodHandle ih = init[i];
|
||||
if (ih.type().returnType() == void.class) {
|
||||
ih.invokeWithArguments(av);
|
||||
} else {
|
||||
varsAndArgs[v++] = init[i].asFixedArity().invokeWithArguments(av);
|
||||
varsAndArgs[v++] = ih.invokeWithArguments(av);
|
||||
}
|
||||
}
|
||||
System.arraycopy(av, 0, varsAndArgs, varSize, nArgs);
|
||||
@ -1926,12 +1947,12 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
MethodHandle s = step[i];
|
||||
MethodHandle f = fini[i];
|
||||
if (s.type().returnType() == void.class) {
|
||||
s.asFixedArity().invokeWithArguments(varsAndArgs);
|
||||
s.invokeWithArguments(varsAndArgs);
|
||||
} else {
|
||||
varsAndArgs[v++] = s.asFixedArity().invokeWithArguments(varsAndArgs);
|
||||
varsAndArgs[v++] = s.invokeWithArguments(varsAndArgs);
|
||||
}
|
||||
if (!(boolean) p.asFixedArity().invokeWithArguments(varsAndArgs)) {
|
||||
return f.asFixedArity().invokeWithArguments(varsAndArgs);
|
||||
if (!(boolean) p.invokeWithArguments(varsAndArgs)) {
|
||||
return f.invokeWithArguments(varsAndArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2122,14 +2143,13 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
Throwable t = null;
|
||||
Object r = null;
|
||||
try {
|
||||
// Use asFixedArity() to avoid unnecessary boxing of last argument for VarargsCollector case.
|
||||
r = target.asFixedArity().invokeWithArguments(av);
|
||||
r = target.invokeWithArguments(av);
|
||||
} catch (Throwable thrown) {
|
||||
t = thrown;
|
||||
throw t;
|
||||
} finally {
|
||||
Object[] args = target.type().returnType() == void.class ? prepend(av, t) : prepend(av, t, r);
|
||||
r = cleanup.asFixedArity().invokeWithArguments(args);
|
||||
r = cleanup.invokeWithArguments(args);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
@ -4368,10 +4368,11 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
|
||||
}
|
||||
|
||||
// Step 4: fill in missing parameter types.
|
||||
List<MethodHandle> finit = fillParameterTypes(init, commonSuffix);
|
||||
List<MethodHandle> fstep = fillParameterTypes(step, commonParameterSequence);
|
||||
List<MethodHandle> fpred = fillParameterTypes(pred, commonParameterSequence);
|
||||
List<MethodHandle> ffini = fillParameterTypes(fini, commonParameterSequence);
|
||||
// Also convert all handles to fixed-arity handles.
|
||||
List<MethodHandle> finit = fixArities(fillParameterTypes(init, commonSuffix));
|
||||
List<MethodHandle> fstep = fixArities(fillParameterTypes(step, commonParameterSequence));
|
||||
List<MethodHandle> fpred = fixArities(fillParameterTypes(pred, commonParameterSequence));
|
||||
List<MethodHandle> ffini = fixArities(fillParameterTypes(fini, commonParameterSequence));
|
||||
|
||||
assert finit.stream().map(MethodHandle::type).map(MethodType::parameterList).
|
||||
allMatch(pl -> pl.equals(commonSuffix));
|
||||
@ -4389,6 +4390,10 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private static List<MethodHandle> fixArities(List<MethodHandle> hs) {
|
||||
return hs.stream().map(MethodHandle::asFixedArity).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a {@code while} loop from an initializer, a body, and a predicate. This is a convenience wrapper for
|
||||
* the {@linkplain #loop(MethodHandle[][]) generic loop combinator}.
|
||||
@ -4887,7 +4892,8 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
|
||||
// target parameter list.
|
||||
cleanup = dropArgumentsToMatch(cleanup, (rtype == void.class ? 1 : 2), targetParamTypes, 0);
|
||||
|
||||
return MethodHandleImpl.makeTryFinally(target, cleanup, rtype, targetParamTypes);
|
||||
// Use asFixedArity() to avoid unnecessary boxing of last argument for VarargsCollector case.
|
||||
return MethodHandleImpl.makeTryFinally(target.asFixedArity(), cleanup.asFixedArity(), rtype, targetParamTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -664,7 +664,7 @@ final class ModuleInfo {
|
||||
try {
|
||||
bb.get(b, off, len);
|
||||
} catch (BufferUnderflowException e) {
|
||||
throw new EOFException();
|
||||
throw new EOFException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -681,7 +681,7 @@ final class ModuleInfo {
|
||||
int ch = bb.get();
|
||||
return (ch != 0);
|
||||
} catch (BufferUnderflowException e) {
|
||||
throw new EOFException();
|
||||
throw new EOFException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -690,7 +690,7 @@ final class ModuleInfo {
|
||||
try {
|
||||
return bb.get();
|
||||
} catch (BufferUnderflowException e) {
|
||||
throw new EOFException();
|
||||
throw new EOFException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -699,7 +699,7 @@ final class ModuleInfo {
|
||||
try {
|
||||
return ((int) bb.get()) & 0xff;
|
||||
} catch (BufferUnderflowException e) {
|
||||
throw new EOFException();
|
||||
throw new EOFException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -708,7 +708,7 @@ final class ModuleInfo {
|
||||
try {
|
||||
return bb.getShort();
|
||||
} catch (BufferUnderflowException e) {
|
||||
throw new EOFException();
|
||||
throw new EOFException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -717,7 +717,7 @@ final class ModuleInfo {
|
||||
try {
|
||||
return ((int) bb.getShort()) & 0xffff;
|
||||
} catch (BufferUnderflowException e) {
|
||||
throw new EOFException();
|
||||
throw new EOFException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -726,7 +726,7 @@ final class ModuleInfo {
|
||||
try {
|
||||
return bb.getChar();
|
||||
} catch (BufferUnderflowException e) {
|
||||
throw new EOFException();
|
||||
throw new EOFException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -735,7 +735,7 @@ final class ModuleInfo {
|
||||
try {
|
||||
return bb.getInt();
|
||||
} catch (BufferUnderflowException e) {
|
||||
throw new EOFException();
|
||||
throw new EOFException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -744,7 +744,7 @@ final class ModuleInfo {
|
||||
try {
|
||||
return bb.getLong();
|
||||
} catch (BufferUnderflowException e) {
|
||||
throw new EOFException();
|
||||
throw new EOFException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -753,7 +753,7 @@ final class ModuleInfo {
|
||||
try {
|
||||
return bb.getFloat();
|
||||
} catch (BufferUnderflowException e) {
|
||||
throw new EOFException();
|
||||
throw new EOFException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -762,7 +762,7 @@ final class ModuleInfo {
|
||||
try {
|
||||
return bb.getDouble();
|
||||
} catch (BufferUnderflowException e) {
|
||||
throw new EOFException();
|
||||
throw new EOFException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -597,10 +597,10 @@ public class Proxy implements java.io.Serializable {
|
||||
private final Module module;
|
||||
ProxyBuilder(ClassLoader loader, List<Class<?>> interfaces) {
|
||||
if (!VM.isModuleSystemInited()) {
|
||||
throw new InternalError("Proxy is not supported until module system is fully initialzed");
|
||||
throw new InternalError("Proxy is not supported until module system is fully initialized");
|
||||
}
|
||||
if (interfaces.size() > 65535) {
|
||||
throw new IllegalArgumentException("interface limit exceeded");
|
||||
throw new IllegalArgumentException("interface limit exceeded: " + interfaces.size());
|
||||
}
|
||||
|
||||
Set<Class<?>> refTypes = referencedTypes(loader, interfaces);
|
||||
|
||||
@ -2559,6 +2559,13 @@ public class CompletableFuture<T> implements Future<T>, CompletionStage<T> {
|
||||
* exceptionally with a CompletionException with this exception as
|
||||
* cause.
|
||||
*
|
||||
* <p>Unless overridden by a subclass, a new non-minimal
|
||||
* CompletableFuture with all methods available can be obtained from
|
||||
* a minimal CompletionStage via {@link #toCompletableFuture()}.
|
||||
* For example, completion of a minimal stage can be awaited by
|
||||
*
|
||||
* <pre> {@code minimalStage.toCompletableFuture().join(); }</pre>
|
||||
*
|
||||
* @return the new CompletionStage
|
||||
* @since 9
|
||||
*/
|
||||
@ -2853,6 +2860,16 @@ public class CompletableFuture<T> implements Future<T>, CompletionStage<T> {
|
||||
@Override public CompletableFuture<T> completeOnTimeout
|
||||
(T value, long timeout, TimeUnit unit) {
|
||||
throw new UnsupportedOperationException(); }
|
||||
@Override public CompletableFuture<T> toCompletableFuture() {
|
||||
Object r;
|
||||
if ((r = result) != null)
|
||||
return new CompletableFuture<T>(encodeRelay(r));
|
||||
else {
|
||||
CompletableFuture<T> d = new CompletableFuture<>();
|
||||
unipush(new UniRelay<T,T>(d, this));
|
||||
return d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// VarHandle mechanics
|
||||
|
||||
@ -1191,7 +1191,7 @@ public class ForkJoinPool extends AbstractExecutorService {
|
||||
* Default idle timeout value (in milliseconds) for the thread
|
||||
* triggering quiescence to park waiting for new work
|
||||
*/
|
||||
private static final long DEFAULT_KEEPALIVE = 60000L;
|
||||
private static final long DEFAULT_KEEPALIVE = 60_000L;
|
||||
|
||||
/**
|
||||
* Undershoot tolerance for idle timeouts
|
||||
@ -2303,7 +2303,6 @@ public class ForkJoinPool extends AbstractExecutorService {
|
||||
throw new NullPointerException();
|
||||
long ms = Math.max(unit.toMillis(keepAliveTime), TIMEOUT_SLOP);
|
||||
|
||||
String prefix = "ForkJoinPool-" + nextPoolId() + "-worker-";
|
||||
int corep = Math.min(Math.max(corePoolSize, parallelism), MAX_CAP);
|
||||
long c = ((((long)(-corep) << TC_SHIFT) & TC_MASK) |
|
||||
(((long)(-parallelism) << RC_SHIFT) & RC_MASK));
|
||||
@ -2315,8 +2314,8 @@ public class ForkJoinPool extends AbstractExecutorService {
|
||||
n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16;
|
||||
n = (n + 1) << 1; // power of two, including space for submission queues
|
||||
|
||||
this.workerNamePrefix = "ForkJoinPool-" + nextPoolId() + "-worker-";
|
||||
this.workQueues = new WorkQueue[n];
|
||||
this.workerNamePrefix = prefix;
|
||||
this.factory = factory;
|
||||
this.ueh = handler;
|
||||
this.saturate = saturate;
|
||||
@ -2327,11 +2326,19 @@ public class ForkJoinPool extends AbstractExecutorService {
|
||||
checkPermission();
|
||||
}
|
||||
|
||||
private Object newInstanceFromSystemProperty(String property)
|
||||
throws ReflectiveOperationException {
|
||||
String className = System.getProperty(property);
|
||||
return (className == null)
|
||||
? null
|
||||
: ClassLoader.getSystemClassLoader().loadClass(className)
|
||||
.getConstructor().newInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for common pool using parameters possibly
|
||||
* overridden by system properties
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Class.newInstance
|
||||
private ForkJoinPool(byte forCommonPoolOnly) {
|
||||
int parallelism = -1;
|
||||
ForkJoinWorkerThreadFactory fac = null;
|
||||
@ -2339,18 +2346,12 @@ public class ForkJoinPool extends AbstractExecutorService {
|
||||
try { // ignore exceptions in accessing/parsing properties
|
||||
String pp = System.getProperty
|
||||
("java.util.concurrent.ForkJoinPool.common.parallelism");
|
||||
String fp = System.getProperty
|
||||
("java.util.concurrent.ForkJoinPool.common.threadFactory");
|
||||
String hp = System.getProperty
|
||||
("java.util.concurrent.ForkJoinPool.common.exceptionHandler");
|
||||
if (pp != null)
|
||||
parallelism = Integer.parseInt(pp);
|
||||
if (fp != null)
|
||||
fac = ((ForkJoinWorkerThreadFactory)ClassLoader.
|
||||
getSystemClassLoader().loadClass(fp).newInstance());
|
||||
if (hp != null)
|
||||
handler = ((UncaughtExceptionHandler)ClassLoader.
|
||||
getSystemClassLoader().loadClass(hp).newInstance());
|
||||
fac = (ForkJoinWorkerThreadFactory) newInstanceFromSystemProperty(
|
||||
"java.util.concurrent.ForkJoinPool.common.threadFactory");
|
||||
handler = (UncaughtExceptionHandler) newInstanceFromSystemProperty(
|
||||
"java.util.concurrent.ForkJoinPool.common.exceptionHandler");
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
|
||||
@ -2373,8 +2374,8 @@ public class ForkJoinPool extends AbstractExecutorService {
|
||||
n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16;
|
||||
n = (n + 1) << 1;
|
||||
|
||||
this.workQueues = new WorkQueue[n];
|
||||
this.workerNamePrefix = "ForkJoinPool.commonPool-worker-";
|
||||
this.workQueues = new WorkQueue[n];
|
||||
this.factory = fac;
|
||||
this.ueh = handler;
|
||||
this.saturate = null;
|
||||
|
||||
@ -35,6 +35,9 @@
|
||||
|
||||
package java.util.concurrent.atomic;
|
||||
|
||||
import static java.lang.Double.doubleToRawLongBits;
|
||||
import static java.lang.Double.longBitsToDouble;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.function.DoubleBinaryOperator;
|
||||
|
||||
@ -91,7 +94,7 @@ public class DoubleAccumulator extends Striped64 implements Serializable {
|
||||
public DoubleAccumulator(DoubleBinaryOperator accumulatorFunction,
|
||||
double identity) {
|
||||
this.function = accumulatorFunction;
|
||||
base = this.identity = Double.doubleToRawLongBits(identity);
|
||||
base = this.identity = doubleToRawLongBits(identity);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -101,18 +104,19 @@ public class DoubleAccumulator extends Striped64 implements Serializable {
|
||||
*/
|
||||
public void accumulate(double x) {
|
||||
Cell[] as; long b, v, r; int m; Cell a;
|
||||
if ((as = cells) != null ||
|
||||
(r = Double.doubleToRawLongBits
|
||||
(function.applyAsDouble
|
||||
(Double.longBitsToDouble(b = base), x))) != b && !casBase(b, r)) {
|
||||
if ((as = cells) != null
|
||||
|| ((r = doubleToRawLongBits
|
||||
(function.applyAsDouble(longBitsToDouble(b = base), x))) != b
|
||||
&& !casBase(b, r))) {
|
||||
boolean uncontended = true;
|
||||
if (as == null || (m = as.length - 1) < 0 ||
|
||||
(a = as[getProbe() & m]) == null ||
|
||||
!(uncontended =
|
||||
(r = Double.doubleToRawLongBits
|
||||
(function.applyAsDouble
|
||||
(Double.longBitsToDouble(v = a.value), x))) == v ||
|
||||
a.cas(v, r)))
|
||||
if (as == null
|
||||
|| (m = as.length - 1) < 0
|
||||
|| (a = as[getProbe() & m]) == null
|
||||
|| !(uncontended =
|
||||
((r = doubleToRawLongBits
|
||||
(function.applyAsDouble
|
||||
(longBitsToDouble(v = a.value), x))) == v)
|
||||
|| a.cas(v, r)))
|
||||
doubleAccumulate(x, function, uncontended);
|
||||
}
|
||||
}
|
||||
@ -128,12 +132,12 @@ public class DoubleAccumulator extends Striped64 implements Serializable {
|
||||
*/
|
||||
public double get() {
|
||||
Cell[] as = cells;
|
||||
double result = Double.longBitsToDouble(base);
|
||||
double result = longBitsToDouble(base);
|
||||
if (as != null) {
|
||||
for (Cell a : as)
|
||||
if (a != null)
|
||||
result = function.applyAsDouble
|
||||
(result, Double.longBitsToDouble(a.value));
|
||||
(result, longBitsToDouble(a.value));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -168,12 +172,12 @@ public class DoubleAccumulator extends Striped64 implements Serializable {
|
||||
*/
|
||||
public double getThenReset() {
|
||||
Cell[] as = cells;
|
||||
double result = Double.longBitsToDouble(base);
|
||||
double result = longBitsToDouble(base);
|
||||
base = identity;
|
||||
if (as != null) {
|
||||
for (Cell a : as) {
|
||||
if (a != null) {
|
||||
double v = Double.longBitsToDouble(a.value);
|
||||
double v = longBitsToDouble(a.value);
|
||||
a.reset(identity);
|
||||
result = function.applyAsDouble(result, v);
|
||||
}
|
||||
@ -267,9 +271,9 @@ public class DoubleAccumulator extends Striped64 implements Serializable {
|
||||
* held by this proxy
|
||||
*/
|
||||
private Object readResolve() {
|
||||
double d = Double.longBitsToDouble(identity);
|
||||
double d = longBitsToDouble(identity);
|
||||
DoubleAccumulator a = new DoubleAccumulator(function, d);
|
||||
a.base = Double.doubleToRawLongBits(value);
|
||||
a.base = doubleToRawLongBits(value);
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,14 +103,16 @@ public class LongAccumulator extends Striped64 implements Serializable {
|
||||
*/
|
||||
public void accumulate(long x) {
|
||||
Cell[] as; long b, v, r; int m; Cell a;
|
||||
if ((as = cells) != null ||
|
||||
(r = function.applyAsLong(b = base, x)) != b && !casBase(b, r)) {
|
||||
if ((as = cells) != null
|
||||
|| ((r = function.applyAsLong(b = base, x)) != b
|
||||
&& !casBase(b, r))) {
|
||||
boolean uncontended = true;
|
||||
if (as == null || (m = as.length - 1) < 0 ||
|
||||
(a = as[getProbe() & m]) == null ||
|
||||
!(uncontended =
|
||||
(r = function.applyAsLong(v = a.value, x)) == v ||
|
||||
a.cas(v, r)))
|
||||
if (as == null
|
||||
|| (m = as.length - 1) < 0
|
||||
|| (a = as[getProbe() & m]) == null
|
||||
|| !(uncontended =
|
||||
(r = function.applyAsLong(v = a.value, x)) == v
|
||||
|| a.cas(v, r)))
|
||||
longAccumulate(x, function, uncontended);
|
||||
}
|
||||
}
|
||||
|
||||
@ -186,7 +186,9 @@ public class BasicImageReader implements AutoCloseable {
|
||||
|
||||
if (result.getMajorVersion() != ImageHeader.MAJOR_VERSION ||
|
||||
result.getMinorVersion() != ImageHeader.MINOR_VERSION) {
|
||||
throw new IOException("The image file \"" + name + "\" is not the correct version");
|
||||
throw new IOException("The image file \"" + name + "\" is not " +
|
||||
"the correct version. Major: " + result.getMajorVersion() +
|
||||
". Minor: " + result.getMinorVersion());
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -318,11 +320,11 @@ public class BasicImageReader implements AutoCloseable {
|
||||
|
||||
private ByteBuffer readBuffer(long offset, long size) {
|
||||
if (offset < 0 || Integer.MAX_VALUE <= offset) {
|
||||
throw new IndexOutOfBoundsException("offset");
|
||||
throw new IndexOutOfBoundsException("Bad offset: " + offset);
|
||||
}
|
||||
|
||||
if (size < 0 || Integer.MAX_VALUE <= size) {
|
||||
throw new IndexOutOfBoundsException("size");
|
||||
throw new IndexOutOfBoundsException("Bad size: " + size);
|
||||
}
|
||||
|
||||
if (MAP_ALL) {
|
||||
@ -382,11 +384,13 @@ public class BasicImageReader implements AutoCloseable {
|
||||
long uncompressedSize = loc.getUncompressedSize();
|
||||
|
||||
if (compressedSize < 0 || Integer.MAX_VALUE < compressedSize) {
|
||||
throw new IndexOutOfBoundsException("Compressed size");
|
||||
throw new IndexOutOfBoundsException(
|
||||
"Bad compressed size: " + compressedSize);
|
||||
}
|
||||
|
||||
if (uncompressedSize < 0 || Integer.MAX_VALUE < uncompressedSize) {
|
||||
throw new IndexOutOfBoundsException("Uncompressed size");
|
||||
throw new IndexOutOfBoundsException(
|
||||
"Bad uncompressed size: " + uncompressedSize);
|
||||
}
|
||||
|
||||
if (compressedSize == 0) {
|
||||
|
||||
@ -79,7 +79,8 @@ public final class ImageHeader {
|
||||
Objects.requireNonNull(buffer);
|
||||
|
||||
if (buffer.capacity() != HEADER_SLOTS) {
|
||||
throw new InternalError("jimage header not the correct size");
|
||||
throw new InternalError(
|
||||
"jimage header not the correct size: " + buffer.capacity());
|
||||
}
|
||||
|
||||
int magic = buffer.get(0);
|
||||
|
||||
@ -81,7 +81,8 @@ public class ImageLocation {
|
||||
}
|
||||
|
||||
if (kind < ATTRIBUTE_END || ATTRIBUTE_COUNT <= kind) {
|
||||
throw new InternalError("Invalid jimage attribute kind");
|
||||
throw new InternalError(
|
||||
"Invalid jimage attribute kind: " + kind);
|
||||
}
|
||||
|
||||
int length = attributeLength(data);
|
||||
@ -91,7 +92,7 @@ public class ImageLocation {
|
||||
value <<= 8;
|
||||
|
||||
if (!bytes.hasRemaining()) {
|
||||
throw new InternalError("\"Missing jimage attribute datad");
|
||||
throw new InternalError("Missing jimage attribute data");
|
||||
}
|
||||
|
||||
value |= bytes.get() & 0xFF;
|
||||
@ -134,7 +135,8 @@ public class ImageLocation {
|
||||
|
||||
long getAttribute(int kind) {
|
||||
if (kind < ATTRIBUTE_END || ATTRIBUTE_COUNT <= kind) {
|
||||
throw new InternalError("Invalid jimage attribute kind");
|
||||
throw new InternalError(
|
||||
"Invalid jimage attribute kind: " + kind);
|
||||
}
|
||||
|
||||
return attributes[kind];
|
||||
@ -142,7 +144,8 @@ public class ImageLocation {
|
||||
|
||||
String getAttributeString(int kind) {
|
||||
if (kind < ATTRIBUTE_END || ATTRIBUTE_COUNT <= kind) {
|
||||
throw new InternalError("Invalid jimage attribute kind");
|
||||
throw new InternalError(
|
||||
"Invalid jimage attribute kind: " + kind);
|
||||
}
|
||||
|
||||
return getStrings().get((int)attributes[kind]);
|
||||
|
||||
@ -82,7 +82,7 @@ public class ImageStream {
|
||||
|
||||
public void ensure(int needs) {
|
||||
if (needs < 0) {
|
||||
throw new IndexOutOfBoundsException("needs");
|
||||
throw new IndexOutOfBoundsException("Bad value: " + needs);
|
||||
}
|
||||
|
||||
if (needs > buffer.remaining()) {
|
||||
@ -106,7 +106,7 @@ public class ImageStream {
|
||||
|
||||
public void skip(int n) {
|
||||
if (n < 0) {
|
||||
throw new IndexOutOfBoundsException("n");
|
||||
throw new IndexOutOfBoundsException("skip value = " + n);
|
||||
}
|
||||
|
||||
buffer.position(buffer.position() + n);
|
||||
|
||||
@ -151,7 +151,7 @@ public class ImageStringsReader implements ImageStrings {
|
||||
try {
|
||||
charsFromMUTF8(chars, bytes, offset, count);
|
||||
} catch (UTFDataFormatException ex) {
|
||||
throw new InternalError("Attempt to convert non modified UTF-8 byte sequence");
|
||||
throw new InternalError("Attempt to convert non modified UTF-8 byte sequence", ex);
|
||||
}
|
||||
|
||||
return new String(chars);
|
||||
@ -199,7 +199,8 @@ public class ImageStringsReader implements ImageStrings {
|
||||
ch = buffer.get();
|
||||
|
||||
if ((ch & 0xC0) != 0x80) {
|
||||
throw new InternalError("Bad continuation in modified UTF-8 byte sequence");
|
||||
throw new InternalError("Bad continuation in " +
|
||||
"modified UTF-8 byte sequence: " + ch);
|
||||
}
|
||||
|
||||
uch = ((uch & ~mask) << 6) | (ch & 0x3F);
|
||||
@ -208,7 +209,8 @@ public class ImageStringsReader implements ImageStrings {
|
||||
}
|
||||
|
||||
if ((uch & 0xFFFF) != uch) {
|
||||
throw new InternalError("UTF-32 char in modified UTF-8 byte sequence");
|
||||
throw new InternalError("UTF-32 char in modified UTF-8 " +
|
||||
"byte sequence: " + uch);
|
||||
}
|
||||
|
||||
chars[j++] = (char)uch;
|
||||
|
||||
@ -183,7 +183,7 @@ class JrtFileSystem extends FileSystem {
|
||||
public PathMatcher getPathMatcher(String syntaxAndInput) {
|
||||
int pos = syntaxAndInput.indexOf(':');
|
||||
if (pos <= 0 || pos == syntaxAndInput.length()) {
|
||||
throw new IllegalArgumentException();
|
||||
throw new IllegalArgumentException("pos is " + pos);
|
||||
}
|
||||
String syntax = syntaxAndInput.substring(0, pos);
|
||||
String input = syntaxAndInput.substring(pos + 1);
|
||||
@ -285,7 +285,8 @@ class JrtFileSystem extends FileSystem {
|
||||
for (OpenOption option : options) {
|
||||
Objects.requireNonNull(option);
|
||||
if (!(option instanceof StandardOpenOption)) {
|
||||
throw new IllegalArgumentException();
|
||||
throw new IllegalArgumentException(
|
||||
"option class: " + option.getClass());
|
||||
}
|
||||
}
|
||||
if (options.contains(StandardOpenOption.WRITE) ||
|
||||
|
||||
@ -122,7 +122,8 @@ final class JrtPath implements Path {
|
||||
public final JrtPath getName(int index) {
|
||||
initOffsets();
|
||||
if (index < 0 || index >= offsets.length) {
|
||||
throw new IllegalArgumentException();
|
||||
throw new IllegalArgumentException("index: " +
|
||||
index + ", offsets length: " + offsets.length);
|
||||
}
|
||||
int begin = offsets[index];
|
||||
int end;
|
||||
@ -139,7 +140,9 @@ final class JrtPath implements Path {
|
||||
initOffsets();
|
||||
if (beginIndex < 0 || endIndex > offsets.length ||
|
||||
beginIndex >= endIndex) {
|
||||
throw new IllegalArgumentException();
|
||||
throw new IllegalArgumentException(
|
||||
"beginIndex: " + beginIndex + ", endIndex: " + endIndex +
|
||||
", offsets length: " + offsets.length);
|
||||
}
|
||||
// starting/ending offsets
|
||||
int begin = offsets[beginIndex];
|
||||
@ -211,7 +214,8 @@ final class JrtPath implements Path {
|
||||
return o;
|
||||
}
|
||||
if (jrtfs != o.jrtfs || isAbsolute() != o.isAbsolute()) {
|
||||
throw new IllegalArgumentException();
|
||||
throw new IllegalArgumentException(
|
||||
"Incorrect filesystem or path: " + other);
|
||||
}
|
||||
final String tp = this.path;
|
||||
final String op = o.path;
|
||||
@ -366,7 +370,8 @@ final class JrtPath implements Path {
|
||||
private JrtPath checkPath(Path path) {
|
||||
Objects.requireNonNull(path);
|
||||
if (!(path instanceof JrtPath))
|
||||
throw new ProviderMismatchException();
|
||||
throw new ProviderMismatchException("path class: " +
|
||||
path.getClass());
|
||||
return (JrtPath) path;
|
||||
}
|
||||
|
||||
@ -459,7 +464,7 @@ final class JrtPath implements Path {
|
||||
}
|
||||
if (c == '\u0000') {
|
||||
throw new InvalidPathException(path,
|
||||
"Path: nul character not allowed");
|
||||
"Path: NUL character not allowed");
|
||||
}
|
||||
to.append(c);
|
||||
prevC = c;
|
||||
|
||||
@ -1603,11 +1603,50 @@ public final class Unsafe {
|
||||
return weakCompareAndSwapShort(o, offset, c2s(expected), c2s(x));
|
||||
}
|
||||
|
||||
/**
|
||||
* The JVM converts integral values to boolean values using two
|
||||
* different conventions, byte testing against zero and truncation
|
||||
* to least-significant bit.
|
||||
*
|
||||
* <p>The JNI documents specify that, at least for returning
|
||||
* values from native methods, a Java boolean value is converted
|
||||
* to the value-set 0..1 by first truncating to a byte (0..255 or
|
||||
* maybe -128..127) and then testing against zero. Thus, Java
|
||||
* booleans in non-Java data structures are by convention
|
||||
* represented as 8-bit containers containing either zero (for
|
||||
* false) or any non-zero value (for true).
|
||||
*
|
||||
* <p>Java booleans in the heap are also stored in bytes, but are
|
||||
* strongly normalized to the value-set 0..1 (i.e., they are
|
||||
* truncated to the least-significant bit).
|
||||
*
|
||||
* <p>The main reason for having different conventions for
|
||||
* conversion is performance: Truncation to the least-significant
|
||||
* bit can be usually implemented with fewer (machine)
|
||||
* instructions than byte testing against zero.
|
||||
*
|
||||
* <p>A number of Unsafe methods load boolean values from the heap
|
||||
* as bytes. Unsafe converts those values according to the JNI
|
||||
* rules (i.e, using the "testing against zero" convention). The
|
||||
* method {@code byte2bool} implements that conversion.
|
||||
*
|
||||
* @param b the byte to be converted to boolean
|
||||
* @return the result of the conversion
|
||||
*/
|
||||
@ForceInline
|
||||
private boolean byte2bool(byte b) {
|
||||
return b > 0;
|
||||
return b != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a boolean value to a byte. The return value is strongly
|
||||
* normalized to the value-set 0..1 (i.e., the value is truncated
|
||||
* to the least-significant bit). See {@link #byte2bool(byte)} for
|
||||
* more details on conversion conventions.
|
||||
*
|
||||
* @param b the boolean to be converted to byte (and then normalized)
|
||||
* @return the result of the conversion
|
||||
*/
|
||||
@ForceInline
|
||||
private byte bool2byte(boolean b) {
|
||||
return b ? (byte)1 : (byte)0;
|
||||
|
||||
@ -50,7 +50,7 @@ public class VM {
|
||||
public static void initLevel(int value) {
|
||||
synchronized (lock) {
|
||||
if (value <= initLevel || value > SYSTEM_BOOTED)
|
||||
throw new InternalError();
|
||||
throw new InternalError("Bad level: " + value);
|
||||
initLevel = value;
|
||||
lock.notifyAll();
|
||||
}
|
||||
|
||||
@ -153,27 +153,24 @@ public final class ModuleBootstrap {
|
||||
boolean addAllDefaultModules = false;
|
||||
boolean addAllSystemModules = false;
|
||||
boolean addAllApplicationModules = false;
|
||||
String propValue = getAndRemoveProperty("jdk.module.addmods");
|
||||
if (propValue != null) {
|
||||
for (String mod: propValue.split(",")) {
|
||||
switch (mod) {
|
||||
case ALL_DEFAULT:
|
||||
addAllDefaultModules = true;
|
||||
break;
|
||||
case ALL_SYSTEM:
|
||||
addAllSystemModules = true;
|
||||
break;
|
||||
case ALL_MODULE_PATH:
|
||||
addAllApplicationModules = true;
|
||||
break;
|
||||
default :
|
||||
roots.add(mod);
|
||||
}
|
||||
for (String mod: getExtraAddModules()) {
|
||||
switch (mod) {
|
||||
case ALL_DEFAULT:
|
||||
addAllDefaultModules = true;
|
||||
break;
|
||||
case ALL_SYSTEM:
|
||||
addAllSystemModules = true;
|
||||
break;
|
||||
case ALL_MODULE_PATH:
|
||||
addAllApplicationModules = true;
|
||||
break;
|
||||
default :
|
||||
roots.add(mod);
|
||||
}
|
||||
}
|
||||
|
||||
// --limit-modules
|
||||
propValue = getAndRemoveProperty("jdk.module.limitmods");
|
||||
String propValue = getAndRemoveProperty("jdk.module.limitmods");
|
||||
if (propValue != null) {
|
||||
Set<String> mods = new HashSet<>();
|
||||
for (String mod: propValue.split(",")) {
|
||||
@ -392,6 +389,32 @@ public final class ModuleBootstrap {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the set of module names specified via --add-modules options
|
||||
* on the command line
|
||||
*/
|
||||
private static Set<String> getExtraAddModules() {
|
||||
String prefix = "jdk.module.addmods.";
|
||||
int index = 0;
|
||||
|
||||
// the system property is removed after decoding
|
||||
String value = getAndRemoveProperty(prefix + index);
|
||||
if (value == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
Set<String> modules = new HashSet<>();
|
||||
while (value != null) {
|
||||
for (String s : value.split(",")) {
|
||||
if (s.length() > 0) modules.add(s);
|
||||
}
|
||||
|
||||
index++;
|
||||
value = getAndRemoveProperty(prefix + index);
|
||||
}
|
||||
|
||||
return modules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the --add-reads options to add any additional read edges that
|
||||
@ -514,7 +537,7 @@ public final class ModuleBootstrap {
|
||||
|
||||
// value is <module>(,<module>)*
|
||||
if (map.containsKey(key))
|
||||
fail(key + " specified more than once");
|
||||
fail(key + " specified more than once");
|
||||
|
||||
Set<String> values = new HashSet<>();
|
||||
map.put(key, values);
|
||||
|
||||
@ -166,6 +166,7 @@ module java.base {
|
||||
jdk.charsets,
|
||||
jdk.compiler,
|
||||
jdk.jartool,
|
||||
jdk.jdeps,
|
||||
jdk.jlink,
|
||||
jdk.net,
|
||||
jdk.scripting.nashorn,
|
||||
@ -189,7 +190,8 @@ module java.base {
|
||||
jdk.unsupported,
|
||||
jdk.vm.ci;
|
||||
exports jdk.internal.util.jar to
|
||||
jdk.jartool;
|
||||
jdk.jartool,
|
||||
jdk.jdeps;
|
||||
exports jdk.internal.vm to
|
||||
java.management,
|
||||
jdk.jvmstat;
|
||||
|
||||
@ -328,8 +328,6 @@ class DatagramChannelImpl
|
||||
public SocketAddress receive(ByteBuffer dst) throws IOException {
|
||||
if (dst.isReadOnly())
|
||||
throw new IllegalArgumentException("Read-only buffer");
|
||||
if (dst == null)
|
||||
throw new NullPointerException();
|
||||
synchronized (readLock) {
|
||||
ensureOpen();
|
||||
// Socket was not bound before attempting receive
|
||||
@ -716,8 +714,6 @@ class DatagramChannelImpl
|
||||
|
||||
@Override
|
||||
public DatagramChannel connect(SocketAddress sa) throws IOException {
|
||||
int localPort = 0;
|
||||
|
||||
synchronized(readLock) {
|
||||
synchronized(writeLock) {
|
||||
synchronized (stateLock) {
|
||||
|
||||
@ -616,8 +616,6 @@ class SocketChannelImpl
|
||||
}
|
||||
|
||||
public boolean connect(SocketAddress sa) throws IOException {
|
||||
int localPort = 0;
|
||||
|
||||
synchronized (readLock) {
|
||||
synchronized (writeLock) {
|
||||
ensureOpenAndUnconnected();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -344,7 +344,8 @@ abstract class SeedGenerator {
|
||||
try {
|
||||
BogusThread bt = new BogusThread();
|
||||
Thread t = new Thread
|
||||
(seedGroup, bt, "SeedGenerator Thread", 0, false);
|
||||
(seedGroup, bt, "SeedGenerator Thread", 0,
|
||||
false);
|
||||
t.start();
|
||||
} catch (Exception e) {
|
||||
throw new InternalError("internal error: " +
|
||||
@ -357,7 +358,8 @@ abstract class SeedGenerator {
|
||||
long startTime = System.nanoTime();
|
||||
while (System.nanoTime() - startTime < 250000000) {
|
||||
synchronized(this){};
|
||||
latch++;
|
||||
// Mask the sign bit and keep latch non-negative
|
||||
latch = (latch + 1) & 0x1FFFFFFF;
|
||||
}
|
||||
|
||||
// Translate the value using the permutation, and xor
|
||||
@ -431,7 +433,7 @@ abstract class SeedGenerator {
|
||||
// data and using it to mix the trivial permutation.
|
||||
// It should be evenly distributed. The specific values
|
||||
// are not crucial to the security of this class.
|
||||
private static byte[] rndTab = {
|
||||
private static final byte[] rndTab = {
|
||||
56, 30, -107, -6, -86, 25, -83, 75, -12, -64,
|
||||
5, -128, 78, 21, 16, 32, 70, -81, 37, -51,
|
||||
-43, -46, -108, 87, 29, 17, -55, 22, -11, -111,
|
||||
|
||||
@ -179,6 +179,7 @@ JVM_GetStackTraceElements(JNIEnv *env, jobject throwable, jobjectArray elements)
|
||||
*/
|
||||
enum {
|
||||
JVM_STACKWALK_FILL_CLASS_REFS_ONLY = 0x2,
|
||||
JVM_STACKWALK_GET_CALLER_CLASS = 0x04,
|
||||
JVM_STACKWALK_SHOW_HIDDEN_FRAMES = 0x20,
|
||||
JVM_STACKWALK_FILL_LIVE_STACK_FRAMES = 0x100
|
||||
};
|
||||
|
||||
@ -152,8 +152,8 @@ defaultPath(void)
|
||||
#ifdef __solaris__
|
||||
/* These really are the Solaris defaults! */
|
||||
return (geteuid() == 0 || getuid() == 0) ?
|
||||
"/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin:/usr/sbin" :
|
||||
"/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin:";
|
||||
"/usr/xpg4/bin:/usr/bin:/opt/SUNWspro/bin:/usr/sbin" :
|
||||
"/usr/xpg4/bin:/usr/bin:/opt/SUNWspro/bin:";
|
||||
#else
|
||||
return ":/bin:/usr/bin"; /* glibc */
|
||||
#endif
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 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
|
||||
@ -35,12 +35,12 @@
|
||||
#include "manifest_info.h"
|
||||
#include "jli_util.h"
|
||||
|
||||
#define PATH_SEPARATOR ':'
|
||||
#define FILESEP "/"
|
||||
#define FILE_SEPARATOR '/'
|
||||
#define PATH_SEPARATOR ':'
|
||||
#define FILESEP "/"
|
||||
#define FILE_SEPARATOR '/'
|
||||
#define IS_FILE_SEPARATOR(c) ((c) == '/')
|
||||
#ifndef MAXNAMELEN
|
||||
#define MAXNAMELEN PATH_MAX
|
||||
#define MAXNAMELEN PATH_MAX
|
||||
#endif
|
||||
|
||||
#ifdef _LP64
|
||||
@ -59,10 +59,13 @@ static jboolean GetJVMPath(const char *jrepath, const char *jvmtype,
|
||||
static jboolean GetJREPath(char *path, jint pathsize, const char * arch,
|
||||
jboolean speculative);
|
||||
|
||||
#if defined(_AIX)
|
||||
#include "java_md_aix.h"
|
||||
#endif
|
||||
|
||||
#ifdef MACOSX
|
||||
#include "java_md_macosx.h"
|
||||
#else /* !MACOSX */
|
||||
#include "java_md_solinux.h"
|
||||
#endif /* MACOSX */
|
||||
|
||||
#endif /* JAVA_MD_H */
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
#include <process.h>
|
||||
#include <iphlpapi.h>
|
||||
#include <icmpapi.h>
|
||||
#include <WinError.h>
|
||||
|
||||
#include "java_net_InetAddress.h"
|
||||
#include "java_net_Inet4AddressImpl.h"
|
||||
@ -442,7 +443,15 @@ ping4(JNIEnv *env,
|
||||
DWORD ReplySize = 0;
|
||||
jboolean ret = JNI_FALSE;
|
||||
|
||||
ReplySize = sizeof(ICMP_ECHO_REPLY) + sizeof(SendData);
|
||||
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa366051%28v=vs.85%29.aspx
|
||||
ReplySize = sizeof(ICMP_ECHO_REPLY) // The buffer should be large enough
|
||||
// to hold at least one ICMP_ECHO_REPLY
|
||||
// structure
|
||||
+ sizeof(SendData) // plus RequestSize bytes of data.
|
||||
+ 8; // This buffer should also be large enough
|
||||
// to also hold 8 more bytes of data
|
||||
// (the size of an ICMP error message)
|
||||
|
||||
ReplyBuffer = (VOID*) malloc(ReplySize);
|
||||
if (ReplyBuffer == NULL) {
|
||||
IcmpCloseHandle(hIcmpFile);
|
||||
@ -478,10 +487,47 @@ ping4(JNIEnv *env,
|
||||
(timeout < 1000) ? 1000 : timeout); // DWORD Timeout
|
||||
}
|
||||
|
||||
if (dwRetVal != 0) {
|
||||
if (dwRetVal == 0) { // if the call failed
|
||||
TCHAR *buf;
|
||||
DWORD err = WSAGetLastError();
|
||||
switch (err) {
|
||||
case ERROR_NO_NETWORK:
|
||||
case ERROR_NETWORK_UNREACHABLE:
|
||||
case ERROR_HOST_UNREACHABLE:
|
||||
case ERROR_PROTOCOL_UNREACHABLE:
|
||||
case ERROR_PORT_UNREACHABLE:
|
||||
case ERROR_REQUEST_ABORTED:
|
||||
case ERROR_INCORRECT_ADDRESS:
|
||||
case ERROR_HOST_DOWN:
|
||||
case ERROR_INVALID_COMPUTERNAME:
|
||||
case ERROR_INVALID_NETNAME:
|
||||
case WSAEHOSTUNREACH: /* Host Unreachable */
|
||||
case WSAENETUNREACH: /* Network Unreachable */
|
||||
case WSAENETDOWN: /* Network is down */
|
||||
case WSAEPFNOSUPPORT: /* Protocol Family unsupported */
|
||||
case IP_REQ_TIMED_OUT:
|
||||
break;
|
||||
default:
|
||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPTSTR)&buf, 0, NULL);
|
||||
NET_ThrowNew(env, err, buf);
|
||||
LocalFree(buf);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
PICMP_ECHO_REPLY pEchoReply = (PICMP_ECHO_REPLY)ReplyBuffer;
|
||||
if ((int)pEchoReply->RoundTripTime <= timeout)
|
||||
|
||||
// This is to take into account the undocumented minimum
|
||||
// timeout mentioned in the IcmpSendEcho call above.
|
||||
// We perform an extra check to make sure that our
|
||||
// roundtrip time was less than our desired timeout
|
||||
// for cases where that timeout is < 1000ms.
|
||||
if (pEchoReply->Status == IP_SUCCESS
|
||||
&& (int)pEchoReply->RoundTripTime <= timeout)
|
||||
{
|
||||
ret = JNI_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
free(ReplyBuffer);
|
||||
|
||||
@ -67,19 +67,22 @@ public final class ConstructorFinder extends AbstractFinder<Constructor<?>> {
|
||||
*/
|
||||
public static Constructor<?> findConstructor(Class<?> type, Class<?>...args) throws NoSuchMethodException {
|
||||
if (type.isPrimitive()) {
|
||||
throw new NoSuchMethodException("Primitive wrapper does not contain constructors");
|
||||
throw new NoSuchMethodException("Primitive wrapper does not contain constructors: "
|
||||
+ type.getName());
|
||||
}
|
||||
if (type.isInterface()) {
|
||||
throw new NoSuchMethodException("Interface does not contain constructors");
|
||||
throw new NoSuchMethodException("Interface does not contain constructors: "
|
||||
+ type.getName());
|
||||
}
|
||||
if (!FinderUtils.isExported(type)) {
|
||||
throw new NoSuchMethodException("Class is not accessible");
|
||||
throw new NoSuchMethodException("Class is not accessible: " + type.getName());
|
||||
}
|
||||
if (Modifier.isAbstract(type.getModifiers())) {
|
||||
throw new NoSuchMethodException("Abstract class cannot be instantiated");
|
||||
throw new NoSuchMethodException("Abstract class cannot be instantiated: "
|
||||
+ type.getName());
|
||||
}
|
||||
if (!Modifier.isPublic(type.getModifiers()) || !isPackageAccessible(type)) {
|
||||
throw new NoSuchMethodException("Class is not accessible");
|
||||
throw new NoSuchMethodException("Class is not accessible: " + type.getName());
|
||||
}
|
||||
PrimitiveWrapperMap.replacePrimitivesWithWrappers(args);
|
||||
Signature signature = new Signature(type, args);
|
||||
|
||||
@ -2461,16 +2461,16 @@ public abstract class ImageReader {
|
||||
try {
|
||||
bundle = ResourceBundle.getBundle(baseName, locale, this.getClass().getModule());
|
||||
} catch (MissingResourceException mre) {
|
||||
throw new IllegalArgumentException("Bundle not found!");
|
||||
throw new IllegalArgumentException("Bundle not found!", mre);
|
||||
}
|
||||
|
||||
String warning = null;
|
||||
try {
|
||||
warning = bundle.getString(keyword);
|
||||
} catch (ClassCastException cce) {
|
||||
throw new IllegalArgumentException("Resource is not a String!");
|
||||
throw new IllegalArgumentException("Resource is not a String!", cce);
|
||||
} catch (MissingResourceException mre) {
|
||||
throw new IllegalArgumentException("Resource is missing!");
|
||||
throw new IllegalArgumentException("Resource is missing!", mre);
|
||||
}
|
||||
|
||||
listener.warningOccurred(this, warning);
|
||||
|
||||
@ -1963,16 +1963,16 @@ public abstract class ImageWriter implements ImageTranscoder {
|
||||
try {
|
||||
bundle = ResourceBundle.getBundle(baseName, locale, this.getClass().getModule());
|
||||
} catch (MissingResourceException mre) {
|
||||
throw new IllegalArgumentException("Bundle not found!");
|
||||
throw new IllegalArgumentException("Bundle not found!", mre);
|
||||
}
|
||||
|
||||
String warning = null;
|
||||
try {
|
||||
warning = bundle.getString(keyword);
|
||||
} catch (ClassCastException cce) {
|
||||
throw new IllegalArgumentException("Resource is not a String!");
|
||||
throw new IllegalArgumentException("Resource is not a String!", cce);
|
||||
} catch (MissingResourceException mre) {
|
||||
throw new IllegalArgumentException("Resource is missing!");
|
||||
throw new IllegalArgumentException("Resource is missing!", mre);
|
||||
}
|
||||
|
||||
listener.warningOccurred(this, imageIndex, warning);
|
||||
|
||||
@ -442,7 +442,7 @@ getAllConfigs (JNIEnv *env, int screen, AwtScreenDataPtr screenDataPtr) {
|
||||
|
||||
#ifndef __linux__ /* SOLARIS */
|
||||
if (xrenderLibHandle == NULL) {
|
||||
xrenderLibHandle = dlopen("/usr/sfw/lib/libXrender.so.1",
|
||||
xrenderLibHandle = dlopen("/usr/lib/libXrender.so.1",
|
||||
RTLD_LAZY | RTLD_GLOBAL);
|
||||
}
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user