This commit is contained in:
Thomas Ng 2014-04-29 14:40:07 -07:00
commit 6bc08ad755
896 changed files with 35412 additions and 12620 deletions

View File

@ -250,3 +250,6 @@ b32e2219736e42baaf45daf0ad67ed34f6033799 jdk9-b02
dd311791ad6895a3989020dd6c6c46db87972ab8 jdk9-b05
85dbdc227c5e11429b4fc4a8ba763f50107edd6e jdk9-b06
c826d05f1fb0773f6a28caa763307dd30d90d36e jdk9-b07
b47e021195757f8f45582124ea7cad48ccf5f872 jdk9-b08
efe7dbc6088691757404e0c8745f894e3ca9c022 jdk9-b09
8c0bdeecd7c0f9ce3f3762a51991f755cb3a972c jdk9-b10

View File

@ -250,3 +250,6 @@ cb4c3440bc2748101923e2488506e61009ab1bf5 jdk9-b04
8c63f0b6ada282f27e3a80125e53c3be603f9af7 jdk9-b05
d0b525cd31b87abeb6d5b7e3516953eeb13b323c jdk9-b06
0ea015c298b201c07fa33990f2445b6d0ef3566d jdk9-b07
db045d8faa0924b7378102d24a1a0d850c1e3834 jdk9-b08
4a21dc7d57d1069a01f68e7182c074cb37349dfb jdk9-b09
fa13f2b926f8426876ec03e7903f3ee0ee150f2e jdk9-b10

View File

@ -145,7 +145,7 @@
root repository:
<blockquote>
<code>
hg clone http://hg.openjdk.java.net/jdk8/jdk8
hg clone http://hg.openjdk.java.net/jdk9/jdk9
<i>YourOpenJDK</i>
<br>
cd <i>YourOpenJDK</i>
@ -373,18 +373,17 @@
particular update level.
<br>&nbsp;<br>
<b><i>Building JDK 8 requires use of a version
of JDK 7 that is at Update 7 or newer. JDK 8
developers should not use JDK 8 as the boot
JDK, to ensure that JDK 8 dependencies are
<b><i>Building JDK 9 requires JDK 8. JDK 9
developers should not use JDK 9 as the boot
JDK, to ensure that JDK 9 dependencies are
not introduced into the parts of the system
that are built with JDK 7.</i></b>
that are built with JDK 8.</i></b>
<br>&nbsp;<br>
The JDK 7 binaries can be downloaded from Oracle's
The JDK 8 binaries can be downloaded from Oracle's
<a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html"
target="_blank">JDK 7 download site</a>.
For build performance reasons
target="_blank">JDK 8 download site</a>.
For build performance reasons it
is very important that this bootstrap JDK be made available
on the local disk of the machine doing the build.
You should add its <code>bin</code> directory
@ -1454,9 +1453,7 @@
<p>One of the top goals of the new build system is to improve the
build performance and decrease the time needed to build. This will
soon also apply to the java compilation when the Smart Javac wrapper
is making its way into jdk8. It can be tried in the build-infra
repository already. You are likely to find that the new build system
is faster than the old one even without this feature.</p>
is fully supported.</p>
<p>At the end of a successful execution of <code>configure</code>,
you will get a performance summary,

View File

@ -82,10 +82,10 @@ AC_DEFUN([BOOTJDK_DO_CHECK],
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
[FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`]
[FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`]
if test "x$FOUND_CORRECT_VERSION" = x; then
AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring])
AC_MSG_NOTICE([(Your Boot JDK must be version 7, 8 or 9)])
AC_MSG_NOTICE([(Your Boot JDK must be version 8 or 9)])
BOOT_JDK_FOUND=no
else
# We're done! :-)

View File

@ -89,7 +89,7 @@ AC_DEFUN([BPERF_CHECK_MEMORY_SIZE],
if test "x$FOUND_MEM" = xyes; then
AC_MSG_RESULT([$MEMORY_SIZE MB])
else
AC_MSG_RESULT([could not detect memory size, defaulting to 1024 MB])
AC_MSG_RESULT([could not detect memory size, defaulting to $MEMORY_SIZE MB])
AC_MSG_WARN([This might seriously impact build performance!])
fi
])

View File

@ -473,7 +473,8 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
ppc )
# on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing
# on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
* )
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"

View File

@ -19906,12 +19906,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -20238,12 +20238,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -20432,12 +20432,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -20619,12 +20619,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -20805,12 +20805,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -20991,12 +20991,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -21168,12 +21168,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -21486,12 +21486,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -21814,12 +21814,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -22029,12 +22029,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -22209,12 +22209,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -22417,12 +22417,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -22597,12 +22597,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -22805,12 +22805,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -22985,12 +22985,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -23193,12 +23193,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -23373,12 +23373,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -23568,12 +23568,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -23746,12 +23746,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -23942,12 +23942,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -24120,12 +24120,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -24315,12 +24315,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -24493,12 +24493,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -24689,12 +24689,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -24867,12 +24867,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -25044,12 +25044,12 @@ $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.ja
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[789]\.'`
FOUND_CORRECT_VERSION=`echo $BOOT_JDK_VERSION | grep '\"1\.[89]\.'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7, 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 7, 8 or 9)" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 8 or 9)" >&5
$as_echo "$as_me: (Your Boot JDK must be version 8 or 9)" >&6;}
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -41672,7 +41672,8 @@ fi
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
ppc )
# on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing
# on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
* )
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"
@ -48685,8 +48686,8 @@ $as_echo_n "checking for memory size... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MEMORY_SIZE MB" >&5
$as_echo "$MEMORY_SIZE MB" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect memory size, defaulting to 1024 MB" >&5
$as_echo "could not detect memory size, defaulting to 1024 MB" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect memory size, defaulting to $MEMORY_SIZE MB" >&5
$as_echo "could not detect memory size, defaulting to $MEMORY_SIZE MB" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This might seriously impact build performance!" >&5
$as_echo "$as_me: WARNING: This might seriously impact build performance!" >&2;}
fi

View File

@ -261,6 +261,7 @@ BOOT_JDK_SOURCETARGET:=@BOOT_JDK_SOURCETARGET@
# Information about the build system
NUM_CORES:=@NUM_CORES@
MEMORY_SIZE:=@MEMORY_SIZE@
# Enable sjavac support = use a javac server,
# multi core javac compilation and dependency tracking.
ENABLE_SJAVAC:=@ENABLE_SJAVAC@

View File

@ -72,12 +72,21 @@ usage() {
exit 1
}
if [ "x" = "x$command" ] ; then
echo "ERROR: No command to hg supplied!"
usage
fi
# Check if we can use fifos for monitoring sub-process completion.
on_windows=`uname -s | egrep -ic -e 'cygwin|msys'`
if [ ${on_windows} = "1" ]; then
# cygwin has (2014-04-18) broken (single writer only) FIFOs
# msys has (2014-04-18) no FIFOs.
have_fifos="false"
else
have_fifos="true"
fi
# Clean out the temporary directory that stores the pid files.
tmp=/tmp/forest.$$
rm -f -r ${tmp}
@ -210,7 +219,19 @@ if [ "${command}" = "serve" ] ; then
) &
else
# Run the supplied command on all repos in parallel.
# n is the number of subprocess started or which might still be running.
n=0
if [ $have_fifos = "true" ]; then
# if we have fifos use them to detect command completion.
mkfifo ${tmp}/fifo
exec 3<>${tmp}/fifo
if [ "${sflag}" = "true" ] ; then
# force sequential
at_a_time=1
fi
fi
for i in ${repos} ${repos_extra} ; do
n=`expr ${n} '+' 1`
repopidfile=`echo ${i} | sed -e 's@./@@' -e 's@/@_@g'`
@ -221,10 +242,11 @@ else
pull_base="${pull_extra}"
fi
done
pull_base="`echo ${pull_base} | sed -e 's@[/]*$@@'`"
(
(
if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone" ] ; then
pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`"
pull_newrepo="${pull_base}/${i}"
path="`dirname ${i}`"
if [ "${path}" != "." ] ; then
times=0
@ -237,7 +259,7 @@ else
sleep 5
done
fi
echo "hg clone ${pull_newrepo} ${i}" > ${status_output}
echo "hg${global_opts} clone ${pull_newrepo} ${i}" > ${status_output}
(PYTHONUNBUFFERED=true hg${global_opts} clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc ) 2>&1 &
else
echo "cd ${i} && hg${global_opts} ${command} ${command_args}" > ${status_output}
@ -246,21 +268,41 @@ else
echo $! > ${tmp}/${repopidfile}.pid
) 2>&1 | sed -e "s@^@${reponame}: @" > ${status_output}
if [ $have_fifos = "true" ]; then
echo "${reponame}" >&3
fi
) &
if [ `expr ${n} '%' ${at_a_time}` -eq 0 -a "${sflag}" = "false" ] ; then
sleep 2
echo "Waiting 5 secs before spawning next background command." > ${status_output}
sleep 3
fi
if [ "${sflag}" = "true" ] ; then
if [ $have_fifos = "true" ]; then
# check on count of running subprocesses and possibly wait for completion
if [ ${at_a_time} -lt ${n} ] ; then
# read will block until there are completed subprocesses
while read repo_done; do
n=`expr ${n} '-' 1`
if [ ${n} -lt ${at_a_time} ] ; then
# we should start more subprocesses
break;
fi
done <&3
fi
else
if [ "${sflag}" = "false" ] ; then
# Compare completions to starts
completed="`(ls -1 ${tmp}/*.pid.rc 2> /dev/null | wc -l) || echo 0`"
while [ ${at_a_time} -lt `expr ${n} '-' ${completed}` ] ; do
# sleep a short time to give time for something to complete
sleep 1
completed="`(ls -1 ${tmp}/*.pid.rc 2> /dev/null | wc -l) || echo 0`"
done
else
# complete this task before starting another.
wait
fi
fi
done
fi
# Wait for all hg commands to complete
# Wait for all subprocesses to complete
wait
# Terminate with exit 0 only if all subprocesses were successful
@ -270,7 +312,7 @@ if [ -d ${tmp} ]; then
exit_code=`cat ${rc} | tr -d ' \n\r'`
if [ "${exit_code}" != "0" ] ; then
repo="`echo ${rc} | sed -e s@^${tmp}@@ -e 's@/*\([^/]*\)\.pid\.rc$@\1@' -e 's@_@/@g'`"
echo "WARNING: ${repo} exited abnormally." > ${status_output}
echo "WARNING: ${repo} exited abnormally ($exit_code)" > ${status_output}
ec=1
fi
done

View File

