diff --git a/.hgtags b/.hgtags
index 0b3abeb4247..d063220672f 100644
--- a/.hgtags
+++ b/.hgtags
@@ -223,3 +223,5 @@ ea73f01b9053e7165e7ba80f242bafecbc6af712 jdk8-b96
2d3875b0d18b3ad1c2bebf385a697e309e4005a4 jdk8-b99
3d34036aae4ea90b2ca59712d5a69db3221f0875 jdk8-b100
edb01c460d4cab21ff0ff13512df7b746efaa0e7 jdk8-b101
+bbe43d712fe08e650808d774861b256ccb34e500 jdk8-b102
+30a1d677a20c6a95f98043d8f20ce570304e3818 jdk8-b103
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index a5df9845c1e..456aa0fa60e 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -223,3 +223,5 @@ a1c1e8bf71f354f3aec0214cf13d6668811e021d jdk8-b97
59dc9da813794c924a0383c2a6241af94defdfed jdk8-b99
d2dcb110e9dbaf9903c05b211df800e78e4b394e jdk8-b100
9f74a220677dc265a724515d8e2617548cef62f1 jdk8-b101
+5eb3c1dc348f72a7f84f7d9d07834e8bbe09a799 jdk8-b102
+b7e64be81c8a7690703df5711f4fc2375da8a9cb jdk8-b103
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 1f084da68c9..0e4c4d9194c 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for OpenJDK jdk8.
+# Generated by GNU Autoconf 2.67 for OpenJDK jdk8.
#
# Report bugs to .
#
@@ -91,7 +91,6 @@ fi
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -217,18 +216,11 @@ IFS=$as_save_IFS
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
- # Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
export CONFIG_SHELL
- case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
- esac
- exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
fi
if test x$as_have_required = xno; then :
@@ -689,6 +681,7 @@ STATIC_LIBRARY
SHARED_LIBRARY
OBJ_SUFFIX
COMPILER_NAME
+TARGET_BITS_FLAG
JT_HOME
JTREGEXE
LIPO
@@ -1469,7 +1462,7 @@ Try \`$0 --help' for more information"
$as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
$as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
;;
esac
@@ -1905,7 +1898,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
OpenJDK configure jdk8
-generated by GNU Autoconf 2.68
+generated by GNU Autoconf 2.67
Copyright (C) 2010 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -1951,7 +1944,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
@@ -1989,7 +1982,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_compile
@@ -2027,7 +2020,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
as_fn_set_status $ac_retval
} # ac_fn_objc_try_compile
@@ -2064,7 +2057,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
as_fn_set_status $ac_retval
} # ac_fn_c_try_cpp
@@ -2101,7 +2094,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_cpp
@@ -2114,10 +2107,10 @@ fi
ac_fn_cxx_check_header_mongrel ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
+ if eval "test \"\${$3+set}\"" = set; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
$as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
@@ -2184,7 +2177,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
$as_echo_n "(cached) " >&6
else
eval "$3=\$ac_header_compiler"
@@ -2193,7 +2186,7 @@ eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
} # ac_fn_cxx_check_header_mongrel
@@ -2234,7 +2227,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=$ac_status
fi
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_run
@@ -2248,7 +2241,7 @@ ac_fn_cxx_check_header_compile ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2266,7 +2259,7 @@ fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
} # ac_fn_cxx_check_header_compile
@@ -2443,7 +2436,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
rm -f conftest.val
fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
as_fn_set_status $ac_retval
} # ac_fn_cxx_compute_int
@@ -2489,7 +2482,7 @@ fi
# interfere with the next link command; also delete a directory that is
# left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_link
@@ -2502,7 +2495,7 @@ ac_fn_cxx_check_func ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2557,7 +2550,7 @@ fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
} # ac_fn_cxx_check_func
@@ -2570,7 +2563,7 @@ ac_fn_c_check_header_compile ()
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2588,7 +2581,7 @@ fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
} # ac_fn_c_check_header_compile
cat >config.log <<_ACEOF
@@ -2596,7 +2589,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by OpenJDK $as_me jdk8, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.67. Invocation command line was
$ $0 $@
@@ -2854,7 +2847,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;}
|| { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
fi
done
@@ -3794,7 +3787,7 @@ fi
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1373384053
+DATE_WHEN_GENERATED=1376579640
###############################################################################
#
@@ -3832,7 +3825,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_BASENAME+:} false; then :
+if test "${ac_cv_path_BASENAME+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $BASENAME in
@@ -3891,7 +3884,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_BASH+:} false; then :
+if test "${ac_cv_path_BASH+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $BASH in
@@ -3950,7 +3943,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CAT+:} false; then :
+if test "${ac_cv_path_CAT+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $CAT in
@@ -4009,7 +4002,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CHMOD+:} false; then :
+if test "${ac_cv_path_CHMOD+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $CHMOD in
@@ -4068,7 +4061,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CMP+:} false; then :
+if test "${ac_cv_path_CMP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $CMP in
@@ -4127,7 +4120,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_COMM+:} false; then :
+if test "${ac_cv_path_COMM+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $COMM in
@@ -4186,7 +4179,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CP+:} false; then :
+if test "${ac_cv_path_CP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $CP in
@@ -4245,7 +4238,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CPIO+:} false; then :
+if test "${ac_cv_path_CPIO+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $CPIO in
@@ -4304,7 +4297,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CUT+:} false; then :
+if test "${ac_cv_path_CUT+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $CUT in
@@ -4363,7 +4356,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_DATE+:} false; then :
+if test "${ac_cv_path_DATE+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $DATE in
@@ -4422,7 +4415,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_DIFF+:} false; then :
+if test "${ac_cv_path_DIFF+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $DIFF in
@@ -4481,7 +4474,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_DIRNAME+:} false; then :
+if test "${ac_cv_path_DIRNAME+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $DIRNAME in
@@ -4540,7 +4533,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ECHO+:} false; then :
+if test "${ac_cv_path_ECHO+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $ECHO in
@@ -4599,7 +4592,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_EXPR+:} false; then :
+if test "${ac_cv_path_EXPR+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $EXPR in
@@ -4658,7 +4651,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_FILE+:} false; then :
+if test "${ac_cv_path_FILE+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $FILE in
@@ -4717,7 +4710,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_FIND+:} false; then :
+if test "${ac_cv_path_FIND+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $FIND in
@@ -4776,7 +4769,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_HEAD+:} false; then :
+if test "${ac_cv_path_HEAD+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $HEAD in
@@ -4835,7 +4828,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_LN+:} false; then :
+if test "${ac_cv_path_LN+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $LN in
@@ -4894,7 +4887,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_LS+:} false; then :
+if test "${ac_cv_path_LS+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $LS in
@@ -4953,7 +4946,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MKDIR+:} false; then :
+if test "${ac_cv_path_MKDIR+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $MKDIR in
@@ -5012,7 +5005,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MKTEMP+:} false; then :
+if test "${ac_cv_path_MKTEMP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $MKTEMP in
@@ -5071,7 +5064,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MV+:} false; then :
+if test "${ac_cv_path_MV+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $MV in
@@ -5130,7 +5123,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PRINTF+:} false; then :
+if test "${ac_cv_path_PRINTF+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $PRINTF in
@@ -5189,7 +5182,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_RM+:} false; then :
+if test "${ac_cv_path_RM+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $RM in
@@ -5248,7 +5241,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_SH+:} false; then :
+if test "${ac_cv_path_SH+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $SH in
@@ -5307,7 +5300,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_SORT+:} false; then :
+if test "${ac_cv_path_SORT+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $SORT in
@@ -5366,7 +5359,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_TAIL+:} false; then :
+if test "${ac_cv_path_TAIL+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $TAIL in
@@ -5425,7 +5418,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_TAR+:} false; then :
+if test "${ac_cv_path_TAR+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $TAR in
@@ -5484,7 +5477,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_TEE+:} false; then :
+if test "${ac_cv_path_TEE+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $TEE in
@@ -5543,7 +5536,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_TOUCH+:} false; then :
+if test "${ac_cv_path_TOUCH+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $TOUCH in
@@ -5602,7 +5595,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_TR+:} false; then :
+if test "${ac_cv_path_TR+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $TR in
@@ -5661,7 +5654,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_UNAME+:} false; then :
+if test "${ac_cv_path_UNAME+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $UNAME in
@@ -5720,7 +5713,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_UNIQ+:} false; then :
+if test "${ac_cv_path_UNIQ+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $UNIQ in
@@ -5779,7 +5772,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_WC+:} false; then :
+if test "${ac_cv_path_WC+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $WC in
@@ -5838,7 +5831,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_WHICH+:} false; then :
+if test "${ac_cv_path_WHICH+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $WHICH in
@@ -5897,7 +5890,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_XARGS+:} false; then :
+if test "${ac_cv_path_XARGS+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $XARGS in
@@ -5957,7 +5950,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
+if test "${ac_cv_prog_AWK+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$AWK"; then
@@ -6007,7 +6000,7 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
+if test "${ac_cv_path_GREP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -z "$GREP"; then
@@ -6082,7 +6075,7 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
+if test "${ac_cv_path_EGREP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -6161,7 +6154,7 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
$as_echo_n "checking for fgrep... " >&6; }
-if ${ac_cv_path_FGREP+:} false; then :
+if test "${ac_cv_path_FGREP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
@@ -6240,7 +6233,7 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
+if test "${ac_cv_path_SED+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
@@ -6326,7 +6319,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_NAWK+:} false; then :
+if test "${ac_cv_path_NAWK+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $NAWK in
@@ -6390,7 +6383,7 @@ THEPWDCMD=pwd
set dummy cygpath; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CYGPATH+:} false; then :
+if test "${ac_cv_path_CYGPATH+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $CYGPATH in
@@ -6430,7 +6423,7 @@ fi
set dummy readlink; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_READLINK+:} false; then :
+if test "${ac_cv_path_READLINK+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $READLINK in
@@ -6470,7 +6463,7 @@ fi
set dummy df; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_DF+:} false; then :
+if test "${ac_cv_path_DF+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $DF in
@@ -6510,7 +6503,7 @@ fi
set dummy SetFile; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_SETFILE+:} false; then :
+if test "${ac_cv_path_SETFILE+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $SETFILE in
@@ -6556,7 +6549,7 @@ $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
+if test "${ac_cv_build+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_build_alias=$build_alias
@@ -6572,7 +6565,7 @@ fi
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
@@ -6590,7 +6583,7 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
+if test "${ac_cv_host+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test "x$host_alias" = x; then
@@ -6605,7 +6598,7 @@ fi
$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
@@ -6623,7 +6616,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
$as_echo_n "checking target system type... " >&6; }
-if ${ac_cv_target+:} false; then :
+if test "${ac_cv_target+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test "x$target_alias" = x; then
@@ -6638,7 +6631,7 @@ fi
$as_echo "$ac_cv_target" >&6; }
case $ac_cv_target in
*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;;
esac
target=$ac_cv_target
ac_save_IFS=$IFS; IFS='-'
@@ -8164,7 +8157,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_PKGHANDLER+:} false; then :
+if test "${ac_cv_prog_PKGHANDLER+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$PKGHANDLER"; then
@@ -8529,7 +8522,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CHECK_GMAKE+:} false; then :
+if test "${ac_cv_path_CHECK_GMAKE+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $CHECK_GMAKE in
@@ -8883,7 +8876,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CHECK_MAKE+:} false; then :
+if test "${ac_cv_path_CHECK_MAKE+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $CHECK_MAKE in
@@ -9242,7 +9235,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CHECK_TOOLSDIR_GMAKE+:} false; then :
+if test "${ac_cv_path_CHECK_TOOLSDIR_GMAKE+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $CHECK_TOOLSDIR_GMAKE in
@@ -9595,7 +9588,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CHECK_TOOLSDIR_MAKE+:} false; then :
+if test "${ac_cv_path_CHECK_TOOLSDIR_MAKE+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $CHECK_TOOLSDIR_MAKE in
@@ -9991,7 +9984,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_UNZIP+:} false; then :
+if test "${ac_cv_path_UNZIP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $UNZIP in
@@ -10050,7 +10043,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ZIP+:} false; then :
+if test "${ac_cv_path_ZIP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $ZIP in
@@ -10109,7 +10102,7 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
set dummy ldd; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_LDD+:} false; then :
+if test "${ac_cv_path_LDD+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $LDD in
@@ -10155,7 +10148,7 @@ fi
set dummy otool; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_OTOOL+:} false; then :
+if test "${ac_cv_path_OTOOL+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $OTOOL in
@@ -10200,7 +10193,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_READELF+:} false; then :
+if test "${ac_cv_path_READELF+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $READELF in
@@ -10243,7 +10236,7 @@ done
set dummy hg; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_HG+:} false; then :
+if test "${ac_cv_path_HG+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $HG in
@@ -10283,7 +10276,7 @@ fi
set dummy stat; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_STAT+:} false; then :
+if test "${ac_cv_path_STAT+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $STAT in
@@ -10323,7 +10316,7 @@ fi
set dummy time; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_TIME+:} false; then :
+if test "${ac_cv_path_TIME+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $TIME in
@@ -10376,7 +10369,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_COMM+:} false; then :
+if test "${ac_cv_path_COMM+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $COMM in
@@ -10438,7 +10431,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_XATTR+:} false; then :
+if test "${ac_cv_path_XATTR+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $XATTR in
@@ -10494,7 +10487,7 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
set dummy codesign; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CODESIGN+:} false; then :
+if test "${ac_cv_path_CODESIGN+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $CODESIGN in
@@ -10558,7 +10551,7 @@ if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $PKG_CONFIG in
@@ -10601,7 +10594,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then
set dummy pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $ac_pt_PKG_CONFIG in
@@ -10774,7 +10767,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_BDEPS_UNZIP+:} false; then :
+if test "${ac_cv_prog_BDEPS_UNZIP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$BDEPS_UNZIP"; then
@@ -10820,7 +10813,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_BDEPS_FTP+:} false; then :
+if test "${ac_cv_prog_BDEPS_FTP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$BDEPS_FTP"; then
@@ -12116,7 +12109,7 @@ $as_echo "$BOOT_JDK_VERSION" >&6; }
set dummy javac; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_JAVAC_CHECK+:} false; then :
+if test "${ac_cv_path_JAVAC_CHECK+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $JAVAC_CHECK in
@@ -12156,7 +12149,7 @@ fi
set dummy java; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_JAVA_CHECK+:} false; then :
+if test "${ac_cv_path_JAVA_CHECK+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $JAVA_CHECK in
@@ -16485,7 +16478,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_JTREGEXE+:} false; then :
+if test "${ac_cv_path_JTREGEXE+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $JTREGEXE in
@@ -16553,7 +16546,7 @@ if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
set dummy link; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CYGWIN_LINK+:} false; then :
+if test "${ac_cv_path_CYGWIN_LINK+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $CYGWIN_LINK in
@@ -17996,7 +17989,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_BUILD_CC+:} false; then :
+if test "${ac_cv_path_BUILD_CC+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $BUILD_CC in
@@ -18307,7 +18300,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_BUILD_CXX+:} false; then :
+if test "${ac_cv_path_BUILD_CXX+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $BUILD_CXX in
@@ -18616,7 +18609,7 @@ $as_echo "$as_me: Rewriting BUILD_CXX to \"$new_complete\"" >&6;}
set dummy ld; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_BUILD_LD+:} false; then :
+if test "${ac_cv_path_BUILD_LD+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $BUILD_LD in
@@ -19123,7 +19116,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_TOOLS_DIR_CC+:} false; then :
+if test "${ac_cv_path_TOOLS_DIR_CC+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $TOOLS_DIR_CC in
@@ -19175,7 +19168,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_POTENTIAL_CC+:} false; then :
+if test "${ac_cv_path_POTENTIAL_CC+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $POTENTIAL_CC in
@@ -19588,7 +19581,7 @@ $as_echo "yes, trying to find proper $COMPILER_NAME compiler" >&6; }
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_PROPER_COMPILER_CC+:} false; then :
+if test "${ac_cv_prog_PROPER_COMPILER_CC+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$PROPER_COMPILER_CC"; then
@@ -19632,7 +19625,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_PROPER_COMPILER_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_PROPER_COMPILER_CC+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_PROPER_COMPILER_CC"; then
@@ -20082,7 +20075,7 @@ if test -n "$ac_tool_prefix"; then
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
@@ -20126,7 +20119,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
@@ -20179,7 +20172,7 @@ fi
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -20294,7 +20287,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
@@ -20337,7 +20330,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -20396,7 +20389,7 @@ $as_echo "$ac_try_echo"; } >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
fi
fi
fi
@@ -20407,7 +20400,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
+if test "${ac_cv_objext+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -20448,7 +20441,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
@@ -20458,7 +20451,7 @@ OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -20495,7 +20488,7 @@ ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
+if test "${ac_cv_prog_cc_g+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_save_c_werror_flag=$ac_c_werror_flag
@@ -20573,7 +20566,7 @@ else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
@@ -20696,7 +20689,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_TOOLS_DIR_CXX+:} false; then :
+if test "${ac_cv_path_TOOLS_DIR_CXX+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $TOOLS_DIR_CXX in
@@ -20748,7 +20741,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_POTENTIAL_CXX+:} false; then :
+if test "${ac_cv_path_POTENTIAL_CXX+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $POTENTIAL_CXX in
@@ -21161,7 +21154,7 @@ $as_echo "yes, trying to find proper $COMPILER_NAME compiler" >&6; }
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_PROPER_COMPILER_CXX+:} false; then :
+if test "${ac_cv_prog_PROPER_COMPILER_CXX+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$PROPER_COMPILER_CXX"; then
@@ -21205,7 +21198,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_PROPER_COMPILER_CXX+:} false; then :
+if test "${ac_cv_prog_ac_ct_PROPER_COMPILER_CXX+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_PROPER_COMPILER_CXX"; then
@@ -21659,7 +21652,7 @@ if test -z "$CXX"; then
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
+if test "${ac_cv_prog_CXX+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CXX"; then
@@ -21703,7 +21696,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CXX"; then
@@ -21781,7 +21774,7 @@ done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -21818,7 +21811,7 @@ ac_test_CXXFLAGS=${CXXFLAGS+set}
ac_save_CXXFLAGS=$CXXFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
+if test "${ac_cv_prog_cxx_g+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
@@ -21916,7 +21909,7 @@ if test -n "$ac_tool_prefix"; then
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJC+:} false; then :
+if test "${ac_cv_prog_OBJC+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$OBJC"; then
@@ -21960,7 +21953,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJC+:} false; then :
+if test "${ac_cv_prog_ac_ct_OBJC+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OBJC"; then
@@ -22036,7 +22029,7 @@ done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Objective C compiler" >&5
$as_echo_n "checking whether we are using the GNU Objective C compiler... " >&6; }
-if ${ac_cv_objc_compiler_gnu+:} false; then :
+if test "${ac_cv_objc_compiler_gnu+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -22073,7 +22066,7 @@ ac_test_OBJCFLAGS=${OBJCFLAGS+set}
ac_save_OBJCFLAGS=$OBJCFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $OBJC accepts -g" >&5
$as_echo_n "checking whether $OBJC accepts -g... " >&6; }
-if ${ac_cv_prog_objc_g+:} false; then :
+if test "${ac_cv_prog_objc_g+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_save_objc_werror_flag=$ac_objc_werror_flag
@@ -22449,7 +22442,7 @@ if test "x$OPENJDK_TARGET_OS" != xwindows; then
set dummy ${ac_tool_prefix}ar; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
+if test "${ac_cv_prog_AR+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$AR"; then
@@ -22489,7 +22482,7 @@ if test -z "$ac_cv_prog_AR"; then
set dummy ar; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_AR"; then
@@ -22831,7 +22824,7 @@ if test "x$OPENJDK_TARGET_OS" = xwindows; then :
set dummy link; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_WINLD+:} false; then :
+if test "${ac_cv_prog_WINLD+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$WINLD"; then
@@ -23170,7 +23163,7 @@ $as_echo "yes" >&6; }
set dummy mt; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MT+:} false; then :
+if test "${ac_cv_prog_MT+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$MT"; then
@@ -23491,7 +23484,7 @@ $as_echo "$as_me: Rewriting MT to \"$new_complete\"" >&6;}
set dummy rc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RC+:} false; then :
+if test "${ac_cv_prog_RC+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$RC"; then
@@ -23883,7 +23876,7 @@ fi
set dummy lib; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_WINAR+:} false; then :
+if test "${ac_cv_prog_WINAR+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$WINAR"; then
@@ -24189,7 +24182,7 @@ $as_echo "$as_me: Rewriting WINAR to \"$new_complete\"" >&6;}
set dummy dumpbin; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DUMPBIN+:} false; then :
+if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$DUMPBIN"; then
@@ -24508,7 +24501,7 @@ if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
+ if test "${ac_cv_prog_CPP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
# Double quotes because CPP needs to be expanded
@@ -24624,7 +24617,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
fi
ac_ext=cpp
@@ -24908,7 +24901,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
if test -z "$CXXCPP"; then
- if ${ac_cv_prog_CXXCPP+:} false; then :
+ if test "${ac_cv_prog_CXXCPP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
# Double quotes because CXXCPP needs to be expanded
@@ -25024,7 +25017,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
fi
ac_ext=cpp
@@ -25326,7 +25319,7 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then
set dummy as; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_AS+:} false; then :
+if test "${ac_cv_path_AS+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $AS in
@@ -25638,7 +25631,7 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then
set dummy nm; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_NM+:} false; then :
+if test "${ac_cv_path_NM+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $NM in
@@ -25944,7 +25937,7 @@ $as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;}
set dummy gnm; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_GNM+:} false; then :
+if test "${ac_cv_path_GNM+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $GNM in
@@ -26250,7 +26243,7 @@ $as_echo "$as_me: Rewriting GNM to \"$new_complete\"" >&6;}
set dummy strip; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_STRIP+:} false; then :
+if test "${ac_cv_path_STRIP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $STRIP in
@@ -26556,7 +26549,7 @@ $as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;}
set dummy mcs; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MCS+:} false; then :
+if test "${ac_cv_path_MCS+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $MCS in
@@ -26864,7 +26857,7 @@ elif test "x$OPENJDK_TARGET_OS" != xwindows; then
set dummy ${ac_tool_prefix}nm; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_NM+:} false; then :
+if test "${ac_cv_prog_NM+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$NM"; then
@@ -26904,7 +26897,7 @@ if test -z "$ac_cv_prog_NM"; then
set dummy nm; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_NM+:} false; then :
+if test "${ac_cv_prog_ac_ct_NM+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_NM"; then
@@ -27224,7 +27217,7 @@ $as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;}
set dummy ${ac_tool_prefix}strip; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
+if test "${ac_cv_prog_STRIP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$STRIP"; then
@@ -27264,7 +27257,7 @@ if test -z "$ac_cv_prog_STRIP"; then
set dummy strip; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_STRIP"; then
@@ -27589,7 +27582,7 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux;
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJCOPY+:} false; then :
+if test "${ac_cv_prog_OBJCOPY+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$OBJCOPY"; then
@@ -27633,7 +27626,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJCOPY+:} false; then :
+if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OBJCOPY"; then
@@ -27960,7 +27953,7 @@ if test -n "$ac_tool_prefix"; then
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$OBJDUMP"; then
@@ -28004,7 +27997,7 @@ do
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OBJDUMP"; then
@@ -28328,7 +28321,7 @@ if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
set dummy lipo; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_LIPO+:} false; then :
+if test "${ac_cv_path_LIPO+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $LIPO in
@@ -28645,7 +28638,7 @@ PATH="$OLD_PATH"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
+if test "${ac_cv_header_stdc+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -28785,17 +28778,16 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then
# keep track of c/cxx flags that we added outselves...
# to prevent emitting warning...
- ADDED_CFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
- ADDED_CXXFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
- ADDED_LDFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
+ TARGET_BITS_FLAG="-m${OPENJDK_TARGET_CPU_BITS}"
- CFLAGS="${CFLAGS}${ADDED_CFLAGS}"
- CXXFLAGS="${CXXFLAGS}${ADDED_CXXFLAGS}"
- LDFLAGS="${LDFLAGS}${ADDED_LDFLAGS}"
- CFLAGS_JDK="${CFLAGS_JDK}${ADDED_CFLAGS}"
- CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}"
- LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}"
+ CFLAGS="${CFLAGS} ${TARGET_BITS_FLAG}"
+ CXXFLAGS="${CXXFLAGS} ${TARGET_BITS_FLAG}"
+ LDFLAGS="${LDFLAGS} ${TARGET_BITS_FLAG}"
+
+ CFLAGS_JDK="${CFLAGS_JDK} ${TARGET_BITS_FLAG}"
+ CXXFLAGS_JDK="${CXXFLAGS_JDK} ${TARGET_BITS_FLAG}"
+ LDFLAGS_JDK="${LDFLAGS_JDK} ${TARGET_BITS_FLAG}"
elif test "x$COMPILE_TYPE" = xreduced; then
if test "x$OPENJDK_TARGET_OS" != xwindows; then
@@ -28803,17 +28795,16 @@ elif test "x$COMPILE_TYPE" = xreduced; then
# keep track of c/cxx flags that we added outselves...
# to prevent emitting warning...
- ADDED_CFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
- ADDED_CXXFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
- ADDED_LDFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
+ TARGET_BITS_FLAG="-m${OPENJDK_TARGET_CPU_BITS}"
- CFLAGS="${CFLAGS}${ADDED_CFLAGS}"
- CXXFLAGS="${CXXFLAGS}${ADDED_CXXFLAGS}"
- LDFLAGS="${LDFLAGS}${ADDED_LDFLAGS}"
- CFLAGS_JDK="${CFLAGS_JDK}${ADDED_CFLAGS}"
- CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}"
- LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}"
+ CFLAGS="${CFLAGS} ${TARGET_BITS_FLAG}"
+ CXXFLAGS="${CXXFLAGS} ${TARGET_BITS_FLAG}"
+ LDFLAGS="${LDFLAGS} ${TARGET_BITS_FLAG}"
+
+ CFLAGS_JDK="${CFLAGS_JDK} ${TARGET_BITS_FLAG}"
+ CXXFLAGS_JDK="${CXXFLAGS_JDK} ${TARGET_BITS_FLAG}"
+ LDFLAGS_JDK="${LDFLAGS_JDK} ${TARGET_BITS_FLAG}"
fi
fi
@@ -28822,7 +28813,7 @@ fi
for ac_header in stdio.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdio_h" = xyes; then :
+if test "x$ac_cv_header_stdio_h" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STDIO_H 1
_ACEOF
@@ -28851,7 +28842,7 @@ done
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int *" >&5
$as_echo_n "checking size of int *... " >&6; }
-if ${ac_cv_sizeof_int_p+:} false; then :
+if test "${ac_cv_sizeof_int_p+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (int *))" "ac_cv_sizeof_int_p" "$ac_includes_default"; then :
@@ -28861,7 +28852,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (int *)
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_int_p=0
fi
@@ -28908,7 +28899,7 @@ $as_echo "$OPENJDK_TARGET_CPU_BITS bits" >&6; }
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if ${ac_cv_c_bigendian+:} false; then :
+if test "${ac_cv_c_bigendian+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_cv_c_bigendian=unknown
@@ -30084,8 +30075,8 @@ if test "x$with_x" = xno; then
have_x=disabled
else
case $x_includes,$x_libraries in #(
- *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
- *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
+ *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5 ;; #(
+ *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then :
$as_echo_n "(cached) " >&6
else
# One or both of the vars are not set, and there is no cached value.
@@ -30362,7 +30353,7 @@ if ac_fn_cxx_try_link "$LINENO"; then :
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5
$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
-if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then :
+if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -30396,14 +30387,14 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then :
+if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
fi
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5
$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
-if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then :
+if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -30437,7 +30428,7 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then :
+if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
fi
@@ -30456,14 +30447,14 @@ rm -f core conftest.err conftest.$ac_objext \
# The functions gethostbyname, getservbyname, and inet_addr are
# in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
ac_fn_cxx_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
-if test "x$ac_cv_func_gethostbyname" = xyes; then :
+if test "x$ac_cv_func_gethostbyname" = x""yes; then :
fi
if test $ac_cv_func_gethostbyname = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -30497,14 +30488,14 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
+if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
fi
if test $ac_cv_lib_nsl_gethostbyname = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5
$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
-if ${ac_cv_lib_bsd_gethostbyname+:} false; then :
+if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -30538,7 +30529,7 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5
$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
-if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then :
+if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
fi
@@ -30553,14 +30544,14 @@ fi
# must be given before -lnsl if both are needed. We assume that
# if connect needs -lnsl, so does gethostbyname.
ac_fn_cxx_check_func "$LINENO" "connect" "ac_cv_func_connect"
-if test "x$ac_cv_func_connect" = xyes; then :
+if test "x$ac_cv_func_connect" = x""yes; then :
fi
if test $ac_cv_func_connect = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5
$as_echo_n "checking for connect in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_connect+:} false; then :
+if test "${ac_cv_lib_socket_connect+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -30594,7 +30585,7 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5
$as_echo "$ac_cv_lib_socket_connect" >&6; }
-if test "x$ac_cv_lib_socket_connect" = xyes; then :
+if test "x$ac_cv_lib_socket_connect" = x""yes; then :
X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
fi
@@ -30602,14 +30593,14 @@ fi
# Guillermo Gomez says -lposix is necessary on A/UX.
ac_fn_cxx_check_func "$LINENO" "remove" "ac_cv_func_remove"
-if test "x$ac_cv_func_remove" = xyes; then :
+if test "x$ac_cv_func_remove" = x""yes; then :
fi
if test $ac_cv_func_remove = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5
$as_echo_n "checking for remove in -lposix... " >&6; }
-if ${ac_cv_lib_posix_remove+:} false; then :
+if test "${ac_cv_lib_posix_remove+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -30643,7 +30634,7 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5
$as_echo "$ac_cv_lib_posix_remove" >&6; }
-if test "x$ac_cv_lib_posix_remove" = xyes; then :
+if test "x$ac_cv_lib_posix_remove" = x""yes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
fi
@@ -30651,14 +30642,14 @@ fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
ac_fn_cxx_check_func "$LINENO" "shmat" "ac_cv_func_shmat"
-if test "x$ac_cv_func_shmat" = xyes; then :
+if test "x$ac_cv_func_shmat" = x""yes; then :
fi
if test $ac_cv_func_shmat = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5
$as_echo_n "checking for shmat in -lipc... " >&6; }
-if ${ac_cv_lib_ipc_shmat+:} false; then :
+if test "${ac_cv_lib_ipc_shmat+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -30692,7 +30683,7 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5
$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
-if test "x$ac_cv_lib_ipc_shmat" = xyes; then :
+if test "x$ac_cv_lib_ipc_shmat" = x""yes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
fi
@@ -30710,7 +30701,7 @@ fi
# John Interrante, Karl Berry
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5
$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
-if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then :
+if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -30744,7 +30735,7 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
-if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then :
+if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then :
X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
fi
@@ -31762,7 +31753,7 @@ $as_echo "$FREETYPE2_FOUND" >&6; }
LDFLAGS="$FREETYPE2_LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_Init_FreeType in -lfreetype" >&5
$as_echo_n "checking for FT_Init_FreeType in -lfreetype... " >&6; }
-if ${ac_cv_lib_freetype_FT_Init_FreeType+:} false; then :
+if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -31796,7 +31787,7 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5
$as_echo "$ac_cv_lib_freetype_FT_Init_FreeType" >&6; }
-if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = xyes; then :
+if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = x""yes; then :
FREETYPE2_FOUND=true
else
as_fn_error $? "Could not find freetype2! $HELP_MSG " "$LINENO" 5
@@ -32084,7 +32075,7 @@ fi
for ac_header in alsa/asoundlib.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "alsa/asoundlib.h" "ac_cv_header_alsa_asoundlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_alsa_asoundlib_h" = xyes; then :
+if test "x$ac_cv_header_alsa_asoundlib_h" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_ALSA_ASOUNDLIB_H 1
_ACEOF
@@ -32143,7 +32134,7 @@ fi
USE_EXTERNAL_LIBJPEG=true
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ljpeg" >&5
$as_echo_n "checking for main in -ljpeg... " >&6; }
-if ${ac_cv_lib_jpeg_main+:} false; then :
+if test "${ac_cv_lib_jpeg_main+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -32171,7 +32162,7 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_main" >&5
$as_echo "$ac_cv_lib_jpeg_main" >&6; }
-if test "x$ac_cv_lib_jpeg_main" = xyes; then :
+if test "x$ac_cv_lib_jpeg_main" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBJPEG 1
_ACEOF
@@ -32220,7 +32211,7 @@ if test "x${with_giflib}" = "xbundled"; then
USE_EXTERNAL_LIBGIF=false
elif test "x${with_giflib}" = "xsystem"; then
ac_fn_cxx_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default"
-if test "x$ac_cv_header_gif_lib_h" = xyes; then :
+if test "x$ac_cv_header_gif_lib_h" = x""yes; then :
else
as_fn_error $? "--with-giflib=system specified, but gif_lib.h not found!" "$LINENO" 5
@@ -32229,7 +32220,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifGetCode in -lgif" >&5
$as_echo_n "checking for DGifGetCode in -lgif... " >&6; }
-if ${ac_cv_lib_gif_DGifGetCode+:} false; then :
+if test "${ac_cv_lib_gif_DGifGetCode+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -32263,7 +32254,7 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifGetCode" >&5
$as_echo "$ac_cv_lib_gif_DGifGetCode" >&6; }
-if test "x$ac_cv_lib_gif_DGifGetCode" = xyes; then :
+if test "x$ac_cv_lib_gif_DGifGetCode" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGIF 1
_ACEOF
@@ -32295,7 +32286,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5
$as_echo_n "checking for compress in -lz... " >&6; }
-if ${ac_cv_lib_z_compress+:} false; then :
+if test "${ac_cv_lib_z_compress+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -32329,7 +32320,7 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress" >&5
$as_echo "$ac_cv_lib_z_compress" >&6; }
-if test "x$ac_cv_lib_z_compress" = xyes; then :
+if test "x$ac_cv_lib_z_compress" = x""yes; then :
ZLIB_FOUND=yes
else
ZLIB_FOUND=no
@@ -32422,7 +32413,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5
$as_echo_n "checking for cos in -lm... " >&6; }
-if ${ac_cv_lib_m_cos+:} false; then :
+if test "${ac_cv_lib_m_cos+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -32456,7 +32447,7 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5
$as_echo "$ac_cv_lib_m_cos" >&6; }
-if test "x$ac_cv_lib_m_cos" = xyes; then :
+if test "x$ac_cv_lib_m_cos" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBM 1
_ACEOF
@@ -32480,7 +32471,7 @@ save_LIBS="$LIBS"
LIBS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -32514,7 +32505,7 @@ LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBDL 1
_ACEOF
@@ -32744,7 +32735,7 @@ and LIBFFI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see .
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
else
LIBFFI_CFLAGS=$pkg_cv_LIBFFI_CFLAGS
LIBFFI_LIBS=$pkg_cv_LIBFFI_LIBS
@@ -32760,7 +32751,7 @@ if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
set dummy llvm-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_LLVM_CONFIG+:} false; then :
+if test "${ac_cv_prog_LLVM_CONFIG+set}" = set; then :
$as_echo_n "(cached) " >&6
else
if test -n "$LLVM_CONFIG"; then
@@ -33376,7 +33367,7 @@ fi
set dummy ccache; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CCACHE+:} false; then :
+if test "${ac_cv_path_CCACHE+set}" = set; then :
$as_echo_n "(cached) " >&6
else
case $CCACHE in
@@ -33638,21 +33629,10 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
- if test "x$cache_file" != "x/dev/null"; then
+ test "x$cache_file" != "x/dev/null" &&
{ $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
$as_echo "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
+ cat confcache >$cache_file
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -33684,7 +33664,7 @@ LTLIBOBJS=$ac_ltlibobjs
-: "${CONFIG_STATUS=./config.status}"
+: ${CONFIG_STATUS=./config.status}
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -33785,7 +33765,6 @@ fi
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -34093,7 +34072,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by OpenJDK $as_me jdk8, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.67. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -34156,7 +34135,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
OpenJDK config.status jdk8
-configured by $0, generated by GNU Autoconf 2.68,
+configured by $0, generated by GNU Autoconf 2.67,
with options \\"\$ac_cs_config\\"
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -34285,7 +34264,7 @@ do
"$OUTPUT_ROOT/spec.sh") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in" ;;
"$OUTPUT_ROOT/Makefile") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in" ;;
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
esac
done
@@ -34307,10 +34286,9 @@ fi
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
- tmp= ac_tmp=
+ tmp=
trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
' 0
trap 'as_fn_exit 1' 1 2 13 15
}
@@ -34318,13 +34296,12 @@ $debug ||
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
+ test -n "$tmp" && test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
@@ -34346,7 +34323,7 @@ else
ac_cs_awk_cr=$ac_cr
fi
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
_ACEOF
@@ -34374,7 +34351,7 @@ done
rm -f conf$$subs.sh
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
@@ -34422,7 +34399,7 @@ t delim
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = ""
@@ -34454,7 +34431,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
|| as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
@@ -34488,7 +34465,7 @@ fi # test -n "$CONFIG_FILES"
# No need to generate them if there are no CONFIG_HEADERS.
# This happens for instance with `./config.status Makefile'.
if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+cat >"$tmp/defines.awk" <<\_ACAWK ||
BEGIN {
_ACEOF
@@ -34500,8 +34477,8 @@ _ACEOF
# handling of long lines.
ac_delim='%!_!# '
for ac_last_try in false false :; do
- ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
- if test -z "$ac_tt"; then
+ ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_t"; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
@@ -34602,7 +34579,7 @@ do
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
@@ -34621,7 +34598,7 @@ do
for ac_f
do
case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
+ -) ac_f="$tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
@@ -34630,7 +34607,7 @@ do
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
@@ -34656,8 +34633,8 @@ $as_echo "$as_me: creating $ac_file" >&6;}
esac
case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ *:-:* | *:-) cat >"$tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
@@ -34782,22 +34759,21 @@ s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
$ac_datarootdir_hack
"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
- rm -f "$ac_tmp/stdin"
+ rm -f "$tmp/stdin"
case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ -) cat "$tmp/out" && rm -f "$tmp/out";;
+ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
esac \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
@@ -34808,20 +34784,20 @@ which seems to be undefined. Please make sure it is defined" >&2;}
if test x"$ac_file" != x-; then
{
$as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
- } >"$ac_tmp/config.h" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+ } >"$tmp/config.h" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
- if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
$as_echo "$as_me: $ac_file is unchanged" >&6;}
else
rm -f "$ac_file"
- mv "$ac_tmp/config.h" "$ac_file" \
+ mv "$tmp/config.h" "$ac_file" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
fi
else
$as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
|| as_fn_error $? "could not create -" "$LINENO" 5
fi
;;
diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4
index 889b99ed727..ed2581c1005 100644
--- a/common/autoconf/platform.m4
+++ b/common/autoconf/platform.m4
@@ -412,17 +412,16 @@ AC_DEFUN([PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS],
[
# keep track of c/cxx flags that we added outselves...
# to prevent emitting warning...
- ADDED_CFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
- ADDED_CXXFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
- ADDED_LDFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
+ TARGET_BITS_FLAG="-m${OPENJDK_TARGET_CPU_BITS}"
+ AC_SUBST(TARGET_BITS_FLAG)
- CFLAGS="${CFLAGS}${ADDED_CFLAGS}"
- CXXFLAGS="${CXXFLAGS}${ADDED_CXXFLAGS}"
- LDFLAGS="${LDFLAGS}${ADDED_LDFLAGS}"
+ CFLAGS="${CFLAGS} ${TARGET_BITS_FLAG}"
+ CXXFLAGS="${CXXFLAGS} ${TARGET_BITS_FLAG}"
+ LDFLAGS="${LDFLAGS} ${TARGET_BITS_FLAG}"
- CFLAGS_JDK="${CFLAGS_JDK}${ADDED_CFLAGS}"
- CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}"
- LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}"
+ CFLAGS_JDK="${CFLAGS_JDK} ${TARGET_BITS_FLAG}"
+ CXXFLAGS_JDK="${CXXFLAGS_JDK} ${TARGET_BITS_FLAG}"
+ LDFLAGS_JDK="${LDFLAGS_JDK} ${TARGET_BITS_FLAG}"
])
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS],
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index c30fd35dc18..d2ffb614bcc 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -304,6 +304,7 @@ MACOSX_VERSION_MIN=@MACOSX_VERSION_MIN@
COMPILER_TYPE:=@COMPILER_TYPE@
COMPILER_NAME:=@COMPILER_NAME@
+TARGET_BITS_FLAG=@TARGET_BITS_FLAG@
COMPILER_SUPPORTS_TARGET_BITS_FLAG=@COMPILER_SUPPORTS_TARGET_BITS_FLAG@
CC_OUT_OPTION:=@CC_OUT_OPTION@
diff --git a/common/makefiles/IdlCompilation.gmk b/common/makefiles/IdlCompilation.gmk
index b03ea43a9e5..94cc15476ad 100644
--- a/common/makefiles/IdlCompilation.gmk
+++ b/common/makefiles/IdlCompilation.gmk
@@ -83,9 +83,6 @@ $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NE
$(call LogSetupMacroEntry,SetupIdlCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
$(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk))
-# Remove any relative addressing in the paths.
-$1_SRC := $$(abspath $$($1_SRC))
-$1_BIN := $$(abspath $$($1_BIN))
# Find all existing java files and existing class files.
$$(eval $$(call MakeDir,$$($1_BIN)))
$1_SRCS := $$(shell find $$($1_SRC) -name "*.idl")
diff --git a/common/makefiles/Main.gmk b/common/makefiles/Main.gmk
index 1214ce56427..dd99df2d526 100644
--- a/common/makefiles/Main.gmk
+++ b/common/makefiles/Main.gmk
@@ -204,7 +204,7 @@ clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jd
# If the output directory was created by configure and now becomes empty, remove it as well.
# FIXME: tmp should not be here, fix ResetTimers instead. And remove spec.sh!
dist-clean: clean
- @($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments Makefile compare.sh spec.sh tmp)
+ @($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments Makefile compare.sh spec.sh tmp javacservers)
@$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
$(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ;\
diff --git a/corba/.hgtags b/corba/.hgtags
index dde93b19425..6aa967721af 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -223,3 +223,5 @@ c8286839d0df04aba819ec4bef12b86babccf30e jdk8-b90
3f67804ab61303782df57e54989ef5e0e4629beb jdk8-b99
8d492f1dfd1b131a4c7886ee6b59528609f7e4fe jdk8-b100
a013024b07475782f1fa8e196e950b34b4077663 jdk8-b101
+528c7e76eaeee022817ee085668459bc97cf5665 jdk8-b102
+49c4a777fdfd648d4c3fffc940fdb97a23108ca8 jdk8-b103
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaInputStream.sjava b/corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaInputStream.sjava
deleted file mode 100644
index 648ff3f4fb7..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaInputStream.sjava
+++ /dev/null
@@ -1,528 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.corba.se.impl.encoding;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-
-import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.Principal;
-import org.omg.CORBA.Any;
-
-import com.sun.org.omg.SendingContext.CodeBase;
-
-import com.sun.corba.se.pept.protocol.MessageMediator;
-
-import com.sun.corba.se.spi.logging.CORBALogDomains;
-import com.sun.corba.se.spi.orb.ORB;
-import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
-import com.sun.corba.se.spi.protocol.CorbaMessageMediator;
-
-import com.sun.corba.se.impl.logging.ORBUtilSystemException;
-import com.sun.corba.se.impl.encoding.CodeSetConversion;
-import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry;
-
-/**
- * This is delegates to the real implementation.
- *
- * NOTE:
- *
- * Before using the stream for valuetype unmarshaling, one must call
- * performORBVersionSpecificInit().
- */
-public abstract class CDRInputStream
- extends org.omg.CORBA_2_3.portable.InputStream
- implements com.sun.corba.se.impl.encoding.MarshalInputStream,
- org.omg.CORBA.DataInputStream, org.omg.CORBA.portable.ValueInputStream
-{
- protected CorbaMessageMediator messageMediator;
- private CDRInputStreamBase impl;
-
- // We can move this out somewhere later. For now, it serves its purpose
- // to create a concrete CDR delegate based on the GIOP version.
- private static class InputStreamFactory {
-
- public static CDRInputStreamBase newInputStream(ORB orb, GIOPVersion version)
- {
- switch(version.intValue()) {
- case GIOPVersion.VERSION_1_0:
- return new CDRInputStream_1_0();
- case GIOPVersion.VERSION_1_1:
- return new CDRInputStream_1_1();
- case GIOPVersion.VERSION_1_2:
- return new CDRInputStream_1_2();
- default:
- ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
- CORBALogDomains.RPC_ENCODING ) ;
- throw wrapper.unsupportedGiopVersion( version ) ;
- }
- }
- }
-
- // Required for the case when a ClientResponseImpl is
- // created with a SystemException due to a dead server/closed
- // connection with no warning. Note that the stream will
- // not be initialized in this case.
- //
- // Probably also required by ServerRequestImpl.
- //
- // REVISIT.
- public CDRInputStream() {
- }
-
- public CDRInputStream(CDRInputStream is) {
- impl = is.impl.dup();
- impl.setParent(this);
- }
-
- public CDRInputStream(org.omg.CORBA.ORB orb,
- ByteBuffer byteBuffer,
- int size,
- boolean littleEndian,
- GIOPVersion version,
- BufferManagerRead bufMgr)
- {
- impl = InputStreamFactory.newInputStream( (ORB)orb, version);
-
- impl.init(orb, byteBuffer, size, littleEndian, bufMgr);
-
- impl.setParent(this);
- }
-
- // org.omg.CORBA.portable.InputStream
- public final boolean read_boolean() {
- return impl.read_boolean();
- }
-
- public final char read_char() {
- return impl.read_char();
- }
-
- public final char read_wchar() {
- return impl.read_wchar();
- }
-
- public final byte read_octet() {
- return impl.read_octet();
- }
-
- public final short read_short() {
- return impl.read_short();
- }
-
- public final short read_ushort() {
- return impl.read_ushort();
- }
-
- public final int read_long() {
- return impl.read_long();
- }
-
- public final int read_ulong() {
- return impl.read_ulong();
- }
-
- public final long read_longlong() {
- return impl.read_longlong();
- }
-
- public final long read_ulonglong() {
- return impl.read_ulonglong();
- }
-
- public final float read_float() {
- return impl.read_float();
- }
-
- public final double read_double() {
- return impl.read_double();
- }
-
- public final String read_string() {
- return impl.read_string();
- }
-
- public final String read_wstring() {
- return impl.read_wstring();
- }
-
- public final void read_boolean_array(boolean[] value, int offset, int length) {
- impl.read_boolean_array(value, offset, length);
- }
-
- public final void read_char_array(char[] value, int offset, int length) {
- impl.read_char_array(value, offset, length);
- }
-
- public final void read_wchar_array(char[] value, int offset, int length) {
- impl.read_wchar_array(value, offset, length);
- }
-
- public final void read_octet_array(byte[] value, int offset, int length) {
- impl.read_octet_array(value, offset, length);
- }
-
- public final void read_short_array(short[] value, int offset, int length) {
- impl.read_short_array(value, offset, length);
- }
-
- public final void read_ushort_array(short[] value, int offset, int length) {
- impl.read_ushort_array(value, offset, length);
- }
-
- public final void read_long_array(int[] value, int offset, int length) {
- impl.read_long_array(value, offset, length);
- }
-
- public final void read_ulong_array(int[] value, int offset, int length) {
- impl.read_ulong_array(value, offset, length);
- }
-
- public final void read_longlong_array(long[] value, int offset, int length) {
- impl.read_longlong_array(value, offset, length);
- }
-
- public final void read_ulonglong_array(long[] value, int offset, int length) {
- impl.read_ulonglong_array(value, offset, length);
- }
-
- public final void read_float_array(float[] value, int offset, int length) {
- impl.read_float_array(value, offset, length);
- }
-
- public final void read_double_array(double[] value, int offset, int length) {
- impl.read_double_array(value, offset, length);
- }
-
- public final org.omg.CORBA.Object read_Object() {
- return impl.read_Object();
- }
-
- public final TypeCode read_TypeCode() {
- return impl.read_TypeCode();
- }
- public final Any read_any() {
- return impl.read_any();
- }
-
- public final Principal read_Principal() {
- return impl.read_Principal();
- }
-
- public final int read() throws java.io.IOException {
- return impl.read();
- }
-
- public final java.math.BigDecimal read_fixed() {
- return impl.read_fixed();
- }
-
- public final org.omg.CORBA.Context read_Context() {
- return impl.read_Context();
- }
-
- public final org.omg.CORBA.Object read_Object(java.lang.Class clz) {
- return impl.read_Object(clz);
- }
-
- public final org.omg.CORBA.ORB orb() {
- return impl.orb();
- }
-
- // org.omg.CORBA_2_3.portable.InputStream
- public final java.io.Serializable read_value() {
- return impl.read_value();
- }
-
- public final java.io.Serializable read_value(java.lang.Class clz) {
- return impl.read_value(clz);
- }
-
- public final java.io.Serializable read_value(org.omg.CORBA.portable.BoxedValueHelper factory) {
- return impl.read_value(factory);
- }
-
- public final java.io.Serializable read_value(java.lang.String rep_id) {
- return impl.read_value(rep_id);
- }
-
- public final java.io.Serializable read_value(java.io.Serializable value) {
- return impl.read_value(value);
- }
-
- public final java.lang.Object read_abstract_interface() {
- return impl.read_abstract_interface();
- }
-
- public final java.lang.Object read_abstract_interface(java.lang.Class clz) {
- return impl.read_abstract_interface(clz);
- }
- // com.sun.corba.se.impl.encoding.MarshalInputStream
-
- public final void consumeEndian() {
- impl.consumeEndian();
- }
-
- public final int getPosition() {
- return impl.getPosition();
- }
-
- // org.omg.CORBA.DataInputStream
-
- public final java.lang.Object read_Abstract () {
- return impl.read_Abstract();
- }
-
- public final java.io.Serializable read_Value () {
- return impl.read_Value();
- }
-
- public final void read_any_array (org.omg.CORBA.AnySeqHolder seq, int offset, int length) {
- impl.read_any_array(seq, offset, length);
- }
-
- public final void read_boolean_array (org.omg.CORBA.BooleanSeqHolder seq, int offset, int length) {
- impl.read_boolean_array(seq, offset, length);
- }
-
- public final void read_char_array (org.omg.CORBA.CharSeqHolder seq, int offset, int length) {
- impl.read_char_array(seq, offset, length);
- }
-
- public final void read_wchar_array (org.omg.CORBA.WCharSeqHolder seq, int offset, int length) {
- impl.read_wchar_array(seq, offset, length);
- }
-
- public final void read_octet_array (org.omg.CORBA.OctetSeqHolder seq, int offset, int length) {
- impl.read_octet_array(seq, offset, length);
- }
-
- public final void read_short_array (org.omg.CORBA.ShortSeqHolder seq, int offset, int length) {
- impl.read_short_array(seq, offset, length);
- }
-
- public final void read_ushort_array (org.omg.CORBA.UShortSeqHolder seq, int offset, int length) {
- impl.read_ushort_array(seq, offset, length);
- }
-
- public final void read_long_array (org.omg.CORBA.LongSeqHolder seq, int offset, int length) {
- impl.read_long_array(seq, offset, length);
- }
-
- public final void read_ulong_array (org.omg.CORBA.ULongSeqHolder seq, int offset, int length) {
- impl.read_ulong_array(seq, offset, length);
- }
-
- public final void read_ulonglong_array (org.omg.CORBA.ULongLongSeqHolder seq, int offset, int length) {
- impl.read_ulonglong_array(seq, offset, length);
- }
-
- public final void read_longlong_array (org.omg.CORBA.LongLongSeqHolder seq, int offset, int length) {
- impl.read_longlong_array(seq, offset, length);
- }
-
- public final void read_float_array (org.omg.CORBA.FloatSeqHolder seq, int offset, int length) {
- impl.read_float_array(seq, offset, length);
- }
-
- public final void read_double_array (org.omg.CORBA.DoubleSeqHolder seq, int offset, int length) {
- impl.read_double_array(seq, offset, length);
- }
-
- // org.omg.CORBA.portable.ValueBase
- public final String[] _truncatable_ids() {
- return impl._truncatable_ids();
- }
-
- // java.io.InputStream
- public final int read(byte b[]) throws IOException {
- return impl.read(b);
- }
-
- public final int read(byte b[], int off, int len) throws IOException {
- return impl.read(b, off, len);
- }
-
- public final long skip(long n) throws IOException {
- return impl.skip(n);
- }
-
- public final int available() throws IOException {
- return impl.available();
- }
-
- public final void close() throws IOException {
- impl.close();
- }
-
- public final void mark(int readlimit) {
- impl.mark(readlimit);
- }
-
- public final void reset() {
- impl.reset();
- }
-
- public final boolean markSupported() {
- return impl.markSupported();
- }
-
- public abstract CDRInputStream dup();
-
- // Needed by TCUtility
- public final java.math.BigDecimal read_fixed(short digits, short scale) {
- return impl.read_fixed(digits, scale);
- }
-
- public final boolean isLittleEndian() {
- return impl.isLittleEndian();
- }
-
- protected final ByteBuffer getByteBuffer() {
- return impl.getByteBuffer();
- }
-
- protected final void setByteBuffer(ByteBuffer byteBuffer) {
- impl.setByteBuffer(byteBuffer);
- }
-
- protected final void setByteBufferWithInfo(ByteBufferWithInfo bbwi) {
- impl.setByteBufferWithInfo(bbwi);
- }
-
- public final int getBufferLength() {
- return impl.getBufferLength();
- }
-
- protected final void setBufferLength(int value) {
- impl.setBufferLength(value);
- }
-
- protected final int getIndex() {
- return impl.getIndex();
- }
-
- protected final void setIndex(int value) {
- impl.setIndex(value);
- }
-
- public final void orb(org.omg.CORBA.ORB orb) {
- impl.orb(orb);
- }
-
- public final GIOPVersion getGIOPVersion() {
- return impl.getGIOPVersion();
- }
-
- public final BufferManagerRead getBufferManager() {
- return impl.getBufferManager();
- }
-
- // This should be overridden by any stream (ex: IIOPInputStream)
- // which wants to read values. Thus, TypeCodeInputStream doesn't
- // have to do this.
- public CodeBase getCodeBase() {
- return null;
- }
-
- // Use Latin-1 for GIOP 1.0 or when code set negotiation was not
- // performed.
- protected CodeSetConversion.BTCConverter createCharBTCConverter() {
- return CodeSetConversion.impl().getBTCConverter(OSFCodeSetRegistry.ISO_8859_1,
- impl.isLittleEndian());
- }
-
- // Subclasses must decide what to do here. It's inconvenient to
- // make the class and this method abstract because of dup().
- protected abstract CodeSetConversion.BTCConverter createWCharBTCConverter();
-
- // Prints the current buffer in a human readable form
- void printBuffer() {
- impl.printBuffer();
- }
-
- /**
- * Aligns the current position on the given octet boundary
- * if there are enough bytes available to do so. Otherwise,
- * it just returns. This is used for some (but not all)
- * GIOP 1.2 message headers.
- */
- public void alignOnBoundary(int octetBoundary) {
- impl.alignOnBoundary(octetBoundary);
- }
-
- // Needed by request and reply messages for GIOP versions >= 1.2 only.
- public void setHeaderPadding(boolean headerPadding) {
- impl.setHeaderPadding(headerPadding);
- }
-
- /**
- * This must be called after determining the proper ORB version,
- * and setting it on the stream's ORB instance. It can be called
- * after reading the service contexts, since that is the only place
- * we can get the ORB version info.
- *
- * Trying to unmarshal things requiring repository IDs before calling
- * this will result in NullPtrExceptions.
- */
- public void performORBVersionSpecificInit() {
- // In the case of SystemExceptions, a stream is created
- // with its default constructor (and thus no impl is set).
- if (impl != null)
- impl.performORBVersionSpecificInit();
- }
-
- /**
- * Resets any internal references to code set converters.
- * This is useful for forcing the CDR stream to reacquire
- * converters (probably from its subclasses) when state
- * has changed.
- */
- public void resetCodeSetConverters() {
- impl.resetCodeSetConverters();
- }
-
- public void setMessageMediator(MessageMediator messageMediator)
- {
- this.messageMediator = (CorbaMessageMediator) messageMediator;
- }
-
- public MessageMediator getMessageMediator()
- {
- return messageMediator;
- }
-
- // ValueInputStream -----------------------------
-
- public void start_value() {
- impl.start_value();
- }
-
- public void end_value() {
- impl.end_value();
- }
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaOutputStream.sjava b/corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaOutputStream.sjava
deleted file mode 100644
index 240a28067da..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/copyobject/JavaOutputStream.sjava
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.corba.se.impl.encoding;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.nio.ByteBuffer;
-
-import org.omg.CORBA.TypeCode;
-import org.omg.CORBA.Principal;
-import org.omg.CORBA.Any;
-
-import com.sun.corba.se.pept.protocol.MessageMediator;
-
-import com.sun.corba.se.spi.orb.ORB;
-import com.sun.corba.se.spi.logging.CORBALogDomains;
-import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
-import com.sun.corba.se.spi.protocol.CorbaMessageMediator;
-
-import com.sun.corba.se.impl.encoding.CodeSetConversion;
-import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry;
-import com.sun.corba.se.impl.orbutil.ORBConstants;
-import com.sun.corba.se.impl.logging.ORBUtilSystemException;
-
-/**
- * This is delegates to the real implementation.
- */
-public abstract class CDROutputStream
- extends org.omg.CORBA_2_3.portable.OutputStream
- implements com.sun.corba.se.impl.encoding.MarshalOutputStream,
- org.omg.CORBA.DataOutputStream, org.omg.CORBA.portable.ValueOutputStream
-{
-/*
- private CDROutputStreamBase impl;
- protected ORB orb ;
- protected ORBUtilSystemException wrapper ;
- protected CorbaMessageMediator corbaMessageMediator;
-
-
- // We can move this out somewhere later. For now, it serves its purpose
- // to create a concrete CDR delegate based on the GIOP version.
- private static class OutputStreamFactory {
-
- public static CDROutputStreamBase newOutputStream(ORB orb, GIOPVersion version)
- {
- switch(version.intValue()) {
- case GIOPVersion.VERSION_1_0:
- return new CDROutputStream_1_0();
- case GIOPVersion.VERSION_1_1:
- return new CDROutputStream_1_1();
- case GIOPVersion.VERSION_1_2:
- return new CDROutputStream_1_2();
- default:
- ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
- CORBALogDomains.RPC_ENCODING ) ;
- // REVISIT - what is appropriate? INTERNAL exceptions
- // are really hard to track later.
- throw wrapper.unsupportedGiopVersion( version ) ;
- }
- }
- }
-
- // REVISIT - These two constructors should be re-factored to better hide
- // the fact that someone extending this class 'can' construct a CDROutputStream
- // that does not use pooled ByteBuffers. Right now, only EncapsOutputStream
- // does _not_ use pooled ByteBuffers, see EncapsOutputStream.
-
- // NOTE: When a stream is constructed for non-channel-backed sockets
- // it notifies the constructor not to use pooled (i.e, direct)
- // ByteBuffers.
-
- public CDROutputStream(ORB orb,
- GIOPVersion version,
- boolean littleEndian,
- BufferManagerWrite bufferManager,
- byte streamFormatVersion,
- boolean usePooledByteBuffers)
- {
- impl = OutputStreamFactory.newOutputStream(orb, version);
- impl.init(orb, littleEndian, bufferManager, streamFormatVersion, usePooledByteBuffers);
-
- impl.setParent(this);
- this.orb = orb ;
- this.wrapper = ORBUtilSystemException.get( orb,
- CORBALogDomains.RPC_ENCODING ) ;
- }
-
- public CDROutputStream(ORB orb,
- GIOPVersion version,
- boolean littleEndian,
- BufferManagerWrite bufferManager,
- byte streamFormatVersion)
- {
- this(orb, version, littleEndian, bufferManager, streamFormatVersion, true);
- }
-*/
-
- private ByteArrayOutputStream bos ;
- private ObjectOutputStream oos ;
-
- public JavaOutputStream()
- {
- bos = new ByteArrayOutputStream() ;
- oos = new ObjectOutputStream( bos ) ;
- }
-
- // Provided by IIOPOutputStream and EncapsOutputStream
- public org.omg.CORBA.portable.InputStream create_input_stream()
- {
- ObjectInputStream ois = new ByteArrayInputStream( bos.toByteArray() ) ;
-
- return new JavaInputStream( ois ) ;
- }
-
- public final void write_boolean(boolean value) {
- impl.write_boolean(value);
- }
- public final void write_char(char value) {
- impl.write_char(value);
- }
- public final void write_wchar(char value) {
- impl.write_wchar(value);
- }
- public final void write_octet(byte value) {
- impl.write_octet(value);
- }
- public final void write_short(short value) {
- impl.write_short(value);
- }
- public final void write_ushort(short value) {
- impl.write_ushort(value);
- }
- public final void write_long(int value) {
- impl.write_long(value);
- }
- public final void write_ulong(int value) {
- impl.write_ulong(value);
- }
- public final void write_longlong(long value) {
- impl.write_longlong(value);
- }
- public final void write_ulonglong(long value) {
- impl.write_ulonglong(value);
- }
- public final void write_float(float value) {
- impl.write_float(value);
- }
- public final void write_double(double value) {
- impl.write_double(value);
- }
- public final void write_string(String value) {
- impl.write_string(value);
- }
- public final void write_wstring(String value) {
- impl.write_wstring(value);
- }
-
- public final void write_boolean_array(boolean[] value, int offset, int length) {
- impl.write_boolean_array(value, offset, length);
- }
- public final void write_char_array(char[] value, int offset, int length) {
- impl.write_char_array(value, offset, length);
- }
- public final void write_wchar_array(char[] value, int offset, int length) {
- impl.write_wchar_array(value, offset, length);
- }
- public final void write_octet_array(byte[] value, int offset, int length) {
- impl.write_octet_array(value, offset, length);
- }
- public final void write_short_array(short[] value, int offset, int length) {
- impl.write_short_array(value, offset, length);
- }
- public final void write_ushort_array(short[] value, int offset, int length){
- impl.write_ushort_array(value, offset, length);
- }
- public final void write_long_array(int[] value, int offset, int length) {
- impl.write_long_array(value, offset, length);
- }
- public final void write_ulong_array(int[] value, int offset, int length) {
- impl.write_ulong_array(value, offset, length);
- }
- public final void write_longlong_array(long[] value, int offset, int length) {
- impl.write_longlong_array(value, offset, length);
- }
- public final void write_ulonglong_array(long[] value, int offset,int length) {
- impl.write_ulonglong_array(value, offset, length);
- }
- public final void write_float_array(float[] value, int offset, int length) {
- impl.write_float_array(value, offset, length);
- }
- public final void write_double_array(double[] value, int offset, int length) {
- impl.write_double_array(value, offset, length);
- }
- public final void write_Object(org.omg.CORBA.Object value) {
- impl.write_Object(value);
- }
- public final void write_TypeCode(TypeCode value) {
- impl.write_TypeCode(value);
- }
- public final void write_any(Any value) {
- impl.write_any(value);
- }
-
- public final void write_Principal(Principal value) {
- impl.write_Principal(value);
- }
-
- public final void write(int b) throws java.io.IOException {
- impl.write(b);
- }
-
- public final void write_fixed(java.math.BigDecimal value) {
- impl.write_fixed(value);
- }
-
- public final void write_Context(org.omg.CORBA.Context ctx,
- org.omg.CORBA.ContextList contexts) {
- impl.write_Context(ctx, contexts);
- }
-
- public final org.omg.CORBA.ORB orb() {
- return impl.orb();
- }
-
- // org.omg.CORBA_2_3.portable.OutputStream
- public final void write_value(java.io.Serializable value) {
- impl.write_value(value);
- }
-
- public final void write_value(java.io.Serializable value, java.lang.Class clz) {
- impl.write_value(value, clz);
- }
-
- public final void write_value(java.io.Serializable value, String repository_id) {
- impl.write_value(value, repository_id);
- }
-
- public final void write_value(java.io.Serializable value,
- org.omg.CORBA.portable.BoxedValueHelper factory) {
- impl.write_value(value, factory);
- }
-
- public final void write_abstract_interface(java.lang.Object obj) {
- impl.write_abstract_interface(obj);
- }
-
- // java.io.OutputStream
- public final void write(byte b[]) throws IOException {
- impl.write(b);
- }
-
- public final void write(byte b[], int off, int len) throws IOException {
- impl.write(b, off, len);
- }
-
- public final void flush() throws IOException {
- impl.flush();
- }
-
- public final void close() throws IOException {
- impl.close();
- }
-
- // com.sun.corba.se.impl.encoding.MarshalOutputStream
- public final void start_block() {
- impl.start_block();
- }
-
- public final void end_block() {
- impl.end_block();
- }
-
- public final void putEndian() {
- impl.putEndian();
- }
-
- public void writeTo(java.io.OutputStream s)
- throws IOException
- {
- impl.writeTo(s);
- }
-
- public final byte[] toByteArray() {
- return impl.toByteArray();
- }
-
- // org.omg.CORBA.DataOutputStream
- public final void write_Abstract (java.lang.Object value) {
- impl.write_Abstract(value);
- }
-
- public final void write_Value (java.io.Serializable value) {
- impl.write_Value(value);
- }
-
- public final void write_any_array(org.omg.CORBA.Any[] seq, int offset, int length) {
- impl.write_any_array(seq, offset, length);
- }
-
- public void setMessageMediator(MessageMediator messageMediator)
- {
- this.corbaMessageMediator = (CorbaMessageMediator) messageMediator;
- }
-
- public MessageMediator getMessageMediator()
- {
- return corbaMessageMediator;
- }
-
- // org.omg.CORBA.portable.ValueBase
- public final String[] _truncatable_ids() {
- return impl._truncatable_ids();
- }
-
- // Other
- protected final int getSize() {
- return impl.getSize();
- }
-
- protected final int getIndex() {
- return impl.getIndex();
- }
-
- protected int getRealIndex(int index) {
- // Used in indirections. Overridden by TypeCodeOutputStream.
- return index;
- }
-
- protected final void setIndex(int value) {
- impl.setIndex(value);
- }
-
- protected final ByteBuffer getByteBuffer() {
- return impl.getByteBuffer();
- }
-
- protected final void setByteBuffer(ByteBuffer byteBuffer) {
- impl.setByteBuffer(byteBuffer);
- }
-
- public final boolean isLittleEndian() {
- return impl.isLittleEndian();
- }
-
- // XREVISIT - return to final if possible
- // REVISIT - was protected - need access from msgtypes test.
- public ByteBufferWithInfo getByteBufferWithInfo() {
- return impl.getByteBufferWithInfo();
- }
-
- protected void setByteBufferWithInfo(ByteBufferWithInfo bbwi) {
- impl.setByteBufferWithInfo(bbwi);
- }
-
- // REVISIT: was protected - but need to access from xgiop.
- public final BufferManagerWrite getBufferManager() {
- return impl.getBufferManager();
- }
-
- public final void write_fixed(java.math.BigDecimal bigDecimal, short digits, short scale) {
- impl.write_fixed(bigDecimal, digits, scale);
- }
-
- public final void writeOctetSequenceTo(org.omg.CORBA.portable.OutputStream s) {
- impl.writeOctetSequenceTo(s);
- }
-
- public final GIOPVersion getGIOPVersion() {
- return impl.getGIOPVersion();
- }
-
- public final void writeIndirection(int tag, int posIndirectedTo) {
- impl.writeIndirection(tag, posIndirectedTo);
- }
-
- // Use Latin-1 for GIOP 1.0 or when code set negotiation was not
- // performed.
- protected CodeSetConversion.CTBConverter createCharCTBConverter() {
- return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.ISO_8859_1);
- }
-
- // Subclasses must decide what to do here. It's inconvenient to
- // make the class and this method abstract because of dup().
- protected abstract CodeSetConversion.CTBConverter createWCharCTBConverter();
-
- protected final void freeInternalCaches() {
- impl.freeInternalCaches();
- }
-
- void printBuffer() {
- impl.printBuffer();
- }
-
- public void alignOnBoundary(int octetBoundary) {
- impl.alignOnBoundary(octetBoundary);
- }
-
- // Needed by request and reply messages for GIOP versions >= 1.2 only.
- public void setHeaderPadding(boolean headerPadding) {
- impl.setHeaderPadding(headerPadding);
- }
-
- // ValueOutputStream -----------------------------
-
- public void start_value(String rep_id) {
- impl.start_value(rep_id);
- }
-
- public void end_value() {
- impl.end_value();
- }
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ThreadCurrentStack.sjava b/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ThreadCurrentStack.sjava
deleted file mode 100644
index 016a902825a..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/interceptors/ThreadCurrentStack.sjava
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.interceptors;
-
-import com.sun.corba.se.impl.corba.AnyImpl;
-import org.omg.PortableInterceptor.Current;
-import org.omg.PortableInterceptor.InvalidSlot;
-
-import com.sun.corba.se.impl.util.MinorCodes;
-import com.sun.corba.se.impl.core.ORB;
-
-/**
- * ThreadCurrentStack is the container of PICurrent instances for each thread
- */
-public class ThreadCurrentStack
-{
- // PICurrentPool is the container for reusable PICurrents
- private class PICurrentPool {
-
- // Contains a list of reusable PICurrents
- private java.util.ArrayList pool;
-
- // High water mark for the pool
- // If the pool size reaches this limit then putPICurrent will
- // not put PICurrent to the pool.
- private static final int HIGH_WATER_MARK = 5;
-
- // currentIndex points to the last PICurrent in the list
- private int currentIndex;
-
- PICurrentPool( ) {
- pool = new java.util.ArrayList( HIGH_WATER_MARK );
- currentIndex = 0;
- }
-
- /**
- * Puts PICurrent to the re-usable pool.
- */
- void putPICurrent( PICurrent current ) {
- // If there are enough PICurrents in the pool, then don't add
- // this current to the pool.
- if( currentIndex >= HIGH_WATER_MARK ) {
- return;
- }
- pool.add(currentIndex , current);
- currentIndex++;
- }
-
- /**
- * Gets PICurrent from the re-usable pool.
- */
- PICurrent getPICurrent( ) {
- // If there are no entries in the pool then return null
- if( currentIndex == 0 ) {
- return null;
- }
- // Works like a stack, Gets the last one added first
- currentIndex--;
- return (PICurrent) pool.get(currentIndex);
- }
- }
-
- // Contains all the active PICurrents for each thread.
- // The ArrayList is made to behave like a stack.
- private java.util.ArrayList currentContainer;
-
- // Keeps track of number of PICurrents in the stack.
- private int currentIndex;
-
- // For Every Thread there will be a pool of re-usable ThreadCurrent's
- // stored in PICurrentPool
- private PICurrentPool currentPool;
-
- // The orb associated with this ThreadCurrentStack
- private ORB piOrb;
-
- /**
- * Constructs the stack and and PICurrentPool
- */
- ThreadCurrentStack( ORB piOrb, PICurrent current ) {
- this.piOrb = piOrb;
- currentIndex = 0;
- currentContainer = new java.util.ArrayList( );
- currentPool = new PICurrentPool( );
- currentContainer.add( currentIndex, current );
- currentIndex++;
- }
-
-
- /**
- * pushPICurrent goes through the following steps
- * 1: Checks to see if there is any PICurrent in PICurrentPool
- * If present then use that instance to push into the ThreadCurrentStack
- *
- * 2:If there is no PICurrent in the pool, then creates a new one and pushes
- * that into the ThreadCurrentStack
- */
- void pushPICurrent( ) {
- PICurrent current = currentPool.getPICurrent( );
- if( current == null ) {
- // get an existing PICurrent to get the slotSize
- PICurrent currentTemp = peekPICurrent();
- current = new PICurrent( piOrb, currentTemp.getSlotSize( ));
- }
- currentContainer.add( currentIndex, current );
- currentIndex++;
- }
-
- /**
- * popPICurrent does the following
- * 1: pops the top PICurrent in the ThreadCurrentStack
- *
- * 2: resets the slots in the PICurrent which resets the slotvalues to
- * null if there are any previous sets.
- *
- * 3: pushes the reset PICurrent into the PICurrentPool to reuse
- */
- void popPICurrent( ) {
- // Do not pop the PICurrent, If there is only one.
- // This should not happen, But an extra check for safety.
- if( currentIndex <= 1 ) {
- throw new org.omg.CORBA.INTERNAL(
- "Cannot pop the only PICurrent in the stack",
- MinorCodes.CANT_POP_ONLY_CURRENT_2,
- CompletionStatus.COMPLETED_NO );
- }
- currentIndex--;
- PICurrent current = (PICurrent)currentContainer.get( currentIndex );
- current.resetSlots( );
- currentPool.putPICurrent( current );
- }
-
- /**
- * peekPICurrent gets the top PICurrent in the ThreadCurrentStack without
- * popping.
- */
- PICurrent peekPICurrent( ) {
- return (PICurrent) currentContainer.get( currentIndex - 1);
- }
-
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/DefineWrapper.sjava b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/DefineWrapper.sjava
deleted file mode 100644
index 0179dfa0bd1..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/DefineWrapper.sjava
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.orbutil ;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-/** This class provides just a main method. Its purpose is to allow -D arguments to
-* set up the system properties when starting programs with tools like OptimizeIt that
-* make this difficult or impossible.
-*
-* Invocation: {java launcher of some kind} DefineClass -Dxxx=yyy -Dxxx=yyy ... {class name} arg0, arg1, ...
-* Result: updates system properties with -D args, then uses reflection to invoke {class name}.main with the args
-*/
-
-class DefineWrapper {
- public static void main( String[] args )
- {
- int numberDefines = args.length ;
- String className = null ;
-
- for (int ctr=0; ctr and get methods.
-
-
- //
- // Perform case sensitivity test first. This applies to all
- // method names AND attributes. Compare each method name and
- // attribute to all other method names and attributes. If names
- // differ only in case, apply mangling as defined in section 1.3.2.7
- // of Java2IDL spec. Note that we compare using the original names.
- //
- for(Iterator outerIter=allMethodInfo.values().iterator();
- outerIter.hasNext();) {
- IDLMethodInfo outer = (IDLMethodInfo) outerIter.next();
- for(Iterator innerIter = allMethodInfo.values().iterator();
- innerIter.hasNext();) {
- IDLMethodInfo inner = (IDLMethodInfo) innerIter.next();
-
- if( (outer != inner) &&
- (!outer.originalName.equals(inner.originalName)) &&
- outer.originalName.equalsIgnoreCase(inner.originalName) ) {
- outer.mangledName =
- mangleCaseSensitiveCollision(outer.originalName);
- break;
- }
-
- }
- }
-
- for(Iterator iter = allMethodInfo.values().iterator();
- iter.hasNext();) {
- IDLMethodInfo next = (IDLMethodcurrentInfo) iter.next();
- next.mangledName =
- mangleIdentifier(next.mangledName,
- next.propertyType != null);
- }
-
- //
- // Now check for overloaded method names and apply 1.3.2.6.
- //
- for(Iterator outerIter=allMethodInfo.values().iterator();
- outerIter.hasNext();) {
- IDLMethodInfo outer = (IDLMethodInfo) outerIter.next();
- if (outer.propertyType != null) {
- continue;
- }
- for(Iterator innerIter = allMethodInfo.values().iterator();
- innerIter.hasNext();) {
- IDLMethodInfo inner = (IDLMethodInfo) innerIter.next();
-
- if( (outer != inner) &&
- (inner.propertyType == null) &&
- outer.originalName.equals(inner.originalName) ) {
- outer.mangledName = mangleOverloadedMethod
- (outer.mangledName, outer.method);
- break;
- }
- }
- }
-
- //
- // Now mangle any properties that clash with method names.
- //
- for(Iterator outerIter=allMethodInfo.values().iterator();
- outerIter.hasNext();) {
- IDLMethodInfo outer = (IDLMethodInfo) outerIter.next();
- if(outer.propertyType == null) {
- continue;
- }
- for(Iterator innerIter = allMethodInfo.values().iterator();
- innerIter.hasNext();) {
- IDLMethodInfo inner = (IDLMethodInfo) innerIter.next();
- if( (outer != inner) &&
- (inner.propertyType == null) &&
- outer.mangledName.equals(inner.mangledName) ) {
- outer.mangledName = outer.mangledName +
- ATTRIBUTE_METHOD_CLASH_MANGLE_CHARS;
- break;
- }
- }
- }
-
- //
- // Ensure that no mapped method names clash with mapped name
- // of container(1.3.2.9). This is a case insensitive comparison.
- //
- for (int ctr=0; ctr and get,
- // map only is to an attribute, and leave the
- // get method alone.
- if( IDLNameToMethodMap_.containsKey(idlName) ) {
- // @@@ I18N
- Method clash = (Method) IDLNameToMethodMap_.get(idlName);
- MethodInfo clashMethodInfo =
- (MethodInfo)allMethodInfo.get( clash ) ;
- if (clashMethodInfo.isBooleanProperty() &&
- next.isReadProperty()) {
- // fix idlName
- } else if (clashMethodInfo.isReadProperty() &&
- next.isBooleanProperty()) {
- // Remove entry under idlName
- // put entry into table under correct name
- } else {
- throw new IllegalStateException("Error : methods " +
- clash + " and " + next.method +
- " both result in IDL name '" + idlName + "'");
- }
- }
-
- IDLNameToMethodMap_.put(idlName, next.method);
- }
-
- return;
-
- }
-
-
- /**
- * Perform all necessary stand-alone identifier mangling operations
- * on a java identifier that is being transformed into an IDL name.
- * That is, mangling operations that don't require looking at anything
- * else but the identifier itself. This covers sections 1.3.2.2, 1.3.2.3,
- * and 1.3.2.4 of the Java2IDL spec. Method overloading and
- * case-sensitivity checks are handled elsewhere.
- */
-
- private static String mangleIdentifier(String identifier) {
- return mangleIdentifier(identifier, false);
- }
-
- private static String mangleIdentifier(String identifier, boolean attribute) {
-
- String mangledName = identifier;
-
- //
- // Apply leading underscore test (1.3.2.3)
- // This should be done before IDL Keyword clash test, since clashing
- // IDL keywords are mangled by adding a leading underscore.
- //
- if( hasLeadingUnderscore(mangledName) ) {
- mangledName = mangleLeadingUnderscore(mangledName);
- }
-
- //
- // Apply IDL keyword clash test (1.3.2.2).
- // This is not needed for attributes since when the full property
- // name is composed it cannot clash with an IDL keyword.
- // (Also, rmic doesn't do it.)
- //
-
- if( !attribute && isIDLKeyword(mangledName) ) {
- mangledName = mangleIDLKeywordClash(mangledName);
- }
-
- //
- // Replace illegal IDL identifier characters (1.3.2.4)
- // for all method names and attributes.
- //
- if( !isIDLIdentifier(mangledName) ) {
- mangledName = mangleUnicodeChars(mangledName);
- }
-
- return mangledName;
- }
-
- /**
- * Checks whether a java identifier clashes with an
- * IDL keyword. Note that this is a case-insensitive
- * comparison.
- *
- * Used to implement section 1.3.2.2 of Java2IDL spec.
- */
- private static boolean isIDLKeyword(String identifier) {
-
- String identifierAllCaps = identifier.toUpperCase();
-
- return idlKeywords_.contains(identifierAllCaps);
- }
-
- private static String mangleIDLKeywordClash(String identifier) {
- return UNDERSCORE + identifier;
- }
-
- private static String mangleLeadingUnderscore(String identifier) {
- return LEADING_UNDERSCORE_CHAR + identifier;
- }
-
- /**
- * Checks whether a java identifier starts with an underscore.
- * Used to implement section 1.3.2.3 of Java2IDL spec.
- */
- private static boolean hasLeadingUnderscore(String identifier) {
- return identifier.startsWith(UNDERSCORE);
- }
-
- /**
- * Implements Section 1.3.2.4 of Java2IDL Mapping.
- * All non-IDL identifier characters must be replaced
- * with their Unicode representation.
- */
- static String mangleUnicodeChars(String identifier) {
- StringBuffer mangledIdentifier = new StringBuffer();
-
- for(int i = 0; i < identifier.length(); i++) {
- char nextChar = identifier.charAt(i);
- if( isIDLIdentifierChar(nextChar) ) {
- mangledIdentifier.append(nextChar);
- } else {
- String unicode = charToUnicodeRepresentation(nextChar);
- mangledIdentifier.append(unicode);
- }
- }
-
- return mangledIdentifier.toString();
- }
-
- /**
- * Implements mangling portion of Section 1.3.2.7 of Java2IDL spec.
- * This method only deals with the actual mangling. Decision about
- * whether case-sensitive collision mangling is required is made
- * elsewhere.
- *
- *
- * "...a mangled name is generated consisting of the original name
- * followed by an underscore separated list of decimal indices
- * into the string, where the indices identify all the upper case
- * characters in the original string. Indices are zero based."
- *
- */
- String mangleCaseSensitiveCollision(String identifier) {
-
- StringBuffer mangledIdentifier = new StringBuffer(identifier);
-
- // There is always at least one trailing underscore, whether or
- // not the identifier has uppercase letters.
- mangledIdentifier.append(UNDERSCORE);
-
- boolean needUnderscore = false;
- for(int i = 0; i < identifier.length(); i++) {
- char next = identifier.charAt(i);
- if( Character.isUpperCase(next) ) {
- // This bit of logic is needed to ensure that we have
- // an underscore separated list of indices but no
- // trailing underscores. Basically, after we have at least
- // one uppercase letter, we always put an undercore before
- // printing the next one.
- if( needUnderscore ) {
- mangledIdentifier.append(UNDERSCORE);
- }
- mangledIdentifier.append(i);
- needUnderscore = true;
- }
- }
-
- return mangledIdentifier.toString();
- }
-
- private static String mangleContainerClash(String identifier) {
- return identifier + ID_CONTAINER_CLASH_CHAR;
- }
-
- /**
- * Implements Section 1.3.2.9 of Java2IDL Mapping. Container in this
- * context means the name of the java Class(excluding package) in which
- * the identifier is defined. Comparison is case-insensitive.
- */
- private static boolean identifierClashesWithContainer
- (String mappedContainerName, String identifier) {
-
- return identifier.equalsIgnoreCase(mappedContainerName);
- }
-
- /**
- * Returns Unicode mangling as defined in Section 1.3.2.4 of
- * Java2IDL spec.
- *
- * "For Java identifiers that contain illegal OMG IDL identifier
- * characters such as '$' or Unicode characters outside of ISO Latin 1,
- * any such illegal characters are replaced by "U" followed by the
- * 4 hexadecimal characters(in upper case) representing the Unicode
- * value. So, the Java name a$b is mapped to aU0024b and
- * x\u03bCy is mapped to xU03BCy."
- */
- public static String charToUnicodeRepresentation(char c) {
-
- int orig = (int) c;
- StringBuffer hexString = new StringBuffer();
-
- int value = orig;
-
- while( value > 0 ) {
- int div = value / 16;
- int mod = value % 16;
- hexString.insert(0, HEX_DIGITS[mod]);
- value = div;
- }
-
- int numZerosToAdd = 4 - hexString.length();
- for(int i = 0; i < numZerosToAdd; i++) {
- hexString.insert(0, "0");
- }
-
- hexString.insert(0, "U");
- return hexString.toString();
- }
-
- private static boolean isIDLIdentifier(String identifier) {
-
- boolean isIdentifier = true;
-
- for(int i = 0; i < identifier.length(); i++) {
- char nextChar = identifier.charAt(i);
- // 1st char must be alphbetic.
- isIdentifier = (i == 0) ?
- isIDLAlphabeticChar(nextChar) :
- isIDLIdentifierChar(nextChar);
- if( !isIdentifier ) {
- break;
- }
- }
-
- return isIdentifier;
-
- }
-
- private static boolean isIDLIdentifierChar(char c) {
- return (isIDLAlphabeticChar(c) ||
- isIDLDecimalDigit(c) ||
- isUnderscore(c));
- }
-
- /**
- * True if character is one of 114 Alphabetic characters as
- * specified in Table 2 of Chapter 3 in CORBA spec.
- */
- private static boolean isIDLAlphabeticChar(char c) {
-
- // NOTE that we can't use the java.lang.Character
- // isUpperCase, isLowerCase, etc. methods since they
- // include many characters other than the Alphabetic list in
- // the CORBA spec. Instead, we test for inclusion in the
- // Unicode value ranges for the corresponding legal characters.
-
- boolean alphaChar =
- (
- // A - Z
- ((c >= 0x0041) && (c <= 0x005A))
-
- ||
-
- // a - z
- ((c >= 0x0061) && (c <= 0x007A))
-
- ||
-
- // other letter uppercase, other letter lowercase, which is
- // the entire upper half of C1 Controls except X and /
- ((c >= 0x00C0) && (c <= 0x00FF)
- && (c != 0x00D7) && (c != 0x00F7)));
-
- return alphaChar;
- }
-
- /**
- * True if character is one of 10 Decimal Digits
- * specified in Table 3 of Chapter 3 in CORBA spec.
- */
- private static boolean isIDLDecimalDigit(char c) {
- return ( (c >= 0x0030) && (c <= 0x0039) );
- }
-
- private static boolean isUnderscore(char c) {
- return ( c == 0x005F );
- }
-
- /**
- * Mangle an overloaded method name as defined in Section 1.3.2.6 of
- * Java2IDL spec. Current value of method name is passed in as argument.
- * We can't start from original method name since the name might have
- * been partially mangled as a result of the other rules.
- */
- private static String mangleOverloadedMethod(String mangledName, Method m) {
-
- IDLTypesUtil idlTypesUtil = new IDLTypesUtil();
-
- // Start by appending the separator string
- String newMangledName = mangledName + OVERLOADED_TYPE_SEPARATOR;
-
- Class[] parameterTypes = m.getParameterTypes();
-
- for(int i = 0; i < parameterTypes.length; i++) {
- Class nextParamType = parameterTypes[i];
-
- if( i > 0 ) {
- newMangledName = newMangledName + OVERLOADED_TYPE_SEPARATOR;
- }
- IDLType idlType = classToIDLType(nextParamType);
-
- String moduleName = idlType.getModuleName();
- String memberName = idlType.getMemberName();
-
- String typeName = (moduleName.length() > 0) ?
- moduleName + UNDERSCORE + memberName : memberName;
-
- if( !idlTypesUtil.isPrimitive(nextParamType) &&
- (idlTypesUtil.getSpecialCaseIDLTypeMapping(nextParamType)
- == null) &&
- isIDLKeyword(typeName) ) {
- typeName = mangleIDLKeywordClash(typeName);
- }
-
- typeName = mangleUnicodeChars(typeName);
-
- newMangledName = newMangledName + typeName;
- }
-
- return newMangledName;
- }
-
-
- private static IDLType classToIDLType(Class c) {
-
- IDLType idlType = null;
- IDLTypesUtil idlTypesUtil = new IDLTypesUtil();
-
- if( idlTypesUtil.isPrimitive(c) ) {
-
- idlType = idlTypesUtil.getPrimitiveIDLTypeMapping(c);
-
- } else if( c.isArray() ) {
-
- // Calculate array depth, as well as base element type.
- Class componentType = c.getComponentType();
- int numArrayDimensions = 1;
- while(componentType.isArray()) {
- componentType = componentType.getComponentType();
- numArrayDimensions++;
- }
- IDLType componentIdlType = classToIDLType(componentType);
-
- String[] modules = BASE_IDL_ARRAY_MODULE_TYPE;
- if( componentIdlType.hasModule() ) {
- modules = (String[])ObjectUtility.concatenateArrays( modules,
- componentIdlType.getModules() ) ;
- }
-
- String memberName = BASE_IDL_ARRAY_ELEMENT_TYPE +
- numArrayDimensions + UNDERSCORE +
- componentIdlType.getMemberName();
-
- idlType = new IDLType(c, modules, memberName);
-
- } else {
- idlType = idlTypesUtil.getSpecialCaseIDLTypeMapping(c);
-
- if (idlType == null) {
- // Section 1.3.2.5 of Java2IDL spec defines mangling rules for
- // inner classes.
- String memberName = getUnmappedContainerName(c);
-
- // replace inner class separator with double underscore
- memberName = memberName.replaceAll("\\$",
- INNER_CLASS_SEPARATOR);
-
- if( hasLeadingUnderscore(memberName) ) {
- memberName = mangleLeadingUnderscore(memberName);
- }
-
- // Get raw package name. If there is a package, it
- // will still have the "." separators and none of the
- // mangling rules will have been applied.
- String packageName = getPackageName(c);
-
- if (packageName == null) {
- idlType = new IDLType( c, memberName ) ;
- } else {
- // If this is a generated IDL Entity Type we need to
- // prepend org_omg_boxedIDL per sections 1.3.5 and 1.3.9
- if (idlTypesUtil.isEntity(c)) {
- packageName = "org.omg.boxedIDL." + packageName ;
- }
-
- // Section 1.3.2.1 and 1.3.2.6 of Java2IDL spec defines
- // rules for mapping java packages to IDL modules and for
- // mangling module name portion of type name. NOTE that
- // of the individual identifier mangling rules,
- // only the leading underscore test is done here.
- // The other two(IDL Keyword, Illegal Unicode chars) are
- // done in mangleOverloadedMethodName.
- StringTokenizer tokenizer =
- new StringTokenizer(packageName, ".");
-
- String[] modules = new String[ tokenizer.countTokens() ] ;
- int index = 0 ;
- while (tokenizer.hasMoreElements()) {
- String next = tokenizer.nextToken();
- String nextMangled = hasLeadingUnderscore(next) ?
- mangleLeadingUnderscore(next) : next;
-
- modules[index++] = nextMangled ;
- }
-
- idlType = new IDLType(c, modules, memberName);
- }
- }
- }
-
- return idlType;
- }
-
- /**
- * Return Class' package name or null if there is no package.
- */
- private static String getPackageName(Class c) {
- Package thePackage = c.getPackage();
- String packageName = null;
-
- // Try to get package name by introspection. Some classloaders might
- // not provide this information, so check for null.
- if( thePackage != null ) {
- packageName = thePackage.getName();
- } else {
- // brute force method
- String fullyQualifiedClassName = c.getName();
- int lastDot = fullyQualifiedClassName.indexOf('.');
- packageName = (lastDot == -1) ? null :
- fullyQualifiedClassName.substring(0, lastDot);
- }
- return packageName;
- }
-
- private static String getMappedContainerName(Class c) {
- String unmappedName = getUnmappedContainerName(c);
-
- return mangleIdentifier(unmappedName);
- }
-
- /**
- * Return portion of class name excluding package name.
- */
- private static String getUnmappedContainerName(Class c) {
-
- String memberName = null;
- String packageName = getPackageName(c);
-
- String fullyQualifiedClassName = c.getName();
-
- if( packageName != null ) {
- int packageLength = packageName.length();
- memberName = fullyQualifiedClassName.substring(packageLength + 1);
- } else {
- memberName = fullyQualifiedClassName;
-
- }
-
- return memberName;
- }
-
- /**
- * Internal helper class for tracking information related to each
- * interface method while we're building the name translation table.
- */
- private static class IDLMethodInfo
- {
- public Method method;
- public String propertyType;
-
- // If this is a property, originalName holds the original
- // attribute name. Otherwise, it holds the original method name.
- public String originalName;
-
- // If this is a property, mangledName holds the mangled attribute
- // name. Otherwise, it holds the mangled method name.
- public String mangledName;
-
- }
-
- public String toString() {
-
- StringBuffer contents = new StringBuffer();
- contents.append("IDLNameTranslator[" );
- for( int ctr=0; ctr 0 ) {
- String className = args[0];
- try {
- remoteInterface = Class.forName(className);
- } catch(Exception e) {
- e.printStackTrace();
- System.exit(-1);
- }
- }
-
- System.out.println("Building name translation for " + remoteInterface);
- try {
- IDLNameTranslator nameTranslator =
- IDLNameTranslatorImpl.get(remoteInterface);
- System.out.println(nameTranslator);
- } catch(IllegalStateException ise) {
- ise.printStackTrace();
- }
- }
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypesUtil_save.sjava b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypesUtil_save.sjava
deleted file mode 100644
index 66bf284375e..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLTypesUtil_save.sjava
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
- * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.presentation.rmi ;
-
-import java.lang.reflect.Method;
-import java.lang.reflect.Field;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Iterator;
-
-/**
- * Utility class for testing RMI/IDL Types as defined in
- * Section 1.2 of The Java Language to IDL Mapping. Note that
- * these are static checks only. Runtime checks, such as those
- * described in Section 1.2.3, #3, are not covered.
- */
-public class IDLTypesUtil {
-
- public static final String JAVA_GET_PROPERTY_PREFIX = "get";
- public static final String JAVA_SET_PROPERTY_PREFIX = "set";
- public static final String JAVA_IS_PROPERTY_PREFIX = "is";
-
- public static final int VALID_TYPE = 0;
- public static final int INVALID_TYPE = 1;
-
- /**
- * Validate a class to ensure it conforms to the rules for a
- * Java RMI/IIOP interface.
- *
- * @throws IDLTypeException if not a valid RMI/IIOP interface.
- */
- public void validateRemoteInterface(Class c) throws IDLTypeException
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- if( !c.isInterface() ) {
- String msg = "Class " + c + " must be a java interface.";
- throw new IDLTypeException(msg);
- }
-
- if( !java.rmi.Remote.class.isAssignableFrom(c) ) {
- String msg = "Class " + c + " must extend java.rmi.Remote, " +
- "either directly or indirectly.";
- throw new IDLTypeException(msg);
- }
-
- // Get all methods, including super-interface methods.
- Method[] methods = c.getMethods();
-
- for(int i = 0; i < methods.length; i++) {
- Method next = methods[i];
- validateExceptions(next);
- }
-
- // Removed because of bug 4989053
- // validateDirectInterfaces(c);
- validateConstants(c);
-
- return;
- }
-
- public boolean isRemoteInterface(Class c)
- {
- boolean remoteInterface = true;
- try {
- validateRemoteInterface(c);
- } catch(IDLTypeException ite) {
- remoteInterface = false;
- }
-
- return remoteInterface;
- }
-
- /**
- * Section 1.2.2 Primitive Types
- */
- public boolean isPrimitive(Class c)
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- return c.isPrimitive();
- }
-
- /**
- * Section 1.2.4
- */
- public boolean isValue(Class c)
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- return
- (!c.isInterface() &&
- java.io.Serializable.class.isAssignableFrom(c) &&
- !java.rmi.Remote.class.isAssignableFrom(c));
- }
-
- /**
- * Section 1.2.5
- */
- public boolean isArray(Class c)
- {
- boolean arrayType = false;
-
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- if( c.isArray() ) {
- Class componentType = c.getComponentType();
- arrayType =
- (isPrimitive(componentType) || isRemoteInterface(componentType) ||
- isEntity(componentType) || isException(componentType) ||
- isValue(componentType) || isObjectReference(componentType) );
- }
-
- return arrayType;
- }
-
- /**
- * Section 1.2.6
- */
- public boolean isException(Class c)
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- // Must be a checked exception, not including RemoteException or
- // its subclasses.
- return isCheckedException(c) && !isRemoteException(c) && isValue(c);
- }
-
- public boolean isRemoteException(Class c)
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- return java.rmi.RemoteException.class.isAssignableFrom(c) ;
- }
-
- public boolean isCheckedException(Class c)
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- return Throwable.class.isAssignableFrom(c) &&
- !RuntimeException.class.isAssignableFrom(c) &&
- !Error.class.isAssignableFrom(c) ;
- }
-
- /**
- * Section 1.2.7
- */
- public boolean isObjectReference(Class c)
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- return (c.isInterface() &&
- org.omg.CORBA.Object.class.isAssignableFrom(c));
- }
-
- /**
- * Section 1.2.8
- */
- public boolean isEntity(Class c)
- {
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- Class superClass = c.getSuperclass();
- return (!c.isInterface() &&
- (superClass != null) &&
- (org.omg.CORBA.portable.IDLEntity.class.isAssignableFrom(c)));
- }
-
- public String javaPropertyPrefixToIDL( String javaPrefix )
- {
- return "_" + javaPrefix + "_" ;
- }
-
- /**
- * Return the property type if given method is legal property accessor as defined in
- * Section 1.3.4.3 of Java2IDL spec. Result is one of: JAVA_GET_PROPERTY_PREFIX,
- * JAVA_SET_PROPERTY_PREFIX, JAVA_IS_PROPERTY_PREFIX.
- */
- public String propertyAccessorMethodType(Method m, Class c) {
-
- String methodName = m.getName();
- Class returnType = m.getReturnType();
- Class[] parameters = m.getParameterTypes();
- Class[] exceptionTypes = m.getExceptionTypes();
- String propertyType = null;
-
- if( methodName.startsWith(JAVA_GET_PROPERTY_PREFIX) ) {
-
- if((parameters.length == 0) && (returnType != Void.TYPE) &&
- !hasCorrespondingReadProperty(m, c, JAVA_IS_PROPERTY_PREFIX) {
- propertyType = JAVA_GET_PROPERTY_PREFIX;
- }
-
- } else if( methodName.startsWith(JAVA_SET_PROPERTY_PREFIX) ) {
-
- if((returnType == Void.TYPE) && (parameters.length == 1)) {
- if (hasCorrespondingReadProperty(m, c, JAVA_GET_PROPERTY_PREFIX) ||
- hasCorrespondingReadProperty(m, c, JAVA_IS_PROPERTY_PREFIX)) {
- propertyType = JAVA_SET_PROPERTY_PREFIX;
- }
- }
-
- } else if( methodName.startsWith(JAVA_IS_PROPERTY_PREFIX) ) {
- if((parameters.length == 0) && (returnType == Boolean.TYPE)) {
- propertyType = JAVA_IS_PROPERTY_PREFIX;
- }
- }
-
- // Some final checks that apply to all properties.
- if( propertyType != null ) {
- if(!validPropertyExceptions(m) ||
- (methodName.length() <= propertyType.length())) {
- propertyType = null;
- }
- }
-
- return propertyType ;
- }
-
- private boolean hasCorrespondingReadProperty
- (Method writeProperty, Class c, String readPropertyPrefix) {
-
- String writePropertyMethodName = writeProperty.getName();
- Class[] writePropertyParameters = writeProperty.getParameterTypes();
- boolean foundReadProperty = false;
-
- try {
- // Look for a valid corresponding Read property
- String readPropertyMethodName =
- writePropertyMethodName.replaceFirst
- (JAVA_SET_PROPERTY_PREFIX, readPropertyPrefix);
- Method readPropertyMethod = c.getMethod(readPropertyMethodName,
- new Class[] {});
- foundReadProperty =
- ((propertyAccessorMethodType(readPropertyMethod, c) != null) &&
- (readPropertyMethod.getReturnType() ==
- writePropertyParameters[0]));
- } catch(Exception e) {
- // ignore. this means we didn't find a corresponding get property.
- }
-
- return foundReadProperty;
- }
-
- public String getAttributeNameForProperty(String propertyName) {
- String attributeName = null;
- String prefix = null;
-
- if( propertyName.startsWith(JAVA_GET_PROPERTY_PREFIX) ) {
- prefix = JAVA_GET_PROPERTY_PREFIX;
- } else if( propertyName.startsWith(JAVA_SET_PROPERTY_PREFIX) ) {
- prefix = JAVA_SET_PROPERTY_PREFIX;
- } else if( propertyName.startsWith(JAVA_IS_PROPERTY_PREFIX) ) {
- prefix = JAVA_IS_PROPERTY_PREFIX;
- }
-
- if( (prefix != null) && (prefix.length() < propertyName.length()) ) {
- String remainder = propertyName.substring(prefix.length());
- if( (remainder.length() >= 2) &&
- Character.isUpperCase(remainder.charAt(0)) &&
- Character.isUpperCase(remainder.charAt(1)) ) {
- // don't set the first letter to lower-case if the
- // first two are upper-case
- attributeName = remainder;
- } else {
- attributeName = Character.toLowerCase(remainder.charAt(0)) +
- remainder.substring(1);
- }
- }
-
- return attributeName;
- }
-
- /**
- * Return IDL Type name for primitive types as defined in
- * Section 1.3.3 of Java2IDL spec or null if not a primitive type.
- */
- public IDLType getPrimitiveIDLTypeMapping(Class c) {
-
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- if( c.isPrimitive() ) {
- if( c == Void.TYPE ) {
- return new IDLType( c, "void" ) ;
- } else if( c == Boolean.TYPE ) {
- return new IDLType( c, "boolean" ) ;
- } else if( c == Character.TYPE ) {
- return new IDLType( c, "wchar" ) ;
- } else if( c == Byte.TYPE ) {
- return new IDLType( c, "octet" ) ;
- } else if( c == Short.TYPE ) {
- return new IDLType( c, "short" ) ;
- } else if( c == Integer.TYPE ) {
- return new IDLType( c, "long" ) ;
- } else if( c == Long.TYPE ) {
- return new IDLType( c, "long_long" ) ;
- } else if( c == Float.TYPE ) {
- return new IDLType( c, "float" ) ;
- } else if( c == Double.TYPE ) {
- return new IDLType( c, "double" ) ;
- }
- }
-
- return null;
- }
-
- /**
- * Return IDL Type name for special case type mappings as defined in
- * Table 1-1 of Java2IDL spec or null if given class is not a special
- * type.
- */
- public IDLType getSpecialCaseIDLTypeMapping(Class c) {
-
- if( c == null ) {
- throw new IllegalArgumentException();
- }
-
- if( c == java.lang.Object.class ) {
- return new IDLType( c, new String[] { "java", "lang" },
- "Object" ) ;
- } else if( c == java.lang.String.class ) {
- return new IDLType( c, new String[] { "CORBA" },
- "WStringValue" ) ;
- } else if( c == java.lang.Class.class ) {
- return new IDLType( c, new String[] { "javax", "rmi", "CORBA" },
- "ClassDesc" ) ;
- } else if( c == java.io.Serializable.class ) {
- return new IDLType( c, new String[] { "java", "io" },
- "Serializable" ) ;
- } else if( c == java.io.Externalizable.class ) {
- return new IDLType( c, new String[] { "java", "io" },
- "Externalizable" ) ;
- } else if( c == java.rmi.Remote.class ) {
- return new IDLType( c, new String[] { "java", "rmi" },
- "Remote" ) ;
- } else if( c == org.omg.CORBA.Object.class ) {
- return new IDLType( c, "Object" ) ;
- } else {
- return null;
- }
- }
-
- /**
- * Implements 1.2.3 #2 and #4
- */
- private void validateExceptions(Method method) throws IDLTypeException {
-
- Class[] exceptions = method.getExceptionTypes();
-
- boolean declaresRemoteExceptionOrSuperClass = false;
-
- // Section 1.2.3, #2
- for(int eIndex = 0; eIndex < exceptions.length; eIndex++) {
- Class exception = exceptions[eIndex];
- if( isRemoteExceptionOrSuperClass(exception) ) {
- declaresRemoteExceptionOrSuperClass = true;
- break;
- }
- }
-
- if( !declaresRemoteExceptionOrSuperClass ) {
- String msg = "Method '" + method + "' must throw at least one " +
- "exception of type java.rmi.RemoteException or one of its " +
- "super-classes";
- throw new IDLTypeException(msg);
- }
-
- // Section 1.2.3, #4
- // See also bug 4972402
- // For all exceptions E in exceptions,
- // (isCheckedException(E) => (isValue(E) || RemoteException.isAssignableFrom( E ) )
- for(int eIndex = 0; eIndex < exceptions.length; eIndex++) {
- Class exception = exceptions[eIndex];
-
- if (isCheckedException(exception) && !isValue(exception) &&
- !isRemoteException(exception))
- {
- String msg = "Exception '" + exception + "' on method '" +
- method + "' is not a allowed RMI/IIOP exception type";
- throw new IDLTypeException(msg);
- }
- }
-
- return;
- }
-
- /**
- * Returns true if the method's throw clause conforms to the exception
- * restrictions for properties as defined in Section 1.3.4.3 of
- * Java2IDL spec. This means that for all exceptions E declared on the
- * method, E isChecked => RemoteException.isAssignableFrom( E ).
- */
- private boolean validPropertyExceptions(Method method)
- {
- Class[] exceptions = method.getExceptionTypes();
-
- for(int eIndex = 0; eIndex < exceptions.length; eIndex++) {
- Class exception = exceptions[eIndex];
-
- if (isCheckedException(exception) && !isRemoteException(exception))
- return false ;
- }
-
- return true;
- }
-
- /**
- * Implements Section 1.2.3, #2.
- */
- private boolean isRemoteExceptionOrSuperClass(Class c) {
- return
- ((c == java.rmi.RemoteException.class) ||
- (c == java.io.IOException.class) ||
- (c == java.lang.Exception.class) ||
- (c == java.lang.Throwable.class));
- }
-
- /**
- * Implements Section 1.2.3, #5.
- */
- private void validateDirectInterfaces(Class c) throws IDLTypeException {
-
- Class[] directInterfaces = c.getInterfaces();
-
- if( directInterfaces.length < 2 ) {
- return;
- }
-
- Set allMethodNames = new HashSet();
- Set currentMethodNames = new HashSet();
-
- for(int i = 0; i < directInterfaces.length; i++) {
- Class next = directInterfaces[i];
- Method[] methods = next.getMethods();
-
- // Comparison is based on method names only. First collect
- // all methods from current interface, eliminating duplicate
- // names.
- currentMethodNames.clear();
- for(int m = 0; m < methods.length; m++) {
- currentMethodNames.add(methods[m].getName());
- }
-
- // Now check each method against list of all unique method
- // names processed so far.
- for(Iterator iter=currentMethodNames.iterator(); iter.hasNext();) {
- String methodName = (String) iter.next();
- if( allMethodNames.contains(methodName) ) {
- String msg = "Class " + c + " inherits method " +
- methodName + " from multiple direct interfaces.";
- throw new IDLTypeException(msg);
- } else {
- allMethodNames.add(methodName);
- }
- }
- }
-
- return;
- }
-
- /**
- * Implements 1.2.3 #6
- */
- private void validateConstants(final Class c)
- throws IDLTypeException {
-
- Field[] fields = null;
-
- try {
- fields = (Field[])
- java.security.AccessController.doPrivileged
- (new java.security.PrivilegedExceptionAction() {
- public java.lang.Object run() throws Exception {
- return c.getFields();
- }
- });
- } catch(java.security.PrivilegedActionException pae) {
- IDLTypeException ite = new IDLTypeException();
- ite.initCause(pae);
- throw ite;
- }
-
- for(int i = 0; i < fields.length; i++) {
- Field next = fields[i];
- Class fieldType = next.getType();
- if( (fieldType != java.lang.String.class) &&
- !isPrimitive(fieldType) ) {
- String msg = "Constant field '" + next.getName() +
- "' in class '" + next.getDeclaringClass().getName() +
- "' has invalid type' " + next.getType() + "'. Constants" +
- " in RMI/IIOP interfaces can only have primitive" +
- " types and java.lang.String types.";
- throw new IDLTypeException(msg);
- }
- }
-
-
- return;
- }
-
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientRequestImpl.sjava b/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientRequestImpl.sjava
deleted file mode 100644
index 6279ff6acb6..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientRequestImpl.sjava
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.iiop;
-
-import com.sun.corba.se.impl.protocol.Request;
-import com.sun.corba.se.impl.core.ClientRequest;
-import com.sun.corba.se.impl.core.ServiceContext;
-import com.sun.corba.se.impl.core.ServiceContexts;
-import com.sun.corba.se.impl.core.ClientResponse;
-import com.sun.corba.se.impl.core.ServerRequest;
-import com.sun.corba.se.impl.core.ServerResponse;
-import com.sun.corba.se.impl.corba.IOR;
-import com.sun.corba.se.impl.corba.GIOPVersion;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage;
-import com.sun.corba.se.impl.orbutil.ORBConstants;
-import com.sun.corba.se.impl.core.ORBVersion;
-import com.sun.corba.se.impl.core.ORB;
-import com.sun.corba.se.impl.orbutil.ORBUtility;
-import com.sun.corba.se.impl.ior.ObjectKeyFactory ;
-import com.sun.corba.se.impl.ior.ObjectKey ;
-import com.sun.corba.se.impl.ior.ObjectKeyTemplate ;
-import com.sun.corba.se.impl.ior.IIOPProfile;
-
-public class LocalClientRequestImpl extends IIOPOutputStream
- implements ClientRequest
-{
- public LocalClientRequestImpl( GIOPVersion gv,
- ORB orb, IOR ior, short addrDisposition,
- String operationName, boolean oneway, ServiceContexts svc,
- int requestId, byte streamFormatVersion)
- {
- super(gv,
- orb,
- null,
- BufferManagerFactory.newBufferManagerWrite(BufferManagerFactory.GROW),
- streamFormatVersion);
-
- this.isOneway = oneway;
- boolean responseExpected = !isOneway;
-
- IIOPProfile iop = ior.getProfile();
- ObjectKey okey = iop.getObjectKey();
- ObjectKeyTemplate oktemp = okey.getTemplate() ;
- ORBVersion version = oktemp.getORBVersion() ;
- orb.setORBVersion( version ) ;
-
- this.request = MessageBase.createRequest(orb, gv, requestId,
- responseExpected, ior, addrDisposition, operationName, svc, null);
- setMessage(request);
- request.write(this);
-
- // mark beginning of msg body for possible later use
- bodyBegin = getSize();
- }
-
- public int getRequestId() {
- return request.getRequestId();
- }
-
- public boolean isOneWay() {
- return isOneway;
- }
-
- public ServiceContexts getServiceContexts() {
- return request.getServiceContexts();
- }
-
- public String getOperationName() {
- return request.getOperation();
- }
-
- public ObjectKey getObjectKey() {
- return request.getObjectKey();
- }
-
- public ServerRequest getServerRequest()
- {
- // Set the size of the marshalled data in the message header.
- getMessage().setSize( getByteBuffer(), getSize() ) ;
-
- // Construct a new ServerRequest out of the buffer in this ClientRequest
- LocalServerRequestImpl serverRequest = new LocalServerRequestImpl(
- (ORB)orb(), toByteArray(), request ) ;
-
- // Skip over all of the GIOP header information. This positions
- // the offset in the buffer so that the skeleton can correctly read
- // the marshalled arguments.
- serverRequest.setIndex( bodyBegin ) ;
-
- return serverRequest ;
- }
-
- public ClientResponse invoke()
- {
- ORB myORB = (ORB)orb() ;
-
- ServerResponse serverResponse = myORB.process( getServerRequest() ) ;
-
- LocalServerResponseImpl lsr = (LocalServerResponseImpl)serverResponse ;
-
- return lsr.getClientResponse() ;
- }
-
- /**
- * Check to see if the request is local.
- */
- public boolean isLocal(){
- return true;
- }
-
- private RequestMessage request;
- private int bodyBegin;
- private boolean isOneway;
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientResponseImpl.sjava b/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientResponseImpl.sjava
deleted file mode 100644
index 24f40e7249f..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientResponseImpl.sjava
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.iiop;
-
-import java.io.IOException;
-
-import org.omg.CORBA.SystemException;
-import org.omg.CORBA.CompletionStatus;
-
-import com.sun.corba.se.impl.core.Response;
-import com.sun.corba.se.impl.core.ClientResponse;
-import com.sun.corba.se.impl.corba.IOR;
-import com.sun.corba.se.impl.core.ORB;
-import com.sun.corba.se.impl.core.ServiceContext;
-import com.sun.corba.se.impl.core.ServiceContexts;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;
-import com.sun.corba.se.impl.orbutil.MinorCodes;
-
-class LocalClientResponseImpl extends IIOPInputStream implements ClientResponse
-{
- LocalClientResponseImpl(ORB orb, byte[] buf, ReplyMessage header)
- {
- super(orb, buf, header.getSize(), header.isLittleEndian(), header, null);
-
- this.reply = header;
-
- // NOTE (Ram J) (06/02/2000) if we set result.setIndex(bodyBegin)
- // in LocalServerResponse.getClientResponse(), then we do not need
- // to read the headers (done below) anymore.
- // This will be an optimisation which is can be done to speed up the
- // local invocation by avoiding reading the headers in the local cases.
-
- // BUGFIX(Ram Jeyaraman) This has been moved from
- // LocalServerResponse.getClientResponse()
- // Skip over all of the GIOP header information. This positions
- // the offset in the buffer so that the skeleton can correctly read
- // the marshalled arguments.
- this.setIndex(Message.GIOPMessageHeaderLength);
-
- // BUGFIX(Ram Jeyaraman) For local invocations, the reply mesg fields
- // needs to be set, by reading the response buffer contents
- // to correctly set the exception type and other info.
- this.reply.read(this);
- }
-
- LocalClientResponseImpl(SystemException ex)
- {
- this.systemException = ex;
- }
-
- public boolean isSystemException() {
- if ( reply != null )
- return reply.getReplyStatus() == ReplyMessage.SYSTEM_EXCEPTION;
- else
- return (systemException != null);
- }
-
- public boolean isUserException() {
- if ( reply != null )
- return reply.getReplyStatus() == ReplyMessage.USER_EXCEPTION;
- else
- return false;
- }
-
- public boolean isLocationForward() {
- if ( reply != null ) {
- return ( (reply.getReplyStatus() == ReplyMessage.LOCATION_FORWARD) ||
- (reply.getReplyStatus() == ReplyMessage.LOCATION_FORWARD_PERM) );
- //return reply.getReplyStatus() == ReplyMessage.LOCATION_FORWARD;
- } else {
- return false;
- }
- }
-
- public boolean isDifferentAddrDispositionRequested() {
- if (reply != null) {
- return reply.getReplyStatus() == ReplyMessage.NEEDS_ADDRESSING_MODE;
- }
-
- return false;
- }
-
- public short getAddrDisposition() {
- if (reply != null) {
- return reply.getAddrDisposition();
- }
-
- throw new org.omg.CORBA.INTERNAL(
- "Null reply in getAddrDisposition",
- MinorCodes.NULL_REPLY_IN_GET_ADDR_DISPOSITION,
- CompletionStatus.COMPLETED_MAYBE);
- }
-
- public IOR getForwardedIOR() {
- if ( reply != null )
- return reply.getIOR();
- else
- return null;
- }
-
- public int getRequestId() {
- if ( reply != null )
- return reply.getRequestId();
- else
- throw new org.omg.CORBA.INTERNAL("Error in getRequestId");
- }
-
- public ServiceContexts getServiceContexts() {
- if ( reply != null )
- return reply.getServiceContexts();
- else
- return null;
- }
-
- public SystemException getSystemException() {
- if ( reply != null )
- return reply.getSystemException();
- else
- return systemException;
- }
-
- public java.lang.String peekUserExceptionId() {
- mark(Integer.MAX_VALUE);
- String result = read_string();
- reset();
- return result;
- }
-
- /**
- * Check to see if the response is local.
- */
- public boolean isLocal(){
- return true;
- }
-
- private ReplyMessage reply;
- private SystemException systemException;
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerRequestImpl.sjava b/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerRequestImpl.sjava
deleted file mode 100644
index ecafbee3947..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerRequestImpl.sjava
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.iiop;
-
-import org.omg.CORBA.SystemException;
-
-import com.sun.corba.se.impl.core.ServerRequest;
-import com.sun.corba.se.impl.core.ServiceContext;
-import com.sun.corba.se.impl.core.DuplicateServiceContext;
-import com.sun.corba.se.impl.core.UEInfoServiceContext;
-import com.sun.corba.se.impl.core.ServiceContexts;
-import com.sun.corba.se.impl.core.ServerResponse;
-import com.sun.corba.se.impl.corba.IOR;
-import com.sun.corba.se.impl.core.ORB;
-import com.sun.corba.se.impl.orbutil.ORBUtility; //d11638
-import org.omg.CORBA.portable.UnknownException;
-import org.omg.CORBA.UNKNOWN;
-import org.omg.CORBA.CompletionStatus;
-import com.sun.corba.se.impl.ior.ObjectKey;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage;
-
-class LocalServerRequestImpl extends IIOPInputStream implements ServerRequest {
- org.omg.CORBA.portable.OutputStream replyStream;
- org.omg.CORBA.portable.OutputStream exceptionReplyStream;
-
- LocalServerRequestImpl(ORB orb, byte[] buf, RequestMessage header)
- {
- super(orb, buf, header.getSize(), header.isLittleEndian(), header, null );
-
- this.request = header;
- }
-
- public int getRequestId() {
- return request.getRequestId();
- }
-
- public boolean isOneWay() {
- return !request.isResponseExpected();
- }
-
- public ServiceContexts getServiceContexts() {
- return request.getServiceContexts();
- }
-
- public String getOperationName() {
- return request.getOperation();
- }
-
- public ObjectKey getObjectKey() {
- return request.getObjectKey();
- }
-
- public ServerResponse createResponse(ServiceContexts svc)
- {
- return new LocalServerResponseImpl(this, svc);
- }
-
- public org.omg.CORBA.portable.OutputStream createReply() {
- if (replyStream == null) {
- replyStream = (org.omg.CORBA.portable.OutputStream)
- createResponse(null);
- }
- return replyStream;
- }
-
- public org.omg.CORBA.portable.OutputStream createExceptionReply() {
- if (exceptionReplyStream == null) {
- exceptionReplyStream = (org.omg.CORBA.portable.OutputStream)
- createUserExceptionResponse(null);
- }
- return exceptionReplyStream;
- }
-
- public ServerResponse createUserExceptionResponse(
- ServiceContexts svc)
- {
- return new LocalServerResponseImpl(this, svc, true);
- }
-
- public ServerResponse createUnknownExceptionResponse(
- UnknownException ex) {
- ServiceContexts contexts = null;
- SystemException sys = new UNKNOWN( 0,
- CompletionStatus.COMPLETED_MAYBE);
-
- try {
- contexts = new ServiceContexts( (ORB)orb() );
- UEInfoServiceContext uei = new UEInfoServiceContext(sys);
- contexts.put(uei) ;
- } catch (DuplicateServiceContext d) {
- // can't happen
- }
-
- return createSystemExceptionResponse(sys,contexts);
- }
-
- public ServerResponse createSystemExceptionResponse(
- SystemException ex, ServiceContexts svc) {
-
- // Only do this if interceptors have been initialized on this request
- // and have not completed their lifecycle (otherwise the info stack
- // may be empty or have a different request's entry on top).
- if (executePIInResponseConstructor()) {
- // Inform Portable Interceptors of the SystemException. This is
- // required to be done here because the ending interception point
- // is called in the ServerResponseImpl constructor called below
- // but we do not currently write the SystemException into the
- // response until after the ending point is called.
- ORB orb = (ORB)orb();
- orb.getPIHandler().setServerPIInfo( ex );
- }
-
- if (orb() != null && ((ORB)orb()).subcontractDebugFlag && ex != null)
- ORBUtility.dprint(this, "Sending SystemException:", ex);
-
- LocalServerResponseImpl response =
- new LocalServerResponseImpl(this, svc, false);
- ORBUtility.writeSystemException(ex, response);
- return response;
- }
-
- public ServerResponse createLocationForward(
- IOR ior, ServiceContexts svc) {
- ReplyMessage reply = MessageBase.createReply( (ORB)orb(),
- request.getGIOPVersion(), request.getRequestId(),
- ReplyMessage.LOCATION_FORWARD, svc, ior);
- LocalServerResponseImpl response =
- new LocalServerResponseImpl(this, reply, ior);
-
- return response;
- }
-
- private RequestMessage request;
-
- /**
- * Check to see if the request is local.
- */
- public boolean isLocal(){
- return true;
- }
-
- private boolean _executeReturnServantInResponseConstructor = false;
-
- public boolean executeReturnServantInResponseConstructor()
- {
- return _executeReturnServantInResponseConstructor;
- }
-
- public void setExecuteReturnServantInResponseConstructor(boolean b)
- {
- _executeReturnServantInResponseConstructor = b;
- }
-
-
- private boolean _executeRemoveThreadInfoInResponseConstructor = false;
-
- public boolean executeRemoveThreadInfoInResponseConstructor()
- {
- return _executeRemoveThreadInfoInResponseConstructor;
- }
-
- public void setExecuteRemoveThreadInfoInResponseConstructor(boolean b)
- {
- _executeRemoveThreadInfoInResponseConstructor = b;
- }
-
-
- private boolean _executePIInResponseConstructor = false;
-
- public boolean executePIInResponseConstructor() {
- return _executePIInResponseConstructor;
- }
-
- public void setExecutePIInResponseConstructor( boolean b ) {
- _executePIInResponseConstructor = b;
- }
-
- // We know that we're talking to the same ValueHandler, so
- // use the maximum version it supports.
- public byte getStreamFormatVersionForReply() {
- return ORBUtility.getMaxStreamFormatVersion();
- }
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerResponseImpl.sjava b/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerResponseImpl.sjava
deleted file mode 100644
index 8574ccfadf1..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalServerResponseImpl.sjava
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.iiop;
-
-import org.omg.CORBA.SystemException;
-
-import com.sun.corba.se.impl.core.ServerResponse;
-import com.sun.corba.se.impl.core.ORB;
-import com.sun.corba.se.impl.corba.IOR;
-import com.sun.corba.se.impl.core.ServiceContext;
-import com.sun.corba.se.impl.core.ServiceContexts;
-import com.sun.corba.se.impl.core.ClientResponse;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage;
-
-class LocalServerResponseImpl
- extends IIOPOutputStream
- implements ServerResponse
-{
- LocalServerResponseImpl(LocalServerRequestImpl request, ServiceContexts svc)
- {
- this(request,
- MessageBase.createReply(
- (ORB)request.orb(),
- request.getGIOPVersion(),
- request.getRequestId(), ReplyMessage.NO_EXCEPTION,
- svc, null),
- null);
- }
-
- LocalServerResponseImpl(LocalServerRequestImpl request, ServiceContexts svc,
- boolean user)
- {
- this(request,
- MessageBase.createReply(
- (ORB)request.orb(),
- request.getGIOPVersion(), request.getRequestId(),
- user ? ReplyMessage.USER_EXCEPTION :
- ReplyMessage.SYSTEM_EXCEPTION,
- svc, null),
- null);
- }
-
- LocalServerResponseImpl( LocalServerRequestImpl request, ReplyMessage reply,
- IOR ior)
- {
- super(request.getGIOPVersion(),
- (ORB)request.orb(),
- null,
- BufferManagerFactory.newBufferManagerWrite(BufferManagerFactory.GROW),
- request.getStreamFormatVersionForReply());
-
- setMessage(reply);
-
- ORB orb = (ORB)request.orb();
-
- ServerResponseImpl.runServantPostInvoke(orb, request);
-
- if( request.executePIInResponseConstructor() ) {
- // Invoke server request ending interception points (send_*):
- // Note: this may end up with a SystemException or an internal
- // Runtime ForwardRequest.
- orb.getPIHandler().invokeServerPIEndingPoint( reply );
-
- // Note this will be executed even if a ForwardRequest or
- // SystemException is thrown by a Portable Interceptors ending
- // point since we end up in this constructor again anyway.
- orb.getPIHandler().cleanupServerPIRequest();
-
- // See (Local)ServerRequestImpl.createSystemExceptionResponse
- // for why this is necesary.
- request.setExecutePIInResponseConstructor(false);
- }
-
- // Once you get here then the final reply is available (i.e.,
- // postinvoke and interceptors have completed.
- if (request.executeRemoveThreadInfoInResponseConstructor()) {
- ServerResponseImpl.removeThreadInfo(orb, request);
- }
-
- reply.write(this);
- if (reply.getIOR() != null)
- reply.getIOR().write(this);
-
- this.reply = reply;
- this.ior = reply.getIOR();
- }
-
- public boolean isSystemException() {
- if (reply != null)
- return reply.getReplyStatus() == ReplyMessage.SYSTEM_EXCEPTION;
- return false;
- }
-
- public boolean isUserException() {
- if (reply != null)
- return reply.getReplyStatus() == ReplyMessage.USER_EXCEPTION;
- return false;
- }
-
- public boolean isLocationForward() {
- if (ior != null)
- return true;
- return false;
- }
-
- public IOR getForwardedIOR() {
- return ior;
- }
-
- public int getRequestId() {
- if (reply != null)
- return reply.getRequestId();
- return -1;
- }
-
- public ServiceContexts getServiceContexts() {
- if (reply != null)
- return reply.getServiceContexts();
- return null;
- }
-
- public SystemException getSystemException() {
- if (reply != null)
- return reply.getSystemException();
- return null;
- }
-
- public ReplyMessage getReply()
- {
- return reply ;
- }
-
- public ClientResponse getClientResponse()
- {
- // set the size of the marshalled data in the message header
- getMessage().setSize(getByteBuffer(), getSize());
-
- // Construct a new ClientResponse out of the buffer in this ClientRequest
- LocalClientResponseImpl result =
- new LocalClientResponseImpl( (ORB)orb(), toByteArray(), reply);
-
- // NOTE (Ram J) (06/02/2000) if we set result.setIndex(bodyBegin) here
- // then the LocalClientResponse does not need to read the headers anymore.
- // This will be an optimisation which is can be done to speed up the
- // local invocation by avoiding reading the headers in the local cases.
-
- // BUGFIX(Ram Jeyaraman) result.setOffset is now done in
- // LocalClientResponseImpl constructor.
- /*
- // Skip over all of the GIOP header information. This positions
- // the offset in the buffer so that the skeleton can correctly read
- // the marshalled arguments.
- result.setOffset( bodyBegin ) ;
- */
-
- return result ;
- }
-
- /**
- * Check to see if the response is local.
- */
- public boolean isLocal(){
- return true;
- }
-
- private ReplyMessage reply;
- private IOR ior; // forwarded IOR
-}
diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/BufferConnectionImpl.sjava b/corba/src/share/classes/com/sun/corba/se/impl/transport/BufferConnectionImpl.sjava
deleted file mode 100644
index c54ee9434f1..00000000000
--- a/corba/src/share/classes/com/sun/corba/se/impl/transport/BufferConnectionImpl.sjava
+++ /dev/null
@@ -1,710 +0,0 @@
-/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.corba.se.impl.transport;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.nio.ByteBuffer;
-import java.nio.channels.SelectableChannel;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.SocketChannel;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.omg.CORBA.COMM_FAILURE;
-import org.omg.CORBA.CompletionStatus;
-import org.omg.CORBA.DATA_CONVERSION;
-import org.omg.CORBA.INTERNAL;
-import org.omg.CORBA.MARSHAL;
-import org.omg.CORBA.OBJECT_NOT_EXIST;
-import org.omg.CORBA.SystemException;
-
-import com.sun.org.omg.SendingContext.CodeBase;
-
-import com.sun.corba.se.pept.broker.Broker;
-import com.sun.corba.se.pept.encoding.InputObject;
-import com.sun.corba.se.pept.encoding.OutputObject;
-import com.sun.corba.se.pept.protocol.MessageMediator;
-import com.sun.corba.se.pept.transport.Acceptor;
-import com.sun.corba.se.pept.transport.Connection;
-import com.sun.corba.se.pept.transport.ConnectionCache;
-import com.sun.corba.se.pept.transport.ContactInfo;
-import com.sun.corba.se.pept.transport.EventHandler;
-import com.sun.corba.se.pept.transport.InboundConnectionCache;
-import com.sun.corba.se.pept.transport.OutboundConnectionCache;
-import com.sun.corba.se.pept.transport.ResponseWaitingRoom;
-import com.sun.corba.se.pept.transport.Selector;
-
-import com.sun.corba.se.spi.ior.IOR;
-import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
-import com.sun.corba.se.spi.logging.CORBALogDomains;
-import com.sun.corba.se.spi.orb.ORB ;
-import com.sun.corba.se.spi.orbutil.threadpool.Work;
-import com.sun.corba.se.spi.protocol.CorbaMessageMediator;
-import com.sun.corba.se.spi.transport.CorbaContactInfo;
-import com.sun.corba.se.spi.transport.CorbaConnection;
-import com.sun.corba.se.spi.transport.CorbaResponseWaitingRoom;
-
-import com.sun.corba.se.impl.encoding.CachedCodeBase;
-import com.sun.corba.se.impl.encoding.CDRInputStream_1_0;
-import com.sun.corba.se.impl.encoding.CDROutputObject;
-import com.sun.corba.se.impl.encoding.CDROutputStream_1_0;
-import com.sun.corba.se.impl.encoding.CodeSetComponentInfo;
-import com.sun.corba.se.impl.encoding.OSFCodeSetRegistry;
-import com.sun.corba.se.impl.logging.ORBUtilSystemException;
-import com.sun.corba.se.impl.orbutil.ORBConstants;
-import com.sun.corba.se.impl.orbutil.ORBUtility;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
-import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
-import com.sun.corba.se.impl.transport.CorbaResponseWaitingRoomImpl;
-
-/**
- * @author Ken Cavanaugh
- */
-public class BufferConnectionImpl
- extends
- EventHandlerBase
- implements
- CorbaConnection,
- Work
-{
- //
- // New transport.
- //
-
- protected long enqueueTime;
-
- public SocketChannel getSocketChannel()
- {
- return null;
- }
-
- // REVISIT:
- // protected for test: genericRPCMSGFramework.IIOPConnection constructor.
-
- //
- // From iiop.Connection.java
- //
-
- protected long timeStamp = 0;
- protected boolean isServer = false;
-
- // Start at some value other than zero since this is a magic
- // value in some protocols.
- protected int requestId = 5;
- protected CorbaResponseWaitingRoom responseWaitingRoom;
- protected int state;
- protected java.lang.Object stateEvent = new java.lang.Object();
- protected java.lang.Object writeEvent = new java.lang.Object();
- protected boolean writeLocked;
- protected int serverRequestCount = 0;
-
- // Server request map: used on the server side of Connection
- // Maps request ID to IIOPInputStream.
- Map serverRequestMap = new HashMap() ;
-
- // This is a flag associated per connection telling us if the
- // initial set of sending contexts were sent to the receiver
- // already...
- protected boolean postInitialContexts = false;
-
- // Remote reference to CodeBase server (supplies
- // FullValueDescription, among other things)
- protected IOR codeBaseServerIOR;
-
- // CodeBase cache for this connection. This will cache remote operations,
- // handle connecting, and ensure we don't do any remote operations until
- // necessary.
- protected CachedCodeBase cachedCodeBase = new CachedCodeBase(this);
-
- protected ORBUtilSystemException wrapper ;
-
- List buffers ;
-
- public BufferConnectionImpl(ORB orb, byte[][] data )
- {
- this.orb = orb;
- wrapper = ORBUtilSystemException.get( orb,
- CORBALogDomains.RPC_TRANSPORT ) ;
- buffers = new ArrayList() ;
- }
-
- ////////////////////////////////////////////////////
- //
- // framework.transport.Connection
- //
-
- public boolean shouldRegisterReadEvent()
- {
- return false;
- }
-
- public boolean shouldRegisterServerReadEvent()
- {
- return false;
- }
-
- public boolean read()
- {
- return true ;
- }
-
- protected CorbaMessageMediator readBits()
- {
- return null ;
- }
-
- protected boolean dispatch(CorbaMessageMediator messageMediator)
- {
- }
-
- public boolean shouldUseDirectByteBuffers()
- {
- return false ;
- }
-
- // Only called from readGIOPMessage with (12, 0, 12) as arguments
- // size is size of buffer to create
- // offset is offset from start of message in buffer
- // length is length to read
- public ByteBuffer read(int size, int offset, int length)
- throws IOException
- {
- byte[] buf = new byte[size];
- readFully( buf, offset, length);
- ByteBuffer byteBuffer = ByteBuffer.wrap(buf);
- byteBuffer.limit(size);
- return byteBuffer;
- }
-
- // Only called as read( buf, 12, msgsize-12 ) in readGIOPMessage
- // We can ignore the byteBuffer parameter
- // offset is the starting position to place data in the result
- // length is the length of the data to read
- public ByteBuffer read(ByteBuffer byteBuffer, int offset, int length)
- throws IOException
- {
- int size = offset + length;
- byte[] buf = new byte[size];
- readFully(buf, offset, length);
- return ByteBuffer.wrap(buf);
- }
-
- // Read size bytes from buffer list and place the data
- // starting at offset in buf.
- public void readFully(byte[] buf, int offset, int size)
- throws IOException
- {
- int remaining = size ;
- int position = offset ;
- while (remaining > 0) {
- ByteBuffer buff = (ByteBuffer)buffers.get(0) ;
- int dataSize = buff.remaining() ;
- int xferSize = dataSize ;
- if (dataSize >= remaining) :
- xferSize = remaining ;
- buffers.remove(0) ;
- }
-
- buff.get( buf, offset, xferSize ) ;
-
- offset += xferSize ;
- remaining -= xferSize ;
- }
- }
-
- public void write(ByteBuffer byteBuffer)
- throws IOException
- {
- buffers.add( byteBuffer ) ;
- }
-
- /**
- * Note:it is possible for this to be called more than once
- */
- public synchronized void close()
- {
- }
-
- public Acceptor getAcceptor()
- {
- return null;
- }
-
- public ContactInfo getContactInfo()
- {
- return null;
- }
-
- public EventHandler getEventHandler()
- {
- return this;
- }
-
- public OutputObject createOutputObject(MessageMediator messageMediator)
- {
- // REVISIT - remove this method from Connection and all it subclasses.
- throw new RuntimeException("*****SocketOrChannelConnectionImpl.createOutputObject - should not be called.");
- }
-
- // This is used by the GIOPOutputObject in order to
- // throw the correct error when handling code sets.
- // Can we determine if we are on the server side by
- // other means? XREVISIT
- public boolean isServer()
- {
- return isServer;
- }
-
- public boolean isBusy()
- {
- return false ;
- }
-
- public long getTimeStamp()
- {
- return timeStamp;
- }
-
- public void setTimeStamp(long time)
- {
- timeStamp = time;
- }
-
- public void setState(String stateString)
- {
- synchronized (stateEvent) {
- if (stateString.equals("ESTABLISHED")) {
- state = ESTABLISHED;
- stateEvent.notifyAll();
- } else {
- // REVISIT: ASSERT
- }
- }
- }
-
- public void writeLock()
- {
- }
-
- public void writeUnlock()
- {
- }
-
- public void sendWithoutLock(OutputObject outputObject)
- {
- }
-
- public void registerWaiter(MessageMediator messageMediator)
- {
- }
-
- public void unregisterWaiter(MessageMediator messageMediator)
- {
- }
-
- public InputObject waitForResponse(MessageMediator messageMediator)
- {
- return null ;
- }
-
- public void setConnectionCache(ConnectionCache connectionCache)
- {
- }
-
- public ConnectionCache getConnectionCache()
- {
- return null;
- }
-
- ////////////////////////////////////////////////////
- //
- // EventHandler methods
- //
-
- public SelectableChannel getChannel()
- {
- return null;
- }
-
- public int getInterestOps()
- {
- return null;
- }
-
- // public Acceptor getAcceptor() - already defined above.
-
- public Connection getConnection()
- {
- return this;
- }
-
- ////////////////////////////////////////////////////
- //
- // Work methods.
- //
-
- public String getName()
- {
- return this.toString();
- }
-
- public void doWork()
- {
- }
-
- public void setEnqueueTime(long timeInMillis)
- {
- enqueueTime = timeInMillis;
- }
-
- public long getEnqueueTime()
- {
- return enqueueTime;
- }
-
- ////////////////////////////////////////////////////
- //
- // spi.transport.CorbaConnection.
- //
-
- public ResponseWaitingRoom getResponseWaitingRoom()
- {
- return null ;
- }
-
- // REVISIT - inteface defines isServer but already defined in
- // higher interface.
-
-
- public void serverRequestMapPut(int requestId,
- CorbaMessageMediator messageMediator)
- {
- serverRequestMap.put(new Integer(requestId), messageMediator);
- }
-
- public CorbaMessageMediator serverRequestMapGet(int requestId)
- {
- return (CorbaMessageMediator)
- serverRequestMap.get(new Integer(requestId));
- }
-
- public void serverRequestMapRemove(int requestId)
- {
- serverRequestMap.remove(new Integer(requestId));
- }
-
-
- // REVISIT: this is also defined in:
- // com.sun.corba.se.spi.legacy.connection.Connection
- public java.net.Socket getSocket()
- {
- return null;
- }
-
- /** It is possible for a Close Connection to have been
- ** sent here, but we will not check for this. A "lazy"
- ** Exception will be thrown in the Worker thread after the
- ** incoming request has been processed even though the connection
- ** is closed before the request is processed. This is o.k because
- ** it is a boundary condition. To prevent it we would have to add
- ** more locks which would reduce performance in the normal case.
- **/
- public synchronized void serverRequestProcessingBegins()
- {
- serverRequestCount++;
- }
-
- public synchronized void serverRequestProcessingEnds()
- {
- serverRequestCount--;
- }
-
- //
- //
- //
-
- public synchronized int getNextRequestId()
- {
- return requestId++;
- }
-
- // Negotiated code sets for char and wchar data
- protected CodeSetComponentInfo.CodeSetContext codeSetContext = null;
-
- public ORB getBroker()
- {
- return orb;
- }
-
- public CodeSetComponentInfo.CodeSetContext getCodeSetContext()
- {
- // Needs to be synchronized for the following case when the client
- // doesn't send the code set context twice, and we have two threads
- // in ServerRequestDispatcher processCodeSetContext.
- //
- // Thread A checks to see if there is a context, there is none, so
- // it calls setCodeSetContext, getting the synch lock.
- // Thread B checks to see if there is a context. If we didn't synch,
- // it might decide to outlaw wchar/wstring.
- if (codeSetContext == null) {
- synchronized(this) {
- return codeSetContext;
- }
- }
-
- return codeSetContext;
- }
-
- public synchronized void setCodeSetContext(CodeSetComponentInfo.CodeSetContext csc) {
- // Double check whether or not we need to do this
- if (codeSetContext == null) {
-
- if (OSFCodeSetRegistry.lookupEntry(csc.getCharCodeSet()) == null ||
- OSFCodeSetRegistry.lookupEntry(csc.getWCharCodeSet()) == null) {
- // If the client says it's negotiated a code set that
- // isn't a fallback and we never said we support, then
- // it has a bug.
- throw wrapper.badCodesetsFromClient() ;
- }
-
- codeSetContext = csc;
- }
- }
-
- //
- // from iiop.IIOPConnection.java
- //
-
- // Map request ID to an InputObject.
- // This is so the client thread can start unmarshaling
- // the reply and remove it from the out_calls map while the
- // ReaderThread can still obtain the input stream to give
- // new fragments. Only the ReaderThread touches the clientReplyMap,
- // so it doesn't incur synchronization overhead.
-
- public MessageMediator clientRequestMapGet(int requestId)
- {
- return null ;
- }
-
- protected MessageMediator clientReply_1_1;
-
- public void clientReply_1_1_Put(MessageMediator x)
- {
- clientReply_1_1 = x;
- }
-
- public MessageMediator clientReply_1_1_Get()
- {
- return clientReply_1_1;
- }
-
- public void clientReply_1_1_Remove()
- {
- clientReply_1_1 = null;
- }
-
- protected MessageMediator serverRequest_1_1;
-
- public void serverRequest_1_1_Put(MessageMediator x)
- {
- serverRequest_1_1 = x;
- }
-
- public MessageMediator serverRequest_1_1_Get()
- {
- return serverRequest_1_1;
- }
-
- public void serverRequest_1_1_Remove()
- {
- serverRequest_1_1 = null;
- }
-
- protected String getStateString( int state )
- {
- synchronized ( stateEvent ){
- switch (state) {
- case OPENING : return "OPENING" ;
- case ESTABLISHED : return "ESTABLISHED" ;
- case CLOSE_SENT : return "CLOSE_SENT" ;
- case CLOSE_RECVD : return "CLOSE_RECVD" ;
- case ABORT : return "ABORT" ;
- default : return "???" ;
- }
- }
- }
-
- public synchronized boolean isPostInitialContexts() {
- return postInitialContexts;
- }
-
- // Can never be unset...
- public synchronized void setPostInitialContexts(){
- postInitialContexts = true;
- }
-
- /**
- * Wake up the outstanding requests on the connection, and hand them
- * COMM_FAILURE exception with a given minor code.
- *
- * Also, delete connection from connection table and
- * stop the reader thread.
-
- * Note that this should only ever be called by the Reader thread for
- * this connection.
- *
- * @param minor_code The minor code for the COMM_FAILURE major code.
- * @param die Kill the reader thread (this thread) before exiting.
- */
- public void purgeCalls(SystemException systemException,
- boolean die, boolean lockHeld)
- {
- }
-
- /*************************************************************************
- * The following methods are for dealing with Connection cleaning for
- * better scalability of servers in high network load conditions.
- **************************************************************************/
-
- public void sendCloseConnection(GIOPVersion giopVersion)
- throws IOException
- {
- Message msg = MessageBase.createCloseConnection(giopVersion);
- sendHelper(giopVersion, msg);
- }
-
- public void sendMessageError(GIOPVersion giopVersion)
- throws IOException
- {
- Message msg = MessageBase.createMessageError(giopVersion);
- sendHelper(giopVersion, msg);
- }
-
- /**
- * Send a CancelRequest message. This does not lock the connection, so the
- * caller needs to ensure this method is called appropriately.
- * @exception IOException - could be due to abortive connection closure.
- */
- public void sendCancelRequest(GIOPVersion giopVersion, int requestId)
- throws IOException
- {
-
- Message msg = MessageBase.createCancelRequest(giopVersion, requestId);
- sendHelper(giopVersion, msg);
- }
-
- protected void sendHelper(GIOPVersion giopVersion, Message msg)
- throws IOException
- {
- // REVISIT: See comments in CDROutputObject constructor.
- CDROutputObject outputObject =
- new CDROutputObject((ORB)orb, null, giopVersion, this, msg,
- ORBConstants.STREAM_FORMAT_VERSION_1);
- msg.write(outputObject);
-
- outputObject.writeTo(this);
- }
-
- public void sendCancelRequestWithLock(GIOPVersion giopVersion,
- int requestId)
- throws IOException
- {
- writeLock();
- try {
- sendCancelRequest(giopVersion, requestId);
- } finally {
- writeUnlock();
- }
- }
-
- // Begin Code Base methods ---------------------------------------
- //
- // Set this connection's code base IOR. The IOR comes from the
- // SendingContext. This is an optional service context, but all
- // JavaSoft ORBs send it.
- //
- // The set and get methods don't need to be synchronized since the
- // first possible get would occur during reading a valuetype, and
- // that would be after the set.
-
- // Sets this connection's code base IOR. This is done after
- // getting the IOR out of the SendingContext service context.
- // Our ORBs always send this, but it's optional in CORBA.
-
- public final void setCodeBaseIOR(IOR ior) {
- codeBaseServerIOR = ior;
- }
-
- public final IOR getCodeBaseIOR() {
- return codeBaseServerIOR;
- }
-
- // Get a CodeBase stub to use in unmarshaling. The CachedCodeBase
- // won't connect to the remote codebase unless it's necessary.
- public final CodeBase getCodeBase() {
- return cachedCodeBase;
- }
-
- // End Code Base methods -----------------------------------------
-
- // Can be overridden in subclass for different options.
- protected void setSocketOptions(Socket socket)
- {
- }
-
- public String toString()
- {
- synchronized ( stateEvent ){
- return
- "BufferConnectionImpl[" + " "
- + getStateString( state ) + " "
- + shouldUseSelectThreadToWait() + " "
- + shouldUseWorkerThreadForEvent()
- + "]" ;
- }
- }
-
- // Must be public - used in encoding.
- public void dprint(String msg)
- {
- ORBUtility.dprint("SocketOrChannelConnectionImpl", msg);
- }
-
- protected void dprint(String msg, Throwable t)
- {
- dprint(msg);
- t.printStackTrace(System.out);
- }
-}
-
-// End of file.
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index 56f7ea3c416..b58c3218710 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -365,3 +365,7 @@ c9dd82da51ed34a28f7c6b3245163ee962e94572 hs25-b40
46487ba40ff225654d0c51787ed3839bafcbd9f3 hs25-b43
f6921c876db192bba389cec062855a66372da01c jdk8-b101
530fe88b3b2c710f42810b3580d86a0d83ad6c1c hs25-b44
+c4697c1c448416108743b59118b4a2498b339d0c jdk8-b102
+7f55137d6aa81efc6eb0035813709f2cb6a26b8b hs25-b45
+6f9be7f87b9653e94fd8fb3070891a0cc91b15bf jdk8-b103
+580430d131ccd475e2f2ad4006531b8c4813d102 hs25-b46
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java
index dd800a49bc4..dbf09b29119 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java
@@ -29,11 +29,10 @@ public interface JVMTIThreadState {
public static final int JVMTI_THREAD_STATE_ALIVE = 0x0001;
public static final int JVMTI_THREAD_STATE_TERMINATED = 0x0002;
public static final int JVMTI_THREAD_STATE_RUNNABLE = 0x0004;
- public static final int JVMTI_THREAD_STATE_WAITING = 0x0008;
+ public static final int JVMTI_THREAD_STATE_WAITING = 0x0080;
public static final int JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 0x0010;
public static final int JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 0x0020;
public static final int JVMTI_THREAD_STATE_SLEEPING = 0x0040;
- public static final int JVMTI_THREAD_STATE_WAITING_FOR_NOTIFICATION = 0x0080;
public static final int JVMTI_THREAD_STATE_IN_OBJECT_WAIT = 0x0100;
public static final int JVMTI_THREAD_STATE_PARKED = 0x0200;
public static final int JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER = 0x0400;
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java
index 2530f1af7a7..66344b553f6 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java
@@ -44,7 +44,7 @@ public class PhaseCFG extends Phase {
Type type = db.lookupType("PhaseCFG");
numBlocksField = new CIntField(type.getCIntegerField("_num_blocks"), 0);
blocksField = type.getAddressField("_blocks");
- bbsField = type.getAddressField("_bbs");
+ bbsField = type.getAddressField("_node_to_block_mapping");
brootField = type.getAddressField("_broot");
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java
index fb17c53d329..226a1762570 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java
@@ -32,7 +32,7 @@ import sun.jvm.hotspot.types.*;
// to the sys_thread_t structure of the classic JVM implementation.
public class OSThread extends VMObject {
private static JIntField interruptedField;
- private static JIntField threadIdField;
+ private static Field threadIdField;
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@@ -44,7 +44,7 @@ public class OSThread extends VMObject {
private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("OSThread");
interruptedField = type.getJIntField("_interrupted");
- threadIdField = type.getJIntField("_thread_id");
+ threadIdField = type.getField("_thread_id");
}
public OSThread(Address addr) {
@@ -56,7 +56,7 @@ public class OSThread extends VMObject {
}
public int threadId() {
- return (int)threadIdField.getValue(addr);
+ return threadIdField.getJInt(addr);
}
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java
index 96817b26226..418bef9a086 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, 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
@@ -74,23 +74,24 @@ public class ClassDump extends Tool {
public void run() {
// Ready to go with the database...
try {
- // The name of the filter always comes from a System property.
- // If we have a pkgList, pass it, otherwise let the filter read
- // its own System property for the list of classes.
- String filterClassName = System.getProperty("sun.jvm.hotspot.tools.jcore.filter",
- "sun.jvm.hotspot.tools.jcore.PackageNameFilter");
- try {
- Class filterClass = Class.forName(filterClassName);
- if (pkgList == null) {
- classFilter = (ClassFilter) filterClass.newInstance();
- } else {
- Constructor con = filterClass.getConstructor(String.class);
- classFilter = (ClassFilter) con.newInstance(pkgList);
+ if (classFilter == null) {
+ // If not already set, the name of the filter comes from a System property.
+ // If we have a pkgList, pass it, otherwise let the filter read
+ // its own System property for the list of classes.
+ String filterClassName = System.getProperty("sun.jvm.hotspot.tools.jcore.filter",
+ "sun.jvm.hotspot.tools.jcore.PackageNameFilter");
+ try {
+ Class filterClass = Class.forName(filterClassName);
+ if (pkgList == null) {
+ classFilter = (ClassFilter) filterClass.newInstance();
+ } else {
+ Constructor con = filterClass.getConstructor(String.class);
+ classFilter = (ClassFilter) con.newInstance(pkgList);
+ }
+ } catch(Exception exp) {
+ System.err.println("Warning: Can not create class filter!");
}
- } catch(Exception exp) {
- System.err.println("Warning: Can not create class filter!");
}
-
String outputDirectory = System.getProperty("sun.jvm.hotspot.tools.jcore.outputDir", ".");
setOutputDirectory(outputDirectory);
diff --git a/hotspot/make/bsd/makefiles/adlc.make b/hotspot/make/bsd/makefiles/adlc.make
index 826d256b9eb..cf5c05e2ac7 100644
--- a/hotspot/make/bsd/makefiles/adlc.make
+++ b/hotspot/make/bsd/makefiles/adlc.make
@@ -41,13 +41,11 @@ SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad
ifeq ("${Platform_arch_model}", "${Platform_arch}")
SOURCES.AD = \
- $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
- $(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad)
+ $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad)
else
SOURCES.AD = \
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
- $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch).ad) \
- $(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad)
+ $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch).ad)
endif
EXEC = $(OUTDIR)/adlc
diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version
index 578a0dfd0de..2ec3b0aaf52 100644
--- a/hotspot/make/hotspot_version
+++ b/hotspot/make/hotspot_version
@@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013
HS_MAJOR_VER=25
HS_MINOR_VER=0
-HS_BUILD_NUMBER=44
+HS_BUILD_NUMBER=46
JDK_MAJOR_VER=1
JDK_MINOR_VER=8
diff --git a/hotspot/make/linux/makefiles/adlc.make b/hotspot/make/linux/makefiles/adlc.make
index 25ace2f5f76..7b808d9b2ae 100644
--- a/hotspot/make/linux/makefiles/adlc.make
+++ b/hotspot/make/linux/makefiles/adlc.make
@@ -41,13 +41,11 @@ SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad
ifeq ("${Platform_arch_model}", "${Platform_arch}")
SOURCES.AD = \
- $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
- $(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad)
+ $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad)
else
SOURCES.AD = \
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
- $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch).ad) \
- $(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad)
+ $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch).ad)
endif
EXEC = $(OUTDIR)/adlc
diff --git a/hotspot/make/solaris/makefiles/adlc.make b/hotspot/make/solaris/makefiles/adlc.make
index 750bd8319bf..642a7ca6136 100644
--- a/hotspot/make/solaris/makefiles/adlc.make
+++ b/hotspot/make/solaris/makefiles/adlc.make
@@ -42,13 +42,11 @@ SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad
ifeq ("${Platform_arch_model}", "${Platform_arch}")
SOURCES.AD = \
- $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
- $(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad)
+ $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad)
else
SOURCES.AD = \
$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
- $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch).ad) \
- $(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad)
+ $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch).ad)
endif
EXEC = $(OUTDIR)/adlc
diff --git a/hotspot/make/solaris/makefiles/dtrace.make b/hotspot/make/solaris/makefiles/dtrace.make
index b57365b93dc..48f9b295b73 100644
--- a/hotspot/make/solaris/makefiles/dtrace.make
+++ b/hotspot/make/solaris/makefiles/dtrace.make
@@ -283,9 +283,9 @@ $(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \
$(DTraced_Files) ||\
STATUS=$$?;\
- if [ x"$$STATUS" = x"1" -a \
- x`uname -r` = x"5.10" -a \
- x`uname -p` = x"sparc" ]; then\
+ if [ x"$$STATUS" = x"1" ]; then \
+ if [ x`uname -r` = x"5.10" -a \
+ x`uname -p` = x"sparc" ]; then\
echo "*****************************************************************";\
echo "* If you are building server compiler, and the error message is ";\
echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\
@@ -294,6 +294,20 @@ $(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\
echo "* dtrace probes for this build.";\
echo "*****************************************************************";\
+ elif [ x`uname -r` = x"5.10" ]; then\
+ echo "*****************************************************************";\
+ echo "* If you are seeing 'syntax error near \"umpiconninfo_t\"' on Solaris";\
+ echo "* 10, try doing 'cd /usr/lib/dtrace && gzip mpi.d' as root, ";\
+ echo "* or set the environment variable HOTSPOT_DISABLE_DTRACE_PROBES";\
+ echo "* to disable dtrace probes for this build.";\
+ echo "*****************************************************************";\
+ else \
+ echo "*****************************************************************";\
+ echo "* If you cannot fix dtrace build issues, try to ";\
+ echo "* set the environment variable HOTSPOT_DISABLE_DTRACE_PROBES";\
+ echo "* to disable dtrace probes for this build.";\
+ echo "*****************************************************************";\
+ fi; \
fi;\
exit $$STATUS
# Since some DTraced_Files are in LIBJVM.o and they are touched by this
diff --git a/hotspot/make/windows/create.bat b/hotspot/make/windows/create.bat
index 16602c8ea90..6e72fa9c9e9 100644
--- a/hotspot/make/windows/create.bat
+++ b/hotspot/make/windows/create.bat
@@ -1,6 +1,6 @@
@echo off
REM
-REM Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+REM Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
REM
REM This code is free software; you can redistribute it and/or modify it
@@ -148,7 +148,7 @@ echo HotSpotJDKDist=%HotSpotJDKDist%
REM This is now safe to do.
:copyfiles
-for /D %%i in (compiler1, compiler2, tiered, core) do (
+for /D %%i in (compiler1, compiler2, tiered ) do (
if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated
copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL
)
@@ -156,7 +156,7 @@ copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\
REM force regneration of ProjectFile
if exist %ProjectFile% del %ProjectFile%
-for /D %%i in (compiler1, compiler2, tiered, core) do (
+for /D %%i in (compiler1, compiler2, tiered ) do (
echo -- %%i --
echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make
echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make
diff --git a/hotspot/make/windows/create_obj_files.sh b/hotspot/make/windows/create_obj_files.sh
index b162bd07b60..c17b0690e17 100644
--- a/hotspot/make/windows/create_obj_files.sh
+++ b/hotspot/make/windows/create_obj_files.sh
@@ -73,19 +73,17 @@ done
BASE_PATHS="${BASE_PATHS} ${GENERATED}/jvmtifiles ${GENERATED}/tracefiles"
-if [ -d "${ALTSRC}/share/vm/jfr" ]; then
- BASE_PATHS="${BASE_PATHS} ${ALTSRC}/share/vm/jfr"
+if [ -d "${ALTSRC}/share/vm/jfr/buffers" ]; then
BASE_PATHS="${BASE_PATHS} ${ALTSRC}/share/vm/jfr/buffers"
fi
BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/share/vm/prims/wbtestmethods"
-CORE_PATHS="${BASE_PATHS}"
# shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS.
if [ -d "${ALTSRC}/share/vm/gc_implementation" ]; then
- CORE_PATHS="${CORE_PATHS} `$FIND ${ALTSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
+ BASE_PATHS="${BASE_PATHS} `$FIND ${ALTSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
fi
-CORE_PATHS="${CORE_PATHS} `$FIND ${COMMONSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
+BASE_PATHS="${BASE_PATHS} `$FIND ${COMMONSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
if [ -d "${ALTSRC}/share/vm/c1" ]; then
COMPILER1_PATHS="${ALTSRC}/share/vm/c1"
@@ -104,12 +102,11 @@ COMPILER2_PATHS="${COMPILER2_PATHS} ${GENERATED}/adfiles"
# Include dirs per type.
case "${TYPE}" in
- "core") Src_Dirs="${CORE_PATHS}" ;;
- "compiler1") Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS}" ;;
- "compiler2") Src_Dirs="${CORE_PATHS} ${COMPILER2_PATHS}" ;;
- "tiered") Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS} ${COMPILER2_PATHS}" ;;
- "zero") Src_Dirs="${CORE_PATHS}" ;;
- "shark") Src_Dirs="${CORE_PATHS}" ;;
+ "compiler1") Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS}" ;;
+ "compiler2") Src_Dirs="${BASE_PATHS} ${COMPILER2_PATHS}" ;;
+ "tiered") Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS} ${COMPILER2_PATHS}" ;;
+ "zero") Src_Dirs="${BASE_PATHS}" ;;
+ "shark") Src_Dirs="${BASE_PATHS}" ;;
esac
COMPILER2_SPECIFIC_FILES="opto libadt bcEscapeAnalyzer.cpp c2_* runtime_*"
@@ -122,7 +119,6 @@ Src_Files_EXCLUDE="jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp"
# Exclude per type.
case "${TYPE}" in
- "core") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;
"compiler1") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;
"compiler2") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;
"tiered") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;
@@ -149,9 +145,17 @@ for e in ${Src_Dirs}; do
Src_Files="${Src_Files}`findsrc ${e}` "
done
-Obj_Files=
+Obj_Files=" "
for e in ${Src_Files}; do
- Obj_Files="${Obj_Files}${e%\.[!.]*}.obj "
+ o="${e%\.[!.]*}.obj"
+ set +e
+ chk=`expr "${Obj_Files}" : ".* $o"`
+ set -e
+ if [ "$chk" != 0 ]; then
+ echo "# INFO: skipping duplicate $o"
+ continue
+ fi
+ Obj_Files="${Obj_Files}$o "
done
echo Obj_Files=${Obj_Files}
diff --git a/hotspot/make/windows/makefiles/adlc.make b/hotspot/make/windows/makefiles/adlc.make
index f320d4e932d..7bcaef718fd 100644
--- a/hotspot/make/windows/makefiles/adlc.make
+++ b/hotspot/make/windows/makefiles/adlc.make
@@ -55,13 +55,11 @@ CXX_INCLUDE_DIRS=\
!if "$(Platform_arch_model)" == "$(Platform_arch)"
SOURCES_AD=\
- $(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad \
- $(WorkSpace)/src/os_cpu/windows_$(Platform_arch)/vm/windows_$(Platform_arch_model).ad
+ $(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad
!else
SOURCES_AD=\
$(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad \
- $(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch).ad \
- $(WorkSpace)/src/os_cpu/windows_$(Platform_arch)/vm/windows_$(Platform_arch_model).ad
+ $(WorkSpace)/src/cpu/$(Platform_arch)/vm/$(Platform_arch).ad
!endif
# NOTE! If you add any files here, you must also update GENERATED_NAMES_IN_DIR
diff --git a/hotspot/make/windows/makefiles/projectcreator.make b/hotspot/make/windows/makefiles/projectcreator.make
index 7aa3ef65cad..a5336c6bf51 100644
--- a/hotspot/make/windows/makefiles/projectcreator.make
+++ b/hotspot/make/windows/makefiles/projectcreator.make
@@ -44,10 +44,11 @@ ProjectCreatorSources=\
# This is only used internally
ProjectCreatorIncludesPRIVATE=\
- -relativeInclude src\closed\share\vm \
- -relativeInclude src\closed\os\windows\vm \
- -relativeInclude src\closed\os_cpu\windows_$(Platform_arch)\vm \
- -relativeInclude src\closed\cpu\$(Platform_arch)\vm \
+ -relativeAltSrcInclude src\closed \
+ -altRelativeInclude share\vm \
+ -altRelativeInclude os\windows\vm \
+ -altRelativeInclude os_cpu\windows_$(Platform_arch)\vm \
+ -altRelativeInclude cpu\$(Platform_arch)\vm \
-relativeInclude src\share\vm \
-relativeInclude src\share\vm\precompiled \
-relativeInclude src\share\vm\prims\wbtestmethods \
@@ -91,7 +92,7 @@ ProjectCreatorIDEOptions = \
-disablePch getThread_windows_$(Platform_arch).cpp \
-disablePch_compiler2 opcodes.cpp
-# Common options for the IDE builds for core, c1, and c2
+# Common options for the IDE builds for c1, and c2
ProjectCreatorIDEOptions=\
$(ProjectCreatorIDEOptions) \
-sourceBase $(HOTSPOTWORKSPACE) \
@@ -157,19 +158,11 @@ ProjectCreatorIDEOptionsIgnoreCompiler2=\
-ignoreFile_TARGET ciTypeFlow.hpp \
-ignoreFile_TARGET $(Platform_arch_model).ad
-##################################################
-# Without compiler(core) specific options
-##################################################
-ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
-$(ProjectCreatorIDEOptionsIgnoreCompiler1:TARGET=core) \
-$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=core)
-
##################################################
# Client(C1) compiler specific options
##################################################
ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
-define_compiler1 COMPILER1 \
- -ignorePath_compiler1 core \
$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1)
##################################################
@@ -178,7 +171,6 @@ $(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1)
#NOTE! This list must be kept in sync with GENERATED_NAMES in adlc.make.
ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
-define_compiler2 COMPILER2 \
- -ignorePath_compiler2 core \
-additionalFile_compiler2 $(Platform_arch_model).ad \
-additionalFile_compiler2 ad_$(Platform_arch_model).cpp \
-additionalFile_compiler2 ad_$(Platform_arch_model).hpp \
diff --git a/hotspot/make/windows/makefiles/trace.make b/hotspot/make/windows/makefiles/trace.make
index 82422b173cf..02948c0a8d0 100644
--- a/hotspot/make/windows/makefiles/trace.make
+++ b/hotspot/make/windows/makefiles/trace.make
@@ -90,25 +90,25 @@ $(TraceOutDir)/traceTypes.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceType
!if "$(OPENJDK)" == "true"
$(TraceOutDir)/traceEventClasses.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceEventClasses.xsl $(XML_DEPS)
- @echo Generating $@
+ @echo Generating OpenJDK $@
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceSrcDir)/traceEventClasses.xsl -OUT $(TraceOutDir)/traceEventClasses.hpp
!else
$(TraceOutDir)/traceEventClasses.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceEventClasses.xsl $(XML_DEPS)
- @echo Generating $@
+ @echo Generating AltSrc $@
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceEventClasses.xsl -OUT $(TraceOutDir)/traceEventClasses.hpp
$(TraceOutDir)/traceProducer.cpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceProducer.xsl $(XML_DEPS)
- @echo Generating $@
+ @echo Generating AltSrc $@
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceProducer.xsl -OUT $(TraceOutDir)/traceProducer.cpp
$(TraceOutDir)/traceRequestables.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceRequestables.xsl $(XML_DEPS)
- @echo Generating $@
+ @echo Generating AltSrc $@
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceRequestables.xsl -OUT $(TraceOutDir)/traceRequestables.hpp
$(TraceOutDir)/traceEventControl.hpp: $(TraceSrcDir)/trace.xml $(TraceAltSrcDir)/traceEventControl.xsl $(XML_DEPS)
- @echo Generating $@
+ @echo Generating AltSrc $@
@$(XSLT) -IN $(TraceSrcDir)/trace.xml -XSL $(TraceAltSrcDir)/traceEventControl.xsl -OUT $(TraceOutDir)/traceEventControl.hpp
!endif
diff --git a/hotspot/make/windows/makefiles/vm.make b/hotspot/make/windows/makefiles/vm.make
index b76443774de..8b5e23d4a28 100644
--- a/hotspot/make/windows/makefiles/vm.make
+++ b/hotspot/make/windows/makefiles/vm.make
@@ -36,10 +36,6 @@ CXX_FLAGS=$(CXX_FLAGS) /D "PRODUCT"
CXX_FLAGS=$(CXX_FLAGS) /D "ASSERT"
!endif
-!if "$(Variant)" == "core"
-# No need to define anything, CORE is defined as !COMPILER1 && !COMPILER2
-!endif
-
!if "$(Variant)" == "compiler1"
CXX_FLAGS=$(CXX_FLAGS) /D "COMPILER1"
!endif
diff --git a/hotspot/make/windows/projectfiles/common/Makefile b/hotspot/make/windows/projectfiles/common/Makefile
index 8ae363be7d5..0bc4fb182ec 100644
--- a/hotspot/make/windows/projectfiles/common/Makefile
+++ b/hotspot/make/windows/projectfiles/common/Makefile
@@ -112,6 +112,7 @@ ReleaseOptions = -define HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) -def
ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) $(ReleaseOptions)
$(HOTSPOTBUILDSPACE)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
+ @if "$(MSC_VER)"=="1500" echo Make sure you have VS2008 SP1 or later, or you may see 'expanded command line too long'
@$(RUN_JAVA) -Djava.class.path="$(HOTSPOTBUILDSPACE)/classes" ProjectCreator WinGammaPlatform$(VcVersion) $(ProjectCreatorIDEOptions)
clean:
diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
index 7b9a494dff0..b6f8a5a5d1a 100644
--- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
@@ -1887,6 +1887,27 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
if (ProfileInterpreter) {
__ set_method_data_pointer_for_bcp();
}
+
+#if INCLUDE_JVMTI
+ if (EnableInvokeDynamic) {
+ Label L_done;
+
+ __ ldub(Address(Lbcp, 0), G1_scratch); // Load current bytecode
+ __ cmp_and_br_short(G1_scratch, Bytecodes::_invokestatic, Assembler::notEqual, Assembler::pn, L_done);
+
+ // The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
+ // Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
+
+ __ call_VM(G1_scratch, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), I0, Lmethod, Lbcp);
+
+ __ br_null(G1_scratch, false, Assembler::pn, L_done);
+ __ delayed()->nop();
+
+ __ st_ptr(G1_scratch, Lesp, wordSize);
+ __ bind(L_done);
+ }
+#endif // INCLUDE_JVMTI
+
// Resume bytecode interpretation at the current bcp
__ dispatch_next(vtos);
// end of JVMTI PopFrame support
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
index 2efa59f8b33..52e459900c7 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
@@ -1920,6 +1920,29 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
__ get_thread(thread);
__ movl(Address(thread, JavaThread::popframe_condition_offset()), JavaThread::popframe_inactive);
+#if INCLUDE_JVMTI
+ if (EnableInvokeDynamic) {
+ Label L_done;
+ const Register local0 = rdi;
+
+ __ cmpb(Address(rsi, 0), Bytecodes::_invokestatic);
+ __ jcc(Assembler::notEqual, L_done);
+
+ // The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
+ // Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
+
+ __ get_method(rdx);
+ __ movptr(rax, Address(local0, 0));
+ __ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), rax, rdx, rsi);
+
+ __ testptr(rax, rax);
+ __ jcc(Assembler::zero, L_done);
+
+ __ movptr(Address(rbx, 0), rax);
+ __ bind(L_done);
+ }
+#endif // INCLUDE_JVMTI
+
__ dispatch_next(vtos);
// end of PopFrame support
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
index f0a2258a70e..4ac85c49578 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
@@ -1929,6 +1929,29 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
__ movl(Address(r15_thread, JavaThread::popframe_condition_offset()),
JavaThread::popframe_inactive);
+#if INCLUDE_JVMTI
+ if (EnableInvokeDynamic) {
+ Label L_done;
+ const Register local0 = r14;
+
+ __ cmpb(Address(r13, 0), Bytecodes::_invokestatic);
+ __ jcc(Assembler::notEqual, L_done);
+
+ // The member name argument must be restored if _invokestatic is re-executed after a PopFrame call.
+ // Detect such a case in the InterpreterRuntime function and return the member name argument, or NULL.
+
+ __ get_method(rdx);
+ __ movptr(rax, Address(local0, 0));
+ __ call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::member_name_arg_or_null), rax, rdx, r13);
+
+ __ testptr(rax, rax);
+ __ jcc(Assembler::zero, L_done);
+
+ __ movptr(Address(rbx, 0), rax);
+ __ bind(L_done);
+ }
+#endif // INCLUDE_JVMTI
+
__ dispatch_next(vtos);
// end of PopFrame support
diff --git a/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp b/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp
index 434b11adf1f..97b185c3aab 100644
--- a/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp
@@ -58,8 +58,8 @@ class EntryFrame : public ZeroFrame {
JavaCallWrapper* call_wrapper,
TRAPS);
public:
- JavaCallWrapper *call_wrapper() const {
- return (JavaCallWrapper *) value_of_word(call_wrapper_off);
+ JavaCallWrapper **call_wrapper() const {
+ return (JavaCallWrapper **) addr_of_word(call_wrapper_off);
}
public:
diff --git a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp
index f6bd6d3c6be..971560cd0d8 100644
--- a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp
+++ b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp
@@ -141,7 +141,7 @@ inline intptr_t* frame::id() const {
return fp();
}
-inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
+inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {
return zero_entryframe()->call_wrapper();
}
diff --git a/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp b/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp
index f1a280bb4b4..1203c315879 100644
--- a/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp
+++ b/hotspot/src/cpu/zero/vm/stubGenerator_zero.cpp
@@ -176,6 +176,19 @@ class StubGenerator: public StubCodeGenerator {
StubRoutines::_oop_arraycopy;
}
+ static int SafeFetch32(int *adr, int errValue) {
+ int value = errValue;
+ value = *adr;
+ return value;
+ }
+
+ static intptr_t SafeFetchN(intptr_t *adr, intptr_t errValue) {
+ intptr_t value = errValue;
+ value = *adr;
+ return value;
+ }
+
+
void generate_initial() {
// Generates all stubs and initializes the entry points
@@ -225,6 +238,15 @@ class StubGenerator: public StubCodeGenerator {
// arraycopy stubs used by compilers
generate_arraycopy_stubs();
+
+ // Safefetch stubs.
+ StubRoutines::_safefetch32_entry = CAST_FROM_FN_PTR(address, StubGenerator::SafeFetch32);
+ StubRoutines::_safefetch32_fault_pc = NULL;
+ StubRoutines::_safefetch32_continuation_pc = NULL;
+
+ StubRoutines::_safefetchN_entry = CAST_FROM_FN_PTR(address, StubGenerator::SafeFetchN);
+ StubRoutines::_safefetchN_fault_pc = NULL;
+ StubRoutines::_safefetchN_continuation_pc = NULL;
}
public:
diff --git a/hotspot/src/os/bsd/vm/attachListener_bsd.cpp b/hotspot/src/os/bsd/vm/attachListener_bsd.cpp
index 6f128f2543b..4a580b486fc 100644
--- a/hotspot/src/os/bsd/vm/attachListener_bsd.cpp
+++ b/hotspot/src/os/bsd/vm/attachListener_bsd.cpp
@@ -445,14 +445,14 @@ AttachOperation* AttachListener::dequeue() {
void AttachListener::vm_start() {
char fn[UNIX_PATH_MAX];
- struct stat64 st;
+ struct stat st;
int ret;
int n = snprintf(fn, UNIX_PATH_MAX, "%s/.java_pid%d",
os::get_temp_directory(), os::current_process_id());
assert(n < (int)UNIX_PATH_MAX, "java_pid file name buffer overflow");
- RESTARTABLE(::stat64(fn, &st), ret);
+ RESTARTABLE(::stat(fn, &st), ret);
if (ret == 0) {
ret = ::unlink(fn);
if (ret == -1) {
diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp
index 3b44d9a220f..0674e6f3c83 100644
--- a/hotspot/src/os/windows/vm/os_windows.cpp
+++ b/hotspot/src/os/windows/vm/os_windows.cpp
@@ -1642,6 +1642,8 @@ void os::print_os_info(outputStream* st) {
void os::win32::print_windows_version(outputStream* st) {
OSVERSIONINFOEX osvi;
+ SYSTEM_INFO si;
+
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
@@ -1651,6 +1653,18 @@ void os::win32::print_windows_version(outputStream* st) {
}
int os_vers = osvi.dwMajorVersion * 1000 + osvi.dwMinorVersion;
+
+ ZeroMemory(&si, sizeof(SYSTEM_INFO));
+ if (os_vers >= 5002) {
+ // Retrieve SYSTEM_INFO from GetNativeSystemInfo call so that we could
+ // find out whether we are running on 64 bit processor or not.
+ if (os::Kernel32Dll::GetNativeSystemInfoAvailable()) {
+ os::Kernel32Dll::GetNativeSystemInfo(&si);
+ } else {
+ GetSystemInfo(&si);
+ }
+ }
+
if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) {
switch (os_vers) {
case 3051: st->print(" Windows NT 3.51"); break;
@@ -1658,57 +1672,48 @@ void os::win32::print_windows_version(outputStream* st) {
case 5000: st->print(" Windows 2000"); break;
case 5001: st->print(" Windows XP"); break;
case 5002:
- case 6000:
- case 6001:
- case 6002: {
- // Retrieve SYSTEM_INFO from GetNativeSystemInfo call so that we could
- // find out whether we are running on 64 bit processor or not.
- SYSTEM_INFO si;
- ZeroMemory(&si, sizeof(SYSTEM_INFO));
- if (!os::Kernel32Dll::GetNativeSystemInfoAvailable()){
- GetSystemInfo(&si);
+ if (osvi.wProductType == VER_NT_WORKSTATION &&
+ si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
+ st->print(" Windows XP x64 Edition");
} else {
- os::Kernel32Dll::GetNativeSystemInfo(&si);
- }
- if (os_vers == 5002) {
- if (osvi.wProductType == VER_NT_WORKSTATION &&
- si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
- st->print(" Windows XP x64 Edition");
- else
- st->print(" Windows Server 2003 family");
- } else if (os_vers == 6000) {
- if (osvi.wProductType == VER_NT_WORKSTATION)
- st->print(" Windows Vista");
- else
- st->print(" Windows Server 2008");
- if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
- st->print(" , 64 bit");
- } else if (os_vers == 6001) {
- if (osvi.wProductType == VER_NT_WORKSTATION) {
- st->print(" Windows 7");
- } else {
- // Unrecognized windows, print out its major and minor versions
- st->print(" Windows NT %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
- }
- if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
- st->print(" , 64 bit");
- } else if (os_vers == 6002) {
- if (osvi.wProductType == VER_NT_WORKSTATION) {
- st->print(" Windows 8");
- } else {
- st->print(" Windows Server 2012");
- }
- if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
- st->print(" , 64 bit");
- } else { // future os
- // Unrecognized windows, print out its major and minor versions
- st->print(" Windows NT %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
- if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
- st->print(" , 64 bit");
+ st->print(" Windows Server 2003 family");
}
break;
- }
- default: // future windows, print out its major and minor versions
+
+ case 6000:
+ if (osvi.wProductType == VER_NT_WORKSTATION) {
+ st->print(" Windows Vista");
+ } else {
+ st->print(" Windows Server 2008");
+ }
+ break;
+
+ case 6001:
+ if (osvi.wProductType == VER_NT_WORKSTATION) {
+ st->print(" Windows 7");
+ } else {
+ st->print(" Windows Server 2008 R2");
+ }
+ break;
+
+ case 6002:
+ if (osvi.wProductType == VER_NT_WORKSTATION) {
+ st->print(" Windows 8");
+ } else {
+ st->print(" Windows Server 2012");
+ }
+ break;
+
+ case 6003:
+ if (osvi.wProductType == VER_NT_WORKSTATION) {
+ st->print(" Windows 8.1");
+ } else {
+ st->print(" Windows Server 2012 R2");
+ }
+ break;
+
+ default: // future os
+ // Unrecognized windows, print out its major and minor versions
st->print(" Windows NT %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
}
} else {
@@ -1720,6 +1725,11 @@ void os::win32::print_windows_version(outputStream* st) {
st->print(" Windows %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
}
}
+
+ if (os_vers >= 6000 && si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
+ st->print(" , 64 bit");
+ }
+
st->print(" Build %d", osvi.dwBuildNumber);
st->print(" %s", osvi.szCSDVersion); // service pack
st->cr();
diff --git a/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.ad b/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.ad
deleted file mode 100644
index f58244ea48f..00000000000
--- a/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_32.ad
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// Copyright (c) 1999, 2012, 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.
-//
-//
-
-// X86 Bsd Architecture Description File
-
diff --git a/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.ad b/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.ad
deleted file mode 100644
index 254328e0971..00000000000
--- a/hotspot/src/os_cpu/bsd_x86/vm/bsd_x86_64.ad
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// Copyright (c) 2003, 2012, 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.
-//
-//
-
-// AMD64 Bsd Architecture Description File
-
-//----------OS-DEPENDENT ENCODING BLOCK----------------------------------------
-// This block specifies the encoding classes used by the compiler to
-// output byte streams. Encoding classes generate functions which are
-// called by Machine Instruction Nodes in order to generate the bit
-// encoding of the instruction. Operands specify their base encoding
-// interface with the interface keyword. There are currently
-// supported four interfaces, REG_INTER, CONST_INTER, MEMORY_INTER, &
-// COND_INTER. REG_INTER causes an operand to generate a function
-// which returns its register number when queried. CONST_INTER causes
-// an operand to generate a function which returns the value of the
-// constant when queried. MEMORY_INTER causes an operand to generate
-// four functions which return the Base Register, the Index Register,
-// the Scale Value, and the Offset Value of the operand when queried.
-// COND_INTER causes an operand to generate six functions which return
-// the encoding code (ie - encoding bits for the instruction)
-// associated with each basic boolean condition for a conditional
-// instruction. Instructions specify two basic values for encoding.
-// They use the ins_encode keyword to specify their encoding class
-// (which must be one of the class names specified in the encoding
-// block), and they use the opcode keyword to specify, in order, their
-// primary, secondary, and tertiary opcode. Only the opcode sections
-// which a particular instruction needs for encoding need to be
-// specified.
-encode %{
- // Build emit functions for each basic byte or larger field in the intel
- // encoding scheme (opcode, rm, sib, immediate), and call them from C++
- // code in the enc_class source block. Emit functions will live in the
- // main source block for now. In future, we can generalize this by
- // adding a syntax that specifies the sizes of fields in an order,
- // so that the adlc can build the emit functions automagically
-
-%}
-
-
-// Platform dependent source
-
-source %{
-
-%}
diff --git a/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.ad b/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.ad
deleted file mode 100644
index 5e234deaa4f..00000000000
--- a/hotspot/src/os_cpu/linux_x86/vm/linux_x86_32.ad
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// Copyright (c) 1999, 2012, 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.
-//
-//
-
-// X86 Linux Architecture Description File
-
diff --git a/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.ad b/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.ad
deleted file mode 100644
index 3b3ac007cd1..00000000000
--- a/hotspot/src/os_cpu/linux_x86/vm/linux_x86_64.ad
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// Copyright (c) 2003, 2012, 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.
-//
-//
-
-// AMD64 Linux Architecture Description File
-
-//----------OS-DEPENDENT ENCODING BLOCK----------------------------------------
-// This block specifies the encoding classes used by the compiler to
-// output byte streams. Encoding classes generate functions which are
-// called by Machine Instruction Nodes in order to generate the bit
-// encoding of the instruction. Operands specify their base encoding
-// interface with the interface keyword. There are currently
-// supported four interfaces, REG_INTER, CONST_INTER, MEMORY_INTER, &
-// COND_INTER. REG_INTER causes an operand to generate a function
-// which returns its register number when queried. CONST_INTER causes
-// an operand to generate a function which returns the value of the
-// constant when queried. MEMORY_INTER causes an operand to generate
-// four functions which return the Base Register, the Index Register,
-// the Scale Value, and the Offset Value of the operand when queried.
-// COND_INTER causes an operand to generate six functions which return
-// the encoding code (ie - encoding bits for the instruction)
-// associated with each basic boolean condition for a conditional
-// instruction. Instructions specify two basic values for encoding.
-// They use the ins_encode keyword to specify their encoding class
-// (which must be one of the class names specified in the encoding
-// block), and they use the opcode keyword to specify, in order, their
-// primary, secondary, and tertiary opcode. Only the opcode sections
-// which a particular instruction needs for encoding need to be
-// specified.
-encode %{
- // Build emit functions for each basic byte or larger field in the intel
- // encoding scheme (opcode, rm, sib, immediate), and call them from C++
- // code in the enc_class source block. Emit functions will live in the
- // main source block for now. In future, we can generalize this by
- // adding a syntax that specifies the sizes of fields in an order,
- // so that the adlc can build the emit functions automagically
-
-%}
-
-
-// Platform dependent source
-
-source %{
-
-%}
diff --git a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
index de0ba9a6ad5..2618519e2a4 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
@@ -410,16 +410,6 @@ extern "C" {
int SpinPause() {
}
- int SafeFetch32(int *adr, int errValue) {
- int value = errValue;
- value = *adr;
- return value;
- }
- intptr_t SafeFetchN(intptr_t *adr, intptr_t errValue) {
- intptr_t value = errValue;
- value = *adr;
- return value;
- }
void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) {
if (from > to) {
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.ad b/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.ad
deleted file mode 100644
index 7f27d4591b3..00000000000
--- a/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.ad
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// Copyright (c) 1999, 2007, 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.
-//
-
-//
-//
-
-// SPARC Solaris Architecture Description File
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.ad b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.ad
deleted file mode 100644
index 9b95823b844..00000000000
--- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.ad
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// Copyright (c) 1999, 2012, 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.
-//
-//
-
-// X86 Solaris Architecture Description File
-
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.ad b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.ad
deleted file mode 100644
index f3334952f62..00000000000
--- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.ad
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// Copyright (c) 2004, 2012, 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.
-//
-//
-
-// AMD64 Solaris Architecture Description File
-
-//----------OS-DEPENDENT ENCODING BLOCK----------------------------------------
-// This block specifies the encoding classes used by the compiler to
-// output byte streams. Encoding classes generate functions which are
-// called by Machine Instruction Nodes in order to generate the bit
-// encoding of the instruction. Operands specify their base encoding
-// interface with the interface keyword. There are currently
-// supported four interfaces, REG_INTER, CONST_INTER, MEMORY_INTER, &
-// COND_INTER. REG_INTER causes an operand to generate a function
-// which returns its register number when queried. CONST_INTER causes
-// an operand to generate a function which returns the value of the
-// constant when queried. MEMORY_INTER causes an operand to generate
-// four functions which return the Base Register, the Index Register,
-// the Scale Value, and the Offset Value of the operand when queried.
-// COND_INTER causes an operand to generate six functions which return
-// the encoding code (ie - encoding bits for the instruction)
-// associated with each basic boolean condition for a conditional
-// instruction. Instructions specify two basic values for encoding.
-// They use the ins_encode keyword to specify their encoding class
-// (which must be one of the class names specified in the encoding
-// block), and they use the opcode keyword to specify, in order, their
-// primary, secondary, and tertiary opcode. Only the opcode sections
-// which a particular instruction needs for encoding need to be
-// specified.
-encode %{
- // Build emit functions for each basic byte or larger field in the intel
- // encoding scheme (opcode, rm, sib, immediate), and call them from C++
- // code in the enc_class source block. Emit functions will live in the
- // main source block for now. In future, we can generalize this by
- // adding a syntax that specifies the sizes of fields in an order,
- // so that the adlc can build the emit functions automagically
-%}
-
-
-// Platform dependent source
-
-source %{
-%}
diff --git a/hotspot/src/os_cpu/windows_x86/vm/windows_x86_32.ad b/hotspot/src/os_cpu/windows_x86/vm/windows_x86_32.ad
deleted file mode 100644
index 27fedf269c5..00000000000
--- a/hotspot/src/os_cpu/windows_x86/vm/windows_x86_32.ad
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// Copyright (c) 1999, 2012, 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.
-//
-//
-
-// X86 Win32 Architecture Description File
-
diff --git a/hotspot/src/os_cpu/windows_x86/vm/windows_x86_64.ad b/hotspot/src/os_cpu/windows_x86/vm/windows_x86_64.ad
deleted file mode 100644
index 54e183a0bc5..00000000000
--- a/hotspot/src/os_cpu/windows_x86/vm/windows_x86_64.ad
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// Copyright (c) 2003, 2012, 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.
-//
-//
-
-// AMD64 Win32 Architecture Description File
-
-//----------OS-DEPENDENT ENCODING BLOCK-----------------------------------------------------
-// This block specifies the encoding classes used by the compiler to output
-// byte streams. Encoding classes generate functions which are called by
-// Machine Instruction Nodes in order to generate the bit encoding of the
-// instruction. Operands specify their base encoding interface with the
-// interface keyword. There are currently supported four interfaces,
-// REG_INTER, CONST_INTER, MEMORY_INTER, & COND_INTER. REG_INTER causes an
-// operand to generate a function which returns its register number when
-// queried. CONST_INTER causes an operand to generate a function which
-// returns the value of the constant when queried. MEMORY_INTER causes an
-// operand to generate four functions which return the Base Register, the
-// Index Register, the Scale Value, and the Offset Value of the operand when
-// queried. COND_INTER causes an operand to generate six functions which
-// return the encoding code (ie - encoding bits for the instruction)
-// associated with each basic boolean condition for a conditional instruction.
-// Instructions specify two basic values for encoding. They use the
-// ins_encode keyword to specify their encoding class (which must be one of
-// the class names specified in the encoding block), and they use the
-// opcode keyword to specify, in order, their primary, secondary, and
-// tertiary opcode. Only the opcode sections which a particular instruction
-// needs for encoding need to be specified.
-encode %{
- // Build emit functions for each basic byte or larger field in the intel
- // encoding scheme (opcode, rm, sib, immediate), and call them from C++
- // code in the enc_class source block. Emit functions will live in the
- // main source block for now. In future, we can generalize this by
- // adding a syntax that specifies the sizes of fields in an order,
- // so that the adlc can build the emit functions automagically
-
-%}
-
-
-// Platform dependent source
-
-source %{
-
-%}
diff --git a/hotspot/src/share/tools/ProjectCreator/BuildConfig.java b/hotspot/src/share/tools/ProjectCreator/BuildConfig.java
index a9b07e03e62..7c95db62f0c 100644
--- a/hotspot/src/share/tools/ProjectCreator/BuildConfig.java
+++ b/hotspot/src/share/tools/ProjectCreator/BuildConfig.java
@@ -142,6 +142,69 @@ class BuildConfig {
return rv;
}
+ // Returns true if the specified path refers to a relative alternate
+ // source file. RelativeAltSrcInclude is usually "src\closed".
+ public static boolean matchesRelativeAltSrcInclude(String path) {
+ String relativeAltSrcInclude =
+ getFieldString(null, "RelativeAltSrcInclude");
+ Vector v = getFieldVector(null, "AltRelativeInclude");
+ for (String pathPart : v) {
+ if (path.contains(relativeAltSrcInclude + Util.sep + pathPart)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // Returns the relative alternate source file for the specified path.
+ // Null is returned if the specified path does not have a matching
+ // alternate source file.
+ public static String getMatchingRelativeAltSrcFile(String path) {
+ Vector v = getFieldVector(null, "RelativeAltSrcFileList");
+ if (v == null) {
+ return null;
+ }
+ for (String pathPart : v) {
+ if (path.endsWith(pathPart)) {
+ String relativeAltSrcInclude =
+ getFieldString(null, "RelativeAltSrcInclude");
+ return relativeAltSrcInclude + Util.sep + pathPart;
+ }
+ }
+ return null;
+ }
+
+ // Returns true if the specified path has a matching alternate
+ // source file.
+ public static boolean matchesRelativeAltSrcFile(String path) {
+ return getMatchingRelativeAltSrcFile(path) != null;
+ }
+
+ // Track the specified alternate source file. The source file is
+ // tracked without the leading .*
+ // part to make matching regular source files easier.
+ public static void trackRelativeAltSrcFile(String path) {
+ String pattern = getFieldString(null, "RelativeAltSrcInclude") +
+ Util.sep;
+ int altSrcInd = path.indexOf(pattern);
+ if (altSrcInd == -1) {
+ // not an AltSrc path
+ return;
+ }
+
+ altSrcInd += pattern.length();
+ if (altSrcInd >= path.length()) {
+ // not a valid AltSrc path
+ return;
+ }
+
+ String altSrcFile = path.substring(altSrcInd);
+ Vector v = getFieldVector(null, "RelativeAltSrcFileList");
+ if (v == null || !v.contains(altSrcFile)) {
+ addFieldVector(null, "RelativeAltSrcFileList", altSrcFile);
+ }
+ }
+
void addTo(Hashtable ht, String key, String value) {
ht.put(expandFormat(key), expandFormat(value));
}
@@ -272,8 +335,19 @@ class BuildConfig {
private Vector getSourceIncludes() {
Vector rv = new Vector();
- Vector ri = new Vector();
String sourceBase = getFieldString(null, "SourceBase");
+
+ // add relative alternate source include values:
+ String relativeAltSrcInclude =
+ getFieldString(null, "RelativeAltSrcInclude");
+ Vector asri = new Vector();
+ collectRelevantVectors(asri, "AltRelativeInclude");
+ for (String f : asri) {
+ rv.add(sourceBase + Util.sep + relativeAltSrcInclude +
+ Util.sep + f);
+ }
+
+ Vector ri = new Vector();
collectRelevantVectors(ri, "RelativeInclude");
for (String f : ri) {
rv.add(sourceBase + Util.sep + f);
@@ -541,35 +615,6 @@ class TieredProductConfig extends ProductConfig {
}
}
-class CoreDebugConfig extends GenericDebugNonKernelConfig {
- String getOptFlag() {
- return getCI().getNoOptFlag();
- }
-
- CoreDebugConfig() {
- initNames("core", "debug", "jvm.dll");
- init(getIncludes(), getDefines());
- }
-}
-
-class CoreFastDebugConfig extends GenericDebugNonKernelConfig {
- String getOptFlag() {
- return getCI().getOptFlag();
- }
-
- CoreFastDebugConfig() {
- initNames("core", "fastdebug", "jvm.dll");
- init(getIncludes(), getDefines());
- }
-}
-
-class CoreProductConfig extends ProductConfig {
- CoreProductConfig() {
- initNames("core", "product", "jvm.dll");
- init(getIncludes(), getDefines());
- }
-}
-
abstract class CompilerInterface {
abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
diff --git a/hotspot/src/share/tools/ProjectCreator/FileTreeCreator.java b/hotspot/src/share/tools/ProjectCreator/FileTreeCreator.java
index 3643c572e99..a81132c7029 100644
--- a/hotspot/src/share/tools/ProjectCreator/FileTreeCreator.java
+++ b/hotspot/src/share/tools/ProjectCreator/FileTreeCreator.java
@@ -12,11 +12,15 @@ public class FileTreeCreator extends SimpleFileVisitor
final int startDirLength;
Stack attributes = new Stack();
Vector allConfigs;
- WinGammaPlatformVC10 wg;
+ WinGammaPlatform wg;
+ WinGammaPlatformVC10 wg10;
- public FileTreeCreator(Path startDir, Vector allConfigs, WinGammaPlatformVC10 wg) {
+ public FileTreeCreator(Path startDir, Vector allConfigs, WinGammaPlatform wg) {
super();
this.wg = wg;
+ if (wg instanceof WinGammaPlatformVC10) {
+ wg10 = (WinGammaPlatformVC10)wg;
+ }
this.allConfigs = allConfigs;
this.startDir = startDir;
startDirLength = startDir.toAbsolutePath().toString().length();
diff --git a/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC10.java b/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC10.java
index 837eef1a566..cb0fe33577e 100644
--- a/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC10.java
+++ b/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC10.java
@@ -1,3 +1,27 @@
+/*
+ * Copyright (c) 2012, 2013, 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.
+ *
+ */
+
import static java.nio.file.FileVisitResult.CONTINUE;
import java.io.IOException;
@@ -21,6 +45,8 @@ public class FileTreeCreatorVC10 extends FileTreeCreator {
boolean usePch = false;
boolean disablePch = false;
boolean useIgnore = false;
+ boolean isAltSrc = false; // only needed as a debugging crumb
+ boolean isReplacedByAltSrc = false;
String fileName = file.getFileName().toString();
// TODO hideFile
@@ -30,6 +56,26 @@ public class FileTreeCreatorVC10 extends FileTreeCreator {
usePch = true;
}
+ String fileLoc = vcProjLocation.relativize(file).toString();
+
+ // isAltSrc and isReplacedByAltSrc applies to all configs for a file
+ if (BuildConfig.matchesRelativeAltSrcInclude(
+ file.toAbsolutePath().toString())) {
+ // current file is an alternate source file so track it
+ isAltSrc = true;
+ BuildConfig.trackRelativeAltSrcFile(
+ file.toAbsolutePath().toString());
+ } else if (BuildConfig.matchesRelativeAltSrcFile(
+ file.toAbsolutePath().toString())) {
+ // current file is a regular file that matches an alternate
+ // source file so yack about replacing the regular file
+ isReplacedByAltSrc = true;
+ System.out.println("INFO: alternate source file '" +
+ BuildConfig.getMatchingRelativeAltSrcFile(
+ file.toAbsolutePath().toString()) +
+ "' replaces '" + fileLoc + "'");
+ }
+
for (BuildConfig cfg : allConfigs) {
if (cfg.lookupHashFieldInContext("IgnoreFile", fileName) != null) {
useIgnore = true;
@@ -57,10 +103,9 @@ public class FileTreeCreatorVC10 extends FileTreeCreator {
}
}
- String tagName = wg.getFileTagFromSuffix(fileName);
- String fileLoc = vcProjLocation.relativize(file).toString();
+ String tagName = wg10.getFileTagFromSuffix(fileName);
- if (!useIgnore && !disablePch && !usePch) {
+ if (!useIgnore && !disablePch && !usePch && !isReplacedByAltSrc) {
wg.tag(tagName, new String[] { "Include", fileLoc});
} else {
wg.startTag(
@@ -78,12 +123,17 @@ public class FileTreeCreatorVC10 extends FileTreeCreator {
if (disablePch) {
wg.tag("PrecompiledHeader", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
}
+ if (isReplacedByAltSrc) {
+ wg.tagData("ExcludedFromBuild", "true", "Condition",
+ "'$(Configuration)|$(Platform)'=='" +
+ cfg.get("Name") + "'");
+ }
}
wg.endTag();
}
String filter = startDir.relativize(file.getParent().toAbsolutePath()).toString();
- wg.addFilterDependency(fileLoc, filter);
+ wg10.addFilterDependency(fileLoc, filter);
return CONTINUE;
}
@@ -112,7 +162,7 @@ public class FileTreeCreatorVC10 extends FileTreeCreator {
if (!hide) {
String name = startDir.relativize(path.toAbsolutePath()).toString();
if (!"".equals(name)) {
- wg.addFilter(name);
+ wg10.addFilter(name);
}
attributes.push(newAttr);
@@ -137,6 +187,4 @@ public class FileTreeCreatorVC10 extends FileTreeCreator {
public void writeFileTree() throws IOException {
Files.walkFileTree(this.startDir, this);
}
-
-
- }
\ No newline at end of file
+}
diff --git a/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC7.java b/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC7.java
index b36e0121f8a..9a431845719 100644
--- a/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC7.java
+++ b/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC7.java
@@ -12,7 +12,7 @@ import java.util.Vector;
public class FileTreeCreatorVC7 extends FileTreeCreator {
public FileTreeCreatorVC7(Path startDir, Vector allConfigs, WinGammaPlatform wg) {
- super(startDir, allConfigs, null);
+ super(startDir, allConfigs, wg);
}
@Override
diff --git a/hotspot/src/share/tools/ProjectCreator/ProjectCreator.java b/hotspot/src/share/tools/ProjectCreator/ProjectCreator.java
index a3065e51273..f1e16ea8a45 100644
--- a/hotspot/src/share/tools/ProjectCreator/ProjectCreator.java
+++ b/hotspot/src/share/tools/ProjectCreator/ProjectCreator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, 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
@@ -39,10 +39,15 @@ public class ProjectCreator {
+ "jvm.dll; no trailing slash>");
System.err.println(" If any of the above are specified, "
+ "they must all be.");
+ System.err.println(" Note: if '-altRelativeInclude' option below is "
+ + "used, then the '-relativeAltSrcInclude' option must be used "
+ + "to specify the alternate source dir, e.g., 'src\\closed'");
System.err.println(" Additional, optional arguments, which can be "
+ "specified multiple times:");
System.err.println(" -absoluteInclude ");
+ System.err.println(" -altRelativeInclude ");
System.err.println(" -relativeInclude ");
System.err.println(" -define ");
System.err.println(" If any of the above are specified, "+
"they must all be.");
+ System.err.println(" Note: if '-altRelativeInclude' option below " +
+ "is used, then the '-relativeAltSrcInclude' " +
+ "option must be used to specify the alternate " +
+ "source dir, e.g., 'src\\closed'");
System.err.println(" Additional, optional arguments, which can be " +
"specified multiple times:");
System.err.println(" -absoluteInclude ");
+ System.err.println(" -altRelativeInclude ");
System.err.println(" -relativeInclude ");
System.err.println(" -define allConfigs) throws IOException {
System.out.println();
- System.out.print(" Writing .vcxproj file: " + projectFileName);
+ System.out.println(" Writing .vcxproj file: " + projectFileName);
String projDir = Util.normalize(new File(projectFileName).getParent());
@@ -114,7 +138,7 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 {
endTag();
printWriter.close();
- System.out.println(" Done.");
+ System.out.println(" Done writing .vcxproj file.");
writeFilterFile(projectFileName, projectName, allConfigs, projDir);
writeUserFile(projectFileName, allConfigs);
diff --git a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
index 09e961cbfa0..b7a99a652db 100644
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
+++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
@@ -139,19 +139,22 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
tagV("Tool", cfg.getV("LinkerFlags"));
- tag("Tool",
- new String[] {
- "Name",
- "VCPostBuildEventTool",
- "Description",
- BuildConfig
- .getFieldString(null, "PostbuildDescription"),
- // Caution: String.replace(String,String) is available
- // from JDK5 onwards only
- "CommandLine",
- cfg.expandFormat(BuildConfig.getFieldString(null,
- "PostbuildCommand").replace("\t",
- "
")) });
+ String postBuildCmd = BuildConfig.getFieldString(null,
+ "PostbuildCommand");
+ if (postBuildCmd != null) {
+ tag("Tool",
+ new String[] {
+ "Name",
+ "VCPostBuildEventTool",
+ "Description",
+ BuildConfig
+ .getFieldString(null, "PostbuildDescription"),
+ // Caution: String.replace(String,String) is available
+ // from JDK5 onwards only
+ "CommandLine",
+ cfg.expandFormat(postBuildCmd.replace("\t",
+ "
")) });
+ }
tag("Tool", new String[] { "Name", "VCPreBuildEventTool" });
diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
index 3af2d23b7d6..dbe3476aad9 100644
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
@@ -2295,7 +2295,7 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) {
if (gen_type_check) {
// We have determined that offset == referent_offset && src != null.
// if (src->_klass->_reference_type == REF_NONE) -> continue
- __ move(new LIR_Address(src.result(), oopDesc::klass_offset_in_bytes(), UseCompressedKlassPointers ? T_OBJECT : T_ADDRESS), src_klass);
+ __ move(new LIR_Address(src.result(), oopDesc::klass_offset_in_bytes(), T_ADDRESS), src_klass);
LIR_Address* reference_type_addr = new LIR_Address(src_klass, in_bytes(InstanceKlass::reference_type_offset()), T_BYTE);
LIR_Opr reference_type = new_register(T_INT);
__ move(reference_type_addr, reference_type);
diff --git a/hotspot/src/share/vm/classfile/classLoader.cpp b/hotspot/src/share/vm/classfile/classLoader.cpp
index 650a299f346..32a4da05bb5 100644
--- a/hotspot/src/share/vm/classfile/classLoader.cpp
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp
@@ -878,7 +878,7 @@ objArrayOop ClassLoader::get_system_packages(TRAPS) {
instanceKlassHandle ClassLoader::load_classfile(Symbol* h_name, TRAPS) {
ResourceMark rm(THREAD);
- EventMark m("loading class " INTPTR_FORMAT, (address)h_name);
+ EventMark m("loading class %s", h_name->as_C_string());
ThreadProfilerMark tpm(ThreadProfilerMark::classLoaderRegion);
stringStream st;
diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp
index 678cb2dcd13..8e94d834ad9 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp
@@ -2557,6 +2557,26 @@ void java_lang_ref_SoftReference::set_clock(jlong value) {
*offset = value;
}
+// Support for java_lang_invoke_DirectMethodHandle
+
+int java_lang_invoke_DirectMethodHandle::_member_offset;
+
+oop java_lang_invoke_DirectMethodHandle::member(oop dmh) {
+ oop member_name = NULL;
+ bool is_dmh = dmh->is_oop() && java_lang_invoke_DirectMethodHandle::is_instance(dmh);
+ assert(is_dmh, "a DirectMethodHandle oop is expected");
+ if (is_dmh) {
+ member_name = dmh->obj_field(member_offset_in_bytes());
+ }
+ return member_name;
+}
+
+void java_lang_invoke_DirectMethodHandle::compute_offsets() {
+ Klass* klass_oop = SystemDictionary::DirectMethodHandle_klass();
+ if (klass_oop != NULL && EnableInvokeDynamic) {
+ compute_offset(_member_offset, klass_oop, vmSymbols::member_name(), vmSymbols::java_lang_invoke_MemberName_signature());
+ }
+}
// Support for java_lang_invoke_MethodHandle
@@ -3205,6 +3225,7 @@ void JavaClasses::compute_offsets() {
java_lang_ThreadGroup::compute_offsets();
if (EnableInvokeDynamic) {
java_lang_invoke_MethodHandle::compute_offsets();
+ java_lang_invoke_DirectMethodHandle::compute_offsets();
java_lang_invoke_MemberName::compute_offsets();
java_lang_invoke_LambdaForm::compute_offsets();
java_lang_invoke_MethodType::compute_offsets();
diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp
index 899d3ba48a3..8a8e801f387 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp
@@ -976,6 +976,32 @@ class java_lang_invoke_MethodHandle: AllStatic {
static int form_offset_in_bytes() { return _form_offset; }
};
+// Interface to java.lang.invoke.DirectMethodHandle objects
+
+class java_lang_invoke_DirectMethodHandle: AllStatic {
+ friend class JavaClasses;
+
+ private:
+ static int _member_offset; // the MemberName of this DMH
+
+ static void compute_offsets();
+
+ public:
+ // Accessors
+ static oop member(oop mh);
+
+ // Testers
+ static bool is_subclass(Klass* klass) {
+ return klass->is_subclass_of(SystemDictionary::DirectMethodHandle_klass());
+ }
+ static bool is_instance(oop obj) {
+ return obj != NULL && is_subclass(obj->klass());
+ }
+
+ // Accessors for code generation:
+ static int member_offset_in_bytes() { return _member_offset; }
+};
+
// Interface to java.lang.invoke.LambdaForm objects
// (These are a private interface for managing adapter code generation.)
diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp
index a2a1a857517..85735a732fa 100644
--- a/hotspot/src/share/vm/classfile/systemDictionary.hpp
+++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp
@@ -151,6 +151,7 @@ class SymbolPropertyTable;
do_klass(reflect_CallerSensitive_klass, sun_reflect_CallerSensitive, Opt ) \
\
/* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \
+ do_klass(DirectMethodHandle_klass, java_lang_invoke_DirectMethodHandle, Opt ) \
do_klass(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre_JSR292 ) \
do_klass(MemberName_klass, java_lang_invoke_MemberName, Pre_JSR292 ) \
do_klass(MethodHandleNatives_klass, java_lang_invoke_MethodHandleNatives, Pre_JSR292 ) \
diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp
index df370237167..067cf503305 100644
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp
+++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp
@@ -255,6 +255,7 @@
/* Support for JSR 292 & invokedynamic (JDK 1.7 and above) */ \
template(java_lang_invoke_CallSite, "java/lang/invoke/CallSite") \
template(java_lang_invoke_ConstantCallSite, "java/lang/invoke/ConstantCallSite") \
+ template(java_lang_invoke_DirectMethodHandle, "java/lang/invoke/DirectMethodHandle") \
template(java_lang_invoke_MutableCallSite, "java/lang/invoke/MutableCallSite") \
template(java_lang_invoke_VolatileCallSite, "java/lang/invoke/VolatileCallSite") \
template(java_lang_invoke_MethodHandle, "java/lang/invoke/MethodHandle") \
@@ -352,6 +353,7 @@
template(thread_id_name, "tid") \
template(newInstance0_name, "newInstance0") \
template(limit_name, "limit") \
+ template(member_name, "member") \
template(forName_name, "forName") \
template(forName0_name, "forName0") \
template(isJavaIdentifierStart_name, "isJavaIdentifierStart") \
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
index c04a5261338..54ade2db111 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -50,6 +50,7 @@
#include "memory/genMarkSweep.hpp"
#include "memory/genOopClosures.inline.hpp"
#include "memory/iterator.hpp"
+#include "memory/padded.hpp"
#include "memory/referencePolicy.hpp"
#include "memory/resourceArea.hpp"
#include "memory/tenuredGeneration.hpp"
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
index c104533a47b..a1eb3130bc6 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
@@ -927,11 +927,9 @@ void ParNewGeneration::collect(bool full,
workers->active_workers(),
Threads::number_of_non_daemon_threads());
workers->set_active_workers(active_workers);
- _next_gen = gch->next_gen(this);
- assert(_next_gen != NULL,
- "This must be the youngest gen, and not the only gen");
assert(gch->n_gens() == 2,
"Par collection currently only works with single older gen.");
+ _next_gen = gch->next_gen(this);
// Do we have to avoid promotion_undo?
if (gch->collector_policy()->is_concurrent_mark_sweep_policy()) {
set_avoid_promotion_undo(true);
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
index 987767b1640..6d3b25d9545 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, 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
@@ -29,6 +29,7 @@
#include "gc_implementation/shared/parGCAllocBuffer.hpp"
#include "gc_implementation/shared/copyFailedInfo.hpp"
#include "memory/defNewGeneration.hpp"
+#include "memory/padded.hpp"
#include "utilities/taskqueue.hpp"
class ChunkArray;
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.hpp
index 0d9d7761c74..00b865f2a35 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parOopClosures.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_PAROOPCLOSURES_HPP
#include "memory/genOopClosures.hpp"
+#include "memory/padded.hpp"
// Closures for ParNewGeneration
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp
index 32929e7a55c..dd3933b0009 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp
@@ -29,14 +29,16 @@
#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
#include "gc_implementation/shared/gcTrace.hpp"
#include "gc_implementation/shared/mutableSpace.hpp"
+#include "memory/allocation.inline.hpp"
#include "memory/memRegion.hpp"
+#include "memory/padded.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.psgc.inline.hpp"
-PSPromotionManager** PSPromotionManager::_manager_array = NULL;
-OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL;
-PSOldGen* PSPromotionManager::_old_gen = NULL;
-MutableSpace* PSPromotionManager::_young_space = NULL;
+PaddedEnd* PSPromotionManager::_manager_array = NULL;
+OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL;
+PSOldGen* PSPromotionManager::_old_gen = NULL;
+MutableSpace* PSPromotionManager::_young_space = NULL;
void PSPromotionManager::initialize() {
ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
@@ -45,8 +47,10 @@ void PSPromotionManager::initialize() {
_old_gen = heap->old_gen();
_young_space = heap->young_gen()->to_space();
+ // To prevent false sharing, we pad the PSPromotionManagers
+ // and make sure that the first instance starts at a cache line.
assert(_manager_array == NULL, "Attempt to initialize twice");
- _manager_array = NEW_C_HEAP_ARRAY(PSPromotionManager*, ParallelGCThreads+1, mtGC);
+ _manager_array = PaddedArray::create_unfreeable(ParallelGCThreads + 1);
guarantee(_manager_array != NULL, "Could not initialize promotion manager");
_stack_array_depth = new OopStarTaskQueueSet(ParallelGCThreads);
@@ -54,26 +58,21 @@ void PSPromotionManager::initialize() {
// Create and register the PSPromotionManager(s) for the worker threads.
for(uint i=0; iregister_queue(i, _manager_array[i]->claimed_stack_depth());
+ stack_array_depth()->register_queue(i, _manager_array[i].claimed_stack_depth());
}
-
// The VMThread gets its own PSPromotionManager, which is not available
// for work stealing.
- _manager_array[ParallelGCThreads] = new PSPromotionManager();
- guarantee(_manager_array[ParallelGCThreads] != NULL, "Could not create PSPromotionManager");
}
PSPromotionManager* PSPromotionManager::gc_thread_promotion_manager(int index) {
assert(index >= 0 && index < (int)ParallelGCThreads, "index out of range");
assert(_manager_array != NULL, "Sanity");
- return _manager_array[index];
+ return &_manager_array[index];
}
PSPromotionManager* PSPromotionManager::vm_thread_promotion_manager() {
assert(_manager_array != NULL, "Sanity");
- return _manager_array[ParallelGCThreads];
+ return &_manager_array[ParallelGCThreads];
}
void PSPromotionManager::pre_scavenge() {
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp
index 8f4731428ac..6707ade2d17 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp
@@ -29,6 +29,8 @@
#include "gc_implementation/shared/gcTrace.hpp"
#include "gc_implementation/shared/copyFailedInfo.hpp"
#include "memory/allocation.hpp"
+#include "memory/padded.hpp"
+#include "utilities/globalDefinitions.hpp"
#include "utilities/taskqueue.hpp"
//
@@ -51,14 +53,14 @@ class MutableSpace;
class PSOldGen;
class ParCompactionManager;
-class PSPromotionManager : public CHeapObj {
+class PSPromotionManager VALUE_OBJ_CLASS_SPEC {
friend class PSScavenge;
friend class PSRefProcTaskExecutor;
private:
- static PSPromotionManager** _manager_array;
- static OopStarTaskQueueSet* _stack_array_depth;
- static PSOldGen* _old_gen;
- static MutableSpace* _young_space;
+ static PaddedEnd* _manager_array;
+ static OopStarTaskQueueSet* _stack_array_depth;
+ static PSOldGen* _old_gen;
+ static MutableSpace* _young_space;
#if TASKQUEUE_STATS
size_t _masked_pushes;
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp
index 841ef64f20b..34c935408d8 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp
@@ -32,7 +32,7 @@
inline PSPromotionManager* PSPromotionManager::manager_array(int index) {
assert(_manager_array != NULL, "access of NULL manager_array");
assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access");
- return _manager_array[index];
+ return &_manager_array[index];
}
template
diff --git a/hotspot/src/share/vm/gc_implementation/shared/objectCountEventSender.cpp b/hotspot/src/share/vm/gc_implementation/shared/objectCountEventSender.cpp
index cf95bdd505e..289c458d2dc 100644
--- a/hotspot/src/share/vm/gc_implementation/shared/objectCountEventSender.cpp
+++ b/hotspot/src/share/vm/gc_implementation/shared/objectCountEventSender.cpp
@@ -32,6 +32,7 @@
#if INCLUDE_SERVICES
void ObjectCountEventSender::send(const KlassInfoEntry* entry, GCId gc_id, jlong timestamp) {
+#if INCLUDE_TRACE
assert(Tracing::is_event_enabled(EventObjectCountAfterGC::eventId),
"Only call this method if the event is enabled");
@@ -42,6 +43,7 @@ void ObjectCountEventSender::send(const KlassInfoEntry* entry, GCId gc_id, jlong
event.set_totalSize(entry->words() * BytesPerWord);
event.set_endtime(timestamp);
event.commit();
+#endif // INCLUDE_TRACE
}
bool ObjectCountEventSender::should_send_event() {
diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
index f5f9d39bcec..4a3019f867f 100644
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
@@ -1209,3 +1209,26 @@ IRT_LEAF(void, InterpreterRuntime::popframe_move_outgoing_args(JavaThread* threa
size_of_arguments * Interpreter::stackElementSize);
IRT_END
#endif
+
+#if INCLUDE_JVMTI
+// This is a support of the JVMTI PopFrame interface.
+// Make sure it is an invokestatic of a polymorphic intrinsic that has a member_name argument
+// and return it as a vm_result so that it can be reloaded in the list of invokestatic parameters.
+// The dmh argument is a reference to a DirectMethoHandle that has a member name field.
+IRT_ENTRY(void, InterpreterRuntime::member_name_arg_or_null(JavaThread* thread, address dmh,
+ Method* method, address bcp))
+ Bytecodes::Code code = Bytecodes::code_at(method, bcp);
+ if (code != Bytecodes::_invokestatic) {
+ return;
+ }
+ ConstantPool* cpool = method->constants();
+ int cp_index = Bytes::get_native_u2(bcp + 1) + ConstantPool::CPCACHE_INDEX_TAG;
+ Symbol* cname = cpool->klass_name_at(cpool->klass_ref_index_at(cp_index));
+ Symbol* mname = cpool->name_ref_at(cp_index);
+
+ if (MethodHandles::has_member_arg(cname, mname)) {
+ oop member_name = java_lang_invoke_DirectMethodHandle::member((oop)dmh);
+ thread->set_vm_result(member_name);
+ }
+IRT_END
+#endif // INCLUDE_JVMTI
diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp
index d46c43e94e0..ad44210ef4d 100644
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp
@@ -95,6 +95,9 @@ class InterpreterRuntime: AllStatic {
static void create_exception(JavaThread* thread, char* name, char* message);
static void create_klass_exception(JavaThread* thread, char* name, oopDesc* obj);
static address exception_handler_for_exception(JavaThread* thread, oopDesc* exception);
+#if INCLUDE_JVMTI
+ static void member_name_arg_or_null(JavaThread* thread, address dmh, Method* m, address bcp);
+#endif
static void throw_pending_exception(JavaThread* thread);
// Statics & fields
diff --git a/hotspot/src/share/vm/memory/cardTableRS.cpp b/hotspot/src/share/vm/memory/cardTableRS.cpp
index 7c21869945b..ddd65d42083 100644
--- a/hotspot/src/share/vm/memory/cardTableRS.cpp
+++ b/hotspot/src/share/vm/memory/cardTableRS.cpp
@@ -310,46 +310,31 @@ void CardTableRS::younger_refs_in_space_iterate(Space* sp,
_ct_bs->non_clean_card_iterate_possibly_parallel(sp, urasm, cl, this);
}
-void CardTableRS::clear_into_younger(Generation* gen) {
- GenCollectedHeap* gch = GenCollectedHeap::heap();
- // Generations younger than gen have been evacuated. We can clear
- // card table entries for gen (we know that it has no pointers
- // to younger gens) and for those below. The card tables for
- // the youngest gen need never be cleared.
+void CardTableRS::clear_into_younger(Generation* old_gen) {
+ assert(old_gen->level() == 1, "Should only be called for the old generation");
+ // The card tables for the youngest gen need never be cleared.
// There's a bit of subtlety in the clear() and invalidate()
// methods that we exploit here and in invalidate_or_clear()
// below to avoid missing cards at the fringes. If clear() or
// invalidate() are changed in the future, this code should
// be revisited. 20040107.ysr
- Generation* g = gen;
- for(Generation* prev_gen = gch->prev_gen(g);
- prev_gen != NULL;
- g = prev_gen, prev_gen = gch->prev_gen(g)) {
- MemRegion to_be_cleared_mr = g->prev_used_region();
- clear(to_be_cleared_mr);
- }
+ clear(old_gen->prev_used_region());
}
-void CardTableRS::invalidate_or_clear(Generation* gen, bool younger) {
- GenCollectedHeap* gch = GenCollectedHeap::heap();
- // For each generation gen (and younger)
- // invalidate the cards for the currently occupied part
- // of that generation and clear the cards for the
+void CardTableRS::invalidate_or_clear(Generation* old_gen) {
+ assert(old_gen->level() == 1, "Should only be called for the old generation");
+ // Invalidate the cards for the currently occupied part of
+ // the old generation and clear the cards for the
// unoccupied part of the generation (if any, making use
// of that generation's prev_used_region to determine that
// region). No need to do anything for the youngest
// generation. Also see note#20040107.ysr above.
- Generation* g = gen;
- for(Generation* prev_gen = gch->prev_gen(g); prev_gen != NULL;
- g = prev_gen, prev_gen = gch->prev_gen(g)) {
- MemRegion used_mr = g->used_region();
- MemRegion to_be_cleared_mr = g->prev_used_region().minus(used_mr);
- if (!to_be_cleared_mr.is_empty()) {
- clear(to_be_cleared_mr);
- }
- invalidate(used_mr);
- if (!younger) break;
+ MemRegion used_mr = old_gen->used_region();
+ MemRegion to_be_cleared_mr = old_gen->prev_used_region().minus(used_mr);
+ if (!to_be_cleared_mr.is_empty()) {
+ clear(to_be_cleared_mr);
}
+ invalidate(used_mr);
}
diff --git a/hotspot/src/share/vm/memory/cardTableRS.hpp b/hotspot/src/share/vm/memory/cardTableRS.hpp
index 234b3972db5..25884feac8b 100644
--- a/hotspot/src/share/vm/memory/cardTableRS.hpp
+++ b/hotspot/src/share/vm/memory/cardTableRS.hpp
@@ -142,12 +142,12 @@ public:
void verify_aligned_region_empty(MemRegion mr);
void clear(MemRegion mr) { _ct_bs->clear(mr); }
- void clear_into_younger(Generation* gen);
+ void clear_into_younger(Generation* old_gen);
void invalidate(MemRegion mr, bool whole_heap = false) {
_ct_bs->invalidate(mr, whole_heap);
}
- void invalidate_or_clear(Generation* gen, bool younger);
+ void invalidate_or_clear(Generation* old_gen);
static uintx ct_max_alignment_constraint() {
return CardTableModRefBS::ct_max_alignment_constraint();
diff --git a/hotspot/src/share/vm/memory/defNewGeneration.cpp b/hotspot/src/share/vm/memory/defNewGeneration.cpp
index c61fa0127bc..0b4af29a3e3 100644
--- a/hotspot/src/share/vm/memory/defNewGeneration.cpp
+++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp
@@ -567,8 +567,6 @@ void DefNewGeneration::collect(bool full,
gc_tracer.report_gc_start(gch->gc_cause(), _gc_timer->gc_start());
_next_gen = gch->next_gen(this);
- assert(_next_gen != NULL,
- "This must be the youngest gen, and not the only gen");
// If the next generation is too full to accommodate promotion
// from this generation, pass on collection; let the next generation
@@ -901,8 +899,6 @@ bool DefNewGeneration::collection_attempt_is_safe() {
if (_next_gen == NULL) {
GenCollectedHeap* gch = GenCollectedHeap::heap();
_next_gen = gch->next_gen(this);
- assert(_next_gen != NULL,
- "This must be the youngest gen, and not the only gen");
}
return _next_gen->promotion_attempt_is_safe(used());
}
diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.cpp b/hotspot/src/share/vm/memory/genCollectedHeap.cpp
index ebdb77f6734..2faed4cc818 100644
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp
@@ -1070,13 +1070,13 @@ GenCollectedHeap* GenCollectedHeap::heap() {
void GenCollectedHeap::prepare_for_compaction() {
- Generation* scanning_gen = _gens[_n_gens-1];
+ guarantee(_n_gens = 2, "Wrong number of generations");
+ Generation* old_gen = _gens[1];
// Start by compacting into same gen.
- CompactPoint cp(scanning_gen, NULL, NULL);
- while (scanning_gen != NULL) {
- scanning_gen->prepare_for_compaction(&cp);
- scanning_gen = prev_gen(scanning_gen);
- }
+ CompactPoint cp(old_gen, NULL, NULL);
+ old_gen->prepare_for_compaction(&cp);
+ Generation* young_gen = _gens[0];
+ young_gen->prepare_for_compaction(&cp);
}
GCStats* GenCollectedHeap::gc_stats(int level) const {
@@ -1245,27 +1245,14 @@ void GenCollectedHeap::ensure_parsability(bool retire_tlabs) {
generation_iterate(&ep_cl, false);
}
-oop GenCollectedHeap::handle_failed_promotion(Generation* gen,
+oop GenCollectedHeap::handle_failed_promotion(Generation* old_gen,
oop obj,
size_t obj_size) {
+ guarantee(old_gen->level() == 1, "We only get here with an old generation");
assert(obj_size == (size_t)obj->size(), "bad obj_size passed in");
HeapWord* result = NULL;
- // First give each higher generation a chance to allocate the promoted object.
- Generation* allocator = next_gen(gen);
- if (allocator != NULL) {
- do {
- result = allocator->allocate(obj_size, false);
- } while (result == NULL && (allocator = next_gen(allocator)) != NULL);
- }
-
- if (result == NULL) {
- // Then give gen and higher generations a chance to expand and allocate the
- // object.
- do {
- result = gen->expand_and_allocate(obj_size, false);
- } while (result == NULL && (gen = next_gen(gen)) != NULL);
- }
+ result = old_gen->expand_and_allocate(obj_size, false);
if (result != NULL) {
Copy::aligned_disjoint_words((HeapWord*)obj, result, obj_size);
diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.hpp b/hotspot/src/share/vm/memory/genCollectedHeap.hpp
index 43338c4da46..9ab9d1991df 100644
--- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp
@@ -368,25 +368,23 @@ public:
// collection.
virtual bool is_maximal_no_gc() const;
- // Return the generation before "gen", or else NULL.
+ // Return the generation before "gen".
Generation* prev_gen(Generation* gen) const {
int l = gen->level();
- if (l == 0) return NULL;
- else return _gens[l-1];
+ guarantee(l > 0, "Out of bounds");
+ return _gens[l-1];
}
- // Return the generation after "gen", or else NULL.
+ // Return the generation after "gen".
Generation* next_gen(Generation* gen) const {
int l = gen->level() + 1;
- if (l == _n_gens) return NULL;
- else return _gens[l];
+ guarantee(l < _n_gens, "Out of bounds");
+ return _gens[l];
}
Generation* get_gen(int i) const {
- if (i >= 0 && i < _n_gens)
- return _gens[i];
- else
- return NULL;
+ guarantee(i >= 0 && i < _n_gens, "Out of bounds");
+ return _gens[i];
}
int n_gens() const {
@@ -485,9 +483,9 @@ public:
// Promotion of obj into gen failed. Try to promote obj to higher
// gens in ascending order; return the new location of obj if successful.
- // Otherwise, try expand-and-allocate for obj in each generation starting at
- // gen; return the new location of obj if successful. Otherwise, return NULL.
- oop handle_failed_promotion(Generation* gen,
+ // Otherwise, try expand-and-allocate for obj in both the young and old
+ // generation; return the new location of obj if successful. Otherwise, return NULL.
+ oop handle_failed_promotion(Generation* old_gen,
oop obj,
size_t obj_size);
diff --git a/hotspot/src/share/vm/memory/genMarkSweep.cpp b/hotspot/src/share/vm/memory/genMarkSweep.cpp
index e53e742be70..fdeba2adaf9 100644
--- a/hotspot/src/share/vm/memory/genMarkSweep.cpp
+++ b/hotspot/src/share/vm/memory/genMarkSweep.cpp
@@ -52,8 +52,8 @@
#include "utilities/copy.hpp"
#include "utilities/events.hpp"
-void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp,
- bool clear_all_softrefs) {
+void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, bool clear_all_softrefs) {
+ guarantee(level == 1, "We always collect both old and young.");
assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint");
GenCollectedHeap* gch = GenCollectedHeap::heap();
@@ -84,11 +84,6 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp,
// Capture heap size before collection for printing.
size_t gch_prev_used = gch->used();
- // Some of the card table updates below assume that the perm gen is
- // also being collected.
- assert(level == gch->n_gens() - 1,
- "All generations are being collected, ergo perm gen too.");
-
// Capture used regions for each generation that will be
// subject to collection, so that card table adjustments can
// be made intelligently (see clear / invalidate further below).
@@ -126,17 +121,15 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp,
all_empty = all_empty && gch->get_gen(i)->used() == 0;
}
GenRemSet* rs = gch->rem_set();
+ Generation* old_gen = gch->get_gen(level);
// Clear/invalidate below make use of the "prev_used_regions" saved earlier.
if (all_empty) {
// We've evacuated all generations below us.
- Generation* g = gch->get_gen(level);
- rs->clear_into_younger(g);
+ rs->clear_into_younger(old_gen);
} else {
// Invalidate the cards corresponding to the currently used
- // region and clear those corresponding to the evacuated region
- // of all generations just collected (i.e. level and younger).
- rs->invalidate_or_clear(gch->get_gen(level),
- true /* younger */);
+ // region and clear those corresponding to the evacuated region.
+ rs->invalidate_or_clear(old_gen);
}
Threads::gc_epilogue();
diff --git a/hotspot/src/share/vm/memory/genRemSet.hpp b/hotspot/src/share/vm/memory/genRemSet.hpp
index e6b8302ad89..44a43540769 100644
--- a/hotspot/src/share/vm/memory/genRemSet.hpp
+++ b/hotspot/src/share/vm/memory/genRemSet.hpp
@@ -135,7 +135,7 @@ public:
// younger than gen from generations gen and older.
// The parameter clear_perm indicates if the perm_gen's
// remembered set should also be processed/cleared.
- virtual void clear_into_younger(Generation* gen) = 0;
+ virtual void clear_into_younger(Generation* old_gen) = 0;
// Informs the RS that refs in the given "mr" may have changed
// arbitrarily, and therefore may contain old-to-young pointers.
@@ -146,11 +146,8 @@ public:
// Informs the RS that refs in this generation
// may have changed arbitrarily, and therefore may contain
- // old-to-young pointers in arbitrary locations. The parameter
- // younger indicates if the same should be done for younger generations
- // as well. The parameter perm indicates if the same should be done for
- // perm gen as well.
- virtual void invalidate_or_clear(Generation* gen, bool younger) = 0;
+ // old-to-young pointers in arbitrary locations.
+ virtual void invalidate_or_clear(Generation* old_gen) = 0;
};
#endif // SHARE_VM_MEMORY_GENREMSET_HPP
diff --git a/hotspot/src/share/vm/memory/padded.hpp b/hotspot/src/share/vm/memory/padded.hpp
new file mode 100644
index 00000000000..4c50b39963e
--- /dev/null
+++ b/hotspot/src/share/vm/memory/padded.hpp
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_MEMORY_PADDED_HPP
+#define SHARE_VM_MEMORY_PADDED_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/globalDefinitions.hpp"
+
+// Bytes needed to pad type to avoid cache-line sharing; alignment should be the
+// expected cache line size (a power of two). The first addend avoids sharing
+// when the start address is not a multiple of alignment; the second maintains
+// alignment of starting addresses that happen to be a multiple.
+#define PADDING_SIZE(type, alignment) \
+ ((alignment) + align_size_up_(sizeof(type), alignment))
+
+// Templates to create a subclass padded to avoid cache line sharing. These are
+// effective only when applied to derived-most (leaf) classes.
+
+// When no args are passed to the base ctor.
+template
+class Padded : public T {
+ private:
+ char _pad_buf_[PADDING_SIZE(T, alignment)];
+};
+
+// When either 0 or 1 args may be passed to the base ctor.
+template
+class Padded01 : public T {
+ public:
+ Padded01(): T() { }
+ Padded01(Arg1T arg1): T(arg1) { }
+ private:
+ char _pad_buf_[PADDING_SIZE(T, alignment)];
+};
+
+// Super class of PaddedEnd when pad_size != 0.
+template
+class PaddedEndImpl : public T {
+ private:
+ char _pad_buf[pad_size];
+};
+
+// Super class of PaddedEnd when pad_size == 0.
+template
+class PaddedEndImpl : public T {
+ // No padding.
+};
+
+#define PADDED_END_SIZE(type, alignment) (align_size_up_(sizeof(type), alignment) - sizeof(type))
+
+// More memory conservative implementation of Padded. The subclass adds the
+// minimal amount of padding needed to make the size of the objects be aligned.
+// This will help reducing false sharing,
+// if the start address is a multiple of alignment.
+template
+class PaddedEnd : public PaddedEndImpl {
+ // C++ don't allow zero-length arrays. The padding is put in a
+ // super class that is specialized for the pad_size == 0 case.
+};
+
+// Helper class to create an array of PaddedEnd objects. All elements will
+// start at a multiple of alignment and the size will be aligned to alignment.
+template
+class PaddedArray {
+ public:
+ // Creates an aligned padded array.
+ // The memory can't be deleted since the raw memory chunk is not returned.
+ static PaddedEnd* create_unfreeable(uint length);
+};
+
+#endif // SHARE_VM_MEMORY_PADDED_HPP
diff --git a/hotspot/src/share/vm/memory/padded.inline.hpp b/hotspot/src/share/vm/memory/padded.inline.hpp
new file mode 100644
index 00000000000..1e9994ab647
--- /dev/null
+++ b/hotspot/src/share/vm/memory/padded.inline.hpp
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2013, 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 "memory/allocation.inline.hpp"
+#include "memory/padded.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/globalDefinitions.hpp"
+
+// Creates an aligned padded array.
+// The memory can't be deleted since the raw memory chunk is not returned.
+template
+PaddedEnd* PaddedArray::create_unfreeable(uint length) {
+ // Check that the PaddedEnd class works as intended.
+ STATIC_ASSERT(is_size_aligned_(sizeof(PaddedEnd), alignment));
+
+ // Allocate a chunk of memory large enough to allow for some alignment.
+ void* chunk = AllocateHeap(length * sizeof(PaddedEnd) + alignment, flags);
+
+ // Make the initial alignment.
+ PaddedEnd* aligned_padded_array = (PaddedEnd*)align_pointer_up(chunk, alignment);
+
+ // Call the default constructor for each element.
+ for (uint i = 0; i < length; i++) {
+ ::new (&aligned_padded_array[i]) T();
+ }
+
+ return aligned_padded_array;
+}
diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp
index 511610bd3bf..33a857f2a7e 100644
--- a/hotspot/src/share/vm/memory/universe.cpp
+++ b/hotspot/src/share/vm/memory/universe.cpp
@@ -105,10 +105,9 @@ objArrayOop Universe::_the_empty_class_klass_array = NULL;
Array* Universe::_the_array_interfaces_array = NULL;
oop Universe::_the_null_string = NULL;
oop Universe::_the_min_jint_string = NULL;
-LatestMethodOopCache* Universe::_finalizer_register_cache = NULL;
-LatestMethodOopCache* Universe::_loader_addClass_cache = NULL;
-LatestMethodOopCache* Universe::_pd_implies_cache = NULL;
-ActiveMethodOopsCache* Universe::_reflect_invoke_cache = NULL;
+LatestMethodCache* Universe::_finalizer_register_cache = NULL;
+LatestMethodCache* Universe::_loader_addClass_cache = NULL;
+LatestMethodCache* Universe::_pd_implies_cache = NULL;
oop Universe::_out_of_memory_error_java_heap = NULL;
oop Universe::_out_of_memory_error_metaspace = NULL;
oop Universe::_out_of_memory_error_class_metaspace = NULL;
@@ -225,7 +224,6 @@ void Universe::serialize(SerializeClosure* f, bool do_all) {
f->do_ptr((void**)&_the_empty_klass_array);
_finalizer_register_cache->serialize(f);
_loader_addClass_cache->serialize(f);
- _reflect_invoke_cache->serialize(f);
_pd_implies_cache->serialize(f);
}
@@ -649,10 +647,9 @@ jint universe_init() {
// We have a heap so create the Method* caches before
// Metaspace::initialize_shared_spaces() tries to populate them.
- Universe::_finalizer_register_cache = new LatestMethodOopCache();
- Universe::_loader_addClass_cache = new LatestMethodOopCache();
- Universe::_pd_implies_cache = new LatestMethodOopCache();
- Universe::_reflect_invoke_cache = new ActiveMethodOopsCache();
+ Universe::_finalizer_register_cache = new LatestMethodCache();
+ Universe::_loader_addClass_cache = new LatestMethodCache();
+ Universe::_pd_implies_cache = new LatestMethodCache();
if (UseSharedSpaces) {
// Read the data structures supporting the shared spaces (shared
@@ -1088,35 +1085,21 @@ bool universe_post_init() {
vmSymbols::register_method_name(),
vmSymbols::register_method_signature());
if (m == NULL || !m->is_static()) {
- THROW_MSG_(vmSymbols::java_lang_NoSuchMethodException(),
- "java.lang.ref.Finalizer.register", false);
+ tty->print_cr("Unable to link/verify Finalizer.register method");
+ return false; // initialization failed (cannot throw exception yet)
}
Universe::_finalizer_register_cache->init(
- SystemDictionary::Finalizer_klass(), m, CHECK_false);
-
- // Resolve on first use and initialize class.
- // Note: No race-condition here, since a resolve will always return the same result
-
- // Setup method for security checks
- k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_reflect_Method(), true, CHECK_false);
- k_h = instanceKlassHandle(THREAD, k);
- k_h->link_class(CHECK_false);
- m = k_h->find_method(vmSymbols::invoke_name(), vmSymbols::object_object_array_object_signature());
- if (m == NULL || m->is_static()) {
- THROW_MSG_(vmSymbols::java_lang_NoSuchMethodException(),
- "java.lang.reflect.Method.invoke", false);
- }
- Universe::_reflect_invoke_cache->init(k_h(), m, CHECK_false);
+ SystemDictionary::Finalizer_klass(), m);
// Setup method for registering loaded classes in class loader vector
InstanceKlass::cast(SystemDictionary::ClassLoader_klass())->link_class(CHECK_false);
m = InstanceKlass::cast(SystemDictionary::ClassLoader_klass())->find_method(vmSymbols::addClass_name(), vmSymbols::class_void_signature());
if (m == NULL || m->is_static()) {
- THROW_MSG_(vmSymbols::java_lang_NoSuchMethodException(),
- "java.lang.ClassLoader.addClass", false);
+ tty->print_cr("Unable to link/verify ClassLoader.addClass method");
+ return false; // initialization failed (cannot throw exception yet)
}
Universe::_loader_addClass_cache->init(
- SystemDictionary::ClassLoader_klass(), m, CHECK_false);
+ SystemDictionary::ClassLoader_klass(), m);
// Setup method for checking protection domain
InstanceKlass::cast(SystemDictionary::ProtectionDomain_klass())->link_class(CHECK_false);
@@ -1132,7 +1115,7 @@ bool universe_post_init() {
return false; // initialization failed
}
Universe::_pd_implies_cache->init(
- SystemDictionary::ProtectionDomain_klass(), m, CHECK_false);;
+ SystemDictionary::ProtectionDomain_klass(), m);;
}
// The folowing is initializing converter functions for serialization in
@@ -1455,7 +1438,7 @@ void Universe::compute_verify_oop_data() {
}
-void CommonMethodOopCache::init(Klass* k, Method* m, TRAPS) {
+void LatestMethodCache::init(Klass* k, Method* m) {
if (!UseSharedSpaces) {
_klass = k;
}
@@ -1471,88 +1454,7 @@ void CommonMethodOopCache::init(Klass* k, Method* m, TRAPS) {
}
-ActiveMethodOopsCache::~ActiveMethodOopsCache() {
- if (_prev_methods != NULL) {
- delete _prev_methods;
- _prev_methods = NULL;
- }
-}
-
-
-void ActiveMethodOopsCache::add_previous_version(Method* method) {
- assert(Thread::current()->is_VM_thread(),
- "only VMThread can add previous versions");
-
- // Only append the previous method if it is executing on the stack.
- if (method->on_stack()) {
-
- if (_prev_methods == NULL) {
- // This is the first previous version so make some space.
- // Start with 2 elements under the assumption that the class
- // won't be redefined much.
- _prev_methods = new (ResourceObj::C_HEAP, mtClass) GrowableArray(2, true);
- }
-
- // RC_TRACE macro has an embedded ResourceMark
- RC_TRACE(0x00000100,
- ("add: %s(%s): adding prev version ref for cached method @%d",
- method->name()->as_C_string(), method->signature()->as_C_string(),
- _prev_methods->length()));
-
- _prev_methods->append(method);
- }
-
-
- // Since the caller is the VMThread and we are at a safepoint, this is a good
- // time to clear out unused method references.
-
- if (_prev_methods == NULL) return;
-
- for (int i = _prev_methods->length() - 1; i >= 0; i--) {
- Method* method = _prev_methods->at(i);
- assert(method != NULL, "weak method ref was unexpectedly cleared");
-
- if (!method->on_stack()) {
- // This method isn't running anymore so remove it
- _prev_methods->remove_at(i);
- MetadataFactory::free_metadata(method->method_holder()->class_loader_data(), method);
- } else {
- // RC_TRACE macro has an embedded ResourceMark
- RC_TRACE(0x00000400,
- ("add: %s(%s): previous cached method @%d is alive",
- method->name()->as_C_string(), method->signature()->as_C_string(), i));
- }
- }
-} // end add_previous_version()
-
-
-bool ActiveMethodOopsCache::is_same_method(const Method* method) const {
- InstanceKlass* ik = InstanceKlass::cast(klass());
- const Method* check_method = ik->method_with_idnum(method_idnum());
- assert(check_method != NULL, "sanity check");
- if (check_method == method) {
- // done with the easy case
- return true;
- }
-
- if (_prev_methods != NULL) {
- // The cached method has been redefined at least once so search
- // the previous versions for a match.
- for (int i = 0; i < _prev_methods->length(); i++) {
- check_method = _prev_methods->at(i);
- if (check_method == method) {
- // a previous version matches
- return true;
- }
- }
- }
-
- // either no previous versions or no previous version matched
- return false;
-}
-
-
-Method* LatestMethodOopCache::get_Method() {
+Method* LatestMethodCache::get_method() {
if (klass() == NULL) return NULL;
InstanceKlass* ik = InstanceKlass::cast(klass());
Method* m = ik->method_with_idnum(method_idnum());
diff --git a/hotspot/src/share/vm/memory/universe.hpp b/hotspot/src/share/vm/memory/universe.hpp
index 24a95e84594..69998434380 100644
--- a/hotspot/src/share/vm/memory/universe.hpp
+++ b/hotspot/src/share/vm/memory/universe.hpp
@@ -41,10 +41,11 @@ class CollectedHeap;
class DeferredObjAllocEvent;
-// Common parts of a Method* cache. This cache safely interacts with
-// the RedefineClasses API.
-//
-class CommonMethodOopCache : public CHeapObj {
+// A helper class for caching a Method* when the user of the cache
+// only cares about the latest version of the Method*. This cache safely
+// interacts with the RedefineClasses API.
+
+class LatestMethodCache : public CHeapObj {
// We save the Klass* and the idnum of Method* in order to get
// the current cached Method*.
private:
@@ -52,12 +53,14 @@ class CommonMethodOopCache : public CHeapObj {
int _method_idnum;
public:
- CommonMethodOopCache() { _klass = NULL; _method_idnum = -1; }
- ~CommonMethodOopCache() { _klass = NULL; _method_idnum = -1; }
+ LatestMethodCache() { _klass = NULL; _method_idnum = -1; }
+ ~LatestMethodCache() { _klass = NULL; _method_idnum = -1; }
- void init(Klass* k, Method* m, TRAPS);
- Klass* klass() const { return _klass; }
- int method_idnum() const { return _method_idnum; }
+ void init(Klass* k, Method* m);
+ Klass* klass() const { return _klass; }
+ int method_idnum() const { return _method_idnum; }
+
+ Method* get_method();
// Enhanced Class Redefinition support
void classes_do(void f(Klass*)) {
@@ -72,39 +75,6 @@ class CommonMethodOopCache : public CHeapObj {
};
-// A helper class for caching a Method* when the user of the cache
-// cares about all versions of the Method*.
-//
-class ActiveMethodOopsCache : public CommonMethodOopCache {
- // This subclass adds weak references to older versions of the
- // Method* and a query method for a Method*.
-
- private:
- // If the cached Method* has not been redefined, then
- // _prev_methods will be NULL. If all of the previous
- // versions of the method have been collected, then
- // _prev_methods can have a length of zero.
- GrowableArray* _prev_methods;
-
- public:
- ActiveMethodOopsCache() { _prev_methods = NULL; }
- ~ActiveMethodOopsCache();
-
- void add_previous_version(Method* method);
- bool is_same_method(const Method* method) const;
-};
-
-
-// A helper class for caching a Method* when the user of the cache
-// only cares about the latest version of the Method*.
-//
-class LatestMethodOopCache : public CommonMethodOopCache {
- // This subclass adds a getter method for the latest Method*.
-
- public:
- Method* get_Method();
-};
-
// For UseCompressedOops and UseCompressedKlassPointers.
struct NarrowPtrStruct {
// Base address for oop/klass-within-java-object materialization.
@@ -174,10 +144,10 @@ class Universe: AllStatic {
static objArrayOop _the_empty_class_klass_array; // Canonicalized obj array of type java.lang.Class
static oop _the_null_string; // A cache of "null" as a Java string
static oop _the_min_jint_string; // A cache of "-2147483648" as a Java string
- static LatestMethodOopCache* _finalizer_register_cache; // static method for registering finalizable objects
- static LatestMethodOopCache* _loader_addClass_cache; // method for registering loaded classes in class loader vector
- static LatestMethodOopCache* _pd_implies_cache; // method for checking protection domain attributes
- static ActiveMethodOopsCache* _reflect_invoke_cache; // method for security checks
+ static LatestMethodCache* _finalizer_register_cache; // static method for registering finalizable objects
+ static LatestMethodCache* _loader_addClass_cache; // method for registering loaded classes in class loader vector
+ static LatestMethodCache* _pd_implies_cache; // method for checking protection domain attributes
+
// preallocated error objects (no backtrace)
static oop _out_of_memory_error_java_heap;
static oop _out_of_memory_error_metaspace;
@@ -334,11 +304,11 @@ class Universe: AllStatic {
static Array* the_array_interfaces_array() { return _the_array_interfaces_array; }
static oop the_null_string() { return _the_null_string; }
static oop the_min_jint_string() { return _the_min_jint_string; }
- static Method* finalizer_register_method() { return _finalizer_register_cache->get_Method(); }
- static Method* loader_addClass_method() { return _loader_addClass_cache->get_Method(); }
- static Method* protection_domain_implies_method() { return _pd_implies_cache->get_Method(); }
- static ActiveMethodOopsCache* reflect_invoke_cache() { return _reflect_invoke_cache; }
+ static Method* finalizer_register_method() { return _finalizer_register_cache->get_method(); }
+ static Method* loader_addClass_method() { return _loader_addClass_cache->get_method(); }
+
+ static Method* protection_domain_implies_method() { return _pd_implies_cache->get_method(); }
static oop null_ptr_exception_instance() { return _null_ptr_exception_instance; }
static oop arithmetic_exception_instance() { return _arithmetic_exception_instance; }
diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp
index ac210e14834..07cc1aa09cc 100644
--- a/hotspot/src/share/vm/oops/method.cpp
+++ b/hotspot/src/share/vm/oops/method.cpp
@@ -981,7 +981,6 @@ bool Method::should_not_be_cached() const {
bool Method::is_ignored_by_security_stack_walk() const {
const bool use_new_reflection = JDK_Version::is_gte_jdk14x_version() && UseNewReflection;
- assert(intrinsic_id() != vmIntrinsics::_invoke || Universe::reflect_invoke_cache()->is_same_method((Method*)this), "sanity");
if (intrinsic_id() == vmIntrinsics::_invoke) {
// This is Method.invoke() -- ignore it
return true;
diff --git a/hotspot/src/share/vm/opto/block.cpp b/hotspot/src/share/vm/opto/block.cpp
index 0aa41de0120..9153d070886 100644
--- a/hotspot/src/share/vm/opto/block.cpp
+++ b/hotspot/src/share/vm/opto/block.cpp
@@ -221,7 +221,7 @@ bool Block::has_uncommon_code() const {
//------------------------------is_uncommon------------------------------------
// True if block is low enough frequency or guarded by a test which
// mostly does not go here.
-bool Block::is_uncommon( Block_Array &bbs ) const {
+bool Block::is_uncommon(PhaseCFG* cfg) const {
// Initial blocks must never be moved, so are never uncommon.
if (head()->is_Root() || head()->is_Start()) return false;
@@ -238,7 +238,7 @@ bool Block::is_uncommon( Block_Array &bbs ) const {
uint uncommon_for_freq_preds = 0;
for( uint i=1; i_idx];
+ Block* guard = cfg->get_block_for_node(pred(i));
// Check to see if this block follows its guard 1 time out of 10000
// or less.
//
@@ -285,11 +285,11 @@ void Block::dump_bidx(const Block* orig, outputStream* st) const {
}
}
-void Block::dump_pred(const Block_Array *bbs, Block* orig, outputStream* st) const {
+void Block::dump_pred(const PhaseCFG* cfg, Block* orig, outputStream* st) const {
if (is_connector()) {
for (uint i=1; i_idx]);
- p->dump_pred(bbs, orig, st);
+ Block *p = cfg->get_block_for_node(pred(i));
+ p->dump_pred(cfg, orig, st);
}
} else {
dump_bidx(orig, st);
@@ -297,7 +297,7 @@ void Block::dump_pred(const Block_Array *bbs, Block* orig, outputStream* st) con
}
}
-void Block::dump_head( const Block_Array *bbs, outputStream* st ) const {
+void Block::dump_head(const PhaseCFG* cfg, outputStream* st) const {
// Print the basic block
dump_bidx(this, st);
st->print(": #\t");
@@ -311,26 +311,28 @@ void Block::dump_head( const Block_Array *bbs, outputStream* st ) const {
if( head()->is_block_start() ) {
for (uint i=1; i_idx];
- p->dump_pred(bbs, p, st);
+ if (cfg != NULL) {
+ Block *p = cfg->get_block_for_node(s);
+ p->dump_pred(cfg, p, st);
} else {
while (!s->is_block_start())
s = s->in(0);
st->print("N%d ", s->_idx );
}
}
- } else
+ } else {
st->print("BLOCK HEAD IS JUNK ");
+ }
// Print loop, if any
const Block *bhead = this; // Head of self-loop
Node *bh = bhead->head();
- if( bbs && bh->is_Loop() && !head()->is_Root() ) {
+
+ if ((cfg != NULL) && bh->is_Loop() && !head()->is_Root()) {
LoopNode *loop = bh->as_Loop();
- const Block *bx = (*bbs)[loop->in(LoopNode::LoopBackControl)->_idx];
+ const Block *bx = cfg->get_block_for_node(loop->in(LoopNode::LoopBackControl));
while (bx->is_connector()) {
- bx = (*bbs)[bx->pred(1)->_idx];
+ bx = cfg->get_block_for_node(bx->pred(1));
}
st->print("\tLoop: B%d-B%d ", bhead->_pre_order, bx->_pre_order);
// Dump any loop-specific bits, especially for CountedLoops.
@@ -349,29 +351,32 @@ void Block::dump_head( const Block_Array *bbs, outputStream* st ) const {
st->print_cr("");
}
-void Block::dump() const { dump(NULL); }
+void Block::dump() const {
+ dump(NULL);
+}
-void Block::dump( const Block_Array *bbs ) const {
- dump_head(bbs);
- uint cnt = _nodes.size();
- for( uint i=0; idump();
+ }
tty->print("\n");
}
#endif
//=============================================================================
//------------------------------PhaseCFG---------------------------------------
-PhaseCFG::PhaseCFG( Arena *a, RootNode *r, Matcher &m ) :
- Phase(CFG),
- _bbs(a),
- _root(r),
- _node_latency(NULL)
+PhaseCFG::PhaseCFG(Arena* arena, RootNode* root, Matcher& matcher)
+: Phase(CFG)
+, _block_arena(arena)
+, _node_to_block_mapping(arena)
+, _root(root)
+, _node_latency(NULL)
#ifndef PRODUCT
- , _trace_opto_pipelining(TraceOptoPipelining || C->method_has_option("TraceOptoPipelining"))
+, _trace_opto_pipelining(TraceOptoPipelining || C->method_has_option("TraceOptoPipelining"))
#endif
#ifdef ASSERT
- , _raw_oops(a)
+, _raw_oops(arena)
#endif
{
ResourceMark rm;
@@ -380,13 +385,13 @@ PhaseCFG::PhaseCFG( Arena *a, RootNode *r, Matcher &m ) :
// Node on demand.
Node *x = new (C) GotoNode(NULL);
x->init_req(0, x);
- _goto = m.match_tree(x);
+ _goto = matcher.match_tree(x);
assert(_goto != NULL, "");
_goto->set_req(0,_goto);
// Build the CFG in Reverse Post Order
_num_blocks = build_cfg();
- _broot = _bbs[_root->_idx];
+ _broot = get_block_for_node(_root);
}
//------------------------------build_cfg--------------------------------------
@@ -440,9 +445,9 @@ uint PhaseCFG::build_cfg() {
// 'p' now points to the start of this basic block
// Put self in array of basic blocks
- Block *bb = new (_bbs._arena) Block(_bbs._arena,p);
- _bbs.map(p->_idx,bb);
- _bbs.map(x->_idx,bb);
+ Block *bb = new (_block_arena) Block(_block_arena, p);
+ map_node_to_block(p, bb);
+ map_node_to_block(x, bb);
if( x != p ) { // Only for root is x == p
bb->_nodes.push((Node*)x);
}
@@ -473,16 +478,16 @@ uint PhaseCFG::build_cfg() {
// Check if it the fist node pushed on stack at the beginning.
if (idx == 0) break; // end of the build
// Find predecessor basic block
- Block *pb = _bbs[x->_idx];
+ Block *pb = get_block_for_node(x);
// Insert into nodes array, if not already there
- if( !_bbs.lookup(proj->_idx) ) {
+ if (!has_block(proj)) {
assert( x != proj, "" );
// Map basic block of projection
- _bbs.map(proj->_idx,pb);
+ map_node_to_block(proj, pb);
pb->_nodes.push(proj);
}
// Insert self as a child of my predecessor block
- pb->_succs.map(pb->_num_succs++, _bbs[np->_idx]);
+ pb->_succs.map(pb->_num_succs++, get_block_for_node(np));
assert( pb->_nodes[ pb->_nodes.size() - pb->_num_succs ]->is_block_proj(),
"too many control users, not a CFG?" );
}
@@ -511,15 +516,15 @@ void PhaseCFG::insert_goto_at(uint block_no, uint succ_no) {
RegionNode* region = new (C) RegionNode(2);
region->init_req(1, proj);
// setup corresponding basic block
- Block* block = new (_bbs._arena) Block(_bbs._arena, region);
- _bbs.map(region->_idx, block);
+ Block* block = new (_block_arena) Block(_block_arena, region);
+ map_node_to_block(region, block);
C->regalloc()->set_bad(region->_idx);
// add a goto node
Node* gto = _goto->clone(); // get a new goto node
gto->set_req(0, region);
// add it to the basic block
block->_nodes.push(gto);
- _bbs.map(gto->_idx, block);
+ map_node_to_block(gto, block);
C->regalloc()->set_bad(gto->_idx);
// hook up successor block
block->_succs.map(block->_num_succs++, out);
@@ -570,7 +575,7 @@ void PhaseCFG::convert_NeverBranch_to_Goto(Block *b) {
gto->set_req(0, b->head());
Node *bp = b->_nodes[end_idx];
b->_nodes.map(end_idx,gto); // Slam over NeverBranch
- _bbs.map(gto->_idx, b);
+ map_node_to_block(gto, b);
C->regalloc()->set_bad(gto->_idx);
b->_nodes.pop(); // Yank projections
b->_nodes.pop(); // Yank projections
@@ -613,7 +618,7 @@ bool PhaseCFG::move_to_next(Block* bx, uint b_index) {
// If the previous block conditionally falls into bx, return false,
// because moving bx will create an extra jump.
for(uint k = 1; k < bx->num_preds(); k++ ) {
- Block* pred = _bbs[bx->pred(k)->_idx];
+ Block* pred = get_block_for_node(bx->pred(k));
if (pred == _blocks[bx_index-1]) {
if (pred->_num_succs != 1) {
return false;
@@ -682,7 +687,7 @@ void PhaseCFG::remove_empty() {
// Look for uncommon blocks and move to end.
if (!C->do_freq_based_layout()) {
- if( b->is_uncommon(_bbs) ) {
+ if (b->is_uncommon(this)) {
move_to_end(b, i);
last--; // No longer check for being uncommon!
if( no_flip_branch(b) ) { // Fall-thru case must follow?
@@ -870,28 +875,31 @@ void PhaseCFG::_dump_cfg( const Node *end, VectorSet &visited ) const {
} while( !p->is_block_start() );
// Recursively visit
- for( uint i=1; ireq(); i++ )
- _dump_cfg(p->in(i),visited);
+ for (uint i = 1; i < p->req(); i++) {
+ _dump_cfg(p->in(i), visited);
+ }
// Dump the block
- _bbs[p->_idx]->dump(&_bbs);
+ get_block_for_node(p)->dump(this);
}
void PhaseCFG::dump( ) const {
tty->print("\n--- CFG --- %d BBs\n",_num_blocks);
- if( _blocks.size() ) { // Did we do basic-block layout?
- for( uint i=0; i<_num_blocks; i++ )
- _blocks[i]->dump(&_bbs);
+ if (_blocks.size()) { // Did we do basic-block layout?
+ for (uint i = 0; i < _num_blocks; i++) {
+ _blocks[i]->dump(this);
+ }
} else { // Else do it with a DFS
- VectorSet visited(_bbs._arena);
+ VectorSet visited(_block_arena);
_dump_cfg(_root,visited);
}
}
void PhaseCFG::dump_headers() {
for( uint i = 0; i < _num_blocks; i++ ) {
- if( _blocks[i] == NULL ) continue;
- _blocks[i]->dump_head(&_bbs);
+ if (_blocks[i]) {
+ _blocks[i]->dump_head(this);
+ }
}
}
@@ -904,7 +912,7 @@ void PhaseCFG::verify( ) const {
uint j;
for (j = 0; j < cnt; j++) {
Node *n = b->_nodes[j];
- assert( _bbs[n->_idx] == b, "" );
+ assert(get_block_for_node(n) == b, "");
if (j >= 1 && n->is_Mach() &&
n->as_Mach()->ideal_Opcode() == Op_CreateEx) {
assert(j == 1 || b->_nodes[j-1]->is_Phi(),
@@ -913,13 +921,12 @@ void PhaseCFG::verify( ) const {
for (uint k = 0; k < n->req(); k++) {
Node *def = n->in(k);
if (def && def != n) {
- assert(_bbs[def->_idx] || def->is_Con(),
- "must have block; constants for debug info ok");
+ assert(get_block_for_node(def) || def->is_Con(), "must have block; constants for debug info ok");
// Verify that instructions in the block is in correct order.
// Uses must follow their definition if they are at the same block.
// Mostly done to check that MachSpillCopy nodes are placed correctly
// when CreateEx node is moved in build_ifg_physical().
- if (_bbs[def->_idx] == b &&
+ if (get_block_for_node(def) == b &&
!(b->head()->is_Loop() && n->is_Phi()) &&
// See (+++) comment in reg_split.cpp
!(n->jvms() != NULL && n->jvms()->is_monitor_use(k))) {
diff --git a/hotspot/src/share/vm/opto/block.hpp b/hotspot/src/share/vm/opto/block.hpp
index a2e4615b8d0..cb9384de2ee 100644
--- a/hotspot/src/share/vm/opto/block.hpp
+++ b/hotspot/src/share/vm/opto/block.hpp
@@ -48,13 +48,12 @@ class Block_Array : public ResourceObj {
friend class VMStructs;
uint _size; // allocated size, as opposed to formal limit
debug_only(uint _limit;) // limit to formal domain
+ Arena *_arena; // Arena to allocate in
protected:
Block **_blocks;
void grow( uint i ); // Grow array node to fit
public:
- Arena *_arena; // Arena to allocate in
-
Block_Array(Arena *a) : _arena(a), _size(OptoBlockListSize) {
debug_only(_limit=0);
_blocks = NEW_ARENA_ARRAY( a, Block *, OptoBlockListSize );
@@ -77,7 +76,7 @@ class Block_List : public Block_Array {
public:
uint _cnt;
Block_List() : Block_Array(Thread::current()->resource_area()), _cnt(0) {}
- void push( Block *b ) { map(_cnt++,b); }
+ void push( Block *b ) { map(_cnt++,b); }
Block *pop() { return _blocks[--_cnt]; }
Block *rpop() { Block *b = _blocks[0]; _blocks[0]=_blocks[--_cnt]; return b;}
void remove( uint i );
@@ -284,15 +283,15 @@ class Block : public CFGElement {
// helper function that adds caller save registers to MachProjNode
void add_call_kills(MachProjNode *proj, RegMask& regs, const char* save_policy, bool exclude_soe);
// Schedule a call next in the block
- uint sched_call(Matcher &matcher, Block_Array &bbs, uint node_cnt, Node_List &worklist, GrowableArray &ready_cnt, MachCallNode *mcall, VectorSet &next_call);
+ uint sched_call(Matcher &matcher, PhaseCFG* cfg, uint node_cnt, Node_List &worklist, GrowableArray &ready_cnt, MachCallNode *mcall, VectorSet &next_call);
// Perform basic-block local scheduling
Node *select(PhaseCFG *cfg, Node_List &worklist, GrowableArray &ready_cnt, VectorSet &next_call, uint sched_slot);
- void set_next_call( Node *n, VectorSet &next_call, Block_Array &bbs );
- void needed_for_next_call(Node *this_call, VectorSet &next_call, Block_Array &bbs);
+ void set_next_call( Node *n, VectorSet &next_call, PhaseCFG* cfg);
+ void needed_for_next_call(Node *this_call, VectorSet &next_call, PhaseCFG* cfg);
bool schedule_local(PhaseCFG *cfg, Matcher &m, GrowableArray &ready_cnt, VectorSet &next_call);
// Cleanup if any code lands between a Call and his Catch
- void call_catch_cleanup(Block_Array &bbs, Compile *C);
+ void call_catch_cleanup(PhaseCFG* cfg, Compile *C);
// Detect implicit-null-check opportunities. Basically, find NULL checks
// with suitable memory ops nearby. Use the memory op to do the NULL check.
// I can generate a memory op if there is not one nearby.
@@ -331,15 +330,15 @@ class Block : public CFGElement {
// Use frequency calculations and code shape to predict if the block
// is uncommon.
- bool is_uncommon( Block_Array &bbs ) const;
+ bool is_uncommon(PhaseCFG* cfg) const;
#ifndef PRODUCT
// Debugging print of basic block
void dump_bidx(const Block* orig, outputStream* st = tty) const;
- void dump_pred(const Block_Array *bbs, Block* orig, outputStream* st = tty) const;
- void dump_head( const Block_Array *bbs, outputStream* st = tty ) const;
+ void dump_pred(const PhaseCFG* cfg, Block* orig, outputStream* st = tty) const;
+ void dump_head(const PhaseCFG* cfg, outputStream* st = tty) const;
void dump() const;
- void dump( const Block_Array *bbs ) const;
+ void dump(const PhaseCFG* cfg) const;
#endif
};
@@ -349,6 +348,12 @@ class Block : public CFGElement {
class PhaseCFG : public Phase {
friend class VMStructs;
private:
+ // Arena for the blocks to be stored in
+ Arena* _block_arena;
+
+ // Map nodes to owning basic block
+ Block_Array _node_to_block_mapping;
+
// Build a proper looking cfg. Return count of basic blocks
uint build_cfg();
@@ -371,22 +376,42 @@ class PhaseCFG : public Phase {
Block* insert_anti_dependences(Block* LCA, Node* load, bool verify = false);
void verify_anti_dependences(Block* LCA, Node* load) {
- assert(LCA == _bbs[load->_idx], "should already be scheduled");
+ assert(LCA == get_block_for_node(load), "should already be scheduled");
insert_anti_dependences(LCA, load, true);
}
public:
- PhaseCFG( Arena *a, RootNode *r, Matcher &m );
+ PhaseCFG(Arena* arena, RootNode* root, Matcher& matcher);
uint _num_blocks; // Count of basic blocks
Block_List _blocks; // List of basic blocks
RootNode *_root; // Root of whole program
- Block_Array _bbs; // Map Nodes to owning Basic Block
Block *_broot; // Basic block of root
uint _rpo_ctr;
CFGLoop* _root_loop;
float _outer_loop_freq; // Outmost loop frequency
+
+ // set which block this node should reside in
+ void map_node_to_block(const Node* node, Block* block) {
+ _node_to_block_mapping.map(node->_idx, block);
+ }
+
+ // removes the mapping from a node to a block
+ void unmap_node_from_block(const Node* node) {
+ _node_to_block_mapping.map(node->_idx, NULL);
+ }
+
+ // get the block in which this node resides
+ Block* get_block_for_node(const Node* node) const {
+ return _node_to_block_mapping[node->_idx];
+ }
+
+ // does this node reside in a block; return true
+ bool has_block(const Node* node) const {
+ return (_node_to_block_mapping.lookup(node->_idx) != NULL);
+ }
+
// Per node latency estimation, valid only during GCM
GrowableArray *_node_latency;
@@ -405,7 +430,7 @@ class PhaseCFG : public Phase {
void Estimate_Block_Frequency();
// Global Code Motion. See Click's PLDI95 paper. Place Nodes in specific
- // basic blocks; i.e. _bbs now maps _idx for all Nodes to some Block.
+ // basic blocks; i.e. _node_to_block_mapping now maps _idx for all Nodes to some Block.
void GlobalCodeMotion( Matcher &m, uint unique, Node_List &proj_list );
// Compute the (backwards) latency of a node from the uses
@@ -454,7 +479,7 @@ class PhaseCFG : public Phase {
// Insert a node into a block, and update the _bbs
void insert( Block *b, uint idx, Node *n ) {
b->_nodes.insert( idx, n );
- _bbs.map( n->_idx, b );
+ map_node_to_block(n, b);
}
#ifndef PRODUCT
@@ -543,7 +568,7 @@ class CFGLoop : public CFGElement {
_child(NULL),
_exit_prob(1.0f) {}
CFGLoop* parent() { return _parent; }
- void push_pred(Block* blk, int i, Block_List& worklist, Block_Array& node_to_blk);
+ void push_pred(Block* blk, int i, Block_List& worklist, PhaseCFG* cfg);
void add_member(CFGElement *s) { _members.push(s); }
void add_nested_loop(CFGLoop* cl);
Block* head() {
diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp
index fc731604eaa..884142d57df 100644
--- a/hotspot/src/share/vm/opto/buildOopMap.cpp
+++ b/hotspot/src/share/vm/opto/buildOopMap.cpp
@@ -426,14 +426,16 @@ static void do_liveness( PhaseRegAlloc *regalloc, PhaseCFG *cfg, Block_List *wor
}
memset( live, 0, cfg->_num_blocks * (max_reg_ints<req(); i++ )
- worklist->push(cfg->_bbs[root->in(i)->_idx]);
+ for (uint i = 1; i < root->req(); i++) {
+ Block* block = cfg->get_block_for_node(root->in(i));
+ worklist->push(block);
+ }
// ZKM.jar includes tiny infinite loops which are unreached from below.
// If we missed any blocks, we'll retry here after pushing all missed
// blocks on the worklist. Normally this outer loop never trips more
// than once.
- while( 1 ) {
+ while (1) {
while( worklist->size() ) { // Standard worklist algorithm
Block *b = worklist->rpop();
@@ -537,8 +539,10 @@ static void do_liveness( PhaseRegAlloc *regalloc, PhaseCFG *cfg, Block_List *wor
for( l=0; lnum_preds(); l++ )
- worklist->push(cfg->_bbs[b->pred(l)->_idx]);
+ for (l = 1; l < (int)b->num_preds(); l++) {
+ Block* block = cfg->get_block_for_node(b->pred(l));
+ worklist->push(block);
+ }
}
}
@@ -629,10 +633,9 @@ void Compile::BuildOopMaps() {
// pred to this block. Otherwise we have to grab a new OopFlow.
OopFlow *flow = NULL; // Flag for finding optimized flow
Block *pred = (Block*)0xdeadbeef;
- uint j;
// Scan this block's preds to find a done predecessor
- for( j=1; jnum_preds(); j++ ) {
- Block *p = _cfg->_bbs[b->pred(j)->_idx];
+ for (uint j = 1; j < b->num_preds(); j++) {
+ Block* p = _cfg->get_block_for_node(b->pred(j));
OopFlow *p_flow = flows[p->_pre_order];
if( p_flow ) { // Predecessor is done
assert( p_flow->_b == p, "cross check" );
diff --git a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp
index 2e212995f3e..15d8befbbac 100644
--- a/hotspot/src/share/vm/opto/c2_globals.hpp
+++ b/hotspot/src/share/vm/opto/c2_globals.hpp
@@ -179,6 +179,9 @@
product_pd(intx, LoopUnrollLimit, \
"Unroll loop bodies with node count less than this") \
\
+ product(intx, LoopMaxUnroll, 16, \
+ "Maximum number of unrolls for main loop") \
+ \
product(intx, LoopUnrollMin, 4, \
"Minimum number of unroll loop bodies before checking progress" \
"of rounds of unroll,optimize,..") \
diff --git a/hotspot/src/share/vm/opto/chaitin.cpp b/hotspot/src/share/vm/opto/chaitin.cpp
index 53ffc573284..4fc254f40ca 100644
--- a/hotspot/src/share/vm/opto/chaitin.cpp
+++ b/hotspot/src/share/vm/opto/chaitin.cpp
@@ -295,7 +295,7 @@ void PhaseChaitin::new_lrg(const Node *x, uint lrg) {
bool PhaseChaitin::clone_projs_shared(Block *b, uint idx, Node *con, Node *copy, uint max_lrg_id) {
- Block *bcon = _cfg._bbs[con->_idx];
+ Block* bcon = _cfg.get_block_for_node(con);
uint cindex = bcon->find_node(con);
Node *con_next = bcon->_nodes[cindex+1];
if (con_next->in(0) != con || !con_next->is_MachProj()) {
@@ -306,7 +306,7 @@ bool PhaseChaitin::clone_projs_shared(Block *b, uint idx, Node *con, Node *copy,
Node *kills = con_next->clone();
kills->set_req(0, copy);
b->_nodes.insert(idx, kills);
- _cfg._bbs.map(kills->_idx, b);
+ _cfg.map_node_to_block(kills, b);
new_lrg(kills, max_lrg_id);
return true;
}
@@ -962,8 +962,7 @@ void PhaseChaitin::gather_lrg_masks( bool after_aggressive ) {
// AggressiveCoalesce. This effectively pre-virtual-splits
// around uncommon uses of common defs.
const RegMask &rm = n->in_RegMask(k);
- if( !after_aggressive &&
- _cfg._bbs[n->in(k)->_idx]->_freq > 1000*b->_freq ) {
+ if (!after_aggressive && _cfg.get_block_for_node(n->in(k))->_freq > 1000 * b->_freq) {
// Since we are BEFORE aggressive coalesce, leave the register
// mask untrimmed by the call. This encourages more coalescing.
// Later, AFTER aggressive, this live range will have to spill
@@ -1709,16 +1708,15 @@ Node *PhaseChaitin::find_base_for_derived( Node **derived_base_map, Node *derive
// set control to _root and place it into Start block
// (where top() node is placed).
base->init_req(0, _cfg._root);
- Block *startb = _cfg._bbs[C->top()->_idx];
+ Block *startb = _cfg.get_block_for_node(C->top());
startb->_nodes.insert(startb->find_node(C->top()), base );
- _cfg._bbs.map( base->_idx, startb );
+ _cfg.map_node_to_block(base, startb);
assert(_lrg_map.live_range_id(base) == 0, "should not have LRG yet");
}
if (_lrg_map.live_range_id(base) == 0) {
new_lrg(base, maxlrg++);
}
- assert(base->in(0) == _cfg._root &&
- _cfg._bbs[base->_idx] == _cfg._bbs[C->top()->_idx], "base NULL should be shared");
+ assert(base->in(0) == _cfg._root && _cfg.get_block_for_node(base) == _cfg.get_block_for_node(C->top()), "base NULL should be shared");
derived_base_map[derived->_idx] = base;
return base;
}
@@ -1754,12 +1752,12 @@ Node *PhaseChaitin::find_base_for_derived( Node **derived_base_map, Node *derive
base->as_Phi()->set_type(t);
// Search the current block for an existing base-Phi
- Block *b = _cfg._bbs[derived->_idx];
+ Block *b = _cfg.get_block_for_node(derived);
for( i = 1; i <= b->end_idx(); i++ ) {// Search for matching Phi
Node *phi = b->_nodes[i];
if( !phi->is_Phi() ) { // Found end of Phis with no match?
b->_nodes.insert( i, base ); // Must insert created Phi here as base
- _cfg._bbs.map( base->_idx, b );
+ _cfg.map_node_to_block(base, b);
new_lrg(base,maxlrg++);
break;
}
@@ -1815,8 +1813,8 @@ bool PhaseChaitin::stretch_base_pointer_live_ranges(ResourceArea *a) {
if( n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_CmpI ) {
Node *phi = n->in(1);
if( phi->is_Phi() && phi->as_Phi()->region()->is_Loop() ) {
- Block *phi_block = _cfg._bbs[phi->_idx];
- if( _cfg._bbs[phi_block->pred(2)->_idx] == b ) {
+ Block *phi_block = _cfg.get_block_for_node(phi);
+ if (_cfg.get_block_for_node(phi_block->pred(2)) == b) {
const RegMask *mask = C->matcher()->idealreg2spillmask[Op_RegI];
Node *spill = new (C) MachSpillCopyNode( phi, *mask, *mask );
insert_proj( phi_block, 1, spill, maxlrg++ );
@@ -1870,7 +1868,7 @@ bool PhaseChaitin::stretch_base_pointer_live_ranges(ResourceArea *a) {
if ((_lrg_map.live_range_id(base) >= _lrg_map.max_lrg_id() || // (Brand new base (hence not live) or
!liveout.member(_lrg_map.live_range_id(base))) && // not live) AND
(_lrg_map.live_range_id(base) > 0) && // not a constant
- _cfg._bbs[base->_idx] != b) { // base not def'd in blk)
+ _cfg.get_block_for_node(base) != b) { // base not def'd in blk)
// Base pointer is not currently live. Since I stretched
// the base pointer to here and it crosses basic-block
// boundaries, the global live info is now incorrect.
@@ -1993,8 +1991,8 @@ void PhaseChaitin::dump(const Node *n) const {
tty->print("\n");
}
-void PhaseChaitin::dump( const Block * b ) const {
- b->dump_head( &_cfg._bbs );
+void PhaseChaitin::dump(const Block *b) const {
+ b->dump_head(&_cfg);
// For all instructions
for( uint j = 0; j < b->_nodes.size(); j++ )
@@ -2299,7 +2297,7 @@ void PhaseChaitin::dump_lrg( uint lidx, bool defs_only ) const {
if (_lrg_map.find_const(n) == lidx) {
if (!dump_once++) {
tty->cr();
- b->dump_head( &_cfg._bbs );
+ b->dump_head(&_cfg);
}
dump(n);
continue;
@@ -2314,7 +2312,7 @@ void PhaseChaitin::dump_lrg( uint lidx, bool defs_only ) const {
if (_lrg_map.find_const(m) == lidx) {
if (!dump_once++) {
tty->cr();
- b->dump_head(&_cfg._bbs);
+ b->dump_head(&_cfg);
}
dump(n);
}
diff --git a/hotspot/src/share/vm/opto/coalesce.cpp b/hotspot/src/share/vm/opto/coalesce.cpp
index 60c88dc12ba..d1f880a6493 100644
--- a/hotspot/src/share/vm/opto/coalesce.cpp
+++ b/hotspot/src/share/vm/opto/coalesce.cpp
@@ -52,7 +52,7 @@ void PhaseCoalesce::dump() const {
// Print a nice block header
tty->print("B%d: ",b->_pre_order);
for( j=1; jnum_preds(); j++ )
- tty->print("B%d ", _phc._cfg._bbs[b->pred(j)->_idx]->_pre_order);
+ tty->print("B%d ", _phc._cfg.get_block_for_node(b->pred(j))->_pre_order);
tty->print("-> ");
for( j=0; j_num_succs; j++ )
tty->print("B%d ",b->_succs[j]->_pre_order);
@@ -208,7 +208,7 @@ void PhaseAggressiveCoalesce::insert_copy_with_overlap( Block *b, Node *copy, ui
copy->set_req(idx,tmp);
// Save source in temp early, before source is killed
b->_nodes.insert(kill_src_idx,tmp);
- _phc._cfg._bbs.map( tmp->_idx, b );
+ _phc._cfg.map_node_to_block(tmp, b);
last_use_idx++;
}
@@ -286,7 +286,7 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
Node *m = n->in(j);
uint src_name = _phc._lrg_map.find(m);
if (src_name != phi_name) {
- Block *pred = _phc._cfg._bbs[b->pred(j)->_idx];
+ Block *pred = _phc._cfg.get_block_for_node(b->pred(j));
Node *copy;
assert(!m->is_Con() || m->is_Mach(), "all Con must be Mach");
// Rematerialize constants instead of copying them
@@ -305,7 +305,7 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
}
// Insert the copy in the use-def chain
n->set_req(j, copy);
- _phc._cfg._bbs.map( copy->_idx, pred );
+ _phc._cfg.map_node_to_block(copy, pred);
// Extend ("register allocate") the names array for the copy.
_phc._lrg_map.extend(copy->_idx, phi_name);
} // End of if Phi names do not match
@@ -343,13 +343,13 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
n->set_req(idx, copy);
// Extend ("register allocate") the names array for the copy.
_phc._lrg_map.extend(copy->_idx, name);
- _phc._cfg._bbs.map( copy->_idx, b );
+ _phc._cfg.map_node_to_block(copy, b);
}
} // End of is two-adr
// Insert a copy at a debug use for a lrg which has high frequency
- if (b->_freq < OPTO_DEBUG_SPLIT_FREQ || b->is_uncommon(_phc._cfg._bbs)) {
+ if (b->_freq < OPTO_DEBUG_SPLIT_FREQ || b->is_uncommon(&_phc._cfg)) {
// Walk the debug inputs to the node and check for lrg freq
JVMState* jvms = n->jvms();
uint debug_start = jvms ? jvms->debug_start() : 999999;
@@ -391,7 +391,7 @@ void PhaseAggressiveCoalesce::insert_copies( Matcher &matcher ) {
uint max_lrg_id = _phc._lrg_map.max_lrg_id();
_phc.new_lrg(copy, max_lrg_id);
_phc._lrg_map.set_max_lrg_id(max_lrg_id + 1);
- _phc._cfg._bbs.map(copy->_idx, b);
+ _phc._cfg.map_node_to_block(copy, b);
//tty->print_cr("Split a debug use in Aggressive Coalesce");
} // End of if high frequency use/def
} // End of for all debug inputs
@@ -437,7 +437,10 @@ void PhaseAggressiveCoalesce::coalesce( Block *b ) {
Block *bs = b->_succs[i];
// Find index of 'b' in 'bs' predecessors
uint j=1;
- while( _phc._cfg._bbs[bs->pred(j)->_idx] != b ) j++;
+ while (_phc._cfg.get_block_for_node(bs->pred(j)) != b) {
+ j++;
+ }
+
// Visit all the Phis in successor block
for( uint k = 1; k_nodes.size(); k++ ) {
Node *n = bs->_nodes[k];
@@ -510,9 +513,9 @@ void PhaseConservativeCoalesce::union_helper( Node *lr1_node, Node *lr2_node, ui
if( bindex < b->_fhrp_index ) b->_fhrp_index--;
// Stretched lr1; add it to liveness of intermediate blocks
- Block *b2 = _phc._cfg._bbs[src_copy->_idx];
+ Block *b2 = _phc._cfg.get_block_for_node(src_copy);
while( b != b2 ) {
- b = _phc._cfg._bbs[b->pred(1)->_idx];
+ b = _phc._cfg.get_block_for_node(b->pred(1));
_phc._live->live(b)->insert(lr1);
}
}
@@ -532,7 +535,7 @@ uint PhaseConservativeCoalesce::compute_separating_interferences(Node *dst_copy,
bindex2--; // Chain backwards 1 instruction
while( bindex2 == 0 ) { // At block start, find prior block
assert( b2->num_preds() == 2, "cannot double coalesce across c-flow" );
- b2 = _phc._cfg._bbs[b2->pred(1)->_idx];
+ b2 = _phc._cfg.get_block_for_node(b2->pred(1));
bindex2 = b2->end_idx()-1;
}
// Get prior instruction
@@ -676,8 +679,8 @@ bool PhaseConservativeCoalesce::copy_copy(Node *dst_copy, Node *src_copy, Block
if (UseFPUForSpilling && rm.is_AllStack() ) {
// Don't coalesce when frequency difference is large
- Block *dst_b = _phc._cfg._bbs[dst_copy->_idx];
- Block *src_def_b = _phc._cfg._bbs[src_def->_idx];
+ Block *dst_b = _phc._cfg.get_block_for_node(dst_copy);
+ Block *src_def_b = _phc._cfg.get_block_for_node(src_def);
if (src_def_b->_freq > 10*dst_b->_freq )
return false;
}
@@ -690,7 +693,7 @@ bool PhaseConservativeCoalesce::copy_copy(Node *dst_copy, Node *src_copy, Block
// Another early bail-out test is when we are double-coalescing and the
// 2 copies are separated by some control flow.
if( dst_copy != src_copy ) {
- Block *src_b = _phc._cfg._bbs[src_copy->_idx];
+ Block *src_b = _phc._cfg.get_block_for_node(src_copy);
Block *b2 = b;
while( b2 != src_b ) {
if( b2->num_preds() > 2 ){// Found merge-point
@@ -701,7 +704,7 @@ bool PhaseConservativeCoalesce::copy_copy(Node *dst_copy, Node *src_copy, Block
//record_bias( _phc._lrgs, lr1, lr2 );
return false; // To hard to find all interferences
}
- b2 = _phc._cfg._bbs[b2->pred(1)->_idx];
+ b2 = _phc._cfg.get_block_for_node(b2->pred(1));
}
}
@@ -786,8 +789,9 @@ bool PhaseConservativeCoalesce::copy_copy(Node *dst_copy, Node *src_copy, Block
// Conservative (but pessimistic) copy coalescing of a single block
void PhaseConservativeCoalesce::coalesce( Block *b ) {
// Bail out on infrequent blocks
- if( b->is_uncommon(_phc._cfg._bbs) )
+ if (b->is_uncommon(&_phc._cfg)) {
return;
+ }
// Check this block for copies.
for( uint i = 1; iend_idx(); i++ ) {
// Check for actual copies on inputs. Coalesce a copy into its
diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp
index cd650b00156..f7cadda849b 100644
--- a/hotspot/src/share/vm/opto/compile.cpp
+++ b/hotspot/src/share/vm/opto/compile.cpp
@@ -2262,7 +2262,7 @@ void Compile::dump_asm(int *pcs, uint pc_limit) {
tty->print("%3.3x ", pcs[n->_idx]);
else
tty->print(" ");
- b->dump_head( &_cfg->_bbs );
+ b->dump_head(_cfg);
if (b->is_connector()) {
tty->print_cr(" # Empty connector block");
} else if (b->num_preds() == 2 && b->pred(1)->is_CatchProj() && b->pred(1)->as_CatchProj()->_con == CatchProjNode::fall_through_index) {
@@ -3525,7 +3525,7 @@ void Compile::ConstantTable::add(Constant& con) {
}
Compile::Constant Compile::ConstantTable::add(MachConstantNode* n, BasicType type, jvalue value) {
- Block* b = Compile::current()->cfg()->_bbs[n->_idx];
+ Block* b = Compile::current()->cfg()->get_block_for_node(n);
Constant con(type, value, b->_freq);
add(con);
return con;
diff --git a/hotspot/src/share/vm/opto/domgraph.cpp b/hotspot/src/share/vm/opto/domgraph.cpp
index 9973cb562f8..b64e291e7ca 100644
--- a/hotspot/src/share/vm/opto/domgraph.cpp
+++ b/hotspot/src/share/vm/opto/domgraph.cpp
@@ -105,8 +105,8 @@ void PhaseCFG::Dominators( ) {
// Step 2:
Node *whead = w->_block->head();
- for( uint j=1; j < whead->req(); j++ ) {
- Block *b = _bbs[whead->in(j)->_idx];
+ for (uint j = 1; j < whead->req(); j++) {
+ Block* b = get_block_for_node(whead->in(j));
Tarjan *vx = &tarjan[b->_pre_order];
Tarjan *u = vx->EVAL();
if( u->_semi < w->_semi )
diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp
index 811dc5c6c87..9ded635f65f 100644
--- a/hotspot/src/share/vm/opto/gcm.cpp
+++ b/hotspot/src/share/vm/opto/gcm.cpp
@@ -66,7 +66,7 @@
// are in b also.
void PhaseCFG::schedule_node_into_block( Node *n, Block *b ) {
// Set basic block of n, Add n to b,
- _bbs.map(n->_idx, b);
+ map_node_to_block(n, b);
b->add_inst(n);
// After Matching, nearly any old Node may have projections trailing it.
@@ -75,11 +75,12 @@ void PhaseCFG::schedule_node_into_block( Node *n, Block *b ) {
for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
Node* use = n->fast_out(i);
if (use->is_Proj()) {
- Block* buse = _bbs[use->_idx];
+ Block* buse = get_block_for_node(use);
if (buse != b) { // In wrong block?
- if (buse != NULL)
+ if (buse != NULL) {
buse->find_remove(use); // Remove from wrong block
- _bbs.map(use->_idx, b); // Re-insert in this block
+ }
+ map_node_to_block(use, b);
b->add_inst(use);
}
}
@@ -97,7 +98,7 @@ void PhaseCFG::replace_block_proj_ctrl( Node *n ) {
if (p != NULL && p != n) { // Control from a block projection?
assert(!n->pinned() || n->is_MachConstantBase(), "only pinned MachConstantBase node is expected here");
// Find trailing Region
- Block *pb = _bbs[in0->_idx]; // Block-projection already has basic block
+ Block *pb = get_block_for_node(in0); // Block-projection already has basic block
uint j = 0;
if (pb->_num_succs != 1) { // More then 1 successor?
// Search for successor
@@ -127,14 +128,15 @@ void PhaseCFG::schedule_pinned_nodes( VectorSet &visited ) {
while ( spstack.is_nonempty() ) {
Node *n = spstack.pop();
if( !visited.test_set(n->_idx) ) { // Test node and flag it as visited
- if( n->pinned() && !_bbs.lookup(n->_idx) ) { // Pinned? Nail it down!
+ if( n->pinned() && !has_block(n)) { // Pinned? Nail it down!
assert( n->in(0), "pinned Node must have Control" );
// Before setting block replace block_proj control edge
replace_block_proj_ctrl(n);
Node *input = n->in(0);
- while( !input->is_block_start() )
+ while (!input->is_block_start()) {
input = input->in(0);
- Block *b = _bbs[input->_idx]; // Basic block of controlling input
+ }
+ Block *b = get_block_for_node(input); // Basic block of controlling input
schedule_node_into_block(n, b);
}
for( int i = n->req() - 1; i >= 0; --i ) { // For all inputs
@@ -149,7 +151,7 @@ void PhaseCFG::schedule_pinned_nodes( VectorSet &visited ) {
// Assert that new input b2 is dominated by all previous inputs.
// Check this by by seeing that it is dominated by b1, the deepest
// input observed until b2.
-static void assert_dom(Block* b1, Block* b2, Node* n, Block_Array &bbs) {
+static void assert_dom(Block* b1, Block* b2, Node* n, const PhaseCFG* cfg) {
if (b1 == NULL) return;
assert(b1->_dom_depth < b2->_dom_depth, "sanity");
Block* tmp = b2;
@@ -162,7 +164,7 @@ static void assert_dom(Block* b1, Block* b2, Node* n, Block_Array &bbs) {
for (uint j=0; jlen(); j++) { // For all inputs
Node* inn = n->in(j); // Get input
if (inn == NULL) continue; // Ignore NULL, missing inputs
- Block* inb = bbs[inn->_idx];
+ Block* inb = cfg->get_block_for_node(inn);
tty->print("B%d idom=B%d depth=%2d ",inb->_pre_order,
inb->_idom ? inb->_idom->_pre_order : 0, inb->_dom_depth);
inn->dump();
@@ -174,20 +176,20 @@ static void assert_dom(Block* b1, Block* b2, Node* n, Block_Array &bbs) {
}
#endif
-static Block* find_deepest_input(Node* n, Block_Array &bbs) {
+static Block* find_deepest_input(Node* n, const PhaseCFG* cfg) {
// Find the last input dominated by all other inputs.
Block* deepb = NULL; // Deepest block so far
int deepb_dom_depth = 0;
for (uint k = 0; k < n->len(); k++) { // For all inputs
Node* inn = n->in(k); // Get input
if (inn == NULL) continue; // Ignore NULL, missing inputs
- Block* inb = bbs[inn->_idx];
+ Block* inb = cfg->get_block_for_node(inn);
assert(inb != NULL, "must already have scheduled this input");
if (deepb_dom_depth < (int) inb->_dom_depth) {
// The new inb must be dominated by the previous deepb.
// The various inputs must be linearly ordered in the dom
// tree, or else there will not be a unique deepest block.
- DEBUG_ONLY(assert_dom(deepb, inb, n, bbs));
+ DEBUG_ONLY(assert_dom(deepb, inb, n, cfg));
deepb = inb; // Save deepest block
deepb_dom_depth = deepb->_dom_depth;
}
@@ -243,7 +245,7 @@ bool PhaseCFG::schedule_early(VectorSet &visited, Node_List &roots) {
++i;
if (in == NULL) continue; // Ignore NULL, missing inputs
int is_visited = visited.test_set(in->_idx);
- if (!_bbs.lookup(in->_idx)) { // Missing block selection?
+ if (!has_block(in)) { // Missing block selection?
if (is_visited) {
// assert( !visited.test(in->_idx), "did not schedule early" );
return false;
@@ -265,9 +267,9 @@ bool PhaseCFG::schedule_early(VectorSet &visited, Node_List &roots) {
// any projections which depend on them.
if (!n->pinned()) {
// Set earliest legal block.
- _bbs.map(n->_idx, find_deepest_input(n, _bbs));
+ map_node_to_block(n, find_deepest_input(n, this));
} else {
- assert(_bbs[n->_idx] == _bbs[n->in(0)->_idx], "Pinned Node should be at the same block as its control edge");
+ assert(get_block_for_node(n) == get_block_for_node(n->in(0)), "Pinned Node should be at the same block as its control edge");
}
if (nstack.is_empty()) {
@@ -313,8 +315,8 @@ Block* Block::dom_lca(Block* LCA) {
// The definition must dominate the use, so move the LCA upward in the
// dominator tree to dominate the use. If the use is a phi, adjust
// the LCA only with the phi input paths which actually use this def.
-static Block* raise_LCA_above_use(Block* LCA, Node* use, Node* def, Block_Array &bbs) {
- Block* buse = bbs[use->_idx];
+static Block* raise_LCA_above_use(Block* LCA, Node* use, Node* def, const PhaseCFG* cfg) {
+ Block* buse = cfg->get_block_for_node(use);
if (buse == NULL) return LCA; // Unused killing Projs have no use block
if (!use->is_Phi()) return buse->dom_lca(LCA);
uint pmax = use->req(); // Number of Phi inputs
@@ -329,7 +331,7 @@ static Block* raise_LCA_above_use(Block* LCA, Node* use, Node* def, Block_Array
// more than once.
for (uint j=1; jin(j) == def) { // Found matching input?
- Block* pred = bbs[buse->pred(j)->_idx];
+ Block* pred = cfg->get_block_for_node(buse->pred(j));
LCA = pred->dom_lca(LCA);
}
}
@@ -342,8 +344,7 @@ static Block* raise_LCA_above_use(Block* LCA, Node* use, Node* def, Block_Array
// which are marked with the given index. Return the LCA (in the dom tree)
// of all marked blocks. If there are none marked, return the original
// LCA.
-static Block* raise_LCA_above_marks(Block* LCA, node_idx_t mark,
- Block* early, Block_Array &bbs) {
+static Block* raise_LCA_above_marks(Block* LCA, node_idx_t mark, Block* early, const PhaseCFG* cfg) {
Block_List worklist;
worklist.push(LCA);
while (worklist.size() > 0) {
@@ -366,7 +367,7 @@ static Block* raise_LCA_above_marks(Block* LCA, node_idx_t mark,
} else {
// Keep searching through this block's predecessors.
for (uint j = 1, jmax = mid->num_preds(); j < jmax; j++) {
- Block* mid_parent = bbs[ mid->pred(j)->_idx ];
+ Block* mid_parent = cfg->get_block_for_node(mid->pred(j));
worklist.push(mid_parent);
}
}
@@ -384,7 +385,7 @@ static Block* raise_LCA_above_marks(Block* LCA, node_idx_t mark,
// be earlier (at a shallower dom_depth) than the true schedule_early
// point of the node. We compute this earlier block as a more permissive
// site for anti-dependency insertion, but only if subsume_loads is enabled.
-static Block* memory_early_block(Node* load, Block* early, Block_Array &bbs) {
+static Block* memory_early_block(Node* load, Block* early, const PhaseCFG* cfg) {
Node* base;
Node* index;
Node* store = load->in(MemNode::Memory);
@@ -412,12 +413,12 @@ static Block* memory_early_block(Node* load, Block* early, Block_Array &bbs) {
Block* deepb = NULL; // Deepest block so far
int deepb_dom_depth = 0;
for (int i = 0; i < mem_inputs_length; i++) {
- Block* inb = bbs[mem_inputs[i]->_idx];
+ Block* inb = cfg->get_block_for_node(mem_inputs[i]);
if (deepb_dom_depth < (int) inb->_dom_depth) {
// The new inb must be dominated by the previous deepb.
// The various inputs must be linearly ordered in the dom
// tree, or else there will not be a unique deepest block.
- DEBUG_ONLY(assert_dom(deepb, inb, load, bbs));
+ DEBUG_ONLY(assert_dom(deepb, inb, load, cfg));
deepb = inb; // Save deepest block
deepb_dom_depth = deepb->_dom_depth;
}
@@ -488,14 +489,14 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) {
// and other inputs are first available. (Computed by schedule_early.)
// For normal loads, 'early' is the shallowest place (dom graph wise)
// to look for anti-deps between this load and any store.
- Block* early = _bbs[load_index];
+ Block* early = get_block_for_node(load);
// If we are subsuming loads, compute an "early" block that only considers
// memory or address inputs. This block may be different than the
// schedule_early block in that it could be at an even shallower depth in the
// dominator tree, and allow for a broader discovery of anti-dependences.
if (C->subsume_loads()) {
- early = memory_early_block(load, early, _bbs);
+ early = memory_early_block(load, early, this);
}
ResourceArea *area = Thread::current()->resource_area();
@@ -619,7 +620,7 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) {
// or else observe that 'store' is all the way up in the
// earliest legal block for 'load'. In the latter case,
// immediately insert an anti-dependence edge.
- Block* store_block = _bbs[store->_idx];
+ Block* store_block = get_block_for_node(store);
assert(store_block != NULL, "unused killing projections skipped above");
if (store->is_Phi()) {
@@ -637,7 +638,7 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) {
for (uint j = PhiNode::Input, jmax = store->req(); j < jmax; j++) {
if (store->in(j) == mem) { // Found matching input?
DEBUG_ONLY(found_match = true);
- Block* pred_block = _bbs[store_block->pred(j)->_idx];
+ Block* pred_block = get_block_for_node(store_block->pred(j));
if (pred_block != early) {
// If any predecessor of the Phi matches the load's "early block",
// we do not need a precedence edge between the Phi and 'load'
@@ -711,7 +712,7 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) {
// preventing the load from sinking past any block containing
// a store that may invalidate the memory state required by 'load'.
if (must_raise_LCA)
- LCA = raise_LCA_above_marks(LCA, load->_idx, early, _bbs);
+ LCA = raise_LCA_above_marks(LCA, load->_idx, early, this);
if (LCA == early) return LCA;
// Insert anti-dependence edges from 'load' to each store
@@ -720,7 +721,7 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) {
if (LCA->raise_LCA_mark() == load_index) {
while (non_early_stores.size() > 0) {
Node* store = non_early_stores.pop();
- Block* store_block = _bbs[store->_idx];
+ Block* store_block = get_block_for_node(store);
if (store_block == LCA) {
// add anti_dependence from store to load in its own block
assert(store != load->in(0), "dependence cycle found");
@@ -754,7 +755,7 @@ private:
public:
// Constructor for the iterator
- Node_Backward_Iterator(Node *root, VectorSet &visited, Node_List &stack, Block_Array &bbs);
+ Node_Backward_Iterator(Node *root, VectorSet &visited, Node_List &stack, PhaseCFG &cfg);
// Postincrement operator to iterate over the nodes
Node *next();
@@ -762,12 +763,12 @@ public:
private:
VectorSet &_visited;
Node_List &_stack;
- Block_Array &_bbs;
+ PhaseCFG &_cfg;
};
// Constructor for the Node_Backward_Iterator
-Node_Backward_Iterator::Node_Backward_Iterator( Node *root, VectorSet &visited, Node_List &stack, Block_Array &bbs )
- : _visited(visited), _stack(stack), _bbs(bbs) {
+Node_Backward_Iterator::Node_Backward_Iterator( Node *root, VectorSet &visited, Node_List &stack, PhaseCFG &cfg)
+ : _visited(visited), _stack(stack), _cfg(cfg) {
// The stack should contain exactly the root
stack.clear();
stack.push(root);
@@ -797,8 +798,8 @@ Node *Node_Backward_Iterator::next() {
_visited.set(self->_idx);
// Now schedule all uses as late as possible.
- uint src = self->is_Proj() ? self->in(0)->_idx : self->_idx;
- uint src_rpo = _bbs[src]->_rpo;
+ const Node* src = self->is_Proj() ? self->in(0) : self;
+ uint src_rpo = _cfg.get_block_for_node(src)->_rpo;
// Schedule all nodes in a post-order visit
Node *unvisited = NULL; // Unvisited anti-dependent Node, if any
@@ -814,7 +815,7 @@ Node *Node_Backward_Iterator::next() {
// do not traverse backward control edges
Node *use = n->is_Proj() ? n->in(0) : n;
- uint use_rpo = _bbs[use->_idx]->_rpo;
+ uint use_rpo = _cfg.get_block_for_node(use)->_rpo;
if ( use_rpo < src_rpo )
continue;
@@ -852,7 +853,7 @@ void PhaseCFG::ComputeLatenciesBackwards(VectorSet &visited, Node_List &stack) {
tty->print("\n#---- ComputeLatenciesBackwards ----\n");
#endif
- Node_Backward_Iterator iter((Node *)_root, visited, stack, _bbs);
+ Node_Backward_Iterator iter((Node *)_root, visited, stack, *this);
Node *n;
// Walk over all the nodes from last to first
@@ -883,7 +884,7 @@ void PhaseCFG::partial_latency_of_defs(Node *n) {
uint nlen = n->len();
uint use_latency = _node_latency->at_grow(n->_idx);
- uint use_pre_order = _bbs[n->_idx]->_pre_order;
+ uint use_pre_order = get_block_for_node(n)->_pre_order;
for ( uint j=0; jin(j);
@@ -903,7 +904,7 @@ void PhaseCFG::partial_latency_of_defs(Node *n) {
#endif
// If the defining block is not known, assume it is ok
- Block *def_block = _bbs[def->_idx];
+ Block *def_block = get_block_for_node(def);
uint def_pre_order = def_block ? def_block->_pre_order : 0;
if ( (use_pre_order < def_pre_order) ||
@@ -931,10 +932,11 @@ void PhaseCFG::partial_latency_of_defs(Node *n) {
// Compute the latency of a specific use
int PhaseCFG::latency_from_use(Node *n, const Node *def, Node *use) {
// If self-reference, return no latency
- if (use == n || use->is_Root())
+ if (use == n || use->is_Root()) {
return 0;
+ }
- uint def_pre_order = _bbs[def->_idx]->_pre_order;
+ uint def_pre_order = get_block_for_node(def)->_pre_order;
uint latency = 0;
// If the use is not a projection, then it is simple...
@@ -946,7 +948,7 @@ int PhaseCFG::latency_from_use(Node *n, const Node *def, Node *use) {
}
#endif
- uint use_pre_order = _bbs[use->_idx]->_pre_order;
+ uint use_pre_order = get_block_for_node(use)->_pre_order;
if (use_pre_order < def_pre_order)
return 0;
@@ -1018,7 +1020,7 @@ Block* PhaseCFG::hoist_to_cheaper_block(Block* LCA, Block* early, Node* self) {
uint start_latency = _node_latency->at_grow(LCA->_nodes[0]->_idx);
uint end_latency = _node_latency->at_grow(LCA->_nodes[LCA->end_idx()]->_idx);
bool in_latency = (target <= start_latency);
- const Block* root_block = _bbs[_root->_idx];
+ const Block* root_block = get_block_for_node(_root);
// Turn off latency scheduling if scheduling is just plain off
if (!C->do_scheduling())
@@ -1126,12 +1128,12 @@ void PhaseCFG::schedule_late(VectorSet &visited, Node_List &stack) {
tty->print("\n#---- schedule_late ----\n");
#endif
- Node_Backward_Iterator iter((Node *)_root, visited, stack, _bbs);
+ Node_Backward_Iterator iter((Node *)_root, visited, stack, *this);
Node *self;
// Walk over all the nodes from last to first
while (self = iter.next()) {
- Block* early = _bbs[self->_idx]; // Earliest legal placement
+ Block* early = get_block_for_node(self); // Earliest legal placement
if (self->is_top()) {
// Top node goes in bb #2 with other constants.
@@ -1179,7 +1181,7 @@ void PhaseCFG::schedule_late(VectorSet &visited, Node_List &stack) {
for (DUIterator_Fast imax, i = self->fast_outs(imax); i < imax; i++) {
// For all uses, find LCA
Node* use = self->fast_out(i);
- LCA = raise_LCA_above_use(LCA, use, self, _bbs);
+ LCA = raise_LCA_above_use(LCA, use, self, this);
}
} // (Hide defs of imax, i from rest of block.)
@@ -1187,7 +1189,7 @@ void PhaseCFG::schedule_late(VectorSet &visited, Node_List &stack) {
// requirement for correctness but it reduces useless
// interference between temps and other nodes.
if (mach != NULL && mach->is_MachTemp()) {
- _bbs.map(self->_idx, LCA);
+ map_node_to_block(self, LCA);
LCA->add_inst(self);
continue;
}
@@ -1262,10 +1264,10 @@ void PhaseCFG::GlobalCodeMotion( Matcher &matcher, uint unique, Node_List &proj_
}
#endif
- // Initialize the bbs.map for things on the proj_list
- uint i;
- for( i=0; i < proj_list.size(); i++ )
- _bbs.map(proj_list[i]->_idx, NULL);
+ // Initialize the node to block mapping for things on the proj_list
+ for (uint i = 0; i < proj_list.size(); i++) {
+ unmap_node_from_block(proj_list[i]);
+ }
// Set the basic block for Nodes pinned into blocks
Arena *a = Thread::current()->resource_area();
@@ -1333,7 +1335,7 @@ void PhaseCFG::GlobalCodeMotion( Matcher &matcher, uint unique, Node_List &proj_
for( int i= matcher._null_check_tests.size()-2; i>=0; i-=2 ) {
Node *proj = matcher._null_check_tests[i ];
Node *val = matcher._null_check_tests[i+1];
- _bbs[proj->_idx]->implicit_null_check(this, proj, val, allowed_reasons);
+ get_block_for_node(proj)->implicit_null_check(this, proj, val, allowed_reasons);
// The implicit_null_check will only perform the transformation
// if the null branch is truly uncommon, *and* it leads to an
// uncommon trap. Combined with the too_many_traps guards
@@ -1353,7 +1355,7 @@ void PhaseCFG::GlobalCodeMotion( Matcher &matcher, uint unique, Node_List &proj_
uint max_idx = C->unique();
GrowableArray ready_cnt(max_idx, max_idx, -1);
visited.Clear();
- for (i = 0; i < _num_blocks; i++) {
+ for (uint i = 0; i < _num_blocks; i++) {
if (!_blocks[i]->schedule_local(this, matcher, ready_cnt, visited)) {
if (!C->failure_reason_is(C2Compiler::retry_no_subsuming_loads())) {
C->record_method_not_compilable("local schedule failed");
@@ -1364,8 +1366,9 @@ void PhaseCFG::GlobalCodeMotion( Matcher &matcher, uint unique, Node_List &proj_
// If we inserted any instructions between a Call and his CatchNode,
// clone the instructions on all paths below the Catch.
- for( i=0; i < _num_blocks; i++ )
- _blocks[i]->call_catch_cleanup(_bbs, C);
+ for (uint i = 0; i < _num_blocks; i++) {
+ _blocks[i]->call_catch_cleanup(this, C);
+ }
#ifndef PRODUCT
if (trace_opto_pipelining()) {
@@ -1392,7 +1395,7 @@ void PhaseCFG::Estimate_Block_Frequency() {
Block_List worklist;
Block* root_blk = _blocks[0];
for (uint i = 1; i < root_blk->num_preds(); i++) {
- Block *pb = _bbs[root_blk->pred(i)->_idx];
+ Block *pb = get_block_for_node(root_blk->pred(i));
if (pb->has_uncommon_code()) {
worklist.push(pb);
}
@@ -1401,7 +1404,7 @@ void PhaseCFG::Estimate_Block_Frequency() {
Block* uct = worklist.pop();
if (uct == _broot) continue;
for (uint i = 1; i < uct->num_preds(); i++) {
- Block *pb = _bbs[uct->pred(i)->_idx];
+ Block *pb = get_block_for_node(uct->pred(i));
if (pb->_num_succs == 1) {
worklist.push(pb);
} else if (pb->num_fall_throughs() == 2) {
@@ -1430,7 +1433,7 @@ void PhaseCFG::Estimate_Block_Frequency() {
Block_List worklist;
Block* root_blk = _blocks[0];
for (uint i = 1; i < root_blk->num_preds(); i++) {
- Block *pb = _bbs[root_blk->pred(i)->_idx];
+ Block *pb = get_block_for_node(root_blk->pred(i));
if (pb->has_uncommon_code()) {
worklist.push(pb);
}
@@ -1439,7 +1442,7 @@ void PhaseCFG::Estimate_Block_Frequency() {
Block* uct = worklist.pop();
uct->_freq = PROB_MIN;
for (uint i = 1; i < uct->num_preds(); i++) {
- Block *pb = _bbs[uct->pred(i)->_idx];
+ Block *pb = get_block_for_node(uct->pred(i));
if (pb->_num_succs == 1 && pb->_freq > PROB_MIN) {
worklist.push(pb);
}
@@ -1499,7 +1502,7 @@ CFGLoop* PhaseCFG::create_loop_tree() {
Block* loop_head = b;
assert(loop_head->num_preds() - 1 == 2, "loop must have 2 predecessors");
Node* tail_n = loop_head->pred(LoopNode::LoopBackControl);
- Block* tail = _bbs[tail_n->_idx];
+ Block* tail = get_block_for_node(tail_n);
// Defensively filter out Loop nodes for non-single-entry loops.
// For all reasonable loops, the head occurs before the tail in RPO.
@@ -1514,13 +1517,13 @@ CFGLoop* PhaseCFG::create_loop_tree() {
loop_head->_loop = nloop;
// Add to nloop so push_pred() will skip over inner loops
nloop->add_member(loop_head);
- nloop->push_pred(loop_head, LoopNode::LoopBackControl, worklist, _bbs);
+ nloop->push_pred(loop_head, LoopNode::LoopBackControl, worklist, this);
while (worklist.size() > 0) {
Block* member = worklist.pop();
if (member != loop_head) {
for (uint j = 1; j < member->num_preds(); j++) {
- nloop->push_pred(member, j, worklist, _bbs);
+ nloop->push_pred(member, j, worklist, this);
}
}
}
@@ -1557,9 +1560,9 @@ CFGLoop* PhaseCFG::create_loop_tree() {
}
//------------------------------push_pred--------------------------------------
-void CFGLoop::push_pred(Block* blk, int i, Block_List& worklist, Block_Array& node_to_blk) {
+void CFGLoop::push_pred(Block* blk, int i, Block_List& worklist, PhaseCFG* cfg) {
Node* pred_n = blk->pred(i);
- Block* pred = node_to_blk[pred_n->_idx];
+ Block* pred = cfg->get_block_for_node(pred_n);
CFGLoop *pred_loop = pred->_loop;
if (pred_loop == NULL) {
// Filter out blocks for non-single-entry loops.
@@ -1580,7 +1583,7 @@ void CFGLoop::push_pred(Block* blk, int i, Block_List& worklist, Block_Array& no
Block* pred_head = pred_loop->head();
assert(pred_head->num_preds() - 1 == 2, "loop must have 2 predecessors");
assert(pred_head != head(), "loop head in only one loop");
- push_pred(pred_head, LoopNode::EntryControl, worklist, node_to_blk);
+ push_pred(pred_head, LoopNode::EntryControl, worklist, cfg);
} else {
assert(pred_loop->_parent == this && _parent == NULL, "just checking");
}
diff --git a/hotspot/src/share/vm/opto/idealGraphPrinter.cpp b/hotspot/src/share/vm/opto/idealGraphPrinter.cpp
index e6909054324..4330643b8b5 100644
--- a/hotspot/src/share/vm/opto/idealGraphPrinter.cpp
+++ b/hotspot/src/share/vm/opto/idealGraphPrinter.cpp
@@ -413,9 +413,9 @@ void IdealGraphPrinter::visit_node(Node *n, bool edges, VectorSet* temp_set) {
print_prop("debug_idx", node->_debug_idx);
#endif
- if(C->cfg() != NULL) {
- Block *block = C->cfg()->_bbs[node->_idx];
- if(block == NULL) {
+ if (C->cfg() != NULL) {
+ Block* block = C->cfg()->get_block_for_node(node);
+ if (block == NULL) {
print_prop("block", C->cfg()->_blocks[0]->_pre_order);
} else {
print_prop("block", block->_pre_order);
diff --git a/hotspot/src/share/vm/opto/ifg.cpp b/hotspot/src/share/vm/opto/ifg.cpp
index 96c0957cffb..82a8ea893e4 100644
--- a/hotspot/src/share/vm/opto/ifg.cpp
+++ b/hotspot/src/share/vm/opto/ifg.cpp
@@ -565,7 +565,7 @@ uint PhaseChaitin::build_ifg_physical( ResourceArea *a ) {
lrgs(r)._def = 0;
}
n->disconnect_inputs(NULL, C);
- _cfg._bbs.map(n->_idx,NULL);
+ _cfg.unmap_node_from_block(n);
n->replace_by(C->top());
// Since yanking a Node from block, high pressure moves up one
hrp_index[0]--;
@@ -607,7 +607,7 @@ uint PhaseChaitin::build_ifg_physical( ResourceArea *a ) {
if( n->is_SpillCopy()
&& lrgs(r).is_singledef() // MultiDef live range can still split
&& n->outcnt() == 1 // and use must be in this block
- && _cfg._bbs[n->unique_out()->_idx] == b ) {
+ && _cfg.get_block_for_node(n->unique_out()) == b ) {
// All single-use MachSpillCopy(s) that immediately precede their
// use must color early. If a longer live range steals their
// color, the spill copy will split and may push another spill copy
diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp
index 2b3eca478d9..fc05a79b416 100644
--- a/hotspot/src/share/vm/opto/lcm.cpp
+++ b/hotspot/src/share/vm/opto/lcm.cpp
@@ -237,7 +237,7 @@ void Block::implicit_null_check(PhaseCFG *cfg, Node *proj, Node *val, int allowe
}
// Check ctrl input to see if the null-check dominates the memory op
- Block *cb = cfg->_bbs[mach->_idx];
+ Block *cb = cfg->get_block_for_node(mach);
cb = cb->_idom; // Always hoist at least 1 block
if( !was_store ) { // Stores can be hoisted only one block
while( cb->_dom_depth > (_dom_depth + 1))
@@ -262,7 +262,7 @@ void Block::implicit_null_check(PhaseCFG *cfg, Node *proj, Node *val, int allowe
if( is_decoden ) continue;
}
// Block of memory-op input
- Block *inb = cfg->_bbs[mach->in(j)->_idx];
+ Block *inb = cfg->get_block_for_node(mach->in(j));
Block *b = this; // Start from nul check
while( b != inb && b->_dom_depth > inb->_dom_depth )
b = b->_idom; // search upwards for input
@@ -272,7 +272,7 @@ void Block::implicit_null_check(PhaseCFG *cfg, Node *proj, Node *val, int allowe
}
if( j > 0 )
continue;
- Block *mb = cfg->_bbs[mach->_idx];
+ Block *mb = cfg->get_block_for_node(mach);
// Hoisting stores requires more checks for the anti-dependence case.
// Give up hoisting if we have to move the store past any load.
if( was_store ) {
@@ -291,7 +291,7 @@ void Block::implicit_null_check(PhaseCFG *cfg, Node *proj, Node *val, int allowe
break; // Found anti-dependent load
// Make sure control does not do a merge (would have to check allpaths)
if( b->num_preds() != 2 ) break;
- b = cfg->_bbs[b->pred(1)->_idx]; // Move up to predecessor block
+ b = cfg->get_block_for_node(b->pred(1)); // Move up to predecessor block
}
if( b != this ) continue;
}
@@ -303,15 +303,15 @@ void Block::implicit_null_check(PhaseCFG *cfg, Node *proj, Node *val, int allowe
// Found a candidate! Pick one with least dom depth - the highest
// in the dom tree should be closest to the null check.
- if( !best ||
- cfg->_bbs[mach->_idx]->_dom_depth < cfg->_bbs[best->_idx]->_dom_depth ) {
+ if (best == NULL || cfg->get_block_for_node(mach)->_dom_depth < cfg->get_block_for_node(best)->_dom_depth) {
best = mach;
bidx = vidx;
-
}
}
// No candidate!
- if( !best ) return;
+ if (best == NULL) {
+ return;
+ }
// ---- Found an implicit null check
extern int implicit_null_checks;
@@ -319,29 +319,29 @@ void Block::implicit_null_check(PhaseCFG *cfg, Node *proj, Node *val, int allowe
if( is_decoden ) {
// Check if we need to hoist decodeHeapOop_not_null first.
- Block *valb = cfg->_bbs[val->_idx];
+ Block *valb = cfg->get_block_for_node(val);
if( this != valb && this->_dom_depth < valb->_dom_depth ) {
// Hoist it up to the end of the test block.
valb->find_remove(val);
this->add_inst(val);
- cfg->_bbs.map(val->_idx,this);
+ cfg->map_node_to_block(val, this);
// DecodeN on x86 may kill flags. Check for flag-killing projections
// that also need to be hoisted.
for (DUIterator_Fast jmax, j = val->fast_outs(jmax); j < jmax; j++) {
Node* n = val->fast_out(j);
if( n->is_MachProj() ) {
- cfg->_bbs[n->_idx]->find_remove(n);
+ cfg->get_block_for_node(n)->find_remove(n);
this->add_inst(n);
- cfg->_bbs.map(n->_idx,this);
+ cfg->map_node_to_block(n, this);
}
}
}
}
// Hoist the memory candidate up to the end of the test block.
- Block *old_block = cfg->_bbs[best->_idx];
+ Block *old_block = cfg->get_block_for_node(best);
old_block->find_remove(best);
add_inst(best);
- cfg->_bbs.map(best->_idx,this);
+ cfg->map_node_to_block(best, this);
// Move the control dependence
if (best->in(0) && best->in(0) == old_block->_nodes[0])
@@ -352,9 +352,9 @@ void Block::implicit_null_check(PhaseCFG *cfg, Node *proj, Node *val, int allowe
for (DUIterator_Fast jmax, j = best->fast_outs(jmax); j < jmax; j++) {
Node* n = best->fast_out(j);
if( n->is_MachProj() ) {
- cfg->_bbs[n->_idx]->find_remove(n);
+ cfg->get_block_for_node(n)->find_remove(n);
add_inst(n);
- cfg->_bbs.map(n->_idx,this);
+ cfg->map_node_to_block(n, this);
}
}
@@ -385,7 +385,7 @@ void Block::implicit_null_check(PhaseCFG *cfg, Node *proj, Node *val, int allowe
Node *old_tst = proj->in(0);
MachNode *nul_chk = new (C) MachNullCheckNode(old_tst->in(0),best,bidx);
_nodes.map(end_idx(),nul_chk);
- cfg->_bbs.map(nul_chk->_idx,this);
+ cfg->map_node_to_block(nul_chk, this);
// Redirect users of old_test to nul_chk
for (DUIterator_Last i2min, i2 = old_tst->last_outs(i2min); i2 >= i2min; --i2)
old_tst->last_out(i2)->set_req(0, nul_chk);
@@ -468,7 +468,7 @@ Node *Block::select(PhaseCFG *cfg, Node_List &worklist, GrowableArray &read
Node* use = n->fast_out(j);
// The use is a conditional branch, make them adjacent
- if (use->is_MachIf() && cfg->_bbs[use->_idx]==this ) {
+ if (use->is_MachIf() && cfg->get_block_for_node(use) == this) {
found_machif = true;
break;
}
@@ -529,13 +529,14 @@ Node *Block::select(PhaseCFG *cfg, Node_List &worklist, GrowableArray &read
//------------------------------set_next_call----------------------------------
-void Block::set_next_call( Node *n, VectorSet &next_call, Block_Array &bbs ) {
+void Block::set_next_call( Node *n, VectorSet &next_call, PhaseCFG* cfg) {
if( next_call.test_set(n->_idx) ) return;
for( uint i=0; ilen(); i++ ) {
Node *m = n->in(i);
if( !m ) continue; // must see all nodes in block that precede call
- if( bbs[m->_idx] == this )
- set_next_call( m, next_call, bbs );
+ if (cfg->get_block_for_node(m) == this) {
+ set_next_call(m, next_call, cfg);
+ }
}
}
@@ -545,12 +546,12 @@ void Block::set_next_call( Node *n, VectorSet &next_call, Block_Array &bbs ) {
// next subroutine call get priority - basically it moves things NOT needed
// for the next call till after the call. This prevents me from trying to
// carry lots of stuff live across a call.
-void Block::needed_for_next_call(Node *this_call, VectorSet &next_call, Block_Array &bbs) {
+void Block::needed_for_next_call(Node *this_call, VectorSet &next_call, PhaseCFG* cfg) {
// Find the next control-defining Node in this block
Node* call = NULL;
for (DUIterator_Fast imax, i = this_call->fast_outs(imax); i < imax; i++) {
Node* m = this_call->fast_out(i);
- if( bbs[m->_idx] == this && // Local-block user
+ if(cfg->get_block_for_node(m) == this && // Local-block user
m != this_call && // Not self-start node
m->is_MachCall() )
call = m;
@@ -558,7 +559,7 @@ void Block::needed_for_next_call(Node *this_call, VectorSet &next_call, Block_Ar
}
if (call == NULL) return; // No next call (e.g., block end is near)
// Set next-call for all inputs to this call
- set_next_call(call, next_call, bbs);
+ set_next_call(call, next_call, cfg);
}
//------------------------------add_call_kills-------------------------------------
@@ -578,7 +579,7 @@ void Block::add_call_kills(MachProjNode *proj, RegMask& regs, const char* save_p
//------------------------------sched_call-------------------------------------
-uint Block::sched_call( Matcher &matcher, Block_Array &bbs, uint node_cnt, Node_List &worklist, GrowableArray &ready_cnt, MachCallNode *mcall, VectorSet &next_call ) {
+uint Block::sched_call( Matcher &matcher, PhaseCFG* cfg, uint node_cnt, Node_List &worklist, GrowableArray &ready_cnt, MachCallNode *mcall, VectorSet &next_call ) {
RegMask regs;
// Schedule all the users of the call right now. All the users are
@@ -597,12 +598,14 @@ uint Block::sched_call( Matcher &matcher, Block_Array &bbs, uint node_cnt, Node_
// Check for scheduling the next control-definer
if( n->bottom_type() == Type::CONTROL )
// Warm up next pile of heuristic bits
- needed_for_next_call(n, next_call, bbs);
+ needed_for_next_call(n, next_call, cfg);
// Children of projections are now all ready
for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) {
Node* m = n->fast_out(j); // Get user
- if( bbs[m->_idx] != this ) continue;
+ if(cfg->get_block_for_node(m) != this) {
+ continue;
+ }
if( m->is_Phi() ) continue;
int m_cnt = ready_cnt.at(m->_idx)-1;
ready_cnt.at_put(m->_idx, m_cnt);
@@ -620,7 +623,7 @@ uint Block::sched_call( Matcher &matcher, Block_Array &bbs, uint node_cnt, Node_
uint r_cnt = mcall->tf()->range()->cnt();
int op = mcall->ideal_Opcode();
MachProjNode *proj = new (matcher.C) MachProjNode( mcall, r_cnt+1, RegMask::Empty, MachProjNode::fat_proj );
- bbs.map(proj->_idx,this);
+ cfg->map_node_to_block(proj, this);
_nodes.insert(node_cnt++, proj);
// Select the right register save policy.
@@ -708,7 +711,7 @@ bool Block::schedule_local(PhaseCFG *cfg, Matcher &matcher, GrowableArray &
uint local = 0;
for( uint j=0; jin(j);
- if( m && cfg->_bbs[m->_idx] == this && !m->is_top() )
+ if( m && cfg->get_block_for_node(m) == this && !m->is_top() )
local++; // One more block-local input
}
ready_cnt.at_put(n->_idx, local); // Count em up
@@ -720,7 +723,7 @@ bool Block::schedule_local(PhaseCFG *cfg, Matcher &matcher, GrowableArray &
for (uint prec = n->req(); prec < n->len(); prec++) {
Node* oop_store = n->in(prec);
if (oop_store != NULL) {
- assert(cfg->_bbs[oop_store->_idx]->_dom_depth <= this->_dom_depth, "oop_store must dominate card-mark");
+ assert(cfg->get_block_for_node(oop_store)->_dom_depth <= this->_dom_depth, "oop_store must dominate card-mark");
}
}
}
@@ -753,7 +756,7 @@ bool Block::schedule_local(PhaseCFG *cfg, Matcher &matcher, GrowableArray &
Node *n = _nodes[i3]; // Get pre-scheduled
for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) {
Node* m = n->fast_out(j);
- if( cfg->_bbs[m->_idx] ==this ) { // Local-block user
+ if (cfg->get_block_for_node(m) == this) { // Local-block user
int m_cnt = ready_cnt.at(m->_idx)-1;
ready_cnt.at_put(m->_idx, m_cnt); // Fix ready count
}
@@ -786,7 +789,7 @@ bool Block::schedule_local(PhaseCFG *cfg, Matcher &matcher, GrowableArray &
}
// Warm up the 'next_call' heuristic bits
- needed_for_next_call(_nodes[0], next_call, cfg->_bbs);
+ needed_for_next_call(_nodes[0], next_call, cfg);
#ifndef PRODUCT
if (cfg->trace_opto_pipelining()) {
@@ -837,7 +840,7 @@ bool Block::schedule_local(PhaseCFG *cfg, Matcher &matcher, GrowableArray &
#endif
if( n->is_MachCall() ) {
MachCallNode *mcall = n->as_MachCall();
- phi_cnt = sched_call(matcher, cfg->_bbs, phi_cnt, worklist, ready_cnt, mcall, next_call);
+ phi_cnt = sched_call(matcher, cfg, phi_cnt, worklist, ready_cnt, mcall, next_call);
continue;
}
@@ -847,7 +850,7 @@ bool Block::schedule_local(PhaseCFG *cfg, Matcher &matcher, GrowableArray &
regs.OR(n->out_RegMask());
MachProjNode *proj = new (matcher.C) MachProjNode( n, 1, RegMask::Empty, MachProjNode::fat_proj );
- cfg->_bbs.map(proj->_idx,this);
+ cfg->map_node_to_block(proj, this);
_nodes.insert(phi_cnt++, proj);
add_call_kills(proj, regs, matcher._c_reg_save_policy, false);
@@ -856,7 +859,9 @@ bool Block::schedule_local(PhaseCFG *cfg, Matcher &matcher, GrowableArray &
// Children are now all ready
for (DUIterator_Fast i5max, i5 = n->fast_outs(i5max); i5 < i5max; i5++) {
Node* m = n->fast_out(i5); // Get user
- if( cfg->_bbs[m->_idx] != this ) continue;
+ if (cfg->get_block_for_node(m) != this) {
+ continue;
+ }
if( m->is_Phi() ) continue;
if (m->_idx >= max_idx) { // new node, skip it
assert(m->is_MachProj() && n->is_Mach() && n->as_Mach()->has_call(), "unexpected node types");
@@ -914,7 +919,7 @@ static void catch_cleanup_fix_all_inputs(Node *use, Node *old_def, Node *new_def
}
//------------------------------catch_cleanup_find_cloned_def------------------
-static Node *catch_cleanup_find_cloned_def(Block *use_blk, Node *def, Block *def_blk, Block_Array &bbs, int n_clone_idx) {
+static Node *catch_cleanup_find_cloned_def(Block *use_blk, Node *def, Block *def_blk, PhaseCFG* cfg, int n_clone_idx) {
assert( use_blk != def_blk, "Inter-block cleanup only");
// The use is some block below the Catch. Find and return the clone of the def
@@ -940,7 +945,8 @@ static Node *catch_cleanup_find_cloned_def(Block *use_blk, Node *def, Block *def
// PhiNode, the PhiNode uses from the def and IT's uses need fixup.
Node_Array inputs = new Node_List(Thread::current()->resource_area());
for(uint k = 1; k < use_blk->num_preds(); k++) {
- inputs.map(k, catch_cleanup_find_cloned_def(bbs[use_blk->pred(k)->_idx], def, def_blk, bbs, n_clone_idx));
+ Block* block = cfg->get_block_for_node(use_blk->pred(k));
+ inputs.map(k, catch_cleanup_find_cloned_def(block, def, def_blk, cfg, n_clone_idx));
}
// Check to see if the use_blk already has an identical phi inserted.
@@ -962,7 +968,7 @@ static Node *catch_cleanup_find_cloned_def(Block *use_blk, Node *def, Block *def
if (fixup == NULL) {
Node *new_phi = PhiNode::make(use_blk->head(), def);
use_blk->_nodes.insert(1, new_phi);
- bbs.map(new_phi->_idx, use_blk);
+ cfg->map_node_to_block(new_phi, use_blk);
for (uint k = 1; k < use_blk->num_preds(); k++) {
new_phi->set_req(k, inputs[k]);
}
@@ -1002,17 +1008,17 @@ static void catch_cleanup_intra_block(Node *use, Node *def, Block *blk, int beg,
//------------------------------catch_cleanup_inter_block---------------------
// Fix all input edges in use that reference "def". The use is in a different
// block than the def.
-static void catch_cleanup_inter_block(Node *use, Block *use_blk, Node *def, Block *def_blk, Block_Array &bbs, int n_clone_idx) {
+static void catch_cleanup_inter_block(Node *use, Block *use_blk, Node *def, Block *def_blk, PhaseCFG* cfg, int n_clone_idx) {
if( !use_blk ) return; // Can happen if the use is a precedence edge
- Node *new_def = catch_cleanup_find_cloned_def(use_blk, def, def_blk, bbs, n_clone_idx);
+ Node *new_def = catch_cleanup_find_cloned_def(use_blk, def, def_blk, cfg, n_clone_idx);
catch_cleanup_fix_all_inputs(use, def, new_def);
}
//------------------------------call_catch_cleanup-----------------------------
// If we inserted any instructions between a Call and his CatchNode,
// clone the instructions on all paths below the Catch.
-void Block::call_catch_cleanup(Block_Array &bbs, Compile* C) {
+void Block::call_catch_cleanup(PhaseCFG* cfg, Compile* C) {
// End of region to clone
uint end = end_idx();
@@ -1037,7 +1043,7 @@ void Block::call_catch_cleanup(Block_Array &bbs, Compile* C) {
// since clones dominate on each path.
Node *clone = _nodes[j-1]->clone();
sb->_nodes.insert( 1, clone );
- bbs.map(clone->_idx,sb);
+ cfg->map_node_to_block(clone, sb);
}
}
@@ -1054,18 +1060,19 @@ void Block::call_catch_cleanup(Block_Array &bbs, Compile* C) {
uint max = out->size();
for (uint j = 0; j < max; j++) {// For all users
Node *use = out->pop();
- Block *buse = bbs[use->_idx];
+ Block *buse = cfg->get_block_for_node(use);
if( use->is_Phi() ) {
for( uint k = 1; k < use->req(); k++ )
if( use->in(k) == n ) {
- Node *fixup = catch_cleanup_find_cloned_def(bbs[buse->pred(k)->_idx], n, this, bbs, n_clone_idx);
+ Block* block = cfg->get_block_for_node(buse->pred(k));
+ Node *fixup = catch_cleanup_find_cloned_def(block, n, this, cfg, n_clone_idx);
use->set_req(k, fixup);
}
} else {
if (this == buse) {
catch_cleanup_intra_block(use, n, this, beg, n_clone_idx);
} else {
- catch_cleanup_inter_block(use, buse, n, this, bbs, n_clone_idx);
+ catch_cleanup_inter_block(use, buse, n, this, cfg, n_clone_idx);
}
}
} // End for all users
diff --git a/hotspot/src/share/vm/opto/live.cpp b/hotspot/src/share/vm/opto/live.cpp
index 773dd1ea2e6..846609e8a49 100644
--- a/hotspot/src/share/vm/opto/live.cpp
+++ b/hotspot/src/share/vm/opto/live.cpp
@@ -101,7 +101,7 @@ void PhaseLive::compute(uint maxlrg) {
for( uint k=1; kin(k);
uint nkidx = nk->_idx;
- if( _cfg._bbs[nkidx] != b ) {
+ if (_cfg.get_block_for_node(nk) != b) {
uint u = _names[nkidx];
use->insert( u );
DEBUG_ONLY(def_outside->insert( u );)
@@ -121,7 +121,7 @@ void PhaseLive::compute(uint maxlrg) {
// Push these live-in things to predecessors
for( uint l=1; lnum_preds(); l++ ) {
- Block *p = _cfg._bbs[b->pred(l)->_idx];
+ Block *p = _cfg.get_block_for_node(b->pred(l));
add_liveout( p, use, first_pass );
// PhiNode uses go in the live-out set of prior blocks.
@@ -142,8 +142,10 @@ void PhaseLive::compute(uint maxlrg) {
assert( delta->count(), "missing delta set" );
// Add new-live-in to predecessors live-out sets
- for( uint l=1; lnum_preds(); l++ )
- add_liveout( _cfg._bbs[b->pred(l)->_idx], delta, first_pass );
+ for (uint l = 1; l < b->num_preds(); l++) {
+ Block* block = _cfg.get_block_for_node(b->pred(l));
+ add_liveout(block, delta, first_pass);
+ }
freeset(b);
} // End of while-worklist-not-empty
diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp
index c438cf9b880..a30fc80df39 100644
--- a/hotspot/src/share/vm/opto/loopTransform.cpp
+++ b/hotspot/src/share/vm/opto/loopTransform.cpp
@@ -624,8 +624,6 @@ bool IdealLoopTree::policy_maximally_unroll( PhaseIdealLoop *phase ) const {
}
-#define MAX_UNROLL 16 // maximum number of unrolls for main loop
-
//------------------------------policy_unroll----------------------------------
// Return TRUE or FALSE if the loop should be unrolled or not. Unroll if
// the loop is a CountedLoop and the body is small enough.
@@ -642,7 +640,7 @@ bool IdealLoopTree::policy_unroll( PhaseIdealLoop *phase ) const {
if (cl->trip_count() <= (uint)(cl->is_normal_loop() ? 2 : 1)) return false;
int future_unroll_ct = cl->unrolled_count() * 2;
- if (future_unroll_ct > MAX_UNROLL) return false;
+ if (future_unroll_ct > LoopMaxUnroll) return false;
// Check for initial stride being a small enough constant
if (abs(cl->stride_con()) > (1<<2)*future_unroll_ct) return false;
diff --git a/hotspot/src/share/vm/opto/node.hpp b/hotspot/src/share/vm/opto/node.hpp
index bb5e8f200d0..0690d21b122 100644
--- a/hotspot/src/share/vm/opto/node.hpp
+++ b/hotspot/src/share/vm/opto/node.hpp
@@ -42,7 +42,6 @@ class AliasInfo;
class AllocateArrayNode;
class AllocateNode;
class Block;
-class Block_Array;
class BoolNode;
class BoxLockNode;
class CMoveNode;
diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp
index f04ab721b97..24a4497c680 100644
--- a/hotspot/src/share/vm/opto/output.cpp
+++ b/hotspot/src/share/vm/opto/output.cpp
@@ -68,7 +68,6 @@ void Compile::Output() {
return;
}
// Make sure I can find the Start Node
- Block_Array& bbs = _cfg->_bbs;
Block *entry = _cfg->_blocks[1];
Block *broot = _cfg->_broot;
@@ -77,8 +76,8 @@ void Compile::Output() {
// Replace StartNode with prolog
MachPrologNode *prolog = new (this) MachPrologNode();
entry->_nodes.map( 0, prolog );
- bbs.map( prolog->_idx, entry );
- bbs.map( start->_idx, NULL ); // start is no longer in any block
+ _cfg->map_node_to_block(prolog, entry);
+ _cfg->unmap_node_from_block(start); // start is no longer in any block
// Virtual methods need an unverified entry point
@@ -117,8 +116,7 @@ void Compile::Output() {
if( m->is_Mach() && m->as_Mach()->ideal_Opcode() != Op_Halt ) {
MachEpilogNode *epilog = new (this) MachEpilogNode(m->as_Mach()->ideal_Opcode() == Op_Return);
b->add_inst( epilog );
- bbs.map(epilog->_idx, b);
- //_regalloc->set_bad(epilog->_idx); // Already initialized this way.
+ _cfg->map_node_to_block(epilog, b);
}
}
}
@@ -252,7 +250,7 @@ void Compile::Insert_zap_nodes() {
if (insert) {
Node *zap = call_zap_node(n->as_MachSafePoint(), i);
b->_nodes.insert( j, zap );
- _cfg->_bbs.map( zap->_idx, b );
+ _cfg->map_node_to_block(zap, b);
++j;
}
}
@@ -1234,7 +1232,7 @@ void Compile::fill_buffer(CodeBuffer* cb, uint* blk_starts) {
#ifdef ASSERT
if (!b->is_connector()) {
stringStream st;
- b->dump_head(&_cfg->_bbs, &st);
+ b->dump_head(_cfg, &st);
MacroAssembler(cb).block_comment(st.as_string());
}
jmp_target[i] = 0;
@@ -1310,7 +1308,7 @@ void Compile::fill_buffer(CodeBuffer* cb, uint* blk_starts) {
MachNode *nop = new (this) MachNopNode(nops_cnt);
b->_nodes.insert(j++, nop);
last_inst++;
- _cfg->_bbs.map( nop->_idx, b );
+ _cfg->map_node_to_block(nop, b);
nop->emit(*cb, _regalloc);
cb->flush_bundle(true);
current_offset = cb->insts_size();
@@ -1395,7 +1393,7 @@ void Compile::fill_buffer(CodeBuffer* cb, uint* blk_starts) {
if (needs_padding && replacement->avoid_back_to_back()) {
MachNode *nop = new (this) MachNopNode();
b->_nodes.insert(j++, nop);
- _cfg->_bbs.map(nop->_idx, b);
+ _cfg->map_node_to_block(nop, b);
last_inst++;
nop->emit(*cb, _regalloc);
cb->flush_bundle(true);
@@ -1549,7 +1547,7 @@ void Compile::fill_buffer(CodeBuffer* cb, uint* blk_starts) {
if( padding > 0 ) {
MachNode *nop = new (this) MachNopNode(padding / nop_size);
b->_nodes.insert( b->_nodes.size(), nop );
- _cfg->_bbs.map( nop->_idx, b );
+ _cfg->map_node_to_block(nop, b);
nop->emit(*cb, _regalloc);
current_offset = cb->insts_size();
}
@@ -1737,7 +1735,6 @@ uint Scheduling::_total_instructions_per_bundle[Pipeline::_max_instrs_per_cycle+
Scheduling::Scheduling(Arena *arena, Compile &compile)
: _arena(arena),
_cfg(compile.cfg()),
- _bbs(compile.cfg()->_bbs),
_regalloc(compile.regalloc()),
_reg_node(arena),
_bundle_instr_count(0),
@@ -2085,8 +2082,9 @@ void Scheduling::DecrementUseCounts(Node *n, const Block *bb) {
if( def->is_Proj() ) // If this is a machine projection, then
def = def->in(0); // propagate usage thru to the base instruction
- if( _bbs[def->_idx] != bb ) // Ignore if not block-local
+ if(_cfg->get_block_for_node(def) != bb) { // Ignore if not block-local
continue;
+ }
// Compute the latency
uint l = _bundle_cycle_number + n->latency(i);
@@ -2358,9 +2356,10 @@ void Scheduling::ComputeUseCount(const Block *bb) {
Node *inp = n->in(k);
if (!inp) continue;
assert(inp != n, "no cycles allowed" );
- if( _bbs[inp->_idx] == bb ) { // Block-local use?
- if( inp->is_Proj() ) // Skip through Proj's
+ if (_cfg->get_block_for_node(inp) == bb) { // Block-local use?
+ if (inp->is_Proj()) { // Skip through Proj's
inp = inp->in(0);
+ }
++_uses[inp->_idx]; // Count 1 block-local use
}
}
@@ -2643,7 +2642,7 @@ void Scheduling::anti_do_def( Block *b, Node *def, OptoReg::Name def_reg, int is
return;
Node *pinch = _reg_node[def_reg]; // Get pinch point
- if( !pinch || _bbs[pinch->_idx] != b || // No pinch-point yet?
+ if ((pinch == NULL) || _cfg->get_block_for_node(pinch) != b || // No pinch-point yet?
is_def ) { // Check for a true def (not a kill)
_reg_node.map(def_reg,def); // Record def/kill as the optimistic pinch-point
return;
@@ -2669,7 +2668,7 @@ void Scheduling::anti_do_def( Block *b, Node *def, OptoReg::Name def_reg, int is
_cfg->C->record_method_not_compilable("too many D-U pinch points");
return;
}
- _bbs.map(pinch->_idx,b); // Pretend it's valid in this block (lazy init)
+ _cfg->map_node_to_block(pinch, b); // Pretend it's valid in this block (lazy init)
_reg_node.map(def_reg,pinch); // Record pinch-point
//_regalloc->set_bad(pinch->_idx); // Already initialized this way.
if( later_def->outcnt() == 0 || later_def->ideal_reg() == MachProjNode::fat_proj ) { // Distinguish def from kill
@@ -2713,9 +2712,9 @@ void Scheduling::anti_do_use( Block *b, Node *use, OptoReg::Name use_reg ) {
return;
Node *pinch = _reg_node[use_reg]; // Get pinch point
// Check for no later def_reg/kill in block
- if( pinch && _bbs[pinch->_idx] == b &&
+ if ((pinch != NULL) && _cfg->get_block_for_node(pinch) == b &&
// Use has to be block-local as well
- _bbs[use->_idx] == b ) {
+ _cfg->get_block_for_node(use) == b) {
if( pinch->Opcode() == Op_Node && // Real pinch-point (not optimistic?)
pinch->req() == 1 ) { // pinch not yet in block?
pinch->del_req(0); // yank pointer to later-def, also set flag
@@ -2895,7 +2894,7 @@ void Scheduling::garbage_collect_pinch_nodes() {
int trace_cnt = 0;
for (uint k = 0; k < _reg_node.Size(); k++) {
Node* pinch = _reg_node[k];
- if (pinch != NULL && pinch->Opcode() == Op_Node &&
+ if ((pinch != NULL) && pinch->Opcode() == Op_Node &&
// no predecence input edges
(pinch->req() == pinch->len() || pinch->in(pinch->req()) == NULL) ) {
cleanup_pinch(pinch);
diff --git a/hotspot/src/share/vm/opto/output.hpp b/hotspot/src/share/vm/opto/output.hpp
index 50b6e76035e..5fb68c6828a 100644
--- a/hotspot/src/share/vm/opto/output.hpp
+++ b/hotspot/src/share/vm/opto/output.hpp
@@ -96,9 +96,6 @@ private:
// List of nodes currently available for choosing for scheduling
Node_List _available;
- // Mapping from node (index) to basic block
- Block_Array& _bbs;
-
// For each instruction beginning a bundle, the number of following
// nodes to be bundled with it.
Bundle *_node_bundling_base;
diff --git a/hotspot/src/share/vm/opto/postaloc.cpp b/hotspot/src/share/vm/opto/postaloc.cpp
index c1b3fdbd231..76c3def2d40 100644
--- a/hotspot/src/share/vm/opto/postaloc.cpp
+++ b/hotspot/src/share/vm/opto/postaloc.cpp
@@ -78,11 +78,13 @@ bool PhaseChaitin::may_be_copy_of_callee( Node *def ) const {
// Helper function for yank_if_dead
int PhaseChaitin::yank( Node *old, Block *current_block, Node_List *value, Node_List *regnd ) {
int blk_adjust=0;
- Block *oldb = _cfg._bbs[old->_idx];
+ Block *oldb = _cfg.get_block_for_node(old);
oldb->find_remove(old);
// Count 1 if deleting an instruction from the current block
- if( oldb == current_block ) blk_adjust++;
- _cfg._bbs.map(old->_idx,NULL);
+ if (oldb == current_block) {
+ blk_adjust++;
+ }
+ _cfg.unmap_node_from_block(old);
OptoReg::Name old_reg = lrgs(_lrg_map.live_range_id(old)).reg();
if( regnd && (*regnd)[old_reg]==old ) { // Instruction is currently available?
value->map(old_reg,NULL); // Yank from value/regnd maps
@@ -433,7 +435,7 @@ void PhaseChaitin::post_allocate_copy_removal() {
bool missing_some_inputs = false;
Block *freed = NULL;
for( j = 1; j < b->num_preds(); j++ ) {
- Block *pb = _cfg._bbs[b->pred(j)->_idx];
+ Block *pb = _cfg.get_block_for_node(b->pred(j));
// Remove copies along phi edges
for( uint k=1; k_nodes[k], j, b, *blk2value[pb->_pre_order], *blk2regnd[pb->_pre_order], false );
@@ -478,7 +480,7 @@ void PhaseChaitin::post_allocate_copy_removal() {
} else {
if( !freed ) { // Didn't get a freebie prior block
// Must clone some data
- freed = _cfg._bbs[b->pred(1)->_idx];
+ freed = _cfg.get_block_for_node(b->pred(1));
Node_List &f_value = *blk2value[freed->_pre_order];
Node_List &f_regnd = *blk2regnd[freed->_pre_order];
for( uint k = 0; k < (uint)_max_reg; k++ ) {
@@ -488,7 +490,7 @@ void PhaseChaitin::post_allocate_copy_removal() {
}
// Merge all inputs together, setting to NULL any conflicts.
for( j = 1; j < b->num_preds(); j++ ) {
- Block *pb = _cfg._bbs[b->pred(j)->_idx];
+ Block *pb = _cfg.get_block_for_node(b->pred(j));
if( pb == freed ) continue; // Did self already via freelist
Node_List &p_regnd = *blk2regnd[pb->_pre_order];
for( uint k = 0; k < (uint)_max_reg; k++ ) {
@@ -515,8 +517,9 @@ void PhaseChaitin::post_allocate_copy_removal() {
u = u ? NodeSentinel : x; // Capture unique input, or NodeSentinel for 2nd input
}
if( u != NodeSentinel ) { // Junk Phi. Remove
- b->_nodes.remove(j--); phi_dex--;
- _cfg._bbs.map(phi->_idx,NULL);
+ b->_nodes.remove(j--);
+ phi_dex--;
+ _cfg.unmap_node_from_block(phi);
phi->replace_by(u);
phi->disconnect_inputs(NULL, C);
continue;
diff --git a/hotspot/src/share/vm/opto/reg_split.cpp b/hotspot/src/share/vm/opto/reg_split.cpp
index 30ac26ba989..6e4323b406e 100644
--- a/hotspot/src/share/vm/opto/reg_split.cpp
+++ b/hotspot/src/share/vm/opto/reg_split.cpp
@@ -132,7 +132,7 @@ void PhaseChaitin::insert_proj( Block *b, uint i, Node *spill, uint maxlrg ) {
}
b->_nodes.insert(i,spill); // Insert node in block
- _cfg._bbs.map(spill->_idx,b); // Update node->block mapping to reflect
+ _cfg.map_node_to_block(spill, b); // Update node->block mapping to reflect
// Adjust the point where we go hi-pressure
if( i <= b->_ihrp_index ) b->_ihrp_index++;
if( i <= b->_fhrp_index ) b->_fhrp_index++;
@@ -219,7 +219,7 @@ uint PhaseChaitin::split_USE( Node *def, Block *b, Node *use, uint useidx, uint
use->set_req(useidx, def);
} else {
// Block and index where the use occurs.
- Block *b = _cfg._bbs[use->_idx];
+ Block *b = _cfg.get_block_for_node(use);
// Put the clone just prior to use
int bindex = b->find_node(use);
// DEF is UP, so must copy it DOWN and hook in USE
@@ -270,7 +270,7 @@ uint PhaseChaitin::split_USE( Node *def, Block *b, Node *use, uint useidx, uint
int bindex;
// Phi input spill-copys belong at the end of the prior block
if( use->is_Phi() ) {
- b = _cfg._bbs[b->pred(useidx)->_idx];
+ b = _cfg.get_block_for_node(b->pred(useidx));
bindex = b->end_idx();
} else {
// Put the clone just prior to use
@@ -335,7 +335,7 @@ Node *PhaseChaitin::split_Rematerialize( Node *def, Block *b, uint insidx, uint
continue;
}
- Block *b_def = _cfg._bbs[def->_idx];
+ Block *b_def = _cfg.get_block_for_node(def);
int idx_def = b_def->find_node(def);
Node *in_spill = get_spillcopy_wide( in, def, i );
if( !in_spill ) return 0; // Bailed out
@@ -589,7 +589,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
UPblock[slidx] = true;
// Record following instruction in case 'n' rematerializes and
// kills flags
- Block *pred1 = _cfg._bbs[b->pred(1)->_idx];
+ Block *pred1 = _cfg.get_block_for_node(b->pred(1));
continue;
}
@@ -601,7 +601,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
// Grab predecessor block header
n1 = b->pred(1);
// Grab the appropriate reaching def info for inpidx
- pred = _cfg._bbs[n1->_idx];
+ pred = _cfg.get_block_for_node(n1);
pidx = pred->_pre_order;
Node **Ltmp = Reaches[pidx];
bool *Utmp = UP[pidx];
@@ -616,7 +616,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
// Grab predecessor block headers
n2 = b->pred(inpidx);
// Grab the appropriate reaching def info for inpidx
- pred = _cfg._bbs[n2->_idx];
+ pred = _cfg.get_block_for_node(n2);
pidx = pred->_pre_order;
Ltmp = Reaches[pidx];
Utmp = UP[pidx];
@@ -701,7 +701,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
// Grab predecessor block header
n1 = b->pred(1);
// Grab the appropriate reaching def info for k
- pred = _cfg._bbs[n1->_idx];
+ pred = _cfg.get_block_for_node(n1);
pidx = pred->_pre_order;
Node **Ltmp = Reaches[pidx];
bool *Utmp = UP[pidx];
@@ -919,7 +919,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
return 0;
}
_lrg_map.extend(def->_idx, 0);
- _cfg._bbs.map(def->_idx,b);
+ _cfg.map_node_to_block(def, b);
n->set_req(inpidx, def);
continue;
}
@@ -1291,7 +1291,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
for( insidx = 0; insidx < phis->size(); insidx++ ) {
Node *phi = phis->at(insidx);
assert(phi->is_Phi(),"This list must only contain Phi Nodes");
- Block *b = _cfg._bbs[phi->_idx];
+ Block *b = _cfg.get_block_for_node(phi);
// Grab the live range number
uint lidx = _lrg_map.find_id(phi);
uint slidx = lrg2reach[lidx];
@@ -1315,7 +1315,7 @@ uint PhaseChaitin::Split(uint maxlrg, ResourceArea* split_arena) {
// DEF has the wrong UP/DOWN value.
for( uint i = 1; i < b->num_preds(); i++ ) {
// Get predecessor block pre-order number
- Block *pred = _cfg._bbs[b->pred(i)->_idx];
+ Block *pred = _cfg.get_block_for_node(b->pred(i));
pidx = pred->_pre_order;
// Grab reaching def
Node *def = Reaches[pidx][slidx];
diff --git a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp
index 877ed0e02fb..c6ec25f1406 100644
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp
@@ -3217,15 +3217,6 @@ void VM_RedefineClasses::redefine_single_class(jclass the_jclass,
JvmtiBreakpoints& jvmti_breakpoints = JvmtiCurrentBreakpoints::get_jvmti_breakpoints();
jvmti_breakpoints.clearall_in_class_at_safepoint(the_class_oop);
- if (the_class_oop == Universe::reflect_invoke_cache()->klass()) {
- // We are redefining java.lang.reflect.Method. Method.invoke() is
- // cached and users of the cache care about each active version of
- // the method so we have to track this previous version.
- // Do this before methods get switched
- Universe::reflect_invoke_cache()->add_previous_version(
- the_class->method_with_idnum(Universe::reflect_invoke_cache()->method_idnum()));
- }
-
// Deoptimize all compiled code that depends on this class
flush_dependent_code(the_class, THREAD);
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
index a507c83a511..0662b6912b9 100644
--- a/hotspot/src/share/vm/runtime/arguments.cpp
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
@@ -60,6 +60,28 @@
#define DEFAULT_VENDOR_URL_BUG "http://bugreport.sun.com/bugreport/crash.jsp"
#define DEFAULT_JAVA_LAUNCHER "generic"
+// Disable options not supported in this release, with a warning if they
+// were explicitly requested on the command-line
+#define UNSUPPORTED_OPTION(opt, description) \
+do { \
+ if (opt) { \
+ if (FLAG_IS_CMDLINE(opt)) { \
+ warning(description " is disabled in this release."); \
+ } \
+ FLAG_SET_DEFAULT(opt, false); \
+ } \
+} while(0)
+
+#define UNSUPPORTED_GC_OPTION(gc) \
+do { \
+ if (gc) { \
+ if (FLAG_IS_CMDLINE(gc)) { \
+ warning(#gc " is not supported in this VM. Using Serial GC."); \
+ } \
+ FLAG_SET_DEFAULT(gc, false); \
+ } \
+} while(0)
+
char** Arguments::_jvm_flags_array = NULL;
int Arguments::_num_jvm_flags = 0;
char** Arguments::_jvm_args_array = NULL;
@@ -3128,14 +3150,17 @@ jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_req
FLAG_SET_DEFAULT(UseLargePages, false);
}
- // Tiered compilation is undefined with C1.
- TieredCompilation = false;
#else
if (!FLAG_IS_DEFAULT(OptoLoopAlignment) && FLAG_IS_DEFAULT(MaxLoopPad)) {
FLAG_SET_DEFAULT(MaxLoopPad, OptoLoopAlignment-1);
}
#endif
+#ifndef TIERED
+ // Tiered compilation is undefined.
+ UNSUPPORTED_OPTION(TieredCompilation, "TieredCompilation");
+#endif
+
// If we are running in a headless jre, force java.awt.headless property
// to be true unless the property has already been set.
// Also allow the OS environment variable JAVA_AWT_HEADLESS to set headless state.
@@ -3278,29 +3303,6 @@ void Arguments::set_shared_spaces_flags() {
}
}
-// Disable options not supported in this release, with a warning if they
-// were explicitly requested on the command-line
-#define UNSUPPORTED_OPTION(opt, description) \
-do { \
- if (opt) { \
- if (FLAG_IS_CMDLINE(opt)) { \
- warning(description " is disabled in this release."); \
- } \
- FLAG_SET_DEFAULT(opt, false); \
- } \
-} while(0)
-
-
-#define UNSUPPORTED_GC_OPTION(gc) \
-do { \
- if (gc) { \
- if (FLAG_IS_CMDLINE(gc)) { \
- warning(#gc " is not supported in this VM. Using Serial GC."); \
- } \
- FLAG_SET_DEFAULT(gc, false); \
- } \
-} while(0)
-
#if !INCLUDE_ALL_GCS
static void force_serial_gc() {
FLAG_SET_DEFAULT(UseSerialGC, true);
diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp
index e7de9601c96..163433b524f 100644
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp
@@ -1098,7 +1098,7 @@ typedef BinaryTreeDictionary MetablockTreeDictionary;
\
c2_nonstatic_field(PhaseCFG, _num_blocks, uint) \
c2_nonstatic_field(PhaseCFG, _blocks, Block_List) \
- c2_nonstatic_field(PhaseCFG, _bbs, Block_Array) \
+ c2_nonstatic_field(PhaseCFG, _node_to_block_mapping, Block_Array) \
c2_nonstatic_field(PhaseCFG, _broot, Block*) \
\
c2_nonstatic_field(PhaseRegAlloc, _node_regs, OptoRegPair*) \
diff --git a/hotspot/src/share/vm/services/gcNotifier.cpp b/hotspot/src/share/vm/services/gcNotifier.cpp
index e6106e29c7d..7d1fe5d8944 100644
--- a/hotspot/src/share/vm/services/gcNotifier.cpp
+++ b/hotspot/src/share/vm/services/gcNotifier.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, 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
@@ -211,9 +211,9 @@ void GCNotifier::sendNotificationInternal(TRAPS) {
NotificationMark nm(request);
Handle objGcInfo = createGcInfo(request->gcManager, request->gcStatInfo, THREAD);
- Handle objName = java_lang_String::create_from_platform_dependent_str(request->gcManager->name(), CHECK);
- Handle objAction = java_lang_String::create_from_platform_dependent_str(request->gcAction, CHECK);
- Handle objCause = java_lang_String::create_from_platform_dependent_str(request->gcCause, CHECK);
+ Handle objName = java_lang_String::create_from_str(request->gcManager->name(), CHECK);
+ Handle objAction = java_lang_String::create_from_str(request->gcAction, CHECK);
+ Handle objCause = java_lang_String::create_from_str(request->gcCause, CHECK);
Klass* k = Management::sun_management_GarbageCollectorImpl_klass(CHECK);
instanceKlassHandle gc_mbean_klass(THREAD, k);
diff --git a/hotspot/src/share/vm/services/management.cpp b/hotspot/src/share/vm/services/management.cpp
index 0808ebd0acd..a2c8944ee42 100644
--- a/hotspot/src/share/vm/services/management.cpp
+++ b/hotspot/src/share/vm/services/management.cpp
@@ -1831,13 +1831,13 @@ class ThreadTimesClosure: public ThreadClosure {
private:
objArrayHandle _names_strings;
char **_names_chars;
- typeArrayOop _times;
+ typeArrayHandle _times;
int _names_len;
int _times_len;
int _count;
public:
- ThreadTimesClosure(objArrayHandle names, typeArrayOop times);
+ ThreadTimesClosure(objArrayHandle names, typeArrayHandle times);
~ThreadTimesClosure();
virtual void do_thread(Thread* thread);
void do_unlocked();
@@ -1845,9 +1845,9 @@ class ThreadTimesClosure: public ThreadClosure {
};
ThreadTimesClosure::ThreadTimesClosure(objArrayHandle names,
- typeArrayOop times) {
+ typeArrayHandle times) {
assert(names() != NULL, "names was NULL");
- assert(times != NULL, "times was NULL");
+ assert(times() != NULL, "times was NULL");
_names_strings = names;
_names_len = names->length();
_names_chars = NEW_C_HEAP_ARRAY(char*, _names_len, mtInternal);
@@ -1925,7 +1925,7 @@ JVM_ENTRY(jint, jmm_GetInternalThreadTimes(JNIEnv *env,
typeArrayOop ta = typeArrayOop(JNIHandles::resolve_non_null(times));
typeArrayHandle times_ah(THREAD, ta);
- ThreadTimesClosure ttc(names_ah, times_ah());
+ ThreadTimesClosure ttc(names_ah, times_ah);
{
MutexLockerEx ml(Threads_lock);
Threads::threads_do(&ttc);
diff --git a/hotspot/src/share/vm/utilities/debug.hpp b/hotspot/src/share/vm/utilities/debug.hpp
index 2450c8fe113..85b26f35fda 100644
--- a/hotspot/src/share/vm/utilities/debug.hpp
+++ b/hotspot/src/share/vm/utilities/debug.hpp
@@ -225,6 +225,22 @@ void report_untested(const char* file, int line, const char* message);
void warning(const char* format, ...);
+#ifdef ASSERT
+// Compile-time asserts.
+template struct StaticAssert;
+template <> struct StaticAssert {};
+
+// Only StaticAssert is defined, so if cond evaluates to false we get
+// a compile time exception when trying to use StaticAssert.
+#define STATIC_ASSERT(cond) \
+ do { \
+ StaticAssert<(cond)> DUMMY_STATIC_ASSERT; \
+ (void)DUMMY_STATIC_ASSERT; /* ignore */ \
+ } while (false)
+#else
+#define STATIC_ASSERT(cond)
+#endif
+
// out of shared space reporting
enum SharedSpaceType {
SharedPermGen,
diff --git a/hotspot/src/share/vm/utilities/exceptions.cpp b/hotspot/src/share/vm/utilities/exceptions.cpp
index 6083c555cbf..af5f974f126 100644
--- a/hotspot/src/share/vm/utilities/exceptions.cpp
+++ b/hotspot/src/share/vm/utilities/exceptions.cpp
@@ -125,13 +125,13 @@ void Exceptions::_throw_oop(Thread* thread, const char* file, int line, oop exce
}
void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception, const char* message) {
+ ResourceMark rm;
assert(h_exception() != NULL, "exception should not be NULL");
// tracing (do this up front - so it works during boot strapping)
if (TraceExceptions) {
ttyLocker ttyl;
- ResourceMark rm;
- tty->print_cr("Exception <%s>%s%s (" INTPTR_FORMAT " ) \n"
+ tty->print_cr("Exception <%s%s%s> (" INTPTR_FORMAT ") \n"
"thrown [%s, line %d]\nfor thread " INTPTR_FORMAT,
h_exception->print_value_string(),
message ? ": " : "", message ? message : "",
@@ -141,7 +141,9 @@ void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exc
NOT_PRODUCT(Exceptions::debug_check_abort(h_exception, message));
// Check for special boot-strapping/vm-thread handling
- if (special_exception(thread, file, line, h_exception)) return;
+ if (special_exception(thread, file, line, h_exception)) {
+ return;
+ }
assert(h_exception->is_a(SystemDictionary::Throwable_klass()), "exception is not a subclass of java/lang/Throwable");
@@ -149,7 +151,9 @@ void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exc
thread->set_pending_exception(h_exception(), file, line);
// vm log
- Events::log_exception(thread, "Threw " INTPTR_FORMAT " at %s:%d", (address)h_exception(), file, line);
+ Events::log_exception(thread, "Exception <%s%s%s> (" INTPTR_FORMAT ") thrown at [%s, line %d]",
+ h_exception->print_value_string(), message ? ": " : "", message ? message : "",
+ (address)h_exception(), file, line);
}
diff --git a/hotspot/src/share/vm/utilities/exceptions.hpp b/hotspot/src/share/vm/utilities/exceptions.hpp
index 32c6f35d8a5..beaabf8dcf7 100644
--- a/hotspot/src/share/vm/utilities/exceptions.hpp
+++ b/hotspot/src/share/vm/utilities/exceptions.hpp
@@ -306,6 +306,6 @@ class ExceptionMark {
// which preserves pre-existing exceptions and does not allow new
// exceptions.
-#define EXCEPTION_MARK Thread* THREAD; ExceptionMark __em(THREAD);
+#define EXCEPTION_MARK Thread* THREAD = NULL; ExceptionMark __em(THREAD);
#endif // SHARE_VM_UTILITIES_EXCEPTIONS_HPP
diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp
index 181e80a0823..f15bb5da9fe 100644
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp
@@ -410,6 +410,8 @@ inline intptr_t align_size_down(intptr_t size, intptr_t alignment) {
return align_size_down_(size, alignment);
}
+#define is_size_aligned_(size, alignment) ((size) == (align_size_up_(size, alignment)))
+
// Align objects by rounding up their size, in HeapWord units.
#define align_object_size_(size) align_size_up_(size, MinObjAlignment)
@@ -428,6 +430,10 @@ inline intptr_t align_object_offset(intptr_t offset) {
return align_size_up(offset, HeapWordsPerLong);
}
+inline void* align_pointer_up(const void* addr, size_t size) {
+ return (void*) align_size_up_((uintptr_t)addr, size);
+}
+
// Clamp an address to be within a specific page
// 1. If addr is on the page it is returned as is
// 2. If addr is above the page_address the start of the *next* page will be returned
@@ -449,32 +455,6 @@ inline address clamp_address_in_page(address addr, address page_address, intptr_
// The expected size in bytes of a cache line, used to pad data structures.
#define DEFAULT_CACHE_LINE_SIZE 64
-// Bytes needed to pad type to avoid cache-line sharing; alignment should be the
-// expected cache line size (a power of two). The first addend avoids sharing
-// when the start address is not a multiple of alignment; the second maintains
-// alignment of starting addresses that happen to be a multiple.
-#define PADDING_SIZE(type, alignment) \
- ((alignment) + align_size_up_(sizeof(type), alignment))
-
-// Templates to create a subclass padded to avoid cache line sharing. These are
-// effective only when applied to derived-most (leaf) classes.
-
-// When no args are passed to the base ctor.
-template
-class Padded: public T {
-private:
- char _pad_buf_[PADDING_SIZE(T, alignment)];
-};
-
-// When either 0 or 1 args may be passed to the base ctor.
-template
-class Padded01: public T {
-public:
- Padded01(): T() { }
- Padded01(Arg1T arg1): T(arg1) { }
-private:
- char _pad_buf_[PADDING_SIZE(T, alignment)];
-};
//----------------------------------------------------------------------------------------------------
// Utility macros for compilers
diff --git a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp
index aea96c8581c..d3eafd5de47 100644
--- a/hotspot/src/share/vm/utilities/taskqueue.hpp
+++ b/hotspot/src/share/vm/utilities/taskqueue.hpp
@@ -395,7 +395,13 @@ bool GenericTaskQueue::pop_local_slow(uint localBot, Age oldAge) {
template
bool GenericTaskQueue::pop_global(E& t) {
Age oldAge = _age.get();
- uint localBot = _bottom;
+ // Architectures with weak memory model require a barrier here
+ // to guarantee that bottom is not older than age,
+ // which is crucial for the correctness of the algorithm.
+#if !(defined SPARC || defined IA32 || defined AMD64)
+ OrderAccess::fence();
+#endif
+ uint localBot = OrderAccess::load_acquire((volatile juint*)&_bottom);
uint n_elems = size(localBot, oldAge.top());
if (n_elems == 0) {
return false;
@@ -644,7 +650,7 @@ public:
template inline bool
GenericTaskQueue::push(E t) {
uint localBot = _bottom;
- assert((localBot >= 0) && (localBot < N), "_bottom out of range.");
+ assert(localBot < N, "_bottom out of range.");
idx_t top = _age.top();
uint dirty_n_elems = dirty_size(localBot, top);
assert(dirty_n_elems < N, "n_elems out of range.");
diff --git a/hotspot/test/compiler/codecache/CheckUpperLimit.java b/hotspot/test/compiler/codecache/CheckUpperLimit.java
index 5e4803226d5..e2a2705b554 100644
--- a/hotspot/test/compiler/codecache/CheckUpperLimit.java
+++ b/hotspot/test/compiler/codecache/CheckUpperLimit.java
@@ -35,10 +35,6 @@ public class CheckUpperLimit {
ProcessBuilder pb;
OutputAnalyzer out;
- pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2048m", "-version");
- out = new OutputAnalyzer(pb.start());
- out.shouldHaveExitValue(0);
-
pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version");
out = new OutputAnalyzer(pb.start());
out.shouldContain("Invalid ReservedCodeCacheSize=");
diff --git a/hotspot/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java b/hotspot/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java
new file mode 100644
index 00000000000..c3f455274dd
--- /dev/null
+++ b/hotspot/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8016474
+ * @summary The bug only happens with C1 and G1 using a different ObjectAlignmentInBytes than KlassAlignmentInBytes (which is 8)
+ * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32 GetUnsafeObjectG1PreBarrier
+ */
+
+import java.lang.reflect.Field;
+
+import sun.misc.Unsafe;
+
+public class GetUnsafeObjectG1PreBarrier {
+ private static final Unsafe unsafe;
+ private static final int N = 100_000;
+
+ static {
+ try {
+ Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
+ theUnsafe.setAccessible(true);
+ unsafe = (Unsafe) theUnsafe.get(null);
+ } catch (NoSuchFieldException | IllegalAccessException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ public Object a;
+
+ public static void main(String[] args) throws Throwable {
+ new GetUnsafeObjectG1PreBarrier();
+ }
+
+ public GetUnsafeObjectG1PreBarrier() throws Throwable {
+ doit();
+ }
+
+ private void doit() throws Throwable {
+ Field field = GetUnsafeObjectG1PreBarrier.class.getField("a");
+ long fieldOffset = unsafe.objectFieldOffset(field);
+
+ for (int i = 0; i < N; i++) {
+ readField(this, fieldOffset);
+ }
+ }
+
+ private void readField(Object o, long fieldOffset) {
+ unsafe.getObject(o, fieldOffset);
+ }
+}
diff --git a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java
index 491650d3752..6b718ec8851 100644
--- a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java
+++ b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java
@@ -26,7 +26,7 @@
* @library /testlibrary /testlibrary/whitebox
* @build ClearMethodStateTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ClearMethodStateTest
+ * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* ClearMethodStateTest
* @summary testing of WB::clearMethodState()
* @author igor.ignatyev@oracle.com
*/
diff --git a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java
index 74b467ea670..f09922cec8b 100644
--- a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java
+++ b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java
@@ -61,6 +61,9 @@ public abstract class CompilerWhiteBoxTest {
/** Value of {@code -XX:TieredStopAtLevel} */
protected static final int TIERED_STOP_AT_LEVEL
= Integer.parseInt(getVMOption("TieredStopAtLevel", "0"));
+ /** Flag for verbose output, true if {@code -Dverbose} specified */
+ protected static final boolean IS_VERBOSE
+ = System.getProperty("verbose") != null;
/**
* Returns value of VM option.
@@ -268,7 +271,9 @@ public abstract class CompilerWhiteBoxTest {
}
result += tmp == null ? 0 : tmp;
}
- System.out.println("method was invoked " + count + " times");
+ if (IS_VERBOSE) {
+ System.out.println("method was invoked " + count + " times");
+ }
return result;
}
}
diff --git a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java
index c831a23e58c..c659ac164e7 100644
--- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java
+++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java
@@ -26,7 +26,7 @@
* @library /testlibrary /testlibrary/whitebox
* @build DeoptimizeAllTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI DeoptimizeAllTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* DeoptimizeAllTest
* @summary testing of WB::deoptimizeAll()
* @author igor.ignatyev@oracle.com
*/
diff --git a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java
index b6c84aeb313..0fedc3402af 100644
--- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java
+++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java
@@ -26,7 +26,7 @@
* @library /testlibrary /testlibrary/whitebox
* @build DeoptimizeMethodTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI DeoptimizeMethodTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* DeoptimizeMethodTest
* @summary testing of WB::deoptimizeMethod()
* @author igor.ignatyev@oracle.com
*/
diff --git a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
index f87b3235697..b14bd96709f 100644
--- a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
+++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
@@ -26,7 +26,7 @@
* @library /testlibrary /testlibrary/whitebox
* @build EnqueueMethodForCompilationTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI EnqueueMethodForCompilationTest
+ * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* EnqueueMethodForCompilationTest
* @summary testing of WB::enqueueMethodForCompilation()
* @author igor.ignatyev@oracle.com
*/
diff --git a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java
index e1cfaf4887b..bb7da4ab007 100644
--- a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java
+++ b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java
@@ -27,7 +27,7 @@
* @library /testlibrary /testlibrary/whitebox
* @build IsMethodCompilableTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI IsMethodCompilableTest
+ * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* IsMethodCompilableTest
* @summary testing of WB::isMethodCompilable()
* @author igor.ignatyev@oracle.com
*/
diff --git a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java
index 8347049a3d6..8290dcecc3a 100644
--- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java
+++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java
@@ -27,7 +27,7 @@
* @library /testlibrary /testlibrary/whitebox
* @build MakeMethodNotCompilableTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI MakeMethodNotCompilableTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* MakeMethodNotCompilableTest
* @summary testing of WB::makeMethodNotCompilable()
* @author igor.ignatyev@oracle.com
*/
diff --git a/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java b/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java
index 6a8b61c373f..22912a1058d 100644
--- a/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java
+++ b/hotspot/test/compiler/whitebox/SetDontInlineMethodTest.java
@@ -26,7 +26,7 @@
* @library /testlibrary /testlibrary/whitebox
* @build SetDontInlineMethodTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI SetDontInlineMethodTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* SetDontInlineMethodTest
* @summary testing of WB::testSetDontInlineMethod()
* @author igor.ignatyev@oracle.com
*/
diff --git a/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java b/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java
index ca3e54389bb..609be614a2c 100644
--- a/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java
+++ b/hotspot/test/compiler/whitebox/SetForceInlineMethodTest.java
@@ -26,7 +26,7 @@
* @library /testlibrary /testlibrary/whitebox
* @build SetForceInlineMethodTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI SetForceInlineMethodTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,TestCase$Helper::* SetForceInlineMethodTest
* @summary testing of WB::testSetForceInlineMethod()
* @author igor.ignatyev@oracle.com
*/
diff --git a/hotspot/test/runtime/7107135/Test7107135.sh b/hotspot/test/runtime/7107135/Test7107135.sh
index d8ccbad19ad..742c71c1ce2 100644
--- a/hotspot/test/runtime/7107135/Test7107135.sh
+++ b/hotspot/test/runtime/7107135/Test7107135.sh
@@ -53,9 +53,6 @@ case "$OS" in
fi
;;
*)
- NULL=NUL
- PS=";"
- FS="\\"
echo "Test passed; only valid for Linux"
exit 0;
;;
@@ -87,14 +84,16 @@ ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rw
echo
echo Test changing of stack protection:
-echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rw
+echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rwx
${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rwx
+JAVA_RETVAL=$?
-if [ "$?" == "0" ]
+if [ "$JAVA_RETVAL" == "0" ]
then
echo
echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} TestMT test-rwx
${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} TestMT test-rwx
+ JAVA_RETVAL=$?
fi
-exit $?
+exit $JAVA_RETVAL
diff --git a/hotspot/test/runtime/8000968/Test8000968.sh b/hotspot/test/runtime/8000968/Test8000968.sh
deleted file mode 100644
index cd7183476cf..00000000000
--- a/hotspot/test/runtime/8000968/Test8000968.sh
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-
-# @test Test8000968.sh
-# @bug 8000968
-# @summary NPG: UseCompressedKlassPointers asserts with ObjectAlignmentInBytes=32
-# @run shell Test8000968.sh
-#
-
-if [ "${TESTJAVA}" = "" ]
-then
- PARENT=`dirname \`which java\``
- TESTJAVA=`dirname ${PARENT}`
- printf "TESTJAVA not set, selecting " ${TESTJAVA}
- printf " If this is incorrect, try setting the variable manually.\n"
-fi
-
-
-# set platform-dependent variables
-OS=`uname -s`
-case "$OS" in
- Windows_* )
- FS="\\"
- NULL=NUL
- ;;
- * )
- FS="/"
- NULL=/dev/null
- ;;
-esac
-
-JAVA=${TESTJAVA}${FS}bin${FS}java
-
-#
-# See if platform has 64 bit java.
-#
-${JAVA} ${TESTVMOPTS} -d64 -version 2>&1 | grep -i "does not support" > ${NULL}
-if [ "$?" != "1" ]
-then
- printf "Platform is 32 bit, does not support -XX:ObjectAlignmentInBytes= option.\n"
- printf "Passed.\n"
- exit 0
-fi
-
-#
-# Test -XX:ObjectAlignmentInBytes with -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops.
-#
-${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=16 -version 2>&1 > ${NULL}
-if [ "$?" != "0" ]
-then
- printf "FAILED: -XX:ObjectAlignmentInBytes=16 option did not work.\n"
- exit 1
-fi
-
-${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=32 -version 2>&1 > ${NULL}
-if [ "$?" != "0" ]
-then
- printf "FAILED: -XX:ObjectAlignmentInBytes=32 option did not work.\n"
- exit 1
-fi
-
-${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=64 -version 2>&1 > ${NULL}
-if [ "$?" != "0" ]
-then
- printf "FAILED: -XX:ObjectAlignmentInBytes=64 option did not work.\n"
- exit 1
-fi
-
-${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=128 -version 2>&1 > ${NULL}
-if [ "$?" != "0" ]
-then
- printf "FAILED: -XX:ObjectAlignmentInBytes=128 option did not work.\n"
- exit 1
-fi
-
-
-printf "Passed.\n"
-exit 0
diff --git a/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java b/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java
new file mode 100644
index 00000000000..dd0c26d9f10
--- /dev/null
+++ b/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8000968
+ * @key regression
+ * @summary NPG: UseCompressedKlassPointers asserts with ObjectAlignmentInBytes=32
+ * @library /testlibrary
+ */
+
+import com.oracle.java.testlibrary.*;
+
+public class CompressedKlassPointerAndOops {
+
+ public static void main(String[] args) throws Exception {
+
+ if (!Platform.is64bit()) {
+ // Can't test this on 32 bit, just pass
+ System.out.println("Skipping test on 32bit");
+ return;
+ }
+
+ runWithAlignment(16);
+ runWithAlignment(32);
+ runWithAlignment(64);
+ runWithAlignment(128);
+ }
+
+ private static void runWithAlignment(int alignment) throws Exception {
+ ProcessBuilder pb;
+ OutputAnalyzer output;
+
+ pb = ProcessTools.createJavaProcessBuilder(
+ "-XX:+UseCompressedKlassPointers",
+ "-XX:+UseCompressedOops",
+ "-XX:ObjectAlignmentInBytes=" + alignment,
+ "-version");
+
+ output = new OutputAnalyzer(pb.start());
+ output.shouldHaveExitValue(0);
+ }
+}
diff --git a/hotspot/test/runtime/7196045/Test7196045.java b/hotspot/test/runtime/InternalApi/ThreadCpuTimesDeadlock.java
similarity index 82%
rename from hotspot/test/runtime/7196045/Test7196045.java
rename to hotspot/test/runtime/InternalApi/ThreadCpuTimesDeadlock.java
index 4c6fcc8c072..3416ce45fec 100644
--- a/hotspot/test/runtime/7196045/Test7196045.java
+++ b/hotspot/test/runtime/InternalApi/ThreadCpuTimesDeadlock.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,9 @@
/*
* @test
* @bug 7196045
+ * @bug 8014294
* @summary Possible JVM deadlock in ThreadTimesClosure when using HotspotInternal non-public API.
- * @run main/othervm -XX:+UsePerfData Test7196045
+ * @run main/othervm -XX:+UsePerfData -Xmx32m ThreadCpuTimesDeadlock
*/
import java.lang.management.ManagementFactory;
@@ -35,9 +36,10 @@ import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
-public class Test7196045 {
+public class ThreadCpuTimesDeadlock {
- public static long duration = 1000 * 60 * 2;
+ public static byte[] dummy;
+ public static long duration = 10 * 1000;
private static final String HOTSPOT_INTERNAL = "sun.management:type=HotspotInternal";
public static void main(String[] args) {
@@ -57,6 +59,18 @@ public class Test7196045 {
throw new RuntimeException("Bad object name" + e1);
}
+ // Thread that allocs memory to generate GC's
+ Thread allocThread = new Thread() {
+ public void run() {
+ while (true) {
+ dummy = new byte[4096];
+ }
+ }
+ };
+
+ allocThread.setDaemon(true);
+ allocThread.start();
+
long endTime = System.currentTimeMillis() + duration;
long i = 0;
while (true) {
diff --git a/hotspot/test/runtime/RedefineObject/Agent.java b/hotspot/test/runtime/RedefineObject/Agent.java
index 7927094d8aa..b5435c22ca7 100644
--- a/hotspot/test/runtime/RedefineObject/Agent.java
+++ b/hotspot/test/runtime/RedefineObject/Agent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2013, 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
@@ -22,6 +22,7 @@
*/
import java.security.*;
import java.lang.instrument.*;
+import java.lang.reflect.*;
public class Agent implements ClassFileTransformer {
public synchronized byte[] transform(final ClassLoader classLoader,
@@ -29,23 +30,35 @@ public class Agent implements ClassFileTransformer {
Class> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer) {
- //System.out.println("Transforming class " + className);
+ System.out.println("Transforming class " + className);
return classfileBuffer;
}
- public static void premain(String agentArgs, Instrumentation instrumentation) {
+ public static void redefine(String agentArgs, Instrumentation instrumentation, Class to_redefine) {
- Agent transformer = new Agent();
-
- instrumentation.addTransformer(transformer, true);
-
- Class c = Object.class;
try {
- instrumentation.retransformClasses(c);
+ instrumentation.retransformClasses(to_redefine);
} catch (Exception e) {
e.printStackTrace();
}
+ }
+
+ public static void premain(String agentArgs, Instrumentation instrumentation) {
+ Agent transformer = new Agent();
+ instrumentation.addTransformer(transformer, true);
+
+ // Redefine java/lang/Object and java/lang/reflect/Method.invoke and
+ // java/lang/ClassLoader
+ Class object_class = Object.class;
+ redefine(agentArgs, instrumentation, object_class);
+
+ Class method_class = Method.class;
+ redefine(agentArgs, instrumentation, method_class);
+
+ Class loader_class = ClassLoader.class;
+ redefine(agentArgs, instrumentation, loader_class);
+
instrumentation.removeTransformer(transformer);
}
@@ -57,5 +70,14 @@ public class Agent implements ClassFileTransformer {
System.gc();
ba.clone();
}
+ try {
+ // Use java/lang/reflect/Method.invoke to call
+ WalkThroughInvoke a = new WalkThroughInvoke();
+ Class aclass = WalkThroughInvoke.class;
+ Method m = aclass.getMethod("stackWalk");
+ m.invoke(a);
+ } catch (Exception x) {
+ x.printStackTrace();
+ }
}
}
diff --git a/hotspot/test/runtime/RedefineObject/TestRedefineObject.java b/hotspot/test/runtime/RedefineObject/TestRedefineObject.java
index bd5003a588a..437cec25b33 100644
--- a/hotspot/test/runtime/RedefineObject/TestRedefineObject.java
+++ b/hotspot/test/runtime/RedefineObject/TestRedefineObject.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,14 +26,17 @@ import com.oracle.java.testlibrary.*;
/*
* Test to redefine java/lang/Object and verify that it doesn't crash on vtable
* call on basic array type.
+ * Test to redefine java/lang/ClassLoader and java/lang/reflect/Method to make
+ * sure cached versions used afterward are the current version.
*
* @test
* @bug 8005056
+ * @bug 8009728
* @library /testlibrary
* @build Agent
* @run main ClassFileInstaller Agent
* @run main TestRedefineObject
- * @run main/othervm -javaagent:agent.jar Agent
+ * @run main/othervm -javaagent:agent.jar -XX:TraceRedefineClasses=5 Agent
*/
public class TestRedefineObject {
public static void main(String[] args) throws Exception {
diff --git a/hotspot/test/runtime/RedefineObject/WalkThroughInvoke.java b/hotspot/test/runtime/RedefineObject/WalkThroughInvoke.java
new file mode 100644
index 00000000000..51f0e635bca
--- /dev/null
+++ b/hotspot/test/runtime/RedefineObject/WalkThroughInvoke.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2013, 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.
+ */
+import java.lang.reflect.*;
+
+public class WalkThroughInvoke {
+ public void stackWalk() {
+ try {
+ Class b = Object.class;
+ SecurityManager sm = new SecurityManager();
+ // Walks the stack with Method.invoke in the stack (which is the
+ // purpose of the test) before it gets an AccessControlException.
+ sm.checkMemberAccess(b, Member.DECLARED);
+ } catch (java.security.AccessControlException e) {
+ // Ignoring an 'AccessControlException' exception since
+ // it is expected as part of this test.
+ }
+ }
+};
diff --git a/hotspot/test/testlibrary/OutputAnalyzerReportingTest.java b/hotspot/test/testlibrary/OutputAnalyzerReportingTest.java
new file mode 100644
index 00000000000..068f193efcf
--- /dev/null
+++ b/hotspot/test/testlibrary/OutputAnalyzerReportingTest.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+/*
+ * @test
+ * @summary Test the OutputAnalyzer reporting functionality,
+ * such as printing additional diagnostic info
+ * (exit code, stdout, stderr, command line, etc.)
+ * @library /testlibrary
+ */
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.ProcessTools;
+
+
+public class OutputAnalyzerReportingTest {
+
+ public static void main(String[] args) throws Exception {
+ // Create the output analyzer under test
+ String stdout = "aaaaaa";
+ String stderr = "bbbbbb";
+ OutputAnalyzer output = new OutputAnalyzer(stdout, stderr);
+
+ // Expected summary values should be the same for all cases,
+ // since the outputAnalyzer object is the same
+ String expectedExitValue = "-1";
+ String expectedSummary =
+ " stdout: [" + stdout + "];\n" +
+ " stderr: [" + stderr + "]\n" +
+ " exitValue = " + expectedExitValue + "\n";
+
+
+ DiagnosticSummaryTestRunner testRunner =
+ new DiagnosticSummaryTestRunner();
+
+ // should have exit value
+ testRunner.init(expectedSummary);
+ int unexpectedExitValue = 2;
+ try {
+ output.shouldHaveExitValue(unexpectedExitValue);
+ } catch (RuntimeException e) { }
+ testRunner.closeAndCheckResults();
+
+ // should not contain
+ testRunner.init(expectedSummary);
+ try {
+ output.shouldNotContain(stdout);
+ } catch (RuntimeException e) { }
+ testRunner.closeAndCheckResults();
+
+ // should contain
+ testRunner.init(expectedSummary);
+ try {
+ output.shouldContain("unexpected-stuff");
+ } catch (RuntimeException e) { }
+ testRunner.closeAndCheckResults();
+
+ // should not match
+ testRunner.init(expectedSummary);
+ try {
+ output.shouldNotMatch("[a]");
+ } catch (RuntimeException e) { }
+ testRunner.closeAndCheckResults();
+
+ // should match
+ testRunner.init(expectedSummary);
+ try {
+ output.shouldMatch("[qwerty]");
+ } catch (RuntimeException e) { }
+ testRunner.closeAndCheckResults();
+
+ }
+
+ private static class DiagnosticSummaryTestRunner {
+ private ByteArrayOutputStream byteStream =
+ new ByteArrayOutputStream(10000);
+
+ private String expectedSummary = "";
+ private PrintStream errStream;
+
+
+ public void init(String expectedSummary) {
+ this.expectedSummary = expectedSummary;
+ byteStream.reset();
+ errStream = new PrintStream(byteStream);
+ System.setErr(errStream);
+ }
+
+ public void closeAndCheckResults() {
+ // check results
+ errStream.close();
+ String stdErrStr = byteStream.toString();
+ if (!stdErrStr.contains(expectedSummary)) {
+ throw new RuntimeException("The output does not contain "
+ + "the diagnostic message, or the message is incorrect");
+ }
+ }
+ }
+
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java
index ede667f8e58..b9e37128d23 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java
@@ -76,7 +76,8 @@ public final class OutputAnalyzer {
*/
public void shouldContain(String expectedString) {
if (!stdout.contains(expectedString) && !stderr.contains(expectedString)) {
- throw new RuntimeException("'" + expectedString + "' missing from stdout/stderr: [" + stdout + stderr + "]\n");
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + expectedString + "' missing from stdout/stderr \n");
}
}
@@ -88,7 +89,8 @@ public final class OutputAnalyzer {
*/
public void stdoutShouldContain(String expectedString) {
if (!stdout.contains(expectedString)) {
- throw new RuntimeException("'" + expectedString + "' missing from stdout: [" + stdout + "]\n");
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + expectedString + "' missing from stdout \n");
}
}
@@ -100,7 +102,8 @@ public final class OutputAnalyzer {
*/
public void stderrShouldContain(String expectedString) {
if (!stderr.contains(expectedString)) {
- throw new RuntimeException("'" + expectedString + "' missing from stderr: [" + stderr + "]\n");
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + expectedString + "' missing from stderr \n");
}
}
@@ -112,10 +115,12 @@ public final class OutputAnalyzer {
*/
public void shouldNotContain(String notExpectedString) {
if (stdout.contains(notExpectedString)) {
- throw new RuntimeException("'" + notExpectedString + "' found in stdout: [" + stdout + "]\n");
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + notExpectedString + "' found in stdout \n");
}
if (stderr.contains(notExpectedString)) {
- throw new RuntimeException("'" + notExpectedString + "' found in stderr: [" + stderr + "]\n");
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + notExpectedString + "' found in stderr \n");
}
}
@@ -127,7 +132,8 @@ public final class OutputAnalyzer {
*/
public void stdoutShouldNotContain(String notExpectedString) {
if (stdout.contains(notExpectedString)) {
- throw new RuntimeException("'" + notExpectedString + "' found in stdout: [" + stdout + "]\n");
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + notExpectedString + "' found in stdout \n");
}
}
@@ -139,7 +145,8 @@ public final class OutputAnalyzer {
*/
public void stderrShouldNotContain(String notExpectedString) {
if (stderr.contains(notExpectedString)) {
- throw new RuntimeException("'" + notExpectedString + "' found in stderr: [" + stderr + "]\n");
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + notExpectedString + "' found in stderr \n");
}
}
@@ -154,9 +161,9 @@ public final class OutputAnalyzer {
Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
if (!stdoutMatcher.find() && !stderrMatcher.find()) {
+ reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
- + "' missing from stdout/stderr: [" + stdout + stderr
- + "]\n");
+ + "' missing from stdout/stderr \n");
}
}
@@ -170,8 +177,9 @@ public final class OutputAnalyzer {
public void stdoutShouldMatch(String pattern) {
Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
if (!matcher.find()) {
+ reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
- + "' missing from stdout: [" + stdout + "]\n");
+ + "' missing from stdout \n");
}
}
@@ -185,8 +193,9 @@ public final class OutputAnalyzer {
public void stderrShouldMatch(String pattern) {
Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
if (!matcher.find()) {
+ reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
- + "' missing from stderr: [" + stderr + "]\n");
+ + "' missing from stderr \n");
}
}
@@ -200,13 +209,15 @@ public final class OutputAnalyzer {
public void shouldNotMatch(String pattern) {
Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
if (matcher.find()) {
+ reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
- + "' found in stdout: [" + stdout + "]\n");
+ + "' found in stdout \n");
}
matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
if (matcher.find()) {
+ reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
- + "' found in stderr: [" + stderr + "]\n");
+ + "' found in stderr \n");
}
}
@@ -220,8 +231,9 @@ public final class OutputAnalyzer {
public void stdoutShouldNotMatch(String pattern) {
Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
if (matcher.find()) {
+ reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
- + "' found in stdout: [" + stdout + "]\n");
+ + "' found in stdout \n");
}
}
@@ -235,23 +247,45 @@ public final class OutputAnalyzer {
public void stderrShouldNotMatch(String pattern) {
Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
if (matcher.find()) {
+ reportDiagnosticSummary();
throw new RuntimeException("'" + pattern
- + "' found in stderr: [" + stderr + "]\n");
+ + "' found in stderr \n");
}
}
/**
- * Verifiy the exit value of the process
+ * Verify the exit value of the process
*
* @param expectedExitValue Expected exit value from process
* @throws RuntimeException If the exit value from the process did not match the expected value
*/
public void shouldHaveExitValue(int expectedExitValue) {
if (getExitValue() != expectedExitValue) {
- throw new RuntimeException("Exit value " + getExitValue() + " , expected to get " + expectedExitValue);
+ reportDiagnosticSummary();
+ throw new RuntimeException("Expected to get exit value of ["
+ + expectedExitValue + "]\n");
}
}
+
+ /**
+ * Report summary that will help to diagnose the problem
+ * Currently includes:
+ * - standard input produced by the process under test
+ * - standard output
+ * - exit code
+ * Note: the command line is printed by the ProcessTools
+ */
+ private void reportDiagnosticSummary() {
+ String msg =
+ " stdout: [" + stdout + "];\n" +
+ " stderr: [" + stderr + "]\n" +
+ " exitValue = " + getExitValue() + "\n";
+
+ System.err.println(msg);
+ }
+
+
/**
* Get the contents of the output buffer (stdout and stderr)
*
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
index cfc1a271c13..8e5d303317d 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
@@ -27,6 +27,7 @@ public class Platform {
private static final String osName = System.getProperty("os.name");
private static final String dataModel = System.getProperty("sun.arch.data.model");
private static final String vmVersion = System.getProperty("java.vm.version");
+ private static final String osArch = System.getProperty("os.arch");
public static boolean is64bit() {
return dataModel.equals("64");
@@ -59,4 +60,14 @@ public class Platform {
public static String getVMVersion() {
return vmVersion;
}
+
+ // Returns true for sparc and sparcv9.
+ public static boolean isSparc() {
+ return osArch.toLowerCase().startsWith("sparc");
+ }
+
+ public static String getOsArch() {
+ return osArch;
+ }
+
}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
index 6e0fdae6564..56277f046ec 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
@@ -31,6 +31,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.List;
import sun.management.VMManagement;
@@ -106,6 +107,22 @@ public final class ProcessTools {
return pid;
}
+ /**
+ * Get the string containing input arguments passed to the VM
+ *
+ * @return arguments
+ */
+ public static String getVmInputArguments() {
+ RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
+
+ List args = runtime.getInputArguments();
+ StringBuilder result = new StringBuilder();
+ for (String arg : args)
+ result.append(arg).append(' ');
+
+ return result.toString();
+ }
+
/**
* Get platform specific VM arguments (e.g. -d64 on 64bit Solaris)
*
@@ -132,8 +149,13 @@ public final class ProcessTools {
Collections.addAll(args, getPlatformSpecificVMArgs());
Collections.addAll(args, command);
- return new ProcessBuilder(args.toArray(new String[args.size()]));
+ // Reporting
+ StringBuilder cmdLine = new StringBuilder();
+ for (String cmd : args)
+ cmdLine.append(cmd).append(' ');
+ System.out.println("Command line: [" + cmdLine.toString() + "]");
+ return new ProcessBuilder(args.toArray(new String[args.size()]));
}
}
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index fc49036c257..03148a2fdb0 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -223,3 +223,5 @@ b8c5f4b6f0fffb44618fc609a584953c4ed67c0b jdk8-b95
adf49c3ef83c160d53ece623049b2cdccaf78fc7 jdk8-b99
5d1974c1d7b9a86431bc253dc5a6a52d4586622e jdk8-b100
0a7432f898e579ea35e8c51e3edab37f949168e4 jdk8-b101
+7cffafa606e9fb865e7b5e6a56e0a681ce5cf617 jdk8-b102
+b1ceab582fc6d795b20aaa8a3fde2eba34af9399 jdk8-b103
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index b7bd401237e..bc095c0cca8 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -223,3 +223,5 @@ b1fb4612a2caea52b5661b87509e560fa044b194 jdk8-b98
8ef83d4b23c933935e28f59b282cea920b1b1f5f jdk8-b99
4fd722afae5c02f00bbd44c3a34425ee474afb1c jdk8-b100
60b623a361642a0f5aef5f06dad9e5f279b9d9a9 jdk8-b101
+988a5f2ac559dcab05698b8a8633aa453e012260 jdk8-b102
+6cdc6ed987801c175a1217d0d3e53c3bd69ba52e jdk8-b103
diff --git a/jdk/.hgtags b/jdk/.hgtags
index f680ba06806..b185182241f 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -224,3 +224,4 @@ c4908732fef5235f1b98cafe0ce507771ef7892c jdk8-b98
5be9c5bfcfe9b2a40412b4fb364377d49de014eb jdk8-b100
6901612328239fbd471d20823113c1cf3fdaebee jdk8-b101
8ed8e2b4b90e0ac9aa5b3efef51cd576a9db96a9 jdk8-b102
+e0f6039c0290b7381042a6fec3100a69a5a67e37 jdk8-b103
diff --git a/jdk/makefiles/CompileNativeLibraries.gmk b/jdk/makefiles/CompileNativeLibraries.gmk
index fa416032473..7ec76e49dbd 100644
--- a/jdk/makefiles/CompileNativeLibraries.gmk
+++ b/jdk/makefiles/CompileNativeLibraries.gmk
@@ -794,6 +794,16 @@ ifeq ($(OPENJDK_TARGET_OS),solaris)
LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
endif
+ifeq ($(OPENJDK_TARGET_OS),linux)
+ifndef OPENJDK
+include $(JDK_TOPDIR)/make/closed/xawt.gmk
+endif
+
+ifeq ($(DISABLE_XRENDER),true)
+ LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
+endif
+endif
+
ifeq ($(MILESTONE),internal)
LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD
endif
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java
index fdad818c4f0..5a1cf0cdeb7 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java
@@ -1856,7 +1856,10 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
// If we're not valid that means we will shortly be validated and
// painted, which means we don't have to do anything here.
if (!isRunsDirty && index >= 0 && index < tabPane.getTabCount()) {
- tabPane.repaint(getTabBounds(tabPane, index));
+ Rectangle rect = getTabBounds(tabPane, index);
+ if (rect != null) {
+ tabPane.repaint(rect);
+ }
}
}
diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java
index 7dbc187296d..39b55762648 100644
--- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneUI.java
@@ -701,6 +701,20 @@ public class AquaTabbedPaneUI extends AquaTabbedPaneCopyFromBasicUI {
return false;
}
+ /**
+ * Returns the bounds of the specified tab index. The bounds are
+ * with respect to the JTabbedPane's coordinate space. If the tab at this
+ * index is not currently visible in the UI, then returns null.
+ */
+ @Override
+ public Rectangle getTabBounds(final JTabbedPane pane, final int i) {
+ if (visibleTabState.needsScrollTabs()
+ && (visibleTabState.isBefore(i) || visibleTabState.isAfter(i))) {
+ return null;
+ }
+ return super.getTabBounds(pane, i);
+ }
+
/**
* Returns the tab index which intersects the specified point
* in the JTabbedPane's coordinate space.
diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
index 8aed7e5feaa..d38946d4376 100644
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
@@ -830,18 +830,19 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
// UTILITY METHODS
// ----------------------------------------------------------------------
- /*
- * Find image to install into Title or into Application icon.
- * First try icons installed for toplevel. If there is no icon
- * use default Duke image.
- * This method shouldn't return null.
+ /**
+ * Find image to install into Title or into Application icon. First try
+ * icons installed for toplevel. Null is returned, if there is no icon and
+ * default Duke image should be used.
*/
private CImage getImageForTarget() {
- List icons = target.getIconImages();
- if (icons == null || icons.size() == 0) {
- return null;
+ CImage icon = null;
+ try {
+ icon = CImage.getCreator().createFromImages(target.getIconImages());
+ } catch (Exception ignored) {
+ // Perhaps the icon passed into Java is broken. Skipping this icon.
}
- return CImage.getCreator().createFromImages(icons);
+ return icon;
}
/*
diff --git a/jdk/src/macosx/native/java/util/SCDynamicStoreConfig.m b/jdk/src/macosx/native/java/util/SCDynamicStoreConfig.m
index f6ad5e2e3fa..86e6a67d793 100644
--- a/jdk/src/macosx/native/java/util/SCDynamicStoreConfig.m
+++ b/jdk/src/macosx/native/java/util/SCDynamicStoreConfig.m
@@ -103,7 +103,6 @@ NSDictionary *realmConfigsForRealms(SCDynamicStoreRef store, NSArray *realms) {
CFTypeRef realmInfo = SCDynamicStoreCopyValue(store, (CFStringRef) [NSString stringWithFormat:@"Kerberos:%@", realm]);
if (CFGetTypeID(realmInfo) != CFDictionaryGetTypeID()) {
- NSLog(@"Unexpected CFType for realm Info: %lu", CFGetTypeID(realmInfo));
return nil;
}
@@ -140,7 +139,6 @@ JNF_COCOA_ENTER(env);
SCDynamicStoreRef store = SCDynamicStoreCreate(NULL, CFSTR("java"), _SCDynamicStoreCallBack, NULL);
if (store == NULL) {
- NSLog(@"Unable to load SCDynamicStore to install NotificationCallback");
return;
}
@@ -171,19 +169,11 @@ JNF_COCOA_ENTER(env);
SCDynamicStoreRef store = SCDynamicStoreCreate(NULL, CFSTR("java-kerberos"), NULL, NULL);
if (store == NULL) {
- NSLog(@"Unable to load SCDynamicStore");
- return NULL;
- }
-
- // Create the store if it is NULL and set it.
- if (store == NULL) {
- NSLog(@"Invalid value for SCDynamicStore");
return NULL;
}
CFTypeRef realms = SCDynamicStoreCopyValue(store, (CFStringRef) KERBEROS_DEFAULT_REALMS);
if (realms == NULL || CFGetTypeID(realms) != CFArrayGetTypeID()) {
- NSLog(@"Unable to load realm info from SCDynamicStore");
if (realms) CFRelease(realms);
CFRelease(store);
return NULL;
@@ -192,7 +182,6 @@ JNF_COCOA_ENTER(env);
CFTypeRef realmMappings = SCDynamicStoreCopyValue(store, (CFStringRef) KERBEROS_DEFAULT_REALM_MAPPINGS);
if (realmMappings == NULL || CFGetTypeID(realmMappings) != CFArrayGetTypeID()) {
- NSLog(@"Unable to load realm mapping info from SCDynamicStore");
if (realmMappings) CFRelease(realmMappings);
CFRelease(realms);
CFRelease(store);
diff --git a/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java b/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java
index 447eb395b69..2ea13fb3169 100644
--- a/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java
+++ b/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, 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
@@ -47,6 +47,10 @@ import javax.security.auth.PrivateCredentialPermission;
import sun.security.util.PropertyExpander;
+import sun.security.provider.PolicyParser.PrincipalEntry;
+import sun.security.provider.PolicyParser.GrantEntry;
+import sun.security.provider.PolicyParser.PermissionEntry;
+
/**
* This class represents a default implementation for
* javax.security.auth.Policy
.
@@ -469,7 +473,8 @@ public class PolicyFile extends javax.security.auth.Policy {
* @param policyFile the policy Reader object.
*/
private void init(URL policy) {
- PolicyParser pp = new PolicyParser(expandProperties);
+ sun.security.provider.PolicyParser pp =
+ new sun.security.provider.PolicyParser(expandProperties);
try {
InputStreamReader isr
= new InputStreamReader(getInputStream(policy));
@@ -477,12 +482,12 @@ public class PolicyFile extends javax.security.auth.Policy {
isr.close();
KeyStore keyStore = initKeyStore(policy, pp.getKeyStoreUrl(),
pp.getKeyStoreType());
- Enumeration enum_ = pp.grantElements();
+ Enumeration enum_ = pp.grantElements();
while (enum_.hasMoreElements()) {
- PolicyParser.GrantEntry ge = enum_.nextElement();
+ GrantEntry ge = enum_.nextElement();
addGrantEntry(ge, keyStore);
}
- } catch (PolicyParser.ParsingException pe) {
+ } catch (sun.security.provider.PolicyParser.ParsingException pe) {
System.err.println(AUTH_POLICY +
rb.getString(".error.parsing.") + policy);
System.err.println(AUTH_POLICY +
@@ -521,8 +526,8 @@ public class PolicyFile extends javax.security.auth.Policy {
*
* @return null if signedBy alias is not recognized
*/
- CodeSource getCodeSource(PolicyParser.GrantEntry ge, KeyStore keyStore)
- throws java.net.MalformedURLException
+ CodeSource getCodeSource(GrantEntry ge, KeyStore keyStore)
+ throws java.net.MalformedURLException
{
Certificate[] certs = null;
if (ge.signedBy != null) {
@@ -559,20 +564,18 @@ public class PolicyFile extends javax.security.auth.Policy {
/**
* Add one policy entry to the vector.
*/
- private void addGrantEntry(PolicyParser.GrantEntry ge,
- KeyStore keyStore) {
+ private void addGrantEntry(GrantEntry ge, KeyStore keyStore) {
if (debug != null) {
debug.println("Adding policy entry: ");
debug.println(" signedBy " + ge.signedBy);
debug.println(" codeBase " + ge.codeBase);
if (ge.principals != null && ge.principals.size() > 0) {
- ListIterator li =
- ge.principals.listIterator();
+ ListIterator li = ge.principals.listIterator();
while (li.hasNext()) {
- PolicyParser.PrincipalEntry pppe = li.next();
- debug.println(" " + pppe.principalClass +
- " " + pppe.principalName);
+ PrincipalEntry pppe = li.next();
+ debug.println(" " + pppe.getPrincipalClass() +
+ " " + pppe.getPrincipalName());
}
}
debug.println();
@@ -584,10 +587,9 @@ public class PolicyFile extends javax.security.auth.Policy {
if (codesource == null) return;
PolicyEntry entry = new PolicyEntry(codesource);
- Enumeration enum_ =
- ge.permissionElements();
+ Enumeration enum_ = ge.permissionElements();
while (enum_.hasMoreElements()) {
- PolicyParser.PermissionEntry pe = enum_.nextElement();
+ PermissionEntry pe = enum_.nextElement();
try {
// XXX special case PrivateCredentialPermission-SELF
Permission perm;
@@ -998,11 +1000,11 @@ public class PolicyFile extends javax.security.auth.Policy {
return true;
}
- ListIterator pli =
- scs.getPrincipals().listIterator();
+ ListIterator pli =
+ scs.getPrincipals().listIterator();
while (pli.hasNext()) {
- PolicyParser.PrincipalEntry principal = pli.next();
+ PrincipalEntry principal = pli.next();
// XXX
// if the Policy entry's Principal does not contain a
@@ -1050,30 +1052,29 @@ public class PolicyFile extends javax.security.auth.Policy {
* if (y == 1), it's the principal name.
*/
private String[][] getPrincipalInfo
- (PolicyParser.PrincipalEntry principal,
- final CodeSource accCs) {
+ (PrincipalEntry principal, final CodeSource accCs) {
// there are 3 possibilities:
// 1) the entry's Principal class and name are not wildcarded
// 2) the entry's Principal name is wildcarded only
// 3) the entry's Principal class and name are wildcarded
- if (!principal.principalClass.equals
- (PolicyParser.PrincipalEntry.WILDCARD_CLASS) &&
- !principal.principalName.equals
- (PolicyParser.PrincipalEntry.WILDCARD_NAME)) {
+ if (!principal.getPrincipalClass().equals
+ (PrincipalEntry.WILDCARD_CLASS) &&
+ !principal.getPrincipalName().equals
+ (PrincipalEntry.WILDCARD_NAME)) {
// build a PrivateCredentialPermission for the principal
// from the Policy entry
String[][] info = new String[1][2];
- info[0][0] = principal.principalClass;
- info[0][1] = principal.principalName;
+ info[0][0] = principal.getPrincipalClass();
+ info[0][1] = principal.getPrincipalName();
return info;
- } else if (!principal.principalClass.equals
- (PolicyParser.PrincipalEntry.WILDCARD_CLASS) &&
- principal.principalName.equals
- (PolicyParser.PrincipalEntry.WILDCARD_NAME)) {
+ } else if (!principal.getPrincipalClass().equals
+ (PrincipalEntry.WILDCARD_CLASS) &&
+ principal.getPrincipalName().equals
+ (PrincipalEntry.WILDCARD_NAME)) {
// build a PrivateCredentialPermission for all
// the Subject's principals that are instances of principalClass
@@ -1088,7 +1089,7 @@ public class PolicyFile extends javax.security.auth.Policy {
// If it doesn't, we should stop here with a ClassCastException.
@SuppressWarnings("unchecked")
Class extends Principal> pClass = (Class extends Principal>)
- Class.forName(principal.principalClass, false,
+ Class.forName(principal.getPrincipalClass(), false,
ClassLoader.getSystemClassLoader());
principalSet = scs.getSubject().getPrincipals(pClass);
} catch (Exception e) {
@@ -1387,6 +1388,7 @@ public class PolicyFile extends javax.security.auth.Policy {
}
}
+@SuppressWarnings("deprecation")
class PolicyPermissions extends PermissionCollection {
private static final long serialVersionUID = -1954188373270545523L;
diff --git a/jdk/src/share/classes/com/sun/security/auth/SubjectCodeSource.java b/jdk/src/share/classes/com/sun/security/auth/SubjectCodeSource.java
index 35d3bf1c410..7e38a087420 100644
--- a/jdk/src/share/classes/com/sun/security/auth/SubjectCodeSource.java
+++ b/jdk/src/share/classes/com/sun/security/auth/SubjectCodeSource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, 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
@@ -33,6 +33,7 @@ import java.security.cert.Certificate;
import java.lang.reflect.Constructor;
import javax.security.auth.Subject;
+import sun.security.provider.PolicyParser.PrincipalEntry;
/**
* This SubjectCodeSource
class contains
@@ -57,7 +58,7 @@ class SubjectCodeSource extends CodeSource implements java.io.Serializable {
});
private Subject subject;
- private LinkedList principals;
+ private LinkedList principals;
private static final Class[] PARAMS = { String.class };
private static final sun.security.util.Debug debug =
sun.security.util.Debug.getInstance("auth", "\t[Auth Access]");
@@ -87,14 +88,14 @@ class SubjectCodeSource extends CodeSource implements java.io.Serializable {
* SubjectCodeSource
*/
SubjectCodeSource(Subject subject,
- LinkedList principals,
+ LinkedList principals,
URL url, Certificate[] certs) {
super(url, certs);
this.subject = subject;
this.principals = (principals == null ?
- new LinkedList() :
- new LinkedList(principals));
+ new LinkedList() :
+ new LinkedList(principals));
sysClassLoader = java.security.AccessController.doPrivileged
(new java.security.PrivilegedAction() {
public ClassLoader run() {
@@ -114,7 +115,7 @@ class SubjectCodeSource extends CodeSource implements java.io.Serializable {
* SubjectCodeSource
as a LinkedList
* of PolicyParser.PrincipalEntry
objects.
*/
- LinkedList getPrincipals() {
+ LinkedList getPrincipals() {
return principals;
}
@@ -167,7 +168,7 @@ class SubjectCodeSource extends CodeSource implements java.io.Serializable {
*/
public boolean implies(CodeSource codesource) {
- LinkedList subjectList = null;
+ LinkedList subjectList = null;
if (codesource == null ||
!(codesource instanceof SubjectCodeSource) ||
@@ -197,20 +198,19 @@ class SubjectCodeSource extends CodeSource implements java.io.Serializable {
return false;
}
- ListIterator li =
- this.principals.listIterator(0);
+ ListIterator li = this.principals.listIterator(0);
while (li.hasNext()) {
- PolicyParser.PrincipalEntry pppe = li.next();
+ PrincipalEntry pppe = li.next();
try {
// handle PrincipalComparators
Class> principalComparator = Class.forName(
- pppe.principalClass, true, sysClassLoader);
+ pppe.getPrincipalClass(), true, sysClassLoader);
Constructor> c = principalComparator.getConstructor(PARAMS);
PrincipalComparator pc =
(PrincipalComparator)c.newInstance
- (new Object[] { pppe.principalName });
+ (new Object[] { pppe.getPrincipalName() });
if (!pc.implies(that.getSubject())) {
if (debug != null)
@@ -236,11 +236,10 @@ class SubjectCodeSource extends CodeSource implements java.io.Serializable {
Iterator i =
that.getSubject().getPrincipals().iterator();
- subjectList = new LinkedList();
+ subjectList = new LinkedList();
while (i.hasNext()) {
Principal p = i.next();
- PolicyParser.PrincipalEntry spppe =
- new PolicyParser.PrincipalEntry
+ PrincipalEntry spppe = new PrincipalEntry
(p.getClass().getName(), p.getName());
subjectList.add(spppe);
}
@@ -281,23 +280,19 @@ class SubjectCodeSource extends CodeSource implements java.io.Serializable {
* pppe argument.
*/
private boolean subjectListImpliesPrincipalEntry(
- LinkedList subjectList,
- PolicyParser.PrincipalEntry pppe) {
+ LinkedList subjectList, PrincipalEntry pppe) {
- ListIterator li =
- subjectList.listIterator(0);
+ ListIterator li = subjectList.listIterator(0);
while (li.hasNext()) {
- PolicyParser.PrincipalEntry listPppe = li.next();
+ PrincipalEntry listPppe = li.next();
- if (pppe.principalClass.equals
- (PolicyParser.PrincipalEntry.WILDCARD_CLASS) ||
- pppe.principalClass.equals
- (listPppe.principalClass)) {
-
- if (pppe.principalName.equals
- (PolicyParser.PrincipalEntry.WILDCARD_NAME) ||
- pppe.principalName.equals
- (listPppe.principalName))
+ if (pppe.getPrincipalClass().equals
+ (PrincipalEntry.WILDCARD_CLASS) ||
+ pppe.getPrincipalClass().equals(listPppe.getPrincipalClass()))
+ {
+ if (pppe.getPrincipalName().equals
+ (PrincipalEntry.WILDCARD_NAME) ||
+ pppe.getPrincipalName().equals(listPppe.getPrincipalName()))
return true;
}
}
@@ -390,13 +385,12 @@ class SubjectCodeSource extends CodeSource implements java.io.Serializable {
}
}
if (principals != null) {
- ListIterator li =
- principals.listIterator();
+ ListIterator li = principals.listIterator();
while (li.hasNext()) {
- PolicyParser.PrincipalEntry pppe = li.next();
+ PrincipalEntry pppe = li.next();
returnMe = returnMe + rb.getString("NEWLINE") +
- pppe.principalClass + " " +
- pppe.principalName;
+ pppe.getPrincipalClass() + " " +
+ pppe.getPrincipalName();
}
}
return returnMe;
diff --git a/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js b/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js
index 468d25ae172..f2c92ab4b0d 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js
+++ b/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js
@@ -151,7 +151,7 @@ function JavaClassProto() {
while (tmp != null) {
res[res.length] = tmp;
tmp = tmp.superclass;
- }
+ }
return res;
}
@@ -263,16 +263,19 @@ function wrapJavaObject(thing) {
if (name == 'class') {
return wrapJavaValue(instance.clazz);
- } else if (name == 'toString') {
- return function() {
- return instance.toString();
- }
} else if (name == 'wrapped-object') {
return instance;
}
return undefined;
- }
+ },
+ __call__: function(name) {
+ if (name == 'toString') {
+ return instance.toString();
+ } else {
+ return undefined;
+ }
+ }
}
}
@@ -297,7 +300,7 @@ function wrapJavaObject(thing) {
return true;
}
}
- return theJavaClassProto[name] != undefined;
+ return false;
},
__get__ : function(name) {
for (var i in fields) {
@@ -305,7 +308,7 @@ function wrapJavaObject(thing) {
return wrapJavaValue(fields[i].value);
}
}
- return theJavaClassProto[name];
+ return undefined;
}
}
@@ -322,7 +325,12 @@ function wrapJavaObject(thing) {
this.name = jclass.name;
this.fields = jclass.fields;
this['wrapped-object'] = jclass;
- this.__proto__ = this.statics;
+ }
+
+ for (var i in theJavaClassProto) {
+ if (typeof theJavaClassProto[i] == 'function') {
+ JavaClassWrapper.prototype[i] = theJavaClassProto[i];
+ }
}
// returns wrapper for Java object arrays
@@ -334,32 +342,35 @@ function wrapJavaObject(thing) {
__getIds__ : function() {
var res = new Array(elements.length);
for (var i = 0; i < elements.length; i++) {
- res[i] = i;
+ res[i] = String(i);
}
return res;
},
__has__: function(name) {
- return (typeof(name) == 'number' &&
- name >= 0 && name < elements.length) ||
+ return (name >= 0 && name < elements.length) ||
name == 'length' || name == 'class' ||
name == 'toString' || name == 'wrapped-object';
},
__get__ : function(name) {
- if (typeof(name) == 'number' &&
- name >= 0 && name < elements.length) {
+ if (name >= 0 && name < elements.length) {
return wrapJavaValue(elements[name]);
} else if (name == 'length') {
return elements.length;
} else if (name == 'class') {
return wrapJavaValue(array.clazz);
- } else if (name == 'toString') {
- return function() { return array.toString(); }
} else if (name == 'wrapped-object') {
return array;
} else {
return undefined;
}
- }
+ },
+ __call__: function(name) {
+ if (name == 'toString') {
+ return array.toString();
+ } else {
+ return undefined;
+ }
+ }
}
}
@@ -373,26 +384,22 @@ function wrapJavaObject(thing) {
__getIds__ : function() {
var r = new Array(array.length);
for (var i = 0; i < array.length; i++) {
- r[i] = i;
+ r[i] = String(i);
}
return r;
},
__has__: function(name) {
- return (typeof(name) == 'number' &&
- name >= 0 && name < array.length) ||
+ return (name >= 0 && name < array.length) ||
name == 'length' || name == 'class' ||
name == 'toString' || name == 'wrapped-object';
},
__get__: function(name) {
- if (typeof(name) == 'number' &&
- name >= 0 && name < array.length) {
+ if (name >= 0 && name < array.length) {
return elements[name];
}
if (name == 'length') {
return array.length;
- } else if (name == 'toString') {
- return function() { return array.valueString(true); }
} else if (name == 'wrapped-object') {
return array;
} else if (name == 'class') {
@@ -400,7 +407,14 @@ function wrapJavaObject(thing) {
} else {
return undefined;
}
- }
+ },
+ __call__: function(name) {
+ if (name == 'toString') {
+ return array.valueString(true);
+ } else {
+ return undefined;
+ }
+ }
}
}
return javaObject(thing);
@@ -673,34 +687,33 @@ function wrapHeapSnapshot(heap) {
__getIds__ : function() {
var res = new Array(path.length);
for (var i = 0; i < path.length; i++) {
- res[i] = i;
+ res[i] = String(i);
}
return res;
},
__has__ : function (name) {
- return (typeof(name) == 'number' &&
- name >= 0 && name < path.length) ||
+ return (name >= 0 && name < path.length) ||
name == 'length' || name == 'toHtml' ||
name == 'toString';
},
__get__ : function(name) {
- if (typeof(name) == 'number' &&
- name >= 0 && name < path.length) {
+ if (name >= 0 && name < path.length) {
return path[name];
} else if (name == 'length') {
return path.length;
- } else if (name == 'toHtml') {
- return function() {
- return computeDescription(true);
- }
- } else if (name == 'toString') {
- return function() {
- return computeDescription(false);
- }
} else {
return undefined;
}
},
+ __call__: function(name) {
+ if (name == 'toHtml') {
+ return computeDescription(true);
+ } else if (name == 'toString') {
+ return computeDescription(false);
+ } else {
+ return undefined;
+ }
+ }
};
}
@@ -1005,22 +1018,8 @@ function toHtml(obj) {
return "" +
name + "@" + id + "";
}
- } else if ((typeof(obj) == 'object') || (obj instanceof JSAdapter)) {
- if (obj instanceof java.lang.Object) {
- // script wrapped Java object
- obj = wrapIterator(obj);
- // special case for enumeration
- if (obj instanceof java.util.Enumeration) {
- var res = "[ ";
- while (obj.hasMoreElements()) {
- res += toHtml(obj.nextElement()) + ", ";
- }
- res += "]";
- return res;
- } else {
- return obj;
- }
- } else if (obj instanceof Array) {
+ } else if (obj instanceof Object) {
+ if (Array.isArray(obj)) {
// script array
var res = "[ ";
for (var i in obj) {
@@ -1047,8 +1046,19 @@ function toHtml(obj) {
}
}
} else {
- // JavaScript primitive value
- return obj;
+ // a Java object
+ obj = wrapIterator(obj);
+ // special case for enumeration
+ if (obj instanceof java.util.Enumeration) {
+ var res = "[ ";
+ while (obj.hasMoreElements()) {
+ res += toHtml(obj.nextElement()) + ", ";
+ }
+ res += "]";
+ return res;
+ } else {
+ return obj;
+ }
}
}
diff --git a/jdk/src/share/classes/com/sun/tools/hat/resources/oqlhelp.html b/jdk/src/share/classes/com/sun/tools/hat/resources/oqlhelp.html
index 3937f4a1c39..d660fd3cae8 100644
--- a/jdk/src/share/classes/com/sun/tools/hat/resources/oqlhelp.html
+++ b/jdk/src/share/classes/com/sun/tools/hat/resources/oqlhelp.html
@@ -79,7 +79,7 @@ bound to a JavaScript variable of the identifier name specified in
select s.value.toString() from java.lang.String s
- where /java/(s.value.toString())
+ where /java/.test(s.value.toString())
show path value of all File objects
@@ -219,7 +219,6 @@ Examples:
select heap.findClass("java.lang.System").statics.props
- select heap.findClass("java.lang.System").props
get number of fields of java.lang.String class
@@ -237,7 +236,7 @@ Examples:
select all classes that have name pattern java.net.*
- select filter(heap.classes(), "/java.net./(it.name)")
+ select filter(heap.classes(), "/java.net./.test(it.name)")
@@ -536,7 +535,7 @@ refer to the following built-in variables.
Example: print number of classes that have specific name pattern
- select count(heap.classes(), "/java.io./(it.name)")
+ select count(heap.classes(), "/java.io./.test(it.name)")
@@ -559,14 +558,14 @@ Examples:
show all classes that have java.io.* name pattern
- select filter(heap.classes(), "/java.io./(it.name)")
+ select filter(heap.classes(), "/java.io./.test(it.name)")
show all referrers of URL object where the referrer is not from
java.net package
- select filter(referrers(u), "! /java.net./(classof(it).name)")
+ select filter(referrers(u), "! /java.net./.test(classof(it).name)")
from java.net.URL u
@@ -619,13 +618,13 @@ Examples:
find the maximum length of any String instance
- select max(map(heap.objects('java.lang.String', false), 'it.count'))
+ select max(map(heap.objects('java.lang.String', false), 'it.value.length'))
find string instance that has the maximum length
- select max(heap.objects('java.lang.String'), 'lhs.count > rhs.count')
+ select max(heap.objects('java.lang.String'), 'lhs.value.length > rhs.value.length')
@@ -775,7 +774,7 @@ and walk until parent is null using the callback function to map call.
- select map(filter(heap.findClass('java.lang.System').props.table, 'it != null'),
+ select map(filter(heap.findClass('java.lang.System').statics.props.table, 'it != null'),
function (it) {
var res = "";
while (it != null) {
diff --git a/jdk/src/share/classes/java/applet/AppletContext.java b/jdk/src/share/classes/java/applet/AppletContext.java
index 87623ee334f..f28308cfb11 100644
--- a/jdk/src/share/classes/java/applet/AppletContext.java
+++ b/jdk/src/share/classes/java/applet/AppletContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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
@@ -56,7 +56,7 @@ public interface AppletContext {
/**
* Returns an Image
object that can then be painted on
- * the screen. The url
argument
that is
+ * the screen. The url
argument that is
* passed as an argument must specify an absolute URL.
*
* This method always returns immediately, whether or not the image
@@ -157,7 +157,7 @@ public interface AppletContext {
* @param stream stream to be associated with the specified key. If this
* parameter is null
, the specified key is removed
* in this applet context.
- * @throws IOException
if the stream size exceeds a certain
+ * @throws IOException if the stream size exceeds a certain
* size limit. Size limit is decided by the implementor of this
* interface.
* @since 1.4
diff --git a/jdk/src/share/classes/java/awt/event/ContainerListener.java b/jdk/src/share/classes/java/awt/event/ContainerListener.java
index d5c444ff184..6fb8321589b 100644
--- a/jdk/src/share/classes/java/awt/event/ContainerListener.java
+++ b/jdk/src/share/classes/java/awt/event/ContainerListener.java
@@ -42,7 +42,7 @@ import java.util.EventListener;
* Container events are provided for notification purposes ONLY;
* The AWT will automatically handle add and remove operations
* internally so the program works properly regardless of
- * whether the program registers a ComponentListener
or not.
+ * whether the program registers a {@code ContainerListener} or not.
*
* @see ContainerAdapter
* @see ContainerEvent
diff --git a/jdk/src/share/classes/java/awt/image/BufferStrategy.java b/jdk/src/share/classes/java/awt/image/BufferStrategy.java
index 82ad5e07d97..de7877330b9 100644
--- a/jdk/src/share/classes/java/awt/image/BufferStrategy.java
+++ b/jdk/src/share/classes/java/awt/image/BufferStrategy.java
@@ -55,7 +55,7 @@ import java.awt.Image;
* Alternatively, the contents of the back buffer can be copied, or
* blitted forward in a chain instead of moving the video pointer.
*
- *
+ * {@code
* Double buffering:
*
* *********** ***********
@@ -72,7 +72,7 @@ import java.awt.Image;
* * * <------ * * <----- * *
* *********** *********** ***********
*
- *
+ * }
*
* Here is an example of how buffer strategies can be created and used:
*
diff --git a/jdk/src/share/classes/java/awt/image/BufferedImage.java b/jdk/src/share/classes/java/awt/image/BufferedImage.java
index d510dcc1ba4..b4222b1e740 100644
--- a/jdk/src/share/classes/java/awt/image/BufferedImage.java
+++ b/jdk/src/share/classes/java/awt/image/BufferedImage.java
@@ -602,12 +602,12 @@ public class BufferedImage extends java.awt.Image
* the raster has been premultiplied with alpha.
* @param properties Hashtable
of
* String
/Object
pairs.
- * @exception RasterFormatException
if the number and
+ * @exception RasterFormatException if the number and
* types of bands in the SampleModel
of the
* Raster
do not match the number and types required by
* the ColorModel
to represent its color and alpha
* components.
- * @exception IllegalArgumentException
if
+ * @exception IllegalArgumentException if
* raster
is incompatible with cm
* @see ColorModel
* @see Raster
@@ -927,7 +927,7 @@ public class BufferedImage extends java.awt.Image
* each color component in the returned data when
* using this method. With a specified coordinate (x, y) in the
* image, the ARGB pixel can be accessed in this way:
- *
+ *
*
*
* pixel = rgbArray[offset + (y-startY)*scansize + (x-startX)];
@@ -1131,7 +1131,7 @@ public class BufferedImage extends java.awt.Image
* @return an {@link Object} that is the property referred to by the
* specified name
or null
if the
* properties of this image are not yet known.
- * @throws NullPointerException
if the property name is null.
+ * @throws NullPointerException if the property name is null.
* @see ImageObserver
* @see java.awt.Image#UndefinedProperty
*/
@@ -1144,7 +1144,7 @@ public class BufferedImage extends java.awt.Image
* @param name the property name
* @return an Object
that is the property referred to by
* the specified name
.
- * @throws NullPointerException
if the property name is null.
+ * @throws NullPointerException if the property name is null.
*/
public Object getProperty(String name) {
if (name == null) {
@@ -1196,7 +1196,7 @@ public class BufferedImage extends java.awt.Image
* @param h the height of the specified rectangular region
* @return a BufferedImage
that is the subimage of this
* BufferedImage
.
- * @exception RasterFormatException
if the specified
+ * @exception RasterFormatException if the specified
* area is not contained within this BufferedImage
.
*/
public BufferedImage getSubimage (int x, int y, int w, int h) {
@@ -1388,7 +1388,7 @@ public class BufferedImage extends java.awt.Image
* @param tileY the y index of the requested tile in the tile array
* @return a Raster
that is the tile defined by the
* arguments tileX
and tileY
.
- * @exception ArrayIndexOutOfBoundsException
if both
+ * @exception ArrayIndexOutOfBoundsException if both
* tileX
and tileY
are not
* equal to 0
*/
@@ -1558,7 +1558,7 @@ public class BufferedImage extends java.awt.Image
* @return true
if the tile specified by the specified
* indices is checked out for writing; false
* otherwise.
- * @exception ArrayIndexOutOfBoundsException
if both
+ * @exception ArrayIndexOutOfBoundsException if both
* tileX
and tileY
are not equal
* to 0
*/
diff --git a/jdk/src/share/classes/java/awt/image/ByteLookupTable.java b/jdk/src/share/classes/java/awt/image/ByteLookupTable.java
index 6f7e67d7432..35968d62ac8 100644
--- a/jdk/src/share/classes/java/awt/image/ByteLookupTable.java
+++ b/jdk/src/share/classes/java/awt/image/ByteLookupTable.java
@@ -171,7 +171,7 @@ public class ByteLookupTable extends LookupTable {
* @exception ArrayIndexOutOfBoundsException if src
is
* longer than dst
or if for any element
* i
of src
,
- * (src[i]&0xff)-offset
is either less than
+ * {@code (src[i]&0xff)-offset} is either less than
* zero or greater than or equal to the length of the
* lookup table for any band.
*/
diff --git a/jdk/src/share/classes/java/awt/image/ColorModel.java b/jdk/src/share/classes/java/awt/image/ColorModel.java
index 5ce313e1bf3..73f5b49fc28 100644
--- a/jdk/src/share/classes/java/awt/image/ColorModel.java
+++ b/jdk/src/share/classes/java/awt/image/ColorModel.java
@@ -692,12 +692,12 @@ public abstract class ColorModel implements Transparency{
* DataBuffer.TYPE_INT
.
* @param inData an array of pixel values
* @return the value of the green component of the specified pixel.
- * @throws ClassCastException
if inData
+ * @throws ClassCastException if inData
* is not a primitive array of type transferType
- * @throws ArrayIndexOutOfBoundsException
if
+ * @throws ArrayIndexOutOfBoundsException if
* inData
is not large enough to hold a pixel value
* for this ColorModel
- * @throws UnsupportedOperationException
if this
+ * @throws UnsupportedOperationException if this
* tranferType
is not supported by this
* ColorModel
*/
diff --git a/jdk/src/share/classes/java/awt/image/DirectColorModel.java b/jdk/src/share/classes/java/awt/image/DirectColorModel.java
index 751d780ba64..2ddd85c1ad1 100644
--- a/jdk/src/share/classes/java/awt/image/DirectColorModel.java
+++ b/jdk/src/share/classes/java/awt/image/DirectColorModel.java
@@ -642,12 +642,12 @@ public class DirectColorModel extends PackedColorModel {
* @param inData the specified pixel
* @return the alpha component of the specified pixel, scaled from
* 0 to 255.
- * @exception ClassCastException
if inData
+ * @exception ClassCastException if inData
* is not a primitive array of type transferType
- * @exception ArrayIndexOutOfBoundsException
if
+ * @exception ArrayIndexOutOfBoundsException if
* inData
is not large enough to hold a pixel value
* for this ColorModel
- * @exception UnsupportedOperationException
if this
+ * @exception UnsupportedOperationException if this
* tranferType
is not supported by this
* ColorModel
*/
@@ -1055,7 +1055,7 @@ public class DirectColorModel extends PackedColorModel {
* begin retrieving the color and alpha components
* @return an int
pixel value in this
* ColorModel
corresponding to the specified components.
- * @exception ArrayIndexOutOfBoundsException
if
+ * @exception ArrayIndexOutOfBoundsException if
* the components
array is not large enough to
* hold all of the color and alpha components starting at
* offset
@@ -1097,9 +1097,9 @@ public class DirectColorModel extends PackedColorModel {
* and alpha components
* @return an Object
representing an array of color and
* alpha components.
- * @exception ClassCastException
if obj
+ * @exception ClassCastException if obj
* is not a primitive array of type transferType
- * @exception ArrayIndexOutOfBoundsException
if
+ * @exception ArrayIndexOutOfBoundsException if
* obj
is not large enough to hold a pixel value
* for this ColorModel
or the components
* array is not large enough to hold all of the color and alpha
diff --git a/jdk/src/share/classes/java/awt/image/ImageProducer.java b/jdk/src/share/classes/java/awt/image/ImageProducer.java
index 768aad50dd9..a419f8bd644 100644
--- a/jdk/src/share/classes/java/awt/image/ImageProducer.java
+++ b/jdk/src/share/classes/java/awt/image/ImageProducer.java
@@ -100,11 +100,11 @@ public interface ImageProducer {
* ImageProducer
should respond by executing
* the following minimum set of ImageConsumer
* method calls:
- *
+ * {@code
* ic.setHints(TOPDOWNLEFTRIGHT | < otherhints >);
* ic.setPixels(...); // As many times as needed
* ic.imageComplete();
- *
+ * }
* @param ic the specified ImageConsumer
* @see ImageConsumer#setHints
*/
diff --git a/jdk/src/share/classes/java/awt/image/IndexColorModel.java b/jdk/src/share/classes/java/awt/image/IndexColorModel.java
index fabe8d20432..d26e3d381be 100644
--- a/jdk/src/share/classes/java/awt/image/IndexColorModel.java
+++ b/jdk/src/share/classes/java/awt/image/IndexColorModel.java
@@ -98,6 +98,7 @@ import java.math.BigInteger;
* Index values greater than or equal to the map size, but less than
* 2n, are undefined and return 0 for all color and
* alpha components.
+ *
*
* For those methods that use a primitive array pixel representation of
* type transferType
, the array length is always one.
diff --git a/jdk/src/share/classes/java/awt/image/MemoryImageSource.java b/jdk/src/share/classes/java/awt/image/MemoryImageSource.java
index b5fd99b475f..90519ce26e4 100644
--- a/jdk/src/share/classes/java/awt/image/MemoryImageSource.java
+++ b/jdk/src/share/classes/java/awt/image/MemoryImageSource.java
@@ -37,7 +37,7 @@ import java.util.Enumeration;
* uses an array to produce pixel values for an Image. Here is an example
* which calculates a 100x100 image representing a fade from black to blue
* along the X axis and a fade from black to red along the Y axis:
- *
+ * {@code
*
* int w = 100;
* int h = 100;
@@ -52,12 +52,12 @@ import java.util.Enumeration;
* }
* Image img = createImage(new MemoryImageSource(w, h, pix, 0, w));
*
- *
+ * }
* The MemoryImageSource is also capable of managing a memory image which
* varies over time to allow animation or custom rendering. Here is an
* example showing how to set up the animation source and signal changes
* in the data (adapted from the MemoryAnimationSourceDemo by Garth Dickie):
- *
+ * {@code
*
* int pixels[];
* MemoryImageSource source;
@@ -96,7 +96,7 @@ import java.util.Enumeration;
* }
* }
*
- *
+ * }
*
* @see ImageProducer
*
diff --git a/jdk/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java b/jdk/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java
index 43d3a8080ba..8095dad2fc5 100644
--- a/jdk/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java
+++ b/jdk/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java
@@ -52,14 +52,14 @@ package java.awt.image;
* x, y
from DataBuffer
data
* and storing the pixel data in data elements of type
* dataType
:
- *
+ * {@code
* int dataElementSize = DataBuffer.getDataTypeSize(dataType);
* int bitnum = dataBitOffset + x*pixelBitStride;
* int element = data.getElem(y*scanlineStride + bitnum/dataElementSize);
* int shift = dataElementSize - (bitnum & (dataElementSize-1))
* - pixelBitStride;
* int pixel = (element >> shift) & ((1 << pixelBitStride) - 1);
- *
+ * }
*/
public class MultiPixelPackedSampleModel extends SampleModel
diff --git a/jdk/src/share/classes/java/awt/image/PixelGrabber.java b/jdk/src/share/classes/java/awt/image/PixelGrabber.java
index 85dde7875ce..2053ed71bdc 100644
--- a/jdk/src/share/classes/java/awt/image/PixelGrabber.java
+++ b/jdk/src/share/classes/java/awt/image/PixelGrabber.java
@@ -35,7 +35,7 @@ import java.awt.Image;
* The PixelGrabber class implements an ImageConsumer which can be attached
* to an Image or ImageProducer object to retrieve a subset of the pixels
* in that image. Here is an example:
- *
+ * {@code
*
* public void handlesinglepixel(int x, int y, int pixel) {
* int alpha = (pixel >> 24) & 0xff;
@@ -65,7 +65,7 @@ import java.awt.Image;
* }
* }
*
- *
+ * }
*
* @see ColorModel#getRGBdefault
*
@@ -165,8 +165,8 @@ public class PixelGrabber implements ImageConsumer {
* accumulated in the default RGB ColorModel. If the forceRGB
* parameter is true, then the pixels will be accumulated in the
* default RGB ColorModel anyway. A buffer is allocated by the
- * PixelGrabber to hold the pixels in either case. If (w < 0) or
- * (h < 0), then they will default to the remaining width and
+ * PixelGrabber to hold the pixels in either case. If {@code (w < 0)} or
+ * {@code (h < 0)}, then they will default to the remaining width and
* height of the source data when that information is delivered.
* @param img the image to retrieve the image data from
* @param x the x coordinate of the upper left corner of the rectangle
@@ -233,10 +233,10 @@ public class PixelGrabber implements ImageConsumer {
* behaves in the following ways, depending on the value of
* ms
:
*
- * - If
ms
== 0, waits until all pixels are delivered
- * - If
ms
> 0, waits until all pixels are delivered
+ * - If {@code ms == 0}, waits until all pixels are delivered
+ *
- If {@code ms > 0}, waits until all pixels are delivered
* as timeout expires.
- *
- If
ms
< 0, returns true
if all pixels
+ * - If {@code ms < 0}, returns
true
if all pixels
* are grabbed, false
otherwise and does not wait.
*
* @param ms the number of milliseconds to wait for the image pixels
diff --git a/jdk/src/share/classes/java/awt/image/RGBImageFilter.java b/jdk/src/share/classes/java/awt/image/RGBImageFilter.java
index 59d77e3428d..2f807ddf50f 100644
--- a/jdk/src/share/classes/java/awt/image/RGBImageFilter.java
+++ b/jdk/src/share/classes/java/awt/image/RGBImageFilter.java
@@ -39,7 +39,7 @@ import java.awt.image.ColorModel;
* The only method which needs to be defined to create a useable image
* filter is the filterRGB method. Here is an example of a definition
* of a filter which swaps the red and blue components of an image:
- *
+ * {@code
*
* class RedBlueSwapFilter extends RGBImageFilter {
* public RedBlueSwapFilter() {
@@ -56,7 +56,7 @@ import java.awt.image.ColorModel;
* }
* }
*
- *
+ * }
*
* @see FilteredImageSource
* @see ImageFilter
diff --git a/jdk/src/share/classes/java/awt/image/ShortLookupTable.java b/jdk/src/share/classes/java/awt/image/ShortLookupTable.java
index 09309e0045e..f0c18e0878e 100644
--- a/jdk/src/share/classes/java/awt/image/ShortLookupTable.java
+++ b/jdk/src/share/classes/java/awt/image/ShortLookupTable.java
@@ -114,7 +114,7 @@ public class ShortLookupTable extends LookupTable {
* @exception ArrayIndexOutOfBoundsException if src
is
* longer than dst
or if for any element
* i
of src
,
- * (src[i]&0xffff)-offset
is either less than
+ * {@code (src[i]&0xffff)-offset} is either less than
* zero or greater than or equal to the length of the
* lookup table for any band.
*/
@@ -165,7 +165,7 @@ public class ShortLookupTable extends LookupTable {
* @exception ArrayIndexOutOfBoundsException if src
is
* longer than dst
or if for any element
* i
of src
,
- * (src[i]&0xffff)-offset
is either less than
+ * {@code (src[i]&0xffff)-offset} is either less than
* zero or greater than or equal to the length of the
* lookup table for any band.
*/
diff --git a/jdk/src/share/classes/java/awt/image/SinglePixelPackedSampleModel.java b/jdk/src/share/classes/java/awt/image/SinglePixelPackedSampleModel.java
index b99eda6c79e..58c1db0b726 100644
--- a/jdk/src/share/classes/java/awt/image/SinglePixelPackedSampleModel.java
+++ b/jdk/src/share/classes/java/awt/image/SinglePixelPackedSampleModel.java
@@ -57,10 +57,10 @@ import java.util.Arrays;
* The following code illustrates extracting the bits of the sample
* representing band b
for pixel x,y
* from DataBuffer data
:
- *
+ * {@code
* int sample = data.getElem(y * scanlineStride + x);
* sample = (sample & bitMasks[b]) >>> bitOffsets[b];
- *
+ * }
*/
public class SinglePixelPackedSampleModel extends SampleModel
diff --git a/jdk/src/share/classes/java/awt/image/WritableRaster.java b/jdk/src/share/classes/java/awt/image/WritableRaster.java
index d38d7af3f60..190596af0a2 100644
--- a/jdk/src/share/classes/java/awt/image/WritableRaster.java
+++ b/jdk/src/share/classes/java/awt/image/WritableRaster.java
@@ -372,13 +372,13 @@ public class WritableRaster extends Raster {
* integral type and less than or equal to 32 bits in size, then calling
* this method is equivalent to executing the following code for all
* x,y
addresses valid in both Rasters.
- *
+ * {@code
* Raster srcRaster;
* WritableRaster dstRaster;
* for (int b = 0; b < srcRaster.getNumBands(); b++) {
* dstRaster.setSample(x, y, b, srcRaster.getSample(x, y, b));
* }
- *
+ * }
* Thus, when copying an integral type source to an integral type
* destination, if the source sample size is greater than the destination
* sample size for a particular band, the high order bits of the source
diff --git a/jdk/src/share/classes/java/beans/AppletInitializer.java b/jdk/src/share/classes/java/beans/AppletInitializer.java
index 9e4b7239d61..2c271a236ca 100644
--- a/jdk/src/share/classes/java/beans/AppletInitializer.java
+++ b/jdk/src/share/classes/java/beans/AppletInitializer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -68,7 +68,6 @@ public interface AppletInitializer {
* the Applet with its Container during the subsequent invocation of its
* addChildren() method.
*
- *
*
* @param newAppletBean The newly instantiated JavaBean
* @param bCtxt The BeanContext intended for this Applet, or
diff --git a/jdk/src/share/classes/java/beans/Beans.java b/jdk/src/share/classes/java/beans/Beans.java
index a457fa41805..5bf13fa7d09 100644
--- a/jdk/src/share/classes/java/beans/Beans.java
+++ b/jdk/src/share/classes/java/beans/Beans.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, 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
@@ -64,7 +64,7 @@ public class Beans {
*
* Instantiate a JavaBean.
*
- *
+ * @return a JavaBean
* @param cls the class-loader from which we should create
* the bean. If this is null, then the system
* class-loader is used.
@@ -84,6 +84,7 @@ public class Beans {
*
* Instantiate a JavaBean.
*
+ * @return a JavaBean
*
* @param cls the class-loader from which we should create
* the bean. If this is null, then the system
@@ -139,6 +140,7 @@ public class Beans {
* the JDK appletviewer (for a reference browser environment) and the
* BDK BeanBox (for a reference bean container).
*
+ * @return a JavaBean
* @param cls the class-loader from which we should create
* the bean. If this is null, then the system
* class-loader is used.
@@ -367,6 +369,8 @@ public class Beans {
* This method is provided in Beans 1.0 as a hook to allow the
* addition of more flexible bean behaviour in the future.
*
+ * @return an object representing a specified type view of the
+ * source object
* @param bean Object from which we want to obtain a view.
* @param targetType The type of view we'd like to get.
*
@@ -390,7 +394,6 @@ public class Beans {
return Introspector.isSubclass(bean.getClass(), targetType);
}
-
/**
* Test if we are in design-mode.
*
diff --git a/jdk/src/share/classes/java/beans/ConstructorProperties.java b/jdk/src/share/classes/java/beans/ConstructorProperties.java
index 3166de31747..5ee947c1f1c 100644
--- a/jdk/src/share/classes/java/beans/ConstructorProperties.java
+++ b/jdk/src/share/classes/java/beans/ConstructorProperties.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2013, 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
@@ -61,7 +61,7 @@ import static java.lang.annotation.RetentionPolicy.*;
the {@code getY()} method. Since parameter names are not in
general available at runtime, without the annotation there would be
no way to know whether the parameters correspond to {@code getX()}
- and {@code getY()} or the other way around.
+ and {@code getY()} or the other way around.
@since 1.6
*/
diff --git a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java
index 6891692c30b..6d667c56f2d 100644
--- a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java
+++ b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, 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
@@ -385,6 +385,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate {
* a class such that no property value depends on the value of
* a subsequent property.
*
+ * @param type the type of the instances
* @param oldInstance The instance to be copied.
* @param newInstance The instance that is to be modified.
* @param out The stream to which any initialization statements should be written.
diff --git a/jdk/src/share/classes/java/beans/EventHandler.java b/jdk/src/share/classes/java/beans/EventHandler.java
index b7635c931b7..b428f2892a1 100644
--- a/jdk/src/share/classes/java/beans/EventHandler.java
+++ b/jdk/src/share/classes/java/beans/EventHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, 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
@@ -515,6 +515,7 @@ public class EventHandler implements InvocationHandler {
*
*
*
+ * @param the type to create
* @param listenerInterface the listener interface to create a proxy for
* @param target the object that will perform the action
* @param action the name of a (possibly qualified) property or method on
@@ -570,6 +571,7 @@ public class EventHandler implements InvocationHandler {
*
*
*
+ * @param the type to create
* @param listenerInterface the listener interface to create a proxy for
* @param target the object that will perform the action
* @param action the name of a (possibly qualified) property or method on
@@ -659,6 +661,7 @@ public class EventHandler implements InvocationHandler {
*
*
*
+ * @param the type to create
* @param listenerInterface the listener interface to create a proxy for
* @param target the object that will perform the action
* @param action the name of a (possibly qualified) property or method on
diff --git a/jdk/src/share/classes/java/beans/Expression.java b/jdk/src/share/classes/java/beans/Expression.java
index f7a15c3464a..ce6fafb104e 100644
--- a/jdk/src/share/classes/java/beans/Expression.java
+++ b/jdk/src/share/classes/java/beans/Expression.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, 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
@@ -139,7 +139,7 @@ public class Expression extends Statement {
* replaces this default value in the same way that any other value
* would, ensuring that expressions are never evaluated more than once.
*
- * See the excecute
method for details on how
+ * See the execute
method for details on how
* methods are chosen using the dynamic types of the target
* and arguments.
*
@@ -147,6 +147,8 @@ public class Expression extends Statement {
* @see #setValue
*
* @return The result of applying this method to these arguments.
+ * @throws Exception if the method with the specified methodName
+ * throws an exception
*/
public Object getValue() throws Exception {
if (value == unbound) {
diff --git a/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java b/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java
index d3f16d2901e..1d59f7afddb 100644
--- a/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java
+++ b/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java
@@ -207,6 +207,8 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor {
* Sets the method that should be used to read an indexed property value.
*
* @param readMethod The new indexed read method.
+ * @throws IntrospectionException if an exception occurs during
+ * introspection.
*/
public synchronized void setIndexedReadMethod(Method readMethod)
throws IntrospectionException {
@@ -285,6 +287,8 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor {
* Sets the method that should be used to write an indexed property value.
*
* @param writeMethod The new indexed write method.
+ * @throws IntrospectionException if an exception occurs during
+ * introspection.
*/
public synchronized void setIndexedWriteMethod(Method writeMethod)
throws IntrospectionException {
diff --git a/jdk/src/share/classes/java/beans/Introspector.java b/jdk/src/share/classes/java/beans/Introspector.java
index 783fcbef315..acc0f77f389 100644
--- a/jdk/src/share/classes/java/beans/Introspector.java
+++ b/jdk/src/share/classes/java/beans/Introspector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, 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
@@ -93,8 +93,17 @@ import sun.reflect.misc.ReflectUtil;
public class Introspector {
// Flags that can be used to control getBeanInfo:
+ /**
+ * Flag to indicate to use of all beaninfo.
+ */
public final static int USE_ALL_BEANINFO = 1;
+ /**
+ * Flag to indicate to ignore immediate beaninfo.
+ */
public final static int IGNORE_IMMEDIATE_BEANINFO = 2;
+ /**
+ * Flag to indicate to ignore all beaninfo.
+ */
public final static int IGNORE_ALL_BEANINFO = 3;
// Static Caches to speed up introspection.
@@ -202,7 +211,7 @@ public class Introspector {
* If the BeanInfo class for a Java Bean has been previously Introspected
* based on the same arguments, then the BeanInfo class is retrieved
* from the BeanInfo cache.
- *
+ * @return the BeanInfo for the bean
* @param beanClass The bean class to be analyzed.
* @param stopClass The baseclass at which to stop the analysis. Any
* methods/properties/events in the stopClass or in its baseclasses
diff --git a/jdk/src/share/classes/java/beans/PersistenceDelegate.java b/jdk/src/share/classes/java/beans/PersistenceDelegate.java
index 01c5bb12387..bbdcdbf060c 100644
--- a/jdk/src/share/classes/java/beans/PersistenceDelegate.java
+++ b/jdk/src/share/classes/java/beans/PersistenceDelegate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, 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
@@ -197,6 +197,7 @@ public abstract class PersistenceDelegate {
* The default implementation, calls the initialize
* method of the type's superclass.
*
+ * @param type the type of the instances
* @param oldInstance The instance to be copied.
* @param newInstance The instance that is to be modified.
* @param out The stream to which any initialization statements should be written.
diff --git a/jdk/src/share/classes/java/beans/PropertyChangeSupport.java b/jdk/src/share/classes/java/beans/PropertyChangeSupport.java
index c3c73179b1a..d55ae76efc8 100644
--- a/jdk/src/share/classes/java/beans/PropertyChangeSupport.java
+++ b/jdk/src/share/classes/java/beans/PropertyChangeSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, 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
@@ -156,7 +156,7 @@ public class PropertyChangeSupport implements Serializable {
* PropertyChangeListenerProxy
, perform the cast, and examine
* the parameter.
*
- *
+ * {@code
* PropertyChangeListener[] listeners = bean.getPropertyChangeListeners();
* for (int i = 0; i < listeners.length; i++) {
* if (listeners[i] instanceof PropertyChangeListenerProxy) {
@@ -168,7 +168,7 @@ public class PropertyChangeSupport implements Serializable {
* }
* }
* }
- *
+ * }
*
* @see PropertyChangeListenerProxy
* @return all of the PropertyChangeListeners
added or an
diff --git a/jdk/src/share/classes/java/beans/PropertyDescriptor.java b/jdk/src/share/classes/java/beans/PropertyDescriptor.java
index 0abdcad972b..c519b504d58 100644
--- a/jdk/src/share/classes/java/beans/PropertyDescriptor.java
+++ b/jdk/src/share/classes/java/beans/PropertyDescriptor.java
@@ -243,6 +243,7 @@ public class PropertyDescriptor extends FeatureDescriptor {
* Sets the method that should be used to read the property value.
*
* @param readMethod The new read method.
+ * @throws IntrospectionException if the read method is invalid
*/
public synchronized void setReadMethod(Method readMethod)
throws IntrospectionException {
@@ -313,6 +314,7 @@ public class PropertyDescriptor extends FeatureDescriptor {
* Sets the method that should be used to write the property value.
*
* @param writeMethod The new write method.
+ * @throws IntrospectionException if the write method is invalid
*/
public synchronized void setWriteMethod(Method writeMethod)
throws IntrospectionException {
diff --git a/jdk/src/share/classes/java/beans/Transient.java b/jdk/src/share/classes/java/beans/Transient.java
index 0a2761ce8b9..165621b39fd 100644
--- a/jdk/src/share/classes/java/beans/Transient.java
+++ b/jdk/src/share/classes/java/beans/Transient.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2013, 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
@@ -40,7 +40,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* A {@code true} value for the "transient" attribute
* indicates to encoders derived from {@link Encoder}
* that this feature should be ignored.
- *
+ *
* The {@code Transient} annotation may be be used
* in any of the methods that are involved
* in a {@link FeatureDescriptor} subclass
@@ -49,7 +49,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* to put the annotation and it is this declaration
* that takes precedence in the case of multiple annotations
* being defined for the same feature.
- *
+ *
* To declare a feature non-transient in a class
* whose superclass declares it transient,
* use {@code @Transient(false)}.
@@ -64,5 +64,11 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Target({METHOD})
@Retention(RUNTIME)
public @interface Transient {
+ /**
+ * Returns whether or not the {@code Introspector} should
+ * construct artifacts for the annotated method.
+ * @return whether or not the {@code Introspector} should
+ * construct artifacts for the annotated method
+ */
boolean value() default true;
}
diff --git a/jdk/src/share/classes/java/beans/VetoableChangeSupport.java b/jdk/src/share/classes/java/beans/VetoableChangeSupport.java
index 6b7e268eba7..293ae5af2c6 100644
--- a/jdk/src/share/classes/java/beans/VetoableChangeSupport.java
+++ b/jdk/src/share/classes/java/beans/VetoableChangeSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@ import java.util.Map.Entry;
*
* Here is an example of {@code VetoableChangeSupport} usage that follows
* the rules and recommendations laid out in the JavaBeans™ specification:
- *
+ * {@code
* public class MyBean {
* private final VetoableChangeSupport vcs = new VetoableChangeSupport(this);
*
@@ -68,7 +68,7 @@ import java.util.Map.Entry;
*
* [...]
* }
- *
+ * }
*
* A {@code VetoableChangeSupport} instance is thread-safe.
*
@@ -156,7 +156,7 @@ public class VetoableChangeSupport implements Serializable {
* VetoableChangeListenerProxy
, perform the cast, and examine
* the parameter.
*
- *
+ * {@code
* VetoableChangeListener[] listeners = bean.getVetoableChangeListeners();
* for (int i = 0; i < listeners.length; i++) {
* if (listeners[i] instanceof VetoableChangeListenerProxy) {
@@ -168,7 +168,7 @@ public class VetoableChangeSupport implements Serializable {
* }
* }
* }
- *
+ * }
*
* @see VetoableChangeListenerProxy
* @return all of the VetoableChangeListeners
added or an
diff --git a/jdk/src/share/classes/java/beans/beancontext/BeanContext.java b/jdk/src/share/classes/java/beans/beancontext/BeanContext.java
index c6217289faf..308147b9e3c 100644
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContext.java
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -64,10 +64,12 @@ public interface BeanContext extends BeanContextChild, Collection, DesignMode, V
* and is defined by the
* java.beans.Beans.instantiate()
method.
*
+ * @return a javaBean named as a child of this
+ * BeanContext
* @param beanName The name of the JavaBean to instantiate
* as a child of this BeanContext
- * @throws IOException
- * @throws ClassNotFoundException
if the class identified
+ * @throws IOException if an IO problem occurs
+ * @throws ClassNotFoundException if the class identified
* by the beanName parameter is not found
*/
Object instantiateChild(String beanName) throws IOException, ClassNotFoundException;
@@ -83,7 +85,7 @@ public interface BeanContext extends BeanContextChild, Collection, DesignMode, V
* @return an InputStream
for reading the resource,
* or null
if the resource could not
* be found.
- * @throws IllegalArgumentException
if
+ * @throws IllegalArgumentException if
* the resource is not valid
*/
InputStream getResourceAsStream(String name, BeanContextChild bcc) throws IllegalArgumentException;
@@ -98,7 +100,7 @@ public interface BeanContext extends BeanContextChild, Collection, DesignMode, V
* @param bcc the specified child
* @return a URL
for the named
* resource for the specified child
- * @throws IllegalArgumentException
+ * @throws IllegalArgumentException
* if the resource is not valid
*/
URL getResource(String name, BeanContextChild bcc) throws IllegalArgumentException;
@@ -109,7 +111,7 @@ public interface BeanContext extends BeanContextChild, Collection, DesignMode, V
* this BeanContext
whenever it adds
* or removes a child Component
(s).
*
- * @param bcml the BeanContextMembershipListener
to be added
+ * @param bcml the BeanContextMembershipListener to be added
*/
void addBeanContextMembershipListener(BeanContextMembershipListener bcml);
diff --git a/jdk/src/share/classes/java/beans/beancontext/BeanContextChild.java b/jdk/src/share/classes/java/beans/beancontext/BeanContextChild.java
index 841e3ccbc5e..e84b7a7eeb5 100644
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextChild.java
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextChild.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -82,7 +82,7 @@ public interface BeanContextChild {
*
* @param bc The BeanContext
with which
* to associate this BeanContextChild
.
- * @throws PropertyVetoException
if the
+ * @throws PropertyVetoException if the
* addition of the specified BeanContext
is refused.
*/
void setBeanContext(BeanContext bc) throws PropertyVetoException;
diff --git a/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java b/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java
index 056913b654a..b2b855867b5 100644
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextChildSupport.java
@@ -78,6 +78,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer
* construct a BeanContextChildSupport where the JavaBean component
* itself implements BeanContextChild, and encapsulates this, delegating
* that interface to this implementation
+ * @param bcc the underlying bean context child
*/
public BeanContextChildSupport(BeanContextChild bcc) {
@@ -94,7 +95,7 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer
* this BeanContextChildSupport
.
* @param bc the new value to be assigned to the BeanContext
* property
- * @throws PropertyVetoException
if the change is rejected
+ * @throws PropertyVetoException if the change is rejected
*/
public synchronized void setBeanContext(BeanContext bc) throws PropertyVetoException {
if (bc == beanContext) return;
@@ -361,6 +362,9 @@ public class BeanContextChildSupport implements BeanContextChild, BeanContextSer
*/
protected VetoableChangeSupport vcSupport;
+ /**
+ * The bean context.
+ */
protected transient BeanContext beanContext;
/**
diff --git a/jdk/src/share/classes/java/beans/beancontext/BeanContextMembershipEvent.java b/jdk/src/share/classes/java/beans/beancontext/BeanContextMembershipEvent.java
index 6b5f4f5609c..24406d4e7db 100644
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextMembershipEvent.java
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextMembershipEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -103,6 +103,7 @@ public class BeanContextMembershipEvent extends BeanContextEvent {
* Is the child specified affected by the event?
* @return true
if affected, false
* if not
+ * @param child the object to check for being affected
*/
public boolean contains(Object child) {
return children.contains(child);
diff --git a/jdk/src/share/classes/java/beans/beancontext/BeanContextServices.java b/jdk/src/share/classes/java/beans/beancontext/BeanContextServices.java
index 168056c260d..0348817bfe8 100644
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextServices.java
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextServices.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, 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
@@ -60,6 +60,7 @@ public interface BeanContextServices extends BeanContext, BeanContextServicesLis
* @param serviceClass the service to add
* @param serviceProvider the BeanContextServiceProvider
* associated with the service
+ * @return true if the service was successful added, false otherwise
*/
boolean addService(Class serviceClass, BeanContextServiceProvider serviceProvider);
@@ -108,7 +109,7 @@ public interface BeanContextServices extends BeanContext, BeanContextServicesLis
* @param bcsrl the
* BeanContextServiceRevokedListener
to notify
* if the service should later become revoked
- * @throws TooManyListenersException
+ * @throws TooManyListenersException if there are too many listeners
* @return a reference to this context's named
* Service as requested or null
*/
diff --git a/jdk/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java b/jdk/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java
index 94d104b14bd..ca0942efef9 100644
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextServicesSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, 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
@@ -603,12 +603,16 @@ public class BeanContextServicesSupport extends BeanContextSupport
serviceProvider = bcsp;
}
+ /**
+ * Returns the service provider.
+ * @return the service provider
+ */
protected BeanContextServiceProvider getServiceProvider() {
return serviceProvider;
}
- /*
- * fields
+ /**
+ * The service provider.
*/
protected BeanContextServiceProvider serviceProvider;
@@ -618,6 +622,9 @@ public class BeanContextServicesSupport extends BeanContextSupport
* subclasses can override this method to create new subclasses of
* BCSSServiceProvider without having to overrride addService() in
* order to instantiate.
+ * @param sc the class
+ * @param bcsp the service provider
+ * @return a service provider without overriding addService()
*/
protected BCSSServiceProvider createBCSSServiceProvider(Class sc, BeanContextServiceProvider bcsp) {
@@ -629,7 +636,7 @@ public class BeanContextServicesSupport extends BeanContextSupport
/**
* add a BeanContextServicesListener
*
- * @throws NullPointerException
+ * @throws NullPointerException if the argument is null
*/
public void addBeanContextServicesListener(BeanContextServicesListener bcsl) {
@@ -660,6 +667,8 @@ public class BeanContextServicesSupport extends BeanContextSupport
/**
* add a service
+ * @param serviceClass the service class
+ * @param bcsp the service provider
*/
public boolean addService(Class serviceClass, BeanContextServiceProvider bcsp) {
@@ -668,6 +677,10 @@ public class BeanContextServicesSupport extends BeanContextSupport
/**
* add a service
+ * @param serviceClass the service class
+ * @param bcsp the service provider
+ * @param fireEvent whether or not an event should be fired
+ * @return true if the service was successfully added
*/
protected boolean addService(Class serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent) {
@@ -709,6 +722,9 @@ public class BeanContextServicesSupport extends BeanContextSupport
/**
* remove a service
+ * @param serviceClass the service class
+ * @param bcsp the service provider
+ * @param revokeCurrentServicesNow whether or not to revoke the service
*/
public void revokeService(Class serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow) {
@@ -1067,6 +1083,7 @@ public class BeanContextServicesSupport extends BeanContextSupport
/**
* Fires a BeanContextServiceEvent notifying of a new service.
+ * @param serviceClass the service class
*/
protected final void fireServiceAdded(Class serviceClass) {
BeanContextServiceAvailableEvent bcssae = new BeanContextServiceAvailableEvent(getBeanContextServicesPeer(), serviceClass);
@@ -1109,6 +1126,8 @@ public class BeanContextServicesSupport extends BeanContextSupport
* Fires a BeanContextServiceRevokedEvent
* indicating that a particular service is
* no longer available.
+ * @param serviceClass the service class
+ * @param revokeNow whether or not the event should be revoked now
*/
protected final void fireServiceRevoked(Class serviceClass, boolean revokeNow) {
Object[] copy;
diff --git a/jdk/src/share/classes/java/beans/beancontext/BeanContextSupport.java b/jdk/src/share/classes/java/beans/beancontext/BeanContextSupport.java
index 85b1a5a292f..a549e2dc317 100644
--- a/jdk/src/share/classes/java/beans/beancontext/BeanContextSupport.java
+++ b/jdk/src/share/classes/java/beans/beancontext/BeanContextSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -62,7 +62,6 @@ import java.util.Map;
/**
* This helper class provides a utility implementation of the
* java.beans.beancontext.BeanContext interface.
- *
*
* Since this class directly implements the BeanContext interface, the class
* can, and is intended to be used either by subclassing this implementation,
@@ -351,9 +350,8 @@ public class BeanContextSupport extends BeanContextChildSupport
* of Child without having to override add() or the other Collection
* methods that add children to the set.
*
- *
* @param targetChild the child to create the Child on behalf of
- * @param peer the peer if the tragetChild and the peer are related by an implementation of BeanContextProxy
+ * @param peer the peer if the tragetChild and the peer are related by an implementation of BeanContextProxy * @return Subtype-specific subclass of Child without overriding collection methods
*/
protected BCSChild createBCSChild(Object targetChild, Object peer) {
@@ -492,6 +490,7 @@ public class BeanContextSupport extends BeanContextChildSupport
* @param callChildSetBC used to indicate that
* the child should be notified that it is no
* longer nested in this BeanContext.
+ * @return whether or not was present before being removed
*/
protected boolean remove(Object targetChild, boolean callChildSetBC) {
@@ -580,7 +579,8 @@ public class BeanContextSupport extends BeanContextChildSupport
/**
* add Collection to set of Children (Unsupported)
* implementations must synchronized on the hierarchy lock and "children" protected field
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException thrown unconditionally by this implementation
+ * @return this implementation unconditionally throws {@code UnsupportedOperationException}
*/
public boolean addAll(Collection c) {
throw new UnsupportedOperationException();
@@ -589,7 +589,9 @@ public class BeanContextSupport extends BeanContextChildSupport
/**
* remove all specified children (Unsupported)
* implementations must synchronized on the hierarchy lock and "children" protected field
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException thrown unconditionally by this implementation
+ * @return this implementation unconditionally throws {@code UnsupportedOperationException}
+
*/
public boolean removeAll(Collection c) {
throw new UnsupportedOperationException();
@@ -599,7 +601,8 @@ public class BeanContextSupport extends BeanContextChildSupport
/**
* retain only specified children (Unsupported)
* implementations must synchronized on the hierarchy lock and "children" protected field
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException thrown unconditionally by this implementation
+ * @return this implementation unconditionally throws {@code UnsupportedOperationException}
*/
public boolean retainAll(Collection c) {
throw new UnsupportedOperationException();
@@ -608,7 +611,7 @@ public class BeanContextSupport extends BeanContextChildSupport
/**
* clear the children (Unsupported)
* implementations must synchronized on the hierarchy lock and "children" protected field
- * @throws UnsupportedOperationException
+ * @throws UnsupportedOperationException thrown unconditionally by this implementation
*/
public void clear() {
throw new UnsupportedOperationException();
@@ -618,7 +621,7 @@ public class BeanContextSupport extends BeanContextChildSupport
* Adds a BeanContextMembershipListener
*
* @param bcml the BeanContextMembershipListener to add
- * @throws NullPointerException
+ * @throws NullPointerException if the argument is null
*/
public void addBeanContextMembershipListener(BeanContextMembershipListener bcml) {
@@ -636,7 +639,7 @@ public class BeanContextSupport extends BeanContextChildSupport
* Removes a BeanContextMembershipListener
*
* @param bcml the BeanContextMembershipListener to remove
- * @throws NullPointerException
+ * @throws NullPointerException if the argument is null
*/
public void removeBeanContextMembershipListener(BeanContextMembershipListener bcml) {
@@ -655,7 +658,7 @@ public class BeanContextSupport extends BeanContextChildSupport
* @param bcc the child object making the request.
*
* @return the requested resource as an InputStream
- * @throws NullPointerException
+ * @throws NullPointerException if the argument is null
*/
public InputStream getResourceAsStream(String name, BeanContextChild bcc) {
@@ -849,6 +852,8 @@ public class BeanContextSupport extends BeanContextChildSupport
*
* This method should not however be used by subclasses to replace their
* own implementation (if any) of writeObject().
+ * @param oos the {@code ObjectOutputStream} to use during serialization
+ * @throws IOException if serialization failed
*/
protected void bcsPreSerializationHook(ObjectOutputStream oos) throws IOException {
@@ -864,6 +869,9 @@ public class BeanContextSupport extends BeanContextChildSupport
*
* This method should not however be used by subclasses to replace their
* own implementation (if any) of readObject().
+ * @param ois the {@code ObjectInputStream} to use during deserialization
+ * @throws IOException if deserialization failed
+ * @throws ClassNotFoundException if needed classes are not found
*/
protected void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException {
@@ -914,6 +922,8 @@ public class BeanContextSupport extends BeanContextChildSupport
* used by readObject to deserialize a collection.
* @param ois the ObjectInputStream to use
* @param coll the Collection
+ * @throws IOException if deserialization failed
+ * @throws ClassNotFoundException if needed classes are not found
*/
protected final void deserialize(ObjectInputStream ois, Collection coll) throws IOException, ClassNotFoundException {
int count = 0;
@@ -1005,6 +1015,9 @@ public class BeanContextSupport extends BeanContextChildSupport
* When an instance of this class is used as a delegate for the
* implementation of the BeanContext protocols (and its subprotocols)
* there exists a 'chicken and egg' problem during deserialization
+ * @param ois the ObjectInputStream to use
+ * @throws IOException if deserialization failed
+ * @throws ClassNotFoundException if needed classes are not found
*/
public final void readChildren(ObjectInputStream ois) throws IOException, ClassNotFoundException {
@@ -1122,6 +1135,7 @@ public class BeanContextSupport extends BeanContextChildSupport
* immediately prior to their being added to the BeanContext.
*
*
+ * @param targetChild the child to create the Child on behalf of
* @return true iff the child may be added to this BeanContext, otherwise false.
*/
@@ -1136,6 +1150,7 @@ public class BeanContextSupport extends BeanContextChildSupport
* immediately prior to their being removed from the BeanContext.
*
*
+ * @param targetChild the child to create the Child on behalf of
* @return true iff the child may be removed from this BeanContext, otherwise false.
*/
@@ -1147,6 +1162,8 @@ public class BeanContextSupport extends BeanContextChildSupport
* subclasses may override this method to simply extend add() semantics
* after the child has been added and before the event notification has
* occurred. The method is called with the child synchronized.
+ * @param child the child
+ * @param bcsc the BCSChild
*/
protected void childJustAddedHook(Object child, BCSChild bcsc) {
@@ -1156,6 +1173,8 @@ public class BeanContextSupport extends BeanContextChildSupport
* subclasses may override this method to simply extend remove() semantics
* after the child has been removed and before the event notification has
* occurred. The method is called with the child synchronized.
+ * @param child the child
+ * @param bcsc the BCSChild
*/
protected void childJustRemovedHook(Object child, BCSChild bcsc) {
@@ -1254,6 +1273,7 @@ public class BeanContextSupport extends BeanContextChildSupport
/**
* Fire a BeanContextshipEvent on the BeanContextMembershipListener interface
+ * @param bcme the event to fire
*/
protected final void fireChildrenAdded(BeanContextMembershipEvent bcme) {
@@ -1267,6 +1287,7 @@ public class BeanContextSupport extends BeanContextChildSupport
/**
* Fire a BeanContextshipEvent on the BeanContextMembershipListener interface
+ * @param bcme the event to fire
*/
protected final void fireChildrenRemoved(BeanContextMembershipEvent bcme) {
diff --git a/jdk/src/share/classes/java/net/SocketAddress.java b/jdk/src/share/classes/java/net/SocketAddress.java
index 5cdd4a519cb..a3ee4ee52f5 100644
--- a/jdk/src/share/classes/java/net/SocketAddress.java
+++ b/jdk/src/share/classes/java/net/SocketAddress.java
@@ -39,4 +39,7 @@ package java.net;
* @since 1.4
*/
public abstract class SocketAddress implements java.io.Serializable {
+
+ static final long serialVersionUID = 5215720748342549866L;
+
}
diff --git a/jdk/src/share/classes/java/nio/file/Files.java b/jdk/src/share/classes/java/nio/file/Files.java
index 586859f17dc..721184c1533 100644
--- a/jdk/src/share/classes/java/nio/file/Files.java
+++ b/jdk/src/share/classes/java/nio/file/Files.java
@@ -25,10 +25,10 @@
package java.nio.file;
-import java.nio.ByteBuffer;
import java.nio.file.attribute.*;
import java.nio.file.spi.FileSystemProvider;
import java.nio.file.spi.FileTypeDetector;
+import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.channels.SeekableByteChannel;
import java.io.Closeable;
@@ -2965,7 +2965,63 @@ public final class Files {
}
/**
- * Read all the bytes from a file. The method ensures that the file is
+ * The maximum size of array to allocate.
+ * Some VMs reserve some header words in an array.
+ * Attempts to allocate larger arrays may result in
+ * OutOfMemoryError: Requested array size exceeds VM limit
+ */
+ private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8;
+
+ /**
+ * Reads all the bytes from an input stream. Uses {@code initialSize} as a hint
+ * about how many bytes the stream will have.
+ *
+ * @param source
+ * the input stream to read from
+ * @param initialSize
+ * the initial size of the byte array to allocate
+ *
+ * @return a byte array containing the bytes read from the file
+ *
+ * @throws IOException
+ * if an I/O error occurs reading from the stream
+ * @throws OutOfMemoryError
+ * if an array of the required size cannot be allocated
+ */
+ private static byte[] read(InputStream source, int initialSize)
+ throws IOException
+ {
+ int capacity = initialSize;
+ byte[] buf = new byte[capacity];
+ int nread = 0;
+ int n;
+ for (;;) {
+ // read to EOF which may read more or less than initialSize (eg: file
+ // is truncated while we are reading)
+ while ((n = source.read(buf, nread, capacity - nread)) > 0)
+ nread += n;
+
+ // if last call to source.read() returned -1, we are done
+ // otherwise, try to read one more byte; if that failed we're done too
+ if (n < 0 || (n = source.read()) < 0)
+ break;
+
+ // one more byte was read; need to allocate a larger buffer
+ if (capacity <= MAX_BUFFER_SIZE - capacity) {
+ capacity = Math.max(capacity << 1, BUFFER_SIZE);
+ } else {
+ if (capacity == MAX_BUFFER_SIZE)
+ throw new OutOfMemoryError("Required array size too large");
+ capacity = MAX_BUFFER_SIZE;
+ }
+ buf = Arrays.copyOf(buf, capacity);
+ buf[nread++] = (byte)n;
+ }
+ return (capacity == nread) ? buf : Arrays.copyOf(buf, nread);
+ }
+
+ /**
+ * Reads all the bytes from a file. The method ensures that the file is
* closed when all bytes have been read or an I/O error, or other runtime
* exception, is thrown.
*
@@ -2989,22 +3045,13 @@ public final class Files {
* method is invoked to check read access to the file.
*/
public static byte[] readAllBytes(Path path) throws IOException {
- try (FileChannel fc = FileChannel.open(path)) {
+ try (FileChannel fc = FileChannel.open(path);
+ InputStream is = Channels.newInputStream(fc)) {
long size = fc.size();
- if (size > (long)Integer.MAX_VALUE)
+ if (size > (long)MAX_BUFFER_SIZE)
throw new OutOfMemoryError("Required array size too large");
- byte[] arr = new byte[(int)size];
- ByteBuffer bb = ByteBuffer.wrap(arr);
- while (bb.hasRemaining()) {
- if (fc.read(bb) < 0) {
- // truncated
- break;
- }
- }
-
- int nread = bb.position();
- return (nread == size) ? arr : Arrays.copyOf(arr, nread);
+ return read(is, (int)size);
}
}
diff --git a/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java b/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java
index ccff225c87d..e7b7581820b 100644
--- a/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java
+++ b/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, 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
@@ -33,15 +33,47 @@ import java.net.*;
* in order to obtain client and server sockets for RMI calls. An
* application may use the setSocketFactory
method to
* request that the RMI runtime use its socket factory instance
- * instead of the default implementation.
+ * instead of the default implementation.
*
- * The default socket factory implementation used goes through a
+ *
The default socket factory implementation performs a
* three-tiered approach to creating client sockets. First, a direct
* socket connection to the remote VM is attempted. If that fails
* (due to a firewall), the runtime uses HTTP with the explicit port
* number of the server. If the firewall does not allow this type of
* communication, then HTTP to a cgi-bin script on the server is used
- * to POST the RMI call.
+ * to POST the RMI call.
+ *
+ *
The default socket factory implementation creates server sockets that
+ * are bound to the wildcard address, which accepts requests from all network
+ * interfaces.
+ *
+ * @implNote
+ *
You can use the {@code RMISocketFactory} class to create a server socket that
+ * is bound to a specific address, restricting the origin of requests. For example,
+ * the following code implements a socket factory that binds server sockets to the
+ * loopback address. This restricts RMI to processing requests only from the local host.
+ *
+ *
{@code
+ * class LoopbackSocketFactory extends RMISocketFactory {
+ * public ServerSocket createServerSocket(int port) throws IOException {
+ * return new ServerSocket(port, 5, InetAddress.getLoopbackAddress());
+ * }
+ *
+ * public Socket createSocket(String host, int port) throws IOException {
+ * // just call the default client socket factory
+ * return RMISocketFactory.getDefaultSocketFactory()
+ * .createSocket(host, port);
+ * }
+ * }
+ *
+ * // ...
+ *
+ * RMISocketFactory.setSocketFactory(new LoopbackSocketFactory());
+ * }
+ *
+ * Set the {@code java.rmi.server.hostname} system property
+ * to a host name (typically {@code localhost}) that resolves to the loopback
+ * interface to ensure that the generated stubs use the right network interface.
*
* @author Ann Wollrath
* @author Peter Jones
diff --git a/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java b/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java
index 7764627bceb..be86c275246 100644
--- a/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java
+++ b/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, 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
@@ -100,6 +100,26 @@ import sun.rmi.server.UnicastServerRef2;
*
*
*
+ * If an object is exported with the
+ * {@link #exportObject(Remote) exportObject(Remote)}
+ * or
+ * {@link #exportObject(Remote, int) exportObject(Remote, port)}
+ * methods, or if a subclass constructor invokes one of the
+ * {@link #UnicastRemoteObject()}
+ * or
+ * {@link #UnicastRemoteObject(int) UnicastRemoteObject(port)}
+ * constructors, the object is exported with a server socket created using the
+ * {@link RMISocketFactory}
+ * class.
+ *
+ * @implNote
+ *
By default, server sockets created by the {@link RMISocketFactory} class
+ * listen on all network interfaces. See the
+ * {@link RMISocketFactory} class and the section
+ * RMI Socket Factories
+ * in the
+ * Java RMI Specification.
+ *
* @author Ann Wollrath
* @author Peter Jones
* @since JDK1.1
diff --git a/jdk/src/share/classes/java/security/Security.java b/jdk/src/share/classes/java/security/Security.java
index 98699da8149..ce99101e716 100644
--- a/jdk/src/share/classes/java/security/Security.java
+++ b/jdk/src/share/classes/java/security/Security.java
@@ -326,17 +326,13 @@ public final class Security {
*
*
A provider cannot be added if it is already installed.
*
- *
First, if there is a security manager, its
- * {@code checkSecurityAccess}
- * method is called with the string
- * {@code "insertProvider."+provider.getName()}
- * to see if it's ok to add a new provider.
- * If the default implementation of {@code checkSecurityAccess}
- * is used (i.e., that method is not overriden), then this will result in
- * a call to the security manager's {@code checkPermission} method
- * with a
- * {@code SecurityPermission("insertProvider."+provider.getName())}
- * permission.
+ *
If there is a security manager, the
+ * {@link java.lang.SecurityManager#checkSecurityAccess} method is called
+ * with the {@code "insertProvider"} permission target name to see if
+ * it's ok to add a new provider. If this permission check is denied,
+ * {@code checkSecurityAccess} is called again with the
+ * {@code "insertProvider."+provider.getName()} permission target name. If
+ * both checks are denied, a {@code SecurityException} is thrown.
*
* @param provider the provider to be added.
*
@@ -360,7 +356,7 @@ public final class Security {
public static synchronized int insertProviderAt(Provider provider,
int position) {
String providerName = provider.getName();
- check("insertProvider." + providerName);
+ checkInsertProvider(providerName);
ProviderList list = Providers.getFullProviderList();
ProviderList newList = ProviderList.insertAt(list, provider, position - 1);
if (list == newList) {
@@ -373,17 +369,13 @@ public final class Security {
/**
* Adds a provider to the next position available.
*
- *
First, if there is a security manager, its
- * {@code checkSecurityAccess}
- * method is called with the string
- * {@code "insertProvider."+provider.getName()}
- * to see if it's ok to add a new provider.
- * If the default implementation of {@code checkSecurityAccess}
- * is used (i.e., that method is not overriden), then this will result in
- * a call to the security manager's {@code checkPermission} method
- * with a
- * {@code SecurityPermission("insertProvider."+provider.getName())}
- * permission.
+ *
If there is a security manager, the
+ * {@link java.lang.SecurityManager#checkSecurityAccess} method is called
+ * with the {@code "insertProvider"} permission target name to see if
+ * it's ok to add a new provider. If this permission check is denied,
+ * {@code checkSecurityAccess} is called again with the
+ * {@code "insertProvider."+provider.getName()} permission target name. If
+ * both checks are denied, a {@code SecurityException} is thrown.
*
* @param provider the provider to be added.
*
@@ -863,6 +855,23 @@ public final class Security {
}
}
+ private static void checkInsertProvider(String name) {
+ SecurityManager security = System.getSecurityManager();
+ if (security != null) {
+ try {
+ security.checkSecurityAccess("insertProvider");
+ } catch (SecurityException se1) {
+ try {
+ security.checkSecurityAccess("insertProvider." + name);
+ } catch (SecurityException se2) {
+ // throw first exception, but add second to suppressed
+ se1.addSuppressed(se2);
+ throw se1;
+ }
+ }
+ }
+ }
+
/*
* Returns all providers who satisfy the specified
* criterion.
diff --git a/jdk/src/share/classes/java/security/SecurityPermission.java b/jdk/src/share/classes/java/security/SecurityPermission.java
index e0f0f92b40c..bbdccaeffe3 100644
--- a/jdk/src/share/classes/java/security/SecurityPermission.java
+++ b/jdk/src/share/classes/java/security/SecurityPermission.java
@@ -130,14 +130,17 @@ import java.util.StringTokenizer;
*
*
*
- * insertProvider.{provider name} |
- * Addition of a new provider, with the specified name |
+ * insertProvider |
+ * Addition of a new provider |
* This would allow somebody to introduce a possibly
* malicious provider (e.g., one that discloses the private keys passed
* to it) as the highest-priority provider. This would be possible
* because the Security object (which manages the installed providers)
* currently does not check the integrity or authenticity of a provider
- * before attaching it. |
+ * before attaching it. The "insertProvider" permission subsumes the
+ * "insertProvider.{provider name}" permission (see the section below for
+ * more information).
+ *
*
*
*
@@ -186,9 +189,10 @@ import java.util.StringTokenizer;
*
*
*
- * The following permissions are associated with classes that have been
- * deprecated: {@link Identity}, {@link IdentityScope}, {@link Signer}. Use of
- * them is discouraged. See the applicable classes for more information.
+ * The following permissions have been superseded by newer permissions or are
+ * associated with classes that have been deprecated: {@link Identity},
+ * {@link IdentityScope}, {@link Signer}. Use of them is discouraged. See the
+ * applicable classes for more information.
*
*
*
@@ -199,6 +203,23 @@ import java.util.StringTokenizer;
*
*
*
+ * insertProvider.{provider name} |
+ * Addition of a new provider, with the specified name |
+ * Use of this permission is discouraged from further use because it is
+ * possible to circumvent the name restrictions by overriding the
+ * {@link java.security.Provider#getName} method. Also, there is an equivalent
+ * level of risk associated with granting code permission to insert a provider
+ * with a specific name, or any name it chooses. Users should use the
+ * "insertProvider" permission instead.
+ * This would allow somebody to introduce a possibly
+ * malicious provider (e.g., one that discloses the private keys passed
+ * to it) as the highest-priority provider. This would be possible
+ * because the Security object (which manages the installed providers)
+ * currently does not check the integrity or authenticity of a provider
+ * before attaching it. |
+ *
+ *
+ *
* setSystemScope |
* Setting of the system identity scope |
* This would allow an attacker to configure the system identity scope with
@@ -306,7 +327,6 @@ public final class SecurityPermission extends BasicPermission {
* @throws NullPointerException if {@code name} is {@code null}.
* @throws IllegalArgumentException if {@code name} is empty.
*/
-
public SecurityPermission(String name)
{
super(name);
@@ -323,7 +343,6 @@ public final class SecurityPermission extends BasicPermission {
* @throws NullPointerException if {@code name} is {@code null}.
* @throws IllegalArgumentException if {@code name} is empty.
*/
-
public SecurityPermission(String name, String actions)
{
super(name, actions);
diff --git a/jdk/src/share/classes/java/util/ArrayPrefixHelpers.java b/jdk/src/share/classes/java/util/ArrayPrefixHelpers.java
index ef59ec7d478..afa872c5855 100644
--- a/jdk/src/share/classes/java/util/ArrayPrefixHelpers.java
+++ b/jdk/src/share/classes/java/util/ArrayPrefixHelpers.java
@@ -128,6 +128,7 @@ class ArrayPrefixHelpers {
this.lo = lo; this.hi = hi;
}
+ @SuppressWarnings("unchecked")
public final void compute() {
final BinaryOperator fn;
final T[] a;
@@ -692,6 +693,4 @@ class ArrayPrefixHelpers {
}
}
}
-
-
-}
\ No newline at end of file
+}
diff --git a/jdk/src/share/classes/java/util/Collections.java b/jdk/src/share/classes/java/util/Collections.java
index 43ce42eeea6..97555f567fa 100644
--- a/jdk/src/share/classes/java/util/Collections.java
+++ b/jdk/src/share/classes/java/util/Collections.java
@@ -1143,6 +1143,7 @@ public class Collections {
public boolean removeIf(Predicate super E> filter) {
throw new UnsupportedOperationException();
}
+ @SuppressWarnings("unchecked")
@Override
public Spliterator spliterator() {
return (Spliterator)c.spliterator();
@@ -1900,7 +1901,7 @@ public class Collections {
private static final long serialVersionUID = -2239321462712562324L;
- EmptyNavigableMap() { super(new TreeMap()); }
+ EmptyNavigableMap() { super(new TreeMap()); }
@Override
public NavigableSet navigableKeySet()
@@ -1928,46 +1929,52 @@ public class Collections {
public K ceilingKey(K key) { return nm.ceilingKey(key); }
public K higherKey(K key) { return nm.higherKey(key); }
+ @SuppressWarnings("unchecked")
public Entry lowerEntry(K key) {
Entry lower = (Entry) nm.lowerEntry(key);
return (null != lower)
- ? new UnmodifiableEntrySet.UnmodifiableEntry(lower)
+ ? new UnmodifiableEntrySet.UnmodifiableEntry<>(lower)
: null;
}
+ @SuppressWarnings("unchecked")
public Entry floorEntry(K key) {
Entry floor = (Entry) nm.floorEntry(key);
return (null != floor)
- ? new UnmodifiableEntrySet.UnmodifiableEntry(floor)
+ ? new UnmodifiableEntrySet.UnmodifiableEntry<>(floor)
: null;
}
+ @SuppressWarnings("unchecked")
public Entry ceilingEntry(K key) {
Entry ceiling = (Entry) nm.ceilingEntry(key);
return (null != ceiling)
- ? new UnmodifiableEntrySet.UnmodifiableEntry(ceiling)
+ ? new UnmodifiableEntrySet.UnmodifiableEntry<>(ceiling)
: null;
}
+ @SuppressWarnings("unchecked")
public Entry higherEntry(K key) {
Entry higher = (Entry) nm.higherEntry(key);
return (null != higher)
- ? new UnmodifiableEntrySet.UnmodifiableEntry(higher)
+ ? new UnmodifiableEntrySet.UnmodifiableEntry<>(higher)
: null;
}
+ @SuppressWarnings("unchecked")
public Entry firstEntry() {
Entry first = (Entry) nm.firstEntry();
return (null != first)
- ? new UnmodifiableEntrySet.UnmodifiableEntry(first)
+ ? new UnmodifiableEntrySet.UnmodifiableEntry<>(first)
: null;
}
+ @SuppressWarnings("unchecked")
public Entry lastEntry() {
Entry last = (Entry) nm.lastEntry();
return (null != last)
- ? new UnmodifiableEntrySet.UnmodifiableEntry(last)
+ ? new UnmodifiableEntrySet.UnmodifiableEntry<>(last)
: null;
}
@@ -2360,7 +2367,7 @@ public class Collections {
}
public NavigableSet tailSet(E fromElement) {
synchronized (mutex) {
- return new SynchronizedNavigableSet(ns.tailSet(fromElement, true), mutex);
+ return new SynchronizedNavigableSet<>(ns.tailSet(fromElement, true), mutex);
}
}
@@ -2925,7 +2932,7 @@ public class Collections {
public NavigableMap descendingMap() {
synchronized (mutex) {
return
- new SynchronizedNavigableMap(nm.descendingMap(), mutex);
+ new SynchronizedNavigableMap<>(nm.descendingMap(), mutex);
}
}
@@ -2935,13 +2942,13 @@ public class Collections {
public NavigableSet navigableKeySet() {
synchronized (mutex) {
- return new SynchronizedNavigableSet(nm.navigableKeySet(), mutex);
+ return new SynchronizedNavigableSet<>(nm.navigableKeySet(), mutex);
}
}
public NavigableSet descendingKeySet() {
synchronized (mutex) {
- return new SynchronizedNavigableSet(nm.descendingKeySet(), mutex);
+ return new SynchronizedNavigableSet<>(nm.descendingKeySet(), mutex);
}
}
@@ -2959,27 +2966,27 @@ public class Collections {
}
public SortedMap tailMap(K fromKey) {
synchronized (mutex) {
- return new SynchronizedNavigableMap<>(nm.tailMap(fromKey, true),mutex);
+ return new SynchronizedNavigableMap<>(nm.tailMap(fromKey, true),mutex);
}
}
public NavigableMap subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) {
synchronized (mutex) {
- return new SynchronizedNavigableMap(
+ return new SynchronizedNavigableMap<>(
nm.subMap(fromKey, fromInclusive, toKey, toInclusive), mutex);
}
}
public NavigableMap headMap(K toKey, boolean inclusive) {
synchronized (mutex) {
- return new SynchronizedNavigableMap(
+ return new SynchronizedNavigableMap<>(
nm.headMap(toKey, inclusive), mutex);
}
}
public NavigableMap tailMap(K fromKey, boolean inclusive) {
synchronized (mutex) {
- return new SynchronizedNavigableMap(
+ return new SynchronizedNavigableMap<>(
nm.tailMap(fromKey, inclusive), mutex);
}
}
@@ -4081,7 +4088,7 @@ public class Collections {
public Entry lowerEntry(K key) {
Entry lower = nm.lowerEntry(key);
return (null != lower)
- ? new CheckedMap.CheckedEntrySet.CheckedEntry(lower, valueType)
+ ? new CheckedMap.CheckedEntrySet.CheckedEntry<>(lower, valueType)
: null;
}
@@ -4090,7 +4097,7 @@ public class Collections {
public Entry floorEntry(K key) {
Entry floor = nm.floorEntry(key);
return (null != floor)
- ? new CheckedMap.CheckedEntrySet.CheckedEntry(floor, valueType)
+ ? new CheckedMap.CheckedEntrySet.CheckedEntry<>(floor, valueType)
: null;
}
@@ -4099,7 +4106,7 @@ public class Collections {
public Entry ceilingEntry(K key) {
Entry ceiling = nm.ceilingEntry(key);
return (null != ceiling)
- ? new CheckedMap.CheckedEntrySet.CheckedEntry(ceiling, valueType)
+ ? new CheckedMap.CheckedEntrySet.CheckedEntry<>(ceiling, valueType)
: null;
}
@@ -4108,7 +4115,7 @@ public class Collections {
public Entry higherEntry(K key) {
Entry higher = nm.higherEntry(key);
return (null != higher)
- ? new CheckedMap.CheckedEntrySet.CheckedEntry(higher, valueType)
+ ? new CheckedMap.CheckedEntrySet.CheckedEntry<>(higher, valueType)
: null;
}
@@ -4117,14 +4124,14 @@ public class Collections {
public Entry firstEntry() {
Entry first = nm.firstEntry();
return (null != first)
- ? new CheckedMap.CheckedEntrySet.CheckedEntry(first, valueType)
+ ? new CheckedMap.CheckedEntrySet.CheckedEntry<>(first, valueType)
: null;
}
public Entry lastEntry() {
Entry last = nm.lastEntry();
return (null != last)
- ? new CheckedMap.CheckedEntrySet.CheckedEntry(last, valueType)
+ ? new CheckedMap.CheckedEntrySet.CheckedEntry<>(last, valueType)
: null;
}
@@ -4132,14 +4139,14 @@ public class Collections {
Entry entry = nm.pollFirstEntry();
return (null == entry)
? null
- : new CheckedMap.CheckedEntrySet.CheckedEntry(entry, valueType);
+ : new CheckedMap.CheckedEntrySet.CheckedEntry<>(entry, valueType);
}
public Entry pollLastEntry() {
Entry entry = nm.pollLastEntry();
return (null == entry)
? null
- : new CheckedMap.CheckedEntrySet.CheckedEntry(entry, valueType);
+ : new CheckedMap.CheckedEntrySet.CheckedEntry<>(entry, valueType);
}
public NavigableMap descendingMap() {
diff --git a/jdk/src/share/classes/java/util/Comparator.java b/jdk/src/share/classes/java/util/Comparator.java
index cd65ca4ea06..55d5efb9866 100644
--- a/jdk/src/share/classes/java/util/Comparator.java
+++ b/jdk/src/share/classes/java/util/Comparator.java
@@ -352,6 +352,7 @@ public interface Comparator {
* @see Comparable
* @since 1.8
*/
+ @SuppressWarnings("unchecked")
public static > Comparator naturalOrder() {
return (Comparator) Comparators.NaturalOrderComparator.INSTANCE;
}
@@ -374,7 +375,7 @@ public interface Comparator {
* @since 1.8
*/
public static Comparator nullsFirst(Comparator super T> comparator) {
- return new Comparators.NullComparator(true, comparator);
+ return new Comparators.NullComparator<>(true, comparator);
}
/**
@@ -395,7 +396,7 @@ public interface Comparator {
* @since 1.8
*/
public static Comparator nullsLast(Comparator super T> comparator) {
- return new Comparators.NullComparator(false, comparator);
+ return new Comparators.NullComparator<>(false, comparator);
}
/**
diff --git a/jdk/src/share/classes/java/util/Comparators.java b/jdk/src/share/classes/java/util/Comparators.java
index a9038321085..ee806798d7a 100644
--- a/jdk/src/share/classes/java/util/Comparators.java
+++ b/jdk/src/share/classes/java/util/Comparators.java
@@ -87,12 +87,12 @@ class Comparators {
@Override
public Comparator thenComparing(Comparator super T> other) {
Objects.requireNonNull(other);
- return new NullComparator(nullFirst, real == null ? other : real.thenComparing(other));
+ return new NullComparator<>(nullFirst, real == null ? other : real.thenComparing(other));
}
@Override
public Comparator reversed() {
- return new NullComparator(!nullFirst, real == null ? null : real.reversed());
+ return new NullComparator<>(!nullFirst, real == null ? null : real.reversed());
}
}
}
diff --git a/jdk/src/share/classes/java/util/Deque.java b/jdk/src/share/classes/java/util/Deque.java
index 051ae9cca46..f6511417f33 100644
--- a/jdk/src/share/classes/java/util/Deque.java
+++ b/jdk/src/share/classes/java/util/Deque.java
@@ -38,7 +38,7 @@ package java.util;
/**
* A linear collection that supports element insertion and removal at
* both ends. The name deque is short for "double ended queue"
- * and is usually pronounced "deck". Most Deque
+ * and is usually pronounced "deck". Most {@code Deque}
* implementations place no fixed limits on the number of elements
* they may contain, but this interface supports capacity-restricted
* deques as well as those with no fixed size limit.
@@ -47,10 +47,10 @@ package java.util;
* ends of the deque. Methods are provided to insert, remove, and
* examine the element. Each of these methods exists in two forms:
* one throws an exception if the operation fails, the other returns a
- * special value (either null or false, depending on
+ * special value (either {@code null} or {@code false}, depending on
* the operation). The latter form of the insert operation is
* designed specifically for use with capacity-restricted
- * Deque implementations; in most implementations, insert
+ * {@code Deque} implementations; in most implementations, insert
* operations cannot fail.
*
* The twelve methods described above are summarized in the
@@ -58,6 +58,7 @@ package java.util;
*
*
*
+ * Summary of Deque methods
*
* |
* First Element (Head) |
@@ -72,38 +73,39 @@ package java.util;
*
*
* Insert |
- * {@link #addFirst addFirst(e)} |
- * {@link #offerFirst offerFirst(e)} |
- * {@link #addLast addLast(e)} |
- * {@link #offerLast offerLast(e)} |
+ * {@link Deque#addFirst addFirst(e)} |
+ * {@link Deque#offerFirst offerFirst(e)} |
+ * {@link Deque#addLast addLast(e)} |
+ * {@link Deque#offerLast offerLast(e)} |
*
*
* Remove |
- * {@link #removeFirst removeFirst()} |
- * {@link #pollFirst pollFirst()} |
- * {@link #removeLast removeLast()} |
- * {@link #pollLast pollLast()} |
+ * {@link Deque#removeFirst removeFirst()} |
+ * {@link Deque#pollFirst pollFirst()} |
+ * {@link Deque#removeLast removeLast()} |
+ * {@link Deque#pollLast pollLast()} |
*
*
* Examine |
- * {@link #getFirst getFirst()} |
- * {@link #peekFirst peekFirst()} |
- * {@link #getLast getLast()} |
- * {@link #peekLast peekLast()} |
+ * {@link Deque#getFirst getFirst()} |
+ * {@link Deque#peekFirst peekFirst()} |
+ * {@link Deque#getLast getLast()} |
+ * {@link Deque#peekLast peekLast()} |
*
*
*
* This interface extends the {@link Queue} interface. When a deque is
* used as a queue, FIFO (First-In-First-Out) behavior results. Elements are
* added at the end of the deque and removed from the beginning. The methods
- * inherited from the Queue interface are precisely equivalent to
- * Deque methods as indicated in the following table:
+ * inherited from the {@code Queue} interface are precisely equivalent to
+ * {@code Deque} methods as indicated in the following table:
*
*
*
+ * Comparison of Queue and Deque methods
*
- * Queue Method |
- * Equivalent Deque Method |
+ * {@code Queue} Method |
+ * Equivalent {@code Deque} Method |
*
*
* {@link java.util.Queue#add add(e)} |
@@ -135,13 +137,14 @@ package java.util;
* interface should be used in preference to the legacy {@link Stack} class.
* When a deque is used as a stack, elements are pushed and popped from the
* beginning of the deque. Stack methods are precisely equivalent to
- * Deque methods as indicated in the table below:
+ * {@code Deque} methods as indicated in the table below:
*
*
*
+ * Comparison of Stack and Deque methods
*
* Stack Method |
- * Equivalent Deque Method |
+ * Equivalent {@code Deque} Method |
*
*
* {@link #push push(e)} |
@@ -168,18 +171,18 @@ package java.util;
* Unlike the {@link List} interface, this interface does not
* provide support for indexed access to elements.
*
- * While Deque implementations are not strictly required
+ * While {@code Deque} implementations are not strictly required
* to prohibit the insertion of null elements, they are strongly
- * encouraged to do so. Users of any Deque implementations
+ * encouraged to do so. Users of any {@code Deque} implementations
* that do allow null elements are strongly encouraged not to
* take advantage of the ability to insert nulls. This is so because
- * null is used as a special return value by various methods
+ * {@code null} is used as a special return value by various methods
* to indicated that the deque is empty.
*
- * Deque implementations generally do not define
- * element-based versions of the equals and hashCode
+ * {@code Deque} implementations generally do not define
+ * element-based versions of the {@code equals} and {@code hashCode}
* methods, but instead inherit the identity-based versions from class
- * Object.
+ * {@code Object}.
*
* This interface is a member of the Java Collections
@@ -190,13 +193,13 @@ package java.util;
* @since 1.6
* @param the type of elements held in this collection
*/
-
public interface Deque extends Queue {
/**
* Inserts the specified element at the front of this deque if it is
- * possible to do so immediately without violating capacity restrictions.
- * When using a capacity-restricted deque, it is generally preferable to
- * use method {@link #offerFirst}.
+ * possible to do so immediately without violating capacity restrictions,
+ * throwing an {@code IllegalStateException} if no space is currently
+ * available. When using a capacity-restricted deque, it is generally
+ * preferable to use method {@link #offerFirst}.
*
* @param e the element to add
* @throws IllegalStateException if the element cannot be added at this
@@ -212,9 +215,10 @@ public interface Deque extends Queue {
/**
* Inserts the specified element at the end of this deque if it is
- * possible to do so immediately without violating capacity restrictions.
- * When using a capacity-restricted deque, it is generally preferable to
- * use method {@link #offerLast}.
+ * possible to do so immediately without violating capacity restrictions,
+ * throwing an {@code IllegalStateException} if no space is currently
+ * available. When using a capacity-restricted deque, it is generally
+ * preferable to use method {@link #offerLast}.
*
* This method is equivalent to {@link #add}.
*
@@ -237,8 +241,8 @@ public interface Deque extends Queue {
* which can fail to insert an element only by throwing an exception.
*
* @param e the element to add
- * @return true if the element was added to this deque, else
- * false
+ * @return {@code true} if the element was added to this deque, else
+ * {@code false}
* @throws ClassCastException if the class of the specified element
* prevents it from being added to this deque
* @throws NullPointerException if the specified element is null and this
@@ -255,8 +259,8 @@ public interface Deque extends Queue {
* which can fail to insert an element only by throwing an exception.
*
* @param e the element to add
- * @return true if the element was added to this deque, else
- * false
+ * @return {@code true} if the element was added to this deque, else
+ * {@code false}
* @throws ClassCastException if the class of the specified element
* prevents it from being added to this deque
* @throws NullPointerException if the specified element is null and this
@@ -288,17 +292,17 @@ public interface Deque extends Queue {
/**
* Retrieves and removes the first element of this deque,
- * or returns null if this deque is empty.
+ * or returns {@code null} if this deque is empty.
*
- * @return the head of this deque, or null if this deque is empty
+ * @return the head of this deque, or {@code null} if this deque is empty
*/
E pollFirst();
/**
* Retrieves and removes the last element of this deque,
- * or returns null if this deque is empty.
+ * or returns {@code null} if this deque is empty.
*
- * @return the tail of this deque, or null if this deque is empty
+ * @return the tail of this deque, or {@code null} if this deque is empty
*/
E pollLast();
@@ -325,31 +329,31 @@ public interface Deque extends Queue {
/**
* Retrieves, but does not remove, the first element of this deque,
- * or returns null if this deque is empty.
+ * or returns {@code null} if this deque is empty.
*
- * @return the head of this deque, or null if this deque is empty
+ * @return the head of this deque, or {@code null} if this deque is empty
*/
E peekFirst();
/**
* Retrieves, but does not remove, the last element of this deque,
- * or returns null if this deque is empty.
+ * or returns {@code null} if this deque is empty.
*
- * @return the tail of this deque, or null if this deque is empty
+ * @return the tail of this deque, or {@code null} if this deque is empty
*/
E peekLast();
/**
* Removes the first occurrence of the specified element from this deque.
* If the deque does not contain the element, it is unchanged.
- * More formally, removes the first element e such that
+ * More formally, removes the first element {@code e} such that
* (o==null ? e==null : o.equals(e))
* (if such an element exists).
- * Returns true if this deque contained the specified element
+ * Returns {@code true} if this deque contained the specified element
* (or equivalently, if this deque changed as a result of the call).
*
* @param o element to be removed from this deque, if present
- * @return true if an element was removed as a result of this call
+ * @return {@code true} if an element was removed as a result of this call
* @throws ClassCastException if the class of the specified element
* is incompatible with this deque
* (optional)
@@ -362,14 +366,14 @@ public interface Deque extends Queue {
/**
* Removes the last occurrence of the specified element from this deque.
* If the deque does not contain the element, it is unchanged.
- * More formally, removes the last element e such that
+ * More formally, removes the last element {@code e} such that
* (o==null ? e==null : o.equals(e))
* (if such an element exists).
- * Returns true if this deque contained the specified element
+ * Returns {@code true} if this deque contained the specified element
* (or equivalently, if this deque changed as a result of the call).
*
* @param o element to be removed from this deque, if present
- * @return true if an element was removed as a result of this call
+ * @return {@code true} if an element was removed as a result of this call
* @throws ClassCastException if the class of the specified element
* is incompatible with this deque
* (optional)
@@ -385,15 +389,15 @@ public interface Deque extends Queue {
* Inserts the specified element into the queue represented by this deque
* (in other words, at the tail of this deque) if it is possible to do so
* immediately without violating capacity restrictions, returning
- * true upon success and throwing an
- * IllegalStateException if no space is currently available.
+ * {@code true} upon success and throwing an
+ * {@code IllegalStateException} if no space is currently available.
* When using a capacity-restricted deque, it is generally preferable to
* use {@link #offer(Object) offer}.
*
* This method is equivalent to {@link #addLast}.
*
* @param e the element to add
- * @return true (as specified by {@link Collection#add})
+ * @return {@code true} (as specified by {@link Collection#add})
* @throws IllegalStateException if the element cannot be added at this
* time due to capacity restrictions
* @throws ClassCastException if the class of the specified element
@@ -409,7 +413,7 @@ public interface Deque extends Queue {
* Inserts the specified element into the queue represented by this deque
* (in other words, at the tail of this deque) if it is possible to do so
* immediately without violating capacity restrictions, returning
- * true upon success and false if no space is currently
+ * {@code true} upon success and {@code false} if no space is currently
* available. When using a capacity-restricted deque, this method is
* generally preferable to the {@link #add} method, which can fail to
* insert an element only by throwing an exception.
@@ -417,8 +421,8 @@ public interface Deque extends Queue {
* This method is equivalent to {@link #offerLast}.
*
* @param e the element to add
- * @return true if the element was added to this deque, else
- * false
+ * @return {@code true} if the element was added to this deque, else
+ * {@code false}
* @throws ClassCastException if the class of the specified element
* prevents it from being added to this deque
* @throws NullPointerException if the specified element is null and this
@@ -444,11 +448,11 @@ public interface Deque extends Queue {
/**
* Retrieves and removes the head of the queue represented by this deque
* (in other words, the first element of this deque), or returns
- * null if this deque is empty.
+ * {@code null} if this deque is empty.
*
* This method is equivalent to {@link #pollFirst()}.
*
- * @return the first element of this deque, or null if
+ * @return the first element of this deque, or {@code null} if
* this deque is empty
*/
E poll();
@@ -469,12 +473,12 @@ public interface Deque extends Queue {
/**
* Retrieves, but does not remove, the head of the queue represented by
* this deque (in other words, the first element of this deque), or
- * returns null if this deque is empty.
+ * returns {@code null} if this deque is empty.
*
* This method is equivalent to {@link #peekFirst()}.
*
* @return the head of the queue represented by this deque, or
- * null if this deque is empty
+ * {@code null} if this deque is empty
*/
E peek();
@@ -484,9 +488,8 @@ public interface Deque extends Queue {
/**
* Pushes an element onto the stack represented by this deque (in other
* words, at the head of this deque) if it is possible to do so
- * immediately without violating capacity restrictions, returning
- * true upon success and throwing an
- * IllegalStateException if no space is currently available.
+ * immediately without violating capacity restrictions, throwing an
+ * {@code IllegalStateException} if no space is currently available.
*
* This method is equivalent to {@link #addFirst}.
*
@@ -520,16 +523,16 @@ public interface Deque extends Queue {
/**
* Removes the first occurrence of the specified element from this deque.
* If the deque does not contain the element, it is unchanged.
- * More formally, removes the first element e such that
+ * More formally, removes the first element {@code e} such that
* (o==null ? e==null : o.equals(e))
* (if such an element exists).
- * Returns true if this deque contained the specified element
+ * Returns {@code true} if this deque contained the specified element
* (or equivalently, if this deque changed as a result of the call).
*
- * This method is equivalent to {@link #removeFirstOccurrence}.
+ * This method is equivalent to {@link #removeFirstOccurrence(Object)}.
*
* @param o element to be removed from this deque, if present
- * @return true if an element was removed as a result of this call
+ * @return {@code true} if an element was removed as a result of this call
* @throws ClassCastException if the class of the specified element
* is incompatible with this deque
* (optional)
@@ -540,13 +543,13 @@ public interface Deque extends Queue {
boolean remove(Object o);
/**
- * Returns true if this deque contains the specified element.
- * More formally, returns true if and only if this deque contains
- * at least one element e such that
+ * Returns {@code true} if this deque contains the specified element.
+ * More formally, returns {@code true} if and only if this deque contains
+ * at least one element {@code e} such that
* (o==null ? e==null : o.equals(e)).
*
* @param o element whose presence in this deque is to be tested
- * @return true if this deque contains the specified element
+ * @return {@code true} if this deque contains the specified element
* @throws ClassCastException if the type of the specified element
* is incompatible with this deque
* (optional)
diff --git a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java
index fb79c56660b..63c887e23ce 100644
--- a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java
+++ b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java
@@ -25,6 +25,7 @@
package java.util;
import java.util.function.DoubleConsumer;
+import java.util.stream.Collector;
/**
* A state object for collecting statistics such as count, min, max, sum, and
@@ -35,24 +36,24 @@ import java.util.function.DoubleConsumer;
* summary statistics on a stream of doubles with:
* {@code
* DoubleSummaryStatistics stats = doubleStream.collect(DoubleSummaryStatistics::new,
- * DoubleSummaryStatistics::accept,
- * DoubleSummaryStatistics::combine);
+ * DoubleSummaryStatistics::accept,
+ * DoubleSummaryStatistics::combine);
* }
*
* {@code DoubleSummaryStatistics} can be used as a
- * {@linkplain java.util.stream.Stream#reduce(java.util.function.BinaryOperator) reduction}
+ * {@linkplain java.util.stream.Stream#collect(Collector) reduction}
* target for a {@linkplain java.util.stream.Stream stream}. For example:
*
* {@code
* DoubleSummaryStatistics stats = people.stream()
- * .collect(Collectors.toDoubleSummaryStatistics(Person::getWeight));
+ * .collect(Collectors.summarizingDouble(Person::getWeight));
*}
*
* This computes, in a single pass, the count of people, as well as the minimum,
* maximum, sum, and average of their weights.
*
* @implNote This implementation is not thread safe. However, it is safe to use
- * {@link java.util.stream.Collectors#toDoubleSummaryStatistics(java.util.function.ToDoubleFunction)
+ * {@link java.util.stream.Collectors#summarizingDouble(java.util.function.ToDoubleFunction)
* Collectors.toDoubleStatistics()} on a parallel stream, because the parallel
* implementation of {@link java.util.stream.Stream#collect Stream.collect()}
* provides the necessary partitioning, isolation, and merging of results for
@@ -152,7 +153,7 @@ public class DoubleSummaryStatistics implements DoubleConsumer {
}
/**
- * Returns the average of values recorded, or zero if no values have been
+ * Returns the arithmetic mean of values recorded, or zero if no values have been
* recorded. The average returned can vary depending upon the order in
* which values are recorded. This is due to accumulated rounding error in
* addition of values of differing magnitudes. Values sorted by increasing
@@ -160,7 +161,7 @@ public class DoubleSummaryStatistics implements DoubleConsumer {
* value is a {@code NaN} or the sum is at any point a {@code NaN} then the
* average will be {@code NaN}.
*
- * @return the average of values, or zero if none
+ * @return the arithmetic mean of values, or zero if none
*/
public final double getAverage() {
return getCount() > 0 ? getSum() / getCount() : 0.0d;
diff --git a/jdk/src/share/classes/java/util/Formatter.java b/jdk/src/share/classes/java/util/Formatter.java
index 5c096c63acf..275e1854e0a 100644
--- a/jdk/src/share/classes/java/util/Formatter.java
+++ b/jdk/src/share/classes/java/util/Formatter.java
@@ -626,12 +626,11 @@ import sun.misc.FormattedFloatingDecimal;
* For general argument types, the precision is the maximum number of
* characters to be written to the output.
*
- * For the floating-point conversions {@code 'e'}, {@code 'E'}, and
- * {@code 'f'} the precision is the number of digits after the decimal
- * separator. If the conversion is {@code 'g'} or {@code 'G'}, then the
+ * For the floating-point conversions {@code 'a'}, {@code 'A'}, {@code 'e'},
+ * {@code 'E'}, and {@code 'f'} the precision is the number of digits after the
+ * radix point. If the conversion is {@code 'g'} or {@code 'G'}, then the
* precision is the total number of digits in the resulting magnitude after
- * rounding. If the conversion is {@code 'a'} or {@code 'A'}, then the
- * precision must not be specified.
+ * rounding.
*
* For character, integral, and date/time argument types and the percent
* and line separator conversions, the precision is not applicable; if a
@@ -1297,14 +1296,21 @@ import sun.misc.FormattedFloatingDecimal;
* of the significand as a fraction. The exponent is represented by
* {@code 'p'} ('\u0070') followed by a decimal string of the
* unbiased exponent as if produced by invoking {@link
- * Integer#toString(int) Integer.toString} on the exponent value.
+ * Integer#toString(int) Integer.toString} on the exponent value. If the
+ * precision is specified, the value is rounded to the given number of
+ * hexadecimal digits.
*
* If m is a {@code double} value with a subnormal
- * representation then the significand is represented by the characters
- * {@code '0x0.'} followed by the hexadecimal representation of the rest
- * of the significand as a fraction. The exponent is represented by
- * {@code 'p-1022'}. Note that there must be at least one nonzero digit
- * in a subnormal significand.
+ * representation then, unless the precision is specified to be in the range
+ * 1 through 12, inclusive, the significand is represented by the characters
+ * {@code '0x0.'} followed by the hexadecimal representation of the rest of
+ * the significand as a fraction, and the exponent represented by
+ * {@code 'p-1022'}. If the precision is in the interval
+ * [1, 12], the subnormal value is normalized such that it
+ * begins with the characters {@code '0x1.'}, rounded to the number of
+ * hexadecimal digits of precision, and the exponent adjusted
+ * accordingly. Note that there must be at least one nonzero digit in a
+ * subnormal significand.
*
*
*
@@ -1367,7 +1373,7 @@ import sun.misc.FormattedFloatingDecimal;
* {@code 1}.
*
* If the conversion is {@code 'a'} or {@code 'A'}, then the precision
- * is the number of hexadecimal digits after the decimal separator. If the
+ * is the number of hexadecimal digits after the radix point. If the
* precision is not provided, then all of the digits as returned by {@link
* Double#toHexString(double)} will be output.
*
diff --git a/jdk/src/share/classes/java/util/HashMap.java b/jdk/src/share/classes/java/util/HashMap.java
index c2aace9db8f..8dfafac8642 100644
--- a/jdk/src/share/classes/java/util/HashMap.java
+++ b/jdk/src/share/classes/java/util/HashMap.java
@@ -876,13 +876,9 @@ public class HashMap
private static int roundUpToPowerOf2(int number) {
// assert number >= 0 : "number must be non-negative";
- int rounded = number >= MAXIMUM_CAPACITY
+ return number >= MAXIMUM_CAPACITY
? MAXIMUM_CAPACITY
- : (rounded = Integer.highestOneBit(number)) != 0
- ? (Integer.bitCount(number) > 1) ? rounded << 1 : rounded
- : 1;
-
- return rounded;
+ : (number > 1) ? Integer.highestOneBit((number - 1) << 1) : 1;
}
/**
diff --git a/jdk/src/share/classes/java/util/Hashtable.java b/jdk/src/share/classes/java/util/Hashtable.java
index a481719be0c..518bd17f5b7 100644
--- a/jdk/src/share/classes/java/util/Hashtable.java
+++ b/jdk/src/share/classes/java/util/Hashtable.java
@@ -928,6 +928,7 @@ public class Hashtable
return (null == result) ? defaultValue : result;
}
+ @SuppressWarnings("unchecked")
@Override
public synchronized void forEach(BiConsumer super K, ? super V> action) {
Objects.requireNonNull(action); // explicit check required in case
@@ -947,6 +948,7 @@ public class Hashtable
}
}
+ @SuppressWarnings("unchecked")
@Override
public synchronized void replaceAll(BiFunction super K, ? super V, ? extends V> function) {
Objects.requireNonNull(function); // explicit check required in case
diff --git a/jdk/src/share/classes/java/util/IdentityHashMap.java b/jdk/src/share/classes/java/util/IdentityHashMap.java
index 3064588c901..a4bdc4b9efd 100644
--- a/jdk/src/share/classes/java/util/IdentityHashMap.java
+++ b/jdk/src/share/classes/java/util/IdentityHashMap.java
@@ -1339,6 +1339,7 @@ public class IdentityHashMap
tab[i + 1] = value;
}
+ @SuppressWarnings("unchecked")
@Override
public void forEach(BiConsumer super K, ? super V> action) {
Objects.requireNonNull(action);
@@ -1357,6 +1358,7 @@ public class IdentityHashMap
}
}
+ @SuppressWarnings("unchecked")
@Override
public void replaceAll(BiFunction super K, ? super V, ? extends V> function) {
Objects.requireNonNull(function);
diff --git a/jdk/src/share/classes/java/util/IntSummaryStatistics.java b/jdk/src/share/classes/java/util/IntSummaryStatistics.java
index fcca3296f85..f93436e7017 100644
--- a/jdk/src/share/classes/java/util/IntSummaryStatistics.java
+++ b/jdk/src/share/classes/java/util/IntSummaryStatistics.java
@@ -25,6 +25,7 @@
package java.util;
import java.util.function.IntConsumer;
+import java.util.stream.Collector;
/**
* A state object for collecting statistics such as count, min, max, sum, and
@@ -35,24 +36,24 @@ import java.util.function.IntConsumer;
* summary statistics on a stream of ints with:
* {@code
* IntSummaryStatistics stats = intStream.collect(IntSummaryStatistics::new,
- * IntSummaryStatistics::accept,
- * IntSummaryStatistics::combine);
+ * IntSummaryStatistics::accept,
+ * IntSummaryStatistics::combine);
* }
*
* {@code IntSummaryStatistics} can be used as a
- * {@linkplain java.util.stream.Stream#reduce(java.util.function.BinaryOperator) reduction}
+ * {@linkplain java.util.stream.Stream#collect(Collector) reduction}
* target for a {@linkplain java.util.stream.Stream stream}. For example:
*
* {@code
* IntSummaryStatistics stats = people.stream()
- * .collect(Collectors.toIntSummaryStatistics(Person::getDependents));
+ * .collect(Collectors.summarizingInt(Person::getDependents));
*}
*
* This computes, in a single pass, the count of people, as well as the minimum,
* maximum, sum, and average of their number of dependents.
*
* @implNote This implementation is not thread safe. However, it is safe to use
- * {@link java.util.stream.Collectors#toIntSummaryStatistics(java.util.function.ToIntFunction)
+ * {@link java.util.stream.Collectors#summarizingInt(java.util.function.ToIntFunction)
* Collectors.toIntStatistics()} on a parallel stream, because the parallel
* implementation of {@link java.util.stream.Stream#collect Stream.collect()}
* provides the necessary partitioning, isolation, and merging of results for
@@ -140,10 +141,10 @@ public class IntSummaryStatistics implements IntConsumer {
}
/**
- * Returns the average of values recorded, or zero if no values have been
+ * Returns the arithmetic mean of values recorded, or zero if no values have been
* recorded.
*
- * @return the average of values, or zero if none
+ * @return the arithmetic mean of values, or zero if none
*/
public final double getAverage() {
return getCount() > 0 ? (double) getSum() / getCount() : 0.0d;
diff --git a/jdk/src/share/classes/java/util/LongSummaryStatistics.java b/jdk/src/share/classes/java/util/LongSummaryStatistics.java
index 0e2da71f8bc..085aa298075 100644
--- a/jdk/src/share/classes/java/util/LongSummaryStatistics.java
+++ b/jdk/src/share/classes/java/util/LongSummaryStatistics.java
@@ -26,6 +26,7 @@ package java.util;
import java.util.function.IntConsumer;
import java.util.function.LongConsumer;
+import java.util.stream.Collector;
/**
* A state object for collecting statistics such as count, min, max, sum, and
@@ -36,24 +37,24 @@ import java.util.function.LongConsumer;
* summary statistics on a stream of longs with:
* {@code
* LongSummaryStatistics stats = longStream.collect(LongSummaryStatistics::new,
- * LongSummaryStatistics::accept,
- * LongSummaryStatistics::combine);
+ * LongSummaryStatistics::accept,
+ * LongSummaryStatistics::combine);
* }
*
* {@code LongSummaryStatistics} can be used as a
- * {@linkplain java.util.stream.Stream#reduce(java.util.function.BinaryOperator) reduction}
+ * {@linkplain java.util.stream.Stream#collect(Collector)} reduction}
* target for a {@linkplain java.util.stream.Stream stream}. For example:
*
* {@code
* LongSummaryStatistics stats = people.stream()
- * .collect(Collectors.toLongSummaryStatistics(Person::getAge));
+ * .collect(Collectors.summarizingLong(Person::getAge));
*}
*
* This computes, in a single pass, the count of people, as well as the minimum,
- * maximum, sum, and average of their ages in milliseconds.
+ * maximum, sum, and average of their ages.
*
* @implNote This implementation is not thread safe. However, it is safe to use
- * {@link java.util.stream.Collectors#toLongSummaryStatistics(java.util.function.ToLongFunction)
+ * {@link java.util.stream.Collectors#summarizingLong(java.util.function.ToLongFunction)
* Collectors.toLongStatistics()} on a parallel stream, because the parallel
* implementation of {@link java.util.stream.Stream#collect Stream.collect()}
* provides the necessary partitioning, isolation, and merging of results for
@@ -152,10 +153,10 @@ public class LongSummaryStatistics implements LongConsumer, IntConsumer {
}
/**
- * Returns the average of values recorded, or zero if no values have been
+ * Returns the arithmetic mean of values recorded, or zero if no values have been
* recorded.
*
- * @return The average of values, or zero if none
+ * @return The arithmetic mean of values, or zero if none
*/
public final double getAverage() {
return getCount() > 0 ? (double) getSum() / getCount() : 0.0d;
diff --git a/jdk/src/share/classes/java/util/Optional.java b/jdk/src/share/classes/java/util/Optional.java
index 5eed705255a..ce2a33d1de6 100644
--- a/jdk/src/share/classes/java/util/Optional.java
+++ b/jdk/src/share/classes/java/util/Optional.java
@@ -307,7 +307,7 @@ public final class Optional {
return false;
}
- Optional other = (Optional) obj;
+ Optional> other = (Optional>) obj;
return Objects.equals(value, other.value);
}
diff --git a/jdk/src/share/classes/java/util/Queue.java b/jdk/src/share/classes/java/util/Queue.java
index 124cc449426..4d345df7e6f 100644
--- a/jdk/src/share/classes/java/util/Queue.java
+++ b/jdk/src/share/classes/java/util/Queue.java
@@ -41,14 +41,15 @@ package java.util;
* queues provide additional insertion, extraction, and inspection
* operations. Each of these methods exists in two forms: one throws
* an exception if the operation fails, the other returns a special
- * value (either null or false, depending on the
+ * value (either {@code null} or {@code false}, depending on the
* operation). The latter form of the insert operation is designed
- * specifically for use with capacity-restricted Queue
+ * specifically for use with capacity-restricted {@code Queue}
* implementations; in most implementations, insert operations cannot
* fail.
*
*
*
+ * Summary of Queue methods
*
* |
* Throws exception |
@@ -56,18 +57,18 @@ package java.util;
*
*
* Insert |
- * {@link #add add(e)} |
- * {@link #offer offer(e)} |
+ * {@link Queue#add add(e)} |
+ * {@link Queue#offer offer(e)} |
*
*
* Remove |
- * {@link #remove remove()} |
- * {@link #poll poll()} |
+ * {@link Queue#remove remove()} |
+ * {@link Queue#poll poll()} |
*
*
* Examine |
- * {@link #element element()} |
- * {@link #peek peek()} |
+ * {@link Queue#element element()} |
+ * {@link Queue#peek peek()} |
*
*
*
@@ -79,15 +80,15 @@ package java.util;
* Whatever the ordering used, the head of the queue is that
* element which would be removed by a call to {@link #remove() } or
* {@link #poll()}. In a FIFO queue, all new elements are inserted at
- * the tail of the queue. Other kinds of queues may use
- * different placement rules. Every Queue implementation
+ * the tail of the queue. Other kinds of queues may use
+ * different placement rules. Every {@code Queue} implementation
* must specify its ordering properties.
*
* The {@link #offer offer} method inserts an element if possible,
- * otherwise returning false. This differs from the {@link
+ * otherwise returning {@code false}. This differs from the {@link
* java.util.Collection#add Collection.add} method, which can fail to
* add an element only by throwing an unchecked exception. The
- * offer method is designed for use when failure is a normal,
+ * {@code offer} method is designed for use when failure is a normal,
* rather than exceptional occurrence, for example, in fixed-capacity
* (or "bounded") queues.
*
@@ -95,32 +96,32 @@ package java.util;
* return the head of the queue.
* Exactly which element is removed from the queue is a
* function of the queue's ordering policy, which differs from
- * implementation to implementation. The remove() and
- * poll() methods differ only in their behavior when the
- * queue is empty: the remove() method throws an exception,
- * while the poll() method returns null.
+ * implementation to implementation. The {@code remove()} and
+ * {@code poll()} methods differ only in their behavior when the
+ * queue is empty: the {@code remove()} method throws an exception,
+ * while the {@code poll()} method returns {@code null}.
*
* The {@link #element()} and {@link #peek()} methods return, but do
* not remove, the head of the queue.
*
- * The Queue interface does not define the blocking queue
+ * The {@code Queue} interface does not define the blocking queue
* methods, which are common in concurrent programming. These methods,
* which wait for elements to appear or for space to become available, are
* defined in the {@link java.util.concurrent.BlockingQueue} interface, which
* extends this interface.
*
- * Queue implementations generally do not allow insertion
- * of null elements, although some implementations, such as
- * {@link LinkedList}, do not prohibit insertion of null.
- * Even in the implementations that permit it, null should
- * not be inserted into a Queue, as null is also
- * used as a special return value by the poll method to
+ * {@code Queue} implementations generally do not allow insertion
+ * of {@code null} elements, although some implementations, such as
+ * {@link LinkedList}, do not prohibit insertion of {@code null}.
+ * Even in the implementations that permit it, {@code null} should
+ * not be inserted into a {@code Queue}, as {@code null} is also
+ * used as a special return value by the {@code poll} method to
* indicate that the queue contains no elements.
*
- * Queue implementations generally do not define
- * element-based versions of methods equals and
- * hashCode but instead inherit the identity based versions
- * from class Object, because element-based equality is not
+ * {@code Queue} implementations generally do not define
+ * element-based versions of methods {@code equals} and
+ * {@code hashCode} but instead inherit the identity based versions
+ * from class {@code Object}, because element-based equality is not
* always well-defined for queues with the same elements but different
* ordering properties.
*
@@ -145,11 +146,11 @@ public interface Queue extends Collection {
/**
* Inserts the specified element into this queue if it is possible to do so
* immediately without violating capacity restrictions, returning
- * true upon success and throwing an IllegalStateException
+ * {@code true} upon success and throwing an {@code IllegalStateException}
* if no space is currently available.
*
* @param e the element to add
- * @return true (as specified by {@link Collection#add})
+ * @return {@code true} (as specified by {@link Collection#add})
* @throws IllegalStateException if the element cannot be added at this
* time due to capacity restrictions
* @throws ClassCastException if the class of the specified element
@@ -169,8 +170,8 @@ public interface Queue extends Collection {
* by throwing an exception.
*
* @param e the element to add
- * @return true if the element was added to this queue, else
- * false
+ * @return {@code true} if the element was added to this queue, else
+ * {@code false}
* @throws ClassCastException if the class of the specified element
* prevents it from being added to this queue
* @throws NullPointerException if the specified element is null and
@@ -192,9 +193,9 @@ public interface Queue extends Collection {
/**
* Retrieves and removes the head of this queue,
- * or returns null if this queue is empty.
+ * or returns {@code null} if this queue is empty.
*
- * @return the head of this queue, or null if this queue is empty
+ * @return the head of this queue, or {@code null} if this queue is empty
*/
E poll();
@@ -210,9 +211,9 @@ public interface Queue extends Collection {
/**
* Retrieves, but does not remove, the head of this queue,
- * or returns null if this queue is empty.
+ * or returns {@code null} if this queue is empty.
*
- * @return the head of this queue, or null if this queue is empty
+ * @return the head of this queue, or {@code null} if this queue is empty
*/
E peek();
}
diff --git a/jdk/src/share/classes/java/util/StringJoiner.java b/jdk/src/share/classes/java/util/StringJoiner.java
index 66d49b64f0a..d4050a4afd5 100644
--- a/jdk/src/share/classes/java/util/StringJoiner.java
+++ b/jdk/src/share/classes/java/util/StringJoiner.java
@@ -49,16 +49,17 @@ package java.util;
*
* A {@code StringJoiner} may be employed to create formatted output from a
* {@link java.util.stream.Stream} using
- * {@link java.util.stream.Collectors#toStringJoiner}. For example:
+ * {@link java.util.stream.Collectors#joining(CharSequence)}. For example:
*
* {@code
* List numbers = Arrays.asList(1, 2, 3, 4);
* String commaSeparatedNumbers = numbers.stream()
* .map(i -> i.toString())
- * .collect(Collectors.toStringJoiner(", ")).toString();
+ * .collect(Collectors.joining(", "));
* }
*
- * @see java.util.stream.Collectors#toStringJoiner
+ * @see java.util.stream.Collectors#joining(CharSequence)
+ * @see java.util.stream.Collectors#joining(CharSequence, CharSequence, CharSequence)
* @since 1.8
*/
public final class StringJoiner {
diff --git a/jdk/src/share/classes/java/util/Vector.java b/jdk/src/share/classes/java/util/Vector.java
index 18cc6f2f0aa..6146957dfd6 100644
--- a/jdk/src/share/classes/java/util/Vector.java
+++ b/jdk/src/share/classes/java/util/Vector.java
@@ -1164,12 +1164,13 @@ public class Vector
if (i >= size) {
return;
}
- final Object[] elementData = Vector.this.elementData;
+ @SuppressWarnings("unchecked")
+ final E[] elementData = (E[]) Vector.this.elementData;
if (i >= elementData.length) {
throw new ConcurrentModificationException();
}
while (i != size && modCount == expectedModCount) {
- action.accept((E) elementData[i++]);
+ action.accept(elementData[i++]);
}
// update once at end of iteration to reduce heap write traffic
cursor = i;
@@ -1311,8 +1312,8 @@ public class Vector
modCount++;
}
- @Override
@SuppressWarnings("unchecked")
+ @Override
public synchronized void sort(Comparator super E> c) {
final int expectedModCount = modCount;
Arrays.sort((E[]) elementData, 0, elementCount, c);
diff --git a/jdk/src/share/classes/java/util/WeakHashMap.java b/jdk/src/share/classes/java/util/WeakHashMap.java
index eb2e636e2ba..0299d296638 100644
--- a/jdk/src/share/classes/java/util/WeakHashMap.java
+++ b/jdk/src/share/classes/java/util/WeakHashMap.java
@@ -1038,6 +1038,7 @@ public class WeakHashMap
}
}
+ @SuppressWarnings("unchecked")
@Override
public void forEach(BiConsumer super K, ? super V> action) {
Objects.requireNonNull(action);
@@ -1059,6 +1060,7 @@ public class WeakHashMap
}
}
+ @SuppressWarnings("unchecked")
@Override
public void replaceAll(BiFunction super K, ? super V, ? extends V> function) {
Objects.requireNonNull(function);
diff --git a/jdk/src/share/classes/java/util/concurrent/CompletableFuture.java b/jdk/src/share/classes/java/util/concurrent/CompletableFuture.java
index 7926f2e63b9..5e2fb134fc1 100644
--- a/jdk/src/share/classes/java/util/concurrent/CompletableFuture.java
+++ b/jdk/src/share/classes/java/util/concurrent/CompletableFuture.java
@@ -48,13 +48,16 @@ import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.CancellationException;
+import java.util.concurrent.CompletionException;
+import java.util.concurrent.CompletionStage;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.LockSupport;
/**
* A {@link Future} that may be explicitly completed (setting its
- * value and status), and may include dependent functions and actions
- * that trigger upon its completion.
+ * value and status), and may be used as a {@link CompletionStage},
+ * supporting dependent functions and actions that trigger upon its
+ * completion.
*
* When two or more threads attempt to
* {@link #complete complete},
@@ -62,64 +65,50 @@ import java.util.concurrent.locks.LockSupport;
* {@link #cancel cancel}
* a CompletableFuture, only one of them succeeds.
*
- * Methods are available for adding dependents based on
- * user-provided Functions, Consumers, or Runnables. The appropriate
- * form to use depends on whether actions require arguments and/or
- * produce results. Completion of a dependent action will trigger the
- * completion of another CompletableFuture. Actions may also be
- * triggered after either or both the current and another
- * CompletableFuture complete. Multiple CompletableFutures may also
- * be grouped as one using {@link #anyOf(CompletableFuture...)} and
- * {@link #allOf(CompletableFuture...)}.
+ * In addition to these and related methods for directly
+ * manipulating status and results, CompletableFuture implements
+ * interface {@link CompletionStage} with the following policies:
*
- * CompletableFutures themselves do not execute asynchronously.
- * However, actions supplied for dependent completions of another
- * CompletableFuture may do so, depending on whether they are provided
- * via one of the async methods (that is, methods with names
- * of the form xxxAsync). The async
- * methods provide a way to commence asynchronous processing of an
- * action using either a given {@link Executor} or by default the
- * {@link ForkJoinPool#commonPool()}. To simplify monitoring,
+ * - Actions supplied for dependent completions of
+ * non-async methods may be performed by the thread that
+ * completes the current CompletableFuture, or by any other caller of
+ * a completion method.
+ *
+ * - All async methods without an explicit Executor
+ * argument are performed using the {@link ForkJoinPool#commonPool()}
+ * (unless it does not support a parallelism level of at least two, in
+ * which case, a new Thread is used). To simplify monitoring,
* debugging, and tracking, all generated asynchronous tasks are
- * instances of the marker interface {@link AsynchronousCompletionTask}.
+ * instances of the marker interface {@link
+ * AsynchronousCompletionTask}.
*
- * Actions supplied for dependent completions of non-async
- * methods may be performed by the thread that completes the current
- * CompletableFuture, or by any other caller of these methods. There
- * are no guarantees about the order of processing completions unless
- * constrained by these methods.
+ * - All CompletionStage methods are implemented independently of
+ * other public methods, so the behavior of one method is not impacted
+ * by overrides of others in subclasses.
*
- * Since (unlike {@link FutureTask}) this class has no direct
+ * CompletableFuture also implements {@link Future} with the following
+ * policies:
+ *
+ * - Since (unlike {@link FutureTask}) this class has no direct
* control over the computation that causes it to be completed,
- * cancellation is treated as just another form of exceptional completion.
- * Method {@link #cancel cancel} has the same effect as
- * {@code completeExceptionally(new CancellationException())}.
+ * cancellation is treated as just another form of exceptional
+ * completion. Method {@link #cancel cancel} has the same effect as
+ * {@code completeExceptionally(new CancellationException())}. Method
+ * {@link #isCompletedExceptionally} can be used to determine if a
+ * CompletableFuture completed in any exceptional fashion.
*
- * Upon exceptional completion (including cancellation), or when a
- * completion entails an additional computation which terminates
- * abruptly with an (unchecked) exception or error, then all of their
- * dependent completions (and their dependents in turn) generally act
- * as {@code completeExceptionally} with a {@link CompletionException}
- * holding that exception as its cause. However, the {@link
- * #exceptionally exceptionally} and {@link #handle handle}
- * completions are able to handle exceptional completions of
- * the CompletableFutures they depend on.
- *
- * In case of exceptional completion with a CompletionException,
+ * - In case of exceptional completion with a CompletionException,
* methods {@link #get()} and {@link #get(long, TimeUnit)} throw an
* {@link ExecutionException} with the same cause as held in the
- * corresponding CompletionException. However, in these cases,
- * methods {@link #join()} and {@link #getNow} throw the
- * CompletionException, which simplifies usage.
- *
- *
Arguments used to pass a completion result (that is, for parameters
- * of type {@code T}) may be null, but passing a null value for any other
- * parameter will result in a {@link NullPointerException} being thrown.
+ * corresponding CompletionException. To simplify usage in most
+ * contexts, this class also defines methods {@link #join()} and
+ * {@link #getNow} that instead throw the CompletionException directly
+ * in these cases.
*
* @author Doug Lea
* @since 1.8
*/
-public class CompletableFuture implements Future {
+public class CompletableFuture implements Future, CompletionStage {
/*
* Overview:
@@ -438,6 +427,19 @@ public class CompletableFuture implements Future {
public final void run() { exec(); }
}
+ /**
+ * Starts the given async task using the given executor, unless
+ * the executor is ForkJoinPool.commonPool and it has been
+ * disabled, in which case starts a new thread.
+ */
+ static void execAsync(Executor e, Async r) {
+ if (e == ForkJoinPool.commonPool() &&
+ ForkJoinPool.getCommonPoolParallelism() <= 1)
+ new Thread(r).start();
+ else
+ e.execute(r);
+ }
+
static final class AsyncRun extends Async {
final Runnable fn;
final CompletableFuture dst;
@@ -538,13 +540,13 @@ public class CompletableFuture implements Future {
static final class AsyncAccept extends Async {
final T arg;
final Consumer super T> fn;
- final CompletableFuture dst;
+ final CompletableFuture> dst;
AsyncAccept(T arg, Consumer super T> fn,
- CompletableFuture dst) {
+ CompletableFuture> dst) {
this.arg = arg; this.fn = fn; this.dst = dst;
}
public final boolean exec() {
- CompletableFuture d; Throwable ex;
+ CompletableFuture> d; Throwable ex;
if ((d = this.dst) != null && d.result == null) {
try {
fn.accept(arg);
@@ -563,14 +565,14 @@ public class CompletableFuture implements Future {
final T arg1;
final U arg2;
final BiConsumer super T,? super U> fn;
- final CompletableFuture dst;
+ final CompletableFuture> dst;
AsyncAcceptBoth(T arg1, U arg2,
BiConsumer super T,? super U> fn,
- CompletableFuture dst) {
+ CompletableFuture> dst) {
this.arg1 = arg1; this.arg2 = arg2; this.fn = fn; this.dst = dst;
}
public final boolean exec() {
- CompletableFuture d; Throwable ex;
+ CompletableFuture> d; Throwable ex;
if ((d = this.dst) != null && d.result == null) {
try {
fn.accept(arg1, arg2);
@@ -587,10 +589,10 @@ public class CompletableFuture implements Future {
static final class AsyncCompose extends Async {
final T arg;
- final Function super T, CompletableFuture> fn;
+ final Function super T, ? extends CompletionStage> fn;
final CompletableFuture dst;
AsyncCompose(T arg,
- Function super T, CompletableFuture> fn,
+ Function super T, ? extends CompletionStage> fn,
CompletableFuture dst) {
this.arg = arg; this.fn = fn; this.dst = dst;
}
@@ -598,7 +600,8 @@ public class CompletableFuture implements Future {
CompletableFuture d, fr; U u; Throwable ex;
if ((d = this.dst) != null && d.result == null) {
try {
- fr = fn.apply(arg);
+ CompletionStage cs = fn.apply(arg);
+ fr = (cs == null) ? null : cs.toCompletableFuture();
ex = (fr == null) ? new NullPointerException() : null;
} catch (Throwable rex) {
ex = rex;
@@ -626,6 +629,33 @@ public class CompletableFuture implements Future {
private static final long serialVersionUID = 5232453952276885070L;
}
+ static final class AsyncWhenComplete extends Async {
+ final T arg1;
+ final Throwable arg2;
+ final BiConsumer super T,? super Throwable> fn;
+ final CompletableFuture dst;
+ AsyncWhenComplete(T arg1, Throwable arg2,
+ BiConsumer super T,? super Throwable> fn,
+ CompletableFuture dst) {
+ this.arg1 = arg1; this.arg2 = arg2; this.fn = fn; this.dst = dst;
+ }
+ public final boolean exec() {
+ CompletableFuture d;
+ if ((d = this.dst) != null && d.result == null) {
+ Throwable ex = arg2;
+ try {
+ fn.accept(arg1, ex);
+ } catch (Throwable rex) {
+ if (ex == null)
+ ex = rex;
+ }
+ d.internalComplete(arg1, ex);
+ }
+ return true;
+ }
+ private static final long serialVersionUID = 5232453952276885070L;
+ }
+
/* ------------- Completions -------------- */
/**
@@ -680,7 +710,7 @@ public class CompletableFuture implements Future {
if (ex == null) {
try {
if (e != null)
- e.execute(new AsyncApply(t, fn, dst));
+ execAsync(e, new AsyncApply(t, fn, dst));
else
u = fn.apply(t);
} catch (Throwable rex) {
@@ -697,11 +727,11 @@ public class CompletableFuture implements Future {
static final class ThenAccept extends Completion {
final CompletableFuture extends T> src;
final Consumer super T> fn;
- final CompletableFuture dst;
+ final CompletableFuture> dst;
final Executor executor;
ThenAccept(CompletableFuture extends T> src,
Consumer super T> fn,
- CompletableFuture dst,
+ CompletableFuture> dst,
Executor executor) {
this.src = src; this.fn = fn; this.dst = dst;
this.executor = executor;
@@ -709,7 +739,7 @@ public class CompletableFuture implements Future {
public final void run() {
final CompletableFuture extends T> a;
final Consumer super T> fn;
- final CompletableFuture dst;
+ final CompletableFuture> dst;
Object r; T t; Throwable ex;
if ((dst = this.dst) != null &&
(fn = this.fn) != null &&
@@ -729,7 +759,7 @@ public class CompletableFuture implements Future {
if (ex == null) {
try {
if (e != null)
- e.execute(new AsyncAccept(t, fn, dst));
+ execAsync(e, new AsyncAccept(t, fn, dst));
else
fn.accept(t);
} catch (Throwable rex) {
@@ -773,7 +803,7 @@ public class CompletableFuture implements Future {
if (ex == null) {
try {
if (e != null)
- e.execute(new AsyncRun(fn, dst));
+ execAsync(e, new AsyncRun(fn, dst));
else
fn.run();
} catch (Throwable rex) {
@@ -839,7 +869,7 @@ public class CompletableFuture implements Future {
if (ex == null) {
try {
if (e != null)
- e.execute(new AsyncCombine(t, u, fn, dst));
+ execAsync(e, new AsyncCombine(t, u, fn, dst));
else
v = fn.apply(t, u);
} catch (Throwable rex) {
@@ -904,7 +934,7 @@ public class CompletableFuture implements Future {
if (ex == null) {
try {
if (e != null)
- e.execute(new AsyncAcceptBoth(t, u, fn, dst));
+ execAsync(e, new AsyncAcceptBoth(t, u, fn, dst));
else
fn.accept(t, u);
} catch (Throwable rex) {
@@ -956,7 +986,7 @@ public class CompletableFuture implements Future {
if (ex == null) {
try {
if (e != null)
- e.execute(new AsyncRun(fn, dst));
+ execAsync(e, new AsyncRun(fn, dst));
else
fn.run();
} catch (Throwable rex) {
@@ -1042,7 +1072,7 @@ public class CompletableFuture implements Future {
if (ex == null) {
try {
if (e != null)
- e.execute(new AsyncApply(t, fn, dst));
+ execAsync(e, new AsyncApply(t, fn, dst));
else
u = fn.apply(t);
} catch (Throwable rex) {
@@ -1095,7 +1125,7 @@ public class CompletableFuture implements Future {
if (ex == null) {
try {
if (e != null)
- e.execute(new AsyncAccept(t, fn, dst));
+ execAsync(e, new AsyncAccept(t, fn, dst));
else
fn.accept(t);
} catch (Throwable rex) {
@@ -1143,7 +1173,7 @@ public class CompletableFuture implements Future {
if (ex == null) {
try {
if (e != null)
- e.execute(new AsyncRun(fn, dst));
+ execAsync(e, new AsyncRun(fn, dst));
else
fn.run();
} catch (Throwable rex) {
@@ -1226,6 +1256,54 @@ public class CompletableFuture implements Future {
private static final long serialVersionUID = 5232453952276885070L;
}
+ static final class WhenCompleteCompletion extends Completion {
+ final CompletableFuture extends T> src;
+ final BiConsumer super T, ? super Throwable> fn;
+ final CompletableFuture dst;
+ final Executor executor;
+ WhenCompleteCompletion(CompletableFuture extends T> src,
+ BiConsumer super T, ? super Throwable> fn,
+ CompletableFuture dst,
+ Executor executor) {
+ this.src = src; this.fn = fn; this.dst = dst;
+ this.executor = executor;
+ }
+ public final void run() {
+ final CompletableFuture extends T> a;
+ final BiConsumer super T, ? super Throwable> fn;
+ final CompletableFuture dst;
+ Object r; T t; Throwable ex;
+ if ((dst = this.dst) != null &&
+ (fn = this.fn) != null &&
+ (a = this.src) != null &&
+ (r = a.result) != null &&
+ compareAndSet(0, 1)) {
+ if (r instanceof AltResult) {
+ ex = ((AltResult)r).ex;
+ t = null;
+ }
+ else {
+ ex = null;
+ @SuppressWarnings("unchecked") T tr = (T) r;
+ t = tr;
+ }
+ Executor e = executor;
+ Throwable dx = null;
+ try {
+ if (e != null)
+ execAsync(e, new AsyncWhenComplete(t, ex, fn, dst));
+ else
+ fn.accept(t, ex);
+ } catch (Throwable rex) {
+ dx = rex;
+ }
+ if (e == null || dx != null)
+ dst.internalComplete(t, ex != null ? ex : dx);
+ }
+ }
+ private static final long serialVersionUID = 5232453952276885070L;
+ }
+
static final class ThenCopy extends Completion {
final CompletableFuture> src;
final CompletableFuture dst;
@@ -1286,10 +1364,13 @@ public class CompletableFuture implements Future {
final CompletableFuture extends T> src;
final BiFunction super T, Throwable, ? extends U> fn;
final CompletableFuture dst;
+ final Executor executor;
HandleCompletion(CompletableFuture extends T> src,
BiFunction super T, Throwable, ? extends U> fn,
- CompletableFuture dst) {
+ CompletableFuture dst,
+ Executor executor) {
this.src = src; this.fn = fn; this.dst = dst;
+ this.executor = executor;
}
public final void run() {
final CompletableFuture extends T> a;
@@ -1310,13 +1391,19 @@ public class CompletableFuture implements Future {
@SuppressWarnings("unchecked") T tr = (T) r;
t = tr;
}
- U u = null; Throwable dx = null;
+ Executor e = executor;
+ U u = null;
+ Throwable dx = null;
try {
- u = fn.apply(t, ex);
+ if (e != null)
+ execAsync(e, new AsyncCombine(t, ex, fn, dst));
+ else
+ u = fn.apply(t, ex);
} catch (Throwable rex) {
dx = rex;
}
- dst.internalComplete(u, dx);
+ if (e == null || dx != null)
+ dst.internalComplete(u, dx);
}
}
private static final long serialVersionUID = 5232453952276885070L;
@@ -1324,11 +1411,11 @@ public class CompletableFuture implements Future {
static final class ThenCompose extends Completion {
final CompletableFuture extends T> src;
- final Function super T, CompletableFuture> fn;
+ final Function super T, ? extends CompletionStage> fn;
final CompletableFuture dst;
final Executor executor;
ThenCompose(CompletableFuture extends T> src,
- Function super T, CompletableFuture> fn,
+ Function super T, ? extends CompletionStage> fn,
CompletableFuture dst,
Executor executor) {
this.src = src; this.fn = fn; this.dst = dst;
@@ -1336,7 +1423,7 @@ public class CompletableFuture implements Future {
}
public final void run() {
final CompletableFuture extends T> a;
- final Function super T, CompletableFuture> fn;
+ final Function super T, ? extends CompletionStage> fn;
final CompletableFuture dst;
Object r; T t; Throwable ex; Executor e;
if ((dst = this.dst) != null &&
@@ -1358,10 +1445,12 @@ public class CompletableFuture implements Future {
boolean complete = false;
if (ex == null) {
if ((e = executor) != null)
- e.execute(new AsyncCompose(t, fn, dst));
+ execAsync(e, new AsyncCompose(t, fn, dst));
else {
try {
- if ((c = fn.apply(t)) == null)
+ CompletionStage cs = fn.apply(t);
+ c = (cs == null) ? null : cs.toCompletableFuture();
+ if (c == null)
ex = new NullPointerException();
} catch (Throwable rex) {
ex = rex;
@@ -1401,6 +1490,619 @@ public class CompletableFuture implements Future {
private static final long serialVersionUID = 5232453952276885070L;
}
+ // Implementations of stage methods with (plain, async, Executor) forms
+
+ private CompletableFuture doThenApply
+ (Function super T,? extends U> fn,
+ Executor e) {
+ if (fn == null) throw new NullPointerException();
+ CompletableFuture dst = new CompletableFuture();
+ ThenApply d = null;
+ Object r;
+ if ((r = result) == null) {
+ CompletionNode p = new CompletionNode
+ (d = new ThenApply(this, fn, dst, e));
+ while ((r = result) == null) {
+ if (UNSAFE.compareAndSwapObject
+ (this, COMPLETIONS, p.next = completions, p))
+ break;
+ }
+ }
+ if (r != null && (d == null || d.compareAndSet(0, 1))) {
+ T t; Throwable ex;
+ if (r instanceof AltResult) {
+ ex = ((AltResult)r).ex;
+ t = null;
+ }
+ else {
+ ex = null;
+ @SuppressWarnings("unchecked") T tr = (T) r;
+ t = tr;
+ }
+ U u = null;
+ if (ex == null) {
+ try {
+ if (e != null)
+ execAsync(e, new AsyncApply(t, fn, dst));
+ else
+ u = fn.apply(t);
+ } catch (Throwable rex) {
+ ex = rex;
+ }
+ }
+ if (e == null || ex != null)
+ dst.internalComplete(u, ex);
+ }
+ helpPostComplete();
+ return dst;
+ }
+
+ private CompletableFuture doThenAccept(Consumer super T> fn,
+ Executor e) {
+ if (fn == null) throw new NullPointerException();
+ CompletableFuture |