@ -250,3 +250,6 @@ d338b892a13db19b093f85cf5f949a4504e4d31f jdk9-b03
167c39eb44731a5d66770d0f00e231164653a2ff jdk9-b05
a4bf701ac316946c2e5e83138ad8e687da6a4b30 jdk9-b06
6c8563600a71394c949405189ddd66267a88d8cd jdk9-b07
2da7fead826bc27f193c7d63048c2cf100a8809c jdk9-b08
1a3a4f48515dbf1cff37279691b2fb74f228298d jdk9-b09
3bd4039dfc632fd7fc8418a25a3dcc34d1cd4019 jdk9-b10

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -52,6 +52,7 @@ import java.io.IOException;
import java.io.DataOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.InvalidClassException;
import java.io.Externalizable;
import java.io.Serializable;
import java.util.Arrays;
@ -80,15 +81,15 @@ public class ObjectStreamClass implements java.io.Serializable {
public static final long kDefaultUID = -1;
private static Object noArgsList[] = {};
private static Class noTypesList[] = {};
private static Class<?> noTypesList[] = {};
/** true if represents enum type */
private boolean isEnum;
private static final Bridge bridge =
(Bridge)AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
AccessController.doPrivileged(
new PrivilegedAction<Bridge>() {
public Bridge run() {
return Bridge.get() ;
}
}
@ -98,7 +99,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* is returned if the specified class does not implement
* java.io.Serializable or java.io.Externalizable.
*/
static final ObjectStreamClass lookup(Class cl)
static final ObjectStreamClass lookup(Class<?> cl)
{
ObjectStreamClass desc = lookupInternal(cl);
if (desc.isSerializable() || desc.isExternalizable())
@ -110,7 +111,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* Find the class descriptor for the specified class.
* Package access only so it can be called from ObjectIn/OutStream.
*/
static ObjectStreamClass lookupInternal(Class cl)
static ObjectStreamClass lookupInternal(Class<?> cl)
{
/* Synchronize on the hashtable so no two threads will do
* this at the same time.
@ -121,14 +122,14 @@ public class ObjectStreamClass implements java.io.Serializable {
desc = findDescriptorFor(cl);
if (desc == null) {
/* Check if it's serializable */
boolean serializable = classSerializable.isAssignableFrom(cl);
boolean serializable = Serializable.class.isAssignableFrom(cl);
/* If the class is only Serializable,
* lookup the descriptor for the superclass.
*/
ObjectStreamClass superdesc = null;
if (serializable) {
Class superclass = cl.getSuperclass();
Class<?> superclass = cl.getSuperclass();
if (superclass != null)
superdesc = lookup(superclass);
}
@ -141,7 +142,7 @@ public class ObjectStreamClass implements java.io.Serializable {
if (serializable) {
externalizable =
((superdesc != null) && superdesc.isExternalizable()) ||
classExternalizable.isAssignableFrom(cl);
Externalizable.class.isAssignableFrom(cl);
if (externalizable) {
serializable = false;
}
@ -185,7 +186,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* that have evolved from a common root class and agree to be serialized
* and deserialized using a common format.
*/
public static final long getSerialVersionUID( java.lang.Class clazz) {
public static final long getSerialVersionUID( java.lang.Class<?> clazz) {
ObjectStreamClass theosc = ObjectStreamClass.lookup( clazz );
if( theosc != null )
{
@ -219,7 +220,7 @@ public class ObjectStreamClass implements java.io.Serializable {
/**
* Return the actual (computed) serialVersionUID for this class.
*/
public static final long getActualSerialVersionUID( java.lang.Class clazz )
public static final long getActualSerialVersionUID( java.lang.Class<?> clazz )
{
ObjectStreamClass theosc = ObjectStreamClass.lookup( clazz );
if( theosc != null )
@ -249,7 +250,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* Return the class in the local VM that this version is mapped to.
* Null is returned if there is no corresponding local class.
*/
public final Class forClass() {
public final Class<?> forClass() {
return ofClass;
}
@ -349,7 +350,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* Create a new ObjectStreamClass from a loaded class.
* Don't call this directly, call lookup instead.
*/
private ObjectStreamClass(java.lang.Class cl, ObjectStreamClass superdesc,
private ObjectStreamClass(java.lang.Class<?> cl, ObjectStreamClass superdesc,
boolean serial, boolean extern)
{
ofClass = cl; /* created from this class */
@ -433,7 +434,7 @@ public class ObjectStreamClass implements java.io.Serializable {
if (initialized)
return;
final Class cl = ofClass;
final Class<?> cl = ofClass;
if (!serializable ||
externalizable ||
@ -561,9 +562,9 @@ public class ObjectStreamClass implements java.io.Serializable {
* will call it as necessary.
*/
writeObjectMethod = getPrivateMethod( cl, "writeObject",
new Class[] { java.io.ObjectOutputStream.class }, Void.TYPE ) ;
new Class<?>[] { java.io.ObjectOutputStream.class }, Void.TYPE ) ;
readObjectMethod = getPrivateMethod( cl, "readObject",
new Class[] { java.io.ObjectInputStream.class }, Void.TYPE ) ;
new Class<?>[] { java.io.ObjectInputStream.class }, Void.TYPE ) ;
}
return null;
}
@ -589,9 +590,9 @@ public class ObjectStreamClass implements java.io.Serializable {
* class, or null if none found. Access checks are disabled on the
* returned method (if any).
*/
private static Method getPrivateMethod(Class cl, String name,
Class[] argTypes,
Class returnType)
private static Method getPrivateMethod(Class<?> cl, String name,
Class<?>[] argTypes,
Class<?> returnType)
{
try {
Method meth = cl.getDeclaredMethod(name, argTypes);
@ -653,7 +654,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* Fill in the reflected Fields that will be used
* for reading.
*/
final void setClass(Class cl) throws InvalidClassException {
final void setClass(Class<?> cl) throws InvalidClassException {
if (cl == null) {
localClassDesc = null;
@ -920,9 +921,9 @@ public class ObjectStreamClass implements java.io.Serializable {
* Access checks are disabled on the returned constructor (if any), since
* the defining class may still be non-public.
*/
private static Constructor getExternalizableConstructor(Class cl) {
private static Constructor getExternalizableConstructor(Class<?> cl) {
try {
Constructor cons = cl.getDeclaredConstructor(new Class[0]);
Constructor cons = cl.getDeclaredConstructor(new Class<?>[0]);
cons.setAccessible(true);
return ((cons.getModifiers() & Modifier.PUBLIC) != 0) ?
cons : null;
@ -936,15 +937,15 @@ public class ObjectStreamClass implements java.io.Serializable {
* superclass, or null if none found. Access checks are disabled on the
* returned constructor (if any).
*/
private static Constructor getSerializableConstructor(Class cl) {
Class initCl = cl;
private static Constructor getSerializableConstructor(Class<?> cl) {
Class<?> initCl = cl;
while (Serializable.class.isAssignableFrom(initCl)) {
if ((initCl = initCl.getSuperclass()) == null) {
return null;
}
}
try {
Constructor cons = initCl.getDeclaredConstructor(new Class[0]);
Constructor cons = initCl.getDeclaredConstructor(new Class<?>[0]);
int mods = cons.getModifiers();
if ((mods & Modifier.PRIVATE) != 0 ||
((mods & (Modifier.PUBLIC | Modifier.PROTECTED)) == 0 &&
@ -1049,7 +1050,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* items to the hash accumulating in the digest stream.
* Fold the hash into a long. Use the SHA secure hash function.
*/
private static long _computeSerialVersionUID(Class cl) {
private static long _computeSerialVersionUID(Class<?> cl) {
if (DEBUG_SVUID)
msg( "Computing SerialVersionUID for " + cl ) ;
ByteArrayOutputStream devnull = new ByteArrayOutputStream(512);
@ -1103,7 +1104,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* them from its computation.
*/
Class interfaces[] = cl.getInterfaces();
Class<?> interfaces[] = cl.getInterfaces();
Arrays.sort(interfaces, compareClassByName);
for (int i = 0; i < interfaces.length; i++) {
@ -1233,7 +1234,7 @@ public class ObjectStreamClass implements java.io.Serializable {
return h;
}
private static long computeStructuralUID(com.sun.corba.se.impl.io.ObjectStreamClass osc, Class cl) {
private static long computeStructuralUID(com.sun.corba.se.impl.io.ObjectStreamClass osc, Class<?> cl) {
ByteArrayOutputStream devnull = new ByteArrayOutputStream(512);
long h = 0;
@ -1253,7 +1254,7 @@ public class ObjectStreamClass implements java.io.Serializable {
DataOutputStream data = new DataOutputStream(mdo);
// Get SUID of parent
Class parent = cl.getSuperclass();
Class<?> parent = cl.getSuperclass();
if ((parent != null))
// SerialBug 1; acc. to spec the one for
// java.lang.object
@ -1309,10 +1310,10 @@ public class ObjectStreamClass implements java.io.Serializable {
/**
* Compute the JVM signature for the class.
*/
static String getSignature(Class clazz) {
static String getSignature(Class<?> clazz) {
String type = null;
if (clazz.isArray()) {
Class cl = clazz;
Class<?> cl = clazz;
int dimensions = 0;
while (cl.isArray()) {
dimensions++;
@ -1358,7 +1359,7 @@ public class ObjectStreamClass implements java.io.Serializable {
sb.append("(");
Class[] params = meth.getParameterTypes(); // avoid clone
Class<?>[] params = meth.getParameterTypes(); // avoid clone
for (int j = 0; j < params.length; j++) {
sb.append(getSignature(params[j]));
}
@ -1375,7 +1376,7 @@ public class ObjectStreamClass implements java.io.Serializable {
sb.append("(");
Class[] params = cons.getParameterTypes(); // avoid clone
Class<?>[] params = cons.getParameterTypes(); // avoid clone
for (int j = 0; j < params.length; j++) {
sb.append(getSignature(params[j]));
}
@ -1395,7 +1396,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* The entries are extended from java.lang.ref.SoftReference so the
* gc will be able to free them if needed.
*/
private static ObjectStreamClass findDescriptorFor(Class cl) {
private static ObjectStreamClass findDescriptorFor(Class<?> cl) {
int hash = cl.hashCode();
int index = (hash & 0x7FFFFFFF) % descriptorFor.length;
@ -1442,7 +1443,7 @@ public class ObjectStreamClass implements java.io.Serializable {
descriptorFor[index] = e;
}
private static Field[] getDeclaredFields(final Class clz) {
private static Field[] getDeclaredFields(final Class<?> clz) {
return (Field[]) AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return clz.getDeclaredFields();
@ -1476,7 +1477,7 @@ public class ObjectStreamClass implements java.io.Serializable {
/*
* Class that is a descriptor for in this virtual machine.
*/
private Class ofClass;
private Class<?> ofClass;
/*
* True if descriptor for a proxy class.
@ -1548,30 +1549,17 @@ public class ObjectStreamClass implements java.io.Serializable {
* Returns true if the given class defines a static initializer method,
* false otherwise.
*/
private static boolean hasStaticInitializer(Class cl) {
private static boolean hasStaticInitializer(Class<?> cl) {
if (hasStaticInitializerMethod == null) {
Class classWithThisMethod = null;
Class<?> classWithThisMethod = null;
try {
try {
// When using rip-int with Merlin or when this is a Merlin
// workspace, the method we want is in sun.misc.ClassReflector
// and absent from java.io.ObjectStreamClass.
//
// When compiling rip-int with JDK 1.3.x, we have to get it
// from java.io.ObjectStreamClass.
classWithThisMethod = Class.forName("sun.misc.ClassReflector");
} catch (ClassNotFoundException cnfe) {
// Do nothing. This is either not a Merlin workspace,
// or rip-int is being compiled with something other than
// Merlin, probably JDK 1.3. Fall back on java.io.ObjectStreaClass.
}
if (classWithThisMethod == null)
classWithThisMethod = java.io.ObjectStreamClass.class;
hasStaticInitializerMethod =
classWithThisMethod.getDeclaredMethod("hasStaticInitializer",
new Class[] { Class.class });
new Class<?>[] { Class.class });
} catch (NoSuchMethodException ex) {
}
@ -1596,22 +1584,6 @@ public class ObjectStreamClass implements java.io.Serializable {
}
/* The Class Object for java.io.Serializable */
private static Class classSerializable = null;
private static Class classExternalizable = null;
/*
* Resolve java.io.Serializable at load time.
*/
static {
try {
classSerializable = Class.forName("java.io.Serializable");
classExternalizable = Class.forName("java.io.Externalizable");
} catch (Throwable e) {
System.err.println("Could not load java.io.Serializable or java.io.Externalizable.");
}
}
/** use serialVersionUID from JDK 1.1. for interoperability */
private static final long serialVersionUID = -6120832682080437368L;
@ -1649,8 +1621,8 @@ public class ObjectStreamClass implements java.io.Serializable {
private static class CompareClassByName implements Comparator {
public int compare(Object o1, Object o2) {
Class c1 = (Class)o1;
Class c2 = (Class)o2;
Class<?> c1 = (Class)o1;
Class<?> c2 = (Class)o2;
return (c1.getName()).compareTo(c2.getName());
}
}
@ -1764,12 +1736,12 @@ public class ObjectStreamClass implements java.io.Serializable {
*
* Copied from the Merlin java.io.ObjectStreamClass.
*/
private static Method getInheritableMethod(Class cl, String name,
Class[] argTypes,
Class returnType)
private static Method getInheritableMethod(Class<?> cl, String name,
Class<?>[] argTypes,
Class<?> returnType)
{
Method meth = null;
Class defCl = cl;
Class<?> defCl = cl;
while (defCl != null) {
try {
meth = defCl.getDeclaredMethod(name, argTypes);
@ -1801,7 +1773,7 @@ public class ObjectStreamClass implements java.io.Serializable {
*
* Copied from the Merlin java.io.ObjectStreamClass.
*/
private static boolean packageEquals(Class cl1, Class cl2) {
private static boolean packageEquals(Class<?> cl1, Class<?> cl2) {
Package pkg1 = cl1.getPackage(), pkg2 = cl2.getPackage();
return ((pkg1 == pkg2) || ((pkg1 != null) && (pkg1.equals(pkg2))));
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -94,7 +94,7 @@ public final class ObjectStreamClassUtil_1_3 {
});
}
public static long computeStructuralUID(boolean hasWriteObject, Class cl) {
public static long computeStructuralUID(boolean hasWriteObject, Class<?> cl) {
ByteArrayOutputStream devnull = new ByteArrayOutputStream(512);
long h = 0;
@ -119,7 +119,7 @@ public final class ObjectStreamClassUtil_1_3 {
// Object method in there
// Get SUID of parent
Class parent = cl.getSuperclass();
Class<?> parent = cl.getSuperclass();
if ((parent != null) && (parent != java.lang.Object.class)) {
boolean hasWriteObjectFlag = false;
Class [] args = {java.io.ObjectOutputStream.class};
@ -503,19 +503,6 @@ public final class ObjectStreamClassUtil_1_3 {
Class classWithThisMethod = null;
try {
try {
// When using rip-int with Merlin or when this is a Merlin
// workspace, the method we want is in sun.misc.ClassReflector
// and absent from java.io.ObjectStreamClass.
//
// When compiling rip-int with JDK 1.3.x, we have to get it
// from java.io.ObjectStreamClass.
classWithThisMethod = Class.forName("sun.misc.ClassReflector");
} catch (ClassNotFoundException cnfe) {
// Do nothing. This is either not a Merlin workspace,
// or rip-int is being compiled with something other than
// Merlin, probably JDK 1.3. Fall back on java.io.ObjectStreaClass.
}
if (classWithThisMethod == null)
classWithThisMethod = java.io.ObjectStreamClass.class;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -53,6 +53,7 @@ import java.io.DataOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.InvalidClassException;
import java.io.Serializable;
import java.io.Externalizable;
import java.util.Arrays;
import java.util.Comparator;
@ -88,7 +89,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
public static final long kDefaultUID = -1;
private static Object noArgsList[] = {};
private static Class noTypesList[] = {};
private static Class<?> noTypesList[] = {};
private static Hashtable translatedFields;
@ -96,7 +97,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* is returned if the specified class does not implement
* java.io.Serializable or java.io.Externalizable.
*/
static final ObjectStreamClass_1_3_1 lookup(Class cl)
static final ObjectStreamClass_1_3_1 lookup(Class<?> cl)
{
ObjectStreamClass_1_3_1 desc = lookupInternal(cl);
if (desc.isSerializable() || desc.isExternalizable())
@ -108,7 +109,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* Find the class descriptor for the specified class.
* Package access only so it can be called from ObjectIn/OutStream.
*/
static ObjectStreamClass_1_3_1 lookupInternal(Class cl)
static ObjectStreamClass_1_3_1 lookupInternal(Class<?> cl)
{
/* Synchronize on the hashtable so no two threads will do
* this at the same time.
@ -122,13 +123,13 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
}
/* Check if it's serializable */
boolean serializable = classSerializable.isAssignableFrom(cl);
boolean serializable = Serializable.class.isAssignableFrom(cl);
/* If the class is only Serializable,
* lookup the descriptor for the superclass.
*/
ObjectStreamClass_1_3_1 superdesc = null;
if (serializable) {
Class superclass = cl.getSuperclass();
Class<?> superclass = cl.getSuperclass();
if (superclass != null)
superdesc = lookup(superclass);
}
@ -141,7 +142,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
if (serializable) {
externalizable =
((superdesc != null) && superdesc.isExternalizable()) ||
classExternalizable.isAssignableFrom(cl);
Externalizable.class.isAssignableFrom(cl);
if (externalizable) {
serializable = false;
}
@ -170,7 +171,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* that have evolved from a common root class and agree to be serialized
* and deserialized using a common format.
*/
public static final long getSerialVersionUID( java.lang.Class clazz) {
public static final long getSerialVersionUID( java.lang.Class<?> clazz) {
ObjectStreamClass_1_3_1 theosc = ObjectStreamClass_1_3_1.lookup( clazz );
if( theosc != null )
{
@ -204,7 +205,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
/**
* Return the actual (computed) serialVersionUID for this class.
*/
public static final long getActualSerialVersionUID( java.lang.Class clazz )
public static final long getActualSerialVersionUID( java.lang.Class<?> clazz )
{
ObjectStreamClass_1_3_1 theosc = ObjectStreamClass_1_3_1.lookup( clazz );
if( theosc != null )
@ -234,7 +235,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* Return the class in the local VM that this version is mapped to.
* Null is returned if there is no corresponding local class.
*/
public final Class forClass() {
public final Class<?> forClass() {
return ofClass;
}
@ -333,7 +334,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* Create a new ObjectStreamClass_1_3_1 from a loaded class.
* Don't call this directly, call lookup instead.
*/
private ObjectStreamClass_1_3_1(java.lang.Class cl, ObjectStreamClass_1_3_1 superdesc,
private ObjectStreamClass_1_3_1(java.lang.Class<?> cl, ObjectStreamClass_1_3_1 superdesc,
boolean serial, boolean extern)
{
ofClass = cl; /* created from this class */
@ -376,7 +377,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
private void init() {
synchronized (lock) {
final Class cl = ofClass;
final Class<?> cl = ofClass;
if (fields != null) // already initialized
return;
@ -558,7 +559,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* will call it as necessary.
*/
try {
Class[] args = {java.io.ObjectOutputStream.class};
Class<?>[] args = {java.io.ObjectOutputStream.class};
writeObjectMethod = cl.getDeclaredMethod("writeObject", args);
hasWriteObjectMethod = true;
int mods = writeObjectMethod.getModifiers();
@ -578,7 +579,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* ObjectInputStream so it can all the method directly.
*/
try {
Class[] args = {java.io.ObjectInputStream.class};
Class<?>[] args = {java.io.ObjectInputStream.class};
readObjectMethod = cl.getDeclaredMethod("readObject", args);
int mods = readObjectMethod.getModifiers();
@ -629,11 +630,11 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
if (translation != null)
return translation;
else {
Class osfClass = com.sun.corba.se.impl.orbutil.ObjectStreamField.class;
Class<?> osfClass = com.sun.corba.se.impl.orbutil.ObjectStreamField.class;
translation = (Object[])java.lang.reflect.Array.newInstance(osfClass, objs.length);
Object arg[] = new Object[2];
Class types[] = {String.class, Class.class};
Class<?> types[] = {String.class, Class.class};
Constructor constructor = osfClass.getDeclaredConstructor(types);
for (int i = fields.length -1; i >= 0; i--){
arg[0] = fields[i].getName();
@ -804,7 +805,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
}
}
private static long computeStructuralUID(ObjectStreamClass_1_3_1 osc, Class cl) {
private static long computeStructuralUID(ObjectStreamClass_1_3_1 osc, Class<?> cl) {
ByteArrayOutputStream devnull = new ByteArrayOutputStream(512);
long h = 0;
@ -824,7 +825,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
DataOutputStream data = new DataOutputStream(mdo);
// Get SUID of parent
Class parent = cl.getSuperclass();
Class<?> parent = cl.getSuperclass();
if ((parent != null))
// SerialBug 1; acc. to spec the one for
// java.lang.object
@ -910,10 +911,10 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
/**
* Compute the JVM signature for the class.
*/
static String getSignature(Class clazz) {
static String getSignature(Class<?> clazz) {
String type = null;
if (clazz.isArray()) {
Class cl = clazz;
Class<?> cl = clazz;
int dimensions = 0;
while (cl.isArray()) {
dimensions++;
@ -959,7 +960,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
sb.append("(");
Class[] params = meth.getParameterTypes(); // avoid clone
Class<?>[] params = meth.getParameterTypes(); // avoid clone
for (int j = 0; j < params.length; j++) {
sb.append(getSignature(params[j]));
}
@ -976,7 +977,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
sb.append("(");
Class[] params = cons.getParameterTypes(); // avoid clone
Class<?>[] params = cons.getParameterTypes(); // avoid clone
for (int j = 0; j < params.length; j++) {
sb.append(getSignature(params[j]));
}
@ -996,7 +997,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* The entries are extended from java.lang.ref.SoftReference so the
* gc will be able to free them if needed.
*/
private static ObjectStreamClass_1_3_1 findDescriptorFor(Class cl) {
private static ObjectStreamClass_1_3_1 findDescriptorFor(Class<?> cl) {
int hash = cl.hashCode();
int index = (hash & 0x7FFFFFFF) % descriptorFor.length;
@ -1077,7 +1078,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
/*
* Class that is a descriptor for in this virtual machine.
*/
private Class ofClass;
private Class<?> ofClass;
/*
* True if descriptor for a proxy class.
@ -1130,22 +1131,6 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
/* Get the private static final field for serial version UID */
// private static native long getSerialVersionUIDField(Class cl);
/* The Class Object for java.io.Serializable */
private static Class classSerializable = null;
private static Class classExternalizable = null;
/*
* Resolve java.io.Serializable at load time.
*/
static {
try {
classSerializable = Class.forName("java.io.Serializable");
classExternalizable = Class.forName("java.io.Externalizable");
} catch (Throwable e) {
System.err.println("Could not load java.io.Serializable or java.io.Externalizable.");
}
}
/** use serialVersionUID from JDK 1.1. for interoperability */
private static final long serialVersionUID = -6120832682080437368L;
@ -1183,8 +1168,8 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
private static class CompareClassByName implements Comparator {
public int compare(Object o1, Object o2) {
Class c1 = (Class)o1;
Class c2 = (Class)o2;
Class<?> c1 = (Class)o1;
Class<?> c2 = (Class)o2;
return (c1.getName()).compareTo(c2.getName());
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -36,6 +36,8 @@ import java.io.FileInputStream;
import java.security.AccessController;
import java.security.PrivilegedAction;
import sun.reflect.misc.ReflectUtil;
/**
* A class providing APIs for the CORBA Object Request Broker
* features. The <code>ORB</code> class also provides
@ -161,6 +163,20 @@ import java.security.PrivilegedAction;
* <P>
* An application or applet can be initialized in one or more ORBs.
* ORB initialization is a bootstrap call into the CORBA world.
*
*
* @implNote
* As described above it is possible to specify, at runtime, an alternative ORBSingleton class and
* an alternative ORB implementation class, via the system properties {@code org.omg.CORBA.ORBSingletonClass}
* and {@code org.omg.CORBA.ORBClass} respectively.
* The class loading strategy is organized, such that, in the case of the ORBSingleton
* the system class loader is used to load the alternative singleton ORB.
* Thus, it is necessary that an application's CLASSPATH
* includes the classes for this alternative ORBSingleton, when specified.
*
* In the case of specifying an alternative ORB implementation class, the loading
* strategy will use the thread context class loader, as appropriate.
*
* @since JDK1.2
*/
abstract public class ORB {
@ -289,20 +305,38 @@ abstract public class ORB {
(className.equals("com.sun.corba.se.impl.orb.ORBSingleton"))) {
singleton = new com.sun.corba.se.impl.orb.ORBSingleton();
} else {
singleton = create_impl(className);
singleton = create_impl_with_systemclassloader(className);
}
}
return singleton;
}
private static ORB create_impl(String className) {
private static ORB create_impl_with_systemclassloader(String className) {
try {
ReflectUtil.checkPackageAccess(className);
ClassLoader cl = ClassLoader.getSystemClassLoader();
Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class;
Class<?> singletonOrbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass);
return (ORB)singletonOrbClass.newInstance();
} catch (Throwable ex) {
SystemException systemException = new INITIALIZE(
"can't instantiate default ORB implementation " + className);
systemException.initCause(ex);
throw systemException;
}
}
private static ORB create_impl(String className) {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null)
cl = ClassLoader.getSystemClassLoader();
try {
return (ORB) Class.forName(className, true, cl).newInstance();
ReflectUtil.checkPackageAccess(className);
Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class;
Class<?> orbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass);
return (ORB)orbClass.newInstance();
} catch (Throwable ex) {
SystemException systemException = new INITIALIZE(
"can't instantiate default ORB implementation " + className);
@ -346,7 +380,6 @@ abstract public class ORB {
} else {
orb = create_impl(className);
}
orb.set_parameters(args, props);
return orb;
}
@ -377,7 +410,6 @@ abstract public class ORB {
} else {
orb = create_impl(className);
}
orb.set_parameters(app, props);
return orb;
}
@ -573,7 +605,7 @@ abstract public class ORB {
try {
// First try to load the OperationDef class
String opDefClassName = "org.omg.CORBA.OperationDef";
Class opDefClass = null;
Class<?> opDefClass = null;
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if ( cl == null )
@ -583,7 +615,7 @@ abstract public class ORB {
// OK, we loaded OperationDef. Now try to get the
// create_operation_list(OperationDef oper) method.
Class[] argc = { opDefClass };
Class<?>[] argc = { opDefClass };
java.lang.reflect.Method meth =
this.getClass().getMethod("create_operation_list", argc);

View File

@ -410,3 +410,6 @@ b2fee789d23f3cdabb3db4e51af43038e5692d3a jdk9-b03
bdc5311e1db7598589b77015119b821bf8c828bd jdk9-b05
52377a30a3f87b62d6135706997b8c7a47366e37 jdk9-b06
52f7edf2589d9f9d35db3008bc5377f279de9c18 jdk9-b07
4dedef5e51ed3a36677a8ba82949fc517ad64162 jdk9-b08
05e8f5242c26ba45d4fa947e4f4f54c058c9b522 jdk9-b09
ebc44d040cd149d2120d69fe183a3dae7840f4b4 jdk9-b10

View File

@ -65,9 +65,6 @@ jprt.my.linux.ppc=${jprt.my.linux.ppc.${jprt.tools.default.release}}
jprt.my.linux.ppcv2.jdk9=linux_ppcv2_2.6
jprt.my.linux.ppcv2=${jprt.my.linux.ppcv2.${jprt.tools.default.release}}
jprt.my.linux.ppcsflt.jdk9=linux_ppcsflt_2.6
jprt.my.linux.ppcsflt=${jprt.my.linux.ppcsflt.${jprt.tools.default.release}}
jprt.my.linux.armvfpsflt.jdk9=linux_armvfpsflt_2.6
jprt.my.linux.armvfpsflt=${jprt.my.linux.armvfpsflt.${jprt.tools.default.release}}
@ -113,7 +110,6 @@ jprt.build.targets.embedded= \
${jprt.my.linux.i586}-{productEmb|fastdebugEmb}, \
${jprt.my.linux.ppc}-{productEmb|fastdebugEmb}, \
${jprt.my.linux.ppcv2}-{productEmb|fastdebugEmb}, \
${jprt.my.linux.ppcsflt}-{productEmb|fastdebugEmb}, \
${jprt.my.linux.armvfpsflt}-{productEmb|fastdebugEmb}, \
${jprt.my.linux.armvfphflt}-{productEmb|fastdebugEmb}, \
${jprt.my.linux.armsflt}-{productEmb|fastdebugEmb}

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2013 SAP AG. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2014 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -2947,17 +2947,60 @@ void BytecodeInterpreter::pd_layout_interpreterState(interpreterState istate,
istate->_last_Java_fp = last_Java_fp;
}
int AbstractInterpreter::layout_activation(Method* method,
int temps, // Number of slots on java expression stack in use.
int popframe_args,
int monitors, // Number of active monitors.
int caller_actual_parameters,
int callee_params,// Number of slots for callee parameters.
int callee_locals,// Number of slots for locals.
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
// Computes monitor_size and top_frame_size in bytes.
static void frame_size_helper(int max_stack,
int monitors,
int& monitor_size,
int& top_frame_size) {
monitor_size = frame::interpreter_frame_monitor_size_in_bytes() * monitors;
top_frame_size = round_to(frame::interpreter_frame_cinterpreterstate_size_in_bytes()
+ monitor_size
+ max_stack * Interpreter::stackElementSize
+ 2 * Interpreter::stackElementSize,
frame::alignment_in_bytes)
+ frame::top_ijava_frame_abi_size;
}
// Returns number of stackElementWords needed for the interpreter frame with the
// given sections.
int AbstractInterpreter::size_activation(int max_stack,
int temps,
int extra_args,
int monitors,
int callee_params,
int callee_locals,
bool is_top_frame) {
int monitor_size = 0;
int top_frame_size = 0;
frame_size_helper(max_stack, monitors, monitor_size, top_frame_size);
int frame_size;
if (is_top_frame) {
frame_size = top_frame_size;
} else {
frame_size = round_to(frame::interpreter_frame_cinterpreterstate_size_in_bytes()
+ monitor_size
+ (temps - callee_params + callee_locals) * Interpreter::stackElementSize
+ 2 * Interpreter::stackElementSize,
frame::alignment_in_bytes)
+ frame::parent_ijava_frame_abi_size;
assert(extra_args == 0, "non-zero for top_frame only");
}
return frame_size / Interpreter::stackElementSize;
}
void AbstractInterpreter::layout_activation(Method* method,
int temps, // Number of slots on java expression stack in use.
int popframe_args,
int monitors, // Number of active monitors.
int caller_actual_parameters,
int callee_params,// Number of slots for callee parameters.
int callee_locals,// Number of slots for locals.
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
// NOTE this code must exactly mimic what
// InterpreterGenerator::generate_compute_interpreter_state() does
@ -2967,86 +3010,64 @@ int AbstractInterpreter::layout_activation(Method* method,
// both the abi scratch area and a place to hold a result from a
// callee on its way to the callers stack.
int monitor_size = frame::interpreter_frame_monitor_size_in_bytes() * monitors;
int frame_size;
int top_frame_size = round_to(frame::interpreter_frame_cinterpreterstate_size_in_bytes()
+ monitor_size
+ (method->max_stack() *Interpreter::stackElementWords * BytesPerWord)
+ 2*BytesPerWord,
frame::alignment_in_bytes)
+ frame::top_ijava_frame_abi_size;
if (is_top_frame) {
frame_size = top_frame_size;
} else {
frame_size = round_to(frame::interpreter_frame_cinterpreterstate_size_in_bytes()
+ monitor_size
+ ((temps - callee_params + callee_locals) *
Interpreter::stackElementWords * BytesPerWord)
+ 2*BytesPerWord,
frame::alignment_in_bytes)
+ frame::parent_ijava_frame_abi_size;
assert(popframe_args==0, "non-zero for top_frame only");
}
int monitor_size = 0;
int top_frame_size = 0;
frame_size_helper(method->max_stack(), monitors, monitor_size, top_frame_size);
// If we actually have a frame to layout we must now fill in all the pieces.
if (interpreter_frame != NULL) {
intptr_t sp = (intptr_t)interpreter_frame->sp();
intptr_t fp = *(intptr_t *)sp;
assert(fp == (intptr_t)caller->sp(), "fp must match");
interpreterState cur_state =
(interpreterState)(fp - frame::interpreter_frame_cinterpreterstate_size_in_bytes());
intptr_t sp = (intptr_t)interpreter_frame->sp();
intptr_t fp = *(intptr_t *)sp;
assert(fp == (intptr_t)caller->sp(), "fp must match");
interpreterState cur_state =
(interpreterState)(fp - frame::interpreter_frame_cinterpreterstate_size_in_bytes());
// Now fill in the interpreterState object.
// Now fill in the interpreterState object.
intptr_t* locals;
if (caller->is_interpreted_frame()) {
// Locals must agree with the caller because it will be used to set the
// caller's tos when we return.
interpreterState prev = caller->get_interpreterState();
// Calculate start of "locals" for MH calls. For MH calls, the
// current method() (= MH target) and prev->callee() (=
// MH.invoke*()) are different and especially have different
// signatures. To pop the argumentsof the caller, we must use
// the prev->callee()->size_of_arguments() because that's what
// the caller actually pushed. Currently, for synthetic MH
// calls (deoptimized from inlined MH calls), detected by
// is_method_handle_invoke(), we use the callee's arguments
// because here, the caller's and callee's signature match.
if (true /*!caller->is_at_mh_callsite()*/) {
locals = prev->stack() + method->size_of_parameters();
} else {
// Normal MH call.
locals = prev->stack() + prev->callee()->size_of_parameters();
}
intptr_t* locals;
if (caller->is_interpreted_frame()) {
// Locals must agree with the caller because it will be used to set the
// caller's tos when we return.
interpreterState prev = caller->get_interpreterState();
// Calculate start of "locals" for MH calls. For MH calls, the
// current method() (= MH target) and prev->callee() (=
// MH.invoke*()) are different and especially have different
// signatures. To pop the argumentsof the caller, we must use
// the prev->callee()->size_of_arguments() because that's what
// the caller actually pushed. Currently, for synthetic MH
// calls (deoptimized from inlined MH calls), detected by
// is_method_handle_invoke(), we use the callee's arguments
// because here, the caller's and callee's signature match.
if (true /*!caller->is_at_mh_callsite()*/) {
locals = prev->stack() + method->size_of_parameters();
} else {
bool is_deopted;
locals = (intptr_t*) (fp + ((method->max_locals() - 1) * BytesPerWord) +
frame::parent_ijava_frame_abi_size);
// Normal MH call.
locals = prev->stack() + prev->callee()->size_of_parameters();
}
intptr_t* monitor_base = (intptr_t*) cur_state;
intptr_t* stack_base = (intptr_t*) ((intptr_t) monitor_base - monitor_size);
// Provide pop_frame capability on PPC64, add popframe_args.
// +1 because stack is always prepushed.
intptr_t* stack = (intptr_t*) ((intptr_t) stack_base - (temps + popframe_args + 1) * BytesPerWord);
BytecodeInterpreter::layout_interpreterState(cur_state,
caller,
interpreter_frame,
method,
locals,
stack,
stack_base,
monitor_base,
(intptr_t*)(((intptr_t)fp)-top_frame_size),
is_top_frame);
BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address,
interpreter_frame->fp());
} else {
bool is_deopted;
locals = (intptr_t*) (fp + ((method->max_locals() - 1) * BytesPerWord) +
frame::parent_ijava_frame_abi_size);
}
return frame_size/BytesPerWord;
intptr_t* monitor_base = (intptr_t*) cur_state;
intptr_t* stack_base = (intptr_t*) ((intptr_t) monitor_base - monitor_size);
// Provide pop_frame capability on PPC64, add popframe_args.
// +1 because stack is always prepushed.
intptr_t* stack = (intptr_t*) ((intptr_t) stack_base - (temps + popframe_args + 1) * BytesPerWord);
BytecodeInterpreter::layout_interpreterState(cur_state,
caller,
interpreter_frame,
method,
locals,
stack,
stack_base,
monitor_base,
(intptr_t*)(((intptr_t)fp) - top_frame_size),
is_top_frame);
BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address,
interpreter_frame->fp());
}
#endif // CC_INTERP

View File

@ -1,6 +1,6 @@
//
// Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
// Copyright 2012, 2013 SAP AG. All rights reserved.
// Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
// Copyright 2012, 2014 SAP AG. All rights reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
// This code is free software; you can redistribute it and/or modify it
@ -1362,8 +1362,8 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
Compile* C = ra_->C;
MacroAssembler _masm(&cbuf);
const long framesize = ((long)C->frame_slots()) << LogBytesPerInt;
assert(framesize%(2*wordSize) == 0, "must preserve 2*wordSize alignment");
const long framesize = C->frame_size_in_bytes();
assert(framesize % (2 * wordSize) == 0, "must preserve 2*wordSize alignment");
const bool method_is_frameless = false /* TODO: PPC port C->is_frameless_method()*/;
@ -1388,19 +1388,22 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
// careful, because some VM calls (such as call site linkage) can
// use several kilobytes of stack. But the stack safety zone should
// account for that. See bugs 4446381, 4468289, 4497237.
if (C->need_stack_bang(framesize) && UseStackBanging) {
int bangsize = C->bang_size_in_bytes();
assert(bangsize >= framesize || bangsize <= 0, "stack bang size incorrect");
if (C->need_stack_bang(bangsize) && UseStackBanging) {
// Unfortunately we cannot use the function provided in
// assembler.cpp as we have to emulate the pipes. So I had to
// insert the code of generate_stack_overflow_check(), see
// assembler.cpp for some illuminative comments.
const int page_size = os::vm_page_size();
int bang_end = StackShadowPages*page_size;
int bang_end = StackShadowPages * page_size;
// This is how far the previous frame's stack banging extended.
const int bang_end_safe = bang_end;
if (framesize > page_size) {
bang_end += framesize;
if (bangsize > page_size) {
bang_end += bangsize;
}
int bang_offset = bang_end_safe;
@ -1446,7 +1449,7 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
unsigned int bytes = (unsigned int)framesize;
long offset = Assembler::align_addr(bytes, frame::alignment_in_bytes);
ciMethod *currMethod = C -> method();
ciMethod *currMethod = C->method();
// Optimized version for most common case.
if (UsePower6SchedulerPPC64 &&

View File

@ -1334,21 +1334,42 @@ bool AbstractInterpreter::can_be_compiled(methodHandle m) {
int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
const int max_alignment_size = 2;
const int abi_scratch = frame::abi_reg_args_size;
return method->max_locals() + method->max_stack() + frame::interpreter_frame_monitor_size() + max_alignment_size + abi_scratch;
return method->max_locals() + method->max_stack() +
frame::interpreter_frame_monitor_size() + max_alignment_size + abi_scratch;
}
// Fills a sceletal interpreter frame generated during deoptimizations
// and returns the frame size in slots.
// Returns number of stackElementWords needed for the interpreter frame with the
// given sections.
// This overestimates the stack by one slot in case of alignments.
int AbstractInterpreter::size_activation(int max_stack,
int temps,
int extra_args,
int monitors,
int callee_params,
int callee_locals,
bool is_top_frame) {
// Note: This calculation must exactly parallel the frame setup
// in AbstractInterpreterGenerator::generate_method_entry.
assert(Interpreter::stackElementWords == 1, "sanity");
const int max_alignment_space = StackAlignmentInBytes / Interpreter::stackElementSize;
const int abi_scratch = is_top_frame ? (frame::abi_reg_args_size / Interpreter::stackElementSize) :
(frame::abi_minframe_size / Interpreter::stackElementSize);
const int size =
max_stack +
(callee_locals - callee_params) +
monitors * frame::interpreter_frame_monitor_size() +
max_alignment_space +
abi_scratch +
frame::ijava_state_size / Interpreter::stackElementSize;
// Fixed size of an interpreter frame, align to 16-byte.
return (size & -2);
}
// Fills a sceletal interpreter frame generated during deoptimizations.
//
// Parameters:
//
// interpreter_frame == NULL:
// Only calculate the size of an interpreter activation, no actual layout.
// Note: This calculation must exactly parallel the frame setup
// in TemplateInterpreter::generate_normal_entry. But it does not
// account for the SP alignment, that might further enhance the
// frame size, depending on FP.
//
// interpreter_frame != NULL:
// set up the method, locals, and monitors.
// The frame interpreter_frame, if not NULL, is guaranteed to be the
@ -1365,59 +1386,41 @@ int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
// the arguments off advance the esp by dummy popframe_extra_args slots.
// Popping off those will establish the stack layout as it was before the call.
//
int AbstractInterpreter::layout_activation(Method* method,
int tempcount,
int popframe_extra_args,
int moncount,
int caller_actual_parameters,
int callee_param_count,
int callee_locals,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
void AbstractInterpreter::layout_activation(Method* method,
int tempcount,
int popframe_extra_args,
int moncount,
int caller_actual_parameters,
int callee_param_count,
int callee_locals_count,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
const int max_alignment_space = 2;
const int abi_scratch = is_top_frame ? (frame::abi_reg_args_size / Interpreter::stackElementSize) :
(frame::abi_minframe_size / Interpreter::stackElementSize) ;
const int conservative_framesize_in_slots =
method->max_stack() + callee_locals - callee_param_count +
(moncount * frame::interpreter_frame_monitor_size()) + max_alignment_space +
abi_scratch + frame::ijava_state_size / Interpreter::stackElementSize;
(frame::abi_minframe_size / Interpreter::stackElementSize);
assert(!is_top_frame || conservative_framesize_in_slots * 8 > frame::abi_reg_args_size + frame::ijava_state_size, "frame too small");
intptr_t* locals_base = (caller->is_interpreted_frame()) ?
caller->interpreter_frame_esp() + caller_actual_parameters :
caller->sp() + method->max_locals() - 1 + (frame::abi_minframe_size / Interpreter::stackElementSize) ;
if (interpreter_frame == NULL) {
// Since we don't know the exact alignment, we return the conservative size.
return (conservative_framesize_in_slots & -2);
} else {
// Now we know our caller, calc the exact frame layout and size.
intptr_t* locals_base = (caller->is_interpreted_frame()) ?
caller->interpreter_frame_esp() + caller_actual_parameters :
caller->sp() + method->max_locals() - 1 + (frame::abi_minframe_size / Interpreter::stackElementSize) ;
intptr_t* monitor_base = caller->sp() - frame::ijava_state_size / Interpreter::stackElementSize ;
intptr_t* monitor = monitor_base - (moncount * frame::interpreter_frame_monitor_size());
intptr_t* esp_base = monitor - 1;
intptr_t* esp = esp_base - tempcount - popframe_extra_args;
intptr_t* sp = (intptr_t *) (((intptr_t) (esp_base - callee_locals_count + callee_param_count - method->max_stack()- abi_scratch)) & -StackAlignmentInBytes);
intptr_t* sender_sp = caller->sp() + (frame::abi_minframe_size - frame::abi_reg_args_size) / Interpreter::stackElementSize;
intptr_t* top_frame_sp = is_top_frame ? sp : sp + (frame::abi_minframe_size - frame::abi_reg_args_size) / Interpreter::stackElementSize;
intptr_t* monitor_base = caller->sp() - frame::ijava_state_size / Interpreter::stackElementSize ;
intptr_t* monitor = monitor_base - (moncount * frame::interpreter_frame_monitor_size());
intptr_t* esp_base = monitor - 1;
intptr_t* esp = esp_base - tempcount - popframe_extra_args;
intptr_t* sp = (intptr_t *) (((intptr_t) (esp_base- callee_locals + callee_param_count - method->max_stack()- abi_scratch)) & -StackAlignmentInBytes);
intptr_t* sender_sp = caller->sp() + (frame::abi_minframe_size - frame::abi_reg_args_size) / Interpreter::stackElementSize;
intptr_t* top_frame_sp = is_top_frame ? sp : sp + (frame::abi_minframe_size - frame::abi_reg_args_size) / Interpreter::stackElementSize;
interpreter_frame->interpreter_frame_set_method(method);
interpreter_frame->interpreter_frame_set_locals(locals_base);
interpreter_frame->interpreter_frame_set_cpcache(method->constants()->cache());
interpreter_frame->interpreter_frame_set_esp(esp);
interpreter_frame->interpreter_frame_set_monitor_end((BasicObjectLock *)monitor);
interpreter_frame->interpreter_frame_set_top_frame_sp(top_frame_sp);
if (!is_bottom_frame) {
interpreter_frame->interpreter_frame_set_sender_sp(sender_sp);
}
int framesize_in_slots = caller->sp() - sp;
assert(!is_top_frame ||framesize_in_slots >= (frame::abi_reg_args_size / Interpreter::stackElementSize) + frame::ijava_state_size / Interpreter::stackElementSize, "frame too small");
assert(framesize_in_slots <= conservative_framesize_in_slots, "exact frame size must be smaller than the convervative size!");
return framesize_in_slots;
interpreter_frame->interpreter_frame_set_method(method);
interpreter_frame->interpreter_frame_set_locals(locals_base);
interpreter_frame->interpreter_frame_set_cpcache(method->constants()->cache());
interpreter_frame->interpreter_frame_set_esp(esp);
interpreter_frame->interpreter_frame_set_monitor_end((BasicObjectLock *)monitor);
interpreter_frame->interpreter_frame_set_top_frame_sp(top_frame_sp);
if (!is_bottom_frame) {
interpreter_frame->interpreter_frame_set_sender_sp(sender_sp);
}
}

View File

@ -630,11 +630,20 @@ class Assembler : public AbstractAssembler {
}
protected:
// Insert a nop if the previous is cbcond
void insert_nop_after_cbcond() {
if (UseCBCond && cbcond_before()) {
nop();
}
}
// Delay slot helpers
// cti is called when emitting control-transfer instruction,
// BEFORE doing the emitting.
// Only effective when assertion-checking is enabled.
void cti() {
// A cbcond instruction immediately followed by a CTI
// instruction introduces pipeline stalls, we need to avoid that.
no_cbcond_before();
#ifdef CHECK_DELAY
assert_not_delayed("cti should not be in delay slot");
#endif
@ -658,7 +667,6 @@ class Assembler : public AbstractAssembler {
void no_cbcond_before() {
assert(offset() == 0 || !cbcond_before(), "cbcond should not follow an other cbcond");
}
public:
bool use_cbcond(Label& L) {

View File

@ -54,33 +54,33 @@ inline void Assembler::emit_data(int x, RelocationHolder const& rspec) {
inline void Assembler::add(Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | rs2(s2) ); }
inline void Assembler::add(Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, address d, relocInfo::relocType rt ) { v9_only(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(bpr_op2) | wdisp16(intptr_t(d), intptr_t(pc())) | predict(p) | rs1(s1), rt); has_delay_slot(); }
inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, Label& L) { bpr( c, a, p, s1, target(L)); }
inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, address d, relocInfo::relocType rt ) { v9_only(); insert_nop_after_cbcond(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(bpr_op2) | wdisp16(intptr_t(d), intptr_t(pc())) | predict(p) | rs1(s1), rt); has_delay_slot(); }
inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, Label& L) { insert_nop_after_cbcond(); bpr( c, a, p, s1, target(L)); }
inline void Assembler::fb( Condition c, bool a, address d, relocInfo::relocType rt ) { v9_dep(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(fb_op2) | wdisp(intptr_t(d), intptr_t(pc()), 22), rt); has_delay_slot(); }
inline void Assembler::fb( Condition c, bool a, Label& L ) { fb(c, a, target(L)); }
inline void Assembler::fb( Condition c, bool a, address d, relocInfo::relocType rt ) { v9_dep(); insert_nop_after_cbcond(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(fb_op2) | wdisp(intptr_t(d), intptr_t(pc()), 22), rt); has_delay_slot(); }
inline void Assembler::fb( Condition c, bool a, Label& L ) { insert_nop_after_cbcond(); fb(c, a, target(L)); }
inline void Assembler::fbp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt ) { v9_only(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(fbp_op2) | branchcc(cc) | predict(p) | wdisp(intptr_t(d), intptr_t(pc()), 19), rt); has_delay_slot(); }
inline void Assembler::fbp( Condition c, bool a, CC cc, Predict p, Label& L ) { fbp(c, a, cc, p, target(L)); }
inline void Assembler::fbp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt ) { v9_only(); insert_nop_after_cbcond(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(fbp_op2) | branchcc(cc) | predict(p) | wdisp(intptr_t(d), intptr_t(pc()), 19), rt); has_delay_slot(); }
inline void Assembler::fbp( Condition c, bool a, CC cc, Predict p, Label& L ) { insert_nop_after_cbcond(); fbp(c, a, cc, p, target(L)); }
inline void Assembler::br( Condition c, bool a, address d, relocInfo::relocType rt ) { v9_dep(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(br_op2) | wdisp(intptr_t(d), intptr_t(pc()), 22), rt); has_delay_slot(); }
inline void Assembler::br( Condition c, bool a, Label& L ) { br(c, a, target(L)); }
inline void Assembler::br( Condition c, bool a, address d, relocInfo::relocType rt ) { v9_dep(); insert_nop_after_cbcond(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(br_op2) | wdisp(intptr_t(d), intptr_t(pc()), 22), rt); has_delay_slot(); }
inline void Assembler::br( Condition c, bool a, Label& L ) { insert_nop_after_cbcond(); br(c, a, target(L)); }
inline void Assembler::bp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt ) { v9_only(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(bp_op2) | branchcc(cc) | predict(p) | wdisp(intptr_t(d), intptr_t(pc()), 19), rt); has_delay_slot(); }
inline void Assembler::bp( Condition c, bool a, CC cc, Predict p, Label& L ) { bp(c, a, cc, p, target(L)); }
inline void Assembler::bp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt ) { v9_only(); insert_nop_after_cbcond(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(bp_op2) | branchcc(cc) | predict(p) | wdisp(intptr_t(d), intptr_t(pc()), 19), rt); has_delay_slot(); }
inline void Assembler::bp( Condition c, bool a, CC cc, Predict p, Label& L ) { insert_nop_after_cbcond(); bp(c, a, cc, p, target(L)); }
// compare and branch
inline void Assembler::cbcond(Condition c, CC cc, Register s1, Register s2, Label& L) { cti(); no_cbcond_before(); emit_data(op(branch_op) | cond_cbcond(c) | op2(bpr_op2) | branchcc(cc) | wdisp10(intptr_t(target(L)), intptr_t(pc())) | rs1(s1) | rs2(s2)); }
inline void Assembler::cbcond(Condition c, CC cc, Register s1, int simm5, Label& L) { cti(); no_cbcond_before(); emit_data(op(branch_op) | cond_cbcond(c) | op2(bpr_op2) | branchcc(cc) | wdisp10(intptr_t(target(L)), intptr_t(pc())) | rs1(s1) | immed(true) | simm(simm5, 5)); }
inline void Assembler::call( address d, relocInfo::relocType rt ) { cti(); emit_data( op(call_op) | wdisp(intptr_t(d), intptr_t(pc()), 30), rt); has_delay_slot(); assert(rt != relocInfo::virtual_call_type, "must use virtual_call_Relocation::spec"); }
inline void Assembler::call( Label& L, relocInfo::relocType rt ) { call( target(L), rt); }
inline void Assembler::call( address d, relocInfo::relocType rt ) { insert_nop_after_cbcond(); cti(); emit_data( op(call_op) | wdisp(intptr_t(d), intptr_t(pc()), 30), rt); has_delay_slot(); assert(rt != relocInfo::virtual_call_type, "must use virtual_call_Relocation::spec"); }
inline void Assembler::call( Label& L, relocInfo::relocType rt ) { insert_nop_after_cbcond(); call( target(L), rt); }
inline void Assembler::flush( Register s1, Register s2) { emit_int32( op(arith_op) | op3(flush_op3) | rs1(s1) | rs2(s2)); }
inline void Assembler::flush( Register s1, int simm13a) { emit_data( op(arith_op) | op3(flush_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
inline void Assembler::jmpl( Register s1, Register s2, Register d ) { cti(); emit_int32( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | rs2(s2)); has_delay_slot(); }
inline void Assembler::jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { cti(); emit_data( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); has_delay_slot(); }
inline void Assembler::jmpl( Register s1, Register s2, Register d ) { insert_nop_after_cbcond(); cti(); emit_int32( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | rs2(s2)); has_delay_slot(); }
inline void Assembler::jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { insert_nop_after_cbcond(); cti(); emit_data( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); has_delay_slot(); }
inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | rs2(s2) ); }
inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec) { emit_data( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); }

View File

@ -152,7 +152,7 @@ LIR_Opr LIR_Assembler::osrBufferPointer() {
}
int LIR_Assembler::initial_frame_size_in_bytes() {
int LIR_Assembler::initial_frame_size_in_bytes() const {
return in_bytes(frame_map()->framesize_in_bytes());
}
@ -182,7 +182,7 @@ void LIR_Assembler::osr_entry() {
int number_of_locks = entry_state->locks_size();
// Create a frame for the compiled activation.
__ build_frame(initial_frame_size_in_bytes());
__ build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes());
// OSR buffer is
//

View File

@ -55,9 +55,9 @@ void C1_MacroAssembler::explicit_null_check(Register base) {
}
void C1_MacroAssembler::build_frame(int frame_size_in_bytes) {
generate_stack_overflow_check(frame_size_in_bytes);
void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes) {
assert(bang_size_in_bytes >= frame_size_in_bytes, "stack bang size incorrect");
generate_stack_overflow_check(bang_size_in_bytes);
// Create the frame.
save_frame_c1(frame_size_in_bytes);
}

View File

@ -958,7 +958,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
// reset handle block
__ ld_ptr(G2_thread, in_bytes(JavaThread::active_handles_offset()), G3_scratch);
__ st_ptr(G0, G3_scratch, JNIHandleBlock::top_offset_in_bytes());
__ st(G0, G3_scratch, JNIHandleBlock::top_offset_in_bytes());
// handle exceptions (exception handling will handle unlocking!)
@ -2099,7 +2099,7 @@ int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
int monitor_size = method->is_synchronized() ?
1*frame::interpreter_frame_monitor_size() : 0;
return size_activation_helper(method->max_locals(), method->max_stack(),
monitor_size) + call_stub_size;
monitor_size) + call_stub_size;
}
void BytecodeInterpreter::layout_interpreterState(interpreterState to_fill,
@ -2183,31 +2183,31 @@ void BytecodeInterpreter::pd_layout_interpreterState(interpreterState istate, ad
istate->_last_Java_pc = (intptr_t*) last_Java_pc;
}
static int frame_size_helper(int max_stack,
int moncount,
int callee_param_size,
int callee_locals_size,
bool is_top_frame,
int& monitor_size,
int& full_frame_words) {
int extra_locals_size = callee_locals_size - callee_param_size;
monitor_size = (sizeof(BasicObjectLock) * moncount) / wordSize;
full_frame_words = size_activation_helper(extra_locals_size, max_stack, monitor_size);
int short_frame_words = size_activation_helper(extra_locals_size, max_stack, monitor_size);
int frame_words = is_top_frame ? full_frame_words : short_frame_words;
int AbstractInterpreter::layout_activation(Method* method,
int tempcount, // Number of slots on java expression stack in use
int popframe_extra_args,
int moncount, // Number of active monitors
int caller_actual_parameters,
int callee_param_size,
int callee_locals_size,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
return frame_words;
}
assert(popframe_extra_args == 0, "NEED TO FIX");
// NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state()
// does as far as allocating an interpreter frame.
// If interpreter_frame!=NULL, set up the method, locals, and monitors.
// The frame interpreter_frame, if not NULL, is guaranteed to be the right size,
// as determined by a previous call to this method.
// It is also guaranteed to be walkable even though it is in a skeletal state
int AbstractInterpreter::size_activation(int max_stack,
int tempcount,
int extra_args,
int moncount,
int callee_param_size,
int callee_locals_size,
bool is_top_frame) {
assert(extra_args == 0, "NEED TO FIX");
// NOTE: return size is in words not bytes
// NOTE: tempcount is the current size of the java expression stack. For top most
// frames we will allocate a full sized expression stack and not the curback
// version that non-top frames have.
// Calculate the amount our frame will be adjust by the callee. For top frame
// this is zero.
@ -2216,87 +2216,108 @@ int AbstractInterpreter::layout_activation(Method* method,
// to it. So it ignores last_frame_adjust value. Seems suspicious as far
// as getting sender_sp correct.
int extra_locals_size = callee_locals_size - callee_param_size;
int monitor_size = (sizeof(BasicObjectLock) * moncount) / wordSize;
int full_frame_words = size_activation_helper(extra_locals_size, method->max_stack(), monitor_size);
int short_frame_words = size_activation_helper(extra_locals_size, method->max_stack(), monitor_size);
int frame_words = is_top_frame ? full_frame_words : short_frame_words;
int unused_monitor_size = 0;
int unused_full_frame_words = 0;
return frame_size_helper(max_stack, moncount, callee_param_size, callee_locals_size, is_top_frame,
unused_monitor_size, unused_full_frame_words);
}
void AbstractInterpreter::layout_activation(Method* method,
int tempcount, // Number of slots on java expression stack in use
int popframe_extra_args,
int moncount, // Number of active monitors
int caller_actual_parameters,
int callee_param_size,
int callee_locals_size,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
assert(popframe_extra_args == 0, "NEED TO FIX");
// NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state()
// does as far as allocating an interpreter frame.
// Set up the method, locals, and monitors.
// The frame interpreter_frame is guaranteed to be the right size,
// as determined by a previous call to the size_activation() method.
// It is also guaranteed to be walkable even though it is in a skeletal state
// NOTE: tempcount is the current size of the java expression stack. For top most
// frames we will allocate a full sized expression stack and not the curback
// version that non-top frames have.
int monitor_size = 0;
int full_frame_words = 0;
int frame_words = frame_size_helper(method->max_stack(), moncount, callee_param_size, callee_locals_size,
is_top_frame, monitor_size, full_frame_words);
/*
if we actually have a frame to layout we must now fill in all the pieces. This means both
We must now fill in all the pieces of the frame. This means both
the interpreterState and the registers.
*/
if (interpreter_frame != NULL) {
// MUCHO HACK
// MUCHO HACK
intptr_t* frame_bottom = interpreter_frame->sp() - (full_frame_words - frame_words);
// 'interpreter_frame->sp()' is unbiased while 'frame_bottom' must be a biased value in 64bit mode.
assert(((intptr_t)frame_bottom & 0xf) == 0, "SP biased in layout_activation");
frame_bottom = (intptr_t*)((intptr_t)frame_bottom - STACK_BIAS);
intptr_t* frame_bottom = interpreter_frame->sp() - (full_frame_words - frame_words);
// 'interpreter_frame->sp()' is unbiased while 'frame_bottom' must be a biased value in 64bit mode.
assert(((intptr_t)frame_bottom & 0xf) == 0, "SP biased in layout_activation");
frame_bottom = (intptr_t*)((intptr_t)frame_bottom - STACK_BIAS);
/* Now fillin the interpreterState object */
/* Now fillin the interpreterState object */
interpreterState cur_state = (interpreterState) ((intptr_t)interpreter_frame->fp() - sizeof(BytecodeInterpreter));
interpreterState cur_state = (interpreterState) ((intptr_t)interpreter_frame->fp() - sizeof(BytecodeInterpreter));
intptr_t* locals;
intptr_t* locals;
// Calculate the postion of locals[0]. This is painful because of
// stack alignment (same as ia64). The problem is that we can
// not compute the location of locals from fp(). fp() will account
// for the extra locals but it also accounts for aligning the stack
// and we can't determine if the locals[0] was misaligned but max_locals
// was enough to have the
// calculate postion of locals. fp already accounts for extra locals.
// +2 for the static long no_params() issue.
// Calculate the postion of locals[0]. This is painful because of
// stack alignment (same as ia64). The problem is that we can
// not compute the location of locals from fp(). fp() will account
// for the extra locals but it also accounts for aligning the stack
// and we can't determine if the locals[0] was misaligned but max_locals
// was enough to have the
// calculate postion of locals. fp already accounts for extra locals.
// +2 for the static long no_params() issue.
if (caller->is_interpreted_frame()) {
// locals must agree with the caller because it will be used to set the
// caller's tos when we return.
interpreterState prev = caller->get_interpreterState();
// stack() is prepushed.
locals = prev->stack() + method->size_of_parameters();
if (caller->is_interpreted_frame()) {
// locals must agree with the caller because it will be used to set the
// caller's tos when we return.
interpreterState prev = caller->get_interpreterState();
// stack() is prepushed.
locals = prev->stack() + method->size_of_parameters();
} else {
// Lay out locals block in the caller adjacent to the register window save area.
//
// Compiled frames do not allocate a varargs area which is why this if
// statement is needed.
//
intptr_t* fp = interpreter_frame->fp();
int local_words = method->max_locals() * Interpreter::stackElementWords;
if (caller->is_compiled_frame()) {
locals = fp + frame::register_save_words + local_words - 1;
} else {
// Lay out locals block in the caller adjacent to the register window save area.
//
// Compiled frames do not allocate a varargs area which is why this if
// statement is needed.
//
intptr_t* fp = interpreter_frame->fp();
int local_words = method->max_locals() * Interpreter::stackElementWords;
if (caller->is_compiled_frame()) {
locals = fp + frame::register_save_words + local_words - 1;
} else {
locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1;
}
locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1;
}
// END MUCHO HACK
intptr_t* monitor_base = (intptr_t*) cur_state;
intptr_t* stack_base = monitor_base - monitor_size;
/* +1 because stack is always prepushed */
intptr_t* stack = stack_base - (tempcount + 1);
BytecodeInterpreter::layout_interpreterState(cur_state,
caller,
interpreter_frame,
method,
locals,
stack,
stack_base,
monitor_base,
frame_bottom,
is_top_frame);
BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address, interpreter_frame->fp());
}
return frame_words;
// END MUCHO HACK
intptr_t* monitor_base = (intptr_t*) cur_state;
intptr_t* stack_base = monitor_base - monitor_size;
/* +1 because stack is always prepushed */
intptr_t* stack = stack_base - (tempcount + 1);
BytecodeInterpreter::layout_interpreterState(cur_state,
caller,
interpreter_frame,
method,
locals,
stack,
stack_base,
monitor_base,
frame_bottom,
is_top_frame);
BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address, interpreter_frame->fp());
}
#endif // CC_INTERP

View File

@ -3531,7 +3531,7 @@ void MacroAssembler::bang_stack_size(Register Rsize, Register Rtsp,
// was post-decremented.) Skip this address by starting at i=1, and
// touch a few more pages below. N.B. It is important to touch all
// the way down to and including i=StackShadowPages.
for (int i = 1; i <= StackShadowPages; i++) {
for (int i = 1; i < StackShadowPages; i++) {
set((-i*offset)+STACK_BIAS, Rscratch);
st(G0, Rtsp, Rscratch);
}

View File

@ -233,6 +233,7 @@ inline void MacroAssembler::br( Condition c, bool a, Predict p, address d, reloc
}
inline void MacroAssembler::br( Condition c, bool a, Predict p, Label& L ) {
insert_nop_after_cbcond();
br(c, a, p, target(L));
}
@ -248,6 +249,7 @@ inline void MacroAssembler::brx( Condition c, bool a, Predict p, address d, relo
}
inline void MacroAssembler::brx( Condition c, bool a, Predict p, Label& L ) {
insert_nop_after_cbcond();
brx(c, a, p, target(L));
}
@ -269,6 +271,7 @@ inline void MacroAssembler::fb( Condition c, bool a, Predict p, address d, reloc
}
inline void MacroAssembler::fb( Condition c, bool a, Predict p, Label& L ) {
insert_nop_after_cbcond();
fb(c, a, p, target(L));
}
@ -318,6 +321,7 @@ inline void MacroAssembler::call( address d, relocInfo::relocType rt ) {
}
inline void MacroAssembler::call( Label& L, relocInfo::relocType rt ) {
insert_nop_after_cbcond();
MacroAssembler::call( target(L), rt);
}

View File

@ -2687,7 +2687,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
if (!is_critical_native) {
// reset handle block
__ ld_ptr(G2_thread, in_bytes(JavaThread::active_handles_offset()), L5);
__ st_ptr(G0, L5, JNIHandleBlock::top_offset_in_bytes());
__ st(G0, L5, JNIHandleBlock::top_offset_in_bytes());
__ ld_ptr(G2_thread, in_bytes(Thread::pending_exception_offset()), G3_scratch);
check_forward_pending_exception(masm, G3_scratch);
@ -3355,13 +3355,16 @@ static void make_new_frames(MacroAssembler* masm, bool deopt) {
Register O4array_size = O4;
Label loop;
// Before we make new frames, check to see if stack is available.
// Do this after the caller's return address is on top of stack
#ifdef ASSERT
// Compilers generate code that bang the stack by as much as the
// interpreter would need. So this stack banging should never
// trigger a fault. Verify that it does not on non product builds.
if (UseStackBanging) {
// Get total frame size for interpreted frames
__ ld(O2UnrollBlock, Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes(), O4);
__ bang_stack_size(O4, O3, G3_scratch);
}
#endif
__ ld(O2UnrollBlock, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes(), O4array_size);
__ ld_ptr(O2UnrollBlock, Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes(), G3pcs);
@ -3409,9 +3412,11 @@ void SharedRuntime::generate_deopt_blob() {
ResourceMark rm;
// setup code generation tools
int pad = VerifyThread ? 512 : 0;// Extra slop space for more verify code
#ifdef ASSERT
if (UseStackBanging) {
pad += StackShadowPages*16 + 32;
}
#endif
#ifdef _LP64
CodeBuffer buffer("deopt_blob", 2100+pad, 512);
#else
@ -3632,9 +3637,11 @@ void SharedRuntime::generate_uncommon_trap_blob() {
ResourceMark rm;
// setup code generation tools
int pad = VerifyThread ? 512 : 0;
#ifdef ASSERT
if (UseStackBanging) {
pad += StackShadowPages*16 + 32;
}
#endif
#ifdef _LP64
CodeBuffer buffer("uncommon_trap_blob", 2700+pad, 512);
#else

View File

@ -1193,15 +1193,16 @@ void MachPrologNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
st->print_cr("Verify_Thread"); st->print("\t");
}
size_t framesize = C->frame_slots() << LogBytesPerInt;
size_t framesize = C->frame_size_in_bytes();
int bangsize = C->bang_size_in_bytes();
// Calls to C2R adapters often do not accept exceptional returns.
// We require that their callers must bang for them. But be careful, because
// some VM calls (such as call site linkage) can use several kilobytes of
// stack. But the stack safety zone should account for that.
// See bugs 4446381, 4468289, 4497237.
if (C->need_stack_bang(framesize)) {
st->print_cr("! stack bang"); st->print("\t");
if (C->need_stack_bang(bangsize)) {
st->print_cr("! stack bang (%d bytes)", bangsize); st->print("\t");
}
if (Assembler::is_simm13(-framesize)) {
@ -1225,17 +1226,18 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
__ verify_thread();
size_t framesize = C->frame_slots() << LogBytesPerInt;
size_t framesize = C->frame_size_in_bytes();
assert(framesize >= 16*wordSize, "must have room for reg. save area");
assert(framesize%(2*wordSize) == 0, "must preserve 2*wordSize alignment");
int bangsize = C->bang_size_in_bytes();
// Calls to C2R adapters often do not accept exceptional returns.
// We require that their callers must bang for them. But be careful, because
// some VM calls (such as call site linkage) can use several kilobytes of
// stack. But the stack safety zone should account for that.
// See bugs 4446381, 4468289, 4497237.
if (C->need_stack_bang(framesize)) {
__ generate_stack_overflow_check(framesize);
if (C->need_stack_bang(bangsize)) {
__ generate_stack_overflow_check(bangsize);
}
if (Assembler::is_simm13(-framesize)) {
@ -1268,7 +1270,7 @@ int MachPrologNode::reloc() const {
void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
Compile* C = ra_->C;
if( do_polling() && ra_->C->is_method_compilation() ) {
if(do_polling() && ra_->C->is_method_compilation()) {
st->print("SETHI #PollAddr,L0\t! Load Polling address\n\t");
#ifdef _LP64
st->print("LDX [L0],G0\t!Poll for Safepointing\n\t");
@ -1277,8 +1279,12 @@ void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
#endif
}
if( do_polling() )
if(do_polling()) {
if (UseCBCond && !ra_->C->is_method_compilation()) {
st->print("NOP\n\t");
}
st->print("RET\n\t");
}
st->print("RESTORE");
}
@ -1291,15 +1297,20 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
__ verify_thread();
// If this does safepoint polling, then do it here
if( do_polling() && ra_->C->is_method_compilation() ) {
if(do_polling() && ra_->C->is_method_compilation()) {
AddressLiteral polling_page(os::get_polling_page());
__ sethi(polling_page, L0);
__ relocate(relocInfo::poll_return_type);
__ ld_ptr( L0, 0, G0 );
__ ld_ptr(L0, 0, G0);
}
// If this is a return, then stuff the restore in the delay slot
if( do_polling() ) {
if(do_polling()) {
if (UseCBCond && !ra_->C->is_method_compilation()) {
// Insert extra padding for the case when the epilogue is preceded by
// a cbcond jump, which can't be followed by a CTI instruction
__ nop();
}
__ ret();
__ delayed()->restore();
} else {
@ -2538,7 +2549,7 @@ encode %{
enc_class call_epilog %{
if( VerifyStackAtCalls ) {
MacroAssembler _masm(&cbuf);
int framesize = ra_->C->frame_slots() << LogBytesPerInt;
int framesize = ra_->C->frame_size_in_bytes();
Register temp_reg = G3;
__ add(SP, framesize, temp_reg);
__ cmp(temp_reg, FP);
@ -3330,7 +3341,18 @@ op_attrib op_cost(1); // Required cost attribute
//----------Instruction Attributes---------------------------------------------
ins_attrib ins_cost(DEFAULT_COST); // Required cost attribute
ins_attrib ins_size(32); // Required size attribute (in bits)
ins_attrib ins_avoid_back_to_back(0); // instruction should not be generated back to back
// avoid_back_to_back attribute is an expression that must return
// one of the following values defined in MachNode:
// AVOID_NONE - instruction can be placed anywhere
// AVOID_BEFORE - instruction cannot be placed after an
// instruction with MachNode::AVOID_AFTER
// AVOID_AFTER - the next instruction cannot be the one
// with MachNode::AVOID_BEFORE
// AVOID_BEFORE_AND_AFTER - BEFORE and AFTER attributes at
// the same time
ins_attrib ins_avoid_back_to_back(MachNode::AVOID_NONE);
ins_attrib ins_short_branch(0); // Required flag: is this instruction a
// non-matching short branch variant of some
// long branch?
@ -6630,6 +6652,7 @@ instruct encodeHeapOop(iRegN dst, iRegP src) %{
ins_encode %{
__ encode_heap_oop($src$$Register, $dst$$Register);
%}
ins_avoid_back_to_back(Universe::narrow_oop_base() == NULL ? AVOID_NONE : AVOID_BEFORE);
ins_pipe(ialu_reg);
%}
@ -9199,6 +9222,7 @@ instruct branch(label labl) %{
__ ba(*L);
__ delayed()->nop();
%}
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(br);
%}
@ -9217,7 +9241,7 @@ instruct branch_short(label labl) %{
__ ba_short(*L);
%}
ins_short_branch(1);
ins_avoid_back_to_back(1);
ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
ins_pipe(cbcond_reg_imm);
%}
@ -9231,6 +9255,7 @@ instruct branchCon(cmpOp cmp, flagsReg icc, label labl) %{
format %{ "BP$cmp $icc,$labl" %}
// Prim = bits 24-22, Secnd = bits 31-30
ins_encode( enc_bp( labl, cmp, icc ) );
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(br_cc);
%}
@ -9242,6 +9267,7 @@ instruct branchConU(cmpOpU cmp, flagsRegU icc, label labl) %{
format %{ "BP$cmp $icc,$labl" %}
// Prim = bits 24-22, Secnd = bits 31-30
ins_encode( enc_bp( labl, cmp, icc ) );
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(br_cc);
%}
@ -9260,6 +9286,7 @@ instruct branchConP(cmpOpP cmp, flagsRegP pcc, label labl) %{
__ bp( (Assembler::Condition)($cmp$$cmpcode), false, Assembler::ptr_cc, predict_taken, *L);
__ delayed()->nop();
%}
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(br_cc);
%}
@ -9278,6 +9305,7 @@ instruct branchConF(cmpOpF cmp, flagsRegF fcc, label labl) %{
__ fbp( (Assembler::Condition)($cmp$$cmpcode), false, (Assembler::CC)($fcc$$reg), predict_taken, *L);
__ delayed()->nop();
%}
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(br_fcc);
%}
@ -9290,6 +9318,7 @@ instruct branchLoopEnd(cmpOp cmp, flagsReg icc, label labl) %{
format %{ "BP$cmp $icc,$labl\t! Loop end" %}
// Prim = bits 24-22, Secnd = bits 31-30
ins_encode( enc_bp( labl, cmp, icc ) );
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(br_cc);
%}
@ -9302,6 +9331,7 @@ instruct branchLoopEndU(cmpOpU cmp, flagsRegU icc, label labl) %{
format %{ "BP$cmp $icc,$labl\t! Loop end" %}
// Prim = bits 24-22, Secnd = bits 31-30
ins_encode( enc_bp( labl, cmp, icc ) );
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(br_cc);
%}
@ -9552,7 +9582,7 @@ instruct cmpI_reg_branch_short(cmpOp cmp, iRegI op1, iRegI op2, label labl, flag
__ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L);
%}
ins_short_branch(1);
ins_avoid_back_to_back(1);
ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
ins_pipe(cbcond_reg_reg);
%}
@ -9570,7 +9600,7 @@ instruct cmpI_imm_branch_short(cmpOp cmp, iRegI op1, immI5 op2, label labl, flag
__ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L);
%}
ins_short_branch(1);
ins_avoid_back_to_back(1);
ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
ins_pipe(cbcond_reg_imm);
%}
@ -9588,7 +9618,7 @@ instruct cmpU_reg_branch_short(cmpOpU cmp, iRegI op1, iRegI op2, label labl, fla
__ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L);
%}
ins_short_branch(1);
ins_avoid_back_to_back(1);
ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
ins_pipe(cbcond_reg_reg);
%}
@ -9606,7 +9636,7 @@ instruct cmpU_imm_branch_short(cmpOpU cmp, iRegI op1, immI5 op2, label labl, fla
__ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L);
%}
ins_short_branch(1);
ins_avoid_back_to_back(1);
ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
ins_pipe(cbcond_reg_imm);
%}
@ -9624,7 +9654,7 @@ instruct cmpL_reg_branch_short(cmpOp cmp, iRegL op1, iRegL op2, label labl, flag
__ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::xcc, $op1$$Register, $op2$$Register, *L);
%}
ins_short_branch(1);
ins_avoid_back_to_back(1);
ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
ins_pipe(cbcond_reg_reg);
%}
@ -9642,7 +9672,7 @@ instruct cmpL_imm_branch_short(cmpOp cmp, iRegL op1, immL5 op2, label labl, flag
__ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::xcc, $op1$$Register, $op2$$constant, *L);
%}
ins_short_branch(1);
ins_avoid_back_to_back(1);
ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
ins_pipe(cbcond_reg_imm);
%}
@ -9665,7 +9695,7 @@ instruct cmpP_reg_branch_short(cmpOpP cmp, iRegP op1, iRegP op2, label labl, fla
__ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::ptr_cc, $op1$$Register, $op2$$Register, *L);
%}
ins_short_branch(1);
ins_avoid_back_to_back(1);
ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
ins_pipe(cbcond_reg_reg);
%}
@ -9687,7 +9717,7 @@ instruct cmpP_null_branch_short(cmpOpP cmp, iRegP op1, immP0 null, label labl, f
__ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::ptr_cc, $op1$$Register, G0, *L);
%}
ins_short_branch(1);
ins_avoid_back_to_back(1);
ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
ins_pipe(cbcond_reg_reg);
%}
@ -9705,7 +9735,7 @@ instruct cmpN_reg_branch_short(cmpOp cmp, iRegN op1, iRegN op2, label labl, flag
__ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L);
%}
ins_short_branch(1);
ins_avoid_back_to_back(1);
ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
ins_pipe(cbcond_reg_reg);
%}
@ -9723,7 +9753,7 @@ instruct cmpN_null_branch_short(cmpOp cmp, iRegN op1, immN0 null, label labl, fl
__ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, G0, *L);
%}
ins_short_branch(1);
ins_avoid_back_to_back(1);
ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
ins_pipe(cbcond_reg_reg);
%}
@ -9742,7 +9772,7 @@ instruct cmpI_reg_branchLoopEnd_short(cmpOp cmp, iRegI op1, iRegI op2, label lab
__ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$Register, *L);
%}
ins_short_branch(1);
ins_avoid_back_to_back(1);
ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
ins_pipe(cbcond_reg_reg);
%}
@ -9760,7 +9790,7 @@ instruct cmpI_imm_branchLoopEnd_short(cmpOp cmp, iRegI op1, immI5 op2, label lab
__ cbcond((Assembler::Condition)($cmp$$cmpcode), Assembler::icc, $op1$$Register, $op2$$constant, *L);
%}
ins_short_branch(1);
ins_avoid_back_to_back(1);
ins_avoid_back_to_back(AVOID_BEFORE_AND_AFTER);
ins_pipe(cbcond_reg_imm);
%}
@ -9777,6 +9807,7 @@ instruct branchCon_regI(cmpOp_reg cmp, iRegI op1, immI0 zero, label labl) %{
ins_cost(BRANCH_COST);
format %{ "BR$cmp $op1,$labl" %}
ins_encode( enc_bpr( labl, cmp, op1 ) );
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(br_reg);
%}
@ -9789,6 +9820,7 @@ instruct branchCon_regP(cmpOp_reg cmp, iRegP op1, immP0 null, label labl) %{
ins_cost(BRANCH_COST);
format %{ "BR$cmp $op1,$labl" %}
ins_encode( enc_bpr( labl, cmp, op1 ) );
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(br_reg);
%}
@ -9801,6 +9833,7 @@ instruct branchCon_regL(cmpOp_reg cmp, iRegL op1, immL0 zero, label labl) %{
ins_cost(BRANCH_COST);
format %{ "BR$cmp $op1,$labl" %}
ins_encode( enc_bpr( labl, cmp, op1 ) );
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(br_reg);
%}
@ -9841,6 +9874,7 @@ instruct branchCon_long(cmpOp cmp, flagsRegL xcc, label labl) %{
__ bp( (Assembler::Condition)($cmp$$cmpcode), false, Assembler::xcc, predict_taken, *L);
__ delayed()->nop();
%}
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(br_cc);
%}
@ -9968,6 +10002,7 @@ instruct CallStaticJavaDirect( method meth ) %{
ins_cost(CALL_COST);
format %{ "CALL,static ; NOP ==> " %}
ins_encode( Java_Static_Call( meth ), call_epilog );
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(simple_call);
%}
@ -10004,6 +10039,7 @@ instruct CallRuntimeDirect(method meth, l7RegP l7) %{
format %{ "CALL,runtime" %}
ins_encode( Java_To_Runtime( meth ),
call_epilog, adjust_long_from_native_call );
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(simple_call);
%}
@ -10016,6 +10052,7 @@ instruct CallLeafDirect(method meth, l7RegP l7) %{
ins_encode( Java_To_Runtime( meth ),
call_epilog,
adjust_long_from_native_call );
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(simple_call);
%}
@ -10028,6 +10065,7 @@ instruct CallLeafNoFPDirect(method meth, l7RegP l7) %{
ins_encode( Java_To_Runtime( meth ),
call_epilog,
adjust_long_from_native_call );
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(simple_call);
%}
@ -10041,6 +10079,7 @@ instruct TailCalljmpInd(g3RegP jump_target, inline_cache_regP method_oop) %{
ins_cost(CALL_COST);
format %{ "Jmp $jump_target ; NOP \t! $method_oop holds method oop" %}
ins_encode(form_jmpl(jump_target));
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(tail_call);
%}
@ -10072,6 +10111,7 @@ instruct tailjmpInd(g1RegP jump_target, i0RegP ex_oop) %{
// opcode(Assembler::jmpl_op3, Assembler::arith_op);
// The hack duplicates the exception oop into G3, so that CreateEx can use it there.
// ins_encode( form3_rs1_simm13_rd( jump_target, 0x00, R_G0 ), move_return_pc_to_o1() );
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(tail_call);
%}
@ -10102,6 +10142,7 @@ instruct RethrowException()
// use the following format syntax
format %{ "Jmp rethrow_stub" %}
ins_encode(enc_rethrow);
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(tail_call);
%}
@ -10130,6 +10171,7 @@ instruct partialSubtypeCheck( o0RegP index, o1RegP sub, o2RegP super, flagsRegP
ins_cost(DEFAULT_COST*10);
format %{ "CALL PartialSubtypeCheck\n\tNOP" %}
ins_encode( enc_PartialSubtypeCheck() );
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(partial_subtype_check_pipe);
%}
@ -10139,6 +10181,7 @@ instruct partialSubtypeCheck_vs_zero( flagsRegP pcc, o1RegP sub, o2RegP super, i
ins_cost(DEFAULT_COST*10);
format %{ "CALL PartialSubtypeCheck\n\tNOP\t# (sets condition codes)" %}
ins_encode( enc_PartialSubtypeCheck() );
ins_avoid_back_to_back(AVOID_BEFORE);
ins_pipe(partial_subtype_check_pipe);
%}

View File

@ -1147,7 +1147,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
// reset handle block
__ ld_ptr(G2_thread, JavaThread::active_handles_offset(), G3_scratch);
__ st_ptr(G0, G3_scratch, JNIHandleBlock::top_offset_in_bytes());
__ st(G0, G3_scratch, JNIHandleBlock::top_offset_in_bytes());
// If we have an oop result store it where it will be safe for any further gc
// until we return now that we've released the handle it might be protected by
@ -1564,37 +1564,23 @@ int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
int monitor_size = method->is_synchronized() ?
1*frame::interpreter_frame_monitor_size() : 0;
return size_activation_helper(method->max_locals(), method->max_stack(),
monitor_size) + call_stub_size;
monitor_size) + call_stub_size;
}
int AbstractInterpreter::layout_activation(Method* method,
int tempcount,
int popframe_extra_args,
int moncount,
int caller_actual_parameters,
int callee_param_count,
int callee_local_count,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
int AbstractInterpreter::size_activation(int max_stack,
int temps,
int extra_args,
int monitors,
int callee_params,
int callee_locals,
bool is_top_frame) {
// Note: This calculation must exactly parallel the frame setup
// in InterpreterGenerator::generate_fixed_frame.
// If f!=NULL, set up the following variables:
// - Lmethod
// - Llocals
// - Lmonitors (to the indicated number of monitors)
// - Lesp (to the indicated number of temps)
// The frame f (if not NULL) on entry is a description of the caller of the frame
// we are about to layout. We are guaranteed that we will be able to fill in a
// new interpreter frame as its callee (i.e. the stack space is allocated and
// the amount was determined by an earlier call to this method with f == NULL).
// On return f (if not NULL) while describe the interpreter frame we just layed out.
int monitor_size = moncount * frame::interpreter_frame_monitor_size();
int rounded_vm_local_words = round_to(frame::interpreter_frame_vm_local_words,WordsPerLong);
int monitor_size = monitors * frame::interpreter_frame_monitor_size();
assert(monitor_size == round_to(monitor_size, WordsPerLong), "must align");
//
// Note: if you look closely this appears to be doing something much different
// than generate_fixed_frame. What is happening is this. On sparc we have to do
@ -1619,146 +1605,171 @@ int AbstractInterpreter::layout_activation(Method* method,
// there is no sense in messing working code.
//
int rounded_cls = round_to((callee_local_count - callee_param_count), WordsPerLong);
int rounded_cls = round_to((callee_locals - callee_params), WordsPerLong);
assert(rounded_cls == round_to(rounded_cls, WordsPerLong), "must align");
int raw_frame_size = size_activation_helper(rounded_cls, method->max_stack(),
monitor_size);
int raw_frame_size = size_activation_helper(rounded_cls, max_stack, monitor_size);
if (interpreter_frame != NULL) {
// The skeleton frame must already look like an interpreter frame
// even if not fully filled out.
assert(interpreter_frame->is_interpreted_frame(), "Must be interpreted frame");
return raw_frame_size;
}
intptr_t* fp = interpreter_frame->fp();
void AbstractInterpreter::layout_activation(Method* method,
int tempcount,
int popframe_extra_args,
int moncount,
int caller_actual_parameters,
int callee_param_count,
int callee_local_count,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
// Set up the following variables:
// - Lmethod
// - Llocals
// - Lmonitors (to the indicated number of monitors)
// - Lesp (to the indicated number of temps)
// The frame caller on entry is a description of the caller of the
// frame we are about to layout. We are guaranteed that we will be
// able to fill in a new interpreter frame as its callee (i.e. the
// stack space is allocated and the amount was determined by an
// earlier call to the size_activation() method). On return caller
// while describe the interpreter frame we just layed out.
JavaThread* thread = JavaThread::current();
RegisterMap map(thread, false);
// More verification that skeleton frame is properly walkable
assert(fp == caller->sp(), "fp must match");
// The skeleton frame must already look like an interpreter frame
// even if not fully filled out.
assert(interpreter_frame->is_interpreted_frame(), "Must be interpreted frame");
intptr_t* montop = fp - rounded_vm_local_words;
int rounded_vm_local_words = round_to(frame::interpreter_frame_vm_local_words,WordsPerLong);
int monitor_size = moncount * frame::interpreter_frame_monitor_size();
assert(monitor_size == round_to(monitor_size, WordsPerLong), "must align");
// preallocate monitors (cf. __ add_monitor_to_stack)
intptr_t* monitors = montop - monitor_size;
intptr_t* fp = interpreter_frame->fp();
// preallocate stack space
intptr_t* esp = monitors - 1 -
(tempcount * Interpreter::stackElementWords) -
popframe_extra_args;
JavaThread* thread = JavaThread::current();
RegisterMap map(thread, false);
// More verification that skeleton frame is properly walkable
assert(fp == caller->sp(), "fp must match");
int local_words = method->max_locals() * Interpreter::stackElementWords;
NEEDS_CLEANUP;
intptr_t* locals;
if (caller->is_interpreted_frame()) {
// Can force the locals area to end up properly overlapping the top of the expression stack.
intptr_t* Lesp_ptr = caller->interpreter_frame_tos_address() - 1;
// Note that this computation means we replace size_of_parameters() values from the caller
// interpreter frame's expression stack with our argument locals
int parm_words = caller_actual_parameters * Interpreter::stackElementWords;
locals = Lesp_ptr + parm_words;
int delta = local_words - parm_words;
int computed_sp_adjustment = (delta > 0) ? round_to(delta, WordsPerLong) : 0;
*interpreter_frame->register_addr(I5_savedSP) = (intptr_t) (fp + computed_sp_adjustment) - STACK_BIAS;
if (!is_bottom_frame) {
// Llast_SP is set below for the current frame to SP (with the
// extra space for the callee's locals). Here we adjust
// Llast_SP for the caller's frame, removing the extra space
// for the current method's locals.
*caller->register_addr(Llast_SP) = *interpreter_frame->register_addr(I5_savedSP);
} else {
assert(*caller->register_addr(Llast_SP) >= *interpreter_frame->register_addr(I5_savedSP), "strange Llast_SP");
}
intptr_t* montop = fp - rounded_vm_local_words;
// preallocate monitors (cf. __ add_monitor_to_stack)
intptr_t* monitors = montop - monitor_size;
// preallocate stack space
intptr_t* esp = monitors - 1 -
(tempcount * Interpreter::stackElementWords) -
popframe_extra_args;
int local_words = method->max_locals() * Interpreter::stackElementWords;
NEEDS_CLEANUP;
intptr_t* locals;
if (caller->is_interpreted_frame()) {
// Can force the locals area to end up properly overlapping the top of the expression stack.
intptr_t* Lesp_ptr = caller->interpreter_frame_tos_address() - 1;
// Note that this computation means we replace size_of_parameters() values from the caller
// interpreter frame's expression stack with our argument locals
int parm_words = caller_actual_parameters * Interpreter::stackElementWords;
locals = Lesp_ptr + parm_words;
int delta = local_words - parm_words;
int computed_sp_adjustment = (delta > 0) ? round_to(delta, WordsPerLong) : 0;
*interpreter_frame->register_addr(I5_savedSP) = (intptr_t) (fp + computed_sp_adjustment) - STACK_BIAS;
if (!is_bottom_frame) {
// Llast_SP is set below for the current frame to SP (with the
// extra space for the callee's locals). Here we adjust
// Llast_SP for the caller's frame, removing the extra space
// for the current method's locals.
*caller->register_addr(Llast_SP) = *interpreter_frame->register_addr(I5_savedSP);
} else {
assert(caller->is_compiled_frame() || caller->is_entry_frame(), "only possible cases");
// Don't have Lesp available; lay out locals block in the caller
// adjacent to the register window save area.
//
// Compiled frames do not allocate a varargs area which is why this if
// statement is needed.
//
if (caller->is_compiled_frame()) {
locals = fp + frame::register_save_words + local_words - 1;
} else {
locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1;
}
if (!caller->is_entry_frame()) {
// Caller wants his own SP back
int caller_frame_size = caller->cb()->frame_size();
*interpreter_frame->register_addr(I5_savedSP) = (intptr_t)(caller->fp() - caller_frame_size) - STACK_BIAS;
assert(*caller->register_addr(Llast_SP) >= *interpreter_frame->register_addr(I5_savedSP), "strange Llast_SP");
}
} else {
assert(caller->is_compiled_frame() || caller->is_entry_frame(), "only possible cases");
// Don't have Lesp available; lay out locals block in the caller
// adjacent to the register window save area.
//
// Compiled frames do not allocate a varargs area which is why this if
// statement is needed.
//
if (caller->is_compiled_frame()) {
locals = fp + frame::register_save_words + local_words - 1;
} else {
locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1;
}
if (!caller->is_entry_frame()) {
// Caller wants his own SP back
int caller_frame_size = caller->cb()->frame_size();
*interpreter_frame->register_addr(I5_savedSP) = (intptr_t)(caller->fp() - caller_frame_size) - STACK_BIAS;
}
}
if (TraceDeoptimization) {
if (caller->is_entry_frame()) {
// make sure I5_savedSP and the entry frames notion of saved SP
// agree. This assertion duplicate a check in entry frame code
// but catches the failure earlier.
assert(*caller->register_addr(Lscratch) == *interpreter_frame->register_addr(I5_savedSP),
"would change callers SP");
}
if (caller->is_entry_frame()) {
tty->print("entry ");
}
if (caller->is_compiled_frame()) {
tty->print("compiled ");
if (caller->is_deoptimized_frame()) {
tty->print("(deopt) ");
}
}
if (TraceDeoptimization) {
if (caller->is_entry_frame()) {
// make sure I5_savedSP and the entry frames notion of saved SP
// agree. This assertion duplicate a check in entry frame code
// but catches the failure earlier.
assert(*caller->register_addr(Lscratch) == *interpreter_frame->register_addr(I5_savedSP),
"would change callers SP");
}
if (caller->is_entry_frame()) {
tty->print("entry ");
}
if (caller->is_compiled_frame()) {
tty->print("compiled ");
if (caller->is_deoptimized_frame()) {
tty->print("(deopt) ");
}
}
if (caller->is_interpreted_frame()) {
tty->print("interpreted ");
}
tty->print_cr("caller fp=0x%x sp=0x%x", caller->fp(), caller->sp());
tty->print_cr("save area = 0x%x, 0x%x", caller->sp(), caller->sp() + 16);
tty->print_cr("save area = 0x%x, 0x%x", caller->fp(), caller->fp() + 16);
tty->print_cr("interpreter fp=0x%x sp=0x%x", interpreter_frame->fp(), interpreter_frame->sp());
tty->print_cr("save area = 0x%x, 0x%x", interpreter_frame->sp(), interpreter_frame->sp() + 16);
tty->print_cr("save area = 0x%x, 0x%x", interpreter_frame->fp(), interpreter_frame->fp() + 16);
tty->print_cr("Llocals = 0x%x", locals);
tty->print_cr("Lesp = 0x%x", esp);
tty->print_cr("Lmonitors = 0x%x", monitors);
if (caller->is_interpreted_frame()) {
tty->print("interpreted ");
}
tty->print_cr("caller fp=0x%x sp=0x%x", caller->fp(), caller->sp());
tty->print_cr("save area = 0x%x, 0x%x", caller->sp(), caller->sp() + 16);
tty->print_cr("save area = 0x%x, 0x%x", caller->fp(), caller->fp() + 16);
tty->print_cr("interpreter fp=0x%x sp=0x%x", interpreter_frame->fp(), interpreter_frame->sp());
tty->print_cr("save area = 0x%x, 0x%x", interpreter_frame->sp(), interpreter_frame->sp() + 16);
tty->print_cr("save area = 0x%x, 0x%x", interpreter_frame->fp(), interpreter_frame->fp() + 16);
tty->print_cr("Llocals = 0x%x", locals);
tty->print_cr("Lesp = 0x%x", esp);
tty->print_cr("Lmonitors = 0x%x", monitors);
}
if (method->max_locals() > 0) {
assert(locals < caller->sp() || locals >= (caller->sp() + 16), "locals in save area");
assert(locals < caller->fp() || locals > (caller->fp() + 16), "locals in save area");
assert(locals < interpreter_frame->sp() || locals > (interpreter_frame->sp() + 16), "locals in save area");
assert(locals < interpreter_frame->fp() || locals >= (interpreter_frame->fp() + 16), "locals in save area");
}
if (method->max_locals() > 0) {
assert(locals < caller->sp() || locals >= (caller->sp() + 16), "locals in save area");
assert(locals < caller->fp() || locals > (caller->fp() + 16), "locals in save area");
assert(locals < interpreter_frame->sp() || locals > (interpreter_frame->sp() + 16), "locals in save area");
assert(locals < interpreter_frame->fp() || locals >= (interpreter_frame->fp() + 16), "locals in save area");
}
#ifdef _LP64
assert(*interpreter_frame->register_addr(I5_savedSP) & 1, "must be odd");
assert(*interpreter_frame->register_addr(I5_savedSP) & 1, "must be odd");
#endif
*interpreter_frame->register_addr(Lmethod) = (intptr_t) method;
*interpreter_frame->register_addr(Llocals) = (intptr_t) locals;
*interpreter_frame->register_addr(Lmonitors) = (intptr_t) monitors;
*interpreter_frame->register_addr(Lesp) = (intptr_t) esp;
// Llast_SP will be same as SP as there is no adapter space
*interpreter_frame->register_addr(Llast_SP) = (intptr_t) interpreter_frame->sp() - STACK_BIAS;
*interpreter_frame->register_addr(LcpoolCache) = (intptr_t) method->constants()->cache();
*interpreter_frame->register_addr(Lmethod) = (intptr_t) method;
*interpreter_frame->register_addr(Llocals) = (intptr_t) locals;
*interpreter_frame->register_addr(Lmonitors) = (intptr_t) monitors;
*interpreter_frame->register_addr(Lesp) = (intptr_t) esp;
// Llast_SP will be same as SP as there is no adapter space
*interpreter_frame->register_addr(Llast_SP) = (intptr_t) interpreter_frame->sp() - STACK_BIAS;
*interpreter_frame->register_addr(LcpoolCache) = (intptr_t) method->constants()->cache();
#ifdef FAST_DISPATCH
*interpreter_frame->register_addr(IdispatchTables) = (intptr_t) Interpreter::dispatch_table();
*interpreter_frame->register_addr(IdispatchTables) = (intptr_t) Interpreter::dispatch_table();
#endif
#ifdef ASSERT
BasicObjectLock* mp = (BasicObjectLock*)monitors;
BasicObjectLock* mp = (BasicObjectLock*)monitors;
assert(interpreter_frame->interpreter_frame_method() == method, "method matches");
assert(interpreter_frame->interpreter_frame_local_at(9) == (intptr_t *)((intptr_t)locals - (9 * Interpreter::stackElementSize)), "locals match");
assert(interpreter_frame->interpreter_frame_monitor_end() == mp, "monitor_end matches");
assert(((intptr_t *)interpreter_frame->interpreter_frame_monitor_begin()) == ((intptr_t *)mp)+monitor_size, "monitor_begin matches");
assert(interpreter_frame->interpreter_frame_tos_address()-1 == esp, "esp matches");
assert(interpreter_frame->interpreter_frame_method() == method, "method matches");
assert(interpreter_frame->interpreter_frame_local_at(9) == (intptr_t *)((intptr_t)locals - (9 * Interpreter::stackElementSize)), "locals match");
assert(interpreter_frame->interpreter_frame_monitor_end() == mp, "monitor_end matches");
assert(((intptr_t *)interpreter_frame->interpreter_frame_monitor_begin()) == ((intptr_t *)mp)+monitor_size, "monitor_begin matches");
assert(interpreter_frame->interpreter_frame_tos_address()-1 == esp, "esp matches");
// check bounds
intptr_t* lo = interpreter_frame->sp() + (frame::memory_parameter_word_sp_offset - 1);
intptr_t* hi = interpreter_frame->fp() - rounded_vm_local_words;
assert(lo < monitors && montop <= hi, "monitors in bounds");
assert(lo <= esp && esp < monitors, "esp in bounds");
// check bounds
intptr_t* lo = interpreter_frame->sp() + (frame::memory_parameter_word_sp_offset - 1);
intptr_t* hi = interpreter_frame->fp() - rounded_vm_local_words;
assert(lo < monitors && montop <= hi, "monitors in bounds");
assert(lo <= esp && esp < monitors, "esp in bounds");
#endif // ASSERT
}
return raw_frame_size;
}
//----------------------------------------------------------------------------------------------------

View File

@ -288,7 +288,7 @@ void LIR_Assembler::osr_entry() {
// build frame
ciMethod* m = compilation()->method();
__ build_frame(initial_frame_size_in_bytes());
__ build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes());
// OSR buffer is
//
@ -376,7 +376,7 @@ void LIR_Assembler::klass2reg_with_patching(Register reg, CodeEmitInfo* info) {
}
// This specifies the rsp decrement needed to build the frame
int LIR_Assembler::initial_frame_size_in_bytes() {
int LIR_Assembler::initial_frame_size_in_bytes() const {
// if rounding, must let FrameMap know!
// The frame_map records size in slots (32bit word)

View File

@ -349,13 +349,14 @@ void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
}
void C1_MacroAssembler::build_frame(int frame_size_in_bytes) {
void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes) {
assert(bang_size_in_bytes >= frame_size_in_bytes, "stack bang size incorrect");
// Make sure there is enough stack space for this method's activation.
// Note that we do this before doing an enter(). This matches the
// ordering of C2's stack overflow check / rsp decrement and allows
// the SharedRuntime stack overflow handling to be consistent
// between the two compilers.
generate_stack_overflow_check(frame_size_in_bytes);
generate_stack_overflow_check(bang_size_in_bytes);
push(rbp);
#ifdef TIERED

View File

@ -1358,7 +1358,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
// reset handle block
__ movptr(t, Address(thread, JavaThread::active_handles_offset()));
__ movptr(Address(t, JNIHandleBlock::top_offset_in_bytes()), (int32_t)NULL_WORD);
__ movl(Address(t, JNIHandleBlock::top_offset_in_bytes()), (int32_t)NULL_WORD);
// If result was an oop then unbox and save it in the frame
{ Label L;
@ -2342,29 +2342,42 @@ void BytecodeInterpreter::layout_interpreterState(interpreterState to_fill,
"Stack top out of range");
}
int AbstractInterpreter::layout_activation(Method* method,
int tempcount, //
int popframe_extra_args,
int moncount,
int caller_actual_parameters,
int callee_param_count,
int callee_locals,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
assert(popframe_extra_args == 0, "FIX ME");
// NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state()
// does as far as allocating an interpreter frame.
// If interpreter_frame!=NULL, set up the method, locals, and monitors.
// The frame interpreter_frame, if not NULL, is guaranteed to be the right size,
// as determined by a previous call to this method.
// It is also guaranteed to be walkable even though it is in a skeletal state
static int frame_size_helper(int max_stack,
int tempcount,
int moncount,
int callee_param_count,
int callee_locals,
bool is_top_frame,
int& monitor_size,
int& full_frame_size) {
int extra_locals_size = (callee_locals - callee_param_count) * BytesPerWord;
monitor_size = sizeof(BasicObjectLock) * moncount;
// First calculate the frame size without any java expression stack
int short_frame_size = size_activation_helper(extra_locals_size,
monitor_size);
// Now with full size expression stack
full_frame_size = short_frame_size + max_stack * BytesPerWord;
// and now with only live portion of the expression stack
short_frame_size = short_frame_size + tempcount * BytesPerWord;
// the size the activation is right now. Only top frame is full size
int frame_size = (is_top_frame ? full_frame_size : short_frame_size);
return frame_size;
}
int AbstractInterpreter::size_activation(int max_stack,
int tempcount,
int extra_args,
int moncount,
int callee_param_count,
int callee_locals,
bool is_top_frame) {
assert(extra_args == 0, "FIX ME");
// NOTE: return size is in words not bytes
// NOTE: tempcount is the current size of the java expression stack. For top most
// frames we will allocate a full sized expression stack and not the curback
// version that non-top frames have.
// Calculate the amount our frame will be adjust by the callee. For top frame
// this is zero.
@ -2374,87 +2387,102 @@ int AbstractInterpreter::layout_activation(Method* method,
// to it. So it ignores last_frame_adjust value. Seems suspicious as far
// as getting sender_sp correct.
int extra_locals_size = (callee_locals - callee_param_count) * BytesPerWord;
int monitor_size = sizeof(BasicObjectLock) * moncount;
int unused_monitor_size = 0;
int unused_full_frame_size = 0;
return frame_size_helper(max_stack, tempcount, moncount, callee_param_count, callee_locals,
is_top_frame, unused_monitor_size, unused_full_frame_size)/BytesPerWord;
}
// First calculate the frame size without any java expression stack
int short_frame_size = size_activation_helper(extra_locals_size,
monitor_size);
void AbstractInterpreter::layout_activation(Method* method,
int tempcount, //
int popframe_extra_args,
int moncount,
int caller_actual_parameters,
int callee_param_count,
int callee_locals,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
// Now with full size expression stack
int full_frame_size = short_frame_size + method->max_stack() * BytesPerWord;
assert(popframe_extra_args == 0, "FIX ME");
// NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state()
// does as far as allocating an interpreter frame.
// Set up the method, locals, and monitors.
// The frame interpreter_frame is guaranteed to be the right size,
// as determined by a previous call to the size_activation() method.
// It is also guaranteed to be walkable even though it is in a skeletal state
// NOTE: tempcount is the current size of the java expression stack. For top most
// frames we will allocate a full sized expression stack and not the curback
// version that non-top frames have.
// and now with only live portion of the expression stack
short_frame_size = short_frame_size + tempcount * BytesPerWord;
int monitor_size = 0;
int full_frame_size = 0;
int frame_size = frame_size_helper(method->max_stack(), tempcount, moncount, callee_param_count, callee_locals,
is_top_frame, monitor_size, full_frame_size);
// the size the activation is right now. Only top frame is full size
int frame_size = (is_top_frame ? full_frame_size : short_frame_size);
if (interpreter_frame != NULL) {
#ifdef ASSERT
assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable");
assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable");
#endif
// MUCHO HACK
// MUCHO HACK
intptr_t* frame_bottom = (intptr_t*) ((intptr_t)interpreter_frame->sp() - (full_frame_size - frame_size));
intptr_t* frame_bottom = (intptr_t*) ((intptr_t)interpreter_frame->sp() - (full_frame_size - frame_size));
/* Now fillin the interpreterState object */
/* Now fillin the interpreterState object */
// The state object is the first thing on the frame and easily located
// The state object is the first thing on the frame and easily located
interpreterState cur_state = (interpreterState) ((intptr_t)interpreter_frame->fp() - sizeof(BytecodeInterpreter));
interpreterState cur_state = (interpreterState) ((intptr_t)interpreter_frame->fp() - sizeof(BytecodeInterpreter));
// Find the locals pointer. This is rather simple on x86 because there is no
// confusing rounding at the callee to account for. We can trivially locate
// our locals based on the current fp().
// Note: the + 2 is for handling the "static long no_params() method" issue.
// (too bad I don't really remember that issue well...)
// Find the locals pointer. This is rather simple on x86 because there is no
// confusing rounding at the callee to account for. We can trivially locate
// our locals based on the current fp().
// Note: the + 2 is for handling the "static long no_params() method" issue.
// (too bad I don't really remember that issue well...)
intptr_t* locals;
// If the caller is interpreted we need to make sure that locals points to the first
// argument that the caller passed and not in an area where the stack might have been extended.
// because the stack to stack to converter needs a proper locals value in order to remove the
// arguments from the caller and place the result in the proper location. Hmm maybe it'd be
// simpler if we simply stored the result in the BytecodeInterpreter object and let the c++ code
// adjust the stack?? HMMM QQQ
//
if (caller->is_interpreted_frame()) {
// locals must agree with the caller because it will be used to set the
// caller's tos when we return.
interpreterState prev = caller->get_interpreterState();
// stack() is prepushed.
locals = prev->stack() + method->size_of_parameters();
// locals = caller->unextended_sp() + (method->size_of_parameters() - 1);
if (locals != interpreter_frame->fp() + frame::sender_sp_offset + (method->max_locals() - 1) + 2) {
// os::breakpoint();
}
} else {
// this is where a c2i would have placed locals (except for the +2)
locals = interpreter_frame->fp() + frame::sender_sp_offset + (method->max_locals() - 1) + 2;
intptr_t* locals;
// If the caller is interpreted we need to make sure that locals points to the first
// argument that the caller passed and not in an area where the stack might have been extended.
// because the stack to stack to converter needs a proper locals value in order to remove the
// arguments from the caller and place the result in the proper location. Hmm maybe it'd be
// simpler if we simply stored the result in the BytecodeInterpreter object and let the c++ code
// adjust the stack?? HMMM QQQ
//
if (caller->is_interpreted_frame()) {
// locals must agree with the caller because it will be used to set the
// caller's tos when we return.
interpreterState prev = caller->get_interpreterState();
// stack() is prepushed.
locals = prev->stack() + method->size_of_parameters();
// locals = caller->unextended_sp() + (method->size_of_parameters() - 1);
if (locals != interpreter_frame->fp() + frame::sender_sp_offset + (method->max_locals() - 1) + 2) {
// os::breakpoint();
}
intptr_t* monitor_base = (intptr_t*) cur_state;
intptr_t* stack_base = (intptr_t*) ((intptr_t) monitor_base - monitor_size);
/* +1 because stack is always prepushed */
intptr_t* stack = (intptr_t*) ((intptr_t) stack_base - (tempcount + 1) * BytesPerWord);
BytecodeInterpreter::layout_interpreterState(cur_state,
caller,
interpreter_frame,
method,
locals,
stack,
stack_base,
monitor_base,
frame_bottom,
is_top_frame);
// BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address, interpreter_frame->fp());
} else {
// this is where a c2i would have placed locals (except for the +2)
locals = interpreter_frame->fp() + frame::sender_sp_offset + (method->max_locals() - 1) + 2;
}
return frame_size/BytesPerWord;
intptr_t* monitor_base = (intptr_t*) cur_state;
intptr_t* stack_base = (intptr_t*) ((intptr_t) monitor_base - monitor_size);
/* +1 because stack is always prepushed */
intptr_t* stack = (intptr_t*) ((intptr_t) stack_base - (tempcount + 1) * BytesPerWord);
BytecodeInterpreter::layout_interpreterState(cur_state,
caller,
interpreter_frame,
method,
locals,
stack,
stack_base,
monitor_base,
frame_bottom,
is_top_frame);
// BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address, interpreter_frame->fp());
}
bool AbstractInterpreter::can_be_compiled(methodHandle m) {

View File

@ -162,7 +162,7 @@ define_pd_global(uintx, TypeProfileLevel, 111);
"Number of milliseconds to wait before start calculating aborts " \
"for RTM locking") \
\
experimental(bool, UseRTMXendForLockBusy, false, \
experimental(bool, UseRTMXendForLockBusy, true, \
"Use RTM Xend instead of Xabort when lock busy") \
\
/* assembler */ \

View File

@ -1051,7 +1051,7 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) {
// was post-decremented.) Skip this address by starting at i=1, and
// touch a few more pages below. N.B. It is important to touch all
// the way down to and including i=StackShadowPages.
for (int i = 1; i <= StackShadowPages; i++) {
for (int i = 1; i < StackShadowPages; i++) {
// this could be any sized move but this is can be a debugging crumb
// so the bigger the better.
movptr(Address(tmp, (-i*os::vm_page_size())), size );
@ -1488,11 +1488,10 @@ void MacroAssembler::rtm_stack_locking(Register objReg, Register tmpReg, Registe
movl(retry_on_abort_count_Reg, RTMRetryCount); // Retry on abort
bind(L_rtm_retry);
}
if (!UseRTMXendForLockBusy) {
movptr(tmpReg, Address(objReg, 0));
testptr(tmpReg, markOopDesc::monitor_value); // inflated vs stack-locked|neutral|biased
jcc(Assembler::notZero, IsInflated);
}
movptr(tmpReg, Address(objReg, 0));
testptr(tmpReg, markOopDesc::monitor_value); // inflated vs stack-locked|neutral|biased
jcc(Assembler::notZero, IsInflated);
if (PrintPreciseRTMLockingStatistics || profile_rtm) {
Label L_noincrement;
if (RTMTotalCountIncrRate > 1) {
@ -1512,10 +1511,7 @@ void MacroAssembler::rtm_stack_locking(Register objReg, Register tmpReg, Registe
Register abort_status_Reg = tmpReg; // status of abort is stored in RAX
if (UseRTMXendForLockBusy) {
xend();
movptr(tmpReg, Address(objReg, 0));
testptr(tmpReg, markOopDesc::monitor_value); // inflated vs stack-locked|neutral|biased
jcc(Assembler::notZero, IsInflated);
movptr(abort_status_Reg, 0x1); // Set the abort status to 1 (as xabort does)
movptr(abort_status_Reg, 0x2); // Set the abort status to 2 (so we can retry)
jmp(L_decrement_retry);
}
else {
@ -6097,7 +6093,7 @@ void MacroAssembler::reinit_heapbase() {
// C2 compiled method's prolog code.
void MacroAssembler::verified_entry(int framesize, bool stack_bang, bool fp_mode_24b) {
void MacroAssembler::verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b) {
// WARNING: Initial instruction MUST be 5 bytes or longer so that
// NativeJump::patch_verified_entry will be able to patch out the entry
@ -6105,18 +6101,20 @@ void MacroAssembler::verified_entry(int framesize, bool stack_bang, bool fp_mode
// the frame allocation can be either 3 or 6 bytes. So if we don't do
// stack bang then we must use the 6 byte frame allocation even if
// we have no frame. :-(
assert(stack_bang_size >= framesize || stack_bang_size <= 0, "stack bang size incorrect");
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
// Remove word for return addr
framesize -= wordSize;
stack_bang_size -= wordSize;
// Calls to C2R adapters often do not accept exceptional returns.
// We require that their callers must bang for them. But be careful, because
// some VM calls (such as call site linkage) can use several kilobytes of
// stack. But the stack safety zone should account for that.
// See bugs 4446381, 4468289, 4497237.
if (stack_bang) {
generate_stack_overflow_check(framesize);
if (stack_bang_size > 0) {
generate_stack_overflow_check(stack_bang_size);
// We always push rbp, so that on return to interpreter rbp, will be
// restored correctly and we can correct the stack.

View File

@ -1170,7 +1170,7 @@ public:
void movl2ptr(Register dst, Register src) { LP64_ONLY(movslq(dst, src)) NOT_LP64(if (dst != src) movl(dst, src)); }
// C2 compiled method's prolog code.
void verified_entry(int framesize, bool stack_bang, bool fp_mode_24b);
void verified_entry(int framesize, int stack_bang_size, bool fp_mode_24b);
// clear memory of size 'cnt' qwords, starting at 'base'.
void clear_mem(Register base, Register cnt, Register rtmp);

View File

@ -2266,7 +2266,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
if (!is_critical_native) {
// reset handle block
__ movptr(rcx, Address(thread, JavaThread::active_handles_offset()));
__ movptr(Address(rcx, JNIHandleBlock::top_offset_in_bytes()), NULL_WORD);
__ movl(Address(rcx, JNIHandleBlock::top_offset_in_bytes()), NULL_WORD);
// Any exception pending?
__ cmpptr(Address(thread, in_bytes(Thread::pending_exception_offset())), (int32_t)NULL_WORD);
@ -3014,11 +3014,15 @@ void SharedRuntime::generate_deopt_blob() {
// restore rbp before stack bang because if stack overflow is thrown it needs to be pushed (and preserved)
__ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
// Stack bang to make sure there's enough room for these interpreter frames.
#ifdef ASSERT
// Compilers generate code that bang the stack by as much as the
// interpreter would need. So this stack banging should never
// trigger a fault. Verify that it does not on non product builds.
if (UseStackBanging) {
__ movl(rbx, Address(rdi ,Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()));
__ bang_stack_size(rbx, rcx);
}
#endif
// Load array of frame pcs into ECX
__ movptr(rcx,Address(rdi,Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes()));
@ -3240,12 +3244,15 @@ void SharedRuntime::generate_uncommon_trap_blob() {
// restore rbp before stack bang because if stack overflow is thrown it needs to be pushed (and preserved)
__ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
// Stack bang to make sure there's enough room for these interpreter frames.
#ifdef ASSERT
// Compilers generate code that bang the stack by as much as the
// interpreter would need. So this stack banging should never
// trigger a fault. Verify that it does not on non product builds.
if (UseStackBanging) {
__ movl(rbx, Address(rdi ,Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()));
__ bang_stack_size(rbx, rcx);
}
#endif
// Load array of frame pcs into ECX
__ movl(rcx,Address(rdi,Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes()));

View File

@ -2509,7 +2509,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
if (!is_critical_native) {
// reset handle block
__ movptr(rcx, Address(r15_thread, JavaThread::active_handles_offset()));
__ movptr(Address(rcx, JNIHandleBlock::top_offset_in_bytes()), (int32_t)NULL_WORD);
__ movl(Address(rcx, JNIHandleBlock::top_offset_in_bytes()), (int32_t)NULL_WORD);
}
// pop our frame
@ -3484,11 +3484,15 @@ void SharedRuntime::generate_deopt_blob() {
// restore rbp before stack bang because if stack overflow is thrown it needs to be pushed (and preserved)
__ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
// Stack bang to make sure there's enough room for these interpreter frames.
#ifdef ASSERT
// Compilers generate code that bang the stack by as much as the
// interpreter would need. So this stack banging should never
// trigger a fault. Verify that it does not on non product builds.
if (UseStackBanging) {
__ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()));
__ bang_stack_size(rbx, rcx);
}
#endif
// Load address of array of frame pcs into rcx
__ movptr(rcx, Address(rdi, Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes()));
@ -3682,11 +3686,15 @@ void SharedRuntime::generate_uncommon_trap_blob() {
// restore rbp before stack bang because if stack overflow is thrown it needs to be pushed (and preserved)
__ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
// Stack bang to make sure there's enough room for these interpreter frames.
#ifdef ASSERT
// Compilers generate code that bang the stack by as much as the
// interpreter would need. So this stack banging should never
// trigger a fault. Verify that it does not on non product builds.
if (UseStackBanging) {
__ movl(rbx, Address(rdi ,Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()));
__ bang_stack_size(rbx, rcx);
}
#endif
// Load address of array of frame pcs into rcx (address*)
__ movptr(rcx, Address(rdi, Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes()));

View File

@ -0,0 +1,124 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 "ci/ciMethod.hpp"
#include "interpreter/interpreter.hpp"
#include "runtime/frame.inline.hpp"
#ifndef CC_INTERP
// asm based interpreter deoptimization helpers
int AbstractInterpreter::size_activation(int max_stack,
int temps,
int extra_args,
int monitors,
int callee_params,
int callee_locals,
bool is_top_frame) {
// Note: This calculation must exactly parallel the frame setup
// in AbstractInterpreterGenerator::generate_method_entry.
// fixed size of an interpreter frame:
int overhead = frame::sender_sp_offset -
frame::interpreter_frame_initial_sp_offset;
// Our locals were accounted for by the caller (or last_frame_adjust
// on the transistion) Since the callee parameters already account
// for the callee's params we only need to account for the extra
// locals.
int size = overhead +
(callee_locals - callee_params)*Interpreter::stackElementWords +
monitors * frame::interpreter_frame_monitor_size() +
temps* Interpreter::stackElementWords + extra_args;
return size;
}
void AbstractInterpreter::layout_activation(Method* method,
int tempcount,
int popframe_extra_args,
int moncount,
int caller_actual_parameters,
int callee_param_count,
int callee_locals,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
// The frame interpreter_frame is guaranteed to be the right size,
// as determined by a previous call to the size_activation() method.
// It is also guaranteed to be walkable even though it is in a
// skeletal state
int max_locals = method->max_locals() * Interpreter::stackElementWords;
int extra_locals = (method->max_locals() - method->size_of_parameters()) *
Interpreter::stackElementWords;
#ifdef ASSERT
if (!EnableInvokeDynamic) {
// @@@ FIXME: Should we correct interpreter_frame_sender_sp in the calling sequences?
// Probably, since deoptimization doesn't work yet.
assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable");
}
assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable(2)");
#endif
interpreter_frame->interpreter_frame_set_method(method);
// NOTE the difference in using sender_sp and
// interpreter_frame_sender_sp interpreter_frame_sender_sp is
// the original sp of the caller (the unextended_sp) and
// sender_sp is fp+8/16 (32bit/64bit) XXX
intptr_t* locals = interpreter_frame->sender_sp() + max_locals - 1;
#ifdef ASSERT
if (caller->is_interpreted_frame()) {
assert(locals < caller->fp() + frame::interpreter_frame_initial_sp_offset, "bad placement");
}
#endif
interpreter_frame->interpreter_frame_set_locals(locals);
BasicObjectLock* montop = interpreter_frame->interpreter_frame_monitor_begin();
BasicObjectLock* monbot = montop - moncount;
interpreter_frame->interpreter_frame_set_monitor_end(monbot);
// Set last_sp
intptr_t* esp = (intptr_t*) monbot -
tempcount*Interpreter::stackElementWords -
popframe_extra_args;
interpreter_frame->interpreter_frame_set_last_sp(esp);
// All frames but the initial (oldest) interpreter frame we fill in have
// a value for sender_sp that allows walking the stack but isn't
// truly correct. Correct the value here.
if (extra_locals != 0 &&
interpreter_frame->sender_sp() ==
interpreter_frame->interpreter_frame_sender_sp()) {
interpreter_frame->set_interpreter_frame_sender_sp(caller->sp() +
extra_locals);
}
*interpreter_frame->interpreter_frame_cache_addr() =
method->constants()->cache();
}
#endif // CC_INTERP

View File

@ -1287,7 +1287,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
// reset handle block
__ movptr(t, Address(thread, JavaThread::active_handles_offset()));
__ movptr(Address(t, JNIHandleBlock::top_offset_in_bytes()), NULL_WORD);
__ movl(Address(t, JNIHandleBlock::top_offset_in_bytes()), NULL_WORD);
// If result was an oop then unbox and save it in the frame
{ Label L;
@ -1686,91 +1686,6 @@ int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
return overhead_size + method_stack + stub_code;
}
// asm based interpreter deoptimization helpers
int AbstractInterpreter::layout_activation(Method* method,
int tempcount,
int popframe_extra_args,
int moncount,
int caller_actual_parameters,
int callee_param_count,
int callee_locals,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
// Note: This calculation must exactly parallel the frame setup
// in AbstractInterpreterGenerator::generate_method_entry.
// If interpreter_frame!=NULL, set up the method, locals, and monitors.
// The frame interpreter_frame, if not NULL, is guaranteed to be the right size,
// as determined by a previous call to this method.
// It is also guaranteed to be walkable even though it is in a skeletal state
// NOTE: return size is in words not bytes
// fixed size of an interpreter frame:
int max_locals = method->max_locals() * Interpreter::stackElementWords;
int extra_locals = (method->max_locals() - method->size_of_parameters()) *
Interpreter::stackElementWords;
int overhead = frame::sender_sp_offset - frame::interpreter_frame_initial_sp_offset;
// Our locals were accounted for by the caller (or last_frame_adjust on the transistion)
// Since the callee parameters already account for the callee's params we only need to account for
// the extra locals.
int size = overhead +
((callee_locals - callee_param_count)*Interpreter::stackElementWords) +
(moncount*frame::interpreter_frame_monitor_size()) +
tempcount*Interpreter::stackElementWords + popframe_extra_args;
if (interpreter_frame != NULL) {
#ifdef ASSERT
if (!EnableInvokeDynamic)
// @@@ FIXME: Should we correct interpreter_frame_sender_sp in the calling sequences?
// Probably, since deoptimization doesn't work yet.
assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable");
assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable(2)");
#endif
interpreter_frame->interpreter_frame_set_method(method);
// NOTE the difference in using sender_sp and interpreter_frame_sender_sp
// interpreter_frame_sender_sp is the original sp of the caller (the unextended_sp)
// and sender_sp is fp+8
intptr_t* locals = interpreter_frame->sender_sp() + max_locals - 1;
#ifdef ASSERT
if (caller->is_interpreted_frame()) {
assert(locals < caller->fp() + frame::interpreter_frame_initial_sp_offset, "bad placement");
}
#endif
interpreter_frame->interpreter_frame_set_locals(locals);
BasicObjectLock* montop = interpreter_frame->interpreter_frame_monitor_begin();
BasicObjectLock* monbot = montop - moncount;
interpreter_frame->interpreter_frame_set_monitor_end(monbot);
// Set last_sp
intptr_t* rsp = (intptr_t*) monbot -
tempcount*Interpreter::stackElementWords -
popframe_extra_args;
interpreter_frame->interpreter_frame_set_last_sp(rsp);
// All frames but the initial (oldest) interpreter frame we fill in have a
// value for sender_sp that allows walking the stack but isn't
// truly correct. Correct the value here.
if (extra_locals != 0 &&
interpreter_frame->sender_sp() == interpreter_frame->interpreter_frame_sender_sp() ) {
interpreter_frame->set_interpreter_frame_sender_sp(caller->sp() + extra_locals);
}
*interpreter_frame->interpreter_frame_cache_addr() =
method->constants()->cache();
}
return size;
}
//------------------------------------------------------------------------------------------------------------------------
// Exceptions

View File

@ -1259,7 +1259,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) {
// reset handle block
__ movptr(t, Address(r15_thread, JavaThread::active_handles_offset()));
__ movptr(Address(t, JNIHandleBlock::top_offset_in_bytes()), (int32_t)NULL_WORD);
__ movl(Address(t, JNIHandleBlock::top_offset_in_bytes()), (int32_t)NULL_WORD);
// If result is an oop unbox and store it in frame where gc will see it
// and result handler will pick it up
@ -1695,87 +1695,6 @@ int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
return (overhead_size + method_stack + stub_code);
}
int AbstractInterpreter::layout_activation(Method* method,
int tempcount,
int popframe_extra_args,
int moncount,
int caller_actual_parameters,
int callee_param_count,
int callee_locals,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
// Note: This calculation must exactly parallel the frame setup
// in AbstractInterpreterGenerator::generate_method_entry.
// If interpreter_frame!=NULL, set up the method, locals, and monitors.
// The frame interpreter_frame, if not NULL, is guaranteed to be the
// right size, as determined by a previous call to this method.
// It is also guaranteed to be walkable even though it is in a skeletal state
// fixed size of an interpreter frame:
int max_locals = method->max_locals() * Interpreter::stackElementWords;
int extra_locals = (method->max_locals() - method->size_of_parameters()) *
Interpreter::stackElementWords;
int overhead = frame::sender_sp_offset -
frame::interpreter_frame_initial_sp_offset;
// Our locals were accounted for by the caller (or last_frame_adjust
// on the transistion) Since the callee parameters already account
// for the callee's params we only need to account for the extra
// locals.
int size = overhead +
(callee_locals - callee_param_count)*Interpreter::stackElementWords +
moncount * frame::interpreter_frame_monitor_size() +
tempcount* Interpreter::stackElementWords + popframe_extra_args;
if (interpreter_frame != NULL) {
#ifdef ASSERT
if (!EnableInvokeDynamic)
// @@@ FIXME: Should we correct interpreter_frame_sender_sp in the calling sequences?
// Probably, since deoptimization doesn't work yet.
assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable");
assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable(2)");
#endif
interpreter_frame->interpreter_frame_set_method(method);
// NOTE the difference in using sender_sp and
// interpreter_frame_sender_sp interpreter_frame_sender_sp is
// the original sp of the caller (the unextended_sp) and
// sender_sp is fp+16 XXX
intptr_t* locals = interpreter_frame->sender_sp() + max_locals - 1;
#ifdef ASSERT
if (caller->is_interpreted_frame()) {
assert(locals < caller->fp() + frame::interpreter_frame_initial_sp_offset, "bad placement");
}
#endif
interpreter_frame->interpreter_frame_set_locals(locals);
BasicObjectLock* montop = interpreter_frame->interpreter_frame_monitor_begin();
BasicObjectLock* monbot = montop - moncount;
interpreter_frame->interpreter_frame_set_monitor_end(monbot);
// Set last_sp
intptr_t* esp = (intptr_t*) monbot -
tempcount*Interpreter::stackElementWords -
popframe_extra_args;
interpreter_frame->interpreter_frame_set_last_sp(esp);
// All frames but the initial (oldest) interpreter frame we fill in have
// a value for sender_sp that allows walking the stack but isn't
// truly correct. Correct the value here.
if (extra_locals != 0 &&
interpreter_frame->sender_sp() ==
interpreter_frame->interpreter_frame_sender_sp()) {
interpreter_frame->set_interpreter_frame_sender_sp(caller->sp() +
extra_locals);
}
*interpreter_frame->interpreter_frame_cache_addr() =
method->constants()->cache();
}
return size;
}
//-----------------------------------------------------------------------------
// Exceptions

View File

@ -512,14 +512,15 @@ void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
Compile* C = ra_->C;
int framesize = C->frame_slots() << LogBytesPerInt;
int framesize = C->frame_size_in_bytes();
int bangsize = C->bang_size_in_bytes();
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
// Remove wordSize for return addr which is already pushed.
framesize -= wordSize;
if (C->need_stack_bang(framesize)) {
if (C->need_stack_bang(bangsize)) {
framesize -= wordSize;
st->print("# stack bang");
st->print("# stack bang (%d bytes)", bangsize);
st->print("\n\t");
st->print("PUSH EBP\t# Save EBP");
if (framesize) {
@ -563,9 +564,10 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
Compile* C = ra_->C;
MacroAssembler _masm(&cbuf);
int framesize = C->frame_slots() << LogBytesPerInt;
int framesize = C->frame_size_in_bytes();
int bangsize = C->bang_size_in_bytes();
__ verified_entry(framesize, C->need_stack_bang(framesize), C->in_24_bit_fp_mode());
__ verified_entry(framesize, C->need_stack_bang(bangsize)?bangsize:0, C->in_24_bit_fp_mode());
C->set_frame_complete(cbuf.insts_size());
@ -589,7 +591,7 @@ int MachPrologNode::reloc() const {
#ifndef PRODUCT
void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream* st ) const {
Compile *C = ra_->C;
int framesize = C->frame_slots() << LogBytesPerInt;
int framesize = C->frame_size_in_bytes();
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
// Remove two words for return addr and rbp,
framesize -= 2*wordSize;
@ -629,7 +631,7 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
masm.fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std()));
}
int framesize = C->frame_slots() << LogBytesPerInt;
int framesize = C->frame_size_in_bytes();
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
// Remove two words for return addr and rbp,
framesize -= 2*wordSize;
@ -663,7 +665,7 @@ uint MachEpilogNode::size(PhaseRegAlloc *ra_) const {
if (C->max_vector_size() > 16) size += 3; // vzeroupper
if (do_polling() && C->is_method_compilation()) size += 6;
int framesize = C->frame_slots() << LogBytesPerInt;
int framesize = C->frame_size_in_bytes();
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
// Remove two words for return addr and rbp,
framesize -= 2*wordSize;

View File

@ -713,14 +713,15 @@ void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
Compile* C = ra_->C;
int framesize = C->frame_slots() << LogBytesPerInt;
int framesize = C->frame_size_in_bytes();
int bangsize = C->bang_size_in_bytes();
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
// Remove wordSize for return addr which is already pushed.
framesize -= wordSize;
if (C->need_stack_bang(framesize)) {
if (C->need_stack_bang(bangsize)) {
framesize -= wordSize;
st->print("# stack bang");
st->print("# stack bang (%d bytes)", bangsize);
st->print("\n\t");
st->print("pushq rbp\t# Save rbp");
if (framesize) {
@ -751,9 +752,10 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
Compile* C = ra_->C;
MacroAssembler _masm(&cbuf);
int framesize = C->frame_slots() << LogBytesPerInt;
int framesize = C->frame_size_in_bytes();
int bangsize = C->bang_size_in_bytes();
__ verified_entry(framesize, C->need_stack_bang(framesize), false);
__ verified_entry(framesize, C->need_stack_bang(bangsize)?bangsize:0, false);
C->set_frame_complete(cbuf.insts_size());
@ -786,7 +788,7 @@ void MachEpilogNode::format(PhaseRegAlloc* ra_, outputStream* st) const
st->cr(); st->print("\t");
}
int framesize = C->frame_slots() << LogBytesPerInt;
int framesize = C->frame_size_in_bytes();
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
// Remove word for return adr already pushed
// and RBP
@ -822,7 +824,7 @@ void MachEpilogNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const
__ vzeroupper();
}
int framesize = C->frame_slots() << LogBytesPerInt;
int framesize = C->frame_size_in_bytes();
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
// Remove word for return adr already pushed
// and RBP

View File

@ -916,17 +916,32 @@ InterpreterFrame *InterpreterFrame::build(int size, TRAPS) {
return (InterpreterFrame *) fp;
}
int AbstractInterpreter::layout_activation(Method* method,
int tempcount,
int popframe_extra_args,
int moncount,
int caller_actual_parameters,
int callee_param_count,
int callee_locals,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
int AbstractInterpreter::size_activation(int max_stack,
int tempcount,
int extra_args,
int moncount,
int callee_param_count,
int callee_locals,
bool is_top_frame) {
int header_words = InterpreterFrame::header_words;
int monitor_words = moncount * frame::interpreter_frame_monitor_size();
int stack_words = is_top_frame ? max_stack : tempcount;
int callee_extra_locals = callee_locals - callee_param_count;
return header_words + monitor_words + stack_words + callee_extra_locals;
}
void AbstractInterpreter::layout_activation(Method* method,
int tempcount,
int popframe_extra_args,
int moncount,
int caller_actual_parameters,
int callee_param_count,
int callee_locals,
frame* caller,
frame* interpreter_frame,
bool is_top_frame,
bool is_bottom_frame) {
assert(popframe_extra_args == 0, "what to do?");
assert(!is_top_frame || (!callee_locals && !callee_param_count),
"top frame should have no caller");
@ -935,39 +950,31 @@ int AbstractInterpreter::layout_activation(Method* method,
// does (the full InterpreterFrame::build, that is, not the
// one that creates empty frames for the deoptimizer).
//
// If interpreter_frame is not NULL then it will be filled in.
// It's size is determined by a previous call to this method,
// so it should be correct.
// interpreter_frame will be filled in. It's size is determined by
// a previous call to the size_activation() method,
//
// Note that tempcount is the current size of the expression
// stack. For top most frames we will allocate a full sized
// expression stack and not the trimmed version that non-top
// frames have.
int header_words = InterpreterFrame::header_words;
int monitor_words = moncount * frame::interpreter_frame_monitor_size();
int stack_words = is_top_frame ? method->max_stack() : tempcount;
int callee_extra_locals = callee_locals - callee_param_count;
intptr_t *locals = interpreter_frame->fp() + method->max_locals();
interpreterState istate = interpreter_frame->get_interpreterState();
intptr_t *monitor_base = (intptr_t*) istate;
intptr_t *stack_base = monitor_base - monitor_words;
intptr_t *stack = stack_base - tempcount - 1;
if (interpreter_frame) {
intptr_t *locals = interpreter_frame->fp() + method->max_locals();
interpreterState istate = interpreter_frame->get_interpreterState();
intptr_t *monitor_base = (intptr_t*) istate;
intptr_t *stack_base = monitor_base - monitor_words;
intptr_t *stack = stack_base - tempcount - 1;
BytecodeInterpreter::layout_interpreterState(istate,
caller,
NULL,
method,
locals,
stack,
stack_base,
monitor_base,
NULL,
is_top_frame);
}
return header_words + monitor_words + stack_words + callee_extra_locals;
BytecodeInterpreter::layout_interpreterState(istate,
caller,
NULL,
method,
locals,
stack,
stack_base,
monitor_base,
NULL,
is_top_frame);
}
void BytecodeInterpreter::layout_interpreterState(interpreterState istate,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2014 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -2811,18 +2811,13 @@ void os::yield() {
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
void os::yield_all(int attempts) {
void os::yield_all() {
// Yields to all threads, including threads with lower priorities
// Threads on Linux are all with same priority. The Solaris style
// os::yield_all() with nanosleep(1ms) is not necessary.
sched_yield();
}
// Called from the tight loops to possibly influence time-sharing heuristics
void os::loop_breaker(int attempts) {
os::yield_all(attempts);
}
////////////////////////////////////////////////////////////////////////////////
// thread priority support
@ -3079,7 +3074,7 @@ static bool do_suspend(OSThread* osthread) {
for (int n = 0; !osthread->sr.is_suspended(); n++) {
for (int i = 0; i < RANDOMLY_LARGE_INTEGER2 && !osthread->sr.is_suspended(); i++) {
os::yield_all(i);
os::yield_all();
}
// timeout, try to cancel the request
@ -3113,7 +3108,7 @@ static void do_resume(OSThread* osthread) {
if (sr_notify(osthread) == 0) {
for (int n = 0; n < RANDOMLY_LARGE_INTEGER && !osthread->sr.is_running(); n++) {
for (int i = 0; i < 100 && !osthread->sr.is_running(); i++) {
os::yield_all(i);
os::yield_all();
}
}
} else {

View File

@ -917,9 +917,20 @@ void os::free_thread(OSThread* osthread) {
//////////////////////////////////////////////////////////////////////////////
// thread local storage
// Restore the thread pointer if the destructor is called. This is in case
// someone from JNI code sets up a destructor with pthread_key_create to run
// detachCurrentThread on thread death. Unless we restore the thread pointer we
// will hang or crash. When detachCurrentThread is called the key will be set
// to null and we will not be called again. If detachCurrentThread is never
// called we could loop forever depending on the pthread implementation.
static void restore_thread_pointer(void* p) {
Thread* thread = (Thread*) p;
os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread);
}
int os::allocate_thread_local_storage() {
pthread_key_t key;
int rslt = pthread_key_create(&key, NULL);
int rslt = pthread_key_create(&key, restore_thread_pointer);
assert(rslt == 0, "cannot allocate thread local storage");
return (int)key;
}
@ -2551,18 +2562,13 @@ void os::yield() {
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN ;}
void os::yield_all(int attempts) {
void os::yield_all() {
// Yields to all threads, including threads with lower priorities
// Threads on Bsd are all with same priority. The Solaris style
// os::yield_all() with nanosleep(1ms) is not necessary.
sched_yield();
}
// Called from the tight loops to possibly influence time-sharing heuristics
void os::loop_breaker(int attempts) {
os::yield_all(attempts);
}
////////////////////////////////////////////////////////////////////////////////
// thread priority support

View File

@ -1032,9 +1032,20 @@ void os::free_thread(OSThread* osthread) {
//////////////////////////////////////////////////////////////////////////////
// thread local storage
// Restore the thread pointer if the destructor is called. This is in case
// someone from JNI code sets up a destructor with pthread_key_create to run
// detachCurrentThread on thread death. Unless we restore the thread pointer we
// will hang or crash. When detachCurrentThread is called the key will be set
// to null and we will not be called again. If detachCurrentThread is never
// called we could loop forever depending on the pthread implementation.
static void restore_thread_pointer(void* p) {
Thread* thread = (Thread*) p;
os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread);
}
int os::allocate_thread_local_storage() {
pthread_key_t key;
int rslt = pthread_key_create(&key, NULL);
int rslt = pthread_key_create(&key, restore_thread_pointer);
assert(rslt == 0, "cannot allocate thread local storage");
return (int)key;
}
@ -3781,18 +3792,13 @@ void os::yield() {
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN ;}
void os::yield_all(int attempts) {
void os::yield_all() {
// Yields to all threads, including threads with lower priorities
// Threads on Linux are all with same priority. The Solaris style
// os::yield_all() with nanosleep(1ms) is not necessary.
sched_yield();
}
// Called from the tight loops to possibly influence time-sharing heuristics
void os::loop_breaker(int attempts) {
os::yield_all(attempts);
}
////////////////////////////////////////////////////////////////////////////////
// thread priority support

View File

@ -29,6 +29,7 @@
#include "services/dtraceAttacher.hpp"
#include <door.h>
#include <limits.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
@ -668,11 +669,13 @@ static jint enable_dprobes(AttachOperation* op, outputStream* out) {
out->print_cr("No probe specified");
return JNI_ERR;
} else {
int probe_typess = atoi(probe);
if (errno) {
char *end;
long val = strtol(probe, &end, 10);
if (end == probe || val < 0 || val > INT_MAX) {
out->print_cr("invalid probe type");
return JNI_ERR;
} else {
int probe_typess = (int) val;
DTrace::enable_dprobes(probe_typess);
return JNI_OK;
}
@ -703,8 +706,9 @@ jint AttachListener::pd_set_flag(AttachOperation* op, outputStream* out) {
bool flag = true;
const char* arg1;
if ((arg1 = op->arg(1)) != NULL) {
flag = (atoi(arg1) != 0);
if (errno) {
char *end;
flag = (strtol(arg1, &end, 10) != 0);
if (arg1 == end) {
out->print_cr("flag value has to be an integer");
return JNI_ERR;
}

View File

@ -49,16 +49,6 @@ void OSThread::pd_destroy() {
// copied from synchronizer.cpp
void OSThread::handle_spinlock_contention(int tries) {
if (NoYieldsInMicrolock) return;
if (tries > 10) {
os::yield_all(tries); // Yield to threads of any priority
} else if (tries > 5) {
os::yield(); // Yield to threads of same or higher priority
}
}
void OSThread::SR_handler(Thread* thread, ucontext_t* uc) {
os::Solaris::SR_handler(thread, uc);
}

View File

@ -82,8 +82,6 @@
void set_ucontext(ucontext_t* ptr) { _ucontext = ptr; }
static void SR_handler(Thread* thread, ucontext_t* uc);
static void handle_spinlock_contention(int tries); // Used for thread local eden locking
// ***************************************************************
// Platform dependent initialization and cleanup
// ***************************************************************

View File

@ -969,9 +969,6 @@ bool os::create_main_thread(JavaThread* thread) {
return true;
}
// _T2_libthread is true if we believe we are running with the newer
// SunSoft lwp/libthread.so (2.8 patch, 2.9 default)
bool os::Solaris::_T2_libthread = false;
bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) {
// Allocate the OSThread object
@ -1056,71 +1053,10 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) {
thread->set_osthread(osthread);
// Create the Solaris thread
// explicit THR_BOUND for T2_libthread case in case
// that assumption is not accurate, but our alternate signal stack
// handling is based on it which must have bound threads
thread_t tid = 0;
long flags = (UseDetachedThreads ? THR_DETACHED : 0) | THR_SUSPENDED
| ((UseBoundThreads || os::Solaris::T2_libthread() ||
(thr_type == vm_thread) ||
(thr_type == cgc_thread) ||
(thr_type == pgc_thread) ||
(thr_type == compiler_thread && BackgroundCompilation)) ?
THR_BOUND : 0);
long flags = (UseDetachedThreads ? THR_DETACHED : 0) | THR_SUSPENDED;
int status;
// 4376845 -- libthread/kernel don't provide enough LWPs to utilize all CPUs.
//
// On multiprocessors systems, libthread sometimes under-provisions our
// process with LWPs. On a 30-way systems, for instance, we could have
// 50 user-level threads in ready state and only 2 or 3 LWPs assigned
// to our process. This can result in under utilization of PEs.
// I suspect the problem is related to libthread's LWP
// pool management and to the kernel's SIGBLOCKING "last LWP parked"
// upcall policy.
//
// The following code is palliative -- it attempts to ensure that our
// process has sufficient LWPs to take advantage of multiple PEs.
// Proper long-term cures include using user-level threads bound to LWPs
// (THR_BOUND) or using LWP-based synchronization. Note that there is a
// slight timing window with respect to sampling _os_thread_count, but
// the race is benign. Also, we should periodically recompute
// _processors_online as the min of SC_NPROCESSORS_ONLN and the
// the number of PEs in our partition. You might be tempted to use
// THR_NEW_LWP here, but I'd recommend against it as that could
// result in undesirable growth of the libthread's LWP pool.
// The fix below isn't sufficient; for instance, it doesn't take into count
// LWPs parked on IO. It does, however, help certain CPU-bound benchmarks.
//
// Some pathologies this scheme doesn't handle:
// * Threads can block, releasing the LWPs. The LWPs can age out.
// When a large number of threads become ready again there aren't
// enough LWPs available to service them. This can occur when the
// number of ready threads oscillates.
// * LWPs/Threads park on IO, thus taking the LWP out of circulation.
//
// Finally, we should call thr_setconcurrency() periodically to refresh
// the LWP pool and thwart the LWP age-out mechanism.
// The "+3" term provides a little slop -- we want to slightly overprovision.
if (AdjustConcurrency && os::Solaris::_os_thread_count < (_processors_online+3)) {
if (!(flags & THR_BOUND)) {
thr_setconcurrency (os::Solaris::_os_thread_count); // avoid starvation
}
}
// Although this doesn't hurt, we should warn of undefined behavior
// when using unbound T1 threads with schedctl(). This should never
// happen, as the compiler and VM threads are always created bound
DEBUG_ONLY(
if ((VMThreadHintNoPreempt || CompilerThreadHintNoPreempt) &&
(!os::Solaris::T2_libthread() && (!(flags & THR_BOUND))) &&
((thr_type == vm_thread) || (thr_type == cgc_thread) ||
(thr_type == pgc_thread) || (thr_type == compiler_thread && BackgroundCompilation))) {
warning("schedctl behavior undefined when Compiler/VM/GC Threads are Unbound");
}
);
// Mark that we don't have an lwp or thread id yet.
// In case we attempt to set the priority before the thread starts.
osthread->set_lwp_id(-1);
@ -1145,13 +1081,6 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, size_t stack_size) {
// Remember that we created this thread so we can set priority on it
osthread->set_vm_created();
// Set the default thread priority. If using bound threads, setting
// lwp priority will be delayed until thread start.
set_native_priority(thread,
DefaultThreadPriority == -1 ?
java_to_os_priority[NormPriority] :
DefaultThreadPriority);
// Initial thread state is INITIALIZED, not SUSPENDED
osthread->set_state(INITIALIZED);
@ -1333,39 +1262,8 @@ void os::initialize_thread(Thread* thr) {
jt->set_stack_size(stack_size);
}
// 5/22/01: Right now alternate signal stacks do not handle
// throwing stack overflow exceptions, see bug 4463178
// Until a fix is found for this, T2 will NOT imply alternate signal
// stacks.
// If using T2 libthread threads, install an alternate signal stack.
// Because alternate stacks associate with LWPs on Solaris,
// see sigaltstack(2), if using UNBOUND threads, or if UseBoundThreads
// we prefer to explicitly stack bang.
// If not using T2 libthread, but using UseBoundThreads any threads
// (primordial thread, jni_attachCurrentThread) we do not create,
// probably are not bound, therefore they can not have an alternate
// signal stack. Since our stack banging code is generated and
// is shared across threads, all threads must be bound to allow
// using alternate signal stacks. The alternative is to interpose
// on _lwp_create to associate an alt sig stack with each LWP,
// and this could be a problem when the JVM is embedded.
// We would prefer to use alternate signal stacks with T2
// Since there is currently no accurate way to detect T2
// we do not. Assuming T2 when running T1 causes sig 11s or assertions
// on installing alternate signal stacks
// 05/09/03: removed alternate signal stack support for Solaris
// The alternate signal stack mechanism is no longer needed to
// handle stack overflow. This is now handled by allocating
// guard pages (red zone) and stackbanging.
// Initially the alternate signal stack mechanism was removed because
// it did not work with T1 llibthread. Alternate
// signal stacks MUST have all threads bound to lwps. Applications
// can create their own threads and attach them without their being
// bound under T1. This is frequently the case for the primordial thread.
// If we were ever to reenable this mechanism we would need to
// use the dynamic check for T2 libthread.
// With the T2 libthread (T1 is no longer supported) threads are always bound
// and we use stackbanging in all cases.
os::Solaris::init_thread_fpu_state();
std::set_terminate(_handle_uncaught_cxx_exception);
@ -2092,12 +1990,7 @@ void os::Solaris::print_distro_info(outputStream* st) {
}
void os::Solaris::print_libversion_info(outputStream* st) {
if (os::Solaris::T2_libthread()) {
st->print(" (T2 libthread)");
}
else {
st->print(" (T1 libthread)");
}
st->print(" (T2 libthread)");
st->cr();
}
@ -3323,48 +3216,20 @@ void os::yield() {
os::YieldResult os::NakedYield() { thr_yield(); return os::YIELD_UNKNOWN; }
// On Solaris we found that yield_all doesn't always yield to all other threads.
// There have been cases where there is a thread ready to execute but it doesn't
// get an lwp as the VM thread continues to spin with sleeps of 1 millisecond.
// The 1 millisecond wait doesn't seem long enough for the kernel to issue a
// SIGWAITING signal which will cause a new lwp to be created. So we count the
// number of times yield_all is called in the one loop and increase the sleep
// time after 8 attempts. If this fails too we increase the concurrency level
// so that the starving thread would get an lwp
void os::yield_all(int attempts) {
void os::yield_all() {
// Yields to all threads, including threads with lower priorities
if (attempts == 0) {
os::sleep(Thread::current(), 1, false);
} else {
int iterations = attempts % 30;
if (iterations == 0 && !os::Solaris::T2_libthread()) {
// thr_setconcurrency and _getconcurrency make sense only under T1.
int noofLWPS = thr_getconcurrency();
if (noofLWPS < (Threads::number_of_threads() + 2)) {
thr_setconcurrency(thr_getconcurrency() + 1);
}
} else if (iterations < 25) {
os::sleep(Thread::current(), 1, false);
} else {
os::sleep(Thread::current(), 10, false);
}
}
os::sleep(Thread::current(), 1, false);
}
// Called from the tight loops to possibly influence time-sharing heuristics
void os::loop_breaker(int attempts) {
os::yield_all(attempts);
}
// Interface for setting lwp priorities. If we are using T2 libthread,
// which forces the use of BoundThreads or we manually set UseBoundThreads,
// all of our threads will be assigned to real lwp's. Using the thr_setprio
// function is meaningless in this mode so we must adjust the real lwp's priority
// The routines below implement the getting and setting of lwp priorities.
//
// Note: T2 is now the only supported libthread. UseBoundThreads flag is
// being deprecated and all threads are now BoundThreads
//
// Note: There are three priority scales used on Solaris. Java priotities
// which range from 1 to 10, libthread "thr_setprio" scale which range
// from 0 to 127, and the current scheduling class of the process we
@ -3437,29 +3302,19 @@ static int lwp_priocntl_init () {
if (!UseThreadPriorities) return 0;
// We are using Bound threads, we need to determine our priority ranges
if (os::Solaris::T2_libthread() || UseBoundThreads) {
// If ThreadPriorityPolicy is 1, switch tables
if (ThreadPriorityPolicy == 1) {
for (i = 0 ; i < CriticalPriority+1; i++)
os::java_to_os_priority[i] = prio_policy1[i];
}
if (UseCriticalJavaThreadPriority) {
// MaxPriority always maps to the FX scheduling class and criticalPrio.
// See set_native_priority() and set_lwp_class_and_priority().
// Save original MaxPriority mapping in case attempt to
// use critical priority fails.
java_MaxPriority_to_os_priority = os::java_to_os_priority[MaxPriority];
// Set negative to distinguish from other priorities
os::java_to_os_priority[MaxPriority] = -criticalPrio;
}
}
// Not using Bound Threads, set to ThreadPolicy 1
else {
for ( i = 0 ; i < CriticalPriority+1; i++ ) {
// If ThreadPriorityPolicy is 1, switch tables
if (ThreadPriorityPolicy == 1) {
for (i = 0 ; i < CriticalPriority+1; i++)
os::java_to_os_priority[i] = prio_policy1[i];
}
return 0;
}
if (UseCriticalJavaThreadPriority) {
// MaxPriority always maps to the FX scheduling class and criticalPrio.
// See set_native_priority() and set_lwp_class_and_priority().
// Save original MaxPriority mapping in case attempt to
// use critical priority fails.
java_MaxPriority_to_os_priority = os::java_to_os_priority[MaxPriority];
// Set negative to distinguish from other priorities
os::java_to_os_priority[MaxPriority] = -criticalPrio;
}
// Get IDs for a set of well-known scheduling classes.
@ -3583,10 +3438,6 @@ int scale_to_lwp_priority (int rMin, int rMax, int x)
// set_lwp_class_and_priority
//
// Set the class and priority of the lwp. This call should only
// be made when using bound threads (T2 threads are bound by default).
//
int set_lwp_class_and_priority(int ThreadID, int lwpid,
int newPrio, int new_class, bool scale) {
int rslt;
@ -3812,23 +3663,20 @@ OSReturn os::set_native_priority(Thread* thread, int newpri) {
status = thr_setprio(thread->osthread()->thread_id(), newpri);
}
if (os::Solaris::T2_libthread() ||
(UseBoundThreads && osthread->is_vm_created())) {
int lwp_status =
set_lwp_class_and_priority(osthread->thread_id(),
osthread->lwp_id(),
newpri,
fxcritical ? fxLimits.schedPolicy : myClass,
!fxcritical);
if (lwp_status != 0 && fxcritical) {
// Try again, this time without changing the scheduling class
newpri = java_MaxPriority_to_os_priority;
lwp_status = set_lwp_class_and_priority(osthread->thread_id(),
osthread->lwp_id(),
newpri, myClass, false);
}
status |= lwp_status;
int lwp_status =
set_lwp_class_and_priority(osthread->thread_id(),
osthread->lwp_id(),
newpri,
fxcritical ? fxLimits.schedPolicy : myClass,
!fxcritical);
if (lwp_status != 0 && fxcritical) {
// Try again, this time without changing the scheduling class
newpri = java_MaxPriority_to_os_priority;
lwp_status = set_lwp_class_and_priority(osthread->thread_id(),
osthread->lwp_id(),
newpri, myClass, false);
}
status |= lwp_status;
return (status == 0) ? OS_OK : OS_ERR;
}
@ -4495,13 +4343,6 @@ const char* os::exception_name(int exception_code, char* buf, size_t size) {
}
}
// (Static) wrappers for the new libthread API
int_fnP_thread_t_iP_uP_stack_tP_gregset_t os::Solaris::_thr_getstate;
int_fnP_thread_t_i_gregset_t os::Solaris::_thr_setstate;
int_fnP_thread_t_i os::Solaris::_thr_setmutator;
int_fnP_thread_t os::Solaris::_thr_suspend_mutator;
int_fnP_thread_t os::Solaris::_thr_continue_mutator;
// (Static) wrapper for getisax(2) call.
os::Solaris::getisax_func_t os::Solaris::_getisax = 0;
@ -4536,78 +4377,9 @@ static address resolve_symbol(const char* name) {
return addr;
}
// isT2_libthread()
//
// Routine to determine if we are currently using the new T2 libthread.
//
// We determine if we are using T2 by reading /proc/self/lstatus and
// looking for a thread with the ASLWP bit set. If we find this status
// bit set, we must assume that we are NOT using T2. The T2 team
// has approved this algorithm.
//
// We need to determine if we are running with the new T2 libthread
// since setting native thread priorities is handled differently
// when using this library. All threads created using T2 are bound
// threads. Calling thr_setprio is meaningless in this case.
//
bool isT2_libthread() {
static prheader_t * lwpArray = NULL;
static int lwpSize = 0;
static int lwpFile = -1;
lwpstatus_t * that;
char lwpName [128];
bool isT2 = false;
#define ADR(x) ((uintptr_t)(x))
#define LWPINDEX(ary,ix) ((lwpstatus_t *)(((ary)->pr_entsize * (ix)) + (ADR((ary) + 1))))
lwpFile = ::open("/proc/self/lstatus", O_RDONLY, 0);
if (lwpFile < 0) {
if (ThreadPriorityVerbose) warning ("Couldn't open /proc/self/lstatus\n");
return false;
}
lwpSize = 16*1024;
for (;;) {
::lseek64 (lwpFile, 0, SEEK_SET);
lwpArray = (prheader_t *)NEW_C_HEAP_ARRAY(char, lwpSize, mtInternal);
if (::read(lwpFile, lwpArray, lwpSize) < 0) {
if (ThreadPriorityVerbose) warning("Error reading /proc/self/lstatus\n");
break;
}
if ((lwpArray->pr_nent * lwpArray->pr_entsize) <= lwpSize) {
// We got a good snapshot - now iterate over the list.
int aslwpcount = 0;
for (int i = 0; i < lwpArray->pr_nent; i++ ) {
that = LWPINDEX(lwpArray,i);
if (that->pr_flags & PR_ASLWP) {
aslwpcount++;
}
}
if (aslwpcount == 0) isT2 = true;
break;
}
lwpSize = lwpArray->pr_nent * lwpArray->pr_entsize;
FREE_C_HEAP_ARRAY(char, lwpArray, mtInternal); // retry.
}
FREE_C_HEAP_ARRAY(char, lwpArray, mtInternal);
::close (lwpFile);
if (ThreadPriorityVerbose) {
if (isT2) tty->print_cr("We are running with a T2 libthread\n");
else tty->print_cr("We are not running with a T2 libthread\n");
}
return isT2;
}
void os::Solaris::libthread_init() {
address func = (address)dlsym(RTLD_DEFAULT, "_thr_suspend_allmutators");
// Determine if we are running with the new T2 libthread
os::Solaris::set_T2_libthread(isT2_libthread());
lwp_priocntl_init();
// RTLD_DEFAULT was not defined on some early versions of 5.5.1
@ -4618,22 +4390,6 @@ void os::Solaris::libthread_init() {
guarantee(func != NULL, "libthread.so is too old.");
}
// Initialize the new libthread getstate API wrappers
func = resolve_symbol("thr_getstate");
os::Solaris::set_thr_getstate(CAST_TO_FN_PTR(int_fnP_thread_t_iP_uP_stack_tP_gregset_t, func));
func = resolve_symbol("thr_setstate");
os::Solaris::set_thr_setstate(CAST_TO_FN_PTR(int_fnP_thread_t_i_gregset_t, func));
func = resolve_symbol("thr_setmutator");
os::Solaris::set_thr_setmutator(CAST_TO_FN_PTR(int_fnP_thread_t_i, func));
func = resolve_symbol("thr_suspend_mutator");
os::Solaris::set_thr_suspend_mutator(CAST_TO_FN_PTR(int_fnP_thread_t, func));
func = resolve_symbol("thr_continue_mutator");
os::Solaris::set_thr_continue_mutator(CAST_TO_FN_PTR(int_fnP_thread_t, func));
int size;
void (*handler_info_func)(address *, int *);
handler_info_func = CAST_TO_FN_PTR(void (*)(address *, int *), resolve_symbol("thr_sighndlrinfo"));
@ -5536,11 +5292,7 @@ void os::thread_cpu_time_info(jvmtiTimerInfo *info_ptr) {
}
bool os::is_thread_cpu_time_supported() {
if ( os::Solaris::T2_libthread() || UseBoundThreads ) {
return true;
} else {
return false;
}
return true;
}
// System loadavg support. Returns -1 if load average cannot be obtained.

View File

@ -41,19 +41,6 @@ class Solaris {
#define TRS_LWPID 2
#define TRS_INVALID 3
// _T2_libthread is true if we believe we are running with the newer
// SunSoft lib/lwp/libthread: default Solaris 9, available Solaris 8
// which is a lightweight libthread that also supports all T1
static bool _T2_libthread;
// These refer to new libthread interface functions
// They get intialized if we dynamically detect new libthread
static int_fnP_thread_t_iP_uP_stack_tP_gregset_t _thr_getstate;
static int_fnP_thread_t_i_gregset_t _thr_setstate;
static int_fnP_thread_t_i _thr_setmutator;
static int_fnP_thread_t _thr_suspend_mutator;
static int_fnP_thread_t _thr_continue_mutator;
// libthread_init sets the above, if the new functionality is detected
// initialized to libthread or lwp synchronization primitives depending on UseLWPSychronization
static int_fnP_mutex_tP _mutex_lock;
static int_fnP_mutex_tP _mutex_trylock;
@ -214,29 +201,6 @@ class Solaris {
static struct sigaction *get_chained_signal_action(int sig);
static bool chained_handler(int sig, siginfo_t *siginfo, void *context);
// The following allow us to link against both the old and new libthread (2.8)
// and exploit the new libthread functionality if available.
static bool T2_libthread() { return _T2_libthread; }
static void set_T2_libthread(bool T2_libthread) { _T2_libthread = T2_libthread; }
static int thr_getstate(thread_t tid, int *flag, unsigned *lwp, stack_t *ss, gregset_t rs)
{ return _thr_getstate(tid, flag, lwp, ss, rs); }
static void set_thr_getstate(int_fnP_thread_t_iP_uP_stack_tP_gregset_t func)
{ _thr_getstate = func; }
static int thr_setstate(thread_t tid, int flag, gregset_t rs) { return _thr_setstate(tid, flag, rs); }
static void set_thr_setstate(int_fnP_thread_t_i_gregset_t func) { _thr_setstate = func; }
static int thr_setmutator(thread_t tid, int enabled) { return _thr_setmutator(tid, enabled); }
static void set_thr_setmutator(int_fnP_thread_t_i func) { _thr_setmutator = func; }
static int thr_suspend_mutator(thread_t tid) { return _thr_suspend_mutator(tid); }
static void set_thr_suspend_mutator(int_fnP_thread_t func) { _thr_suspend_mutator = func; }
static int thr_continue_mutator(thread_t tid) { return _thr_continue_mutator(tid); }
static void set_thr_continue_mutator(int_fnP_thread_t func) { _thr_continue_mutator = func; }
// Allows us to switch between lwp and thread -based synchronization
static int mutex_lock(mutex_t *mx) { return _mutex_lock(mx); }
static int mutex_trylock(mutex_t *mx) { return _mutex_trylock(mx); }

View File

@ -3518,7 +3518,7 @@ os::YieldResult os::NakedYield() {
void os::yield() { os::NakedYield(); }
void os::yield_all(int attempts) {
void os::yield_all() {
// Yields to all threads, including threads with lower priorities
Sleep(1);
}
@ -3864,12 +3864,6 @@ void os::init(void) {
win32::setmode_streams();
init_page_sizes((size_t) win32::vm_page_size());
// For better scalability on MP systems (must be called after initialize_system_info)
#ifndef PRODUCT
if (is_MP()) {
NoYieldsInMicrolock = true;
}
#endif
// This may be overridden later when argument processing is done.
FLAG_SET_ERGO(bool, UseLargePagesIndividualAllocation,
os::win32::is_windows_2003());

View File

@ -52,9 +52,6 @@ inline void* os::dll_lookup(void *lib, const char *name) {
return (void*)::GetProcAddress((HMODULE)lib, name);
}
// Used to improve time-sharing on some systems
inline void os::loop_breaker(int attempts) {}
inline bool os::obsolete_option(const JavaVMOption *option) {
return false;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -270,31 +270,6 @@ frame os::current_frame() {
}
}
static int threadgetstate(thread_t tid, int *flags, lwpid_t *lwp, stack_t *ss, gregset_t rs, lwpstatus_t *lwpstatus) {
char lwpstatusfile[PROCFILE_LENGTH];
int lwpfd, err;
if (err = os::Solaris::thr_getstate(tid, flags, lwp, ss, rs))
return (err);
if (*flags == TRS_LWPID) {
sprintf(lwpstatusfile, "/proc/%d/lwp/%d/lwpstatus", getpid(),
*lwp);
if ((lwpfd = ::open(lwpstatusfile, O_RDONLY)) < 0) {
perror("thr_mutator_status: open lwpstatus");
return (EINVAL);
}
if (pread(lwpfd, lwpstatus, sizeof (lwpstatus_t), (off_t)0) !=
sizeof (lwpstatus_t)) {
perror("thr_mutator_status: read lwpstatus");
(void) ::close(lwpfd);
return (EINVAL);
}
(void) ::close(lwpfd);
}
return (0);
}
bool os::is_allocatable(size_t bytes) {
#ifdef _LP64
return true;

View File

@ -256,30 +256,6 @@ frame os::current_frame() {
}
}
static int threadgetstate(thread_t tid, int *flags, lwpid_t *lwp, stack_t *ss, gregset_t rs, lwpstatus_t *lwpstatus) {
char lwpstatusfile[PROCFILE_LENGTH];
int lwpfd, err;
if (err = os::Solaris::thr_getstate(tid, flags, lwp, ss, rs))
return (err);
if (*flags == TRS_LWPID) {
sprintf(lwpstatusfile, "/proc/%d/lwp/%d/lwpstatus", getpid(),
*lwp);
if ((lwpfd = open(lwpstatusfile, O_RDONLY)) < 0) {
perror("thr_mutator_status: open lwpstatus");
return (EINVAL);
}
if (pread(lwpfd, lwpstatus, sizeof (lwpstatus_t), (off_t)0) !=
sizeof (lwpstatus_t)) {
perror("thr_mutator_status: read lwpstatus");
(void) close(lwpfd);
return (EINVAL);
}
(void) close(lwpfd);
}
return (0);
}
#ifndef AMD64
// Detecting SSE support by OS

View File

@ -25,6 +25,7 @@
package com.sun.hotspot.tools.compiler;
import java.io.PrintStream;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.List;
@ -40,6 +41,7 @@ public class CallSite {
private int endNodes;
private int endLiveNodes;
private double timeStamp;
private long inlineId;
CallSite() {
}
@ -94,7 +96,7 @@ public class CallSite {
public void print(PrintStream stream, int indent) {
emit(stream, indent);
String m = getMethod().getHolder().replace('/', '.') + "::" + getMethod().getName();
String m = getMethod().getHolder() + "::" + getMethod().getName();
if (getReason() == null) {
stream.print(" @ " + getBci() + " " + m + " (" + getMethod().getBytes() + " bytes)");
@ -214,4 +216,45 @@ public class CallSite {
return timeStamp;
}
private boolean matches(CallSite other) {
// Every late inline call site has a unique inline id. If the
// call site we're looking for has one then use it other rely
// on method name and bci.
if (other.inlineId != 0) {
return inlineId == other.inlineId;
}
return method.equals(other.method) && bci == other.bci;
}
public CallSite findCallSite(ArrayDeque<CallSite> sites) {
// Locate a late inline call site. Multiple chains of
// identical call sites with the same method name/bci are
// possible so we have to try them all until we find the late
// inline call site that has a matching inline id.
CallSite site = sites.pop();
for (CallSite c : calls) {
if (c.matches(site)) {
if (!sites.isEmpty()) {
CallSite res = c.findCallSite(sites);
if (res != null) {
sites.push(site);
return res;
}
} else {
sites.push(site);
return c;
}
}
}
sites.push(site);
return null;
}
public long getInlineId() {
return inlineId;
}
public void setInlineId(long inlineId) {
this.inlineId = inlineId;
}
}

View File

@ -31,6 +31,7 @@ package com.sun.hotspot.tools.compiler;
import java.io.FileReader;
import java.io.Reader;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@ -144,9 +145,12 @@ public class LogParser extends DefaultHandler implements ErrorHandler, Constants
private Stack<CallSite> scopes = new Stack<CallSite>();
private Compilation compile;
private CallSite site;
private CallSite methodHandleSite;
private Stack<Phase> phaseStack = new Stack<Phase>();
private UncommonTrapEvent currentTrap;
private Stack<CallSite> late_inline_scope;
private Stack<CallSite> lateInlineScope;
private boolean lateInlining;
long parseLong(String l) {
try {
@ -330,18 +334,61 @@ public class LogParser extends DefaultHandler implements ErrorHandler, Constants
}
methods.put(id, m);
} else if (qname.equals("call")) {
site = new CallSite(bci, method(search(atts, "method")));
if (methodHandleSite != null) {
methodHandleSite = null;
}
Method m = method(search(atts, "method"));
if (lateInlining && scopes.size() == 0) {
// re-attempting already seen call site (late inlining for MH invokes)
if (m != site.getMethod()) {
if (bci != site.getBci()) {
System.out.println(m + " bci: " + bci);
System.out.println(site.getMethod() + " bci: " + site.getBci());
throw new InternalError("bci mismatch after late inlining");
}
site.setMethod(m);
}
} else {
site = new CallSite(bci, m);
}
site.setCount(Integer.parseInt(search(atts, "count", "0")));
String receiver = atts.getValue("receiver");
if (receiver != null) {
site.setReceiver(type(receiver));
site.setReceiver_count(Integer.parseInt(search(atts, "receiver_count")));
}
scopes.peek().add(site);
int methodHandle = Integer.parseInt(search(atts, "method_handle_intrinsic", "0"));
if (lateInlining && scopes.size() == 0) {
// The call was added before this round of late inlining
} else if (methodHandle == 0) {
scopes.peek().add(site);
} else {
// method handle call site can be followed by another
// call (in case it is inlined). If that happens we
// discard the method handle call site. So we keep
// track of it but don't add it to the list yet.
methodHandleSite = site;
}
} else if (qname.equals("regalloc")) {
compile.setAttempts(Integer.parseInt(search(atts, "attempts")));
} else if (qname.equals("inline_fail")) {
scopes.peek().last().setReason(search(atts, "reason"));
if (methodHandleSite != null) {
scopes.peek().add(methodHandleSite);
methodHandleSite = null;
}
if (lateInlining && scopes.size() == 0) {
site.setReason(search(atts, "reason"));
lateInlining = false;
} else {
scopes.peek().last().setReason(search(atts, "reason"));
}
} else if (qname.equals("inline_success")) {
if (methodHandleSite != null) {
throw new InternalError("method handle site should have been replaced");
}
if (lateInlining && scopes.size() == 0) {
site.setReason(null);
}
} else if (qname.equals("failure")) {
failureReason = search(atts, "reason");
} else if (qname.equals("task_done")) {
@ -371,22 +418,30 @@ public class LogParser extends DefaultHandler implements ErrorHandler, Constants
// ignore for now
}
} else if (qname.equals("late_inline")) {
late_inline_scope = new Stack<CallSite>();
long inlineId = Long.parseLong(search(atts, "inline_id"));
lateInlineScope = new Stack<CallSite>();
site = new CallSite(-999, method(search(atts, "method")));
late_inline_scope.push(site);
site.setInlineId(inlineId);
lateInlineScope.push(site);
} else if (qname.equals("jvms")) {
// <jvms bci='4' method='java/io/DataInputStream readChar ()C' bytes='40' count='5815' iicount='20815'/>
if (currentTrap != null) {
currentTrap.addJVMS(atts.getValue("method"), Integer.parseInt(atts.getValue("bci")));
} else if (late_inline_scope != null) {
} else if (lateInlineScope != null) {
bci = Integer.parseInt(search(atts, "bci"));
site = new CallSite(bci, method(search(atts, "method")));
late_inline_scope.push(site);
lateInlineScope.push(site);
} else {
// Ignore <eliminate_allocation type='667'>,
// <eliminate_lock lock='1'>,
// <replace_string_concat arguments='2' string_alloc='0' multiple='0'>
}
} else if (qname.equals("inline_id")) {
if (methodHandleSite != null) {
throw new InternalError("method handle site should have been replaced");
}
long id = Long.parseLong(search(atts, "id"));
site.setInlineId(id);
} else if (qname.equals("nmethod")) {
String id = makeId(atts);
NMethod nm = new NMethod(Double.parseDouble(search(atts, "stamp")),
@ -396,8 +451,18 @@ public class LogParser extends DefaultHandler implements ErrorHandler, Constants
nmethods.put(id, nm);
events.add(nm);
} else if (qname.equals("parse")) {
if (methodHandleSite != null) {
throw new InternalError("method handle site should have been replaced");
}
Method m = method(search(atts, "method"));
if (scopes.size() == 0) {
if (lateInlining && scopes.size() == 0) {
if (site.getMethod() != m) {
System.out.println(site.getMethod());
System.out.println(m);
throw new InternalError("Unexpected method mismatch during late inlining");
}
}
if (scopes.size() == 0 && !lateInlining) {
compile.setMethod(m);
scopes.push(site);
} else {
@ -427,14 +492,19 @@ public class LogParser extends DefaultHandler implements ErrorHandler, Constants
if (qname.equals("parse")) {
indent -= 2;
scopes.pop();
if (scopes.size() == 0) {
lateInlining = false;
}
} else if (qname.equals("uncommon_trap")) {
currentTrap = null;
} else if (qname.equals("late_inline")) {
// Populate late inlining info.
// late_inline scopes are specified in reverse order:
if (scopes.size() != 0) {
throw new InternalError("scopes should be empty for late inline");
}
// late inline scopes are specified in reverse order:
// compiled method should be on top of stack.
CallSite caller = late_inline_scope.pop();
CallSite caller = lateInlineScope.pop();
Method m = compile.getMethod();
if (m != caller.getMethod()) {
System.out.println(m);
@ -444,28 +514,42 @@ public class LogParser extends DefaultHandler implements ErrorHandler, Constants
// late_inline contains caller+bci info, convert it
// to bci+callee info used by LogCompilation.
site = compile.getLateInlineCall();
CallSite lateInlineSite = compile.getLateInlineCall();
ArrayDeque<CallSite> thisCallScopes = new ArrayDeque<CallSite>();
do {
bci = caller.getBci();
// Next inlined call.
caller = late_inline_scope.pop();
caller = lateInlineScope.pop();
CallSite callee = new CallSite(bci, caller.getMethod());
site.add(callee);
site = callee;
} while (!late_inline_scope.empty());
callee.setInlineId(caller.getInlineId());
thisCallScopes.addLast(callee);
lateInlineSite.add(callee);
lateInlineSite = callee;
} while (!lateInlineScope.empty());
site = compile.getCall().findCallSite(thisCallScopes);
if (site == null) {
System.out.println(caller.getMethod() + " bci: " + bci);
throw new InternalError("couldn't find call site");
}
lateInlining = true;
if (caller.getBci() != -999) {
System.out.println(caller.getMethod());
throw new InternalError("broken late_inline info");
}
if (site.getMethod() != caller.getMethod()) {
System.out.println(site.getMethod());
System.out.println(caller.getMethod());
throw new InternalError("call site and late_inline info don't match");
if (site.getInlineId() == caller.getInlineId()) {
site.setMethod(caller.getMethod());
} else {
System.out.println(site.getMethod());
System.out.println(caller.getMethod());
throw new InternalError("call site and late_inline info don't match");
}
}
// late_inline is followed by parse with scopes.size() == 0,
// 'site' will be pushed to scopes.
late_inline_scope = null;
lateInlineScope = null;
} else if (qname.equals("task")) {
types.clear();
methods.clear();

View File

@ -51,15 +51,15 @@ public class Method implements Constants {
String format(int osr_bci) {
if (osr_bci >= 0) {
return getHolder().replace('/', '.') + "::" + getName() + " @ " + osr_bci + " (" + getBytes() + " bytes)";
return getHolder() + "::" + getName() + " @ " + osr_bci + " (" + getBytes() + " bytes)";
} else {
return getHolder().replace('/', '.') + "::" + getName() + " (" + getBytes() + " bytes)";
return getHolder() + "::" + getName() + " (" + getBytes() + " bytes)";
}
}
@Override
public String toString() {
return getHolder().replace('/', '.') + "::" + getName() + " (" + getBytes() + " bytes)";
return getHolder() + "::" + getName() + " (" + getBytes() + " bytes)";
}
public String getHolder() {
@ -117,4 +117,14 @@ public class Method implements Constants {
public void setFlags(String flags) {
this.flags = flags;
}
@Override
public boolean equals(Object o) {
if (o instanceof Method) {
Method other = (Method)o;
return holder.equals(other.holder) && name.equals(other.name) &&
arguments.equals(other.arguments) && returnType.equals(other.returnType);
}
return false;
}
}

View File

@ -1613,21 +1613,20 @@ void ArchDesc::declareClasses(FILE *fp) {
// Each instruction attribute results in a virtual call of same name.
// The ins_cost is not handled here.
Attribute *attr = instr->_attribs;
bool avoid_back_to_back = false;
Attribute *avoid_back_to_back_attr = NULL;
while (attr != NULL) {
if (strcmp (attr->_ident, "ins_cost") != 0 &&
if (strcmp (attr->_ident, "ins_is_TrapBasedCheckNode") == 0) {
fprintf(fp, " virtual bool is_TrapBasedCheckNode() const { return %s; }\n", attr->_val);
} else if (strcmp (attr->_ident, "ins_cost") != 0 &&
strncmp(attr->_ident, "ins_field_", 10) != 0 &&
// Must match function in node.hpp: return type bool, no prefix "ins_".
strcmp (attr->_ident, "ins_is_TrapBasedCheckNode") != 0 &&
strcmp (attr->_ident, "ins_short_branch") != 0) {
fprintf(fp, " virtual int %s() const { return %s; }\n", attr->_ident, attr->_val);
}
// Check value for ins_avoid_back_to_back, and if it is true (1), set the flag
if (!strcmp(attr->_ident, "ins_avoid_back_to_back") != 0 && attr->int_val(*this) != 0)
avoid_back_to_back = true;
if (strcmp (attr->_ident, "ins_is_TrapBasedCheckNode") == 0)
fprintf(fp, " virtual bool is_TrapBasedCheckNode() const { return %s; }\n", attr->_val);
if (strcmp(attr->_ident, "ins_avoid_back_to_back") == 0) {
avoid_back_to_back_attr = attr;
}
attr = (Attribute *)attr->_next;
}
@ -1799,11 +1798,11 @@ void ArchDesc::declareClasses(FILE *fp) {
}
// flag: if this instruction should not be generated back to back.
if ( avoid_back_to_back ) {
if ( node_flags_set ) {
fprintf(fp," | Flag_avoid_back_to_back");
if (avoid_back_to_back_attr != NULL) {
if (node_flags_set) {
fprintf(fp," | (%s)", avoid_back_to_back_attr->_val);
} else {
fprintf(fp,"init_flags(Flag_avoid_back_to_back");
fprintf(fp,"init_flags((%s)", avoid_back_to_back_attr->_val);
node_flags_set = true;
}
}

View File

@ -968,6 +968,7 @@ void CodeBuffer::verify_section_allocation() {
void CodeBuffer::log_section_sizes(const char* name) {
if (xtty != NULL) {
ttyLocker ttyl;
// log info about buffer usage
xtty->print_cr("<blob name='%s' size='%d'>", name, _total_size);
for (int n = (int) CodeBuffer::SECT_FIRST; n < (int) CodeBuffer::SECT_LIMIT; n++) {

View File

@ -546,6 +546,7 @@ Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* metho
, _code(buffer_blob)
, _has_access_indexed(false)
, _current_instruction(NULL)
, _interpreter_frame_size(0)
#ifndef PRODUCT
, _last_instruction_printed(NULL)
#endif // PRODUCT

View File

@ -88,6 +88,7 @@ class Compilation: public StackObj {
CodeOffsets _offsets;
CodeBuffer _code;
bool _has_access_indexed;
int _interpreter_frame_size; // Stack space needed in case of a deoptimization
// compilation helpers
void initialize();
@ -262,6 +263,18 @@ class Compilation: public StackObj {
// Dump inlining replay data to the stream.
void dump_inline_data(outputStream* out) { /* do nothing now */ }
// How much stack space would the interpreter need in case of a
// deoptimization (worst case)
void update_interpreter_frame_size(int size) {
if (_interpreter_frame_size < size) {
_interpreter_frame_size = size;
}
}
int interpreter_frame_size() const {
return _interpreter_frame_size;
}
};

View File

@ -227,8 +227,38 @@ void CodeEmitInfo::add_register_oop(LIR_Opr opr) {
_oop_map->set_oop(name);
}
// Mirror the stack size calculation in the deopt code
// How much stack space would we need at this point in the program in
// case of deoptimization?
int CodeEmitInfo::interpreter_frame_size() const {
ValueStack* state = _stack;
int size = 0;
int callee_parameters = 0;
int callee_locals = 0;
int extra_args = state->scope()->method()->max_stack() - state->stack_size();
while (state != NULL) {
int locks = state->locks_size();
int temps = state->stack_size();
bool is_top_frame = (state == _stack);
ciMethod* method = state->scope()->method();
int frame_size = BytesPerWord * Interpreter::size_activation(method->max_stack(),
temps + callee_parameters,
extra_args,
locks,
callee_parameters,
callee_locals,
is_top_frame);
size += frame_size;
callee_parameters = method->size_of_parameters();
callee_locals = method->max_locals();
extra_args = 0;
state = state->caller_state();
}
return size + Deoptimization::last_frame_adjust(0, callee_locals) * BytesPerWord;
}
// Implementation of IR

View File

@ -284,6 +284,8 @@ class CodeEmitInfo: public CompilationResourceObj {
bool is_method_handle_invoke() const { return _is_method_handle_invoke; }
void set_is_method_handle_invoke(bool x) { _is_method_handle_invoke = x; }
int interpreter_frame_size() const;
};

View File

@ -190,6 +190,13 @@ address LIR_Assembler::pc() const {
return _masm->pc();
}
// To bang the stack of this compiled method we use the stack size
// that the interpreter would need in case of a deoptimization. This
// removes the need to bang the stack in the deoptimization blob which
// in turn simplifies stack overflow handling.
int LIR_Assembler::bang_size_in_bytes() const {
return MAX2(initial_frame_size_in_bytes(), _compilation->interpreter_frame_size());
}
void LIR_Assembler::emit_exception_entries(ExceptionInfoList* info_list) {
for (int i = 0; i < info_list->length(); i++) {
@ -797,7 +804,7 @@ void LIR_Assembler::emit_op2(LIR_Op2* op) {
void LIR_Assembler::build_frame() {
_masm->build_frame(initial_frame_size_in_bytes());
_masm->build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes());
}

View File

@ -132,7 +132,8 @@ class LIR_Assembler: public CompilationResourceObj {
int code_offset() const;
address pc() const;
int initial_frame_size_in_bytes();
int initial_frame_size_in_bytes() const;
int bang_size_in_bytes() const;
// test for constants which can be encoded directly in instructions
static bool is_small_constant(LIR_Opr opr);

View File

@ -2451,6 +2451,9 @@ void LinearScan::compute_oop_map(IntervalWalker* iw, const LIR_OpVisitState &vis
CodeEmitInfo* info = visitor.info_at(i);
OopMap* oop_map = first_oop_map;
// compute worst case interpreter size in case of a deoptimization
_compilation->update_interpreter_frame_size(info->interpreter_frame_size());
if (info->stack()->locks_size() != first_info->stack()->locks_size()) {
// this info has a different number of locks then the precomputed oop map
// (possible for lock and unlock instructions) -> compute oop map with

View File

@ -39,7 +39,7 @@ class C1_MacroAssembler: public MacroAssembler {
void explicit_null_check(Register base);
void inline_cache_check(Register receiver, Register iCache);
void build_frame(int frame_size_in_bytes);
void build_frame(int frame_size_in_bytes, int bang_size_in_bytes);
void remove_frame(int frame_size_in_bytes);
void unverified_entry(Register receiver, Register ic_klass);

View File

@ -237,3 +237,9 @@ void ciKlass::print_impl(outputStream* st) {
void ciKlass::print_name_on(outputStream* st) {
name()->print_symbol_on(st);
}
const char* ciKlass::external_name() const {
GUARDED_VM_ENTRY(
return get_Klass()->external_name();
)
}

View File

@ -125,6 +125,8 @@ public:
virtual ciKlass* exact_klass() = 0;
void print_name_on(outputStream* st);
const char* external_name() const;
};
#endif // SHARE_VM_CI_CIKLASS_HPP

View File

@ -80,6 +80,7 @@ ciMethod::ciMethod(methodHandle h_m) : ciMetadata(h_m()) {
_code_size = h_m()->code_size();
_intrinsic_id = h_m()->intrinsic_id();
_handler_count = h_m()->exception_table_length();
_size_of_parameters = h_m()->size_of_parameters();
_uses_monitors = h_m()->access_flags().has_monitor_bytecodes();
_balanced_monitors = !_uses_monitors || h_m()->access_flags().is_monitor_matching();
_is_c1_compilable = !h_m()->is_not_c1_compilable();

View File

@ -71,6 +71,7 @@ class ciMethod : public ciMetadata {
int _interpreter_invocation_count;
int _interpreter_throwout_count;
int _instructions_size;
int _size_of_parameters;
bool _uses_monitors;
bool _balanced_monitors;
@ -166,6 +167,7 @@ class ciMethod : public ciMetadata {
int exception_table_length() const { check_is_loaded(); return _handler_count; }
int interpreter_invocation_count() const { check_is_loaded(); return _interpreter_invocation_count; }
int interpreter_throwout_count() const { check_is_loaded(); return _interpreter_throwout_count; }
int size_of_parameters() const { check_is_loaded(); return _size_of_parameters; }
// Code size for inlining decisions.
int code_size_for_inlining();
@ -241,7 +243,6 @@ class ciMethod : public ciMetadata {
ciField* get_field_at_bci( int bci, bool &will_link);
ciMethod* get_method_at_bci(int bci, bool &will_link, ciSignature* *declared_signature);
// Given a certain calling environment, find the monomorphic target
// for the call. Return NULL if the call is not monomorphic in
// its calling environment.

View File

@ -123,6 +123,10 @@ void ciSymbol::print_symbol_on(outputStream *st) {
GUARDED_VM_ENTRY(get_symbol()->print_symbol_on(st);)
}
const char* ciSymbol::as_klass_external_name() const {
GUARDED_VM_ENTRY(return get_symbol()->as_klass_external_name(););
}
// ------------------------------------------------------------------
// ciSymbol::make_impl
//

View File

@ -90,6 +90,7 @@ public:
void print_symbol() {
print_symbol_on(tty);
}
const char* as_klass_external_name() const;
// Make a ciSymbol from a C string.
// Consider adding to vmSymbols.hpp instead of using this constructor.

View File

@ -2777,6 +2777,11 @@ void ClassFileParser::parse_classfile_bootstrap_methods_attribute(u4 attribute_b
"Short length on BootstrapMethods in class file %s",
CHECK);
guarantee_property(attribute_byte_length > sizeof(u2),
"Invalid BootstrapMethods attribute length %u in class file %s",
attribute_byte_length,
CHECK);
// The attribute contains a counted array of counted tuples of shorts,
// represending bootstrap specifiers:
// length*{bootstrap_method_index, argument_count*{argument_index}}
@ -4180,8 +4185,12 @@ ClassFileParser::~ClassFileParser() {
clear_class_metadata();
// deallocate the klass if already created.
MetadataFactory::free_metadata(_loader_data, _klass);
// deallocate the klass if already created. Don't directly deallocate, but add
// to the deallocate list so that the klass is removed from the CLD::_klasses list
// at a safepoint.
if (_klass != NULL) {
_loader_data->add_to_deallocate_list(_klass);
}
_klass = NULL;
}

View File

@ -390,20 +390,6 @@ class MethodFamily : public ResourceObj {
Symbol* get_exception_message() { return _exception_message; }
Symbol* get_exception_name() { return _exception_name; }
// Return true if the specified klass has a static method that matches
// the name and signature of the target method.
bool has_matching_static(InstanceKlass* root) {
if (_members.length() > 0) {
Pair<Method*,QualifiedState> entry = _members.at(0);
Method* impl = root->find_method(entry.first->name(),
entry.first->signature());
if ((impl != NULL) && impl->is_static()) {
return true;
}
}
return false;
}
// Either sets the target or the exception error message
void determine_target(InstanceKlass* root, TRAPS) {
if (has_target() || throws_exception()) {
@ -433,21 +419,19 @@ class MethodFamily : public ResourceObj {
// If the root klass has a static method with matching name and signature
// then do not generate an overpass method because it will hide the
// static method during resolution.
if (!has_matching_static(root)) {
if (qualified_methods.length() == 0) {
_exception_message = generate_no_defaults_message(CHECK);
} else {
assert(root != NULL, "Null root class");
_exception_message = generate_method_message(root->name(), qualified_methods.at(0), CHECK);
}
_exception_name = vmSymbols::java_lang_AbstractMethodError();
if (qualified_methods.length() == 0) {
_exception_message = generate_no_defaults_message(CHECK);
} else {
assert(root != NULL, "Null root class");
_exception_message = generate_method_message(root->name(), qualified_methods.at(0), CHECK);
}
_exception_name = vmSymbols::java_lang_AbstractMethodError();
// If only one qualified method is default, select that
} else if (num_defaults == 1) {
_selected_target = qualified_methods.at(default_index);
} else if (num_defaults > 1 && !has_matching_static(root)) {
} else if (num_defaults > 1) {
_exception_message = generate_conflicts_message(&qualified_methods,CHECK);
_exception_name = vmSymbols::java_lang_IncompatibleClassChangeError();
if (TraceDefaultMethods) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -464,25 +464,26 @@ bool java_lang_String::equals(oop str1, oop str2) {
void java_lang_String::print(oop java_string, outputStream* st) {
assert(java_string->klass() == SystemDictionary::String_klass(), "must be java_string");
typeArrayOop value = java_lang_String::value(java_string);
int offset = java_lang_String::offset(java_string);
int length = java_lang_String::length(java_string);
int end = MIN2(length, 100);
if (value == NULL) {
// This can happen if, e.g., printing a String
// object before its initializer has been called
st->print_cr("NULL");
} else {
st->print("\"");
for (int index = 0; index < length; index++) {
st->print("%c", value->char_at(index + offset));
}
st->print("\"");
st->print("NULL");
return;
}
int offset = java_lang_String::offset(java_string);
int length = java_lang_String::length(java_string);
st->print("\"");
for (int index = 0; index < length; index++) {
st->print("%c", value->char_at(index + offset));
}
st->print("\"");
}
static void initialize_static_field(fieldDescriptor* fd, TRAPS) {
Handle mirror (THREAD, fd->field_holder()->java_mirror());
static void initialize_static_field(fieldDescriptor* fd, Handle mirror, TRAPS) {
assert(mirror.not_null() && fd->is_static(), "just checking");
if (fd->has_initial_value()) {
BasicType t = fd->field_type();
@ -549,21 +550,45 @@ void java_lang_Class::fixup_mirror(KlassHandle k, TRAPS) {
create_mirror(k, Handle(NULL), CHECK);
}
oop java_lang_Class::create_mirror(KlassHandle k, Handle protection_domain, TRAPS) {
void java_lang_Class::initialize_mirror_fields(KlassHandle k,
Handle mirror,
Handle protection_domain,
TRAPS) {
// Allocate a simple java object for a lock.
// This needs to be a java object because during class initialization
// it can be held across a java call.
typeArrayOop r = oopFactory::new_typeArray(T_INT, 0, CHECK);
set_init_lock(mirror(), r);
// Set protection domain also
set_protection_domain(mirror(), protection_domain());
// Initialize static fields
InstanceKlass::cast(k())->do_local_static_fields(&initialize_static_field, mirror, CHECK);
}
void java_lang_Class::create_mirror(KlassHandle k, Handle protection_domain, TRAPS) {
assert(k->java_mirror() == NULL, "should only assign mirror once");
// Use this moment of initialization to cache modifier_flags also,
// to support Class.getModifiers(). Instance classes recalculate
// the cached flags after the class file is parsed, but before the
// class is put into the system dictionary.
int computed_modifiers = k->compute_modifier_flags(CHECK_0);
int computed_modifiers = k->compute_modifier_flags(CHECK);
k->set_modifier_flags(computed_modifiers);
// Class_klass has to be loaded because it is used to allocate
// the mirror.
if (SystemDictionary::Class_klass_loaded()) {
// Allocate mirror (java.lang.Class instance)
Handle mirror = InstanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_instance(k, CHECK_0);
Handle mirror = InstanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_instance(k, CHECK);
// Setup indirection from mirror->klass
if (!k.is_null()) {
java_lang_Class::set_klass(mirror(), k());
}
InstanceMirrorKlass* mk = InstanceMirrorKlass::cast(mirror->klass());
assert(oop_size(mirror()) == mk->instance_size(k), "should have been set");
java_lang_Class::set_static_oop_field_count(mirror(), mk->compute_static_oop_field_count(mirror()));
// It might also have a component mirror. This mirror must already exist.
@ -576,29 +601,32 @@ oop java_lang_Class::create_mirror(KlassHandle k, Handle protection_domain, TRAP
assert(k->oop_is_objArray(), "Must be");
Klass* element_klass = ObjArrayKlass::cast(k())->element_klass();
assert(element_klass != NULL, "Must have an element klass");
comp_mirror = element_klass->java_mirror();
comp_mirror = element_klass->java_mirror();
}
assert(comp_mirror.not_null(), "must have a mirror");
// Two-way link between the array klass and its component mirror:
// Two-way link between the array klass and its component mirror:
ArrayKlass::cast(k())->set_component_mirror(comp_mirror());
set_array_klass(comp_mirror(), k());
} else {
assert(k->oop_is_instance(), "Must be");
// Allocate a simple java object for a lock.
// This needs to be a java object because during class initialization
// it can be held across a java call.
typeArrayOop r = oopFactory::new_typeArray(T_INT, 0, CHECK_NULL);
set_init_lock(mirror(), r);
// Set protection domain also
set_protection_domain(mirror(), protection_domain());
// Initialize static fields
InstanceKlass::cast(k())->do_local_static_fields(&initialize_static_field, CHECK_NULL);
initialize_mirror_fields(k, mirror, protection_domain, THREAD);
if (HAS_PENDING_EXCEPTION) {
// If any of the fields throws an exception like OOM remove the klass field
// from the mirror so GC doesn't follow it after the klass has been deallocated.
// This mirror looks like a primitive type, which logically it is because it
// it represents no class.
java_lang_Class::set_klass(mirror(), NULL);
return;
}
}
// Setup indirection from klass->mirror last
// after any exceptions can happen during allocations.
if (!k.is_null()) {
k->set_java_mirror(mirror());
}
return mirror();
} else {
if (fixup_mirror_list() == NULL) {
GrowableArray<Klass*>* list =
@ -606,12 +634,10 @@ oop java_lang_Class::create_mirror(KlassHandle k, Handle protection_domain, TRAP
set_fixup_mirror_list(list);
}
fixup_mirror_list()->push(k());
return NULL;
}
}
int java_lang_Class::oop_size(oop java_class) {
assert(_oop_size_offset != 0, "must be set");
return java_class->int_field(_oop_size_offset);

View File

@ -246,11 +246,12 @@ class java_lang_Class : AllStatic {
static void set_init_lock(oop java_class, oop init_lock);
static void set_protection_domain(oop java_class, oop protection_domain);
static void initialize_mirror_fields(KlassHandle k, Handle mirror, Handle protection_domain, TRAPS);
public:
static void compute_offsets();
// Instance creation
static oop create_mirror(KlassHandle k, Handle protection_domain, TRAPS);
static void create_mirror(KlassHandle k, Handle protection_domain, TRAPS);
static void fixup_mirror(KlassHandle k, TRAPS);
static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS);
// Conversion

View File

@ -810,11 +810,11 @@ void StringTable::buckets_oops_do(OopClosure* f, int start_idx, int end_idx) {
const int limit = the_table()->table_size();
assert(0 <= start_idx && start_idx <= limit,
err_msg("start_idx (" INT32_FORMAT ") is out of bounds", start_idx));
err_msg("start_idx (%d) is out of bounds", start_idx));
assert(0 <= end_idx && end_idx <= limit,
err_msg("end_idx (" INT32_FORMAT ") is out of bounds", end_idx));
err_msg("end_idx (%d) is out of bounds", end_idx));
assert(start_idx <= end_idx,
err_msg("Index ordering: start_idx=" INT32_FORMAT", end_idx=" INT32_FORMAT,
err_msg("Index ordering: start_idx=%d, end_idx=%d",
start_idx, end_idx));
for (int i = start_idx; i < end_idx; i += 1) {
@ -833,11 +833,11 @@ void StringTable::buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClos
const int limit = the_table()->table_size();
assert(0 <= start_idx && start_idx <= limit,
err_msg("start_idx (" INT32_FORMAT ") is out of bounds", start_idx));
err_msg("start_idx (%d) is out of bounds", start_idx));
assert(0 <= end_idx && end_idx <= limit,
err_msg("end_idx (" INT32_FORMAT ") is out of bounds", end_idx));
err_msg("end_idx (%d) is out of bounds", end_idx));
assert(start_idx <= end_idx,
err_msg("Index ordering: start_idx=" INT32_FORMAT", end_idx=" INT32_FORMAT,
err_msg("Index ordering: start_idx=%d, end_idx=%d",
start_idx, end_idx));
for (int i = start_idx; i < end_idx; ++i) {

View File

@ -826,47 +826,6 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
}
} // load_instance_class loop
if (HAS_PENDING_EXCEPTION) {
// An exception, such as OOM could have happened at various places inside
// load_instance_class. We might have partially initialized a shared class
// and need to clean it up.
if (class_loader.is_null()) {
// In some cases k may be null. Let's find the shared class again.
instanceKlassHandle ik(THREAD, find_shared_class(name));
if (ik.not_null()) {
if (ik->class_loader_data() == NULL) {
// We didn't go as far as Klass::restore_unshareable_info(),
// so nothing to clean up.
} else {
Klass *kk;
{
MutexLocker mu(SystemDictionary_lock, THREAD);
kk = find_class(d_index, d_hash, name, ik->class_loader_data());
}
if (kk != NULL) {
// No clean up is needed if the shared class has been entered
// into system dictionary, as load_shared_class() won't be called
// again.
} else {
// This must be done outside of the SystemDictionary_lock to
// avoid deadlock.
//
// Note that Klass::restore_unshareable_info (called via
// load_instance_class above) is also called outside
// of SystemDictionary_lock. Other threads are blocked from
// loading this class because they are waiting on the
// SystemDictionary_lock until this thread removes
// the placeholder below.
//
// This need to be re-thought when parallel-capable non-boot
// classloaders are supported by CDS (today they're not).
clean_up_shared_class(ik, class_loader, THREAD);
}
}
}
}
}
if (load_instance_added == true) {
// clean up placeholder entries for LOAD_INSTANCE success or error
// This brackets the SystemDictionary updates for both defining
@ -1272,19 +1231,6 @@ instanceKlassHandle SystemDictionary::load_shared_class(
return ik;
}
void SystemDictionary::clean_up_shared_class(instanceKlassHandle ik, Handle class_loader, TRAPS) {
// Updating methods must be done under a lock so multiple
// threads don't update these in parallel
// Shared classes are all currently loaded by the bootstrap
// classloader, so this will never cause a deadlock on
// a custom class loader lock.
{
Handle lockObject = compute_loader_lock_object(class_loader, THREAD);
check_loader_lock_contention(lockObject, THREAD);
ObjectLocker ol(lockObject, THREAD, true);
ik->remove_unshareable_info();
}
}
instanceKlassHandle SystemDictionary::load_instance_class(Symbol* class_name, Handle class_loader, TRAPS) {
instanceKlassHandle nh = instanceKlassHandle(); // null Handle

View File

@ -617,7 +617,6 @@ private:
Handle class_loader, TRAPS);
static instanceKlassHandle load_shared_class(instanceKlassHandle ik,
Handle class_loader, TRAPS);
static void clean_up_shared_class(instanceKlassHandle ik, Handle class_loader, TRAPS);
static instanceKlassHandle load_instance_class(Symbol* class_name, Handle class_loader, TRAPS);
static Handle compute_loader_lock_object(Handle class_loader, TRAPS);
static void check_loader_lock_contention(Handle loader_lock, TRAPS);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -299,7 +299,7 @@ class VerificationType VALUE_OBJ_CLASS_SPEC {
int dimensions() const {
assert(is_array(), "Must be an array");
int index = 0;
while (name()->byte_at(index++) == '[');
while (name()->byte_at(index) == '[') index++;
return index;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1943,7 +1943,7 @@ bool ClassVerifier::is_protected_access(instanceKlassHandle this_class,
InstanceKlass* target_instance = InstanceKlass::cast(target_class);
fieldDescriptor fd;
if (is_method) {
Method* m = target_instance->uncached_lookup_method(field_name, field_sig);
Method* m = target_instance->uncached_lookup_method(field_name, field_sig, Klass::normal);
if (m != NULL && m->is_protected()) {
if (!this_class->is_same_class_package(m->method_holder())) {
return true;
@ -2280,7 +2280,8 @@ void ClassVerifier::verify_invoke_init(
ref_class_type.name(), CHECK_VERIFY(this));
Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method(
vmSymbols::object_initializer_name(),
cp->signature_ref_at(bcs->get_index_u2()));
cp->signature_ref_at(bcs->get_index_u2()),
Klass::normal);
instanceKlassHandle mh(THREAD, m->method_holder());
if (m->is_protected() && !mh->is_same_class_package(_klass())) {
bool assignable = current_type().is_assignable_from(

View File

@ -106,7 +106,7 @@ int CompileLog::identify(ciBaseObject* obj) {
if (mobj->is_klass()) {
ciKlass* klass = mobj->as_klass();
begin_elem("klass id='%d'", id);
name(klass->name());
name(klass);
if (!klass->is_loaded()) {
print(" unloaded='1'");
} else {
@ -171,6 +171,15 @@ void CompileLog::name(ciSymbol* name) {
print("'");
}
void CompileLog::name(ciKlass* k) {
print(" name='");
if (!k->is_loaded()) {
text()->print(k->name()->as_klass_external_name());
} else {
text()->print(k->external_name());
}
print("'");
}
// ------------------------------------------------------------------
// CompileLog::clear_identities

View File

@ -28,6 +28,7 @@
#include "utilities/xmlstream.hpp"
class ciBaseObject;
class ciKlass;
class ciObject;
class ciMetadata;
class ciSymbol;
@ -72,6 +73,7 @@ class CompileLog : public xmlStream {
void name(ciSymbol* s); // name='s'
void name(Symbol* s) { xmlStream::name(s); }
void name(ciKlass* k);
// Output an object description, return obj->ident().
int identify(ciBaseObject* obj);

View File

@ -57,10 +57,10 @@ ConcurrentG1Refine::ConcurrentG1Refine(G1CollectedHeap* g1h) :
_threads = NEW_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _n_threads, mtGC);
int worker_id_offset = (int)DirtyCardQueueSet::num_par_ids();
uint worker_id_offset = DirtyCardQueueSet::num_par_ids();
ConcurrentG1RefineThread *next = NULL;
for (int i = _n_threads - 1; i >= 0; i--) {
for (uint i = _n_threads - 1; i != UINT_MAX; i--) {
ConcurrentG1RefineThread* t = new ConcurrentG1RefineThread(this, next, worker_id_offset, i);
assert(t != NULL, "Conc refine should have been created");
if (t->osthread() == NULL) {
@ -87,7 +87,7 @@ void ConcurrentG1Refine::init() {
void ConcurrentG1Refine::stop() {
if (_threads != NULL) {
for (int i = 0; i < _n_threads; i++) {
for (uint i = 0; i < _n_threads; i++) {
_threads[i]->stop();
}
}
@ -96,7 +96,7 @@ void ConcurrentG1Refine::stop() {
void ConcurrentG1Refine::reinitialize_threads() {
reset_threshold_step();
if (_threads != NULL) {
for (int i = 0; i < _n_threads; i++) {
for (uint i = 0; i < _n_threads; i++) {
_threads[i]->initialize();
}
}
@ -104,7 +104,7 @@ void ConcurrentG1Refine::reinitialize_threads() {
ConcurrentG1Refine::~ConcurrentG1Refine() {
if (_threads != NULL) {
for (int i = 0; i < _n_threads; i++) {
for (uint i = 0; i < _n_threads; i++) {
delete _threads[i];
}
FREE_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _threads, mtGC);
@ -113,7 +113,7 @@ ConcurrentG1Refine::~ConcurrentG1Refine() {
void ConcurrentG1Refine::threads_do(ThreadClosure *tc) {
if (_threads != NULL) {
for (int i = 0; i < _n_threads; i++) {
for (uint i = 0; i < _n_threads; i++) {
tc->do_thread(_threads[i]);
}
}
@ -121,20 +121,20 @@ void ConcurrentG1Refine::threads_do(ThreadClosure *tc) {
void ConcurrentG1Refine::worker_threads_do(ThreadClosure * tc) {
if (_threads != NULL) {
for (int i = 0; i < worker_thread_num(); i++) {
for (uint i = 0; i < worker_thread_num(); i++) {
tc->do_thread(_threads[i]);
}
}
}
int ConcurrentG1Refine::thread_num() {
int n_threads = (G1ConcRefinementThreads > 0) ? G1ConcRefinementThreads
uint ConcurrentG1Refine::thread_num() {
uint n_threads = (G1ConcRefinementThreads > 0) ? G1ConcRefinementThreads
: ParallelGCThreads;
return MAX2<int>(n_threads, 1);
return MAX2<uint>(n_threads, 1);
}
void ConcurrentG1Refine::print_worker_threads_on(outputStream* st) const {
for (int i = 0; i < _n_threads; ++i) {
for (uint i = 0; i < _n_threads; ++i) {
_threads[i]->print_on(st);
st->cr();
}

View File

@ -39,8 +39,8 @@ class DirtyCardQueue;
class ConcurrentG1Refine: public CHeapObj<mtGC> {
ConcurrentG1RefineThread** _threads;
int _n_threads;
int _n_worker_threads;
uint _n_threads;
uint _n_worker_threads;
/*
* The value of the update buffer queue length falls into one of 3 zones:
* green, yellow, red. If the value is in [0, green) nothing is
@ -88,7 +88,7 @@ class ConcurrentG1Refine: public CHeapObj<mtGC> {
// The RS sampling thread
ConcurrentG1RefineThread * sampling_thread() const;
static int thread_num();
static uint thread_num();
void print_worker_threads_on(outputStream* st) const;
@ -100,8 +100,8 @@ class ConcurrentG1Refine: public CHeapObj<mtGC> {
int yellow_zone() const { return _yellow_zone; }
int red_zone() const { return _red_zone; }
int total_thread_num() const { return _n_threads; }
int worker_thread_num() const { return _n_worker_threads; }
uint total_thread_num() const { return _n_threads; }
uint worker_thread_num() const { return _n_worker_threads; }
int thread_threshold_step() const { return _thread_threshold_step; }

View File

@ -33,7 +33,7 @@
ConcurrentG1RefineThread::
ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread *next,
int worker_id_offset, int worker_id) :
uint worker_id_offset, uint worker_id) :
ConcurrentGCThread(),
_worker_id_offset(worker_id_offset),
_worker_id(worker_id),

View File

@ -38,8 +38,8 @@ class ConcurrentG1RefineThread: public ConcurrentGCThread {
double _vtime_start; // Initial virtual time.
double _vtime_accum; // Initial virtual time.
int _worker_id;
int _worker_id_offset;
uint _worker_id;
uint _worker_id_offset;
// The refinement threads collection is linked list. A predecessor can activate a successor
// when the number of the rset update buffer crosses a certain threshold. A successor
@ -71,7 +71,7 @@ public:
virtual void run();
// Constructor
ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread* next,
int worker_id_offset, int worker_id);
uint worker_id_offset, uint worker_id);
void initialize();

View File

@ -567,8 +567,8 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) :
_root_regions.init(_g1h, this);
if (ConcGCThreads > ParallelGCThreads) {
warning("Can't have more ConcGCThreads (" UINT32_FORMAT ") "
"than ParallelGCThreads (" UINT32_FORMAT ").",
warning("Can't have more ConcGCThreads (" UINTX_FORMAT ") "
"than ParallelGCThreads (" UINTX_FORMAT ").",
ConcGCThreads, ParallelGCThreads);
return;
}
@ -1804,7 +1804,6 @@ class G1ParNoteEndTask;
class G1NoteEndOfConcMarkClosure : public HeapRegionClosure {
G1CollectedHeap* _g1;
int _worker_num;
size_t _max_live_bytes;
uint _regions_claimed;
size_t _freed_bytes;
@ -1817,10 +1816,9 @@ class G1NoteEndOfConcMarkClosure : public HeapRegionClosure {
public:
G1NoteEndOfConcMarkClosure(G1CollectedHeap* g1,
int worker_num,
FreeRegionList* local_cleanup_list,
HRRSCleanupTask* hrrs_cleanup_task) :
_g1(g1), _worker_num(worker_num),
_g1(g1),
_max_live_bytes(0), _regions_claimed(0),
_freed_bytes(0),
_claimed_region_time(0.0), _max_region_time(0.0),
@ -1893,7 +1891,7 @@ public:
double start = os::elapsedTime();
FreeRegionList local_cleanup_list("Local Cleanup List");
HRRSCleanupTask hrrs_cleanup_task;
G1NoteEndOfConcMarkClosure g1_note_end(_g1h, worker_id, &local_cleanup_list,
G1NoteEndOfConcMarkClosure g1_note_end(_g1h, &local_cleanup_list,
&hrrs_cleanup_task);
if (G1CollectedHeap::use_parallel_gc_threads()) {
_g1h->heap_region_par_iterate_chunked(&g1_note_end, worker_id,
@ -2145,7 +2143,7 @@ void ConcurrentMark::completeCleanup() {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
_cleanup_list.verify_list();
_cleanup_list.verify_optional();
FreeRegionList tmp_free_list("Tmp Free List");
if (G1ConcRegionFreeingVerbose) {

View File

@ -34,12 +34,12 @@
bool DirtyCardQueue::apply_closure(CardTableEntryClosure* cl,
bool consume,
size_t worker_i) {
uint worker_i) {
bool res = true;
if (_buf != NULL) {
res = apply_closure_to_buffer(cl, _buf, _index, _sz,
consume,
(int) worker_i);
worker_i);
if (res && consume) _index = _sz;
}
return res;
@ -49,7 +49,7 @@ bool DirtyCardQueue::apply_closure_to_buffer(CardTableEntryClosure* cl,
void** buf,
size_t index, size_t sz,
bool consume,
int worker_i) {
uint worker_i) {
if (cl == NULL) return true;
for (size_t i = index; i < sz; i += oopSize) {
int ind = byte_index_to_index((int)i);
@ -79,8 +79,8 @@ DirtyCardQueueSet::DirtyCardQueueSet(bool notify_when_complete) :
}
// Determines how many mutator threads can process the buffers in parallel.
size_t DirtyCardQueueSet::num_par_ids() {
return os::processor_count();
uint DirtyCardQueueSet::num_par_ids() {
return (uint)os::processor_count();
}
void DirtyCardQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock,
@ -103,7 +103,7 @@ void DirtyCardQueueSet::set_closure(CardTableEntryClosure* closure) {
}
void DirtyCardQueueSet::iterate_closure_all_threads(bool consume,
size_t worker_i) {
uint worker_i) {
assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint.");
for(JavaThread* t = Threads::first(); t; t = t->next()) {
bool b = t->dirty_card_queue().apply_closure(_closure, consume);
@ -126,11 +126,11 @@ bool DirtyCardQueueSet::mut_process_buffer(void** buf) {
// We get the the number of any par_id that this thread
// might have already claimed.
int worker_i = thread->get_claimed_par_id();
uint worker_i = thread->get_claimed_par_id();
// If worker_i is not -1 then the thread has already claimed
// If worker_i is not UINT_MAX then the thread has already claimed
// a par_id. We make note of it using the already_claimed value
if (worker_i != -1) {
if (worker_i != UINT_MAX) {
already_claimed = true;
} else {
@ -142,7 +142,7 @@ bool DirtyCardQueueSet::mut_process_buffer(void** buf) {
}
bool b = false;
if (worker_i != -1) {
if (worker_i != UINT_MAX) {
b = DirtyCardQueue::apply_closure_to_buffer(_closure, buf, 0,
_sz, true, worker_i);
if (b) Atomic::inc(&_processed_buffers_mut);
@ -154,8 +154,8 @@ bool DirtyCardQueueSet::mut_process_buffer(void** buf) {
// we release the id
_free_ids->release_par_id(worker_i);
// and set the claimed_id in the thread to -1
thread->set_claimed_par_id(-1);
// and set the claimed_id in the thread to UINT_MAX
thread->set_claimed_par_id(UINT_MAX);
}
}
return b;
@ -186,7 +186,7 @@ DirtyCardQueueSet::get_completed_buffer(int stop_at) {
bool DirtyCardQueueSet::
apply_closure_to_completed_buffer_helper(CardTableEntryClosure* cl,
int worker_i,
uint worker_i,
BufferNode* nd) {
if (nd != NULL) {
void **buf = BufferNode::make_buffer_from_node(nd);
@ -208,7 +208,7 @@ apply_closure_to_completed_buffer_helper(CardTableEntryClosure* cl,
}
bool DirtyCardQueueSet::apply_closure_to_completed_buffer(CardTableEntryClosure* cl,
int worker_i,
uint worker_i,
int stop_at,
bool during_pause) {
assert(!during_pause || stop_at == 0, "Should not leave any completed buffers during a pause");
@ -218,7 +218,7 @@ bool DirtyCardQueueSet::apply_closure_to_completed_buffer(CardTableEntryClosure*
return res;
}
bool DirtyCardQueueSet::apply_closure_to_completed_buffer(int worker_i,
bool DirtyCardQueueSet::apply_closure_to_completed_buffer(uint worker_i,
int stop_at,
bool during_pause) {
return apply_closure_to_completed_buffer(_closure, worker_i,

View File

@ -36,7 +36,7 @@ class CardTableEntryClosure: public CHeapObj<mtGC> {
public:
// Process the card whose card table entry is "card_ptr". If returns
// "false", terminate the iteration early.
virtual bool do_card_ptr(jbyte* card_ptr, int worker_i = 0) = 0;
virtual bool do_card_ptr(jbyte* card_ptr, uint worker_i = 0) = 0;
};
// A ptrQueue whose elements are "oops", pointers to object heads.
@ -53,7 +53,7 @@ public:
// deletes processed entries from logs.
bool apply_closure(CardTableEntryClosure* cl,
bool consume = true,
size_t worker_i = 0);
uint worker_i = 0);
// Apply the closure to all elements of "buf", down to "index"
// (inclusive.) If returns "false", then a closure application returned
@ -63,7 +63,7 @@ public:
static bool apply_closure_to_buffer(CardTableEntryClosure* cl,
void** buf, size_t index, size_t sz,
bool consume = true,
int worker_i = 0);
uint worker_i = 0);
void **get_buf() { return _buf;}
void set_buf(void **buf) {_buf = buf;}
size_t get_index() { return _index;}
@ -98,7 +98,7 @@ public:
// The number of parallel ids that can be claimed to allow collector or
// mutator threads to do card-processing work.
static size_t num_par_ids();
static uint num_par_ids();
static void handle_zero_index_for_thread(JavaThread* t);
@ -115,7 +115,7 @@ public:
// change in the future.) If "consume" is true, processed entries are
// discarded.
void iterate_closure_all_threads(bool consume = true,
size_t worker_i = 0);
uint worker_i = 0);
// If there exists some completed buffer, pop it, then apply the
// registered closure to all its elements, nulling out those elements
@ -124,7 +124,7 @@ public:
// but is only partially completed before a "yield" happens, the
// partially completed buffer (with its processed elements set to NULL)
// is returned to the completed buffer set, and this call returns false.
bool apply_closure_to_completed_buffer(int worker_i = 0,
bool apply_closure_to_completed_buffer(uint worker_i = 0,
int stop_at = 0,
bool during_pause = false);
@ -136,13 +136,13 @@ public:
// partially completed buffer (with its processed elements set to NULL)
// is returned to the completed buffer set, and this call returns false.
bool apply_closure_to_completed_buffer(CardTableEntryClosure* cl,
int worker_i = 0,
uint worker_i = 0,
int stop_at = 0,
bool during_pause = false);
// Helper routine for the above.
bool apply_closure_to_completed_buffer_helper(CardTableEntryClosure* cl,
int worker_i,
uint worker_i,
BufferNode* nd);
BufferNode* get_completed_buffer(int stop_at);

View File

@ -304,26 +304,26 @@ void G1BlockOffsetArray::check_all_cards(size_t start_card, size_t end_card) con
if (c - start_card > BlockOffsetArray::power_to_cards_back(1)) {
guarantee(entry > N_words,
err_msg("Should be in logarithmic region - "
"entry: " UINT32_FORMAT ", "
"_array->offset_array(c): " UINT32_FORMAT ", "
"N_words: " UINT32_FORMAT,
entry, _array->offset_array(c), N_words));
"entry: %u, "
"_array->offset_array(c): %u, "
"N_words: %u",
(uint)entry, (uint)_array->offset_array(c), (uint)N_words));
}
size_t backskip = BlockOffsetArray::entry_to_cards_back(entry);
size_t landing_card = c - backskip;
guarantee(landing_card >= (start_card - 1), "Inv");
if (landing_card >= start_card) {
guarantee(_array->offset_array(landing_card) <= entry,
err_msg("Monotonicity - landing_card offset: " UINT32_FORMAT ", "
"entry: " UINT32_FORMAT,
_array->offset_array(landing_card), entry));
err_msg("Monotonicity - landing_card offset: %u, "
"entry: %u",
(uint)_array->offset_array(landing_card), (uint)entry));
} else {
guarantee(landing_card == start_card - 1, "Tautology");
// Note that N_words is the maximum offset value
guarantee(_array->offset_array(landing_card) <= N_words,
err_msg("landing card offset: " UINT32_FORMAT ", "
"N_words: " UINT32_FORMAT,
_array->offset_array(landing_card), N_words));
err_msg("landing card offset: %u, "
"N_words: %u",
(uint)_array->offset_array(landing_card), (uint)N_words));
}
}
}
@ -554,21 +554,20 @@ void G1BlockOffsetArray::alloc_block_work2(HeapWord** threshold_, size_t* index_
(_array->offset_array(orig_index) > 0 &&
_array->offset_array(orig_index) <= N_words),
err_msg("offset array should have been set - "
"orig_index offset: " UINT32_FORMAT ", "
"orig_index offset: %u, "
"blk_start: " PTR_FORMAT ", "
"boundary: " PTR_FORMAT,
_array->offset_array(orig_index),
(uint)_array->offset_array(orig_index),
blk_start, boundary));
for (size_t j = orig_index + 1; j <= end_index; j++) {
assert(_array->offset_array(j) > 0 &&
_array->offset_array(j) <=
(u_char) (N_words+BlockOffsetArray::N_powers-1),
err_msg("offset array should have been set - "
UINT32_FORMAT " not > 0 OR "
UINT32_FORMAT " not <= " UINT32_FORMAT,
_array->offset_array(j),
_array->offset_array(j),
(u_char) (N_words+BlockOffsetArray::N_powers-1)));
"%u not > 0 OR %u not <= %u",
(uint) _array->offset_array(j),
(uint) _array->offset_array(j),
(uint) (N_words+BlockOffsetArray::N_powers-1)));
}
#endif
}

View File

@ -146,8 +146,8 @@ private:
void check_offset(size_t offset, const char* msg) const {
assert(offset <= N_words,
err_msg("%s - "
"offset: " UINT32_FORMAT", N_words: " UINT32_FORMAT,
msg, offset, N_words));
"offset: " SIZE_FORMAT", N_words: %u",
msg, offset, (uint)N_words));
}
// Bounds checking accessors:

View File

@ -102,7 +102,7 @@ public:
ConcurrentG1Refine* cg1r) :
_sts(sts), _g1rs(g1rs), _cg1r(cg1r), _concurrent(true)
{}
bool do_card_ptr(jbyte* card_ptr, int worker_i) {
bool do_card_ptr(jbyte* card_ptr, uint worker_i) {
bool oops_into_cset = _g1rs->refine_card(card_ptr, worker_i, false);
// This path is executed by the concurrent refine or mutator threads,
// concurrently, and so we do not care if card_ptr contains references
@ -131,7 +131,7 @@ public:
{
for (int i = 0; i < 256; i++) _histo[i] = 0;
}
bool do_card_ptr(jbyte* card_ptr, int worker_i) {
bool do_card_ptr(jbyte* card_ptr, uint worker_i) {
if (_g1h->is_in_reserved(_ctbs->addr_for(card_ptr))) {
_calls++;
unsigned char* ujb = (unsigned char*)card_ptr;
@ -160,7 +160,7 @@ public:
RedirtyLoggedCardTableEntryClosure() :
_calls(0), _g1h(G1CollectedHeap::heap()), _ctbs(_g1h->g1_barrier_set()) {}
bool do_card_ptr(jbyte* card_ptr, int worker_i) {
bool do_card_ptr(jbyte* card_ptr, uint worker_i) {
if (_g1h->is_in_reserved(_ctbs->addr_for(card_ptr))) {
_calls++;
*card_ptr = 0;
@ -1288,7 +1288,7 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
print_heap_before_gc();
trace_heap_before_gc(gc_tracer);
size_t metadata_prev_used = MetaspaceAux::allocated_used_bytes();
size_t metadata_prev_used = MetaspaceAux::used_bytes();
verify_region_sets_optional();
@ -2314,7 +2314,7 @@ void G1CollectedHeap::check_gc_time_stamps() {
void G1CollectedHeap::iterate_dirty_card_closure(CardTableEntryClosure* cl,
DirtyCardQueue* into_cset_dcq,
bool concurrent,
int worker_i) {
uint worker_i) {
// Clean cards in the hot card cache
G1HotCardCache* hot_card_cache = _cg1r->hot_card_cache();
hot_card_cache->drain(worker_i, g1_rem_set(), into_cset_dcq);
@ -2843,7 +2843,7 @@ void G1CollectedHeap::clear_cset_start_regions() {
// Given the id of a worker, obtain or calculate a suitable
// starting region for iterating over the current collection set.
HeapRegion* G1CollectedHeap::start_cset_region_for_worker(int worker_i) {
HeapRegion* G1CollectedHeap::start_cset_region_for_worker(uint worker_i) {
assert(get_gc_time_stamp() > 0, "should have been updated by now");
HeapRegion* result = NULL;
@ -5103,7 +5103,7 @@ g1_process_strong_roots(bool is_scavenging,
OopClosure* scan_non_heap_roots,
OopsInHeapRegionClosure* scan_rs,
G1KlassScanClosure* scan_klasses,
int worker_i) {
uint worker_i) {
// First scan the strong roots
double ext_roots_start = os::elapsedTime();
@ -5207,10 +5207,10 @@ public:
~G1StringSymbolTableUnlinkTask() {
guarantee(!_process_strings || !_do_in_parallel || StringTable::parallel_claimed_index() >= _initial_string_table_size,
err_msg("claim value "INT32_FORMAT" after unlink less than initial string table size "INT32_FORMAT,
err_msg("claim value %d after unlink less than initial string table size %d",
StringTable::parallel_claimed_index(), _initial_string_table_size));
guarantee(!_process_symbols || !_do_in_parallel || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size,
err_msg("claim value "INT32_FORMAT" after unlink less than initial symbol table size "INT32_FORMAT,
err_msg("claim value %d after unlink less than initial symbol table size %d",
SymbolTable::parallel_claimed_index(), _initial_symbol_table_size));
}
@ -5275,7 +5275,7 @@ void G1CollectedHeap::unlink_string_and_symbol_table(BoolObjectClosure* is_alive
class RedirtyLoggedCardTableEntryFastClosure : public CardTableEntryClosure {
public:
bool do_card_ptr(jbyte* card_ptr, int worker_i) {
bool do_card_ptr(jbyte* card_ptr, uint worker_i) {
*card_ptr = CardTableModRefBS::dirty_card_val();
return true;
}

View File

@ -845,7 +845,7 @@ protected:
OopClosure* scan_non_heap_roots,
OopsInHeapRegionClosure* scan_rs,
G1KlassScanClosure* scan_klasses,
int worker_i);
uint worker_i);
// Notifies all the necessary spaces that the committed space has
// been updated (either expanded or shrunk). It should be called
@ -1139,7 +1139,7 @@ public:
void iterate_dirty_card_closure(CardTableEntryClosure* cl,
DirtyCardQueue* into_cset_dcq,
bool concurrent, int worker_i);
bool concurrent, uint worker_i);
// The shared block offset table array.
G1BlockOffsetSharedArray* bot_shared() const { return _bot_shared; }
@ -1370,7 +1370,7 @@ public:
// Given the id of a worker, obtain or calculate a suitable
// starting region for iterating over the current collection set.
HeapRegion* start_cset_region_for_worker(int worker_i);
HeapRegion* start_cset_region_for_worker(uint worker_i);
// This is a convenience method that is used by the
// HeapRegionIterator classes to calculate the starting region for

View File

@ -1204,7 +1204,7 @@ void G1CollectorPolicy::record_heap_size_info_at_start(bool full) {
(_young_list_target_length * HeapRegion::GrainBytes) - _survivor_used_bytes_before_gc;
if (full) {
_metaspace_used_bytes_before_gc = MetaspaceAux::allocated_used_bytes();
_metaspace_used_bytes_before_gc = MetaspaceAux::used_bytes();
}
}

View File

@ -147,7 +147,7 @@ template <class T>
void WorkerDataArray<T>::verify() {
for (uint i = 0; i < _length; i++) {
assert(_data[i] != _uninitialized,
err_msg("Invalid data for worker " UINT32_FORMAT ", data: %lf, uninitialized: %lf",
err_msg("Invalid data for worker %u, data: %lf, uninitialized: %lf",
i, (double)_data[i], (double)_uninitialized));
}
}
@ -246,8 +246,8 @@ void G1GCPhaseTimes::print_stats(int level, const char* str, double value) {
LineBuffer(level).append_and_print_cr("[%s: %.1lf ms]", str, value);
}
void G1GCPhaseTimes::print_stats(int level, const char* str, double value, int workers) {
LineBuffer(level).append_and_print_cr("[%s: %.1lf ms, GC Workers: %d]", str, value, workers);
void G1GCPhaseTimes::print_stats(int level, const char* str, double value, uint workers) {
LineBuffer(level).append_and_print_cr("[%s: %.1lf ms, GC Workers: %u]", str, value, workers);
}
double G1GCPhaseTimes::accounted_time_ms() {

View File

@ -161,7 +161,7 @@ class G1GCPhaseTimes : public CHeapObj<mtGC> {
// Helper methods for detailed logging
void print_stats(int level, const char* str, double value);
void print_stats(int level, const char* str, double value, int workers);
void print_stats(int level, const char* str, double value, uint workers);
public:
G1GCPhaseTimes(uint max_gc_threads);

View File

@ -44,9 +44,9 @@ void G1HotCardCache::initialize() {
_hot_cache_idx = 0;
// For refining the cards in the hot cache in parallel
int n_workers = (ParallelGCThreads > 0 ?
uint n_workers = (ParallelGCThreads > 0 ?
_g1h->workers()->total_workers() : 1);
_hot_cache_par_chunk_size = MAX2(1, _hot_cache_size / n_workers);
_hot_cache_par_chunk_size = MAX2(1, _hot_cache_size / (int)n_workers);
_hot_cache_par_claimed_idx = 0;
_card_counts.initialize();
@ -89,7 +89,7 @@ jbyte* G1HotCardCache::insert(jbyte* card_ptr) {
return res;
}
void G1HotCardCache::drain(int worker_i,
void G1HotCardCache::drain(uint worker_i,
G1RemSet* g1rs,
DirtyCardQueue* into_cset_dcq) {
if (!default_use_cache()) {
@ -122,8 +122,8 @@ void G1HotCardCache::drain(int worker_i,
// RSet updating while within an evacuation pause.
// In this case worker_i should be the id of a GC worker thread
assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint");
assert(worker_i < (int) (ParallelGCThreads == 0 ? 1 : ParallelGCThreads),
err_msg("incorrect worker id: "INT32_FORMAT, worker_i));
assert(worker_i < (ParallelGCThreads == 0 ? 1 : ParallelGCThreads),
err_msg("incorrect worker id: %u", worker_i));
into_cset_dcq->enqueue(card_ptr);
}

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