--- a/.hgtags Sat Dec 29 11:00:15 2012 +0000
+++ b/.hgtags Tue Jan 01 17:49:22 2013 -0800
@@ -189,3 +189,6 @@
a2cf4d4a484378caea2e827ed604b2bbae58bdba jdk8-b65
17820b958ae84f7c1cc6719319c8e2232f7a4f1d jdk8-b66
76cc9bd3ece407d3a15d3bea537b57927973c5e7 jdk8-b67
+cb33628d4e8f11e879c371959e5948b66a53376f jdk8-b68
+adb5171c554e14cd86f618b5584f6e3d693d5889 jdk8-b69
+0d625373c69e2ad6f546fd88ab50c6c9aad01271 jdk8-b70
--- a/.hgtags-top-repo Sat Dec 29 11:00:15 2012 +0000
+++ b/.hgtags-top-repo Tue Jan 01 17:49:22 2013 -0800
@@ -189,3 +189,6 @@
b772de306dc24c17f7bd1398531ddeb58723b804 jdk8-b65
13bb8c326e7b7b0b19d78c8088033e3932e3f7ca jdk8-b66
9a6ec97ec45c1a62d5233cefa91e8390e380e13a jdk8-b67
+cdb401a60cea6ad5ef3f498725ed1decf8dda1ea jdk8-b68
+6ee8080a6efe0639fcd00627a5e0f839bf010481 jdk8-b69
+105a25ffa4a4f0af70188d4371b4a0385009b7ce jdk8-b70
--- a/common/autoconf/basics.m4 Sat Dec 29 11:00:15 2012 +0000
+++ b/common/autoconf/basics.m4 Tue Jan 01 17:49:22 2013 -0800
@@ -90,13 +90,25 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ AC_MSG_NOTICE([Resolving $1 (as $path) failed, using $path directly.])
+ new_path="$path"
+ fi
+
if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- AC_MSG_NOTICE([Resolving $1 (as $path) with 'which' failed, using $path directly.])
- new_path="$path"
- else
AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.])
has_space=`$ECHO "$complete" | $GREP " "`
if test "x$has_space" != x; then
@@ -104,20 +116,19 @@
fi
AC_MSG_ERROR([Cannot locate the the path of $1])
fi
- fi
fi
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- $1="$new_complete"
- AC_MSG_NOTICE([Rewriting $1 to "$new_complete"])
- fi
+ $1="$new_complete"
+ AC_MSG_NOTICE([Rewriting $1 to "$new_complete"])
+ fi
])
AC_DEFUN([BASIC_REMOVE_SYMBOLIC_LINKS],
--- a/common/autoconf/generated-configure.sh Sat Dec 29 11:00:15 2012 +0000
+++ b/common/autoconf/generated-configure.sh Tue Jan 01 17:49:22 2013 -0800
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for OpenJDK jdk8.
+# Generated by GNU Autoconf 2.68 for OpenJDK jdk8.
#
# Report bugs to <build-dev@openjdk.java.net>.
#
@@ -91,6 +91,7 @@
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
@@ -216,11 +217,18 @@
# 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
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+ 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+"$@"}
fi
if test x$as_have_required = xno; then :
@@ -812,6 +820,7 @@
JVM_VARIANT_ZEROSHARK
JVM_VARIANT_ZERO
JVM_VARIANT_KERNEL
+JVM_VARIANT_MINIMAL1
JVM_VARIANT_CLIENT
JVM_VARIANT_SERVER
JVM_VARIANTS
@@ -1430,7 +1439,7 @@
$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
@@ -1684,7 +1693,7 @@
sys-root (for cross-compiling)
--with-jdk-variant JDK variant to build (normal) [normal]
--with-jvm-variants JVM variants (separated by commas) to build (server,
- client, kernel, zero, zeroshark) [server]
+ client, minimal1, kernel, zero, zeroshark) [server]
--with-debug-level set the debug level (release, fastdebug, slowdebug)
[release]
--with-conf-name use this as the name of the configuration [generated
@@ -1850,7 +1859,7 @@
if $ac_init_version; then
cat <<\_ACEOF
OpenJDK configure jdk8
-generated by GNU Autoconf 2.67
+generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -1896,7 +1905,7 @@
ac_retval=1
fi
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
@@ -1934,7 +1943,7 @@
ac_retval=1
fi
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_compile
@@ -1972,7 +1981,7 @@
ac_retval=1
fi
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_objc_try_compile
@@ -2009,7 +2018,7 @@
ac_retval=1
fi
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_cpp
@@ -2046,7 +2055,7 @@
ac_retval=1
fi
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_cpp
@@ -2059,10 +2068,10 @@
ac_fn_cxx_check_header_mongrel ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval "test \"\${$3+set}\"" = set; then :
+ if eval \${$3+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
@@ -2129,7 +2138,7 @@
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=\$ac_header_compiler"
@@ -2138,7 +2147,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
fi
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_cxx_check_header_mongrel
@@ -2179,7 +2188,7 @@
ac_retval=$ac_status
fi
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_run
@@ -2193,7 +2202,7 @@
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 "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2211,7 +2220,7 @@
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_cxx_check_header_compile
@@ -2388,7 +2397,7 @@
rm -f conftest.val
fi
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_cxx_compute_int
@@ -2434,7 +2443,7 @@
# 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_link
@@ -2447,7 +2456,7 @@
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 "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2502,7 +2511,7 @@
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_cxx_check_func
@@ -2515,7 +2524,7 @@
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 "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2533,7 +2542,7 @@
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
cat >config.log <<_ACEOF
@@ -2541,7 +2550,7 @@
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.67. Invocation command line was
+generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2799,7 +2808,7 @@
|| { { $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
@@ -3674,7 +3683,7 @@
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1355221914
+DATE_WHEN_GENERATED=1355963953
###############################################################################
#
@@ -3712,7 +3721,7 @@
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 test "${ac_cv_path_BASENAME+set}" = set; then :
+if ${ac_cv_path_BASENAME+:} false; then :
$as_echo_n "(cached) " >&6
else
case $BASENAME in
@@ -3771,7 +3780,7 @@
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 test "${ac_cv_path_BASH+set}" = set; then :
+if ${ac_cv_path_BASH+:} false; then :
$as_echo_n "(cached) " >&6
else
case $BASH in
@@ -3830,7 +3839,7 @@
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 test "${ac_cv_path_CAT+set}" = set; then :
+if ${ac_cv_path_CAT+:} false; then :
$as_echo_n "(cached) " >&6
else
case $CAT in
@@ -3889,7 +3898,7 @@
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 test "${ac_cv_path_CHMOD+set}" = set; then :
+if ${ac_cv_path_CHMOD+:} false; then :
$as_echo_n "(cached) " >&6
else
case $CHMOD in
@@ -3948,7 +3957,7 @@
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 test "${ac_cv_path_CMP+set}" = set; then :
+if ${ac_cv_path_CMP+:} false; then :
$as_echo_n "(cached) " >&6
else
case $CMP in
@@ -4007,7 +4016,7 @@
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 test "${ac_cv_path_CP+set}" = set; then :
+if ${ac_cv_path_CP+:} false; then :
$as_echo_n "(cached) " >&6
else
case $CP in
@@ -4066,7 +4075,7 @@
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 test "${ac_cv_path_CUT+set}" = set; then :
+if ${ac_cv_path_CUT+:} false; then :
$as_echo_n "(cached) " >&6
else
case $CUT in
@@ -4125,7 +4134,7 @@
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 test "${ac_cv_path_DATE+set}" = set; then :
+if ${ac_cv_path_DATE+:} false; then :
$as_echo_n "(cached) " >&6
else
case $DATE in
@@ -4184,7 +4193,7 @@
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 test "${ac_cv_path_DIFF+set}" = set; then :
+if ${ac_cv_path_DIFF+:} false; then :
$as_echo_n "(cached) " >&6
else
case $DIFF in
@@ -4243,7 +4252,7 @@
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 test "${ac_cv_path_DIRNAME+set}" = set; then :
+if ${ac_cv_path_DIRNAME+:} false; then :
$as_echo_n "(cached) " >&6
else
case $DIRNAME in
@@ -4302,7 +4311,7 @@
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 test "${ac_cv_path_ECHO+set}" = set; then :
+if ${ac_cv_path_ECHO+:} false; then :
$as_echo_n "(cached) " >&6
else
case $ECHO in
@@ -4361,7 +4370,7 @@
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 test "${ac_cv_path_EXPR+set}" = set; then :
+if ${ac_cv_path_EXPR+:} false; then :
$as_echo_n "(cached) " >&6
else
case $EXPR in
@@ -4420,7 +4429,7 @@
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 test "${ac_cv_path_FILE+set}" = set; then :
+if ${ac_cv_path_FILE+:} false; then :
$as_echo_n "(cached) " >&6
else
case $FILE in
@@ -4479,7 +4488,7 @@
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 test "${ac_cv_path_FIND+set}" = set; then :
+if ${ac_cv_path_FIND+:} false; then :
$as_echo_n "(cached) " >&6
else
case $FIND in
@@ -4538,7 +4547,7 @@
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 test "${ac_cv_path_HEAD+set}" = set; then :
+if ${ac_cv_path_HEAD+:} false; then :
$as_echo_n "(cached) " >&6
else
case $HEAD in
@@ -4597,7 +4606,7 @@
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 test "${ac_cv_path_LN+set}" = set; then :
+if ${ac_cv_path_LN+:} false; then :
$as_echo_n "(cached) " >&6
else
case $LN in
@@ -4656,7 +4665,7 @@
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 test "${ac_cv_path_LS+set}" = set; then :
+if ${ac_cv_path_LS+:} false; then :
$as_echo_n "(cached) " >&6
else
case $LS in
@@ -4715,7 +4724,7 @@
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 test "${ac_cv_path_MKDIR+set}" = set; then :
+if ${ac_cv_path_MKDIR+:} false; then :
$as_echo_n "(cached) " >&6
else
case $MKDIR in
@@ -4774,7 +4783,7 @@
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 test "${ac_cv_path_MKTEMP+set}" = set; then :
+if ${ac_cv_path_MKTEMP+:} false; then :
$as_echo_n "(cached) " >&6
else
case $MKTEMP in
@@ -4833,7 +4842,7 @@
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 test "${ac_cv_path_MV+set}" = set; then :
+if ${ac_cv_path_MV+:} false; then :
$as_echo_n "(cached) " >&6
else
case $MV in
@@ -4892,7 +4901,7 @@
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 test "${ac_cv_path_PRINTF+set}" = set; then :
+if ${ac_cv_path_PRINTF+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PRINTF in
@@ -4951,7 +4960,7 @@
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 test "${ac_cv_path_THEPWDCMD+set}" = set; then :
+if ${ac_cv_path_THEPWDCMD+:} false; then :
$as_echo_n "(cached) " >&6
else
case $THEPWDCMD in
@@ -5010,7 +5019,7 @@
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 test "${ac_cv_path_RM+set}" = set; then :
+if ${ac_cv_path_RM+:} false; then :
$as_echo_n "(cached) " >&6
else
case $RM in
@@ -5069,7 +5078,7 @@
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 test "${ac_cv_path_SH+set}" = set; then :
+if ${ac_cv_path_SH+:} false; then :
$as_echo_n "(cached) " >&6
else
case $SH in
@@ -5128,7 +5137,7 @@
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 test "${ac_cv_path_SORT+set}" = set; then :
+if ${ac_cv_path_SORT+:} false; then :
$as_echo_n "(cached) " >&6
else
case $SORT in
@@ -5187,7 +5196,7 @@
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 test "${ac_cv_path_TAIL+set}" = set; then :
+if ${ac_cv_path_TAIL+:} false; then :
$as_echo_n "(cached) " >&6
else
case $TAIL in
@@ -5246,7 +5255,7 @@
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 test "${ac_cv_path_TAR+set}" = set; then :
+if ${ac_cv_path_TAR+:} false; then :
$as_echo_n "(cached) " >&6
else
case $TAR in
@@ -5305,7 +5314,7 @@
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 test "${ac_cv_path_TEE+set}" = set; then :
+if ${ac_cv_path_TEE+:} false; then :
$as_echo_n "(cached) " >&6
else
case $TEE in
@@ -5364,7 +5373,7 @@
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 test "${ac_cv_path_TOUCH+set}" = set; then :
+if ${ac_cv_path_TOUCH+:} false; then :
$as_echo_n "(cached) " >&6
else
case $TOUCH in
@@ -5423,7 +5432,7 @@
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 test "${ac_cv_path_TR+set}" = set; then :
+if ${ac_cv_path_TR+:} false; then :
$as_echo_n "(cached) " >&6
else
case $TR in
@@ -5482,7 +5491,7 @@
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 test "${ac_cv_path_UNAME+set}" = set; then :
+if ${ac_cv_path_UNAME+:} false; then :
$as_echo_n "(cached) " >&6
else
case $UNAME in
@@ -5541,7 +5550,7 @@
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 test "${ac_cv_path_UNIQ+set}" = set; then :
+if ${ac_cv_path_UNIQ+:} false; then :
$as_echo_n "(cached) " >&6
else
case $UNIQ in
@@ -5600,7 +5609,7 @@
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 test "${ac_cv_path_WC+set}" = set; then :
+if ${ac_cv_path_WC+:} false; then :
$as_echo_n "(cached) " >&6
else
case $WC in
@@ -5659,7 +5668,7 @@
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 test "${ac_cv_path_WHICH+set}" = set; then :
+if ${ac_cv_path_WHICH+:} false; then :
$as_echo_n "(cached) " >&6
else
case $WHICH in
@@ -5718,7 +5727,7 @@
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 test "${ac_cv_path_XARGS+set}" = set; then :
+if ${ac_cv_path_XARGS+:} false; then :
$as_echo_n "(cached) " >&6
else
case $XARGS in
@@ -5778,7 +5787,7 @@
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 test "${ac_cv_prog_AWK+set}" = set; then :
+if ${ac_cv_prog_AWK+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$AWK"; then
@@ -5828,7 +5837,7 @@
{ $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 test "${ac_cv_path_GREP+set}" = set; then :
+if ${ac_cv_path_GREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$GREP"; then
@@ -5903,7 +5912,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
$as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if ${ac_cv_path_EGREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -5982,7 +5991,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
$as_echo_n "checking for fgrep... " >&6; }
-if test "${ac_cv_path_FGREP+set}" = set; then :
+if ${ac_cv_path_FGREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
@@ -6061,7 +6070,7 @@
{ $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 test "${ac_cv_path_SED+set}" = set; then :
+if ${ac_cv_path_SED+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
@@ -6147,7 +6156,7 @@
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 test "${ac_cv_path_NAWK+set}" = set; then :
+if ${ac_cv_path_NAWK+:} false; then :
$as_echo_n "(cached) " >&6
else
case $NAWK in
@@ -6207,7 +6216,7 @@
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 test "${ac_cv_path_CYGPATH+set}" = set; then :
+if ${ac_cv_path_CYGPATH+:} false; then :
$as_echo_n "(cached) " >&6
else
case $CYGPATH in
@@ -6247,7 +6256,7 @@
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 test "${ac_cv_path_READLINK+set}" = set; then :
+if ${ac_cv_path_READLINK+:} false; then :
$as_echo_n "(cached) " >&6
else
case $READLINK in
@@ -6287,7 +6296,7 @@
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 test "${ac_cv_path_DF+set}" = set; then :
+if ${ac_cv_path_DF+:} false; then :
$as_echo_n "(cached) " >&6
else
case $DF in
@@ -6327,7 +6336,7 @@
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 test "${ac_cv_path_SETFILE+set}" = set; then :
+if ${ac_cv_path_SETFILE+:} false; then :
$as_echo_n "(cached) " >&6
else
case $SETFILE in
@@ -6373,7 +6382,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then :
+if ${ac_cv_build+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_build_alias=$build_alias
@@ -6389,7 +6398,7 @@
$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='-'
@@ -6407,7 +6416,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
$as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then :
+if ${ac_cv_host+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "x$host_alias" = x; then
@@ -6422,7 +6431,7 @@
$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='-'
@@ -6440,7 +6449,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
$as_echo_n "checking target system type... " >&6; }
-if test "${ac_cv_target+set}" = set; then :
+if ${ac_cv_target+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "x$target_alias" = x; then
@@ -6455,7 +6464,7 @@
$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='-'
@@ -7387,6 +7396,7 @@
# Currently we have:
# server: normal interpreter and a tiered C1/C2 compiler
# client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms)
+# minimal1: reduced form of client with optional VM services and features stripped out
# kernel: kernel footprint JVM that passes the TCK without major performance problems,
# ie normal interpreter and C1, only the serial GC, kernel jvmti etc
# zero: no machine code interpreter, no compiler
@@ -7405,16 +7415,17 @@
fi
JVM_VARIANTS=",$with_jvm_variants,"
-TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'`
+TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/minimal1,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'`
if test "x$TEST_VARIANTS" != "x,"; then
- as_fn_error $? "The available JVM variants are: server, client, kernel, zero, zeroshark" "$LINENO" 5
+ as_fn_error $? "The available JVM variants are: server, client, minimal1, kernel, zero, zeroshark" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_jvm_variants" >&5
$as_echo "$with_jvm_variants" >&6; }
JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
+JVM_VARIANT_MINIMAL1=`$ECHO "$JVM_VARIANTS" | $SED -e '/,minimal1,/!s/.*/false/g' -e '/,minimal1,/s/.*/true/g'`
JVM_VARIANT_KERNEL=`$ECHO "$JVM_VARIANTS" | $SED -e '/,kernel,/!s/.*/false/g' -e '/,kernel,/s/.*/true/g'`
JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
@@ -7429,10 +7440,15 @@
as_fn_error $? "You cannot build a kernel JVM for a 64-bit machine." "$LINENO" 5
fi
fi
+if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
+ if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+ as_fn_error $? "You cannot build a minimal JVM for a 64-bit machine." "$LINENO" 5
+ fi
+fi
# Replace the commas with AND for use in the build directory name.
ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/'`
-COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/'`
+COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/minimal1,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/'`
if test "x$COUNT_VARIANTS" != "x,1"; then
BUILDING_MULTIPLE_JVM_VARIANTS=yes
else
@@ -7446,6 +7462,7 @@
+
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
MACOSX_UNIVERSAL="true"
fi
@@ -7531,7 +7548,9 @@
#####
# Generate the legacy makefile targets for hotspot.
# The hotspot api for selecting the build artifacts, really, needs to be improved.
-#
+# JDK-7195896 will fix this on the hotspot side by using the JVM_VARIANT_* variables to
+# determine what needs to be built. All we will need to set here is all_product, all_fastdebug etc
+# But until then ...
HOTSPOT_TARGET=""
if test "x$JVM_VARIANT_SERVER" = xtrue; then
@@ -7542,6 +7561,10 @@
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
fi
+if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
+ HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
+fi
+
if test "x$JVM_VARIANT_KERNEL" = xtrue; then
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel "
fi
@@ -7860,7 +7883,7 @@
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 test "${ac_cv_prog_PKGHANDLER+set}" = set; then :
+if ${ac_cv_prog_PKGHANDLER+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$PKGHANDLER"; then
@@ -8165,14 +8188,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -8182,21 +8217,20 @@
fi
as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- FOUND_MAKE="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+ FOUND_MAKE="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
- fi
+ fi
fi
fi
@@ -8214,7 +8248,7 @@
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 test "${ac_cv_path_CHECK_GMAKE+set}" = set; then :
+if ${ac_cv_path_CHECK_GMAKE+:} false; then :
$as_echo_n "(cached) " >&6
else
case $CHECK_GMAKE in
@@ -8511,14 +8545,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -8528,21 +8574,20 @@
fi
as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- FOUND_MAKE="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+ FOUND_MAKE="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
- fi
+ fi
fi
fi
@@ -8557,7 +8602,7 @@
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 test "${ac_cv_path_CHECK_MAKE+set}" = set; then :
+if ${ac_cv_path_CHECK_MAKE+:} false; then :
$as_echo_n "(cached) " >&6
else
case $CHECK_MAKE in
@@ -8854,14 +8899,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -8871,21 +8928,20 @@
fi
as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- FOUND_MAKE="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+ FOUND_MAKE="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
- fi
+ fi
fi
fi
@@ -8905,7 +8961,7 @@
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 test "${ac_cv_path_CHECK_TOOLSDIR_GMAKE+set}" = set; then :
+if ${ac_cv_path_CHECK_TOOLSDIR_GMAKE+:} false; then :
$as_echo_n "(cached) " >&6
else
case $CHECK_TOOLSDIR_GMAKE in
@@ -9202,14 +9258,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -9219,21 +9287,20 @@
fi
as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- FOUND_MAKE="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+ FOUND_MAKE="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
- fi
+ fi
fi
fi
@@ -9247,7 +9314,7 @@
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 test "${ac_cv_path_CHECK_TOOLSDIR_MAKE+set}" = set; then :
+if ${ac_cv_path_CHECK_TOOLSDIR_MAKE+:} false; then :
$as_echo_n "(cached) " >&6
else
case $CHECK_TOOLSDIR_MAKE in
@@ -9544,14 +9611,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -9561,21 +9640,20 @@
fi
as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- FOUND_MAKE="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+ FOUND_MAKE="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
- fi
+ fi
fi
fi
@@ -9632,7 +9710,7 @@
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 test "${ac_cv_path_UNZIP+set}" = set; then :
+if ${ac_cv_path_UNZIP+:} false; then :
$as_echo_n "(cached) " >&6
else
case $UNZIP in
@@ -9691,7 +9769,7 @@
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 test "${ac_cv_path_ZIP+set}" = set; then :
+if ${ac_cv_path_ZIP+:} false; then :
$as_echo_n "(cached) " >&6
else
case $ZIP in
@@ -9750,7 +9828,7 @@
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 test "${ac_cv_path_LDD+set}" = set; then :
+if ${ac_cv_path_LDD+:} false; then :
$as_echo_n "(cached) " >&6
else
case $LDD in
@@ -9796,7 +9874,7 @@
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 test "${ac_cv_path_OTOOL+set}" = set; then :
+if ${ac_cv_path_OTOOL+:} false; then :
$as_echo_n "(cached) " >&6
else
case $OTOOL in
@@ -9841,7 +9919,7 @@
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 test "${ac_cv_path_READELF+set}" = set; then :
+if ${ac_cv_path_READELF+:} false; then :
$as_echo_n "(cached) " >&6
else
case $READELF in
@@ -9884,7 +9962,7 @@
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 test "${ac_cv_path_HG+set}" = set; then :
+if ${ac_cv_path_HG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $HG in
@@ -9924,7 +10002,7 @@
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 test "${ac_cv_path_STAT+set}" = set; then :
+if ${ac_cv_path_STAT+:} false; then :
$as_echo_n "(cached) " >&6
else
case $STAT in
@@ -9964,7 +10042,7 @@
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 test "${ac_cv_path_TIME+set}" = set; then :
+if ${ac_cv_path_TIME+:} false; then :
$as_echo_n "(cached) " >&6
else
case $TIME in
@@ -10009,7 +10087,7 @@
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 test "${ac_cv_path_COMM+set}" = set; then :
+if ${ac_cv_path_COMM+:} false; then :
$as_echo_n "(cached) " >&6
else
case $COMM in
@@ -10073,7 +10151,7 @@
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 test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PKG_CONFIG in
@@ -10116,7 +10194,7 @@
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 test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $ac_pt_PKG_CONFIG in
@@ -10289,7 +10367,7 @@
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 test "${ac_cv_prog_BDEPS_UNZIP+set}" = set; then :
+if ${ac_cv_prog_BDEPS_UNZIP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$BDEPS_UNZIP"; then
@@ -10335,7 +10413,7 @@
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 test "${ac_cv_prog_BDEPS_FTP+set}" = set; then :
+if ${ac_cv_prog_BDEPS_FTP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$BDEPS_FTP"; then
@@ -11624,7 +11702,7 @@
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 test "${ac_cv_path_JAVAC_CHECK+set}" = set; then :
+if ${ac_cv_path_JAVAC_CHECK+:} false; then :
$as_echo_n "(cached) " >&6
else
case $JAVAC_CHECK in
@@ -11664,7 +11742,7 @@
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 test "${ac_cv_path_JAVA_CHECK+set}" = set; then :
+if ${ac_cv_path_JAVA_CHECK+:} false; then :
$as_echo_n "(cached) " >&6
else
case $JAVA_CHECK in
@@ -15723,7 +15801,7 @@
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 test "${ac_cv_path_CYGWIN_LINK+set}" = set; then :
+if ${ac_cv_path_CYGWIN_LINK+:} false; then :
$as_echo_n "(cached) " >&6
else
case $CYGWIN_LINK in
@@ -16373,14 +16451,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving VS_ENV_CMD (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving VS_ENV_CMD (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving VS_ENV_CMD (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving VS_ENV_CMD (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -16390,21 +16480,20 @@
fi
as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- VS_ENV_CMD="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting VS_ENV_CMD to \"$new_complete\"" >&5
+ VS_ENV_CMD="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting VS_ENV_CMD to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting VS_ENV_CMD to \"$new_complete\"" >&6;}
- fi
+ fi
# Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat
@@ -16701,7 +16790,7 @@
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 test "${ac_cv_path_BUILD_CC+set}" = set; then :
+if ${ac_cv_path_BUILD_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
case $BUILD_CC in
@@ -16962,14 +17051,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_CC (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving BUILD_CC (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_CC (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving BUILD_CC (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -16979,21 +17080,20 @@
fi
as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- BUILD_CC="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CC to \"$new_complete\"" >&5
+ BUILD_CC="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CC to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting BUILD_CC to \"$new_complete\"" >&6;}
- fi
+ fi
for ac_prog in cl CC g++
do
@@ -17001,7 +17101,7 @@
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 test "${ac_cv_path_BUILD_CXX+set}" = set; then :
+if ${ac_cv_path_BUILD_CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
case $BUILD_CXX in
@@ -17262,14 +17362,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_CXX (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving BUILD_CXX (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_CXX (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving BUILD_CXX (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -17279,27 +17391,26 @@
fi
as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- BUILD_CXX="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CXX to \"$new_complete\"" >&5
+ BUILD_CXX="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CXX to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting BUILD_CXX to \"$new_complete\"" >&6;}
- fi
+ fi
# Extract the first word of "ld", so it can be a program name with args.
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 test "${ac_cv_path_BUILD_LD+set}" = set; then :
+if ${ac_cv_path_BUILD_LD+:} false; then :
$as_echo_n "(cached) " >&6
else
case $BUILD_LD in
@@ -17557,14 +17668,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_LD (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving BUILD_LD (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_LD (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving BUILD_LD (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -17574,21 +17697,20 @@
fi
as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- BUILD_LD="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_LD to \"$new_complete\"" >&5
+ BUILD_LD="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_LD to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting BUILD_LD to \"$new_complete\"" >&6;}
- fi
+ fi
fi
@@ -17800,7 +17922,7 @@
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 test "${ac_cv_path_TOOLS_DIR_CC+set}" = set; then :
+if ${ac_cv_path_TOOLS_DIR_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
case $TOOLS_DIR_CC in
@@ -17852,7 +17974,7 @@
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 test "${ac_cv_path_POTENTIAL_CC+set}" = set; then :
+if ${ac_cv_path_POTENTIAL_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
case $POTENTIAL_CC in
@@ -18144,14 +18266,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CC (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving CC (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CC (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving CC (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -18161,21 +18295,20 @@
fi
as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- CC="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CC to \"$new_complete\"" >&5
+ CC="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CC to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting CC to \"$new_complete\"" >&6;}
- fi
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking resolved symbolic links for CC" >&5
$as_echo_n "checking resolved symbolic links for CC... " >&6; }
@@ -18254,7 +18387,7 @@
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 test "${ac_cv_prog_PROPER_COMPILER_CC+set}" = set; then :
+if ${ac_cv_prog_PROPER_COMPILER_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$PROPER_COMPILER_CC"; then
@@ -18298,7 +18431,7 @@
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 test "${ac_cv_prog_ac_ct_PROPER_COMPILER_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_PROPER_COMPILER_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_PROPER_COMPILER_CC"; then
@@ -18569,14 +18702,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving PROPER_COMPILER_CC (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving PROPER_COMPILER_CC (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving PROPER_COMPILER_CC (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving PROPER_COMPILER_CC (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -18586,21 +18731,20 @@
fi
as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- PROPER_COMPILER_CC="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&5
+ PROPER_COMPILER_CC="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&6;}
- fi
+ fi
PATH="$RETRY_COMPILER_SAVED_PATH"
@@ -18737,7 +18881,7 @@
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 test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
@@ -18781,7 +18925,7 @@
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 test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
@@ -18834,7 +18978,7 @@
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
@@ -18949,7 +19093,7 @@
{ { $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; }
@@ -18992,7 +19136,7 @@
{ { $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
@@ -19051,7 +19195,7 @@
$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
@@ -19062,7 +19206,7 @@
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 test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -19103,7 +19247,7 @@
{ { $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
@@ -19113,7 +19257,7 @@
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 test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -19150,7 +19294,7 @@
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 test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_c_werror_flag=$ac_c_werror_flag
@@ -19228,7 +19372,7 @@
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 test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
@@ -19347,7 +19491,7 @@
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 test "${ac_cv_path_TOOLS_DIR_CXX+set}" = set; then :
+if ${ac_cv_path_TOOLS_DIR_CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
case $TOOLS_DIR_CXX in
@@ -19399,7 +19543,7 @@
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 test "${ac_cv_path_POTENTIAL_CXX+set}" = set; then :
+if ${ac_cv_path_POTENTIAL_CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
case $POTENTIAL_CXX in
@@ -19691,14 +19835,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CXX (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving CXX (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CXX (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving CXX (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -19708,21 +19864,20 @@
fi
as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- CXX="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXX to \"$new_complete\"" >&5
+ CXX="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXX to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting CXX to \"$new_complete\"" >&6;}
- fi
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking resolved symbolic links for CXX" >&5
$as_echo_n "checking resolved symbolic links for CXX... " >&6; }
@@ -19801,7 +19956,7 @@
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 test "${ac_cv_prog_PROPER_COMPILER_CXX+set}" = set; then :
+if ${ac_cv_prog_PROPER_COMPILER_CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$PROPER_COMPILER_CXX"; then
@@ -19845,7 +20000,7 @@
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 test "${ac_cv_prog_ac_ct_PROPER_COMPILER_CXX+set}" = set; then :
+if ${ac_cv_prog_ac_ct_PROPER_COMPILER_CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_PROPER_COMPILER_CXX"; then
@@ -20116,14 +20271,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving PROPER_COMPILER_CXX (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving PROPER_COMPILER_CXX (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving PROPER_COMPILER_CXX (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving PROPER_COMPILER_CXX (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -20133,21 +20300,20 @@
fi
as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- PROPER_COMPILER_CXX="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&5
+ PROPER_COMPILER_CXX="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&6;}
- fi
+ fi
PATH="$RETRY_COMPILER_SAVED_PATH"
@@ -20288,7 +20454,7 @@
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 test "${ac_cv_prog_CXX+set}" = set; then :
+if ${ac_cv_prog_CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CXX"; then
@@ -20332,7 +20498,7 @@
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 test "${ac_cv_prog_ac_ct_CXX+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CXX"; then
@@ -20410,7 +20576,7 @@
{ $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 test "${ac_cv_cxx_compiler_gnu+set}" = set; then :
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -20447,7 +20613,7 @@
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 test "${ac_cv_prog_cxx_g+set}" = set; then :
+if ${ac_cv_prog_cxx_g+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
@@ -20545,7 +20711,7 @@
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 test "${ac_cv_prog_OBJC+set}" = set; then :
+if ${ac_cv_prog_OBJC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$OBJC"; then
@@ -20589,7 +20755,7 @@
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 test "${ac_cv_prog_ac_ct_OBJC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OBJC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OBJC"; then
@@ -20665,7 +20831,7 @@
{ $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 test "${ac_cv_objc_compiler_gnu+set}" = set; then :
+if ${ac_cv_objc_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -20702,7 +20868,7 @@
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 test "${ac_cv_prog_objc_g+set}" = set; then :
+if ${ac_cv_prog_objc_g+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_objc_werror_flag=$ac_objc_werror_flag
@@ -21006,14 +21172,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJC (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving OBJC (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJC (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving OBJC (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJC, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of OBJC, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -21023,21 +21201,20 @@
fi
as_fn_error $? "Cannot locate the the path of OBJC" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- OBJC="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJC to \"$new_complete\"" >&5
+ OBJC="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJC to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting OBJC to \"$new_complete\"" >&6;}
- fi
+ fi
else
OBJC=
@@ -21067,7 +21244,7 @@
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 test "${ac_cv_prog_AR+set}" = set; then :
+if ${ac_cv_prog_AR+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$AR"; then
@@ -21107,7 +21284,7 @@
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 test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_AR"; then
@@ -21376,14 +21553,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving AR (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving AR (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving AR (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving AR (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -21393,21 +21582,20 @@
fi
as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- AR="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AR to \"$new_complete\"" >&5
+ AR="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AR to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting AR to \"$new_complete\"" >&6;}
- fi
+ fi
fi
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
@@ -21438,7 +21626,7 @@
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 test "${ac_cv_prog_WINLD+set}" = set; then :
+if ${ac_cv_prog_WINLD+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$WINLD"; then
@@ -21712,14 +21900,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving WINLD (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving WINLD (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving WINLD (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving WINLD (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of WINLD, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -21729,21 +21929,20 @@
fi
as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- WINLD="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting WINLD to \"$new_complete\"" >&5
+ WINLD="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting WINLD to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting WINLD to \"$new_complete\"" >&6;}
- fi
+ fi
printf "Windows linker was found at $WINLD\n"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the found link.exe is actually the Visual Studio linker" >&5
@@ -21766,7 +21965,7 @@
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 test "${ac_cv_prog_MT+set}" = set; then :
+if ${ac_cv_prog_MT+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$MT"; then
@@ -22038,14 +22237,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving MT (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving MT (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving MT (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving MT (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of MT, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -22055,28 +22266,27 @@
fi
as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- MT="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MT to \"$new_complete\"" >&5
+ MT="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MT to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting MT to \"$new_complete\"" >&6;}
- fi
+ fi
# The resource compiler
# Extract the first word of "rc", so it can be a program name with args.
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 test "${ac_cv_prog_RC+set}" = set; then :
+if ${ac_cv_prog_RC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$RC"; then
@@ -22348,14 +22558,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving RC (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving RC (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving RC (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving RC (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of RC, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -22365,21 +22587,20 @@
fi
as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- RC="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting RC to \"$new_complete\"" >&5
+ RC="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting RC to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting RC to \"$new_complete\"" >&6;}
- fi
+ fi
# For hotspot, we need these in Windows mixed path,
@@ -22456,7 +22677,7 @@
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 test "${ac_cv_prog_WINAR+set}" = set; then :
+if ${ac_cv_prog_WINAR+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$WINAR"; then
@@ -22711,14 +22932,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving WINAR (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving WINAR (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving WINAR (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving WINAR (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of WINAR, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -22728,21 +22961,20 @@
fi
as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- WINAR="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting WINAR to \"$new_complete\"" >&5
+ WINAR="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting WINAR to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting WINAR to \"$new_complete\"" >&6;}
- fi
+ fi
AR="$WINAR"
ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT"
@@ -22751,7 +22983,7 @@
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 test "${ac_cv_prog_DUMPBIN+set}" = set; then :
+if ${ac_cv_prog_DUMPBIN+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$DUMPBIN"; then
@@ -23006,14 +23238,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving DUMPBIN (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving DUMPBIN (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving DUMPBIN (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving DUMPBIN (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -23023,21 +23267,20 @@
fi
as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- DUMPBIN="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DUMPBIN to \"$new_complete\"" >&5
+ DUMPBIN="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DUMPBIN to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting DUMPBIN to \"$new_complete\"" >&6;}
- fi
+ fi
COMPILER_TYPE=CL
@@ -23059,7 +23302,7 @@
CPP=
fi
if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then :
+ if ${ac_cv_prog_CPP+:} false; then :
$as_echo_n "(cached) " >&6
else
# Double quotes because CPP needs to be expanded
@@ -23175,7 +23418,7 @@
{ { $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
@@ -23406,14 +23649,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CPP (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving CPP (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CPP (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving CPP (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -23423,21 +23678,20 @@
fi
as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- CPP="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CPP to \"$new_complete\"" >&5
+ CPP="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CPP to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting CPP to \"$new_complete\"" >&6;}
- fi
+ fi
ac_ext=cpp
@@ -23448,7 +23702,7 @@
{ $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 test "${ac_cv_prog_CXXCPP+set}" = set; then :
+ if ${ac_cv_prog_CXXCPP+:} false; then :
$as_echo_n "(cached) " >&6
else
# Double quotes because CXXCPP needs to be expanded
@@ -23564,7 +23818,7 @@
{ { $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
@@ -23795,14 +24049,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CXXCPP (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving CXXCPP (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CXXCPP (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving CXXCPP (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -23812,21 +24078,20 @@
fi
as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- CXXCPP="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXXCPP to \"$new_complete\"" >&5
+ CXXCPP="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXXCPP to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting CXXCPP to \"$new_complete\"" >&6;}
- fi
+ fi
if test "x$COMPILE_TYPE" != "xcross"; then
@@ -23855,7 +24120,7 @@
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 test "${ac_cv_path_AS+set}" = set; then :
+if ${ac_cv_path_AS+:} false; then :
$as_echo_n "(cached) " >&6
else
case $AS in
@@ -24113,14 +24378,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving AS (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving AS (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving AS (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving AS (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -24130,21 +24407,20 @@
fi
as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- AS="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AS to \"$new_complete\"" >&5
+ AS="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AS to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting AS to \"$new_complete\"" >&6;}
- fi
+ fi
else
AS="$CC -c"
@@ -24158,7 +24434,7 @@
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 test "${ac_cv_path_NM+set}" = set; then :
+if ${ac_cv_path_NM+:} false; then :
$as_echo_n "(cached) " >&6
else
case $NM in
@@ -24419,14 +24695,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving NM (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving NM (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving NM (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving NM (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -24436,27 +24724,26 @@
fi
as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- NM="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5
+ NM="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;}
- fi
+ fi
# Extract the first word of "strip", so it can be a program name with args.
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 test "${ac_cv_path_STRIP+set}" = set; then :
+if ${ac_cv_path_STRIP+:} false; then :
$as_echo_n "(cached) " >&6
else
case $STRIP in
@@ -24714,14 +25001,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving STRIP (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving STRIP (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -24731,27 +25030,26 @@
fi
as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- STRIP="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5
+ STRIP="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;}
- fi
+ fi
# Extract the first word of "mcs", so it can be a program name with args.
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 test "${ac_cv_path_MCS+set}" = set; then :
+if ${ac_cv_path_MCS+:} false; then :
$as_echo_n "(cached) " >&6
else
case $MCS in
@@ -25009,14 +25307,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving MCS (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving MCS (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving MCS (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving MCS (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -25026,21 +25336,20 @@
fi
as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- MCS="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MCS to \"$new_complete\"" >&5
+ MCS="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MCS to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting MCS to \"$new_complete\"" >&6;}
- fi
+ fi
elif test "x$OPENJDK_TARGET_OS" != xwindows; then
if test -n "$ac_tool_prefix"; then
@@ -25048,7 +25357,7 @@
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 test "${ac_cv_prog_NM+set}" = set; then :
+if ${ac_cv_prog_NM+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$NM"; then
@@ -25088,7 +25397,7 @@
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 test "${ac_cv_prog_ac_ct_NM+set}" = set; then :
+if ${ac_cv_prog_ac_ct_NM+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_NM"; then
@@ -25357,14 +25666,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving NM (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving NM (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving NM (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving NM (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -25374,28 +25695,27 @@
fi
as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- NM="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5
+ NM="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;}
- fi
+ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
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 test "${ac_cv_prog_STRIP+set}" = set; then :
+if ${ac_cv_prog_STRIP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$STRIP"; then
@@ -25435,7 +25755,7 @@
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 test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_STRIP"; then
@@ -25704,14 +26024,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving STRIP (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving STRIP (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -25721,21 +26053,20 @@
fi
as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- STRIP="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5
+ STRIP="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;}
- fi
+ fi
fi
@@ -25749,7 +26080,7 @@
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 test "${ac_cv_prog_OBJCOPY+set}" = set; then :
+if ${ac_cv_prog_OBJCOPY+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$OBJCOPY"; then
@@ -25793,7 +26124,7 @@
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 test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OBJCOPY+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OBJCOPY"; then
@@ -26066,14 +26397,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJCOPY (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving OBJCOPY (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJCOPY (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving OBJCOPY (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -26083,21 +26426,20 @@
fi
as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- OBJCOPY="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJCOPY to \"$new_complete\"" >&5
+ OBJCOPY="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJCOPY to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting OBJCOPY to \"$new_complete\"" >&6;}
- fi
+ fi
fi
fi
@@ -26109,7 +26451,7 @@
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 test "${ac_cv_prog_OBJDUMP+set}" = set; then :
+if ${ac_cv_prog_OBJDUMP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$OBJDUMP"; then
@@ -26153,7 +26495,7 @@
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 test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OBJDUMP"; then
@@ -26426,14 +26768,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJDUMP (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving OBJDUMP (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJDUMP (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving OBJDUMP (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -26443,21 +26797,20 @@
fi
as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- OBJDUMP="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJDUMP to \"$new_complete\"" >&5
+ OBJDUMP="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJDUMP to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting OBJDUMP to \"$new_complete\"" >&6;}
- fi
+ fi
fi
@@ -26466,7 +26819,7 @@
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 test "${ac_cv_path_LIPO+set}" = set; then :
+if ${ac_cv_path_LIPO+:} false; then :
$as_echo_n "(cached) " >&6
else
case $LIPO in
@@ -26724,14 +27077,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving LIPO (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving LIPO (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving LIPO (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving LIPO (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -26741,21 +27106,20 @@
fi
as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- LIPO="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LIPO to \"$new_complete\"" >&5
+ LIPO="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LIPO to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting LIPO to \"$new_complete\"" >&6;}
- fi
+ fi
fi
@@ -26770,7 +27134,7 @@
{ $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 test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -26946,7 +27310,7 @@
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" = x""yes; then :
+if test "x$ac_cv_header_stdio_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STDIO_H 1
_ACEOF
@@ -26975,7 +27339,7 @@
# 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 test "${ac_cv_sizeof_int_p+set}" = set; then :
+if ${ac_cv_sizeof_int_p+:} false; 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 :
@@ -26985,7 +27349,7 @@
{ { $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
@@ -27032,7 +27396,7 @@
#
{ $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 test "${ac_cv_c_bigendian+set}" = set; then :
+if ${ac_cv_c_bigendian+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_c_bigendian=unknown
@@ -27764,11 +28128,14 @@
# On some platforms (mac) the linker warns about non existing -L dirs.
# Add server first if available. Linking aginst client does not always produce the same results.
- # Only add client dir if client is being built. Default to server for other variants.
+ # Only add client dir if client is being built. Add minimal (note not minimal1) if only building minimal1.
+ # Default to server for other variants.
if test "x$JVM_VARIANT_SERVER" = xtrue; then
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
elif test "x$JVM_VARIANT_CLIENT" = xtrue; then
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client"
+ elif test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
else
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
fi
@@ -28029,8 +28396,8 @@
have_x=disabled
else
case $x_includes,$x_libraries in #(
- *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5 ;; #(
- *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then :
+ *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
+ *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
$as_echo_n "(cached) " >&6
else
# One or both of the vars are not set, and there is no cached value.
@@ -28307,7 +28674,7 @@
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 test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then :
+if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -28341,14 +28708,14 @@
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" = x""yes; then :
+if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; 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 test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then :
+if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -28382,7 +28749,7 @@
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" = x""yes; then :
+if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
fi
@@ -28401,14 +28768,14 @@
# 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" = x""yes; then :
+if test "x$ac_cv_func_gethostbyname" = xyes; 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 test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then :
+if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -28442,14 +28809,14 @@
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" = x""yes; then :
+if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; 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 test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then :
+if ${ac_cv_lib_bsd_gethostbyname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -28483,7 +28850,7 @@
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" = x""yes; then :
+if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
fi
@@ -28498,14 +28865,14 @@
# 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" = x""yes; then :
+if test "x$ac_cv_func_connect" = xyes; 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 test "${ac_cv_lib_socket_connect+set}" = set; then :
+if ${ac_cv_lib_socket_connect+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -28539,7 +28906,7 @@
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" = x""yes; then :
+if test "x$ac_cv_lib_socket_connect" = xyes; then :
X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
fi
@@ -28547,14 +28914,14 @@
# 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" = x""yes; then :
+if test "x$ac_cv_func_remove" = xyes; 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 test "${ac_cv_lib_posix_remove+set}" = set; then :
+if ${ac_cv_lib_posix_remove+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -28588,7 +28955,7 @@
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" = x""yes; then :
+if test "x$ac_cv_lib_posix_remove" = xyes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
fi
@@ -28596,14 +28963,14 @@
# 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" = x""yes; then :
+if test "x$ac_cv_func_shmat" = xyes; 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 test "${ac_cv_lib_ipc_shmat+set}" = set; then :
+if ${ac_cv_lib_ipc_shmat+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -28637,7 +29004,7 @@
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" = x""yes; then :
+if test "x$ac_cv_lib_ipc_shmat" = xyes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
fi
@@ -28655,7 +29022,7 @@
# 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 test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then :
+if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -28689,7 +29056,7 @@
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" = x""yes; then :
+if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then :
X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
fi
@@ -29696,7 +30063,7 @@
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 test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then :
+if ${ac_cv_lib_freetype_FT_Init_FreeType+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -29730,7 +30097,7 @@
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" = x""yes; then :
+if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = xyes; then :
FREETYPE2_FOUND=true
else
as_fn_error $? "Could not find freetype2! $HELP_MSG " "$LINENO" 5
@@ -30018,7 +30385,7 @@
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" = x""yes; then :
+if test "x$ac_cv_header_alsa_asoundlib_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_ALSA_ASOUNDLIB_H 1
_ACEOF
@@ -30077,7 +30444,7 @@
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 test "${ac_cv_lib_jpeg_main+set}" = set; then :
+if ${ac_cv_lib_jpeg_main+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -30105,7 +30472,7 @@
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" = x""yes; then :
+if test "x$ac_cv_lib_jpeg_main" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBJPEG 1
_ACEOF
@@ -30129,7 +30496,7 @@
USE_EXTERNAL_LIBJPEG=true
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgif" >&5
$as_echo_n "checking for main in -lgif... " >&6; }
-if test "${ac_cv_lib_gif_main+set}" = set; then :
+if ${ac_cv_lib_gif_main+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -30157,7 +30524,7 @@
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_main" >&5
$as_echo "$ac_cv_lib_gif_main" >&6; }
-if test "x$ac_cv_lib_gif_main" = x""yes; then :
+if test "x$ac_cv_lib_gif_main" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGIF 1
_ACEOF
@@ -30187,7 +30554,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5
$as_echo_n "checking for compress in -lz... " >&6; }
-if test "${ac_cv_lib_z_compress+set}" = set; then :
+if ${ac_cv_lib_z_compress+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -30221,7 +30588,7 @@
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" = x""yes; then :
+if test "x$ac_cv_lib_z_compress" = xyes; then :
ZLIB_FOUND=yes
else
ZLIB_FOUND=no
@@ -30314,7 +30681,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5
$as_echo_n "checking for cos in -lm... " >&6; }
-if test "${ac_cv_lib_m_cos+set}" = set; then :
+if ${ac_cv_lib_m_cos+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -30348,7 +30715,7 @@
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" = x""yes; then :
+if test "x$ac_cv_lib_m_cos" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBM 1
_ACEOF
@@ -30372,7 +30739,7 @@
LIBS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+if ${ac_cv_lib_dl_dlopen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -30406,7 +30773,7 @@
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" = x""yes; then :
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBDL 1
_ACEOF
@@ -31050,7 +31417,7 @@
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 test "${ac_cv_path_CCACHE+set}" = set; then :
+if ${ac_cv_path_CCACHE+:} false; then :
$as_echo_n "(cached) " >&6
else
case $CCACHE in
@@ -31301,10 +31668,21 @@
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
- test "x$cache_file" != "x/dev/null" &&
+ if test "x$cache_file" != "x/dev/null"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
$as_echo "$as_me: updating cache $cache_file" >&6;}
- cat confcache >$cache_file
+ 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
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;}
@@ -31336,7 +31714,7 @@
-: ${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"
@@ -31437,6 +31815,7 @@
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
@@ -31744,7 +32123,7 @@
# values after options handling.
ac_log="
This file was extended by OpenJDK $as_me jdk8, which was
-generated by GNU Autoconf 2.67. Invocation command line was
+generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -31807,7 +32186,7 @@
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.67,
+configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -31936,7 +32315,7 @@
"$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
@@ -31958,9 +32337,10 @@
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
- tmp=
+ tmp= ac_tmp=
trap 'exit_status=$?
- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
trap 'as_fn_exit 1' 1 2 13 15
}
@@ -31968,12 +32348,13 @@
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$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.
@@ -31995,7 +32376,7 @@
ac_cs_awk_cr=$ac_cr
fi
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
@@ -32023,7 +32404,7 @@
rm -f conf$$subs.sh
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
@@ -32071,7 +32452,7 @@
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = ""
@@ -32103,7 +32484,7 @@
sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
|| as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
@@ -32137,7 +32518,7 @@
# 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 >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
BEGIN {
_ACEOF
@@ -32149,8 +32530,8 @@
# handling of long lines.
ac_delim='%!_!# '
for ac_last_try in false false :; do
- ac_t=`sed -n "/$ac_delim/p" confdefs.h`
- if test -z "$ac_t"; then
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
@@ -32251,7 +32632,7 @@
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
@@ -32270,7 +32651,7 @@
for ac_f
do
case $ac_f in
- -) ac_f="$tmp/stdin";;
+ -) ac_f="$ac_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 `:'.
@@ -32279,7 +32660,7 @@
[\\/$]*) 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'"
@@ -32305,8 +32686,8 @@
esac
case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
@@ -32431,21 +32812,22 @@
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
$ac_datarootdir_hack
"
-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
+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
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { 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"; } &&
{ $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 "$tmp/stdin"
+ rm -f "$ac_tmp/stdin"
case $ac_file in
- -) cat "$tmp/out" && rm -f "$tmp/out";;
- *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
esac \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
@@ -32456,20 +32838,20 @@
if test x"$ac_file" != x-; then
{
$as_echo "/* $configure_input */" \
- && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
- } >"$tmp/config.h" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
- if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+ if diff "$ac_file" "$ac_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 "$tmp/config.h" "$ac_file" \
+ mv "$ac_tmp/config.h" "$ac_file" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
fi
else
$as_echo "/* $configure_input */" \
- && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
|| as_fn_error $? "could not create -" "$LINENO" 5
fi
;;
--- a/common/autoconf/jdk-options.m4 Sat Dec 29 11:00:15 2012 +0000
+++ b/common/autoconf/jdk-options.m4 Tue Jan 01 17:49:22 2013 -0800
@@ -60,28 +60,30 @@
# Currently we have:
# server: normal interpreter and a tiered C1/C2 compiler
# client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms)
+# minimal1: reduced form of client with optional VM services and features stripped out
# kernel: kernel footprint JVM that passes the TCK without major performance problems,
# ie normal interpreter and C1, only the serial GC, kernel jvmti etc
# zero: no machine code interpreter, no compiler
# zeroshark: zero interpreter and shark/llvm compiler backend
AC_MSG_CHECKING([which variants of the JVM to build])
AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
- [JVM variants (separated by commas) to build (server, client, kernel, zero, zeroshark) @<:@server@:>@])])
+ [JVM variants (separated by commas) to build (server, client, minimal1, kernel, zero, zeroshark) @<:@server@:>@])])
if test "x$with_jvm_variants" = x; then
with_jvm_variants="server"
fi
JVM_VARIANTS=",$with_jvm_variants,"
-TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'`
+TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/minimal1,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'`
if test "x$TEST_VARIANTS" != "x,"; then
- AC_MSG_ERROR([The available JVM variants are: server, client, kernel, zero, zeroshark])
+ AC_MSG_ERROR([The available JVM variants are: server, client, minimal1, kernel, zero, zeroshark])
fi
AC_MSG_RESULT([$with_jvm_variants])
JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
+JVM_VARIANT_MINIMAL1=`$ECHO "$JVM_VARIANTS" | $SED -e '/,minimal1,/!s/.*/false/g' -e '/,minimal1,/s/.*/true/g'`
JVM_VARIANT_KERNEL=`$ECHO "$JVM_VARIANTS" | $SED -e '/,kernel,/!s/.*/false/g' -e '/,kernel,/s/.*/true/g'`
JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
@@ -96,10 +98,15 @@
AC_MSG_ERROR([You cannot build a kernel JVM for a 64-bit machine.])
fi
fi
+if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
+ if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+ AC_MSG_ERROR([You cannot build a minimal JVM for a 64-bit machine.])
+ fi
+fi
# Replace the commas with AND for use in the build directory name.
ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/'`
-COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/'`
+COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/minimal1,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/'`
if test "x$COUNT_VARIANTS" != "x,1"; then
BUILDING_MULTIPLE_JVM_VARIANTS=yes
else
@@ -109,6 +116,7 @@
AC_SUBST(JVM_VARIANTS)
AC_SUBST(JVM_VARIANT_SERVER)
AC_SUBST(JVM_VARIANT_CLIENT)
+AC_SUBST(JVM_VARIANT_MINIMAL1)
AC_SUBST(JVM_VARIANT_KERNEL)
AC_SUBST(JVM_VARIANT_ZERO)
AC_SUBST(JVM_VARIANT_ZEROSHARK)
@@ -191,7 +199,9 @@
#####
# Generate the legacy makefile targets for hotspot.
# The hotspot api for selecting the build artifacts, really, needs to be improved.
-#
+# JDK-7195896 will fix this on the hotspot side by using the JVM_VARIANT_* variables to
+# determine what needs to be built. All we will need to set here is all_product, all_fastdebug etc
+# But until then ...
HOTSPOT_TARGET=""
if test "x$JVM_VARIANT_SERVER" = xtrue; then
@@ -202,6 +212,10 @@
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
fi
+if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
+ HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
+fi
+
if test "x$JVM_VARIANT_KERNEL" = xtrue; then
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel "
fi
--- a/common/autoconf/spec.gmk.in Sat Dec 29 11:00:15 2012 +0000
+++ b/common/autoconf/spec.gmk.in Tue Jan 01 17:49:22 2013 -0800
@@ -185,11 +185,12 @@
# These are the libjvms that we want to build.
# The java launcher uses the default.
-# The other can be selected by specifying -client -server -kernel -zero or -zeroshark
+# The others can be selected by specifying -client -server -minimal1 -kernel -zero or -zeroshark
# on the java launcher command line.
JVM_VARIANTS:=@JVM_VARIANTS@
JVM_VARIANT_SERVER:=@JVM_VARIANT_SERVER@
JVM_VARIANT_CLIENT:=@JVM_VARIANT_CLIENT@
+JVM_VARIANT_MINIMAL1:=@JVM_VARIANT_MINIMAL1@
JVM_VARIANT_KERNEL:=@JVM_VARIANT_KERNEL@
JVM_VARIANT_ZERO:=@JVM_VARIANT_ZERO@
JVM_VARIANT_ZEROSHARK:=@JVM_VARIANT_ZEROSHARK@
--- a/common/autoconf/toolchain.m4 Sat Dec 29 11:00:15 2012 +0000
+++ b/common/autoconf/toolchain.m4 Tue Jan 01 17:49:22 2013 -0800
@@ -954,11 +954,14 @@
# On some platforms (mac) the linker warns about non existing -L dirs.
# Add server first if available. Linking aginst client does not always produce the same results.
- # Only add client dir if client is being built. Default to server for other variants.
+ # Only add client dir if client is being built. Add minimal (note not minimal1) if only building minimal1.
+ # Default to server for other variants.
if test "x$JVM_VARIANT_SERVER" = xtrue; then
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
elif test "x$JVM_VARIANT_CLIENT" = xtrue; then
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client"
+ elif test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
+ LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
else
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
fi
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/bin/hgforest.sh Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,194 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2009, 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.
+#
+
+# Shell script for a fast parallel forest command
+command="$1"
+pull_extra_base="$2"
+
+# Python always buffers stdout significantly, thus we will not see any output from hg clone jdk,
+# until a lot of time has passed! By passing -u to python, we get incremental updates
+# on stdout. Much nicer.
+whichhg="`which hg`"
+
+if [ "${whichhg}" = "" ] ; then
+ echo Cannot find hg!
+ exit 1
+fi
+
+if [ "" = "$command" ] ; then
+ echo No command to hg supplied!
+ exit 1
+fi
+
+has_hash_bang="`head -n 1 "${whichhg}" | cut -b 1-2`"
+python=""
+bpython=""
+
+if [ "#!" = "$has_hash_bang" ] ; then
+ python="`head -n 1 ${whichhg} | cut -b 3-`"
+ bpython="`basename "$python"`"
+fi
+
+if [ "python" = "$bpython" -a -x "$python" ] ; then
+ hg="${python} -u ${whichhg}"
+else
+ echo Cannot find python from hg launcher. Running plain hg, which probably has buffered stdout.
+ hg="hg"
+fi
+
+# Clean out the temporary directory that stores the pid files.
+tmp=/tmp/forest.$$
+rm -f -r ${tmp}
+mkdir -p ${tmp}
+
+safe_interrupt () {
+ if [ -d ${tmp} ]; then
+ if [ "`ls ${tmp}`" != "" ]; then
+ echo "Waiting for processes ( `cat ${tmp}/* | tr '\n' ' '`) to terminate nicely!"
+ sleep 1
+ # Pipe stderr to dev/null to silence kill, that complains when trying to kill
+ # a subprocess that has already exited.
+ kill -TERM `cat ${tmp}/* | tr '\n' ' '` 2> /dev/null
+ wait
+ echo Interrupt complete!
+ fi
+ fi
+ rm -f -r ${tmp}
+ exit 1
+}
+
+nice_exit () {
+ if [ -d ${tmp} ]; then
+ if [ "`ls ${tmp}`" != "" ]; then
+ wait
+ fi
+ fi
+ rm -f -r ${tmp}
+}
+
+trap 'safe_interrupt' INT QUIT
+trap 'nice_exit' EXIT
+
+# Only look in specific locations for possible forests (avoids long searches)
+pull_default=""
+repos=""
+repos_extra=""
+if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
+ subrepos="corba jaxp jaxws langtools jdk hotspot"
+ if [ -f .hg/hgrc ] ; then
+ pull_default=`hg paths default`
+ if [ "${pull_default}" = "" ] ; then
+ echo "ERROR: Need initial clone with 'hg paths default' defined"
+ exit 1
+ fi
+ fi
+ if [ "${pull_default}" = "" ] ; then
+ echo "ERROR: Need initial repository to use this script"
+ exit 1
+ fi
+ for i in ${subrepos} ; do
+ if [ ! -f ${i}/.hg/hgrc ] ; then
+ repos="${repos} ${i}"
+ fi
+ done
+ if [ "${pull_extra_base}" != "" ] ; then
+ subrepos_extra="jdk/src/closed jdk/make/closed jdk/test/closed hotspot/make/closed hotspot/src/closed hotspot/test/closed deploy install sponsors pubs"
+ pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'`
+ pull_extra="${pull_extra_base}/${pull_default_tail}"
+ for i in ${subrepos_extra} ; do
+ if [ ! -f ${i}/.hg/hgrc ] ; then
+ repos_extra="${repos_extra} ${i}"
+ fi
+ done
+ fi
+ at_a_time=2
+ # Any repos to deal with?
+ if [ "${repos}" = "" -a "${repos_extra}" = "" ] ; then
+ exit
+ fi
+else
+ hgdirs=`ls -d ./.hg ./*/.hg ./*/*/.hg ./*/*/*/.hg ./*/*/*/*/.hg 2>/dev/null`
+ # Derive repository names from the .hg directory locations
+ for i in ${hgdirs} ; do
+ repos="${repos} `echo ${i} | sed -e 's@/.hg$@@'`"
+ done
+ for i in ${repos} ; do
+ if [ -h ${i}/.hg/store/lock -o -f ${i}/.hg/store/lock ] ; then
+ locked="${i} ${locked}"
+ fi
+ done
+ at_a_time=8
+ # Any repos to deal with?
+ if [ "${repos}" = "" ] ; then
+ echo "No repositories to process."
+ exit
+ fi
+ if [ "${locked}" != "" ] ; then
+ echo "These repositories are locked: ${locked}"
+ exit
+ fi
+fi
+
+# Echo out what repositories we do a command on.
+echo "# Repositories: ${repos} ${repos_extra}"
+echo
+
+# Run the supplied command on all repos in parallel.
+n=0
+for i in ${repos} ${repos_extra} ; do
+ n=`expr ${n} '+' 1`
+ repopidfile=`echo ${i} | sed -e 's@./@@' -e 's@/@_@g'`
+ reponame=`echo ${i} | sed -e :a -e 's/^.\{1,20\}$/ &/;ta'`
+ pull_base="${pull_default}"
+ for j in $repos_extra ; do
+ if [ "$i" = "$j" ] ; then
+ pull_base="${pull_extra}"
+ fi
+ done
+ (
+ (
+ if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
+ pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`"
+ echo ${hg} clone ${pull_newrepo} ${i}
+ ${hg} clone ${pull_newrepo} ${i} &
+ else
+ echo "cd ${i} && ${hg} $*"
+ cd ${i} && ${hg} "$@" &
+ fi
+ echo $! > ${tmp}/${repopidfile}.pid
+ ) 2>&1 | sed -e "s@^@${reponame}: @") &
+
+ if [ `expr ${n} '%' ${at_a_time}` -eq 0 ] ; then
+ sleep 2
+ echo Waiting 5 secs before spawning next background command.
+ sleep 3
+ fi
+done
+# Wait for all hg commands to complete
+wait
+
+# Terminate with exit 0 all the time (hard to know when to say "failed")
+exit 0
+
--- a/common/makefiles/RMICompilation.gmk Sat Dec 29 11:00:15 2012 +0000
+++ b/common/makefiles/RMICompilation.gmk Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 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
--- a/common/makefiles/javadoc/CORE_PKGS.gmk Sat Dec 29 11:00:15 2012 +0000
+++ b/common/makefiles/javadoc/CORE_PKGS.gmk Tue Jan 01 17:49:22 2013 -0800
@@ -131,6 +131,7 @@
java.util.concurrent \
java.util.concurrent.atomic \
java.util.concurrent.locks \
+ java.util.function \
java.util.jar \
java.util.logging \
java.util.prefs \
--- a/common/makefiles/javadoc/NON_CORE_PKGS.gmk Sat Dec 29 11:00:15 2012 +0000
+++ b/common/makefiles/javadoc/NON_CORE_PKGS.gmk Tue Jan 01 17:49:22 2013 -0800
@@ -78,7 +78,8 @@
JCONSOLE_PKGS = com.sun.tools.jconsole
-TREEAPI_PKGS = com.sun.source.tree \
+TREEAPI_PKGS = com.sun.source.doctree \
+ com.sun.source.tree \
com.sun.source.util
SMARTCARDIO_PKGS = javax.smartcardio
--- a/corba/.hgtags Sat Dec 29 11:00:15 2012 +0000
+++ b/corba/.hgtags Tue Jan 01 17:49:22 2013 -0800
@@ -189,3 +189,6 @@
5132f7900a8f0c30c3ca7f7a32f9433f4fee7745 jdk8-b65
65771ad1ca557ca26e4979d4dc633cf685435cb8 jdk8-b66
394515ad2a55d4d54df990b36065505d3e7a3cbb jdk8-b67
+82000531feaa7baef76b6406099e5cd88943d635 jdk8-b68
+22ddcac208a8dea894a16887d04f3ca4d3c5d267 jdk8-b69
+603cceb495c8133d47b26a7502d51c7d8a67d76b jdk8-b70
--- a/get_source.sh Sat Dec 29 11:00:15 2012 +0000
+++ b/get_source.sh Tue Jan 01 17:49:22 2013 -0800
@@ -26,8 +26,8 @@
#
# Get clones of all nested repositories
-sh ./make/scripts/hgforest.sh clone $*
+sh ./common/bin/hgforest.sh clone "$@"
# Update all existing repositories to the latest sources
-sh ./make/scripts/hgforest.sh pull -u
+sh ./common/bin/hgforest.sh pull -u
--- a/hotspot/.hgtags Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/.hgtags Tue Jan 01 17:49:22 2013 -0800
@@ -299,3 +299,8 @@
b61d9c88b759d1594b8af1655598e8fa00393672 hs25-b11
25bdce771bb3a7ae9825261a284d292cda700122 jdk8-b67
a35a72dd2e1255239d31f796f9f693e49b36bc9f hs25-b12
+121aa71316af6cd877bf455e775fa3fdbcdd4b65 jdk8-b68
+b6c9c0109a608eedbb6b868d260952990e3c91fe hs25-b13
+cb8a4e04bc8c104de8a2f67463c7e31232bf8d68 jdk8-b69
+990bbd393c239d95310ccc38094e57923bbf1d4a hs25-b14
+e94068d4ff52849c8aa0786a53a59b63d1312a39 jdk8-b70
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciArrayKlass.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciArrayKlass.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciField.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciField.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciInstance.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciInstance.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciKlass.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciKlass.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMetadata.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMetadata.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjArrayKlass.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjArrayKlass.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObject.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObject.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciReceiverTypeData.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciReceiverTypeData.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciSymbol.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciSymbol.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciType.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciType.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciTypeArrayKlass.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciTypeArrayKlass.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciVirtualCallData.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciVirtualCallData.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/LoaderConstraintTable.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/LoaderConstraintTable.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012 Oracle and/or its affiliates. All rights reserved.
+ * 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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BitData.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BitData.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java Tue Jan 01 17:49:22 2013 -0800
@@ -69,6 +69,8 @@
signatureIndex = new CIntField(type.getCIntegerField("_signature_index"), 0);
idnum = new CIntField(type.getCIntegerField("_method_idnum"), 0);
maxStack = new CIntField(type.getCIntegerField("_max_stack"), 0);
+ maxLocals = new CIntField(type.getCIntegerField("_max_locals"), 0);
+ sizeOfParameters = new CIntField(type.getCIntegerField("_size_of_parameters"), 0);
// start of byte code
bytecodeOffset = type.getSize();
@@ -96,6 +98,8 @@
private static CIntField signatureIndex;
private static CIntField idnum;
private static CIntField maxStack;
+ private static CIntField maxLocals;
+ private static CIntField sizeOfParameters;
// start of bytecode
private static long bytecodeOffset;
@@ -151,6 +155,14 @@
return maxStack.getValue(this);
}
+ public long getMaxLocals() {
+ return maxLocals.getValue(this);
+ }
+
+ public long getSizeOfParameters() {
+ return sizeOfParameters.getValue(this);
+ }
+
public Symbol getName() {
return getMethod().getName();
}
@@ -247,6 +259,8 @@
visitor.doCInt(signatureIndex, true);
visitor.doCInt(codeSize, true);
visitor.doCInt(maxStack, true);
+ visitor.doCInt(maxLocals, true);
+ visitor.doCInt(sizeOfParameters, true);
}
// Accessors
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java Tue Jan 01 17:49:22 2013 -0800
@@ -50,8 +50,6 @@
constMethod = type.getAddressField("_constMethod");
methodData = type.getAddressField("_method_data");
methodSize = new CIntField(type.getCIntegerField("_method_size"), 0);
- maxLocals = new CIntField(type.getCIntegerField("_max_locals"), 0);
- sizeOfParameters = new CIntField(type.getCIntegerField("_size_of_parameters"), 0);
accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0);
code = type.getAddressField("_code");
vtableIndex = new CIntField(type.getCIntegerField("_vtable_index"), 0);
@@ -83,8 +81,6 @@
private static AddressField constMethod;
private static AddressField methodData;
private static CIntField methodSize;
- private static CIntField maxLocals;
- private static CIntField sizeOfParameters;
private static CIntField accessFlags;
private static CIntField vtableIndex;
private static CIntField invocationCounter;
@@ -134,8 +130,8 @@
/** WARNING: this is in words, not useful in this system; use getObjectSize() instead */
public long getMethodSize() { return methodSize.getValue(this); }
public long getMaxStack() { return getConstMethod().getMaxStack(); }
- public long getMaxLocals() { return maxLocals.getValue(this); }
- public long getSizeOfParameters() { return sizeOfParameters.getValue(this); }
+ public long getMaxLocals() { return getConstMethod().getMaxLocals(); }
+ public long getSizeOfParameters() { return getConstMethod().getSizeOfParameters(); }
public long getNameIndex() { return getConstMethod().getNameIndex(); }
public long getSignatureIndex() { return getConstMethod().getSignatureIndex(); }
public long getGenericSignatureIndex() { return getConstMethod().getGenericSignatureIndex(); }
@@ -282,8 +278,6 @@
public void iterateFields(MetadataVisitor visitor) {
visitor.doCInt(methodSize, true);
- visitor.doCInt(maxLocals, true);
- visitor.doCInt(sizeOfParameters, true);
visitor.doCInt(accessFlags, true);
}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ProfileData.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ProfileData.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/RetData.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/RetData.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block_Array.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block_Array.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block_List.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block_List.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallDynamicJavaNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallDynamicJavaNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallRuntimeNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallRuntimeNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallStaticJavaNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallStaticJavaNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Compile.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Compile.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/HaltNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/HaltNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/InlineTree.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/InlineTree.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/JVMState.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/JVMState.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/LoopNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/LoopNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallRuntimeNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallRuntimeNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallStaticJavaNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallStaticJavaNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachIfNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachIfNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachReturnNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachReturnNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachSafePointNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachSafePointNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MultiNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MultiNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node_Array.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node_Array.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node_List.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node_List.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Phase.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Phase.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseRegAlloc.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseRegAlloc.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhiNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhiNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/ProjNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/ProjNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/RegionNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/RegionNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/RootNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/RootNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/SafePointNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/SafePointNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/TypeNode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/TypeNode.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/prims/JvmtiExport.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/prims/JvmtiExport.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GenericGrowableArray.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GenericGrowableArray.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GrowableArray.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GrowableArray.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*
*/
--- a/hotspot/agent/src/share/native/sadis.c Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/agent/src/share/native/sadis.c Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright 2012, Oracle and/or its affiliates. All Rights Reserved.
+ * Copyright (c) 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
--- a/hotspot/make/bsd/Makefile Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/bsd/Makefile Tue Jan 01 17:49:22 2013 -0800
@@ -47,10 +47,10 @@
# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
# JDI binding on SA produces two binaries:
-# 1. sa-jdi.jar - This is build before building libjvm[_g].so
+# 1. sa-jdi.jar - This is built before building libjvm.so
# Please refer to ./makefiles/sa.make
-# 2. libsa[_g].so - Native library for SA - This is built after
-# libjsig[_g].so (signal interposition library)
+# 2. libsa.so - Native library for SA - This is built after
+# libjsig.so (signal interposition library)
# Please refer to ./makefiles/vm.make
# If $(GAMMADIR)/agent dir is not present, SA components are not built.
@@ -181,9 +181,9 @@
#
# What you get with each target:
#
-# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
+# debug* - "thin" libjvm - debug info linked into the gamma launcher
# fastdebug* - optimized compile, but with asserts enabled
-# jvmg* - "fat" libjvm_g - debug info linked into libjvm_g.so
+# jvmg* - "fat" libjvm - debug info linked into libjvm.so
# optimized* - optimized compile, no asserts
# profiled* - gprof
# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
--- a/hotspot/make/bsd/makefiles/buildtree.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/bsd/makefiles/buildtree.make Tue Jan 01 17:49:22 2013 -0800
@@ -449,12 +449,7 @@
echo " exit 0"; \
echo "fi"; \
echo ""; \
- echo "# Use gamma_g if it exists"; \
- echo ""; \
echo "GAMMA_PROG=gamma"; \
- echo "if [ -f gamma_g ]; then "; \
- echo " GAMMA_PROG=gamma_g"; \
- echo "fi"; \
echo ""; \
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \
--- a/hotspot/make/bsd/makefiles/debug.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/bsd/makefiles/debug.make Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -38,7 +38,6 @@
"Please use 'make jvmg' to build debug JVM. \n" \
"----------------------------------------------------------------------\n")
-G_SUFFIX = _g
VERSION = debug
SYSDEFS += -DASSERT -DDEBUG
PICFLAGS = DEFAULT
--- a/hotspot/make/bsd/makefiles/dtrace.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/bsd/makefiles/dtrace.make Tue Jan 01 17:49:22 2013 -0800
@@ -38,12 +38,10 @@
# Bsd does not build libjvm_db, does not compile on macosx
# disabled in build: rule in vm.make
JVM_DB = libjvm_db
-#LIBJVM_DB = libjvm_db.dylib
-LIBJVM_DB = libjvm$(G_SUFFIX)_db.dylib
+LIBJVM_DB = libjvm_db.dylib
JVM_DTRACE = jvm_dtrace
-#LIBJVM_DTRACE = libjvm_dtrace.dylib
-LIBJVM_DTRACE = libjvm$(G_SUFFIX)_dtrace.dylib
+LIBJVM_DTRACE = libjvm_dtrace.dylib
JVMOFFS = JvmOffsets
JVMOFFS.o = $(JVMOFFS).o
@@ -80,9 +78,7 @@
ifneq ("${ISA}","${BUILDARCH}")
XLIBJVM_DB = 64/$(LIBJVM_DB)
-XLIBJVM_DB_G = 64/$(LIBJVM_DB_G)
XLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE)
-XLIBJVM_DTRACE_G = 64/$(LIBJVM_DTRACE_G)
XARCH = $(subst sparcv9,v9,$(shell echo $(ISA)))
$(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
@@ -90,14 +86,12 @@
$(QUIETLY) mkdir -p 64/ ; \
$(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. -I$(GENERATED) \
$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c #-lc
-# [ -f $(XLIBJVM_DB_G) ] || { ln -s $(LIBJVM_DB) $(XLIBJVM_DB_G); }
$(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
@echo Making $@
$(QUIETLY) mkdir -p 64/ ; \
$(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. \
$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c #-lc -lthread -ldoor
-# [ -f $(XLIBJVM_DTRACE_G) ] || { ln -s $(LIBJVM_DTRACE) $(XLIBJVM_DTRACE_G); }
endif # ifneq ("${ISA}","${BUILDARCH}")
@@ -141,13 +135,11 @@
@echo Making $@
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -Wall # -lc
-# [ -f $(LIBJVM_DB_G) ] || { ln -s $@ $(LIBJVM_DB_G); }
$(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
@echo Making $@
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \
$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c #-lc -lthread -ldoor
-# [ -f $(LIBJVM_DTRACE_G) ] || { ln -s $@ $(LIBJVM_DTRACE_G); }
#$(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \
# $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d
--- a/hotspot/make/bsd/makefiles/fastdebug.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/bsd/makefiles/fastdebug.make Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -58,7 +58,6 @@
# Linker mapfile
MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug
-G_SUFFIX = _g
VERSION = optimized
SYSDEFS += -DASSERT -DFASTDEBUG
PICFLAGS = DEFAULT
--- a/hotspot/make/bsd/makefiles/gcc.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/bsd/makefiles/gcc.make Tue Jan 01 17:49:22 2013 -0800
@@ -284,9 +284,9 @@
# Use the stabs format for debugging information (this is the default
# on gcc-2.91). It's good enough, has all the information about line
-# numbers and local variables, and libjvm_g.so is only about 16M.
+# numbers and local variables, and libjvm.so is only about 16M.
# Change this back to "-g" if you want the most expressive format.
-# (warning: that could easily inflate libjvm_g.so to 150M!)
+# (warning: that could easily inflate libjvm.so to 150M!)
# Note: The Itanium gcc compiler crashes when using -gstabs.
DEBUG_CFLAGS/ia64 = -g
DEBUG_CFLAGS/amd64 = -g
--- a/hotspot/make/bsd/makefiles/jsig.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/bsd/makefiles/jsig.make Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 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
@@ -24,16 +24,13 @@
# Rules to build signal interposition library, used by vm.make
-# libjsig[_g].so: signal interposition library
+# libjsig.so: signal interposition library
JSIG = jsig
-JSIG_G = $(JSIG)$(G_SUFFIX)
ifeq ($(OS_VENDOR), Darwin)
LIBJSIG = lib$(JSIG).dylib
- LIBJSIG_G = lib$(JSIG_G).dylib
else
LIBJSIG = lib$(JSIG).so
- LIBJSIG_G = lib$(JSIG_G).so
endif
JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm
@@ -58,7 +55,6 @@
@echo Making signal interposition lib...
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
$(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $<
- $(QUIETLY) [ -f $(LIBJSIG_G) ] || { ln -s $@ $(LIBJSIG_G); }
install_jsig: $(LIBJSIG)
@echo "Copying $(LIBJSIG) to $(DEST_JSIG)"
--- a/hotspot/make/bsd/makefiles/jvmg.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/bsd/makefiles/jvmg.make Tue Jan 01 17:49:22 2013 -0800
@@ -37,7 +37,6 @@
# Linker mapfile
MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug
-G_SUFFIX = _g
VERSION = debug
SYSDEFS += -DASSERT -DDEBUG
PICFLAGS = DEFAULT
--- a/hotspot/make/bsd/makefiles/optimized.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/bsd/makefiles/optimized.make Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -40,5 +40,4 @@
# Linker mapfile
MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug
-G_SUFFIX =
VERSION = optimized
--- a/hotspot/make/bsd/makefiles/product.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/bsd/makefiles/product.make Tue Jan 01 17:49:22 2013 -0800
@@ -40,7 +40,6 @@
# Linker mapfile
MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-product
-G_SUFFIX =
SYSDEFS += -DPRODUCT
VERSION = optimized
--- a/hotspot/make/bsd/makefiles/saproc.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/bsd/makefiles/saproc.make Tue Jan 01 17:49:22 2013 -0800
@@ -24,16 +24,13 @@
# Rules to build serviceability agent library, used by vm.make
-# libsaproc[_g].so: serviceability agent
+# libsaproc.so: serviceability agent
SAPROC = saproc
-SAPROC_G = $(SAPROC)$(G_SUFFIX)
ifeq ($(OS_VENDOR), Darwin)
LIBSAPROC = lib$(SAPROC).dylib
- LIBSAPROC_G = lib$(SAPROC_G).dylib
else
LIBSAPROC = lib$(SAPROC).so
- LIBSAPROC_G = lib$(SAPROC_G).so
endif
AGENT_DIR = $(GAMMADIR)/agent
@@ -114,7 +111,6 @@
$(SA_DEBUG_CFLAGS) \
-o $@ \
$(SALIBS)
- $(QUIETLY) [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
install_saproc: $(BUILDLIBSAPROC)
$(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \
--- a/hotspot/make/bsd/makefiles/vm.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/bsd/makefiles/vm.make Tue Jan 01 17:49:22 2013 -0800
@@ -138,11 +138,9 @@
JVM = jvm
ifeq ($(OS_VENDOR), Darwin)
LIBJVM = lib$(JVM).dylib
- LIBJVM_G = lib$(JVM)$(G_SUFFIX).dylib
CFLAGS += -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE
else
LIBJVM = lib$(JVM).so
- LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
endif
SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt
@@ -314,7 +312,6 @@
$(LFLAGS_VM) -o $@ $(sort $(LIBJVM.o)) $(LIBS_VM); \
$(LINK_LIB.CXX/POST_HOOK) \
rm -f $@.1; ln -s $@ $@.1; \
- [ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \
}
DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)
--- a/hotspot/make/hotspot_version Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/hotspot_version Tue Jan 01 17:49:22 2013 -0800
@@ -35,7 +35,7 @@
HS_MAJOR_VER=25
HS_MINOR_VER=0
-HS_BUILD_NUMBER=12
+HS_BUILD_NUMBER=14
JDK_MAJOR_VER=1
JDK_MINOR_VER=8
--- a/hotspot/make/linux/Makefile Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/linux/Makefile Tue Jan 01 17:49:22 2013 -0800
@@ -47,10 +47,10 @@
# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
# JDI binding on SA produces two binaries:
-# 1. sa-jdi.jar - This is build before building libjvm[_g].so
+# 1. sa-jdi.jar - This is built before building libjvm.so
# Please refer to ./makefiles/sa.make
-# 2. libsa[_g].so - Native library for SA - This is built after
-# libjsig[_g].so (signal interposition library)
+# 2. libsa.so - Native library for SA - This is built after
+# libjsig.so (signal interposition library)
# Please refer to ./makefiles/vm.make
# If $(GAMMADIR)/agent dir is not present, SA components are not built.
@@ -181,9 +181,9 @@
#
# What you get with each target:
#
-# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
+# debug* - "thin" libjvm - debug info linked into the gamma launcher
# fastdebug* - optimized compile, but with asserts enabled
-# jvmg* - "fat" libjvm_g - debug info linked into libjvm_g.so
+# jvmg* - "fat" libjvm - debug info linked into libjvm.so
# optimized* - optimized compile, no asserts
# profiled* - gprof
# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
--- a/hotspot/make/linux/makefiles/buildtree.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/linux/makefiles/buildtree.make Tue Jan 01 17:49:22 2013 -0800
@@ -442,12 +442,7 @@
echo " exit 0"; \
echo "fi"; \
echo ""; \
- echo "# Use gamma_g if it exists"; \
- echo ""; \
echo "GAMMA_PROG=gamma"; \
- echo "if [ -f gamma_g ]; then "; \
- echo " GAMMA_PROG=gamma_g"; \
- echo "fi"; \
echo ""; \
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \
--- a/hotspot/make/linux/makefiles/debug.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/linux/makefiles/debug.make Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -38,7 +38,6 @@
"Please use 'make jvmg' to build debug JVM. \n" \
"----------------------------------------------------------------------\n")
-G_SUFFIX = _g
VERSION = debug
SYSDEFS += -DASSERT -DDEBUG
PICFLAGS = DEFAULT
--- a/hotspot/make/linux/makefiles/fastdebug.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/linux/makefiles/fastdebug.make Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -58,7 +58,6 @@
# Linker mapfile
MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug
-G_SUFFIX = _g
VERSION = optimized
SYSDEFS += -DASSERT -DFASTDEBUG
PICFLAGS = DEFAULT
--- a/hotspot/make/linux/makefiles/gcc.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/linux/makefiles/gcc.make Tue Jan 01 17:49:22 2013 -0800
@@ -229,9 +229,9 @@
else
# Use the stabs format for debugging information (this is the default
# on gcc-2.91). It's good enough, has all the information about line
- # numbers and local variables, and libjvm_g.so is only about 16M.
+ # numbers and local variables, and libjvm.so is only about 16M.
# Change this back to "-g" if you want the most expressive format.
- # (warning: that could easily inflate libjvm_g.so to 150M!)
+ # (warning: that could easily inflate libjvm.so to 150M!)
# Note: The Itanium gcc compiler crashes when using -gstabs.
DEBUG_CFLAGS/ia64 = -g
DEBUG_CFLAGS/amd64 = -g
--- a/hotspot/make/linux/makefiles/jsig.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/linux/makefiles/jsig.make Tue Jan 01 17:49:22 2013 -0800
@@ -24,17 +24,12 @@
# Rules to build signal interposition library, used by vm.make
-# libjsig[_g].so: signal interposition library
+# libjsig.so: signal interposition library
JSIG = jsig
LIBJSIG = lib$(JSIG).so
-JSIG_G = $(JSIG)$(G_SUFFIX)
-LIBJSIG_G = lib$(JSIG_G).so
-
LIBJSIG_DEBUGINFO = lib$(JSIG).debuginfo
LIBJSIG_DIZ = lib$(JSIG).diz
-LIBJSIG_G_DEBUGINFO = lib$(JSIG_G).debuginfo
-LIBJSIG_G_DIZ = lib$(JSIG_G).diz
JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm
@@ -60,7 +55,6 @@
@echo Making signal interposition lib...
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
$(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $< -ldl
- $(QUIETLY) [ -f $(LIBJSIG_G) ] || { ln -s $@ $(LIBJSIG_G); }
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO)
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
@@ -72,11 +66,9 @@
# implied else here is no stripping at all
endif
endif
- [ -f $(LIBJSIG_G_DEBUGINFO) ] || { ln -s $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO); }
ifeq ($(ZIP_DEBUGINFO_FILES),1)
- $(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO)
- $(RM) $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO)
- [ -f $(LIBJSIG_G_DIZ) ] || { ln -s $(LIBJSIG_DIZ) $(LIBJSIG_G_DIZ); }
+ $(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO)
+ $(RM) $(LIBJSIG_DEBUGINFO)
endif
endif
--- a/hotspot/make/linux/makefiles/jvmg.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/linux/makefiles/jvmg.make Tue Jan 01 17:49:22 2013 -0800
@@ -37,7 +37,6 @@
# Linker mapfile
MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug
-G_SUFFIX = _g
VERSION = debug
SYSDEFS += -DASSERT -DDEBUG
PICFLAGS = DEFAULT
--- a/hotspot/make/linux/makefiles/optimized.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/linux/makefiles/optimized.make Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# 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
@@ -40,5 +40,4 @@
# Linker mapfile
MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug
-G_SUFFIX =
VERSION = optimized
--- a/hotspot/make/linux/makefiles/product.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/linux/makefiles/product.make Tue Jan 01 17:49:22 2013 -0800
@@ -40,7 +40,6 @@
# Linker mapfile
MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-product
-G_SUFFIX =
SYSDEFS += -DPRODUCT
VERSION = optimized
--- a/hotspot/make/linux/makefiles/saproc.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/linux/makefiles/saproc.make Tue Jan 01 17:49:22 2013 -0800
@@ -26,18 +26,13 @@
# Rules to build serviceability agent library, used by vm.make
-# libsaproc[_g].so: serviceability agent
+# libsaproc.so: serviceability agent
SAPROC = saproc
LIBSAPROC = lib$(SAPROC).so
-SAPROC_G = $(SAPROC)$(G_SUFFIX)
-LIBSAPROC_G = lib$(SAPROC_G).so
-
LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo
LIBSAPROC_DIZ = lib$(SAPROC).diz
-LIBSAPROC_G_DEBUGINFO = lib$(SAPROC_G).debuginfo
-LIBSAPROC_G_DIZ = lib$(SAPROC_G).diz
AGENT_DIR = $(GAMMADIR)/agent
@@ -99,7 +94,6 @@
$(SA_DEBUG_CFLAGS) \
-o $@ \
-lthread_db
- $(QUIETLY) [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
@@ -111,11 +105,9 @@
# implied else here is no stripping at all
endif
endif
- [ -f $(LIBSAPROC_G_DEBUGINFO) ] || { ln -s $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO); }
ifeq ($(ZIP_DEBUGINFO_FILES),1)
- $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO)
- $(RM) $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO)
- [ -f $(LIBSAPROC_G_DIZ) ] || { ln -s $(LIBSAPROC_DIZ) $(LIBSAPROC_G_DIZ); }
+ $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
+ $(RM) $(LIBSAPROC_DEBUGINFO)
endif
endif
--- a/hotspot/make/linux/makefiles/vm.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/linux/makefiles/vm.make Tue Jan 01 17:49:22 2013 -0800
@@ -138,12 +138,9 @@
JVM = jvm
LIBJVM = lib$(JVM).so
-LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
LIBJVM_DEBUGINFO = lib$(JVM).debuginfo
LIBJVM_DIZ = lib$(JVM).diz
-LIBJVM_G_DEBUGINFO = lib$(JVM)$(G_SUFFIX).debuginfo
-LIBJVM_G_DIZ = lib$(JVM)$(G_SUFFIX).diz
SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt
@@ -323,7 +320,6 @@
$(LFLAGS_VM) -o $@ $(sort $(LIBJVM.o)) $(LIBS_VM); \
$(LINK_LIB.CXX/POST_HOOK) \
rm -f $@.1; ln -s $@ $@.1; \
- [ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \
if [ \"$(CROSS_COMPILE_ARCH)\" = \"\" ] ; then \
if [ -x /usr/sbin/selinuxenabled ] ; then \
/usr/sbin/selinuxenabled; \
@@ -348,11 +344,9 @@
# implied else here is no stripping at all
endif
endif
- $(QUIETLY) [ -f $(LIBJVM_G_DEBUGINFO) ] || ln -s $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
ifeq ($(ZIP_DEBUGINFO_FILES),1)
- $(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
- $(RM) $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
- [ -f $(LIBJVM_G_DIZ) ] || { ln -s $(LIBJVM_DIZ) $(LIBJVM_G_DIZ); }
+ $(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO)
+ $(RM) $(LIBJVM_DEBUGINFO)
endif
endif
--- a/hotspot/make/solaris/Makefile Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/solaris/Makefile Tue Jan 01 17:49:22 2013 -0800
@@ -38,10 +38,10 @@
# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
# JDI binding on SA produces two binaries:
-# 1. sa-jdi.jar - This is build before building libjvm[_g].so
+# 1. sa-jdi.jar - This is built before building libjvm.so
# Please refer to ./makefiles/sa.make
-# 2. libsaproc[_g].so - Native library for SA - This is built after
-# libjsig[_g].so (signal interposition library)
+# 2. libsaproc.so - Native library for SA - This is built after
+# libjsig.so (signal interposition library)
# Please refer to ./makefiles/vm.make
# If $(GAMMADIR)/agent dir is not present, SA components are not built.
@@ -141,9 +141,9 @@
#
# What you get with each target:
#
-# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
+# debug* - "thin" libjvm - debug info linked into the gamma launcher
# fastdebug* - optimized compile, but with asserts enabled
-# jvmg* - "fat" libjvm_g - debug info linked into libjvm_g.so
+# jvmg* - "fat" libjvm - debug info linked into libjvm.so
# optimized* - optimized compile, no asserts
# profiled* - gprof
# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
--- a/hotspot/make/solaris/makefiles/buildtree.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/solaris/makefiles/buildtree.make Tue Jan 01 17:49:22 2013 -0800
@@ -436,12 +436,7 @@
echo " exit 0"; \
echo "fi"; \
echo ""; \
- echo "# Use gamma_g if it exists"; \
- echo ""; \
echo "GAMMA_PROG=gamma"; \
- echo "if [ -f gamma_g ]; then "; \
- echo " GAMMA_PROG=gamma_g"; \
- echo "fi"; \
echo ""; \
echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \
--- a/hotspot/make/solaris/makefiles/debug.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/solaris/makefiles/debug.make Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
@@ -53,7 +53,6 @@
"Please use 'gnumake jvmg' to build debug JVM. \n" \
"-------------------------------------------------------------------------\n")
-G_SUFFIX = _g
VERSION = debug
SYSDEFS += -DASSERT -DDEBUG
PICFLAGS = DEFAULT
--- a/hotspot/make/solaris/makefiles/dtrace.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/solaris/makefiles/dtrace.make Tue Jan 01 17:49:22 2013 -0800
@@ -39,21 +39,15 @@
JVM_DB = libjvm_db
LIBJVM_DB = libjvm_db.so
-LIBJVM_DB_G = libjvm$(G_SUFFIX)_db.so
LIBJVM_DB_DEBUGINFO = libjvm_db.debuginfo
LIBJVM_DB_DIZ = libjvm_db.diz
-LIBJVM_DB_G_DEBUGINFO = libjvm$(G_SUFFIX)_db.debuginfo
-LIBJVM_DB_G_DIZ = libjvm$(G_SUFFIX)_db.diz
JVM_DTRACE = jvm_dtrace
LIBJVM_DTRACE = libjvm_dtrace.so
-LIBJVM_DTRACE_G = libjvm$(G_SUFFIX)_dtrace.so
LIBJVM_DTRACE_DEBUGINFO = libjvm_dtrace.debuginfo
LIBJVM_DTRACE_DIZ = libjvm_dtrace.diz
-LIBJVM_DTRACE_G_DEBUGINFO = libjvm$(G_SUFFIX)_dtrace.debuginfo
-LIBJVM_DTRACE_G_DIZ = libjvm$(G_SUFFIX)_dtrace.diz
JVMOFFS = JvmOffsets
JVMOFFS.o = $(JVMOFFS).o
@@ -96,25 +90,18 @@
XLIBJVM_DIR = 64
XLIBJVM_DB = $(XLIBJVM_DIR)/$(LIBJVM_DB)
-XLIBJVM_DB_G = $(XLIBJVM_DIR)/$(LIBJVM_DB_G)
XLIBJVM_DTRACE = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE)
-XLIBJVM_DTRACE_G = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_G)
XLIBJVM_DB_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DB_DEBUGINFO)
XLIBJVM_DB_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DB_DIZ)
-XLIBJVM_DB_G_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DB_G_DEBUGINFO)
-XLIBJVM_DB_G_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DB_G_DIZ)
XLIBJVM_DTRACE_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DEBUGINFO)
XLIBJVM_DTRACE_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DIZ)
-XLIBJVM_DTRACE_G_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_G_DEBUGINFO)
-XLIBJVM_DTRACE_G_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_G_DIZ)
$(XLIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
@echo Making $@
$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \
$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
- [ -f $(XLIBJVM_DB_G) ] || { ln -s $(LIBJVM_DB) $(XLIBJVM_DB_G); }
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
# Clear the SHF_ALLOC flag (if set) from empty section headers.
@@ -137,13 +124,11 @@
# implied else here is no stripping at all
endif
endif
- [ -f $(XLIBJVM_DB_G_DEBUGINFO) ] || { cd $(XLIBJVM_DIR) && ln -s $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO); }
ifeq ($(ZIP_DEBUGINFO_FILES),1)
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
# in the archived name:
- ( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO) )
- $(RM) $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO)
- [ -f $(XLIBJVM_DB_G_DIZ) ] || { cd $(XLIBJVM_DIR) && ln -s $(LIBJVM_DB_DIZ) $(LIBJVM_DB_G_DIZ); }
+ ( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) )
+ $(RM) $(XLIBJVM_DB_DEBUGINFO)
endif
endif
@@ -152,7 +137,6 @@
$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \
$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
- [ -f $(XLIBJVM_DTRACE_G) ] || { ln -s $(LIBJVM_DTRACE) $(XLIBJVM_DTRACE_G); }
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
# Clear the SHF_ALLOC flag (if set) from empty section headers.
$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
@@ -170,13 +154,11 @@
# implied else here is no stripping at all
endif
endif
- [ -f $(XLIBJVM_DTRACE_G_DEBUGINFO) ] || { cd $(XLIBJVM_DIR) && ln -s $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO); }
ifeq ($(ZIP_DEBUGINFO_FILES),1)
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
# in the archived name:
- ( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO) )
- $(RM) $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO)
- [ -f $(XLIBJVM_DTRACE_G_DIZ) ] || { cd $(XLIBJVM_DIR) && ln -s $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_G_DIZ); }
+ ( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO))
+ $(RM) $(XLIBJVM_DTRACE_DEBUGINFO)
endif
endif
@@ -224,7 +206,6 @@
@echo Making $@
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
- [ -f $(LIBJVM_DB_G) ] || { ln -s $@ $(LIBJVM_DB_G); }
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
# Clear the SHF_ALLOC flag (if set) from empty section headers.
$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
@@ -240,11 +221,9 @@
# implied else here is no stripping at all
endif
endif
- [ -f $(LIBJVM_DB_G_DEBUGINFO) ] || { ln -s $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO); }
ifeq ($(ZIP_DEBUGINFO_FILES),1)
- $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO)
- $(RM) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO)
- [ -f $(LIBJVM_DB_G_DIZ) ] || { ln -s $(LIBJVM_DB_DIZ) $(LIBJVM_DB_G_DIZ); }
+ $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO)
+ $(RM) $(LIBJVM_DB_DEBUGINFO)
endif
endif
@@ -252,7 +231,6 @@
@echo Making $@
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \
$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
- [ -f $(LIBJVM_DTRACE_G) ] || { ln -s $@ $(LIBJVM_DTRACE_G); }
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
# Clear the SHF_ALLOC flag (if set) from empty section headers.
$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
@@ -268,11 +246,9 @@
# implied else here is no stripping at all
endif
endif
- [ -f $(LIBJVM_DTRACE_G_DEBUGINFO) ] || { ln -s $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO); }
ifeq ($(ZIP_DEBUGINFO_FILES),1)
- $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO)
- $(RM) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO)
- [ -f $(LIBJVM_DTRACE_G_DIZ) ] || { ln -s $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_G_DIZ); }
+ $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO)
+ $(RM) $(LIBJVM_DTRACE_DEBUGINFO)
endif
endif
--- a/hotspot/make/solaris/makefiles/fastdebug.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/solaris/makefiles/fastdebug.make Tue Jan 01 17:49:22 2013 -0800
@@ -122,7 +122,6 @@
# and mustn't be otherwise.
MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
-G_SUFFIX = _g
VERSION = optimized
SYSDEFS += -DASSERT -DFASTDEBUG -DCHECK_UNHANDLED_OOPS
PICFLAGS = DEFAULT
--- a/hotspot/make/solaris/makefiles/gcc.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/solaris/makefiles/gcc.make Tue Jan 01 17:49:22 2013 -0800
@@ -187,9 +187,9 @@
# Use the stabs format for debugging information (this is the default
# on gcc-2.91). It's good enough, has all the information about line
-# numbers and local variables, and libjvm_g.so is only about 16M.
+# numbers and local variables, and libjvm.so is only about 16M.
# Change this back to "-g" if you want the most expressive format.
-# (warning: that could easily inflate libjvm_g.so to 150M!)
+# (warning: that could easily inflate libjvm.so to 150M!)
# Note: The Itanium gcc compiler crashes when using -gstabs.
DEBUG_CFLAGS/ia64 = -g
DEBUG_CFLAGS/amd64 = -g
--- a/hotspot/make/solaris/makefiles/jsig.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/solaris/makefiles/jsig.make Tue Jan 01 17:49:22 2013 -0800
@@ -24,17 +24,12 @@
# Rules to build signal interposition library, used by vm.make
-# libjsig[_g].so: signal interposition library
+# libjsig.so: signal interposition library
JSIG = jsig
LIBJSIG = lib$(JSIG).so
-JSIG_G = $(JSIG)$(G_SUFFIX)
-LIBJSIG_G = lib$(JSIG_G).so
-
LIBJSIG_DEBUGINFO = lib$(JSIG).debuginfo
LIBJSIG_DIZ = lib$(JSIG).diz
-LIBJSIG_G_DEBUGINFO = lib$(JSIG_G).debuginfo
-LIBJSIG_G_DIZ = lib$(JSIG_G).diz
JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm
@@ -56,7 +51,6 @@
@echo Making signal interposition lib...
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
$(LFLAGS_JSIG) -o $@ $(JSIGSRCDIR)/jsig.c -ldl
- [ -f $(LIBJSIG_G) ] || { ln -s $@ $(LIBJSIG_G); }
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
# Clear the SHF_ALLOC flag (if set) from empty section headers.
@@ -77,11 +71,9 @@
# implied else here is no stripping at all
endif
endif
- [ -f $(LIBJSIG_G_DEBUGINFO) ] || { ln -s $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO); }
ifeq ($(ZIP_DEBUGINFO_FILES),1)
- $(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO)
- $(RM) $(LIBJSIG_DEBUGINFO) $(LIBJSIG_G_DEBUGINFO)
- [ -f $(LIBJSIG_G_DIZ) ] || { ln -s $(LIBJSIG_DIZ) $(LIBJSIG_G_DIZ); }
+ $(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO)
+ $(RM) $(LIBJSIG_DEBUGINFO)
endif
endif
--- a/hotspot/make/solaris/makefiles/jvmg.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/solaris/makefiles/jvmg.make Tue Jan 01 17:49:22 2013 -0800
@@ -51,7 +51,6 @@
# and mustn't be otherwise.
MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE)
-G_SUFFIX = _g
VERSION = debug
SYSDEFS += -DASSERT -DDEBUG
PICFLAGS = DEFAULT
--- a/hotspot/make/solaris/makefiles/optimized.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/solaris/makefiles/optimized.make Tue Jan 01 17:49:22 2013 -0800
@@ -62,5 +62,4 @@
# Set the environment variable HOTSPARC_GENERIC to "true"
# to inhibit the effect of the previous line on CFLAGS.
-G_SUFFIX =
VERSION = optimized
--- a/hotspot/make/solaris/makefiles/product.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/solaris/makefiles/product.make Tue Jan 01 17:49:22 2013 -0800
@@ -78,6 +78,5 @@
# and this macro is not used.
# LINK_LIB.CXX/POST_HOOK += $(STRIP_LIB.CXX/POST_HOOK)
-G_SUFFIX =
SYSDEFS += -DPRODUCT
VERSION = optimized
--- a/hotspot/make/solaris/makefiles/saproc.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/solaris/makefiles/saproc.make Tue Jan 01 17:49:22 2013 -0800
@@ -24,20 +24,15 @@
# Rules to build serviceability agent library, used by vm.make
-# libsaproc[_g].so: serviceability agent
+# libsaproc.so: serviceability agent
SAPROC = saproc
SADIS = sadis
LIBSAPROC = lib$(SAPROC).so
SADISOBJ = $(SADIS).o
-SAPROC_G = $(SAPROC)$(G_SUFFIX)
-LIBSAPROC_G = lib$(SAPROC_G).so
-
LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo
LIBSAPROC_DIZ = lib$(SAPROC).diz
-LIBSAPROC_G_DEBUGINFO = lib$(SAPROC_G).debuginfo
-LIBSAPROC_G_DIZ = lib$(SAPROC_G).diz
AGENT_DIR = $(GAMMADIR)/agent
@@ -113,7 +108,6 @@
$(SA_LFLAGS) \
-o $@ \
-ldl -ldemangle -lthread -lc
- [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
$(SADISOBJ): $(SADISSRCFILES)
$(QUIETLY) $(CC) \
@@ -146,11 +140,9 @@
# implied else here is no stripping at all
endif
endif
- [ -f $(LIBSAPROC_G_DEBUGINFO) ] || { ln -s $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO); }
ifeq ($(ZIP_DEBUGINFO_FILES),1)
- $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO)
- $(RM) $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO)
- [ -f $(LIBSAPROC_G_DIZ) ] || { ln -s $(LIBSAPROC_DIZ) $(LIBSAPROC_G_DIZ); }
+ $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
+ $(RM) $(LIBSAPROC_DEBUGINFO)
endif
endif
--- a/hotspot/make/solaris/makefiles/vm.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/solaris/makefiles/vm.make Tue Jan 01 17:49:22 2013 -0800
@@ -157,12 +157,9 @@
JVM = jvm
LIBJVM = lib$(JVM).so
-LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
LIBJVM_DEBUGINFO = lib$(JVM).debuginfo
LIBJVM_DIZ = lib$(JVM).diz
-LIBJVM_G_DEBUGINFO = lib$(JVM)$(G_SUFFIX).debuginfo
-LIBJVM_G_DIZ = lib$(JVM)$(G_SUFFIX).diz
SPECIAL_PATHS:=adlc c1 dist gc_implementation opto shark libadt
@@ -291,8 +288,6 @@
$(QUIETLY) $(LINK_VM) $(LFLAGS_VM) -o $@ $(sort $(LIBJVM.o)) $(LIBS_VM)
$(QUIETLY) $(LINK_LIB.CXX/POST_HOOK)
$(QUIETLY) rm -f $@.1 && ln -s $@ $@.1
- $(QUIETLY) [ -f $(LIBJVM_G) ] || ln -s $@ $(LIBJVM_G)
- $(QUIETLY) [ -f $(LIBJVM_G).1 ] || ln -s $@.1 $(LIBJVM_G).1
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
# Clear the SHF_ALLOC flag (if set) from empty section headers.
@@ -313,11 +308,9 @@
# implied else here is no stripping at all
endif
endif
- $(QUIETLY) [ -f $(LIBJVM_G_DEBUGINFO) ] || ln -s $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
ifeq ($(ZIP_DEBUGINFO_FILES),1)
- $(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
- $(RM) $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
- [ -f $(LIBJVM_G_DIZ) ] || { ln -s $(LIBJVM_DIZ) $(LIBJVM_G_DIZ); }
+ $(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO)
+ $(RM) $(LIBJVM_DEBUGINFO)
endif
endif
endif # filter -sbfast -xsbfast
--- a/hotspot/make/windows/build.make Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/windows/build.make Tue Jan 01 17:49:22 2013 -0800
@@ -33,7 +33,7 @@
# SA components are built if BUILD_WIN_SA=1 is specified.
# See notes in README. This produces files:
# 1. sa-jdi.jar - This is built before building jvm.dll
-# 2. sawindbg[_g].dll - Native library for SA - This is built after jvm.dll
+# 2. sawindbg.dll - Native library for SA - This is built after jvm.dll
# - Also, .lib, .map, .pdb.
#
# Please refer to ./makefiles/sa.make
@@ -115,7 +115,7 @@
!endif
#########################################################################
-# Parameters for VERSIONINFO resource for jvm[_g].dll.
+# Parameters for VERSIONINFO resource for jvm.dll.
# These can be overridden via the nmake.exe command line.
# They are overridden by RE during the control builds.
#
@@ -225,11 +225,6 @@
#########################################################################
-# With the jvm_g.dll now being named jvm.dll, we can't build both and place
-# the dll's in the same directory, so we only build one at a time,
-# re-directing the output to different output directories (done by user
-# of this makefile).
-#
defaultTarget: product
# The product or release build is an optimized build, and is the default
--- a/hotspot/make/windows/projectfiles/compiler2/ADLCompiler.dsp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/windows/projectfiles/compiler2/ADLCompiler.dsp Tue Jan 01 17:49:22 2013 -0800
@@ -72,11 +72,11 @@
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
-# ADD BSC32 /o".\adlc\Debug\adlc_g.bsc"
+# ADD BSC32 /o".\adlc\Debug\adlc.bsc"
# SUBTRACT BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386 /out:".\bin\adlc_g.exe"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386 /out:".\bin\adlc.exe"
!ENDIF
--- a/hotspot/make/windows/projectfiles/tiered/ADLCompiler.dsp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/make/windows/projectfiles/tiered/ADLCompiler.dsp Tue Jan 01 17:49:22 2013 -0800
@@ -72,11 +72,11 @@
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
-# ADD BSC32 /o".\adlc\Debug\adlc_g.bsc"
+# ADD BSC32 /o".\adlc\Debug\adlc.bsc"
# SUBTRACT BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386 /out:".\bin\adlc_g.exe"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386 /out:".\bin\adlc.exe"
!ENDIF
--- a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -298,7 +298,7 @@
for (int i = 0; i < _bytes_to_copy; i++) {
address ptr = (address)(_pc_start + i);
int a_byte = (*ptr) & 0xFF;
- __ a_byte (a_byte);
+ __ emit_int8 (a_byte);
}
}
@@ -340,10 +340,10 @@
int being_initialized_entry_offset = __ offset() - being_initialized_entry + sizeof_patch_record;
// Emit the patch record. We need to emit a full word, so emit an extra empty byte
- __ a_byte(0);
- __ a_byte(being_initialized_entry_offset);
- __ a_byte(bytes_to_skip);
- __ a_byte(_bytes_to_copy);
+ __ emit_int8(0);
+ __ emit_int8(being_initialized_entry_offset);
+ __ emit_int8(bytes_to_skip);
+ __ emit_int8(_bytes_to_copy);
address patch_info_pc = __ pc();
assert(patch_info_pc - end_of_patch == bytes_to_skip, "incorrect patch info");
--- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -582,7 +582,9 @@
// the following temporary registers are used during frame creation
const Register Gtmp1 = G3_scratch ;
const Register Gtmp2 = G1_scratch;
- const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
+ const Register RconstMethod = Gtmp1;
+ const Address constMethod(G5_method, 0, in_bytes(Method::const_offset()));
+ const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
bool inc_counter = UseCompiler || CountCompiledCalls;
@@ -618,6 +620,7 @@
}
#endif // ASSERT
+ __ ld_ptr(constMethod, RconstMethod);
__ lduh(size_of_parameters, Gtmp1);
__ sll(Gtmp1, LogBytesPerWord, Gtmp2); // parameter size in bytes
__ add(Gargs, Gtmp2, Gargs); // points to first local + BytesPerWord
@@ -1047,8 +1050,6 @@
const Register Gtmp = G3_scratch;
const Address constMethod (G5_method, 0, in_bytes(Method::const_offset()));
const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset()));
- const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
- const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset()));
// slop factor is two extra slots on the expression stack so that
// we always have room to store a result when returning from a call without parameters
@@ -1066,6 +1067,9 @@
// Now compute new frame size
if (native) {
+ const Register RconstMethod = Gtmp;
+ const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
+ __ ld_ptr(constMethod, RconstMethod);
__ lduh( size_of_parameters, Gtmp );
__ calc_mem_param_words(Gtmp, Gtmp); // space for native call parameters passed on the stack in words
} else {
@@ -1236,9 +1240,13 @@
}
if (init_value != noreg) {
Label clear_loop;
+ const Register RconstMethod = O1;
+ const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
+ const Address size_of_locals (RconstMethod, 0, in_bytes(ConstMethod::size_of_locals_offset()));
// NOTE: If you change the frame layout, this code will need to
// be updated!
+ __ ld_ptr( constMethod, RconstMethod );
__ lduh( size_of_locals, O2 );
__ lduh( size_of_parameters, O1 );
__ sll( O2, LogBytesPerWord, O2);
@@ -1483,13 +1491,16 @@
//
// assert_different_registers(state, prev_state);
const Register Gtmp = G3_scratch;
+ const RconstMethod = G3_scratch;
const Register tmp = O2;
- const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
- const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset()));
+ const Address constMethod(G5_method, 0, in_bytes(Method::const_offset()));
+ const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
+ const Address size_of_locals (RconstMethod, 0, in_bytes(ConstMethod::size_of_locals_offset()));
+ __ ld_ptr(constMethod, RconstMethod);
__ lduh(size_of_parameters, tmp);
- __ sll(tmp, LogBytesPerWord, Gtmp); // parameter size in bytes
- __ add(args, Gtmp, Gargs); // points to first local + BytesPerWord
+ __ sll(tmp, LogBytesPerWord, Gargs); // parameter size in bytes
+ __ add(args, Gargs, Gargs); // points to first local + BytesPerWord
// NEW
__ add(Gargs, -wordSize, Gargs); // points to first local[0]
// determine extra space for non-argument locals & adjust caller's SP
@@ -1541,8 +1552,6 @@
const Address constMethod (G5_method, 0, in_bytes(Method::const_offset()));
const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset()));
- const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
- const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset()));
address entry_point = __ pc();
__ mov(G0, prevState); // no current activation
@@ -1750,7 +1759,9 @@
__ ld_ptr(STATE(_result._to_call._callee), L4_scratch); // called method
__ ld_ptr(STATE(_stack), L1_scratch); // get top of java expr stack
- __ lduh(L4_scratch, in_bytes(Method::size_of_parameters_offset()), L2_scratch); // get parameter size
+ // get parameter size
+ __ ld_ptr(L4_scratch, in_bytes(Method::const_offset()), L2_scratch);
+ __ lduh(L2_scratch, in_bytes(ConstMethod::size_of_parameters_offset()), L2_scratch);
__ sll(L2_scratch, LogBytesPerWord, L2_scratch ); // parameter size in bytes
__ add(L1_scratch, L2_scratch, L1_scratch); // stack destination for result
__ ld(L4_scratch, in_bytes(Method::result_index_offset()), L3_scratch); // called method result type index
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -100,34 +100,6 @@
bool AbstractAssembler::pd_check_instruction_mark() { return false; }
#endif
-
-void MacroAssembler::print_instruction(int inst) {
- const char* s;
- switch (inv_op(inst)) {
- default: s = "????"; break;
- case call_op: s = "call"; break;
- case branch_op:
- switch (inv_op2(inst)) {
- case fb_op2: s = "fb"; break;
- case fbp_op2: s = "fbp"; break;
- case br_op2: s = "br"; break;
- case bp_op2: s = "bp"; break;
- case cb_op2: s = "cb"; break;
- case bpr_op2: {
- if (is_cbcond(inst)) {
- s = is_cxb(inst) ? "cxb" : "cwb";
- } else {
- s = "bpr";
- }
- break;
- }
- default: s = "????"; break;
- }
- }
- ::tty->print("%s", s);
-}
-
-
// Patch instruction inst at offset inst_pos to refer to dest_pos
// and return the resulting instruction.
// We should have pcs, not offsets, but since all is relative, it will work out
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -603,7 +603,6 @@
friend class Label;
protected:
- static void print_instruction(int inst);
static int patched_branch(int dest_pos, int inst, int inst_pos);
static int branch_destination(int inst, int pos);
@@ -759,9 +758,6 @@
// Required platform-specific helpers for Label::patch_instructions.
// They _shadow_ the declarations in AbstractAssembler, which are undefined.
void pd_patch_instruction(address branch, address target);
-#ifndef PRODUCT
- static void pd_print_patched_instruction(address branch);
-#endif
// sethi Macro handles optimizations and relocations
private:
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -43,14 +43,6 @@
stub_inst = patched_branch(target - branch, stub_inst, 0);
}
-#ifndef PRODUCT
-inline void MacroAssembler::pd_print_patched_instruction(address branch) {
- jint stub_inst = *(jint*) branch;
- print_instruction(stub_inst);
- ::tty->print("%s", " (unresolved)");
-}
-#endif // PRODUCT
-
// Use the right loads/stores for the platform
inline void MacroAssembler::ld_ptr( Register s1, Register s2, Register d ) {
#ifdef _LP64
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -171,7 +171,8 @@
if (VerifyMethodHandles && !for_compiler_entry) {
// make sure recv is already on stack
- __ load_sized_value(Address(method_temp, Method::size_of_parameters_offset()),
+ __ ld_ptr(method_temp, in_bytes(Method::const_offset()), temp2);
+ __ load_sized_value(Address(temp2, ConstMethod::size_of_parameters_offset()),
temp2,
sizeof(u2), /*is_signed*/ false);
// assert(sizeof(u2) == sizeof(Method::_size_of_parameters), "");
@@ -233,7 +234,8 @@
int ref_kind = signature_polymorphic_intrinsic_ref_kind(iid);
assert(ref_kind != 0 || iid == vmIntrinsics::_invokeBasic, "must be _invokeBasic or a linkTo intrinsic");
if (ref_kind == 0 || MethodHandles::ref_kind_has_receiver(ref_kind)) {
- __ load_sized_value(Address(G5_method, Method::size_of_parameters_offset()),
+ __ ld_ptr(G5_method, in_bytes(Method::const_offset()), O4_param_size);
+ __ load_sized_value(Address(O4_param_size, ConstMethod::size_of_parameters_offset()),
O4_param_size,
sizeof(u2), /*is_signed*/ false);
// assert(sizeof(u2) == sizeof(Method::_size_of_parameters), "");
--- a/hotspot/src/cpu/sparc/vm/sparc.ad Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad Tue Jan 01 17:49:22 2013 -0800
@@ -10224,7 +10224,7 @@
//---------- Zeros Count Instructions ------------------------------------------
-instruct countLeadingZerosI(iRegI dst, iRegI src, iRegI tmp, flagsReg cr) %{
+instruct countLeadingZerosI(iRegIsafe dst, iRegI src, iRegI tmp, flagsReg cr) %{
predicate(UsePopCountInstruction); // See Matcher::match_rule_supported
match(Set dst (CountLeadingZerosI src));
effect(TEMP dst, TEMP tmp, KILL cr);
@@ -10321,7 +10321,7 @@
ins_pipe(ialu_reg);
%}
-instruct countTrailingZerosI(iRegI dst, iRegI src, flagsReg cr) %{
+instruct countTrailingZerosI(iRegIsafe dst, iRegI src, flagsReg cr) %{
predicate(UsePopCountInstruction); // See Matcher::match_rule_supported
match(Set dst (CountTrailingZerosI src));
effect(TEMP dst, KILL cr);
@@ -10364,19 +10364,21 @@
//---------- Population Count Instructions -------------------------------------
-instruct popCountI(iRegI dst, iRegI src) %{
+instruct popCountI(iRegIsafe dst, iRegI src) %{
predicate(UsePopCountInstruction);
match(Set dst (PopCountI src));
- format %{ "POPC $src, $dst" %}
- ins_encode %{
- __ popc($src$$Register, $dst$$Register);
+ format %{ "SRL $src, G0, $dst\t! clear upper word for 64 bit POPC\n\t"
+ "POPC $dst, $dst" %}
+ ins_encode %{
+ __ srl($src$$Register, G0, $dst$$Register);
+ __ popc($dst$$Register, $dst$$Register);
%}
ins_pipe(ialu_reg);
%}
// Note: Long.bitCount(long) returns an int.
-instruct popCountL(iRegI dst, iRegL src) %{
+instruct popCountL(iRegIsafe dst, iRegL src) %{
predicate(UsePopCountInstruction);
match(Set dst (PopCountL src));
--- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -434,7 +434,7 @@
// the frame is greater than one page in size, so check against
// the bottom of the stack
- __ cmp_and_brx_short(SP, Rscratch, Assembler::greater, Assembler::pt, after_frame_check);
+ __ cmp_and_brx_short(SP, Rscratch, Assembler::greaterUnsigned, Assembler::pt, after_frame_check);
// the stack will overflow, throw an exception
@@ -494,9 +494,6 @@
// (gri - 2/25/2000)
- const Address size_of_parameters(G5_method, Method::size_of_parameters_offset());
- const Address size_of_locals (G5_method, Method::size_of_locals_offset());
- const Address constMethod (G5_method, Method::const_offset());
int rounded_vm_local_words = round_to( frame::interpreter_frame_vm_local_words, WordsPerLong );
const int extra_space =
@@ -506,11 +503,15 @@
(native_call ? frame::interpreter_frame_extra_outgoing_argument_words : 0);
const Register Glocals_size = G3;
+ const Register RconstMethod = Glocals_size;
const Register Otmp1 = O3;
const Register Otmp2 = O4;
// Lscratch can't be used as a temporary because the call_stub uses
// it to assert that the stack frame was setup correctly.
+ const Address constMethod (G5_method, Method::const_offset());
+ const Address size_of_parameters(RconstMethod, ConstMethod::size_of_parameters_offset());
+ __ ld_ptr( constMethod, RconstMethod );
__ lduh( size_of_parameters, Glocals_size);
// Gargs points to first local + BytesPerWord
@@ -530,6 +531,8 @@
//
// Compute number of locals in method apart from incoming parameters
//
+ const Address size_of_locals (Otmp1, ConstMethod::size_of_locals_offset());
+ __ ld_ptr( constMethod, Otmp1 );
__ lduh( size_of_locals, Otmp1 );
__ sub( Otmp1, Glocals_size, Glocals_size );
__ round_to( Glocals_size, WordsPerLong );
@@ -1256,8 +1259,7 @@
// make sure registers are different!
assert_different_registers(G2_thread, G5_method, Gargs, Gtmp1, Gtmp2);
- const Address size_of_parameters(G5_method, Method::size_of_parameters_offset());
- const Address size_of_locals (G5_method, Method::size_of_locals_offset());
+ const Address constMethod (G5_method, Method::const_offset());
// Seems like G5_method is live at the point this is used. So we could make this look consistent
// and use in the asserts.
const Address access_flags (Lmethod, Method::access_flags_offset());
@@ -1307,8 +1309,13 @@
init_value = G0;
Label clear_loop;
+ const Register RconstMethod = O1;
+ const Address size_of_parameters(RconstMethod, ConstMethod::size_of_parameters_offset());
+ const Address size_of_locals (RconstMethod, ConstMethod::size_of_locals_offset());
+
// NOTE: If you change the frame layout, this code will need to
// be updated!
+ __ ld_ptr( constMethod, RconstMethod );
__ lduh( size_of_locals, O2 );
__ lduh( size_of_parameters, O1 );
__ sll( O2, Interpreter::logStackElementSize, O2);
@@ -1823,9 +1830,13 @@
const Register Gtmp1 = G3_scratch;
const Register Gtmp2 = G1_scratch;
+ const Register RconstMethod = Gtmp1;
+ const Address constMethod(Lmethod, Method::const_offset());
+ const Address size_of_parameters(RconstMethod, ConstMethod::size_of_parameters_offset());
// Compute size of arguments for saving when returning to deoptimized caller
- __ lduh(Lmethod, in_bytes(Method::size_of_parameters_offset()), Gtmp1);
+ __ ld_ptr(constMethod, RconstMethod);
+ __ lduh(size_of_parameters, Gtmp1);
__ sll(Gtmp1, Interpreter::logStackElementSize, Gtmp1);
__ sub(Llocals, Gtmp1, Gtmp2);
__ add(Gtmp2, wordSize, Gtmp2);
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -3040,7 +3040,8 @@
Register Rtemp = G4_scratch;
// Load receiver from stack slot
- __ lduh(G5_method, in_bytes(Method::size_of_parameters_offset()), G4_scratch);
+ __ ld_ptr(G5_method, in_bytes(Method::const_offset()), G4_scratch);
+ __ lduh(G4_scratch, in_bytes(ConstMethod::size_of_parameters_offset()), G4_scratch);
__ load_receiver(G4_scratch, O0);
// receiver NULL check
--- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -226,9 +226,9 @@
assert(isByte(op1) && isByte(op2), "wrong opcode");
assert(isByte(imm8), "not a byte");
assert((op1 & 0x01) == 0, "should be 8bit operation");
- emit_byte(op1);
- emit_byte(op2 | encode(dst));
- emit_byte(imm8);
+ emit_int8(op1);
+ emit_int8(op2 | encode(dst));
+ emit_int8(imm8);
}
@@ -237,12 +237,12 @@
assert((op1 & 0x01) == 1, "should be 32bit operation");
assert((op1 & 0x02) == 0, "sign-extension bit should not be set");
if (is8bit(imm32)) {
- emit_byte(op1 | 0x02); // set sign bit
- emit_byte(op2 | encode(dst));
- emit_byte(imm32 & 0xFF);
+ emit_int8(op1 | 0x02); // set sign bit
+ emit_int8(op2 | encode(dst));
+ emit_int8(imm32 & 0xFF);
} else {
- emit_byte(op1);
- emit_byte(op2 | encode(dst));
+ emit_int8(op1);
+ emit_int8(op2 | encode(dst));
emit_long(imm32);
}
}
@@ -252,8 +252,8 @@
assert(isByte(op1) && isByte(op2), "wrong opcode");
assert((op1 & 0x01) == 1, "should be 32bit operation");
assert((op1 & 0x02) == 0, "sign-extension bit should not be set");
- emit_byte(op1);
- emit_byte(op2 | encode(dst));
+ emit_int8(op1);
+ emit_int8(op2 | encode(dst));
emit_long(imm32);
}
@@ -262,11 +262,11 @@
assert((op1 & 0x01) == 1, "should be 32bit operation");
assert((op1 & 0x02) == 0, "sign-extension bit should not be set");
if (is8bit(imm32)) {
- emit_byte(op1 | 0x02); // set sign bit
+ emit_int8(op1 | 0x02); // set sign bit
emit_operand(rm, adr, 1);
- emit_byte(imm32 & 0xFF);
+ emit_int8(imm32 & 0xFF);
} else {
- emit_byte(op1);
+ emit_int8(op1);
emit_operand(rm, adr, 4);
emit_long(imm32);
}
@@ -275,8 +275,8 @@
void Assembler::emit_arith(int op1, int op2, Register dst, Register src) {
assert(isByte(op1) && isByte(op2), "wrong opcode");
- emit_byte(op1);
- emit_byte(op2 | encode(dst) << 3 | encode(src));
+ emit_int8(op1);
+ emit_int8(op2 | encode(dst) << 3 | encode(src));
}
@@ -301,21 +301,21 @@
// [base + index*scale]
// [00 reg 100][ss index base]
assert(index != rsp, "illegal addressing mode");
- emit_byte(0x04 | regenc);
- emit_byte(scale << 6 | indexenc | baseenc);
+ emit_int8(0x04 | regenc);
+ emit_int8(scale << 6 | indexenc | baseenc);
} else if (is8bit(disp) && rtype == relocInfo::none) {
// [base + index*scale + imm8]
// [01 reg 100][ss index base] imm8
assert(index != rsp, "illegal addressing mode");
- emit_byte(0x44 | regenc);
- emit_byte(scale << 6 | indexenc | baseenc);
- emit_byte(disp & 0xFF);
+ emit_int8(0x44 | regenc);
+ emit_int8(scale << 6 | indexenc | baseenc);
+ emit_int8(disp & 0xFF);
} else {
// [base + index*scale + disp32]
// [10 reg 100][ss index base] disp32
assert(index != rsp, "illegal addressing mode");
- emit_byte(0x84 | regenc);
- emit_byte(scale << 6 | indexenc | baseenc);
+ emit_int8(0x84 | regenc);
+ emit_int8(scale << 6 | indexenc | baseenc);
emit_data(disp, rspec, disp32_operand);
}
} else if (base == rsp LP64_ONLY(|| base == r12)) {
@@ -323,19 +323,19 @@
if (disp == 0 && rtype == relocInfo::none) {
// [rsp]
// [00 reg 100][00 100 100]
- emit_byte(0x04 | regenc);
- emit_byte(0x24);
+ emit_int8(0x04 | regenc);
+ emit_int8(0x24);
} else if (is8bit(disp) && rtype == relocInfo::none) {
// [rsp + imm8]
// [01 reg 100][00 100 100] disp8
- emit_byte(0x44 | regenc);
- emit_byte(0x24);
- emit_byte(disp & 0xFF);
+ emit_int8(0x44 | regenc);
+ emit_int8(0x24);
+ emit_int8(disp & 0xFF);
} else {
// [rsp + imm32]
// [10 reg 100][00 100 100] disp32
- emit_byte(0x84 | regenc);
- emit_byte(0x24);
+ emit_int8(0x84 | regenc);
+ emit_int8(0x24);
emit_data(disp, rspec, disp32_operand);
}
} else {
@@ -345,16 +345,16 @@
base != rbp LP64_ONLY(&& base != r13)) {
// [base]
// [00 reg base]
- emit_byte(0x00 | regenc | baseenc);
+ emit_int8(0x00 | regenc | baseenc);
} else if (is8bit(disp) && rtype == relocInfo::none) {
// [base + disp8]
// [01 reg base] disp8
- emit_byte(0x40 | regenc | baseenc);
- emit_byte(disp & 0xFF);
+ emit_int8(0x40 | regenc | baseenc);
+ emit_int8(disp & 0xFF);
} else {
// [base + disp32]
// [10 reg base] disp32
- emit_byte(0x80 | regenc | baseenc);
+ emit_int8(0x80 | regenc | baseenc);
emit_data(disp, rspec, disp32_operand);
}
}
@@ -364,14 +364,14 @@
// [index*scale + disp]
// [00 reg 100][ss index 101] disp32
assert(index != rsp, "illegal addressing mode");
- emit_byte(0x04 | regenc);
- emit_byte(scale << 6 | indexenc | 0x05);
+ emit_int8(0x04 | regenc);
+ emit_int8(scale << 6 | indexenc | 0x05);
emit_data(disp, rspec, disp32_operand);
} else if (rtype != relocInfo::none ) {
// [disp] (64bit) RIP-RELATIVE (32bit) abs
// [00 000 101] disp32
- emit_byte(0x05 | regenc);
+ emit_int8(0x05 | regenc);
// Note that the RIP-rel. correction applies to the generated
// disp field, but _not_ to the target address in the rspec.
@@ -391,8 +391,8 @@
// 32bit never did this, did everything as the rip-rel/disp code above
// [disp] ABSOLUTE
// [00 reg 100][00 100 101] disp32
- emit_byte(0x04 | regenc);
- emit_byte(0x25);
+ emit_int8(0x04 | regenc);
+ emit_int8(0x25);
emit_data(disp, rspec, disp32_operand);
}
}
@@ -883,8 +883,8 @@
void Assembler::emit_farith(int b1, int b2, int i) {
assert(isByte(b1) && isByte(b2), "wrong opcode");
assert(0 <= i && i < 8, "illegal stack offset");
- emit_byte(b1);
- emit_byte(b2 + i);
+ emit_int8(b1);
+ emit_int8(b2 + i);
}
@@ -899,7 +899,7 @@
void Assembler::adcl(Address dst, Register src) {
InstructionMark im(this);
prefix(dst, src);
- emit_byte(0x11);
+ emit_int8(0x11);
emit_operand(src, dst);
}
@@ -911,7 +911,7 @@
void Assembler::adcl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x13);
+ emit_int8(0x13);
emit_operand(dst, src);
}
@@ -929,7 +929,7 @@
void Assembler::addl(Address dst, Register src) {
InstructionMark im(this);
prefix(dst, src);
- emit_byte(0x01);
+ emit_int8(0x01);
emit_operand(src, dst);
}
@@ -941,7 +941,7 @@
void Assembler::addl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x03);
+ emit_int8(0x03);
emit_operand(dst, src);
}
@@ -953,38 +953,40 @@
void Assembler::addr_nop_4() {
assert(UseAddressNop, "no CPU support");
// 4 bytes: NOP DWORD PTR [EAX+0]
- emit_byte(0x0F);
- emit_byte(0x1F);
- emit_byte(0x40); // emit_rm(cbuf, 0x1, EAX_enc, EAX_enc);
- emit_byte(0); // 8-bits offset (1 byte)
+ emit_int8(0x0F);
+ emit_int8(0x1F);
+ emit_int8(0x40); // emit_rm(cbuf, 0x1, EAX_enc, EAX_enc);
+ emit_int8(0); // 8-bits offset (1 byte)
}
void Assembler::addr_nop_5() {
assert(UseAddressNop, "no CPU support");
// 5 bytes: NOP DWORD PTR [EAX+EAX*0+0] 8-bits offset
- emit_byte(0x0F);
- emit_byte(0x1F);
- emit_byte(0x44); // emit_rm(cbuf, 0x1, EAX_enc, 0x4);
- emit_byte(0x00); // emit_rm(cbuf, 0x0, EAX_enc, EAX_enc);
- emit_byte(0); // 8-bits offset (1 byte)
+ emit_int8(0x0F);
+ emit_int8(0x1F);
+ emit_int8(0x44); // emit_rm(cbuf, 0x1, EAX_enc, 0x4);
+ emit_int8(0x00); // emit_rm(cbuf, 0x0, EAX_enc, EAX_enc);
+ emit_int8(0); // 8-bits offset (1 byte)
}
void Assembler::addr_nop_7() {
assert(UseAddressNop, "no CPU support");
// 7 bytes: NOP DWORD PTR [EAX+0] 32-bits offset
- emit_byte(0x0F);
- emit_byte(0x1F);
- emit_byte(0x80); // emit_rm(cbuf, 0x2, EAX_enc, EAX_enc);
+ emit_int8(0x0F);
+ emit_int8(0x1F);
+ emit_int8((unsigned char)0x80);
+ // emit_rm(cbuf, 0x2, EAX_enc, EAX_enc);
emit_long(0); // 32-bits offset (4 bytes)
}
void Assembler::addr_nop_8() {
assert(UseAddressNop, "no CPU support");
// 8 bytes: NOP DWORD PTR [EAX+EAX*0+0] 32-bits offset
- emit_byte(0x0F);
- emit_byte(0x1F);
- emit_byte(0x84); // emit_rm(cbuf, 0x2, EAX_enc, 0x4);
- emit_byte(0x00); // emit_rm(cbuf, 0x0, EAX_enc, EAX_enc);
+ emit_int8(0x0F);
+ emit_int8(0x1F);
+ emit_int8((unsigned char)0x84);
+ // emit_rm(cbuf, 0x2, EAX_enc, 0x4);
+ emit_int8(0x00); // emit_rm(cbuf, 0x0, EAX_enc, EAX_enc);
emit_long(0); // 32-bits offset (4 bytes)
}
@@ -1012,67 +1014,67 @@
assert(VM_Version::supports_aes(), "");
InstructionMark im(this);
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xde);
+ emit_int8((unsigned char)0xDE);
emit_operand(dst, src);
}
void Assembler::aesdec(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_aes(), "");
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xde);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xDE);
+ emit_int8(0xC0 | encode);
}
void Assembler::aesdeclast(XMMRegister dst, Address src) {
assert(VM_Version::supports_aes(), "");
InstructionMark im(this);
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xdf);
+ emit_int8((unsigned char)0xDF);
emit_operand(dst, src);
}
void Assembler::aesdeclast(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_aes(), "");
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xdf);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xDF);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::aesenc(XMMRegister dst, Address src) {
assert(VM_Version::supports_aes(), "");
InstructionMark im(this);
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xdc);
+ emit_int8((unsigned char)0xDC);
emit_operand(dst, src);
}
void Assembler::aesenc(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_aes(), "");
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xdc);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xDC);
+ emit_int8(0xC0 | encode);
}
void Assembler::aesenclast(XMMRegister dst, Address src) {
assert(VM_Version::supports_aes(), "");
InstructionMark im(this);
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xdd);
+ emit_int8((unsigned char)0xDD);
emit_operand(dst, src);
}
void Assembler::aesenclast(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_aes(), "");
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xdd);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xDD);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::andl(Address dst, int32_t imm32) {
InstructionMark im(this);
prefix(dst);
- emit_byte(0x81);
+ emit_int8((unsigned char)0x81);
emit_operand(rsp, dst, 4);
emit_long(imm32);
}
@@ -1085,7 +1087,7 @@
void Assembler::andl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x23);
+ emit_int8(0x23);
emit_operand(dst, src);
}
@@ -1096,23 +1098,23 @@
void Assembler::bsfl(Register dst, Register src) {
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBC);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBC);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::bsrl(Register dst, Register src) {
assert(!VM_Version::supports_lzcnt(), "encoding is treated as LZCNT");
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBD);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBD);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::bswapl(Register reg) { // bswap
int encode = prefix_and_encode(reg->encoding());
- emit_byte(0x0F);
- emit_byte(0xC8 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)(0xC8 | encode));
}
void Assembler::call(Label& L, relocInfo::relocType rtype) {
@@ -1125,36 +1127,36 @@
assert(offs <= 0, "assembler error");
InstructionMark im(this);
// 1110 1000 #32-bit disp
- emit_byte(0xE8);
+ emit_int8((unsigned char)0xE8);
emit_data(offs - long_size, rtype, operand);
} else {
InstructionMark im(this);
// 1110 1000 #32-bit disp
L.add_patch_at(code(), locator());
- emit_byte(0xE8);
+ emit_int8((unsigned char)0xE8);
emit_data(int(0), rtype, operand);
}
}
void Assembler::call(Register dst) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xFF);
- emit_byte(0xD0 | encode);
+ emit_int8((unsigned char)0xFF);
+ emit_int8((unsigned char)(0xD0 | encode));
}
void Assembler::call(Address adr) {
InstructionMark im(this);
prefix(adr);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rdx, adr);
}
void Assembler::call_literal(address entry, RelocationHolder const& rspec) {
assert(entry != NULL, "call most probably wrong");
InstructionMark im(this);
- emit_byte(0xE8);
+ emit_int8((unsigned char)0xE8);
intptr_t disp = entry - (pc() + sizeof(int32_t));
assert(is_simm32(disp), "must be 32bit offset (call2)");
// Technically, should use call32_operand, but this format is
@@ -1165,42 +1167,42 @@
}
void Assembler::cdql() {
- emit_byte(0x99);
+ emit_int8((unsigned char)0x99);
}
void Assembler::cld() {
- emit_byte(0xfc);
+ emit_int8((unsigned char)0xFC);
}
void Assembler::cmovl(Condition cc, Register dst, Register src) {
NOT_LP64(guarantee(VM_Version::supports_cmov(), "illegal instruction"));
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0x40 | cc);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8(0x40 | cc);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cmovl(Condition cc, Register dst, Address src) {
NOT_LP64(guarantee(VM_Version::supports_cmov(), "illegal instruction"));
prefix(src, dst);
- emit_byte(0x0F);
- emit_byte(0x40 | cc);
+ emit_int8(0x0F);
+ emit_int8(0x40 | cc);
emit_operand(dst, src);
}
void Assembler::cmpb(Address dst, int imm8) {
InstructionMark im(this);
prefix(dst);
- emit_byte(0x80);
+ emit_int8((unsigned char)0x80);
emit_operand(rdi, dst, 1);
- emit_byte(imm8);
+ emit_int8(imm8);
}
void Assembler::cmpl(Address dst, int32_t imm32) {
InstructionMark im(this);
prefix(dst);
- emit_byte(0x81);
+ emit_int8((unsigned char)0x81);
emit_operand(rdi, dst, 4);
emit_long(imm32);
}
@@ -1219,17 +1221,17 @@
void Assembler::cmpl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x3B);
+ emit_int8((unsigned char)0x3B);
emit_operand(dst, src);
}
void Assembler::cmpw(Address dst, int imm16) {
InstructionMark im(this);
assert(!dst.base_needs_rex() && !dst.index_needs_rex(), "no extended registers");
- emit_byte(0x66);
- emit_byte(0x81);
+ emit_int8(0x66);
+ emit_int8((unsigned char)0x81);
emit_operand(rdi, dst, 2);
- emit_word(imm16);
+ emit_int16(imm16);
}
// The 32-bit cmpxchg compares the value at adr with the contents of rax,
@@ -1238,8 +1240,8 @@
void Assembler::cmpxchgl(Register reg, Address adr) { // cmpxchg
InstructionMark im(this);
prefix(adr, reg);
- emit_byte(0x0F);
- emit_byte(0xB1);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB1);
emit_operand(reg, adr);
}
@@ -1266,8 +1268,8 @@
}
void Assembler::cpuid() {
- emit_byte(0x0F);
- emit_byte(0xA2);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xA2);
}
void Assembler::cvtdq2pd(XMMRegister dst, XMMRegister src) {
@@ -1293,8 +1295,8 @@
void Assembler::cvtsi2sdl(XMMRegister dst, Register src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2);
- emit_byte(0x2A);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2A);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cvtsi2sdl(XMMRegister dst, Address src) {
@@ -1305,8 +1307,8 @@
void Assembler::cvtsi2ssl(XMMRegister dst, Register src) {
NOT_LP64(assert(VM_Version::supports_sse(), ""));
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3);
- emit_byte(0x2A);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2A);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cvtsi2ssl(XMMRegister dst, Address src) {
@@ -1328,22 +1330,22 @@
void Assembler::cvttsd2sil(Register dst, XMMRegister src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
int encode = simd_prefix_and_encode(dst, src, VEX_SIMD_F2);
- emit_byte(0x2C);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2C);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cvttss2sil(Register dst, XMMRegister src) {
NOT_LP64(assert(VM_Version::supports_sse(), ""));
int encode = simd_prefix_and_encode(dst, src, VEX_SIMD_F3);
- emit_byte(0x2C);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2C);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::decl(Address dst) {
// Don't use it directly. Use MacroAssembler::decrement() instead.
InstructionMark im(this);
prefix(dst);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rcx, dst);
}
@@ -1369,43 +1371,43 @@
void Assembler::emms() {
NOT_LP64(assert(VM_Version::supports_mmx(), ""));
- emit_byte(0x0F);
- emit_byte(0x77);
+ emit_int8(0x0F);
+ emit_int8(0x77);
}
void Assembler::hlt() {
- emit_byte(0xF4);
+ emit_int8((unsigned char)0xF4);
}
void Assembler::idivl(Register src) {
int encode = prefix_and_encode(src->encoding());
- emit_byte(0xF7);
- emit_byte(0xF8 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xF8 | encode));
}
void Assembler::divl(Register src) { // Unsigned
int encode = prefix_and_encode(src->encoding());
- emit_byte(0xF7);
- emit_byte(0xF0 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xF0 | encode));
}
void Assembler::imull(Register dst, Register src) {
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xAF);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAF);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::imull(Register dst, Register src, int value) {
int encode = prefix_and_encode(dst->encoding(), src->encoding());
if (is8bit(value)) {
- emit_byte(0x6B);
- emit_byte(0xC0 | encode);
- emit_byte(value & 0xFF);
+ emit_int8(0x6B);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(value & 0xFF);
} else {
- emit_byte(0x69);
- emit_byte(0xC0 | encode);
+ emit_int8(0x69);
+ emit_int8((unsigned char)(0xC0 | encode));
emit_long(value);
}
}
@@ -1414,7 +1416,7 @@
// Don't use it directly. Use MacroAssembler::increment() instead.
InstructionMark im(this);
prefix(dst);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rax, dst);
}
@@ -1430,14 +1432,14 @@
intptr_t offs = (intptr_t)dst - (intptr_t)pc();
if (maybe_short && is8bit(offs - short_size)) {
// 0111 tttn #8-bit disp
- emit_byte(0x70 | cc);
- emit_byte((offs - short_size) & 0xFF);
+ emit_int8(0x70 | cc);
+ emit_int8((offs - short_size) & 0xFF);
} else {
// 0000 1111 1000 tttn #32-bit disp
assert(is_simm32(offs - long_size),
"must be 32bit offset (call4)");
- emit_byte(0x0F);
- emit_byte(0x80 | cc);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)(0x80 | cc));
emit_long(offs - long_size);
}
} else {
@@ -1446,8 +1448,8 @@
// Note: use jccb() if label to be bound is very close to get
// an 8-bit displacement
L.add_patch_at(code(), locator());
- emit_byte(0x0F);
- emit_byte(0x80 | cc);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)(0x80 | cc));
emit_long(0);
}
}
@@ -1466,20 +1468,20 @@
#endif
intptr_t offs = (intptr_t)entry - (intptr_t)pc();
// 0111 tttn #8-bit disp
- emit_byte(0x70 | cc);
- emit_byte((offs - short_size) & 0xFF);
+ emit_int8(0x70 | cc);
+ emit_int8((offs - short_size) & 0xFF);
} else {
InstructionMark im(this);
L.add_patch_at(code(), locator());
- emit_byte(0x70 | cc);
- emit_byte(0);
+ emit_int8(0x70 | cc);
+ emit_int8(0);
}
}
void Assembler::jmp(Address adr) {
InstructionMark im(this);
prefix(adr);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rsp, adr);
}
@@ -1492,10 +1494,10 @@
const int long_size = 5;
intptr_t offs = entry - pc();
if (maybe_short && is8bit(offs - short_size)) {
- emit_byte(0xEB);
- emit_byte((offs - short_size) & 0xFF);
+ emit_int8((unsigned char)0xEB);
+ emit_int8((offs - short_size) & 0xFF);
} else {
- emit_byte(0xE9);
+ emit_int8((unsigned char)0xE9);
emit_long(offs - long_size);
}
} else {
@@ -1505,20 +1507,20 @@
// force an 8-bit displacement.
InstructionMark im(this);
L.add_patch_at(code(), locator());
- emit_byte(0xE9);
+ emit_int8((unsigned char)0xE9);
emit_long(0);
}
}
void Assembler::jmp(Register entry) {
int encode = prefix_and_encode(entry->encoding());
- emit_byte(0xFF);
- emit_byte(0xE0 | encode);
+ emit_int8((unsigned char)0xFF);
+ emit_int8((unsigned char)(0xE0 | encode));
}
void Assembler::jmp_literal(address dest, RelocationHolder const& rspec) {
InstructionMark im(this);
- emit_byte(0xE9);
+ emit_int8((unsigned char)0xE9);
assert(dest != NULL, "must have a target");
intptr_t disp = dest - (pc() + sizeof(int32_t));
assert(is_simm32(disp), "must be 32bit offset (jmp)");
@@ -1539,13 +1541,13 @@
assert(is8bit(dist), "Dispacement too large for a short jmp");
#endif
intptr_t offs = entry - pc();
- emit_byte(0xEB);
- emit_byte((offs - short_size) & 0xFF);
+ emit_int8((unsigned char)0xEB);
+ emit_int8((offs - short_size) & 0xFF);
} else {
InstructionMark im(this);
L.add_patch_at(code(), locator());
- emit_byte(0xEB);
- emit_byte(0);
+ emit_int8((unsigned char)0xEB);
+ emit_int8(0);
}
}
@@ -1553,46 +1555,46 @@
NOT_LP64(assert(VM_Version::supports_sse(), ""));
InstructionMark im(this);
prefix(src);
- emit_byte(0x0F);
- emit_byte(0xAE);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAE);
emit_operand(as_Register(2), src);
}
void Assembler::leal(Register dst, Address src) {
InstructionMark im(this);
#ifdef _LP64
- emit_byte(0x67); // addr32
+ emit_int8(0x67); // addr32
prefix(src, dst);
#endif // LP64
- emit_byte(0x8D);
+ emit_int8((unsigned char)0x8D);
emit_operand(dst, src);
}
void Assembler::lfence() {
- emit_byte(0x0F);
- emit_byte(0xAE);
- emit_byte(0xE8);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAE);
+ emit_int8((unsigned char)0xE8);
}
void Assembler::lock() {
- emit_byte(0xF0);
+ emit_int8((unsigned char)0xF0);
}
void Assembler::lzcntl(Register dst, Register src) {
assert(VM_Version::supports_lzcnt(), "encoding is treated as BSR");
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBD);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBD);
+ emit_int8((unsigned char)(0xC0 | encode));
}
// Emit mfence instruction
void Assembler::mfence() {
NOT_LP64(assert(VM_Version::supports_sse2(), "unsupported");)
- emit_byte( 0x0F );
- emit_byte( 0xAE );
- emit_byte( 0xF0 );
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAE);
+ emit_int8((unsigned char)0xF0);
}
void Assembler::mov(Register dst, Register src) {
@@ -1612,15 +1614,15 @@
void Assembler::movlhps(XMMRegister dst, XMMRegister src) {
NOT_LP64(assert(VM_Version::supports_sse(), ""));
int encode = simd_prefix_and_encode(dst, src, src, VEX_SIMD_NONE);
- emit_byte(0x16);
- emit_byte(0xC0 | encode);
+ emit_int8(0x16);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movb(Register dst, Address src) {
NOT_LP64(assert(dst->has_byte_register(), "must have byte register"));
InstructionMark im(this);
prefix(src, dst, true);
- emit_byte(0x8A);
+ emit_int8((unsigned char)0x8A);
emit_operand(dst, src);
}
@@ -1628,9 +1630,9 @@
void Assembler::movb(Address dst, int imm8) {
InstructionMark im(this);
prefix(dst);
- emit_byte(0xC6);
+ emit_int8((unsigned char)0xC6);
emit_operand(rax, dst, 1);
- emit_byte(imm8);
+ emit_int8(imm8);
}
@@ -1638,30 +1640,30 @@
assert(src->has_byte_register(), "must have byte register");
InstructionMark im(this);
prefix(dst, src, true);
- emit_byte(0x88);
+ emit_int8((unsigned char)0x88);
emit_operand(src, dst);
}
void Assembler::movdl(XMMRegister dst, Register src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
int encode = simd_prefix_and_encode(dst, src, VEX_SIMD_66);
- emit_byte(0x6E);
- emit_byte(0xC0 | encode);
+ emit_int8(0x6E);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movdl(Register dst, XMMRegister src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// swap src/dst to get correct prefix
int encode = simd_prefix_and_encode(src, dst, VEX_SIMD_66);
- emit_byte(0x7E);
- emit_byte(0xC0 | encode);
+ emit_int8(0x7E);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movdl(XMMRegister dst, Address src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_66);
- emit_byte(0x6E);
+ emit_int8(0x6E);
emit_operand(dst, src);
}
@@ -1669,7 +1671,7 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_66);
- emit_byte(0x7E);
+ emit_int8(0x7E);
emit_operand(src, dst);
}
@@ -1692,7 +1694,7 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_F3);
- emit_byte(0x7F);
+ emit_int8(0x7F);
emit_operand(src, dst);
}
@@ -1701,8 +1703,8 @@
assert(UseAVX, "");
bool vector256 = true;
int encode = vex_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F3, vector256);
- emit_byte(0x6F);
- emit_byte(0xC0 | encode);
+ emit_int8(0x6F);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::vmovdqu(XMMRegister dst, Address src) {
@@ -1710,7 +1712,7 @@
InstructionMark im(this);
bool vector256 = true;
vex_prefix(dst, xnoreg, src, VEX_SIMD_F3, vector256);
- emit_byte(0x6F);
+ emit_int8(0x6F);
emit_operand(dst, src);
}
@@ -1721,7 +1723,7 @@
// swap src<->dst for encoding
assert(src != xnoreg, "sanity");
vex_prefix(src, xnoreg, dst, VEX_SIMD_F3, vector256);
- emit_byte(0x7F);
+ emit_int8(0x7F);
emit_operand(src, dst);
}
@@ -1729,27 +1731,27 @@
void Assembler::movl(Register dst, int32_t imm32) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xB8 | encode);
+ emit_int8((unsigned char)(0xB8 | encode));
emit_long(imm32);
}
void Assembler::movl(Register dst, Register src) {
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x8B);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0x8B);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x8B);
+ emit_int8((unsigned char)0x8B);
emit_operand(dst, src);
}
void Assembler::movl(Address dst, int32_t imm32) {
InstructionMark im(this);
prefix(dst);
- emit_byte(0xC7);
+ emit_int8((unsigned char)0xC7);
emit_operand(rax, dst, 4);
emit_long(imm32);
}
@@ -1757,7 +1759,7 @@
void Assembler::movl(Address dst, Register src) {
InstructionMark im(this);
prefix(dst, src);
- emit_byte(0x89);
+ emit_int8((unsigned char)0x89);
emit_operand(src, dst);
}
@@ -1771,15 +1773,15 @@
void Assembler::movq( MMXRegister dst, Address src ) {
assert( VM_Version::supports_mmx(), "" );
- emit_byte(0x0F);
- emit_byte(0x6F);
+ emit_int8(0x0F);
+ emit_int8(0x6F);
emit_operand(dst, src);
}
void Assembler::movq( Address dst, MMXRegister src ) {
assert( VM_Version::supports_mmx(), "" );
- emit_byte(0x0F);
- emit_byte(0x7F);
+ emit_int8(0x0F);
+ emit_int8(0x7F);
// workaround gcc (3.2.1-7a) bug
// In that version of gcc with only an emit_operand(MMX, Address)
// gcc will tail jump and try and reverse the parameters completely
@@ -1793,7 +1795,7 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_F3);
- emit_byte(0x7E);
+ emit_int8(0x7E);
emit_operand(dst, src);
}
@@ -1801,24 +1803,24 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_66);
- emit_byte(0xD6);
+ emit_int8((unsigned char)0xD6);
emit_operand(src, dst);
}
void Assembler::movsbl(Register dst, Address src) { // movsxb
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x0F);
- emit_byte(0xBE);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBE);
emit_operand(dst, src);
}
void Assembler::movsbl(Register dst, Register src) { // movsxb
NOT_LP64(assert(src->has_byte_register(), "must have byte register"));
int encode = prefix_and_encode(dst->encoding(), src->encoding(), true);
- emit_byte(0x0F);
- emit_byte(0xBE);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBE);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movsd(XMMRegister dst, XMMRegister src) {
@@ -1835,7 +1837,7 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_F2);
- emit_byte(0x11);
+ emit_int8(0x11);
emit_operand(src, dst);
}
@@ -1853,93 +1855,93 @@
NOT_LP64(assert(VM_Version::supports_sse(), ""));
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_F3);
- emit_byte(0x11);
+ emit_int8(0x11);
emit_operand(src, dst);
}
void Assembler::movswl(Register dst, Address src) { // movsxw
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x0F);
- emit_byte(0xBF);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBF);
emit_operand(dst, src);
}
void Assembler::movswl(Register dst, Register src) { // movsxw
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBF);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBF);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movw(Address dst, int imm16) {
InstructionMark im(this);
- emit_byte(0x66); // switch to 16-bit mode
+ emit_int8(0x66); // switch to 16-bit mode
prefix(dst);
- emit_byte(0xC7);
+ emit_int8((unsigned char)0xC7);
emit_operand(rax, dst, 2);
- emit_word(imm16);
+ emit_int16(imm16);
}
void Assembler::movw(Register dst, Address src) {
InstructionMark im(this);
- emit_byte(0x66);
+ emit_int8(0x66);
prefix(src, dst);
- emit_byte(0x8B);
+ emit_int8((unsigned char)0x8B);
emit_operand(dst, src);
}
void Assembler::movw(Address dst, Register src) {
InstructionMark im(this);
- emit_byte(0x66);
+ emit_int8(0x66);
prefix(dst, src);
- emit_byte(0x89);
+ emit_int8((unsigned char)0x89);
emit_operand(src, dst);
}
void Assembler::movzbl(Register dst, Address src) { // movzxb
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x0F);
- emit_byte(0xB6);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB6);
emit_operand(dst, src);
}
void Assembler::movzbl(Register dst, Register src) { // movzxb
NOT_LP64(assert(src->has_byte_register(), "must have byte register"));
int encode = prefix_and_encode(dst->encoding(), src->encoding(), true);
- emit_byte(0x0F);
- emit_byte(0xB6);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB6);
+ emit_int8(0xC0 | encode);
}
void Assembler::movzwl(Register dst, Address src) { // movzxw
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x0F);
- emit_byte(0xB7);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB7);
emit_operand(dst, src);
}
void Assembler::movzwl(Register dst, Register src) { // movzxw
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xB7);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB7);
+ emit_int8(0xC0 | encode);
}
void Assembler::mull(Address src) {
InstructionMark im(this);
prefix(src);
- emit_byte(0xF7);
+ emit_int8((unsigned char)0xF7);
emit_operand(rsp, src);
}
void Assembler::mull(Register src) {
int encode = prefix_and_encode(src->encoding());
- emit_byte(0xF7);
- emit_byte(0xE0 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xE0 | encode));
}
void Assembler::mulsd(XMMRegister dst, Address src) {
@@ -1964,8 +1966,8 @@
void Assembler::negl(Register dst) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xF7);
- emit_byte(0xD8 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xD8 | encode));
}
void Assembler::nop(int i) {
@@ -1976,7 +1978,7 @@
// speed is not an issue so simply use the single byte traditional nop
// to do alignment.
- for (; i > 0 ; i--) emit_byte(0x90);
+ for (; i > 0 ; i--) emit_int8((unsigned char)0x90);
return;
#endif // ASSERT
@@ -2006,33 +2008,35 @@
while(i >= 15) {
// For Intel don't generate consecutive addess nops (mix with regular nops)
i -= 15;
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
addr_nop_8();
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
- emit_byte(0x90); // nop
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8((unsigned char)0x90);
+ // nop
}
switch (i) {
case 14:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 13:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 12:
addr_nop_8();
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
- emit_byte(0x90); // nop
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8((unsigned char)0x90);
+ // nop
break;
case 11:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 10:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 9:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 8:
addr_nop_8();
break;
@@ -2040,7 +2044,7 @@
addr_nop_7();
break;
case 6:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 5:
addr_nop_5();
break;
@@ -2049,11 +2053,12 @@
break;
case 3:
// Don't use "0x0F 0x1F 0x00" - need patching safe padding
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 2:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 1:
- emit_byte(0x90); // nop
+ emit_int8((unsigned char)0x90);
+ // nop
break;
default:
assert(i == 0, " ");
@@ -2086,24 +2091,24 @@
while(i >= 22) {
i -= 11;
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
addr_nop_8();
}
// Generate first nop for size between 21-12
switch (i) {
case 21:
i -= 1;
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 20:
case 19:
i -= 1;
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 18:
case 17:
i -= 1;
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 16:
case 15:
i -= 8;
@@ -2116,7 +2121,7 @@
break;
case 12:
i -= 6;
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
addr_nop_5();
break;
default:
@@ -2126,11 +2131,11 @@
// Generate second nop for size between 11-1
switch (i) {
case 11:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 10:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 9:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 8:
addr_nop_8();
break;
@@ -2138,7 +2143,7 @@
addr_nop_7();
break;
case 6:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 5:
addr_nop_5();
break;
@@ -2147,11 +2152,12 @@
break;
case 3:
// Don't use "0x0F 0x1F 0x00" - need patching safe padding
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 2:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 1:
- emit_byte(0x90); // nop
+ emit_int8((unsigned char)0x90);
+ // nop
break;
default:
assert(i == 0, " ");
@@ -2174,42 +2180,43 @@
//
while(i > 12) {
i -= 4;
- emit_byte(0x66); // size prefix
- emit_byte(0x66);
- emit_byte(0x66);
- emit_byte(0x90); // nop
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66);
+ emit_int8(0x66);
+ emit_int8((unsigned char)0x90);
+ // nop
}
// 1 - 12 nops
if(i > 8) {
if(i > 9) {
i -= 1;
- emit_byte(0x66);
+ emit_int8(0x66);
}
i -= 3;
- emit_byte(0x66);
- emit_byte(0x66);
- emit_byte(0x90);
+ emit_int8(0x66);
+ emit_int8(0x66);
+ emit_int8((unsigned char)0x90);
}
// 1 - 8 nops
if(i > 4) {
if(i > 6) {
i -= 1;
- emit_byte(0x66);
+ emit_int8(0x66);
}
i -= 3;
- emit_byte(0x66);
- emit_byte(0x66);
- emit_byte(0x90);
+ emit_int8(0x66);
+ emit_int8(0x66);
+ emit_int8((unsigned char)0x90);
}
switch (i) {
case 4:
- emit_byte(0x66);
+ emit_int8(0x66);
case 3:
- emit_byte(0x66);
+ emit_int8(0x66);
case 2:
- emit_byte(0x66);
+ emit_int8(0x66);
case 1:
- emit_byte(0x90);
+ emit_int8((unsigned char)0x90);
break;
default:
assert(i == 0, " ");
@@ -2218,8 +2225,8 @@
void Assembler::notl(Register dst) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xF7);
- emit_byte(0xD0 | encode );
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xD0 | encode));
}
void Assembler::orl(Address dst, int32_t imm32) {
@@ -2236,7 +2243,7 @@
void Assembler::orl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x0B);
+ emit_int8(0x0B);
emit_operand(dst, src);
}
@@ -2260,61 +2267,61 @@
assert(VM_Version::supports_sse4_2(), "");
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A);
- emit_byte(0x61);
+ emit_int8(0x61);
emit_operand(dst, src);
- emit_byte(imm8);
+ emit_int8(imm8);
}
void Assembler::pcmpestri(XMMRegister dst, XMMRegister src, int imm8) {
assert(VM_Version::supports_sse4_2(), "");
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A);
- emit_byte(0x61);
- emit_byte(0xC0 | encode);
- emit_byte(imm8);
+ emit_int8(0x61);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(imm8);
}
void Assembler::pmovzxbw(XMMRegister dst, Address src) {
assert(VM_Version::supports_sse4_1(), "");
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0x30);
+ emit_int8(0x30);
emit_operand(dst, src);
}
void Assembler::pmovzxbw(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_sse4_1(), "");
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0x30);
- emit_byte(0xC0 | encode);
+ emit_int8(0x30);
+ emit_int8((unsigned char)(0xC0 | encode));
}
// generic
void Assembler::pop(Register dst) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0x58 | encode);
+ emit_int8(0x58 | encode);
}
void Assembler::popcntl(Register dst, Address src) {
assert(VM_Version::supports_popcnt(), "must support");
InstructionMark im(this);
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
prefix(src, dst);
- emit_byte(0x0F);
- emit_byte(0xB8);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB8);
emit_operand(dst, src);
}
void Assembler::popcntl(Register dst, Register src) {
assert(VM_Version::supports_popcnt(), "must support");
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xB8);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB8);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::popf() {
- emit_byte(0x9D);
+ emit_int8((unsigned char)0x9D);
}
#ifndef _LP64 // no 32bit push/pop on amd64
@@ -2322,21 +2329,21 @@
// NOTE: this will adjust stack by 8byte on 64bits
InstructionMark im(this);
prefix(dst);
- emit_byte(0x8F);
+ emit_int8((unsigned char)0x8F);
emit_operand(rax, dst);
}
#endif
void Assembler::prefetch_prefix(Address src) {
prefix(src);
- emit_byte(0x0F);
+ emit_int8(0x0F);
}
void Assembler::prefetchnta(Address src) {
NOT_LP64(assert(VM_Version::supports_sse(), "must support"));
InstructionMark im(this);
prefetch_prefix(src);
- emit_byte(0x18);
+ emit_int8(0x18);
emit_operand(rax, src); // 0, src
}
@@ -2344,7 +2351,7 @@
assert(VM_Version::supports_3dnow_prefetch(), "must support");
InstructionMark im(this);
prefetch_prefix(src);
- emit_byte(0x0D);
+ emit_int8(0x0D);
emit_operand(rax, src); // 0, src
}
@@ -2352,7 +2359,7 @@
NOT_LP64(assert(VM_Version::supports_sse(), "must support"));
InstructionMark im(this);
prefetch_prefix(src);
- emit_byte(0x18);
+ emit_int8(0x18);
emit_operand(rcx, src); // 1, src
}
@@ -2360,7 +2367,7 @@
NOT_LP64(assert(VM_Version::supports_sse(), "must support"));
InstructionMark im(this);
prefetch_prefix(src);
- emit_byte(0x18);
+ emit_int8(0x18);
emit_operand(rdx, src); // 2, src
}
@@ -2368,7 +2375,7 @@
NOT_LP64(assert(VM_Version::supports_sse(), "must support"));
InstructionMark im(this);
prefetch_prefix(src);
- emit_byte(0x18);
+ emit_int8(0x18);
emit_operand(rbx, src); // 3, src
}
@@ -2376,27 +2383,26 @@
assert(VM_Version::supports_3dnow_prefetch(), "must support");
InstructionMark im(this);
prefetch_prefix(src);
- emit_byte(0x0D);
+ emit_int8(0x0D);
emit_operand(rcx, src); // 1, src
}
void Assembler::prefix(Prefix p) {
- a_byte(p);
+ emit_int8(p);
}
void Assembler::pshufb(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_ssse3(), "");
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0x00);
- emit_byte(0xC0 | encode);
+ emit_int8(0x00);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::pshufb(XMMRegister dst, Address src) {
assert(VM_Version::supports_ssse3(), "");
- assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes");
InstructionMark im(this);
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0x00);
+ emit_int8(0x00);
emit_operand(dst, src);
}
@@ -2404,7 +2410,7 @@
assert(isByte(mode), "invalid value");
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
emit_simd_arith_nonds(0x70, dst, src, VEX_SIMD_66);
- emit_byte(mode & 0xFF);
+ emit_int8(mode & 0xFF);
}
@@ -2414,16 +2420,16 @@
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes");
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_66);
- emit_byte(0x70);
+ emit_int8(0x70);
emit_operand(dst, src);
- emit_byte(mode & 0xFF);
+ emit_int8(mode & 0xFF);
}
void Assembler::pshuflw(XMMRegister dst, XMMRegister src, int mode) {
assert(isByte(mode), "invalid value");
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
emit_simd_arith_nonds(0x70, dst, src, VEX_SIMD_F2);
- emit_byte(mode & 0xFF);
+ emit_int8(mode & 0xFF);
}
void Assembler::pshuflw(XMMRegister dst, Address src, int mode) {
@@ -2432,18 +2438,18 @@
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes");
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_F2);
- emit_byte(0x70);
+ emit_int8(0x70);
emit_operand(dst, src);
- emit_byte(mode & 0xFF);
+ emit_int8(mode & 0xFF);
}
void Assembler::psrldq(XMMRegister dst, int shift) {
// Shift 128 bit value in xmm register by number of bytes.
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
int encode = simd_prefix_and_encode(xmm3, dst, dst, VEX_SIMD_66);
- emit_byte(0x73);
- emit_byte(0xC0 | encode);
- emit_byte(shift);
+ emit_int8(0x73);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift);
}
void Assembler::ptest(XMMRegister dst, Address src) {
@@ -2451,15 +2457,15 @@
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes");
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0x17);
+ emit_int8(0x17);
emit_operand(dst, src);
}
void Assembler::ptest(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_sse4_1(), "");
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0x17);
- emit_byte(0xC0 | encode);
+ emit_int8(0x17);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::punpcklbw(XMMRegister dst, Address src) {
@@ -2492,18 +2498,18 @@
void Assembler::push(int32_t imm32) {
// in 64bits we push 64bits onto the stack but only
// take a 32bit immediate
- emit_byte(0x68);
+ emit_int8(0x68);
emit_long(imm32);
}
void Assembler::push(Register src) {
int encode = prefix_and_encode(src->encoding());
- emit_byte(0x50 | encode);
+ emit_int8(0x50 | encode);
}
void Assembler::pushf() {
- emit_byte(0x9C);
+ emit_int8((unsigned char)0x9C);
}
#ifndef _LP64 // no 32bit push/pop on amd64
@@ -2511,7 +2517,7 @@
// Note this will push 64bit on 64bit
InstructionMark im(this);
prefix(src);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rsi, src);
}
#endif
@@ -2520,58 +2526,58 @@
assert(isShiftCount(imm8), "illegal shift count");
int encode = prefix_and_encode(dst->encoding());
if (imm8 == 1) {
- emit_byte(0xD1);
- emit_byte(0xD0 | encode);
+ emit_int8((unsigned char)0xD1);
+ emit_int8((unsigned char)(0xD0 | encode));
} else {
- emit_byte(0xC1);
- emit_byte(0xD0 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)0xD0 | encode);
+ emit_int8(imm8);
}
}
// copies data from [esi] to [edi] using rcx pointer sized words
// generic
void Assembler::rep_mov() {
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
// MOVSQ
LP64_ONLY(prefix(REX_W));
- emit_byte(0xA5);
+ emit_int8((unsigned char)0xA5);
}
// sets rcx pointer sized words with rax, value at [edi]
// generic
void Assembler::rep_set() { // rep_set
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
// STOSQ
LP64_ONLY(prefix(REX_W));
- emit_byte(0xAB);
+ emit_int8((unsigned char)0xAB);
}
// scans rcx pointer sized words at [edi] for occurance of rax,
// generic
void Assembler::repne_scan() { // repne_scan
- emit_byte(0xF2);
+ emit_int8((unsigned char)0xF2);
// SCASQ
LP64_ONLY(prefix(REX_W));
- emit_byte(0xAF);
+ emit_int8((unsigned char)0xAF);
}
#ifdef _LP64
// scans rcx 4 byte words at [edi] for occurance of rax,
// generic
void Assembler::repne_scanl() { // repne_scan
- emit_byte(0xF2);
+ emit_int8((unsigned char)0xF2);
// SCASL
- emit_byte(0xAF);
+ emit_int8((unsigned char)0xAF);
}
#endif
void Assembler::ret(int imm16) {
if (imm16 == 0) {
- emit_byte(0xC3);
+ emit_int8((unsigned char)0xC3);
} else {
- emit_byte(0xC2);
- emit_word(imm16);
+ emit_int8((unsigned char)0xC2);
+ emit_int16(imm16);
}
}
@@ -2580,26 +2586,26 @@
// Not supported in 64bit mode
ShouldNotReachHere();
#endif
- emit_byte(0x9E);
+ emit_int8((unsigned char)0x9E);
}
void Assembler::sarl(Register dst, int imm8) {
int encode = prefix_and_encode(dst->encoding());
assert(isShiftCount(imm8), "illegal shift count");
if (imm8 == 1) {
- emit_byte(0xD1);
- emit_byte(0xF8 | encode);
+ emit_int8((unsigned char)0xD1);
+ emit_int8((unsigned char)(0xF8 | encode));
} else {
- emit_byte(0xC1);
- emit_byte(0xF8 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)(0xF8 | encode));
+ emit_int8(imm8);
}
}
void Assembler::sarl(Register dst) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xD3);
- emit_byte(0xF8 | encode);
+ emit_int8((unsigned char)0xD3);
+ emit_int8((unsigned char)(0xF8 | encode));
}
void Assembler::sbbl(Address dst, int32_t imm32) {
@@ -2617,7 +2623,7 @@
void Assembler::sbbl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x1B);
+ emit_int8(0x1B);
emit_operand(dst, src);
}
@@ -2629,47 +2635,47 @@
void Assembler::setb(Condition cc, Register dst) {
assert(0 <= cc && cc < 16, "illegal cc");
int encode = prefix_and_encode(dst->encoding(), true);
- emit_byte(0x0F);
- emit_byte(0x90 | cc);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0x90 | cc);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::shll(Register dst, int imm8) {
assert(isShiftCount(imm8), "illegal shift count");
int encode = prefix_and_encode(dst->encoding());
if (imm8 == 1 ) {
- emit_byte(0xD1);
- emit_byte(0xE0 | encode);
+ emit_int8((unsigned char)0xD1);
+ emit_int8((unsigned char)(0xE0 | encode));
} else {
- emit_byte(0xC1);
- emit_byte(0xE0 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)(0xE0 | encode));
+ emit_int8(imm8);
}
}
void Assembler::shll(Register dst) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xD3);
- emit_byte(0xE0 | encode);
+ emit_int8((unsigned char)0xD3);
+ emit_int8((unsigned char)(0xE0 | encode));
}
void Assembler::shrl(Register dst, int imm8) {
assert(isShiftCount(imm8), "illegal shift count");
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xC1);
- emit_byte(0xE8 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)(0xE8 | encode));
+ emit_int8(imm8);
}
void Assembler::shrl(Register dst) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xD3);
- emit_byte(0xE8 | encode);
+ emit_int8((unsigned char)0xD3);
+ emit_int8((unsigned char)(0xE8 | encode));
}
// copies a single word from [esi] to [edi]
void Assembler::smovl() {
- emit_byte(0xA5);
+ emit_int8((unsigned char)0xA5);
}
void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) {
@@ -2688,7 +2694,7 @@
}
void Assembler::std() {
- emit_byte(0xfd);
+ emit_int8((unsigned char)0xFD);
}
void Assembler::sqrtss(XMMRegister dst, Address src) {
@@ -2700,8 +2706,8 @@
NOT_LP64(assert(VM_Version::supports_sse(), ""));
InstructionMark im(this);
prefix(dst);
- emit_byte(0x0F);
- emit_byte(0xAE);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAE);
emit_operand(as_Register(3), dst);
}
@@ -2714,7 +2720,7 @@
void Assembler::subl(Address dst, Register src) {
InstructionMark im(this);
prefix(dst, src);
- emit_byte(0x29);
+ emit_int8(0x29);
emit_operand(src, dst);
}
@@ -2732,7 +2738,7 @@
void Assembler::subl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x2B);
+ emit_int8(0x2B);
emit_operand(dst, src);
}
@@ -2773,11 +2779,11 @@
// 8bit operands
int encode = dst->encoding();
if (encode == 0) {
- emit_byte(0xA9);
+ emit_int8((unsigned char)0xA9);
} else {
encode = prefix_and_encode(encode);
- emit_byte(0xF7);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xC0 | encode));
}
emit_long(imm32);
}
@@ -2790,7 +2796,7 @@
void Assembler::testl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x85);
+ emit_int8((unsigned char)0x85);
emit_operand(dst, src);
}
@@ -2818,28 +2824,28 @@
void Assembler::xaddl(Address dst, Register src) {
InstructionMark im(this);
prefix(dst, src);
- emit_byte(0x0F);
- emit_byte(0xC1);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xC1);
emit_operand(src, dst);
}
void Assembler::xchgl(Register dst, Address src) { // xchg
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x87);
+ emit_int8((unsigned char)0x87);
emit_operand(dst, src);
}
void Assembler::xchgl(Register dst, Register src) {
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x87);
- emit_byte(0xc0 | encode);
+ emit_int8((unsigned char)0x87);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::xgetbv() {
- emit_byte(0x0F);
- emit_byte(0x01);
- emit_byte(0xD0);
+ emit_int8(0x0F);
+ emit_int8(0x01);
+ emit_int8((unsigned char)0xD0);
}
void Assembler::xorl(Register dst, int32_t imm32) {
@@ -2850,7 +2856,7 @@
void Assembler::xorl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x33);
+ emit_int8(0x33);
emit_operand(dst, src);
}
@@ -3276,8 +3282,8 @@
void Assembler::pmulld(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_sse4_1(), "");
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0x40);
- emit_byte(0xC0 | encode);
+ emit_int8(0x40);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) {
@@ -3288,8 +3294,8 @@
void Assembler::vpmulld(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) {
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_38);
- emit_byte(0x40);
- emit_byte(0xC0 | encode);
+ emit_int8(0x40);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, Address src, bool vector256) {
@@ -3303,7 +3309,7 @@
int dst_enc = dst->encoding();
int nds_enc = nds->is_valid() ? nds->encoding() : 0;
vex_prefix(src, nds_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_38, false, vector256);
- emit_byte(0x40);
+ emit_int8(0x40);
emit_operand(dst, src);
}
@@ -3312,27 +3318,27 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM6 is for /6 encoding: 66 0F 71 /6 ib
int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66);
- emit_byte(0x71);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x71);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::pslld(XMMRegister dst, int shift) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM6 is for /6 encoding: 66 0F 72 /6 ib
int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66);
- emit_byte(0x72);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x72);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::psllq(XMMRegister dst, int shift) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM6 is for /6 encoding: 66 0F 73 /6 ib
int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66);
- emit_byte(0x73);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x73);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::psllw(XMMRegister dst, XMMRegister shift) {
@@ -3354,21 +3360,21 @@
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM6 is for /6 encoding: 66 0F 71 /6 ib
emit_vex_arith(0x71, xmm6, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpslld(XMMRegister dst, XMMRegister src, int shift, bool vector256) {
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM6 is for /6 encoding: 66 0F 72 /6 ib
emit_vex_arith(0x72, xmm6, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpsllq(XMMRegister dst, XMMRegister src, int shift, bool vector256) {
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM6 is for /6 encoding: 66 0F 73 /6 ib
emit_vex_arith(0x73, xmm6, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpsllw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) {
@@ -3391,18 +3397,18 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM2 is for /2 encoding: 66 0F 71 /2 ib
int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66);
- emit_byte(0x71);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x71);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::psrld(XMMRegister dst, int shift) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM2 is for /2 encoding: 66 0F 72 /2 ib
int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66);
- emit_byte(0x72);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x72);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::psrlq(XMMRegister dst, int shift) {
@@ -3411,9 +3417,9 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM2 is for /2 encoding: 66 0F 73 /2 ib
int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66);
- emit_byte(0x73);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x73);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::psrlw(XMMRegister dst, XMMRegister shift) {
@@ -3435,21 +3441,21 @@
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM2 is for /2 encoding: 66 0F 73 /2 ib
emit_vex_arith(0x71, xmm2, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpsrld(XMMRegister dst, XMMRegister src, int shift, bool vector256) {
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM2 is for /2 encoding: 66 0F 73 /2 ib
emit_vex_arith(0x72, xmm2, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, int shift, bool vector256) {
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM2 is for /2 encoding: 66 0F 73 /2 ib
emit_vex_arith(0x73, xmm2, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) {
@@ -3472,18 +3478,18 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM4 is for /4 encoding: 66 0F 71 /4 ib
int encode = simd_prefix_and_encode(xmm4, dst, dst, VEX_SIMD_66);
- emit_byte(0x71);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x71);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::psrad(XMMRegister dst, int shift) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM4 is for /4 encoding: 66 0F 72 /4 ib
int encode = simd_prefix_and_encode(xmm4, dst, dst, VEX_SIMD_66);
- emit_byte(0x72);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x72);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::psraw(XMMRegister dst, XMMRegister shift) {
@@ -3500,14 +3506,14 @@
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM4 is for /4 encoding: 66 0F 71 /4 ib
emit_vex_arith(0x71, xmm4, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpsrad(XMMRegister dst, XMMRegister src, int shift, bool vector256) {
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM4 is for /4 encoding: 66 0F 71 /4 ib
emit_vex_arith(0x72, xmm4, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpsraw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) {
@@ -3572,11 +3578,11 @@
assert(VM_Version::supports_avx(), "");
bool vector256 = true;
int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_3A);
- emit_byte(0x18);
- emit_byte(0xC0 | encode);
+ emit_int8(0x18);
+ emit_int8((unsigned char)(0xC0 | encode));
// 0x00 - insert into lower 128 bits
// 0x01 - insert into upper 128 bits
- emit_byte(0x01);
+ emit_int8(0x01);
}
void Assembler::vinsertf128h(XMMRegister dst, Address src) {
@@ -3587,10 +3593,10 @@
int dst_enc = dst->encoding();
// swap src<->dst for encoding
vex_prefix(src, dst_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256);
- emit_byte(0x18);
+ emit_int8(0x18);
emit_operand(dst, src);
// 0x01 - insert into upper 128 bits
- emit_byte(0x01);
+ emit_int8(0x01);
}
void Assembler::vextractf128h(Address dst, XMMRegister src) {
@@ -3600,21 +3606,21 @@
assert(src != xnoreg, "sanity");
int src_enc = src->encoding();
vex_prefix(dst, 0, src_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256);
- emit_byte(0x19);
+ emit_int8(0x19);
emit_operand(src, dst);
// 0x01 - extract from upper 128 bits
- emit_byte(0x01);
+ emit_int8(0x01);
}
void Assembler::vinserti128h(XMMRegister dst, XMMRegister nds, XMMRegister src) {
assert(VM_Version::supports_avx2(), "");
bool vector256 = true;
int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_3A);
- emit_byte(0x38);
- emit_byte(0xC0 | encode);
+ emit_int8(0x38);
+ emit_int8((unsigned char)(0xC0 | encode));
// 0x00 - insert into lower 128 bits
// 0x01 - insert into upper 128 bits
- emit_byte(0x01);
+ emit_int8(0x01);
}
void Assembler::vinserti128h(XMMRegister dst, Address src) {
@@ -3625,10 +3631,10 @@
int dst_enc = dst->encoding();
// swap src<->dst for encoding
vex_prefix(src, dst_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256);
- emit_byte(0x38);
+ emit_int8(0x38);
emit_operand(dst, src);
// 0x01 - insert into upper 128 bits
- emit_byte(0x01);
+ emit_int8(0x01);
}
void Assembler::vextracti128h(Address dst, XMMRegister src) {
@@ -3638,16 +3644,16 @@
assert(src != xnoreg, "sanity");
int src_enc = src->encoding();
vex_prefix(dst, 0, src_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256);
- emit_byte(0x39);
+ emit_int8(0x39);
emit_operand(src, dst);
// 0x01 - extract from upper 128 bits
- emit_byte(0x01);
+ emit_int8(0x01);
}
void Assembler::vzeroupper() {
assert(VM_Version::supports_avx(), "");
(void)vex_prefix_and_encode(xmm0, xmm0, xmm0, VEX_SIMD_NONE);
- emit_byte(0x77);
+ emit_int8(0x77);
}
@@ -3657,15 +3663,15 @@
void Assembler::cmp_literal32(Register src1, int32_t imm32, RelocationHolder const& rspec) {
// NO PREFIX AS NEVER 64BIT
InstructionMark im(this);
- emit_byte(0x81);
- emit_byte(0xF8 | src1->encoding());
+ emit_int8((unsigned char)0x81);
+ emit_int8((unsigned char)(0xF8 | src1->encoding()));
emit_data(imm32, rspec, 0);
}
void Assembler::cmp_literal32(Address src1, int32_t imm32, RelocationHolder const& rspec) {
// NO PREFIX AS NEVER 64BIT (not even 32bit versions of 64bit regs
InstructionMark im(this);
- emit_byte(0x81);
+ emit_int8((unsigned char)0x81);
emit_operand(rdi, src1);
emit_data(imm32, rspec, 0);
}
@@ -3675,14 +3681,14 @@
// into rdx:rax. The ZF is set if the compared values were equal, and cleared otherwise.
void Assembler::cmpxchg8(Address adr) {
InstructionMark im(this);
- emit_byte(0x0F);
- emit_byte(0xc7);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xC7);
emit_operand(rcx, adr);
}
void Assembler::decl(Register dst) {
// Don't use it directly. Use MacroAssembler::decrementl() instead.
- emit_byte(0x48 | dst->encoding());
+ emit_int8(0x48 | dst->encoding());
}
#endif // _LP64
@@ -3690,8 +3696,8 @@
// 64bit typically doesn't use the x87 but needs to for the trig funcs
void Assembler::fabs() {
- emit_byte(0xD9);
- emit_byte(0xE1);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xE1);
}
void Assembler::fadd(int i) {
@@ -3700,13 +3706,13 @@
void Assembler::fadd_d(Address src) {
InstructionMark im(this);
- emit_byte(0xDC);
+ emit_int8((unsigned char)0xDC);
emit_operand32(rax, src);
}
void Assembler::fadd_s(Address src) {
InstructionMark im(this);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD8);
emit_operand32(rax, src);
}
@@ -3719,8 +3725,8 @@
}
void Assembler::fchs() {
- emit_byte(0xD9);
- emit_byte(0xE0);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xE0);
}
void Assembler::fcom(int i) {
@@ -3733,29 +3739,29 @@
void Assembler::fcomp_d(Address src) {
InstructionMark im(this);
- emit_byte(0xDC);
+ emit_int8((unsigned char)0xDC);
emit_operand32(rbx, src);
}
void Assembler::fcomp_s(Address src) {
InstructionMark im(this);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD8);
emit_operand32(rbx, src);
}
void Assembler::fcompp() {
- emit_byte(0xDE);
- emit_byte(0xD9);
+ emit_int8((unsigned char)0xDE);
+ emit_int8((unsigned char)0xD9);
}
void Assembler::fcos() {
- emit_byte(0xD9);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xFF);
}
void Assembler::fdecstp() {
- emit_byte(0xD9);
- emit_byte(0xF6);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xF6);
}
void Assembler::fdiv(int i) {
@@ -3764,13 +3770,13 @@
void Assembler::fdiv_d(Address src) {
InstructionMark im(this);
- emit_byte(0xDC);
+ emit_int8((unsigned char)0xDC);
emit_operand32(rsi, src);
}
void Assembler::fdiv_s(Address src) {
InstructionMark im(this);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD8);
emit_operand32(rsi, src);
}
@@ -3791,13 +3797,13 @@
void Assembler::fdivr_d(Address src) {
InstructionMark im(this);
- emit_byte(0xDC);
+ emit_int8((unsigned char)0xDC);
emit_operand32(rdi, src);
}
void Assembler::fdivr_s(Address src) {
InstructionMark im(this);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD8);
emit_operand32(rdi, src);
}
@@ -3815,59 +3821,59 @@
void Assembler::fild_d(Address adr) {
InstructionMark im(this);
- emit_byte(0xDF);
+ emit_int8((unsigned char)0xDF);
emit_operand32(rbp, adr);
}
void Assembler::fild_s(Address adr) {
InstructionMark im(this);
- emit_byte(0xDB);
+ emit_int8((unsigned char)0xDB);
emit_operand32(rax, adr);
}
void Assembler::fincstp() {
- emit_byte(0xD9);
- emit_byte(0xF7);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xF7);
}
void Assembler::finit() {
- emit_byte(0x9B);
- emit_byte(0xDB);
- emit_byte(0xE3);
+ emit_int8((unsigned char)0x9B);
+ emit_int8((unsigned char)0xDB);
+ emit_int8((unsigned char)0xE3);
}
void Assembler::fist_s(Address adr) {
InstructionMark im(this);
- emit_byte(0xDB);
+ emit_int8((unsigned char)0xDB);
emit_operand32(rdx, adr);
}
void Assembler::fistp_d(Address adr) {
InstructionMark im(this);
- emit_byte(0xDF);
+ emit_int8((unsigned char)0xDF);
emit_operand32(rdi, adr);
}
void Assembler::fistp_s(Address adr) {
InstructionMark im(this);
- emit_byte(0xDB);
+ emit_int8((unsigned char)0xDB);
emit_operand32(rbx, adr);
}
void Assembler::fld1() {
- emit_byte(0xD9);
- emit_byte(0xE8);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xE8);
}
void Assembler::fld_d(Address adr) {
InstructionMark im(this);
- emit_byte(0xDD);
+ emit_int8((unsigned char)0xDD);
emit_operand32(rax, adr);
}
void Assembler::fld_s(Address adr) {
InstructionMark im(this);
- emit_byte(0xD9);
+ emit_int8((unsigned char)0xD9);
emit_operand32(rax, adr);
}
@@ -3878,35 +3884,35 @@
void Assembler::fld_x(Address adr) {
InstructionMark im(this);
- emit_byte(0xDB);
+ emit_int8((unsigned char)0xDB);
emit_operand32(rbp, adr);
}
void Assembler::fldcw(Address src) {
InstructionMark im(this);
- emit_byte(0xd9);
+ emit_int8((unsigned char)0xD9);
emit_operand32(rbp, src);
}
void Assembler::fldenv(Address src) {
InstructionMark im(this);
- emit_byte(0xD9);
+ emit_int8((unsigned char)0xD9);
emit_operand32(rsp, src);
}
void Assembler::fldlg2() {
- emit_byte(0xD9);
- emit_byte(0xEC);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xEC);
}
void Assembler::fldln2() {
- emit_byte(0xD9);
- emit_byte(0xED);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xED);
}
void Assembler::fldz() {
- emit_byte(0xD9);
- emit_byte(0xEE);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xEE);
}
void Assembler::flog() {
@@ -3927,13 +3933,13 @@
void Assembler::fmul_d(Address src) {
InstructionMark im(this);
- emit_byte(0xDC);
+ emit_int8((unsigned char)0xDC);
emit_operand32(rcx, src);
}
void Assembler::fmul_s(Address src) {
InstructionMark im(this);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD8);
emit_operand32(rcx, src);
}
@@ -3947,63 +3953,63 @@
void Assembler::fnsave(Address dst) {
InstructionMark im(this);
- emit_byte(0xDD);
+ emit_int8((unsigned char)0xDD);
emit_operand32(rsi, dst);
}
void Assembler::fnstcw(Address src) {
InstructionMark im(this);
- emit_byte(0x9B);
- emit_byte(0xD9);
+ emit_int8((unsigned char)0x9B);
+ emit_int8((unsigned char)0xD9);
emit_operand32(rdi, src);
}
void Assembler::fnstsw_ax() {
- emit_byte(0xdF);
- emit_byte(0xE0);
+ emit_int8((unsigned char)0xDF);
+ emit_int8((unsigned char)0xE0);
}
void Assembler::fprem() {
- emit_byte(0xD9);
- emit_byte(0xF8);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xF8);
}
void Assembler::fprem1() {
- emit_byte(0xD9);
- emit_byte(0xF5);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xF5);
}
void Assembler::frstor(Address src) {
InstructionMark im(this);
- emit_byte(0xDD);
+ emit_int8((unsigned char)0xDD);
emit_operand32(rsp, src);
}
void Assembler::fsin() {
- emit_byte(0xD9);
- emit_byte(0xFE);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xFE);
}
void Assembler::fsqrt() {
- emit_byte(0xD9);
- emit_byte(0xFA);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xFA);
}
void Assembler::fst_d(Address adr) {
InstructionMark im(this);
- emit_byte(0xDD);
+ emit_int8((unsigned char)0xDD);
emit_operand32(rdx, adr);
}
void Assembler::fst_s(Address adr) {
InstructionMark im(this);
- emit_byte(0xD9);
+ emit_int8((unsigned char)0xD9);
emit_operand32(rdx, adr);
}
void Assembler::fstp_d(Address adr) {
InstructionMark im(this);
- emit_byte(0xDD);
+ emit_int8((unsigned char)0xDD);
emit_operand32(rbx, adr);
}
@@ -4013,13 +4019,13 @@
void Assembler::fstp_s(Address adr) {
InstructionMark im(this);
- emit_byte(0xD9);
+ emit_int8((unsigned char)0xD9);
emit_operand32(rbx, adr);
}
void Assembler::fstp_x(Address adr) {
InstructionMark im(this);
- emit_byte(0xDB);
+ emit_int8((unsigned char)0xDB);
emit_operand32(rdi, adr);
}
@@ -4029,13 +4035,13 @@
void Assembler::fsub_d(Address src) {
InstructionMark im(this);
- emit_byte(0xDC);
+ emit_int8((unsigned char)0xDC);
emit_operand32(rsp, src);
}
void Assembler::fsub_s(Address src) {
InstructionMark im(this);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD8);
emit_operand32(rsp, src);
}
@@ -4053,13 +4059,13 @@
void Assembler::fsubr_d(Address src) {
InstructionMark im(this);
- emit_byte(0xDC);
+ emit_int8((unsigned char)0xDC);
emit_operand32(rbp, src);
}
void Assembler::fsubr_s(Address src) {
InstructionMark im(this);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD8);
emit_operand32(rbp, src);
}
@@ -4072,15 +4078,15 @@
}
void Assembler::ftan() {
- emit_byte(0xD9);
- emit_byte(0xF2);
- emit_byte(0xDD);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xF2);
+ emit_int8((unsigned char)0xDD);
+ emit_int8((unsigned char)0xD8);
}
void Assembler::ftst() {
- emit_byte(0xD9);
- emit_byte(0xE4);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xE4);
}
void Assembler::fucomi(int i) {
@@ -4096,7 +4102,7 @@
}
void Assembler::fwait() {
- emit_byte(0x9B);
+ emit_int8((unsigned char)0x9B);
}
void Assembler::fxch(int i) {
@@ -4104,23 +4110,23 @@
}
void Assembler::fyl2x() {
- emit_byte(0xD9);
- emit_byte(0xF1);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xF1);
}
void Assembler::frndint() {
- emit_byte(0xD9);
- emit_byte(0xFC);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xFC);
}
void Assembler::f2xm1() {
- emit_byte(0xD9);
- emit_byte(0xF0);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xF0);
}
void Assembler::fldl2e() {
- emit_byte(0xD9);
- emit_byte(0xEA);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xEA);
}
// SSE SIMD prefix byte values corresponding to VexSimdPrefix encoding.
@@ -4131,7 +4137,7 @@
// Generate SSE legacy REX prefix and SIMD opcode based on VEX encoding.
void Assembler::rex_prefix(Address adr, XMMRegister xreg, VexSimdPrefix pre, VexOpcode opc, bool rex_w) {
if (pre > 0) {
- emit_byte(simd_pre[pre]);
+ emit_int8(simd_pre[pre]);
}
if (rex_w) {
prefixq(adr, xreg);
@@ -4139,25 +4145,25 @@
prefix(adr, xreg);
}
if (opc > 0) {
- emit_byte(0x0F);
+ emit_int8(0x0F);
int opc2 = simd_opc[opc];
if (opc2 > 0) {
- emit_byte(opc2);
+ emit_int8(opc2);
}
}
}
int Assembler::rex_prefix_and_encode(int dst_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, bool rex_w) {
if (pre > 0) {
- emit_byte(simd_pre[pre]);
+ emit_int8(simd_pre[pre]);
}
int encode = (rex_w) ? prefixq_and_encode(dst_enc, src_enc) :
prefix_and_encode(dst_enc, src_enc);
if (opc > 0) {
- emit_byte(0x0F);
+ emit_int8(0x0F);
int opc2 = simd_opc[opc];
if (opc2 > 0) {
- emit_byte(opc2);
+ emit_int8(opc2);
}
}
return encode;
@@ -4171,11 +4177,11 @@
int byte1 = (vex_r ? VEX_R : 0) | (vex_x ? VEX_X : 0) | (vex_b ? VEX_B : 0);
byte1 = (~byte1) & 0xE0;
byte1 |= opc;
- a_byte(byte1);
+ emit_int8(byte1);
int byte2 = ((~nds_enc) & 0xf) << 3;
byte2 |= (vex_w ? VEX_W : 0) | (vector256 ? 4 : 0) | pre;
- emit_byte(byte2);
+ emit_int8(byte2);
} else {
prefix(VEX_2bytes);
@@ -4183,7 +4189,7 @@
byte1 = (~byte1) & 0x80;
byte1 |= ((~nds_enc) & 0xf) << 3;
byte1 |= (vector256 ? 4 : 0) | pre;
- emit_byte(byte1);
+ emit_int8(byte1);
}
}
@@ -4229,28 +4235,28 @@
void Assembler::emit_simd_arith(int opcode, XMMRegister dst, Address src, VexSimdPrefix pre) {
InstructionMark im(this);
simd_prefix(dst, dst, src, pre);
- emit_byte(opcode);
+ emit_int8(opcode);
emit_operand(dst, src);
}
void Assembler::emit_simd_arith(int opcode, XMMRegister dst, XMMRegister src, VexSimdPrefix pre) {
int encode = simd_prefix_and_encode(dst, dst, src, pre);
- emit_byte(opcode);
- emit_byte(0xC0 | encode);
+ emit_int8(opcode);
+ emit_int8((unsigned char)(0xC0 | encode));
}
// Versions with no second source register (non-destructive source).
void Assembler::emit_simd_arith_nonds(int opcode, XMMRegister dst, Address src, VexSimdPrefix pre) {
InstructionMark im(this);
simd_prefix(dst, xnoreg, src, pre);
- emit_byte(opcode);
+ emit_int8(opcode);
emit_operand(dst, src);
}
void Assembler::emit_simd_arith_nonds(int opcode, XMMRegister dst, XMMRegister src, VexSimdPrefix pre) {
int encode = simd_prefix_and_encode(dst, xnoreg, src, pre);
- emit_byte(opcode);
- emit_byte(0xC0 | encode);
+ emit_int8(opcode);
+ emit_int8((unsigned char)(0xC0 | encode));
}
// 3-operands AVX instructions
@@ -4258,22 +4264,22 @@
Address src, VexSimdPrefix pre, bool vector256) {
InstructionMark im(this);
vex_prefix(dst, nds, src, pre, vector256);
- emit_byte(opcode);
+ emit_int8(opcode);
emit_operand(dst, src);
}
void Assembler::emit_vex_arith(int opcode, XMMRegister dst, XMMRegister nds,
XMMRegister src, VexSimdPrefix pre, bool vector256) {
int encode = vex_prefix_and_encode(dst, nds, src, pre, vector256);
- emit_byte(opcode);
- emit_byte(0xC0 | encode);
+ emit_int8(opcode);
+ emit_int8((unsigned char)(0xC0 | encode));
}
#ifndef _LP64
void Assembler::incl(Register dst) {
// Don't use it directly. Use MacroAssembler::incrementl() instead.
- emit_byte(0x40 | dst->encoding());
+ emit_int8(0x40 | dst->encoding());
}
void Assembler::lea(Register dst, Address src) {
@@ -4282,7 +4288,7 @@
void Assembler::mov_literal32(Address dst, int32_t imm32, RelocationHolder const& rspec) {
InstructionMark im(this);
- emit_byte(0xC7);
+ emit_int8((unsigned char)0xC7);
emit_operand(rax, dst);
emit_data((int)imm32, rspec, 0);
}
@@ -4290,49 +4296,49 @@
void Assembler::mov_literal32(Register dst, int32_t imm32, RelocationHolder const& rspec) {
InstructionMark im(this);
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xB8 | encode);
+ emit_int8((unsigned char)(0xB8 | encode));
emit_data((int)imm32, rspec, 0);
}
void Assembler::popa() { // 32bit
- emit_byte(0x61);
+ emit_int8(0x61);
}
void Assembler::push_literal32(int32_t imm32, RelocationHolder const& rspec) {
InstructionMark im(this);
- emit_byte(0x68);
+ emit_int8(0x68);
emit_data(imm32, rspec, 0);
}
void Assembler::pusha() { // 32bit
- emit_byte(0x60);
+ emit_int8(0x60);
}
void Assembler::set_byte_if_not_zero(Register dst) {
- emit_byte(0x0F);
- emit_byte(0x95);
- emit_byte(0xE0 | dst->encoding());
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0x95);
+ emit_int8((unsigned char)(0xE0 | dst->encoding()));
}
void Assembler::shldl(Register dst, Register src) {
- emit_byte(0x0F);
- emit_byte(0xA5);
- emit_byte(0xC0 | src->encoding() << 3 | dst->encoding());
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xA5);
+ emit_int8((unsigned char)(0xC0 | src->encoding() << 3 | dst->encoding()));
}
void Assembler::shrdl(Register dst, Register src) {
- emit_byte(0x0F);
- emit_byte(0xAD);
- emit_byte(0xC0 | src->encoding() << 3 | dst->encoding());
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAD);
+ emit_int8((unsigned char)(0xC0 | src->encoding() << 3 | dst->encoding()));
}
#else // LP64
void Assembler::set_byte_if_not_zero(Register dst) {
int enc = prefix_and_encode(dst->encoding(), true);
- emit_byte(0x0F);
- emit_byte(0x95);
- emit_byte(0xE0 | enc);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0x95);
+ emit_int8((unsigned char)(0xE0 | enc));
}
// 64bit only pieces of the assembler
@@ -4670,7 +4676,7 @@
void Assembler::adcq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x13);
+ emit_int8(0x13);
emit_operand(dst, src);
}
@@ -4688,7 +4694,7 @@
void Assembler::addq(Address dst, Register src) {
InstructionMark im(this);
prefixq(dst, src);
- emit_byte(0x01);
+ emit_int8(0x01);
emit_operand(src, dst);
}
@@ -4700,7 +4706,7 @@
void Assembler::addq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x03);
+ emit_int8(0x03);
emit_operand(dst, src);
}
@@ -4712,7 +4718,7 @@
void Assembler::andq(Address dst, int32_t imm32) {
InstructionMark im(this);
prefixq(dst);
- emit_byte(0x81);
+ emit_int8((unsigned char)0x81);
emit_operand(rsp, dst, 4);
emit_long(imm32);
}
@@ -4725,7 +4731,7 @@
void Assembler::andq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x23);
+ emit_int8(0x23);
emit_operand(dst, src);
}
@@ -4736,56 +4742,56 @@
void Assembler::bsfq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBC);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBC);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::bsrq(Register dst, Register src) {
assert(!VM_Version::supports_lzcnt(), "encoding is treated as LZCNT");
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBD);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBD);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::bswapq(Register reg) {
int encode = prefixq_and_encode(reg->encoding());
- emit_byte(0x0F);
- emit_byte(0xC8 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)(0xC8 | encode));
}
void Assembler::cdqq() {
prefix(REX_W);
- emit_byte(0x99);
+ emit_int8((unsigned char)0x99);
}
void Assembler::clflush(Address adr) {
prefix(adr);
- emit_byte(0x0F);
- emit_byte(0xAE);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAE);
emit_operand(rdi, adr);
}
void Assembler::cmovq(Condition cc, Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0x40 | cc);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8(0x40 | cc);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cmovq(Condition cc, Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x0F);
- emit_byte(0x40 | cc);
+ emit_int8(0x0F);
+ emit_int8(0x40 | cc);
emit_operand(dst, src);
}
void Assembler::cmpq(Address dst, int32_t imm32) {
InstructionMark im(this);
prefixq(dst);
- emit_byte(0x81);
+ emit_int8((unsigned char)0x81);
emit_operand(rdi, dst, 4);
emit_long(imm32);
}
@@ -4798,7 +4804,7 @@
void Assembler::cmpq(Address dst, Register src) {
InstructionMark im(this);
prefixq(dst, src);
- emit_byte(0x3B);
+ emit_int8(0x3B);
emit_operand(src, dst);
}
@@ -4810,122 +4816,122 @@
void Assembler::cmpq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x3B);
+ emit_int8(0x3B);
emit_operand(dst, src);
}
void Assembler::cmpxchgq(Register reg, Address adr) {
InstructionMark im(this);
prefixq(adr, reg);
- emit_byte(0x0F);
- emit_byte(0xB1);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB1);
emit_operand(reg, adr);
}
void Assembler::cvtsi2sdq(XMMRegister dst, Register src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
int encode = simd_prefix_and_encode_q(dst, dst, src, VEX_SIMD_F2);
- emit_byte(0x2A);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2A);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cvtsi2sdq(XMMRegister dst, Address src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionMark im(this);
simd_prefix_q(dst, dst, src, VEX_SIMD_F2);
- emit_byte(0x2A);
+ emit_int8(0x2A);
emit_operand(dst, src);
}
void Assembler::cvtsi2ssq(XMMRegister dst, Register src) {
NOT_LP64(assert(VM_Version::supports_sse(), ""));
int encode = simd_prefix_and_encode_q(dst, dst, src, VEX_SIMD_F3);
- emit_byte(0x2A);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2A);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cvtsi2ssq(XMMRegister dst, Address src) {
NOT_LP64(assert(VM_Version::supports_sse(), ""));
InstructionMark im(this);
simd_prefix_q(dst, dst, src, VEX_SIMD_F3);
- emit_byte(0x2A);
+ emit_int8(0x2A);
emit_operand(dst, src);
}
void Assembler::cvttsd2siq(Register dst, XMMRegister src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
int encode = simd_prefix_and_encode_q(dst, src, VEX_SIMD_F2);
- emit_byte(0x2C);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2C);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cvttss2siq(Register dst, XMMRegister src) {
NOT_LP64(assert(VM_Version::supports_sse(), ""));
int encode = simd_prefix_and_encode_q(dst, src, VEX_SIMD_F3);
- emit_byte(0x2C);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2C);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::decl(Register dst) {
// Don't use it directly. Use MacroAssembler::decrementl() instead.
// Use two-byte form (one-byte form is a REX prefix in 64-bit mode)
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xFF);
- emit_byte(0xC8 | encode);
+ emit_int8((unsigned char)0xFF);
+ emit_int8((unsigned char)(0xC8 | encode));
}
void Assembler::decq(Register dst) {
// Don't use it directly. Use MacroAssembler::decrementq() instead.
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode)
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xFF);
- emit_byte(0xC8 | encode);
+ emit_int8((unsigned char)0xFF);
+ emit_int8(0xC8 | encode);
}
void Assembler::decq(Address dst) {
// Don't use it directly. Use MacroAssembler::decrementq() instead.
InstructionMark im(this);
prefixq(dst);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rcx, dst);
}
void Assembler::fxrstor(Address src) {
prefixq(src);
- emit_byte(0x0F);
- emit_byte(0xAE);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAE);
emit_operand(as_Register(1), src);
}
void Assembler::fxsave(Address dst) {
prefixq(dst);
- emit_byte(0x0F);
- emit_byte(0xAE);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAE);
emit_operand(as_Register(0), dst);
}
void Assembler::idivq(Register src) {
int encode = prefixq_and_encode(src->encoding());
- emit_byte(0xF7);
- emit_byte(0xF8 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xF8 | encode));
}
void Assembler::imulq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xAF);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAF);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::imulq(Register dst, Register src, int value) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
if (is8bit(value)) {
- emit_byte(0x6B);
- emit_byte(0xC0 | encode);
- emit_byte(value & 0xFF);
+ emit_int8(0x6B);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(value & 0xFF);
} else {
- emit_byte(0x69);
- emit_byte(0xC0 | encode);
+ emit_int8(0x69);
+ emit_int8((unsigned char)(0xC0 | encode));
emit_long(value);
}
}
@@ -4934,23 +4940,23 @@
// Don't use it directly. Use MacroAssembler::incrementl() instead.
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode)
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xFF);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xFF);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::incq(Register dst) {
// Don't use it directly. Use MacroAssembler::incrementq() instead.
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode)
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xFF);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xFF);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::incq(Address dst) {
// Don't use it directly. Use MacroAssembler::incrementq() instead.
InstructionMark im(this);
prefixq(dst);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rax, dst);
}
@@ -4961,35 +4967,35 @@
void Assembler::leaq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x8D);
+ emit_int8((unsigned char)0x8D);
emit_operand(dst, src);
}
void Assembler::mov64(Register dst, int64_t imm64) {
InstructionMark im(this);
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xB8 | encode);
+ emit_int8((unsigned char)(0xB8 | encode));
emit_int64(imm64);
}
void Assembler::mov_literal64(Register dst, intptr_t imm64, RelocationHolder const& rspec) {
InstructionMark im(this);
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xB8 | encode);
+ emit_int8(0xB8 | encode);
emit_data64(imm64, rspec);
}
void Assembler::mov_narrow_oop(Register dst, int32_t imm32, RelocationHolder const& rspec) {
InstructionMark im(this);
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xB8 | encode);
+ emit_int8((unsigned char)(0xB8 | encode));
emit_data((int)imm32, rspec, narrow_oop_operand);
}
void Assembler::mov_narrow_oop(Address dst, int32_t imm32, RelocationHolder const& rspec) {
InstructionMark im(this);
prefix(dst);
- emit_byte(0xC7);
+ emit_int8((unsigned char)0xC7);
emit_operand(rax, dst, 4);
emit_data((int)imm32, rspec, narrow_oop_operand);
}
@@ -4997,34 +5003,34 @@
void Assembler::cmp_narrow_oop(Register src1, int32_t imm32, RelocationHolder const& rspec) {
InstructionMark im(this);
int encode = prefix_and_encode(src1->encoding());
- emit_byte(0x81);
- emit_byte(0xF8 | encode);
+ emit_int8((unsigned char)0x81);
+ emit_int8((unsigned char)(0xF8 | encode));
emit_data((int)imm32, rspec, narrow_oop_operand);
}
void Assembler::cmp_narrow_oop(Address src1, int32_t imm32, RelocationHolder const& rspec) {
InstructionMark im(this);
prefix(src1);
- emit_byte(0x81);
+ emit_int8((unsigned char)0x81);
emit_operand(rax, src1, 4);
emit_data((int)imm32, rspec, narrow_oop_operand);
}
void Assembler::lzcntq(Register dst, Register src) {
assert(VM_Version::supports_lzcnt(), "encoding is treated as BSR");
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBD);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBD);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movdq(XMMRegister dst, Register src) {
// table D-1 says MMX/SSE2
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
int encode = simd_prefix_and_encode_q(dst, src, VEX_SIMD_66);
- emit_byte(0x6E);
- emit_byte(0xC0 | encode);
+ emit_int8(0x6E);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movdq(Register dst, XMMRegister src) {
@@ -5032,43 +5038,43 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// swap src/dst to get correct prefix
int encode = simd_prefix_and_encode_q(src, dst, VEX_SIMD_66);
- emit_byte(0x7E);
- emit_byte(0xC0 | encode);
+ emit_int8(0x7E);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x8B);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0x8B);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x8B);
+ emit_int8((unsigned char)0x8B);
emit_operand(dst, src);
}
void Assembler::movq(Address dst, Register src) {
InstructionMark im(this);
prefixq(dst, src);
- emit_byte(0x89);
+ emit_int8((unsigned char)0x89);
emit_operand(src, dst);
}
void Assembler::movsbq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x0F);
- emit_byte(0xBE);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBE);
emit_operand(dst, src);
}
void Assembler::movsbq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBE);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBE);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movslq(Register dst, int32_t imm32) {
@@ -5078,7 +5084,7 @@
ShouldNotReachHere();
InstructionMark im(this);
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xC7 | encode);
+ emit_int8((unsigned char)(0xC7 | encode));
emit_long(imm32);
}
@@ -5086,7 +5092,7 @@
assert(is_simm32(imm32), "lost bits");
InstructionMark im(this);
prefixq(dst);
- emit_byte(0xC7);
+ emit_int8((unsigned char)0xC7);
emit_operand(rax, dst, 4);
emit_long(imm32);
}
@@ -5094,77 +5100,77 @@
void Assembler::movslq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x63);
+ emit_int8(0x63);
emit_operand(dst, src);
}
void Assembler::movslq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x63);
- emit_byte(0xC0 | encode);
+ emit_int8(0x63);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movswq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x0F);
- emit_byte(0xBF);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBF);
emit_operand(dst, src);
}
void Assembler::movswq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBF);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0x0F);
+ emit_int8((unsigned char)0xBF);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movzbq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x0F);
- emit_byte(0xB6);
+ emit_int8((unsigned char)0x0F);
+ emit_int8((unsigned char)0xB6);
emit_operand(dst, src);
}
void Assembler::movzbq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xB6);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB6);
+ emit_int8(0xC0 | encode);
}
void Assembler::movzwq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x0F);
- emit_byte(0xB7);
+ emit_int8((unsigned char)0x0F);
+ emit_int8((unsigned char)0xB7);
emit_operand(dst, src);
}
void Assembler::movzwq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xB7);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0x0F);
+ emit_int8((unsigned char)0xB7);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::negq(Register dst) {
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xF7);
- emit_byte(0xD8 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xD8 | encode));
}
void Assembler::notq(Register dst) {
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xF7);
- emit_byte(0xD0 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xD0 | encode));
}
void Assembler::orq(Address dst, int32_t imm32) {
InstructionMark im(this);
prefixq(dst);
- emit_byte(0x81);
+ emit_int8((unsigned char)0x81);
emit_operand(rcx, dst, 4);
emit_long(imm32);
}
@@ -5177,7 +5183,7 @@
void Assembler::orq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x0B);
+ emit_int8(0x0B);
emit_operand(dst, src);
}
@@ -5210,26 +5216,26 @@
void Assembler::popcntq(Register dst, Address src) {
assert(VM_Version::supports_popcnt(), "must support");
InstructionMark im(this);
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
prefixq(src, dst);
- emit_byte(0x0F);
- emit_byte(0xB8);
+ emit_int8((unsigned char)0x0F);
+ emit_int8((unsigned char)0xB8);
emit_operand(dst, src);
}
void Assembler::popcntq(Register dst, Register src) {
assert(VM_Version::supports_popcnt(), "must support");
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xB8);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0x0F);
+ emit_int8((unsigned char)0xB8);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::popq(Address dst) {
InstructionMark im(this);
prefixq(dst);
- emit_byte(0x8F);
+ emit_int8((unsigned char)0x8F);
emit_operand(rax, dst);
}
@@ -5261,7 +5267,7 @@
void Assembler::pushq(Address src) {
InstructionMark im(this);
prefixq(src);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rsi, src);
}
@@ -5269,31 +5275,31 @@
assert(isShiftCount(imm8 >> 1), "illegal shift count");
int encode = prefixq_and_encode(dst->encoding());
if (imm8 == 1) {
- emit_byte(0xD1);
- emit_byte(0xD0 | encode);
+ emit_int8((unsigned char)0xD1);
+ emit_int8((unsigned char)(0xD0 | encode));
} else {
- emit_byte(0xC1);
- emit_byte(0xD0 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)(0xD0 | encode));
+ emit_int8(imm8);
}
}
void Assembler::sarq(Register dst, int imm8) {
assert(isShiftCount(imm8 >> 1), "illegal shift count");
int encode = prefixq_and_encode(dst->encoding());
if (imm8 == 1) {
- emit_byte(0xD1);
- emit_byte(0xF8 | encode);
+ emit_int8((unsigned char)0xD1);
+ emit_int8((unsigned char)(0xF8 | encode));
} else {
- emit_byte(0xC1);
- emit_byte(0xF8 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)(0xF8 | encode));
+ emit_int8(imm8);
}
}
void Assembler::sarq(Register dst) {
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xD3);
- emit_byte(0xF8 | encode);
+ emit_int8((unsigned char)0xD3);
+ emit_int8((unsigned char)(0xF8 | encode));
}
void Assembler::sbbq(Address dst, int32_t imm32) {
@@ -5310,7 +5316,7 @@
void Assembler::sbbq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x1B);
+ emit_int8(0x1B);
emit_operand(dst, src);
}
@@ -5323,33 +5329,33 @@
assert(isShiftCount(imm8 >> 1), "illegal shift count");
int encode = prefixq_and_encode(dst->encoding());
if (imm8 == 1) {
- emit_byte(0xD1);
- emit_byte(0xE0 | encode);
+ emit_int8((unsigned char)0xD1);
+ emit_int8((unsigned char)(0xE0 | encode));
} else {
- emit_byte(0xC1);
- emit_byte(0xE0 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)(0xE0 | encode));
+ emit_int8(imm8);
}
}
void Assembler::shlq(Register dst) {
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xD3);
- emit_byte(0xE0 | encode);
+ emit_int8((unsigned char)0xD3);
+ emit_int8((unsigned char)(0xE0 | encode));
}
void Assembler::shrq(Register dst, int imm8) {
assert(isShiftCount(imm8 >> 1), "illegal shift count");
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xC1);
- emit_byte(0xE8 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)(0xE8 | encode));
+ emit_int8(imm8);
}
void Assembler::shrq(Register dst) {
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xD3);
- emit_byte(0xE8 | encode);
+ emit_int8((unsigned char)0xD3);
+ emit_int8(0xE8 | encode);
}
void Assembler::subq(Address dst, int32_t imm32) {
@@ -5361,7 +5367,7 @@
void Assembler::subq(Address dst, Register src) {
InstructionMark im(this);
prefixq(dst, src);
- emit_byte(0x29);
+ emit_int8(0x29);
emit_operand(src, dst);
}
@@ -5379,7 +5385,7 @@
void Assembler::subq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x2B);
+ emit_int8(0x2B);
emit_operand(dst, src);
}
@@ -5395,11 +5401,11 @@
int encode = dst->encoding();
if (encode == 0) {
prefix(REX_W);
- emit_byte(0xA9);
+ emit_int8((unsigned char)0xA9);
} else {
encode = prefixq_and_encode(encode);
- emit_byte(0xF7);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xC0 | encode));
}
emit_long(imm32);
}
@@ -5412,22 +5418,22 @@
void Assembler::xaddq(Address dst, Register src) {
InstructionMark im(this);
prefixq(dst, src);
- emit_byte(0x0F);
- emit_byte(0xC1);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xC1);
emit_operand(src, dst);
}
void Assembler::xchgq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x87);
+ emit_int8((unsigned char)0x87);
emit_operand(dst, src);
}
void Assembler::xchgq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x87);
- emit_byte(0xc0 | encode);
+ emit_int8((unsigned char)0x87);
+ emit_int8((unsigned char)(0xc0 | encode));
}
void Assembler::xorq(Register dst, Register src) {
@@ -5438,7 +5444,7 @@
void Assembler::xorq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x33);
+ emit_int8(0x33);
emit_operand(dst, src);
}
--- a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -313,10 +313,10 @@
#endif
} else {
// make a copy the code which is going to be patched.
- for ( int i = 0; i < _bytes_to_copy; i++) {
+ for (int i = 0; i < _bytes_to_copy; i++) {
address ptr = (address)(_pc_start + i);
int a_byte = (*ptr) & 0xFF;
- __ a_byte (a_byte);
+ __ emit_int8(a_byte);
*ptr = 0x90; // make the site look like a nop
}
}
@@ -363,11 +363,11 @@
// emit the offsets needed to find the code to patch
int being_initialized_entry_offset = __ pc() - being_initialized_entry + sizeof_patch_record;
- __ a_byte(0xB8);
- __ a_byte(0);
- __ a_byte(being_initialized_entry_offset);
- __ a_byte(bytes_to_skip);
- __ a_byte(_bytes_to_copy);
+ __ emit_int8((unsigned char)0xB8);
+ __ emit_int8(0);
+ __ emit_int8(being_initialized_entry_offset);
+ __ emit_int8(bytes_to_skip);
+ __ emit_int8(_bytes_to_copy);
address patch_info_pc = __ pc();
assert(patch_info_pc - end_of_patch == bytes_to_skip, "incorrect patch info");
--- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -611,8 +611,6 @@
// C++ interpreter only
// rsi/r13 - previous interpreter state pointer
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
-
// InterpreterRuntime::frequency_counter_overflow takes one argument
// indicating if the counter overflow occurs at a backwards branch (non-NULL bcp).
// The call returns the address of the verified entry point for the method or NULL
@@ -977,15 +975,16 @@
// to save/restore.
address entry_point = __ pc();
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
- const Address size_of_locals (rbx, Method::size_of_locals_offset());
+ const Address constMethod (rbx, Method::const_offset());
const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset());
const Address access_flags (rbx, Method::access_flags_offset());
+ const Address size_of_parameters(rcx, ConstMethod::size_of_parameters_offset());
// rsi/r13 == state/locals rdi == prevstate
const Register locals = rdi;
// get parameter size (always needed)
+ __ movptr(rcx, constMethod);
__ load_unsigned_short(rcx, size_of_parameters);
// rbx: Method*
@@ -994,6 +993,7 @@
// for natives the size of locals is zero
// compute beginning of parameters /locals
+
__ lea(locals, Address(rsp, rcx, Address::times_ptr, -wordSize));
// initialize fixed part of activation frame
@@ -1107,11 +1107,14 @@
const Register method = rbx;
const Register thread = LP64_ONLY(r15_thread) NOT_LP64(rdi);
const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp(); // rcx|rscratch1
+ const Address constMethod (method, Method::const_offset());
+ const Address size_of_parameters(t, ConstMethod::size_of_parameters_offset());
// allocate space for parameters
__ movptr(method, STATE(_method));
__ verify_method_ptr(method);
- __ load_unsigned_short(t, Address(method, Method::size_of_parameters_offset()));
+ __ movptr(t, constMethod);
+ __ load_unsigned_short(t, size_of_parameters);
__ shll(t, 2);
#ifdef _LP64
__ subptr(rsp, t);
@@ -1700,15 +1703,17 @@
// save sender sp
__ push(rcx);
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
- const Address size_of_locals (rbx, Method::size_of_locals_offset());
+ const Address constMethod (rbx, Method::const_offset());
const Address access_flags (rbx, Method::access_flags_offset());
+ const Address size_of_parameters(rdx, ConstMethod::size_of_parameters_offset());
+ const Address size_of_locals (rdx, ConstMethod::size_of_locals_offset());
// const Address monitor_block_top (rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
// const Address monitor_block_bot (rbp, frame::interpreter_frame_initial_sp_offset * wordSize);
// const Address monitor(rbp, frame::interpreter_frame_initial_sp_offset * wordSize - (int)sizeof(BasicObjectLock));
// get parameter size (always needed)
+ __ movptr(rdx, constMethod);
__ load_unsigned_short(rcx, size_of_parameters);
// rbx: Method*
@@ -1989,7 +1994,9 @@
__ movptr(rbx, STATE(_result._to_call._callee));
// callee left args on top of expression stack, remove them
- __ load_unsigned_short(rcx, Address(rbx, Method::size_of_parameters_offset()));
+ __ movptr(rcx, constMethod);
+ __ load_unsigned_short(rcx, Address(rcx, ConstMethod::size_of_parameters_offset()));
+
__ lea(rsp, Address(rsp, rcx, Address::times_ptr));
__ movl(rcx, Address(rbx, Method::result_index_offset()));
@@ -2159,7 +2166,9 @@
// Make it look like call_stub calling conventions
// Get (potential) receiver
- __ load_unsigned_short(rcx, size_of_parameters); // get size of parameters in words
+ // get size of parameters in words
+ __ movptr(rcx, constMethod);
+ __ load_unsigned_short(rcx, Address(rcx, ConstMethod::size_of_parameters_offset()));
ExternalAddress recursive(CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation));
__ pushptr(recursive.addr()); // make it look good in the debugger
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -1023,7 +1023,7 @@
void MacroAssembler::leave() {
// %%% is this really better? Why not on 32bit too?
- emit_byte(0xC9); // LEAVE
+ emit_int8((unsigned char)0xC9); // LEAVE
}
void MacroAssembler::lneg(Register hi, Register lo) {
@@ -2112,11 +2112,11 @@
if (UseAddressNop) {
addr_nop_5();
} else {
- emit_byte(0x26); // es:
- emit_byte(0x2e); // cs:
- emit_byte(0x64); // fs:
- emit_byte(0x65); // gs:
- emit_byte(0x90);
+ emit_int8(0x26); // es:
+ emit_int8(0x2e); // cs:
+ emit_int8(0x64); // fs:
+ emit_int8(0x65); // gs:
+ emit_int8((unsigned char)0x90);
}
}
@@ -2534,12 +2534,12 @@
int offs = (intptr_t)dst.target() - ((intptr_t)pc());
if (dst.reloc() == relocInfo::none && is8bit(offs - short_size)) {
// 0111 tttn #8-bit disp
- emit_byte(0x70 | cc);
- emit_byte((offs - short_size) & 0xFF);
+ emit_int8(0x70 | cc);
+ emit_int8((offs - short_size) & 0xFF);
} else {
// 0000 1111 1000 tttn #32-bit disp
- emit_byte(0x0F);
- emit_byte(0x80 | cc);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)(0x80 | cc));
emit_long(offs - long_size);
}
} else {
@@ -3085,7 +3085,8 @@
void MacroAssembler::pshufb(XMMRegister dst, AddressLiteral src) {
// Used in sign-bit flipping with aligned address.
- assert((UseAVX > 0) || (((intptr_t)src.target() & 15) == 0), "SSE mode requires address alignment 16 bytes");
+ bool aligned_adr = (((intptr_t)src.target() & 15) == 0);
+ assert((UseAVX > 0) || aligned_adr, "SSE mode requires address alignment 16 bytes");
if (reachable(src)) {
Assembler::pshufb(dst, as_Address(src));
} else {
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -126,25 +126,6 @@
}
}
-#ifndef PRODUCT
- static void pd_print_patched_instruction(address branch) {
- const char* s;
- unsigned char op = branch[0];
- if (op == 0xE8) {
- s = "call";
- } else if (op == 0xE9 || op == 0xEB) {
- s = "jmp";
- } else if ((op & 0xF0) == 0x70) {
- s = "jcc";
- } else if (op == 0x0F) {
- s = "jcc";
- } else {
- s = "????";
- }
- tty->print("%s (unresolved)", s);
- }
-#endif
-
// The following 4 methods return the offset of the appropriate move instruction
// Support for fast byte/short loading with zero extension (depending on particular CPU)
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -169,8 +169,9 @@
if (VerifyMethodHandles && !for_compiler_entry) {
// make sure recv is already on stack
+ __ movptr(temp2, Address(method_temp, Method::const_offset()));
__ load_sized_value(temp2,
- Address(method_temp, Method::size_of_parameters_offset()),
+ Address(temp2, ConstMethod::size_of_parameters_offset()),
sizeof(u2), /*is_signed*/ false);
// assert(sizeof(u2) == sizeof(Method::_size_of_parameters), "");
Label L;
@@ -234,8 +235,9 @@
int ref_kind = signature_polymorphic_intrinsic_ref_kind(iid);
assert(ref_kind != 0 || iid == vmIntrinsics::_invokeBasic, "must be _invokeBasic or a linkTo intrinsic");
if (ref_kind == 0 || MethodHandles::ref_kind_has_receiver(ref_kind)) {
+ __ movptr(rdx_argp, Address(rbx_method, Method::const_offset()));
__ load_sized_value(rdx_argp,
- Address(rbx_method, Method::size_of_parameters_offset()),
+ Address(rdx_argp, ConstMethod::size_of_parameters_offset()),
sizeof(u2), /*is_signed*/ false);
// assert(sizeof(u2) == sizeof(Method::_size_of_parameters), "");
rdx_first_arg_addr = __ argument_address(rdx_argp, -1);
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -2174,13 +2174,13 @@
// c_rarg2 - K (key) in little endian int array
//
address generate_aescrypt_encryptBlock() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "aescrypt_encryptBlock");
Label L_doLast;
address start = __ pc();
- const Register from = rsi; // source array address
+ const Register from = rdx; // source array address
const Register to = rdx; // destination array address
const Register key = rcx; // key array address
const Register keylen = rax;
@@ -2189,47 +2189,74 @@
const Address key_param (rbp, 8+8);
const XMMRegister xmm_result = xmm0;
- const XMMRegister xmm_temp = xmm1;
- const XMMRegister xmm_key_shuf_mask = xmm2;
-
- __ enter(); // required for proper stackwalking of RuntimeStub frame
- __ push(rsi);
- __ movptr(from , from_param);
- __ movptr(to , to_param);
- __ movptr(key , key_param);
-
+ const XMMRegister xmm_key_shuf_mask = xmm1;
+ const XMMRegister xmm_temp1 = xmm2;
+ const XMMRegister xmm_temp2 = xmm3;
+ const XMMRegister xmm_temp3 = xmm4;
+ const XMMRegister xmm_temp4 = xmm5;
+
+ __ enter(); // required for proper stackwalking of RuntimeStub frame
+ __ movptr(from, from_param);
+ __ movptr(key, key_param);
+
+ // keylen could be only {11, 13, 15} * 4 = {44, 52, 60}
__ movl(keylen, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT)));
- // keylen = # of 32-bit words, convert to 128-bit words
- __ shrl(keylen, 2);
- __ subl(keylen, 11); // every key has at least 11 128-bit words, some have more
__ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr()));
__ movdqu(xmm_result, Address(from, 0)); // get 16 bytes of input
+ __ movptr(to, to_param);
// For encryption, the java expanded key ordering is just what we need
- load_key(xmm_temp, key, 0x00, xmm_key_shuf_mask);
- __ pxor(xmm_result, xmm_temp);
- for (int offset = 0x10; offset <= 0x90; offset += 0x10) {
- aes_enc_key(xmm_result, xmm_temp, key, offset, xmm_key_shuf_mask);
- }
- load_key (xmm_temp, key, 0xa0, xmm_key_shuf_mask);
- __ cmpl(keylen, 0);
- __ jcc(Assembler::equal, L_doLast);
- __ aesenc(xmm_result, xmm_temp); // only in 192 and 256 bit keys
- aes_enc_key(xmm_result, xmm_temp, key, 0xb0, xmm_key_shuf_mask);
- load_key(xmm_temp, key, 0xc0, xmm_key_shuf_mask);
- __ subl(keylen, 2);
- __ jcc(Assembler::equal, L_doLast);
- __ aesenc(xmm_result, xmm_temp); // only in 256 bit keys
- aes_enc_key(xmm_result, xmm_temp, key, 0xd0, xmm_key_shuf_mask);
- load_key(xmm_temp, key, 0xe0, xmm_key_shuf_mask);
+ load_key(xmm_temp1, key, 0x00, xmm_key_shuf_mask);
+ __ pxor(xmm_result, xmm_temp1);
+
+ load_key(xmm_temp1, key, 0x10, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x20, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x30, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x40, xmm_key_shuf_mask);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+ __ aesenc(xmm_result, xmm_temp3);
+ __ aesenc(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x50, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x60, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x70, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x80, xmm_key_shuf_mask);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+ __ aesenc(xmm_result, xmm_temp3);
+ __ aesenc(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x90, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xa0, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 44);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xb0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xc0, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 52);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xd0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xe0, xmm_key_shuf_mask);
__ BIND(L_doLast);
- __ aesenclast(xmm_result, xmm_temp);
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenclast(xmm_result, xmm_temp2);
__ movdqu(Address(to, 0), xmm_result); // store the result
__ xorptr(rax, rax); // return 0
- __ pop(rsi);
__ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0);
@@ -2245,13 +2272,13 @@
// c_rarg2 - K (key) in little endian int array
//
address generate_aescrypt_decryptBlock() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "aescrypt_decryptBlock");
Label L_doLast;
address start = __ pc();
- const Register from = rsi; // source array address
+ const Register from = rdx; // source array address
const Register to = rdx; // destination array address
const Register key = rcx; // key array address
const Register keylen = rax;
@@ -2260,51 +2287,76 @@
const Address key_param (rbp, 8+8);
const XMMRegister xmm_result = xmm0;
- const XMMRegister xmm_temp = xmm1;
- const XMMRegister xmm_key_shuf_mask = xmm2;
+ const XMMRegister xmm_key_shuf_mask = xmm1;
+ const XMMRegister xmm_temp1 = xmm2;
+ const XMMRegister xmm_temp2 = xmm3;
+ const XMMRegister xmm_temp3 = xmm4;
+ const XMMRegister xmm_temp4 = xmm5;
__ enter(); // required for proper stackwalking of RuntimeStub frame
- __ push(rsi);
- __ movptr(from , from_param);
- __ movptr(to , to_param);
- __ movptr(key , key_param);
-
+ __ movptr(from, from_param);
+ __ movptr(key, key_param);
+
+ // keylen could be only {11, 13, 15} * 4 = {44, 52, 60}
__ movl(keylen, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT)));
- // keylen = # of 32-bit words, convert to 128-bit words
- __ shrl(keylen, 2);
- __ subl(keylen, 11); // every key has at least 11 128-bit words, some have more
__ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr()));
__ movdqu(xmm_result, Address(from, 0));
+ __ movptr(to, to_param);
// for decryption java expanded key ordering is rotated one position from what we want
// so we start from 0x10 here and hit 0x00 last
// we don't know if the key is aligned, hence not using load-execute form
- load_key(xmm_temp, key, 0x10, xmm_key_shuf_mask);
- __ pxor (xmm_result, xmm_temp);
- for (int offset = 0x20; offset <= 0xa0; offset += 0x10) {
- aes_dec_key(xmm_result, xmm_temp, key, offset, xmm_key_shuf_mask);
- }
- __ cmpl(keylen, 0);
- __ jcc(Assembler::equal, L_doLast);
- // only in 192 and 256 bit keys
- aes_dec_key(xmm_result, xmm_temp, key, 0xb0, xmm_key_shuf_mask);
- aes_dec_key(xmm_result, xmm_temp, key, 0xc0, xmm_key_shuf_mask);
- __ subl(keylen, 2);
- __ jcc(Assembler::equal, L_doLast);
- // only in 256 bit keys
- aes_dec_key(xmm_result, xmm_temp, key, 0xd0, xmm_key_shuf_mask);
- aes_dec_key(xmm_result, xmm_temp, key, 0xe0, xmm_key_shuf_mask);
+ load_key(xmm_temp1, key, 0x10, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x20, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x30, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x40, xmm_key_shuf_mask);
+
+ __ pxor (xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+ __ aesdec(xmm_result, xmm_temp3);
+ __ aesdec(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x50, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x60, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x70, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x80, xmm_key_shuf_mask);
+
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+ __ aesdec(xmm_result, xmm_temp3);
+ __ aesdec(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x90, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xa0, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x00, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 44);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xb0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xc0, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 52);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xd0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xe0, xmm_key_shuf_mask);
__ BIND(L_doLast);
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+
// for decryption the aesdeclast operation is always on key+0x00
- load_key(xmm_temp, key, 0x00, xmm_key_shuf_mask);
- __ aesdeclast(xmm_result, xmm_temp);
-
+ __ aesdeclast(xmm_result, xmm_temp3);
__ movdqu(Address(to, 0), xmm_result); // store the result
-
__ xorptr(rax, rax); // return 0
- __ pop(rsi);
__ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0);
@@ -2340,7 +2392,7 @@
// c_rarg4 - input length
//
address generate_cipherBlockChaining_encryptAESCrypt() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_encryptAESCrypt");
address start = __ pc();
@@ -2393,7 +2445,7 @@
__ jcc(Assembler::notEqual, L_key_192_256);
// 128 bit code follows here
- __ movptr(pos, 0);
+ __ movl(pos, 0);
__ align(OptoLoopAlignment);
__ BIND(L_loopTop_128);
__ movdqu(xmm_temp, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of input
@@ -2423,15 +2475,15 @@
__ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0);
- __ BIND(L_key_192_256);
- // here rax = len in ints of AESCrypt.KLE array (52=192, or 60=256)
+ __ BIND(L_key_192_256);
+ // here rax = len in ints of AESCrypt.KLE array (52=192, or 60=256)
__ cmpl(rax, 52);
__ jcc(Assembler::notEqual, L_key_256);
// 192-bit code follows here (could be changed to use more xmm registers)
- __ movptr(pos, 0);
- __ align(OptoLoopAlignment);
- __ BIND(L_loopTop_192);
+ __ movl(pos, 0);
+ __ align(OptoLoopAlignment);
+ __ BIND(L_loopTop_192);
__ movdqu(xmm_temp, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of input
__ pxor (xmm_result, xmm_temp); // xor with the current r vector
@@ -2452,11 +2504,11 @@
__ jcc(Assembler::notEqual, L_loopTop_192);
__ jmp(L_exit);
- __ BIND(L_key_256);
+ __ BIND(L_key_256);
// 256-bit code follows here (could be changed to use more xmm registers)
- __ movptr(pos, 0);
- __ align(OptoLoopAlignment);
- __ BIND(L_loopTop_256);
+ __ movl(pos, 0);
+ __ align(OptoLoopAlignment);
+ __ BIND(L_loopTop_256);
__ movdqu(xmm_temp, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of input
__ pxor (xmm_result, xmm_temp); // xor with the current r vector
@@ -2495,7 +2547,7 @@
//
address generate_cipherBlockChaining_decryptAESCrypt() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_decryptAESCrypt");
address start = __ pc();
@@ -2556,9 +2608,9 @@
// 128-bit code follows here, parallelized
- __ movptr(pos, 0);
- __ align(OptoLoopAlignment);
- __ BIND(L_singleBlock_loopTop_128);
+ __ movl(pos, 0);
+ __ align(OptoLoopAlignment);
+ __ BIND(L_singleBlock_loopTop_128);
__ cmpptr(len_reg, 0); // any blocks left??
__ jcc(Assembler::equal, L_exit);
__ movdqu(xmm_result, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of cipher input
@@ -2597,7 +2649,7 @@
__ jcc(Assembler::notEqual, L_key_256);
// 192-bit code follows here (could be optimized to use parallelism)
- __ movptr(pos, 0);
+ __ movl(pos, 0);
__ align(OptoLoopAlignment);
__ BIND(L_singleBlock_loopTop_192);
__ movdqu(xmm_result, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of cipher input
@@ -2622,7 +2674,7 @@
__ BIND(L_key_256);
// 256-bit code follows here (could be optimized to use parallelism)
- __ movptr(pos, 0);
+ __ movl(pos, 0);
__ align(OptoLoopAlignment);
__ BIND(L_singleBlock_loopTop_256);
__ movdqu(xmm_result, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of cipher input
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -2953,21 +2953,6 @@
}
}
- // aesenc using specified key+offset
- // can optionally specify that the shuffle mask is already in an xmmregister
- void aes_enc_key(XMMRegister xmmdst, XMMRegister xmmtmp, Register key, int offset, XMMRegister xmm_shuf_mask=NULL) {
- load_key(xmmtmp, key, offset, xmm_shuf_mask);
- __ aesenc(xmmdst, xmmtmp);
- }
-
- // aesdec using specified key+offset
- // can optionally specify that the shuffle mask is already in an xmmregister
- void aes_dec_key(XMMRegister xmmdst, XMMRegister xmmtmp, Register key, int offset, XMMRegister xmm_shuf_mask=NULL) {
- load_key(xmmtmp, key, offset, xmm_shuf_mask);
- __ aesdec(xmmdst, xmmtmp);
- }
-
-
// Arguments:
//
// Inputs:
@@ -2976,7 +2961,7 @@
// c_rarg2 - K (key) in little endian int array
//
address generate_aescrypt_encryptBlock() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "aescrypt_encryptBlock");
Label L_doLast;
@@ -2988,15 +2973,17 @@
const Register keylen = rax;
const XMMRegister xmm_result = xmm0;
- const XMMRegister xmm_temp = xmm1;
- const XMMRegister xmm_key_shuf_mask = xmm2;
+ const XMMRegister xmm_key_shuf_mask = xmm1;
+ // On win64 xmm6-xmm15 must be preserved so don't use them.
+ const XMMRegister xmm_temp1 = xmm2;
+ const XMMRegister xmm_temp2 = xmm3;
+ const XMMRegister xmm_temp3 = xmm4;
+ const XMMRegister xmm_temp4 = xmm5;
__ enter(); // required for proper stackwalking of RuntimeStub frame
+ // keylen could be only {11, 13, 15} * 4 = {44, 52, 60}
__ movl(keylen, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT)));
- // keylen = # of 32-bit words, convert to 128-bit words
- __ shrl(keylen, 2);
- __ subl(keylen, 11); // every key has at least 11 128-bit words, some have more
__ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr()));
__ movdqu(xmm_result, Address(from, 0)); // get 16 bytes of input
@@ -3004,25 +2991,53 @@
// For encryption, the java expanded key ordering is just what we need
// we don't know if the key is aligned, hence not using load-execute form
- load_key(xmm_temp, key, 0x00, xmm_key_shuf_mask);
- __ pxor(xmm_result, xmm_temp);
- for (int offset = 0x10; offset <= 0x90; offset += 0x10) {
- aes_enc_key(xmm_result, xmm_temp, key, offset, xmm_key_shuf_mask);
- }
- load_key (xmm_temp, key, 0xa0, xmm_key_shuf_mask);
- __ cmpl(keylen, 0);
- __ jcc(Assembler::equal, L_doLast);
- __ aesenc(xmm_result, xmm_temp); // only in 192 and 256 bit keys
- aes_enc_key(xmm_result, xmm_temp, key, 0xb0, xmm_key_shuf_mask);
- load_key(xmm_temp, key, 0xc0, xmm_key_shuf_mask);
- __ subl(keylen, 2);
- __ jcc(Assembler::equal, L_doLast);
- __ aesenc(xmm_result, xmm_temp); // only in 256 bit keys
- aes_enc_key(xmm_result, xmm_temp, key, 0xd0, xmm_key_shuf_mask);
- load_key(xmm_temp, key, 0xe0, xmm_key_shuf_mask);
+ load_key(xmm_temp1, key, 0x00, xmm_key_shuf_mask);
+ __ pxor(xmm_result, xmm_temp1);
+
+ load_key(xmm_temp1, key, 0x10, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x20, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x30, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x40, xmm_key_shuf_mask);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+ __ aesenc(xmm_result, xmm_temp3);
+ __ aesenc(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x50, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x60, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x70, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x80, xmm_key_shuf_mask);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+ __ aesenc(xmm_result, xmm_temp3);
+ __ aesenc(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x90, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xa0, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 44);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xb0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xc0, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 52);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xd0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xe0, xmm_key_shuf_mask);
__ BIND(L_doLast);
- __ aesenclast(xmm_result, xmm_temp);
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenclast(xmm_result, xmm_temp2);
__ movdqu(Address(to, 0), xmm_result); // store the result
__ xorptr(rax, rax); // return 0
__ leave(); // required for proper stackwalking of RuntimeStub frame
@@ -3040,7 +3055,7 @@
// c_rarg2 - K (key) in little endian int array
//
address generate_aescrypt_decryptBlock() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "aescrypt_decryptBlock");
Label L_doLast;
@@ -3052,15 +3067,17 @@
const Register keylen = rax;
const XMMRegister xmm_result = xmm0;
- const XMMRegister xmm_temp = xmm1;
- const XMMRegister xmm_key_shuf_mask = xmm2;
+ const XMMRegister xmm_key_shuf_mask = xmm1;
+ // On win64 xmm6-xmm15 must be preserved so don't use them.
+ const XMMRegister xmm_temp1 = xmm2;
+ const XMMRegister xmm_temp2 = xmm3;
+ const XMMRegister xmm_temp3 = xmm4;
+ const XMMRegister xmm_temp4 = xmm5;
__ enter(); // required for proper stackwalking of RuntimeStub frame
+ // keylen could be only {11, 13, 15} * 4 = {44, 52, 60}
__ movl(keylen, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT)));
- // keylen = # of 32-bit words, convert to 128-bit words
- __ shrl(keylen, 2);
- __ subl(keylen, 11); // every key has at least 11 128-bit words, some have more
__ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr()));
__ movdqu(xmm_result, Address(from, 0));
@@ -3068,29 +3085,55 @@
// for decryption java expanded key ordering is rotated one position from what we want
// so we start from 0x10 here and hit 0x00 last
// we don't know if the key is aligned, hence not using load-execute form
- load_key(xmm_temp, key, 0x10, xmm_key_shuf_mask);
- __ pxor (xmm_result, xmm_temp);
- for (int offset = 0x20; offset <= 0xa0; offset += 0x10) {
- aes_dec_key(xmm_result, xmm_temp, key, offset, xmm_key_shuf_mask);
- }
- __ cmpl(keylen, 0);
- __ jcc(Assembler::equal, L_doLast);
- // only in 192 and 256 bit keys
- aes_dec_key(xmm_result, xmm_temp, key, 0xb0, xmm_key_shuf_mask);
- aes_dec_key(xmm_result, xmm_temp, key, 0xc0, xmm_key_shuf_mask);
- __ subl(keylen, 2);
- __ jcc(Assembler::equal, L_doLast);
- // only in 256 bit keys
- aes_dec_key(xmm_result, xmm_temp, key, 0xd0, xmm_key_shuf_mask);
- aes_dec_key(xmm_result, xmm_temp, key, 0xe0, xmm_key_shuf_mask);
+ load_key(xmm_temp1, key, 0x10, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x20, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x30, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x40, xmm_key_shuf_mask);
+
+ __ pxor (xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+ __ aesdec(xmm_result, xmm_temp3);
+ __ aesdec(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x50, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x60, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x70, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x80, xmm_key_shuf_mask);
+
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+ __ aesdec(xmm_result, xmm_temp3);
+ __ aesdec(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x90, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xa0, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x00, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 44);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xb0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xc0, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 52);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xd0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xe0, xmm_key_shuf_mask);
__ BIND(L_doLast);
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+
// for decryption the aesdeclast operation is always on key+0x00
- load_key(xmm_temp, key, 0x00, xmm_key_shuf_mask);
- __ aesdeclast(xmm_result, xmm_temp);
-
+ __ aesdeclast(xmm_result, xmm_temp3);
__ movdqu(Address(to, 0), xmm_result); // store the result
-
__ xorptr(rax, rax); // return 0
__ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0);
@@ -3109,7 +3152,7 @@
// c_rarg4 - input length
//
address generate_cipherBlockChaining_encryptAESCrypt() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_encryptAESCrypt");
address start = __ pc();
@@ -3133,16 +3176,19 @@
const XMMRegister xmm_temp = xmm1;
// keys 0-10 preloaded into xmm2-xmm12
const int XMM_REG_NUM_KEY_FIRST = 2;
- const int XMM_REG_NUM_KEY_LAST = 12;
+ const int XMM_REG_NUM_KEY_LAST = 15;
const XMMRegister xmm_key0 = as_XMMRegister(XMM_REG_NUM_KEY_FIRST);
- const XMMRegister xmm_key10 = as_XMMRegister(XMM_REG_NUM_KEY_LAST);
+ const XMMRegister xmm_key10 = as_XMMRegister(XMM_REG_NUM_KEY_FIRST+10);
+ const XMMRegister xmm_key11 = as_XMMRegister(XMM_REG_NUM_KEY_FIRST+11);
+ const XMMRegister xmm_key12 = as_XMMRegister(XMM_REG_NUM_KEY_FIRST+12);
+ const XMMRegister xmm_key13 = as_XMMRegister(XMM_REG_NUM_KEY_FIRST+13);
__ enter(); // required for proper stackwalking of RuntimeStub frame
#ifdef _WIN64
// on win64, fill len_reg from stack position
__ movl(len_reg, len_mem);
- // save the xmm registers which must be preserved 6-12
+ // save the xmm registers which must be preserved 6-15
__ subptr(rsp, -rsp_after_call_off * wordSize);
for (int i = 6; i <= XMM_REG_NUM_KEY_LAST; i++) {
__ movdqu(xmm_save(i), as_XMMRegister(i));
@@ -3151,12 +3197,11 @@
const XMMRegister xmm_key_shuf_mask = xmm_temp; // used temporarily to swap key bytes up front
__ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr()));
- // load up xmm regs 2 thru 12 with key 0x00 - 0xa0
- for (int rnum = XMM_REG_NUM_KEY_FIRST, offset = 0x00; rnum <= XMM_REG_NUM_KEY_LAST; rnum++) {
+ // load up xmm regs xmm2 thru xmm12 with key 0x00 - 0xa0
+ for (int rnum = XMM_REG_NUM_KEY_FIRST, offset = 0x00; rnum <= XMM_REG_NUM_KEY_FIRST+10; rnum++) {
load_key(as_XMMRegister(rnum), key, offset, xmm_key_shuf_mask);
offset += 0x10;
}
-
__ movdqu(xmm_result, Address(rvec, 0x00)); // initialize xmm_result with r vec
// now split to different paths depending on the keylen (len in ints of AESCrypt.KLE array (52=192, or 60=256))
@@ -3167,16 +3212,15 @@
// 128 bit code follows here
__ movptr(pos, 0);
__ align(OptoLoopAlignment);
+
__ BIND(L_loopTop_128);
__ movdqu(xmm_temp, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of input
__ pxor (xmm_result, xmm_temp); // xor with the current r vector
-
__ pxor (xmm_result, xmm_key0); // do the aes rounds
- for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_LAST - 1; rnum++) {
+ for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_FIRST + 9; rnum++) {
__ aesenc(xmm_result, as_XMMRegister(rnum));
}
__ aesenclast(xmm_result, xmm_key10);
-
__ movdqu(Address(to, pos, Address::times_1, 0), xmm_result); // store into the next 16 bytes of output
// no need to store r to memory until we exit
__ addptr(pos, AESBlockSize);
@@ -3198,24 +3242,23 @@
__ BIND(L_key_192_256);
// here rax = len in ints of AESCrypt.KLE array (52=192, or 60=256)
+ load_key(xmm_key11, key, 0xb0, xmm_key_shuf_mask);
+ load_key(xmm_key12, key, 0xc0, xmm_key_shuf_mask);
__ cmpl(rax, 52);
__ jcc(Assembler::notEqual, L_key_256);
// 192-bit code follows here (could be changed to use more xmm registers)
__ movptr(pos, 0);
__ align(OptoLoopAlignment);
+
__ BIND(L_loopTop_192);
__ movdqu(xmm_temp, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of input
__ pxor (xmm_result, xmm_temp); // xor with the current r vector
-
__ pxor (xmm_result, xmm_key0); // do the aes rounds
- for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_LAST; rnum++) {
+ for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_FIRST + 11; rnum++) {
__ aesenc(xmm_result, as_XMMRegister(rnum));
}
- aes_enc_key(xmm_result, xmm_temp, key, 0xb0);
- load_key(xmm_temp, key, 0xc0);
- __ aesenclast(xmm_result, xmm_temp);
-
+ __ aesenclast(xmm_result, xmm_key12);
__ movdqu(Address(to, pos, Address::times_1, 0), xmm_result); // store into the next 16 bytes of output
// no need to store r to memory until we exit
__ addptr(pos, AESBlockSize);
@@ -3225,22 +3268,19 @@
__ BIND(L_key_256);
// 256-bit code follows here (could be changed to use more xmm registers)
+ load_key(xmm_key13, key, 0xd0, xmm_key_shuf_mask);
__ movptr(pos, 0);
__ align(OptoLoopAlignment);
+
__ BIND(L_loopTop_256);
__ movdqu(xmm_temp, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of input
__ pxor (xmm_result, xmm_temp); // xor with the current r vector
-
__ pxor (xmm_result, xmm_key0); // do the aes rounds
- for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_LAST; rnum++) {
+ for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_FIRST + 13; rnum++) {
__ aesenc(xmm_result, as_XMMRegister(rnum));
}
- aes_enc_key(xmm_result, xmm_temp, key, 0xb0);
- aes_enc_key(xmm_result, xmm_temp, key, 0xc0);
- aes_enc_key(xmm_result, xmm_temp, key, 0xd0);
load_key(xmm_temp, key, 0xe0);
__ aesenclast(xmm_result, xmm_temp);
-
__ movdqu(Address(to, pos, Address::times_1, 0), xmm_result); // store into the next 16 bytes of output
// no need to store r to memory until we exit
__ addptr(pos, AESBlockSize);
@@ -3267,7 +3307,7 @@
//
address generate_cipherBlockChaining_decryptAESCrypt_Parallel() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_decryptAESCrypt");
address start = __ pc();
@@ -3288,12 +3328,10 @@
#endif
const Register pos = rax;
- // xmm register assignments for the loops below
- const XMMRegister xmm_result = xmm0;
// keys 0-10 preloaded into xmm2-xmm12
const int XMM_REG_NUM_KEY_FIRST = 5;
const int XMM_REG_NUM_KEY_LAST = 15;
- const XMMRegister xmm_key_first = as_XMMRegister(XMM_REG_NUM_KEY_FIRST);
+ const XMMRegister xmm_key_first = as_XMMRegister(XMM_REG_NUM_KEY_FIRST);
const XMMRegister xmm_key_last = as_XMMRegister(XMM_REG_NUM_KEY_LAST);
__ enter(); // required for proper stackwalking of RuntimeStub frame
@@ -3312,13 +3350,14 @@
const XMMRegister xmm_key_shuf_mask = xmm1; // used temporarily to swap key bytes up front
__ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr()));
// load up xmm regs 5 thru 15 with key 0x10 - 0xa0 - 0x00
- for (int rnum = XMM_REG_NUM_KEY_FIRST, offset = 0x10; rnum <= XMM_REG_NUM_KEY_LAST; rnum++) {
- if (rnum == XMM_REG_NUM_KEY_LAST) offset = 0x00;
+ for (int rnum = XMM_REG_NUM_KEY_FIRST, offset = 0x10; rnum < XMM_REG_NUM_KEY_LAST; rnum++) {
load_key(as_XMMRegister(rnum), key, offset, xmm_key_shuf_mask);
offset += 0x10;
}
+ load_key(xmm_key_last, key, 0x00, xmm_key_shuf_mask);
const XMMRegister xmm_prev_block_cipher = xmm1; // holds cipher of previous block
+
// registers holding the four results in the parallelized loop
const XMMRegister xmm_result0 = xmm0;
const XMMRegister xmm_result1 = xmm2;
@@ -3376,8 +3415,12 @@
__ jmp(L_multiBlock_loopTop_128);
// registers used in the non-parallelized loops
+ // xmm register assignments for the loops below
+ const XMMRegister xmm_result = xmm0;
const XMMRegister xmm_prev_block_cipher_save = xmm2;
- const XMMRegister xmm_temp = xmm3;
+ const XMMRegister xmm_key11 = xmm3;
+ const XMMRegister xmm_key12 = xmm4;
+ const XMMRegister xmm_temp = xmm4;
__ align(OptoLoopAlignment);
__ BIND(L_singleBlock_loopTop_128);
@@ -3415,12 +3458,15 @@
__ BIND(L_key_192_256);
// here rax = len in ints of AESCrypt.KLE array (52=192, or 60=256)
+ load_key(xmm_key11, key, 0xb0);
__ cmpl(rax, 52);
__ jcc(Assembler::notEqual, L_key_256);
// 192-bit code follows here (could be optimized to use parallelism)
+ load_key(xmm_key12, key, 0xc0); // 192-bit key goes up to c0
__ movptr(pos, 0);
__ align(OptoLoopAlignment);
+
__ BIND(L_singleBlock_loopTop_192);
__ movdqu(xmm_result, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of cipher input
__ movdqa(xmm_prev_block_cipher_save, xmm_result); // save for next r vector
@@ -3428,14 +3474,13 @@
for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_LAST - 1; rnum++) {
__ aesdec(xmm_result, as_XMMRegister(rnum));
}
- aes_dec_key(xmm_result, xmm_temp, key, 0xb0); // 192-bit key goes up to c0
- aes_dec_key(xmm_result, xmm_temp, key, 0xc0);
+ __ aesdec(xmm_result, xmm_key11);
+ __ aesdec(xmm_result, xmm_key12);
__ aesdeclast(xmm_result, xmm_key_last); // xmm15 always came from key+0
__ pxor (xmm_result, xmm_prev_block_cipher); // xor with the current r vector
- __ movdqu(Address(to, pos, Address::times_1, 0), xmm_result); // store into the next 16 bytes of output
+ __ movdqu(Address(to, pos, Address::times_1, 0), xmm_result); // store into the next 16 bytes of output
// no need to store r to memory until we exit
- __ movdqa(xmm_prev_block_cipher, xmm_prev_block_cipher_save); // set up next r vector with cipher input from this block
-
+ __ movdqa(xmm_prev_block_cipher, xmm_prev_block_cipher_save); // set up next r vector with cipher input from this block
__ addptr(pos, AESBlockSize);
__ subptr(len_reg, AESBlockSize);
__ jcc(Assembler::notEqual,L_singleBlock_loopTop_192);
@@ -3445,23 +3490,26 @@
// 256-bit code follows here (could be optimized to use parallelism)
__ movptr(pos, 0);
__ align(OptoLoopAlignment);
+
__ BIND(L_singleBlock_loopTop_256);
- __ movdqu(xmm_result, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of cipher input
+ __ movdqu(xmm_result, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of cipher input
__ movdqa(xmm_prev_block_cipher_save, xmm_result); // save for next r vector
__ pxor (xmm_result, xmm_key_first); // do the aes dec rounds
for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_LAST - 1; rnum++) {
__ aesdec(xmm_result, as_XMMRegister(rnum));
}
- aes_dec_key(xmm_result, xmm_temp, key, 0xb0); // 256-bit key goes up to e0
- aes_dec_key(xmm_result, xmm_temp, key, 0xc0);
- aes_dec_key(xmm_result, xmm_temp, key, 0xd0);
- aes_dec_key(xmm_result, xmm_temp, key, 0xe0);
- __ aesdeclast(xmm_result, xmm_key_last); // xmm15 came from key+0
+ __ aesdec(xmm_result, xmm_key11);
+ load_key(xmm_temp, key, 0xc0);
+ __ aesdec(xmm_result, xmm_temp);
+ load_key(xmm_temp, key, 0xd0);
+ __ aesdec(xmm_result, xmm_temp);
+ load_key(xmm_temp, key, 0xe0); // 256-bit key goes up to e0
+ __ aesdec(xmm_result, xmm_temp);
+ __ aesdeclast(xmm_result, xmm_key_last); // xmm15 came from key+0
__ pxor (xmm_result, xmm_prev_block_cipher); // xor with the current r vector
- __ movdqu(Address(to, pos, Address::times_1, 0), xmm_result); // store into the next 16 bytes of output
+ __ movdqu(Address(to, pos, Address::times_1, 0), xmm_result); // store into the next 16 bytes of output
// no need to store r to memory until we exit
- __ movdqa(xmm_prev_block_cipher, xmm_prev_block_cipher_save); // set up next r vector with cipher input from this block
-
+ __ movdqa(xmm_prev_block_cipher, xmm_prev_block_cipher_save); // set up next r vector with cipher input from this block
__ addptr(pos, AESBlockSize);
__ subptr(len_reg, AESBlockSize);
__ jcc(Assembler::notEqual,L_singleBlock_loopTop_256);
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -424,8 +424,6 @@
// C++ interpreter only
// rsi - previous interpreter state pointer
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
-
// InterpreterRuntime::frequency_counter_overflow takes one argument
// indicating if the counter overflow occurs at a backwards branch (non-NULL bcp).
// The call returns the address of the verified entry point for the method or NULL
@@ -868,12 +866,13 @@
// rsi: previous interpreter state (C++ interpreter) must preserve
address entry_point = __ pc();
-
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
+ const Address constMethod (rbx, Method::const_offset());
const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset());
const Address access_flags (rbx, Method::access_flags_offset());
+ const Address size_of_parameters(rcx, ConstMethod::size_of_parameters_offset());
// get parameter size (always needed)
+ __ movptr(rcx, constMethod);
__ load_unsigned_short(rcx, size_of_parameters);
// native calls don't need the stack size check since they have no expression stack
@@ -988,7 +987,9 @@
// allocate space for parameters
__ get_method(method);
- __ load_unsigned_short(t, Address(method, Method::size_of_parameters_offset()));
+ __ movptr(t, Address(method, Method::const_offset()));
+ __ load_unsigned_short(t, Address(t, ConstMethod::size_of_parameters_offset()));
+
__ shlptr(t, Interpreter::logStackElementSize);
__ addptr(t, 2*wordSize); // allocate two more slots for JNIEnv and possible mirror
__ subptr(rsp, t);
@@ -1297,13 +1298,14 @@
// rsi: sender sp
address entry_point = __ pc();
-
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
- const Address size_of_locals (rbx, Method::size_of_locals_offset());
+ const Address constMethod (rbx, Method::const_offset());
const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset());
const Address access_flags (rbx, Method::access_flags_offset());
+ const Address size_of_parameters(rdx, ConstMethod::size_of_parameters_offset());
+ const Address size_of_locals (rdx, ConstMethod::size_of_locals_offset());
// get parameter size (always needed)
+ __ movptr(rdx, constMethod);
__ load_unsigned_short(rcx, size_of_parameters);
// rbx,: Method*
@@ -1734,7 +1736,8 @@
// Compute size of arguments for saving when returning to deoptimized caller
__ get_method(rax);
- __ load_unsigned_short(rax, Address(rax, in_bytes(Method::size_of_parameters_offset())));
+ __ movptr(rax, Address(rax, Method::const_offset()));
+ __ load_unsigned_short(rax, Address(rax, ConstMethod::size_of_parameters_offset()));
__ shlptr(rax, Interpreter::logStackElementSize);
__ restore_locals();
__ subptr(rdi, rax);
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -369,9 +369,6 @@
// Everything as it was on entry
// rdx is not restored. Doesn't appear to really be set.
- const Address size_of_parameters(rbx,
- Method::size_of_parameters_offset());
-
// InterpreterRuntime::frequency_counter_overflow takes two
// arguments, the first (thread) is passed by call_VM, the second
// indicates if the counter overflow occurs at a backwards branch
@@ -844,14 +841,17 @@
address entry_point = __ pc();
- const Address size_of_parameters(rbx, Method::
- size_of_parameters_offset());
+ const Address constMethod (rbx, Method::const_offset());
const Address invocation_counter(rbx, Method::
invocation_counter_offset() +
InvocationCounter::counter_offset());
const Address access_flags (rbx, Method::access_flags_offset());
+ const Address size_of_parameters(rcx, ConstMethod::
+ size_of_parameters_offset());
+
// get parameter size (always needed)
+ __ movptr(rcx, constMethod);
__ load_unsigned_short(rcx, size_of_parameters);
// native calls don't need the stack size check since they have no
@@ -967,9 +967,8 @@
// allocate space for parameters
__ get_method(method);
- __ load_unsigned_short(t,
- Address(method,
- Method::size_of_parameters_offset()));
+ __ movptr(t, Address(method, Method::const_offset()));
+ __ load_unsigned_short(t, Address(t, ConstMethod::size_of_parameters_offset()));
__ shll(t, Interpreter::logStackElementSize);
__ subptr(rsp, t);
@@ -1302,15 +1301,18 @@
// r13: sender sp
address entry_point = __ pc();
- const Address size_of_parameters(rbx,
- Method::size_of_parameters_offset());
- const Address size_of_locals(rbx, Method::size_of_locals_offset());
+ const Address constMethod(rbx, Method::const_offset());
const Address invocation_counter(rbx,
Method::invocation_counter_offset() +
InvocationCounter::counter_offset());
const Address access_flags(rbx, Method::access_flags_offset());
+ const Address size_of_parameters(rdx,
+ ConstMethod::size_of_parameters_offset());
+ const Address size_of_locals(rdx, ConstMethod::size_of_locals_offset());
+
// get parameter size (always needed)
+ __ movptr(rdx, constMethod);
__ load_unsigned_short(rcx, size_of_parameters);
// rbx: Method*
@@ -1752,7 +1754,8 @@
// Compute size of arguments for saving when returning to
// deoptimized caller
__ get_method(rax);
- __ load_unsigned_short(rax, Address(rax, in_bytes(Method::
+ __ movptr(rax, Address(rax, Method::const_offset()));
+ __ load_unsigned_short(rax, Address(rax, in_bytes(ConstMethod::
size_of_parameters_offset())));
__ shll(rax, Interpreter::logStackElementSize);
__ restore_locals(); // XXX do we need this?
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -489,8 +489,8 @@
}
// The AES intrinsic stubs require AES instruction support (of course)
- // but also require AVX and sse3 modes for instructions it use.
- if (UseAES && (UseAVX > 0) && (UseSSE > 2)) {
+ // but also require sse3 mode for instructions it use.
+ if (UseAES && (UseSSE > 2)) {
if (FLAG_IS_DEFAULT(UseAESIntrinsics)) {
UseAESIntrinsics = true;
}
--- a/hotspot/src/cpu/zero/vm/assembler_zero.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/zero/vm/assembler_zero.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -56,15 +56,9 @@
ShouldNotCallThis();
}
-#ifndef PRODUCT
-void Assembler::pd_print_patched_instruction(address branch) {
- ShouldNotCallThis();
-}
-#endif // PRODUCT
-
void MacroAssembler::align(int modulus) {
while (offset() % modulus != 0)
- emit_byte(AbstractAssembler::code_fill_byte());
+ emit_int8(AbstractAssembler::code_fill_byte());
}
void MacroAssembler::bang_stack_with_offset(int offset) {
@@ -72,8 +66,7 @@
}
void MacroAssembler::advance(int bytes) {
- _code_pos += bytes;
- sync();
+ code_section()->set_end(code_section()->end() + bytes);
}
RegisterOrConstant MacroAssembler::delayed_value_impl(
--- a/hotspot/src/cpu/zero/vm/assembler_zero.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/cpu/zero/vm/assembler_zero.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -37,9 +37,6 @@
public:
void pd_patch_instruction(address branch, address target);
-#ifndef PRODUCT
- static void pd_print_patched_instruction(address branch);
-#endif // PRODUCT
};
class MacroAssembler : public Assembler {
--- a/hotspot/src/os/posix/vm/os_posix.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/os/posix/vm/os_posix.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -93,6 +93,47 @@
return;
}
+// Multiple threads can race in this code, and can remap over each other with MAP_FIXED,
+// so on posix, unmap the section at the start and at the end of the chunk that we mapped
+// rather than unmapping and remapping the whole chunk to get requested alignment.
+char* os::reserve_memory_aligned(size_t size, size_t alignment) {
+ assert((alignment & (os::vm_allocation_granularity() - 1)) == 0,
+ "Alignment must be a multiple of allocation granularity (page size)");
+ assert((size & (alignment -1)) == 0, "size must be 'alignment' aligned");
+
+ size_t extra_size = size + alignment;
+ assert(extra_size >= size, "overflow, size is too large to allow alignment");
+
+ char* extra_base = os::reserve_memory(extra_size, NULL, alignment);
+
+ if (extra_base == NULL) {
+ return NULL;
+ }
+
+ // Do manual alignment
+ char* aligned_base = (char*) align_size_up((uintptr_t) extra_base, alignment);
+
+ // [ | | ]
+ // ^ extra_base
+ // ^ extra_base + begin_offset == aligned_base
+ // extra_base + begin_offset + size ^
+ // extra_base + extra_size ^
+ // |<>| == begin_offset
+ // end_offset == |<>|
+ size_t begin_offset = aligned_base - extra_base;
+ size_t end_offset = (extra_base + extra_size) - (aligned_base + size);
+
+ if (begin_offset > 0) {
+ os::release_memory(extra_base, begin_offset);
+ }
+
+ if (end_offset > 0) {
+ os::release_memory(extra_base + begin_offset + size, end_offset);
+ }
+
+ return aligned_base;
+}
+
void os::Posix::print_load_average(outputStream* st) {
st->print("load average:");
double loadavg[3];
--- a/hotspot/src/os/windows/vm/os_windows.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/os/windows/vm/os_windows.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -2895,6 +2895,36 @@
}
}
+// Multiple threads can race in this code but it's not possible to unmap small sections of
+// virtual space to get requested alignment, like posix-like os's.
+// Windows prevents multiple thread from remapping over each other so this loop is thread-safe.
+char* os::reserve_memory_aligned(size_t size, size_t alignment) {
+ assert((alignment & (os::vm_allocation_granularity() - 1)) == 0,
+ "Alignment must be a multiple of allocation granularity (page size)");
+ assert((size & (alignment -1)) == 0, "size must be 'alignment' aligned");
+
+ size_t extra_size = size + alignment;
+ assert(extra_size >= size, "overflow, size is too large to allow alignment");
+
+ char* aligned_base = NULL;
+
+ do {
+ char* extra_base = os::reserve_memory(extra_size, NULL, alignment);
+ if (extra_base == NULL) {
+ return NULL;
+ }
+ // Do manual alignment
+ aligned_base = (char*) align_size_up((uintptr_t) extra_base, alignment);
+
+ os::release_memory(extra_base, extra_size);
+
+ aligned_base = os::reserve_memory(size, aligned_base);
+
+ } while (aligned_base == NULL);
+
+ return aligned_base;
+}
+
char* os::pd_reserve_memory(size_t bytes, char* addr, size_t alignment_hint) {
assert((size_t)addr % os::vm_allocation_granularity() == 0,
"reserve alignment");
--- a/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -116,7 +116,7 @@
ThreadLocalStorage::pd_tlsAccessMode tlsMode = ThreadLocalStorage::pd_getTlsAccessMode ();
if (tlsMode == ThreadLocalStorage::pd_tlsAccessIndirect) { // T1
// Use thread as a temporary: mov r, gs:[0]; mov r, [r+tlsOffset]
- emit_byte (segment);
+ emit_int8 (segment);
// ExternalAddress doesn't work because it can't take NULL
AddressLiteral null(0, relocInfo::none);
movptr (thread, null);
@@ -125,7 +125,7 @@
} else
if (tlsMode == ThreadLocalStorage::pd_tlsAccessDirect) { // T2
// mov r, gs:[tlsOffset]
- emit_byte (segment);
+ emit_int8 (segment);
AddressLiteral tls_off((address)ThreadLocalStorage::pd_getTlsOffset(), relocInfo::none);
movptr (thread, tls_off);
return ;
--- a/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -30,7 +30,7 @@
void MacroAssembler::int3() {
- emit_byte(0xCC);
+ emit_int8((unsigned char)0xCC);
}
#ifndef _LP64
--- a/hotspot/src/share/vm/asm/assembler.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/asm/assembler.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -109,37 +109,6 @@
ICache::invalidate_range(addr_at(0), offset());
}
-
-void AbstractAssembler::a_byte(int x) {
- emit_byte(x);
-}
-
-
-void AbstractAssembler::a_long(jint x) {
- emit_long(x);
-}
-
-// Labels refer to positions in the (to be) generated code. There are bound
-// and unbound
-//
-// Bound labels refer to known positions in the already generated code.
-// offset() is the position the label refers to.
-//
-// Unbound labels refer to unknown positions in the code to be generated; it
-// may contain a list of unresolved displacements that refer to it
-#ifndef PRODUCT
-void AbstractAssembler::print(Label& L) {
- if (L.is_bound()) {
- tty->print_cr("bound label to %d|%d", L.loc_pos(), L.loc_sect());
- } else if (L.is_unbound()) {
- L.print_instructions((MacroAssembler*)this);
- } else {
- tty->print_cr("label in inconsistent state (loc = %d)", L.loc());
- }
-}
-#endif // PRODUCT
-
-
void AbstractAssembler::bind(Label& L) {
if (L.is_bound()) {
// Assembler can bind a label more than once to the same place.
@@ -342,28 +311,3 @@
#endif
return offset < 0 || os::vm_page_size() <= offset;
}
-
-#ifndef PRODUCT
-void Label::print_instructions(MacroAssembler* masm) const {
- CodeBuffer* cb = masm->code();
- for (int i = 0; i < _patch_index; ++i) {
- int branch_loc;
- if (i >= PatchCacheSize) {
- branch_loc = _patch_overflow->at(i - PatchCacheSize);
- } else {
- branch_loc = _patches[i];
- }
- int branch_pos = CodeBuffer::locator_pos(branch_loc);
- int branch_sect = CodeBuffer::locator_sect(branch_loc);
- address branch = cb->locator_address(branch_loc);
- tty->print_cr("unbound label");
- tty->print("@ %d|%d ", branch_pos, branch_sect);
- if (branch_sect == CodeBuffer::SECT_CONSTS) {
- tty->print_cr(PTR_FORMAT, *(address*)branch);
- continue;
- }
- masm->pd_print_patched_instruction(branch);
- tty->cr();
- }
-}
-#endif // ndef PRODUCT
--- a/hotspot/src/share/vm/asm/assembler.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/asm/assembler.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -216,17 +216,6 @@
bool isByte(int x) const { return 0 <= x && x < 0x100; }
bool isShiftCount(int x) const { return 0 <= x && x < 32; }
- void emit_int8( int8_t x) { code_section()->emit_int8( x); }
- void emit_int16( int16_t x) { code_section()->emit_int16( x); }
- void emit_int32( int32_t x) { code_section()->emit_int32( x); }
- void emit_int64( int64_t x) { code_section()->emit_int64( x); }
-
- void emit_float( jfloat x) { code_section()->emit_float( x); }
- void emit_double( jdouble x) { code_section()->emit_double( x); }
- void emit_address(address x) { code_section()->emit_address(x); }
-
- void emit_byte(int x) { emit_int8 (x); } // deprecated
- void emit_word(int x) { emit_int16(x); } // deprecated
void emit_long(jint x) { emit_int32(x); } // deprecated
// Instruction boundaries (required when emitting relocatable values).
@@ -277,9 +266,6 @@
};
#endif
- // Label functions
- void print(Label& L);
-
public:
// Creation
@@ -288,6 +274,15 @@
// ensure buf contains all code (call this before using/copying the code)
void flush();
+ void emit_int8( int8_t x) { code_section()->emit_int8( x); }
+ void emit_int16( int16_t x) { code_section()->emit_int16( x); }
+ void emit_int32( int32_t x) { code_section()->emit_int32( x); }
+ void emit_int64( int64_t x) { code_section()->emit_int64( x); }
+
+ void emit_float( jfloat x) { code_section()->emit_float( x); }
+ void emit_double( jdouble x) { code_section()->emit_double( x); }
+ void emit_address(address x) { code_section()->emit_address(x); }
+
// min and max values for signed immediate ranges
static int min_simm(int nbits) { return -(intptr_t(1) << (nbits - 1)) ; }
static int max_simm(int nbits) { return (intptr_t(1) << (nbits - 1)) - 1; }
@@ -327,8 +322,6 @@
void clear_inst_mark() { code_section()->clear_mark(); }
// Constants in code
- void a_byte(int x);
- void a_long(jint x);
void relocate(RelocationHolder const& rspec, int format = 0) {
assert(!pd_check_instruction_mark()
|| inst_mark() == NULL || inst_mark() == code_section()->end(),
@@ -441,15 +434,6 @@
*/
void pd_patch_instruction(address branch, address target);
-#ifndef PRODUCT
- /**
- * Platform-dependent method of printing an instruction that needs to be
- * patched.
- *
- * @param branch the instruction to be patched in the buffer.
- */
- static void pd_print_patched_instruction(address branch);
-#endif // PRODUCT
};
#ifdef TARGET_ARCH_x86
--- a/hotspot/src/share/vm/asm/codeBuffer.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/asm/codeBuffer.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -496,21 +496,9 @@
dest->verify_section_allocation();
}
-// Anonymous classes need mirror to keep the metadata alive but
-// for regular classes, the class_loader is sufficient.
+// Append an oop reference that keeps the class alive.
static void append_oop_references(GrowableArray<oop>* oops, Klass* k) {
- if (k->oop_is_instance()) {
- InstanceKlass* ik = InstanceKlass::cast(k);
- if (ik->is_anonymous()) {
- oop o = ik->java_mirror();
- assert (o != NULL, "should have a mirror");
- if (!oops->contains(o)) {
- oops->append(o);
- }
- return; // only need the mirror
- }
- }
- oop cl = k->class_loader();
+ oop cl = k->klass_holder();
if (cl != NULL && !oops->contains(cl)) {
oops->append(cl);
}
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -3442,6 +3442,11 @@
preserves_state = true;
break;
+ case vmIntrinsics::_loadFence :
+ case vmIntrinsics::_storeFence:
+ case vmIntrinsics::_fullFence :
+ break;
+
default : return false; // do not inline
}
// create intrinsic node
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -2977,6 +2977,16 @@
do_CompareAndSwap(x, longType);
break;
+ case vmIntrinsics::_loadFence :
+ if (os::is_MP()) __ membar_acquire();
+ break;
+ case vmIntrinsics::_storeFence:
+ if (os::is_MP()) __ membar_release();
+ break;
+ case vmIntrinsics::_fullFence :
+ if (os::is_MP()) __ membar();
+ break;
+
case vmIntrinsics::_Reference_get:
do_Reference_get(x);
break;
--- a/hotspot/src/share/vm/ci/ciField.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/ci/ciField.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -366,10 +366,12 @@
// ------------------------------------------------------------------
// ciField::print
void ciField::print() {
- tty->print("<ciField ");
+ tty->print("<ciField name=");
_holder->print_name();
tty->print(".");
_name->print_symbol();
+ tty->print(" signature=");
+ _signature->print_symbol();
tty->print(" offset=%d type=", _offset);
if (_type != NULL) _type->print_name();
else tty->print("(reference)");
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -64,8 +64,10 @@
ClassLoaderData * ClassLoaderData::_the_null_class_loader_data = NULL;
-ClassLoaderData::ClassLoaderData(Handle h_class_loader) : _class_loader(h_class_loader()),
- _metaspace(NULL), _unloading(false), _keep_alive(false), _klasses(NULL),
+ClassLoaderData::ClassLoaderData(Handle h_class_loader, bool is_anonymous) :
+ _class_loader(h_class_loader()),
+ _is_anonymous(is_anonymous), _keep_alive(is_anonymous), // initially
+ _metaspace(NULL), _unloading(false), _klasses(NULL),
_claimed(0), _jmethod_ids(NULL), _handles(NULL), _deallocate_list(NULL),
_next(NULL), _dependencies(NULL),
_metaspace_lock(new Mutex(Monitor::leaf+1, "Metaspace allocation lock", true)) {
@@ -167,16 +169,18 @@
ok = (objArrayOop)ok->obj_at(1);
}
+ // Must handle over GC points
+ assert (last != NULL, "dependencies should be initialized");
+ objArrayHandle last_handle(THREAD, last);
+
// Create a new dependency node with fields for (class_loader or mirror, next)
objArrayOop deps = oopFactory::new_objectArray(2, CHECK);
deps->obj_at_put(0, dependency());
- // Must handle over more GC points
+ // Must handle over GC points
objArrayHandle new_dependency(THREAD, deps);
// Add the dependency under lock
- assert (last != NULL, "dependencies should be initialized");
- objArrayHandle last_handle(THREAD, last);
locked_add_dependency(last_handle, new_dependency);
}
@@ -257,13 +261,6 @@
ShouldNotReachHere(); // should have found this class!!
}
-
-bool ClassLoaderData::is_anonymous() const {
- Klass* k = _klasses;
- return (_keep_alive || (k != NULL && k->oop_is_instance() &&
- InstanceKlass::cast(k)->is_anonymous()));
-}
-
void ClassLoaderData::unload() {
_unloading = true;
@@ -396,8 +393,7 @@
// These anonymous class loaders are to contain classes used for JSR292
ClassLoaderData* ClassLoaderData::anonymous_class_loader_data(oop loader, TRAPS) {
// Add a new class loader data to the graph.
- ClassLoaderData* cld = ClassLoaderDataGraph::add(NULL, loader, CHECK_NULL);
- return cld;
+ return ClassLoaderDataGraph::add(NULL, loader, CHECK_NULL);
}
const char* ClassLoaderData::loader_name() {
@@ -475,7 +471,9 @@
// Create one.
ClassLoaderData* *list_head = &_head;
ClassLoaderData* next = _head;
- ClassLoaderData* cld = new ClassLoaderData(loader);
+
+ bool is_anonymous = (cld_addr == NULL);
+ ClassLoaderData* cld = new ClassLoaderData(loader, is_anonymous);
if (cld_addr != NULL) {
// First, Atomically set it
@@ -485,10 +483,6 @@
// Returns the data.
return old;
}
- } else {
- // Disallow unloading for this CLD during initialization if there is no
- // class_loader oop to link this to.
- cld->set_keep_alive(true);
}
// We won the race, and therefore the task of adding the data to the list of
--- a/hotspot/src/share/vm/classfile/classLoaderData.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -8,7 +8,7 @@
*
* 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
+ * 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).
*
@@ -109,6 +109,7 @@
Mutex* _metaspace_lock; // Locks the metaspace for allocations and setup.
bool _unloading; // true if this class loader goes away
bool _keep_alive; // if this CLD can be unloaded for anonymous loaders
+ bool _is_anonymous; // if this CLD is for an anonymous class
volatile int _claimed; // true if claimed, for example during GC traces.
// To avoid applying oop closure more than once.
// Has to be an int because we cas it.
@@ -139,7 +140,7 @@
void set_next(ClassLoaderData* next) { _next = next; }
ClassLoaderData* next() const { return _next; }
- ClassLoaderData(Handle h_class_loader);
+ ClassLoaderData(Handle h_class_loader, bool is_anonymous);
~ClassLoaderData();
void set_metaspace(Metaspace* m) { _metaspace = m; }
@@ -174,12 +175,12 @@
return _the_null_class_loader_data;
}
- bool is_anonymous() const;
+ bool is_anonymous() const { return _is_anonymous; }
static void init_null_class_loader_data() {
assert(_the_null_class_loader_data == NULL, "cannot initialize twice");
assert(ClassLoaderDataGraph::_head == NULL, "cannot initialize twice");
- _the_null_class_loader_data = new ClassLoaderData((oop)NULL);
+ _the_null_class_loader_data = new ClassLoaderData((oop)NULL, false);
ClassLoaderDataGraph::_head = _the_null_class_loader_data;
assert(_the_null_class_loader_data->is_the_null_class_loader_data(), "Must be");
if (DumpSharedSpaces) {
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -327,14 +327,14 @@
return result;
}
-unsigned int java_lang_String::to_hash(oop java_string) {
+unsigned int java_lang_String::hash_code(oop java_string) {
int length = java_lang_String::length(java_string);
- // Zero length string will hash to zero with String.toHash() function.
+ // Zero length string will hash to zero with String.hashCode() function.
if (length == 0) return 0;
typeArrayOop value = java_lang_String::value(java_string);
int offset = java_lang_String::offset(java_string);
- return java_lang_String::to_hash(value->char_at_addr(offset), length);
+ return java_lang_String::hash_code(value->char_at_addr(offset), length);
}
char* java_lang_String::as_quoted_ascii(oop java_string) {
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -166,8 +166,8 @@
// objects in the shared archive file.
// hash P(31) from Kernighan & Ritchie
//
- // For this reason, THIS ALGORITHM MUST MATCH String.toHash().
- template <typename T> static unsigned int to_hash(T* s, int len) {
+ // For this reason, THIS ALGORITHM MUST MATCH String.hashCode().
+ template <typename T> static unsigned int hash_code(T* s, int len) {
unsigned int h = 0;
while (len-- > 0) {
h = 31*h + (unsigned int) *s;
@@ -175,10 +175,10 @@
}
return h;
}
- static unsigned int to_hash(oop java_string);
+ static unsigned int hash_code(oop java_string);
// This is the string hash code used by the StringTable, which may be
- // the same as String.toHash or an alternate hash code.
+ // the same as String.hashCode or an alternate hash code.
static unsigned int hash_string(oop java_string);
static bool equals(oop java_string, jchar* chars, int len);
--- a/hotspot/src/share/vm/classfile/symbolTable.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/classfile/symbolTable.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -179,7 +179,7 @@
unsigned int SymbolTable::hash_symbol(const char* s, int len) {
return use_alternate_hashcode() ?
AltHashing::murmur3_32(seed(), (const jbyte*)s, len) :
- java_lang_String::to_hash(s, len);
+ java_lang_String::hash_code(s, len);
}
@@ -617,7 +617,7 @@
// Pick hashing algorithm
unsigned int StringTable::hash_string(const jchar* s, int len) {
return use_alternate_hashcode() ? AltHashing::murmur3_32(seed(), s, len) :
- java_lang_String::to_hash(s, len);
+ java_lang_String::hash_code(s, len);
}
oop StringTable::lookup(int index, jchar* name,
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -756,6 +756,15 @@
do_intrinsic(_unpark, sun_misc_Unsafe, unpark_name, unpark_signature, F_RN) \
do_name( unpark_name, "unpark") \
do_alias( unpark_signature, /*(LObject;)V*/ object_void_signature) \
+ do_intrinsic(_loadFence, sun_misc_Unsafe, loadFence_name, loadFence_signature, F_RN) \
+ do_name( loadFence_name, "loadFence") \
+ do_alias( loadFence_signature, void_method_signature) \
+ do_intrinsic(_storeFence, sun_misc_Unsafe, storeFence_name, storeFence_signature, F_RN) \
+ do_name( storeFence_name, "storeFence") \
+ do_alias( storeFence_signature, void_method_signature) \
+ do_intrinsic(_fullFence, sun_misc_Unsafe, fullFence_name, fullFence_signature, F_RN) \
+ do_name( fullFence_name, "fullFence") \
+ do_alias( fullFence_signature, void_method_signature) \
\
/* unsafe memory references (there are a lot of them...) */ \
do_signature(getObject_signature, "(Ljava/lang/Object;J)Ljava/lang/Object;") \
@@ -897,12 +906,14 @@
do_intrinsic(_getAndAddLong, sun_misc_Unsafe, getAndAddLong_name, getAndAddLong_signature, F_R) \
do_name( getAndAddLong_name, "getAndAddLong") \
do_signature(getAndAddLong_signature, "(Ljava/lang/Object;JJ)J" ) \
- do_intrinsic(_getAndSetInt, sun_misc_Unsafe, getAndSet_name, getAndSetInt_signature, F_R) \
- do_name( getAndSet_name, "getAndSet") \
+ do_intrinsic(_getAndSetInt, sun_misc_Unsafe, getAndSetInt_name, getAndSetInt_signature, F_R) \
+ do_name( getAndSetInt_name, "getAndSetInt") \
do_alias( getAndSetInt_signature, /*"(Ljava/lang/Object;JI)I"*/ getAndAddInt_signature) \
- do_intrinsic(_getAndSetLong, sun_misc_Unsafe, getAndSet_name, getAndSetLong_signature, F_R) \
+ do_intrinsic(_getAndSetLong, sun_misc_Unsafe, getAndSetLong_name, getAndSetLong_signature, F_R) \
+ do_name( getAndSetLong_name, "getAndSetLong") \
do_alias( getAndSetLong_signature, /*"(Ljava/lang/Object;JJ)J"*/ getAndAddLong_signature) \
- do_intrinsic(_getAndSetObject, sun_misc_Unsafe, getAndSet_name, getAndSetObject_signature, F_R) \
+ do_intrinsic(_getAndSetObject, sun_misc_Unsafe, getAndSetObject_name, getAndSetObject_signature, F_R)\
+ do_name( getAndSetObject_name, "getAndSetObject") \
do_signature(getAndSetObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;" ) \
\
/* prefetch_signature is shared by all prefetch variants */ \
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -269,12 +269,10 @@
const char* comment,
bool is_blocking) {
assert(!_lock->is_locked(), "bad locking");
- InstanceKlass* holder = method->method_holder();
_compile_id = compile_id;
_method = method();
- _method_holder = JNIHandles::make_global(
- holder->is_anonymous() ? holder->java_mirror(): holder->class_loader());
+ _method_holder = JNIHandles::make_global(method->method_holder()->klass_holder());
_osr_bci = osr_bci;
_is_blocking = is_blocking;
_comp_level = comp_level;
@@ -298,10 +296,7 @@
} else {
_hot_method = hot_method();
// only add loader or mirror if different from _method_holder
- InstanceKlass* hot_holder = hot_method->method_holder();
- _hot_method_holder = JNIHandles::make_global(
- hot_holder->is_anonymous() ? hot_holder->java_mirror() :
- hot_holder->class_loader());
+ _hot_method_holder = JNIHandles::make_global(hot_method->method_holder()->klass_holder());
}
}
}
--- a/hotspot/src/share/vm/compiler/compilerOracle.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/compiler/compilerOracle.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -538,6 +538,7 @@
if (match != NULL) {
if (!_quiet) {
+ ResourceMark rm;
tty->print("CompilerOracle: %s ", command_names[command]);
match->print();
}
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -46,27 +46,11 @@
// Concurrent marking bit map wrapper
-CMBitMapRO::CMBitMapRO(ReservedSpace rs, int shifter) :
- _bm((uintptr_t*)NULL,0),
+CMBitMapRO::CMBitMapRO(int shifter) :
+ _bm(),
_shifter(shifter) {
- _bmStartWord = (HeapWord*)(rs.base());
- _bmWordSize = rs.size()/HeapWordSize; // rs.size() is in bytes
- ReservedSpace brs(ReservedSpace::allocation_align_size_up(
- (_bmWordSize >> (_shifter + LogBitsPerByte)) + 1));
-
- MemTracker::record_virtual_memory_type((address)brs.base(), mtGC);
-
- guarantee(brs.is_reserved(), "couldn't allocate concurrent marking bit map");
- // For now we'll just commit all of the bit map up fromt.
- // Later on we'll try to be more parsimonious with swap.
- guarantee(_virtual_space.initialize(brs, brs.size()),
- "couldn't reseve backing store for concurrent marking bit map");
- assert(_virtual_space.committed_size() == brs.size(),
- "didn't reserve backing store for all of concurrent marking bit map?");
- _bm.set_map((uintptr_t*)_virtual_space.low());
- assert(_virtual_space.committed_size() << (_shifter + LogBitsPerByte) >=
- _bmWordSize, "inconsistency in bit map sizing");
- _bm.set_size(_bmWordSize >> _shifter);
+ _bmStartWord = 0;
+ _bmWordSize = 0;
}
HeapWord* CMBitMapRO::getNextMarkedWordAddress(HeapWord* addr,
@@ -108,15 +92,40 @@
}
#ifndef PRODUCT
-bool CMBitMapRO::covers(ReservedSpace rs) const {
+bool CMBitMapRO::covers(ReservedSpace heap_rs) const {
// assert(_bm.map() == _virtual_space.low(), "map inconsistency");
assert(((size_t)_bm.size() * ((size_t)1 << _shifter)) == _bmWordSize,
"size inconsistency");
- return _bmStartWord == (HeapWord*)(rs.base()) &&
- _bmWordSize == rs.size()>>LogHeapWordSize;
+ return _bmStartWord == (HeapWord*)(heap_rs.base()) &&
+ _bmWordSize == heap_rs.size()>>LogHeapWordSize;
}
#endif
+bool CMBitMap::allocate(ReservedSpace heap_rs) {
+ _bmStartWord = (HeapWord*)(heap_rs.base());
+ _bmWordSize = heap_rs.size()/HeapWordSize; // heap_rs.size() is in bytes
+ ReservedSpace brs(ReservedSpace::allocation_align_size_up(
+ (_bmWordSize >> (_shifter + LogBitsPerByte)) + 1));
+ if (!brs.is_reserved()) {
+ warning("ConcurrentMark marking bit map allocation failure");
+ return false;
+ }
+ MemTracker::record_virtual_memory_type((address)brs.base(), mtGC);
+ // For now we'll just commit all of the bit map up front.
+ // Later on we'll try to be more parsimonious with swap.
+ if (!_virtual_space.initialize(brs, brs.size())) {
+ warning("ConcurrentMark marking bit map backing store failure");
+ return false;
+ }
+ assert(_virtual_space.committed_size() == brs.size(),
+ "didn't reserve backing store for all of concurrent marking bit map?");
+ _bm.set_map((uintptr_t*)_virtual_space.low());
+ assert(_virtual_space.committed_size() << (_shifter + LogBitsPerByte) >=
+ _bmWordSize, "inconsistency in bit map sizing");
+ _bm.set_size(_bmWordSize >> _shifter);
+ return true;
+}
+
void CMBitMap::clearAll() {
_bm.clear();
return;
@@ -163,20 +172,79 @@
#endif
{}
-void CMMarkStack::allocate(size_t size) {
- _base = NEW_C_HEAP_ARRAY(oop, size, mtGC);
- if (_base == NULL) {
- vm_exit_during_initialization("Failed to allocate CM region mark stack");
+bool CMMarkStack::allocate(size_t capacity) {
+ // allocate a stack of the requisite depth
+ ReservedSpace rs(ReservedSpace::allocation_align_size_up(capacity * sizeof(oop)));
+ if (!rs.is_reserved()) {
+ warning("ConcurrentMark MarkStack allocation failure");
+ return false;
}
- _index = 0;
- _capacity = (jint) size;
+ MemTracker::record_virtual_memory_type((address)rs.base(), mtGC);
+ if (!_virtual_space.initialize(rs, rs.size())) {
+ warning("ConcurrentMark MarkStack backing store failure");
+ // Release the virtual memory reserved for the marking stack
+ rs.release();
+ return false;
+ }
+ assert(_virtual_space.committed_size() == rs.size(),
+ "Didn't reserve backing store for all of ConcurrentMark stack?");
+ _base = (oop*) _virtual_space.low();
+ setEmpty();
+ _capacity = (jint) capacity;
_saved_index = -1;
NOT_PRODUCT(_max_depth = 0);
+ return true;
+}
+
+void CMMarkStack::expand() {
+ // Called, during remark, if we've overflown the marking stack during marking.
+ assert(isEmpty(), "stack should been emptied while handling overflow");
+ assert(_capacity <= (jint) MarkStackSizeMax, "stack bigger than permitted");
+ // Clear expansion flag
+ _should_expand = false;
+ if (_capacity == (jint) MarkStackSizeMax) {
+ if (PrintGCDetails && Verbose) {
+ gclog_or_tty->print_cr(" (benign) Can't expand marking stack capacity, at max size limit");
+ }
+ return;
+ }
+ // Double capacity if possible
+ jint new_capacity = MIN2(_capacity*2, (jint) MarkStackSizeMax);
+ // Do not give up existing stack until we have managed to
+ // get the double capacity that we desired.
+ ReservedSpace rs(ReservedSpace::allocation_align_size_up(new_capacity *
+ sizeof(oop)));
+ if (rs.is_reserved()) {
+ // Release the backing store associated with old stack
+ _virtual_space.release();
+ // Reinitialize virtual space for new stack
+ if (!_virtual_space.initialize(rs, rs.size())) {
+ fatal("Not enough swap for expanded marking stack capacity");
+ }
+ _base = (oop*)(_virtual_space.low());
+ _index = 0;
+ _capacity = new_capacity;
+ } else {
+ if (PrintGCDetails && Verbose) {
+ // Failed to double capacity, continue;
+ gclog_or_tty->print(" (benign) Failed to expand marking stack capacity from "
+ SIZE_FORMAT"K to " SIZE_FORMAT"K",
+ _capacity / K, new_capacity / K);
+ }
+ }
+}
+
+void CMMarkStack::set_should_expand() {
+ // If we're resetting the marking state because of an
+ // marking stack overflow, record that we should, if
+ // possible, expand the stack.
+ _should_expand = _cm->has_overflown();
}
CMMarkStack::~CMMarkStack() {
if (_base != NULL) {
- FREE_C_HEAP_ARRAY(oop, _base, mtGC);
+ _base = NULL;
+ _virtual_space.release();
}
}
@@ -217,7 +285,7 @@
jint res = Atomic::cmpxchg(next_index, &_index, index);
if (res == index) {
for (int i = 0; i < n; i++) {
- int ind = index + i;
+ int ind = index + i;
assert(ind < _capacity, "By overflow test above.");
_base[ind] = ptr_arr[i];
}
@@ -228,7 +296,6 @@
}
}
-
void CMMarkStack::par_push_arr(oop* ptr_arr, int n) {
MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag);
jint start = _index;
@@ -244,9 +311,9 @@
assert(ind < _capacity, "By overflow test above.");
_base[ind] = ptr_arr[i];
}
+ NOT_PRODUCT(_max_depth = MAX2(_max_depth, next_index));
}
-
bool CMMarkStack::par_pop_arr(oop* ptr_arr, int max, int* n) {
MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag);
jint index = _index;
@@ -255,7 +322,7 @@
return false;
} else {
int k = MIN2(max, index);
- jint new_ind = index - k;
+ jint new_ind = index - k;
for (int j = 0; j < k; j++) {
ptr_arr[j] = _base[new_ind + j];
}
@@ -404,9 +471,10 @@
return MAX2((n_par_threads + 2) / 4, 1U);
}
-ConcurrentMark::ConcurrentMark(ReservedSpace rs, uint max_regions) :
- _markBitMap1(rs, MinObjAlignment - 1),
- _markBitMap2(rs, MinObjAlignment - 1),
+ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) :
+ _g1h(g1h),
+ _markBitMap1(MinObjAlignment - 1),
+ _markBitMap2(MinObjAlignment - 1),
_parallel_marking_threads(0),
_max_parallel_marking_threads(0),
@@ -415,10 +483,10 @@
_cleanup_sleep_factor(0.0),
_cleanup_task_overhead(1.0),
_cleanup_list("Cleanup List"),
- _region_bm((BitMap::idx_t) max_regions, false /* in_resource_area*/),
- _card_bm((rs.size() + CardTableModRefBS::card_size - 1) >>
- CardTableModRefBS::card_shift,
- false /* in_resource_area*/),
+ _region_bm((BitMap::idx_t)(g1h->max_regions()), false /* in_resource_area*/),
+ _card_bm((heap_rs.size() + CardTableModRefBS::card_size - 1) >>
+ CardTableModRefBS::card_shift,
+ false /* in_resource_area*/),
_prevMarkBitMap(&_markBitMap1),
_nextMarkBitMap(&_markBitMap2),
@@ -449,7 +517,8 @@
_parallel_workers(NULL),
_count_card_bitmaps(NULL),
- _count_marked_bytes(NULL) {
+ _count_marked_bytes(NULL),
+ _completed_initialization(false) {
CMVerboseLevel verbose_level = (CMVerboseLevel) G1MarkingVerboseLevel;
if (verbose_level < no_verbose) {
verbose_level = no_verbose;
@@ -464,61 +533,34 @@
"heap end = "PTR_FORMAT, _heap_start, _heap_end);
}
- _markStack.allocate(MarkStackSize);
+ if (!_markBitMap1.allocate(heap_rs)) {
+ warning("Failed to allocate first CM bit map");
+ return;
+ }
+ if (!_markBitMap2.allocate(heap_rs)) {
+ warning("Failed to allocate second CM bit map");
+ return;
+ }
// Create & start a ConcurrentMark thread.
_cmThread = new ConcurrentMarkThread(this);
assert(cmThread() != NULL, "CM Thread should have been created");
assert(cmThread()->cm() != NULL, "CM Thread should refer to this cm");
- _g1h = G1CollectedHeap::heap();
assert(CGC_lock != NULL, "Where's the CGC_lock?");
- assert(_markBitMap1.covers(rs), "_markBitMap1 inconsistency");
- assert(_markBitMap2.covers(rs), "_markBitMap2 inconsistency");
+ assert(_markBitMap1.covers(heap_rs), "_markBitMap1 inconsistency");
+ assert(_markBitMap2.covers(heap_rs), "_markBitMap2 inconsistency");
SATBMarkQueueSet& satb_qs = JavaThread::satb_mark_queue_set();
satb_qs.set_buffer_size(G1SATBBufferSize);
_root_regions.init(_g1h, this);
- _tasks = NEW_C_HEAP_ARRAY(CMTask*, _max_worker_id, mtGC);
- _accum_task_vtime = NEW_C_HEAP_ARRAY(double, _max_worker_id, mtGC);
-
- _count_card_bitmaps = NEW_C_HEAP_ARRAY(BitMap, _max_worker_id, mtGC);
- _count_marked_bytes = NEW_C_HEAP_ARRAY(size_t*, _max_worker_id, mtGC);
-
- BitMap::idx_t card_bm_size = _card_bm.size();
-
- // so that the assertion in MarkingTaskQueue::task_queue doesn't fail
- _active_tasks = _max_worker_id;
- for (uint i = 0; i < _max_worker_id; ++i) {
- CMTaskQueue* task_queue = new CMTaskQueue();
- task_queue->initialize();
- _task_queues->register_queue(i, task_queue);
-
- _count_card_bitmaps[i] = BitMap(card_bm_size, false);
- _count_marked_bytes[i] = NEW_C_HEAP_ARRAY(size_t, (size_t) max_regions, mtGC);
-
- _tasks[i] = new CMTask(i, this,
- _count_marked_bytes[i],
- &_count_card_bitmaps[i],
- task_queue, _task_queues);
-
- _accum_task_vtime[i] = 0.0;
- }
-
- // Calculate the card number for the bottom of the heap. Used
- // in biasing indexes into the accounting card bitmaps.
- _heap_bottom_card_num =
- intptr_t(uintptr_t(_g1h->reserved_region().start()) >>
- CardTableModRefBS::card_shift);
-
- // Clear all the liveness counting data
- clear_all_count_data();
-
if (ConcGCThreads > ParallelGCThreads) {
- vm_exit_during_initialization("Can't have more ConcGCThreads "
- "than ParallelGCThreads.");
+ warning("Can't have more ConcGCThreads (" UINT32_FORMAT ") "
+ "than ParallelGCThreads (" UINT32_FORMAT ").",
+ ConcGCThreads, ParallelGCThreads);
+ return;
}
if (ParallelGCThreads == 0) {
// if we are not running with any parallel GC threads we will not
@@ -590,9 +632,86 @@
}
}
+ if (FLAG_IS_DEFAULT(MarkStackSize)) {
+ uintx mark_stack_size =
+ MIN2(MarkStackSizeMax,
+ MAX2(MarkStackSize, (uintx) (parallel_marking_threads() * TASKQUEUE_SIZE)));
+ // Verify that the calculated value for MarkStackSize is in range.
+ // It would be nice to use the private utility routine from Arguments.
+ if (!(mark_stack_size >= 1 && mark_stack_size <= MarkStackSizeMax)) {
+ warning("Invalid value calculated for MarkStackSize (" UINTX_FORMAT "): "
+ "must be between " UINTX_FORMAT " and " UINTX_FORMAT,
+ mark_stack_size, 1, MarkStackSizeMax);
+ return;
+ }
+ FLAG_SET_ERGO(uintx, MarkStackSize, mark_stack_size);
+ } else {
+ // Verify MarkStackSize is in range.
+ if (FLAG_IS_CMDLINE(MarkStackSize)) {
+ if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
+ if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
+ warning("Invalid value specified for MarkStackSize (" UINTX_FORMAT "): "
+ "must be between " UINTX_FORMAT " and " UINTX_FORMAT,
+ MarkStackSize, 1, MarkStackSizeMax);
+ return;
+ }
+ } else if (FLAG_IS_CMDLINE(MarkStackSizeMax)) {
+ if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
+ warning("Invalid value specified for MarkStackSize (" UINTX_FORMAT ")"
+ " or for MarkStackSizeMax (" UINTX_FORMAT ")",
+ MarkStackSize, MarkStackSizeMax);
+ return;
+ }
+ }
+ }
+ }
+
+ if (!_markStack.allocate(MarkStackSize)) {
+ warning("Failed to allocate CM marking stack");
+ return;
+ }
+
+ _tasks = NEW_C_HEAP_ARRAY(CMTask*, _max_worker_id, mtGC);
+ _accum_task_vtime = NEW_C_HEAP_ARRAY(double, _max_worker_id, mtGC);
+
+ _count_card_bitmaps = NEW_C_HEAP_ARRAY(BitMap, _max_worker_id, mtGC);
+ _count_marked_bytes = NEW_C_HEAP_ARRAY(size_t*, _max_worker_id, mtGC);
+
+ BitMap::idx_t card_bm_size = _card_bm.size();
+
+ // so that the assertion in MarkingTaskQueue::task_queue doesn't fail
+ _active_tasks = _max_worker_id;
+
+ size_t max_regions = (size_t) _g1h->max_regions();
+ for (uint i = 0; i < _max_worker_id; ++i) {
+ CMTaskQueue* task_queue = new CMTaskQueue();
+ task_queue->initialize();
+ _task_queues->register_queue(i, task_queue);
+
+ _count_card_bitmaps[i] = BitMap(card_bm_size, false);
+ _count_marked_bytes[i] = NEW_C_HEAP_ARRAY(size_t, max_regions, mtGC);
+
+ _tasks[i] = new CMTask(i, this,
+ _count_marked_bytes[i],
+ &_count_card_bitmaps[i],
+ task_queue, _task_queues);
+
+ _accum_task_vtime[i] = 0.0;
+ }
+
+ // Calculate the card number for the bottom of the heap. Used
+ // in biasing indexes into the accounting card bitmaps.
+ _heap_bottom_card_num =
+ intptr_t(uintptr_t(_g1h->reserved_region().start()) >>
+ CardTableModRefBS::card_shift);
+
+ // Clear all the liveness counting data
+ clear_all_count_data();
+
// so that the call below can read a sensible value
- _heap_start = (HeapWord*) rs.base();
+ _heap_start = (HeapWord*) heap_rs.base();
set_non_marking_state();
+ _completed_initialization = true;
}
void ConcurrentMark::update_g1_committed(bool force) {
@@ -1165,6 +1284,11 @@
assert(!restart_for_overflow(), "sanity");
}
+ // Expand the marking stack, if we have to and if we can.
+ if (_markStack.should_expand()) {
+ _markStack.expand();
+ }
+
// Reset the marking state if marking completed
if (!restart_for_overflow()) {
set_non_marking_state();
@@ -2785,7 +2909,7 @@
// Verify entries on the task queues
for (uint i = 0; i < _max_worker_id; i += 1) {
cl.set_phase(VerifyNoCSetOopsQueues, i);
- OopTaskQueue* queue = _task_queues->queue(i);
+ CMTaskQueue* queue = _task_queues->queue(i);
queue->oops_do(&cl);
}
}
@@ -2840,8 +2964,8 @@
#endif // PRODUCT
void ConcurrentMark::clear_marking_state(bool clear_overflow) {
- _markStack.setEmpty();
- _markStack.clear_overflow();
+ _markStack.set_should_expand();
+ _markStack.setEmpty(); // Also clears the _markStack overflow flag
if (clear_overflow) {
clear_has_overflown();
} else {
@@ -2850,7 +2974,7 @@
_finger = _heap_start;
for (uint i = 0; i < _max_worker_id; ++i) {
- OopTaskQueue* queue = _task_queues->queue(i);
+ CMTaskQueue* queue = _task_queues->queue(i);
queue->set_empty();
}
}
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -63,7 +63,7 @@
public:
// constructor
- CMBitMapRO(ReservedSpace rs, int shifter);
+ CMBitMapRO(int shifter);
enum { do_yield = true };
@@ -117,8 +117,11 @@
public:
// constructor
- CMBitMap(ReservedSpace rs, int shifter) :
- CMBitMapRO(rs, shifter) {}
+ CMBitMap(int shifter) :
+ CMBitMapRO(shifter) {}
+
+ // Allocates the back store for the marking bitmap
+ bool allocate(ReservedSpace heap_rs);
// write marks
void mark(HeapWord* addr) {
@@ -155,17 +158,18 @@
MemRegion getAndClearMarkedRegion(HeapWord* addr, HeapWord* end_addr);
};
-// Represents a marking stack used by the CM collector.
-// Ideally this should be GrowableArray<> just like MSC's marking stack(s).
+// Represents a marking stack used by ConcurrentMarking in the G1 collector.
class CMMarkStack VALUE_OBJ_CLASS_SPEC {
+ VirtualSpace _virtual_space; // Underlying backing store for actual stack
ConcurrentMark* _cm;
oop* _base; // bottom of stack
- jint _index; // one more than last occupied index
- jint _capacity; // max #elements
- jint _saved_index; // value of _index saved at start of GC
- NOT_PRODUCT(jint _max_depth;) // max depth plumbed during run
+ jint _index; // one more than last occupied index
+ jint _capacity; // max #elements
+ jint _saved_index; // value of _index saved at start of GC
+ NOT_PRODUCT(jint _max_depth;) // max depth plumbed during run
- bool _overflow;
+ bool _overflow;
+ bool _should_expand;
DEBUG_ONLY(bool _drain_in_progress;)
DEBUG_ONLY(bool _drain_in_progress_yields;)
@@ -173,7 +177,13 @@
CMMarkStack(ConcurrentMark* cm);
~CMMarkStack();
- void allocate(size_t size);
+#ifndef PRODUCT
+ jint max_depth() const {
+ return _max_depth;
+ }
+#endif
+
+ bool allocate(size_t capacity);
oop pop() {
if (!isEmpty()) {
@@ -231,11 +241,17 @@
bool isEmpty() { return _index == 0; }
bool isFull() { return _index == _capacity; }
- int maxElems() { return _capacity; }
+ int maxElems() { return _capacity; }
bool overflow() { return _overflow; }
void clear_overflow() { _overflow = false; }
+ bool should_expand() const { return _should_expand; }
+ void set_should_expand();
+
+ // Expand the stack, typically in response to an overflow condition
+ void expand();
+
int size() { return _index; }
void setEmpty() { _index = 0; clear_overflow(); }
@@ -344,6 +360,7 @@
class ConcurrentMarkThread;
class ConcurrentMark: public CHeapObj<mtGC> {
+ friend class CMMarkStack;
friend class ConcurrentMarkThread;
friend class CMTask;
friend class CMBitMapClosure;
@@ -577,6 +594,9 @@
// the card bitmaps.
intptr_t _heap_bottom_card_num;
+ // Set to true when initialization is complete
+ bool _completed_initialization;
+
public:
// Manipulation of the global mark stack.
// Notice that the first mark_stack_push is CAS-based, whereas the
@@ -636,7 +656,7 @@
return _task_queues->steal(worker_id, hash_seed, obj);
}
- ConcurrentMark(ReservedSpace rs, uint max_regions);
+ ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs);
~ConcurrentMark();
ConcurrentMarkThread* cmThread() { return _cmThread; }
@@ -907,6 +927,11 @@
// Should *not* be called from parallel code.
inline bool mark_and_count(oop obj);
+ // Returns true if initialization was successfully completed.
+ bool completed_initialization() const {
+ return _completed_initialization;
+ }
+
protected:
// Clear all the per-task bitmaps and arrays used to store the
// counting data.
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -2079,7 +2079,11 @@
// Create the ConcurrentMark data structure and thread.
// (Must do this late, so that "max_regions" is defined.)
- _cm = new ConcurrentMark(heap_rs, max_regions());
+ _cm = new ConcurrentMark(this, heap_rs);
+ if (_cm == NULL || !_cm->completed_initialization()) {
+ vm_shutdown_during_initialization("Could not create/initialize ConcurrentMark");
+ return JNI_ENOMEM;
+ }
_cmThread = _cm->cmThread();
// Initialize the from_card cache structure of HeapRegionRemSet.
@@ -2087,7 +2091,7 @@
// Now expand into the initial heap size.
if (!expand(init_byte_size)) {
- vm_exit_during_initialization("Failed to allocate initial heap.");
+ vm_shutdown_during_initialization("Failed to allocate initial heap.");
return JNI_ENOMEM;
}
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp"
+#include "memory/allocation.inline.hpp"
#include "runtime/java.hpp"
AdjoiningVirtualSpaces::AdjoiningVirtualSpaces(ReservedSpace rs,
--- a/hotspot/src/share/vm/gc_implementation/shared/gcStats.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcStats.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "gc_implementation/shared/gcStats.hpp"
#include "gc_implementation/shared/gcUtil.hpp"
+#include "memory/allocation.inline.hpp"
GCStats::GCStats() {
_avg_promoted = new AdaptivePaddedNoZeroDevAverage(
--- a/hotspot/src/share/vm/memory/allocation.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/memory/allocation.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -202,7 +202,7 @@
// Calling new or delete will result in fatal error.
class StackObj ALLOCATION_SUPER_CLASS_SPEC {
- public:
+ private:
void* operator new(size_t size);
void operator delete(void* p);
};
@@ -226,7 +226,7 @@
// be defined as a an empty string "".
//
class _ValueObj {
- public:
+ private:
void* operator new(size_t size);
void operator delete(void* p);
};
--- a/hotspot/src/share/vm/memory/metaspace.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/memory/metaspace.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -2192,11 +2192,6 @@
// MetaspaceAux
-size_t MetaspaceAux::used_in_bytes() {
- return (Metaspace::class_space_list()->used_words_sum() +
- Metaspace::space_list()->used_words_sum()) * BytesPerWord;
-}
-
size_t MetaspaceAux::used_in_bytes(Metaspace::MetadataType mdtype) {
size_t used = 0;
ClassLoaderDataGraphMetaspaceIterator iter;
@@ -2222,14 +2217,6 @@
return free * BytesPerWord;
}
-// The total words available for metadata allocation. This
-// uses Metaspace capacity_words() which is the total words
-// in chunks allocated for a Metaspace.
-size_t MetaspaceAux::capacity_in_bytes() {
- return (Metaspace::class_space_list()->capacity_words_sum() +
- Metaspace::space_list()->capacity_words_sum()) * BytesPerWord;
-}
-
size_t MetaspaceAux::capacity_in_bytes(Metaspace::MetadataType mdtype) {
size_t capacity = free_chunks_total(mdtype);
ClassLoaderDataGraphMetaspaceIterator iter;
@@ -2242,11 +2229,6 @@
return capacity * BytesPerWord;
}
-size_t MetaspaceAux::reserved_in_bytes() {
- return (Metaspace::class_space_list()->virtual_space_total() +
- Metaspace::space_list()->virtual_space_total()) * BytesPerWord;
-}
-
size_t MetaspaceAux::reserved_in_bytes(Metaspace::MetadataType mdtype) {
size_t reserved = (mdtype == Metaspace::ClassType) ?
Metaspace::class_space_list()->virtual_space_total() :
--- a/hotspot/src/share/vm/memory/metaspace.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/memory/metaspace.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -156,16 +156,25 @@
public:
// Total of space allocated to metadata in all Metaspaces
- static size_t used_in_bytes();
+ static size_t used_in_bytes() {
+ return used_in_bytes(Metaspace::ClassType) +
+ used_in_bytes(Metaspace::NonClassType);
+ }
// Total of available space in all Metaspaces
// Total of capacity allocated to all Metaspaces. This includes
// space in Metachunks not yet allocated and in the Metachunk
// freelist.
- static size_t capacity_in_bytes();
+ static size_t capacity_in_bytes() {
+ return capacity_in_bytes(Metaspace::ClassType) +
+ capacity_in_bytes(Metaspace::NonClassType);
+ }
// Total space reserved in all Metaspaces
- static size_t reserved_in_bytes();
+ static size_t reserved_in_bytes() {
+ return reserved_in_bytes(Metaspace::ClassType) +
+ reserved_in_bytes(Metaspace::NonClassType);
+ }
static size_t min_chunk_size();
--- a/hotspot/src/share/vm/memory/metaspaceCounters.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/memory/metaspaceCounters.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/hotspot/src/share/vm/memory/metaspaceCounters.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/memory/metaspaceCounters.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/hotspot/src/share/vm/oops/constMethod.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/oops/constMethod.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -46,6 +46,7 @@
// | interp_kind | flags | code_size |
// | name index | signature index |
// | method_idnum | max_stack |
+// | max_locals | size_of_parameters |
// |------------------------------------------------------|
// | |
// | byte codes |
@@ -150,7 +151,8 @@
// initially corresponds to the index into the methods array.
// but this may change with redefinition
u2 _max_stack; // Maximum number of entries on the expression stack
-
+ u2 _max_locals; // Number of local variables used by this method
+ u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words
// Constructor
ConstMethod(int byte_code_size,
@@ -338,6 +340,11 @@
static ByteSize max_stack_offset()
{ return byte_offset_of(ConstMethod, _max_stack); }
+ static ByteSize size_of_locals_offset()
+ { return byte_offset_of(ConstMethod, _max_locals); }
+ static ByteSize size_of_parameters_offset()
+ { return byte_offset_of(ConstMethod, _size_of_parameters); }
+
// Unique id for the method
static const u2 MAX_IDNUM;
@@ -349,6 +356,14 @@
int max_stack() const { return _max_stack; }
void set_max_stack(int size) { _max_stack = size; }
+ // max locals
+ int max_locals() const { return _max_locals; }
+ void set_max_locals(int size) { _max_locals = size; }
+
+ // size of parameters
+ int size_of_parameters() const { return _size_of_parameters; }
+ void set_size_of_parameters(int size) { _size_of_parameters = size; }
+
// Deallocation for RedefineClasses
void deallocate_contents(ClassLoaderData* loader_data);
bool is_klass() const { return false; }
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -538,6 +538,12 @@
}
}
+ // Oop that keeps the metadata for this class from being unloaded
+ // in places where the metadata is stored in other places, like nmethods
+ oop klass_holder() const {
+ return is_anonymous() ? java_mirror() : class_loader();
+ }
+
// signers
objArrayOop signers() const { return _signers; }
void set_signers(objArrayOop s) { klass_oop_store((oop*)&_signers, s); }
--- a/hotspot/src/share/vm/oops/klass.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/oops/klass.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -451,6 +451,8 @@
oop class_loader() const;
+ virtual oop klass_holder() const { return class_loader(); }
+
protected:
virtual Klass* array_klass_impl(bool or_null, int rank, TRAPS);
virtual Klass* array_klass_impl(bool or_null, TRAPS);
--- a/hotspot/src/share/vm/oops/method.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/oops/method.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -73,8 +73,7 @@
// |------------------------------------------------------|
// | result_index (C++ interpreter only) |
// |------------------------------------------------------|
-// | method_size | max_locals |
-// | size_of_parameters | intrinsic_id| flags |
+// | method_size | intrinsic_id| flags |
// |------------------------------------------------------|
// | throwout_count | num_breakpoints |
// |------------------------------------------------------|
@@ -116,8 +115,6 @@
int _result_index; // C++ interpreter needs for converting results to/from stack
#endif
u2 _method_size; // size of this object
- u2 _max_locals; // Number of local variables used by this method
- u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words
u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none)
u1 _jfr_towrite : 1, // Flags
_force_inline : 1,
@@ -292,8 +289,8 @@
void set_max_stack(int size) { constMethod()->set_max_stack(size); }
// max locals
- int max_locals() const { return _max_locals; }
- void set_max_locals(int size) { _max_locals = size; }
+ int max_locals() const { return constMethod()->max_locals(); }
+ void set_max_locals(int size) { constMethod()->set_max_locals(size); }
int highest_comp_level() const;
void set_highest_comp_level(int level);
@@ -311,7 +308,8 @@
void set_interpreter_throwout_count(int count) { _interpreter_throwout_count = count; }
// size of parameters
- int size_of_parameters() const { return _size_of_parameters; }
+ int size_of_parameters() const { return constMethod()->size_of_parameters(); }
+ void set_size_of_parameters(int size) { constMethod()->set_size_of_parameters(size); }
bool has_stackmap_table() const {
return constMethod()->has_stackmap_table();
@@ -588,8 +586,6 @@
#ifdef CC_INTERP
static ByteSize result_index_offset() { return byte_offset_of(Method, _result_index ); }
#endif /* CC_INTERP */
- static ByteSize size_of_locals_offset() { return byte_offset_of(Method, _max_locals ); }
- static ByteSize size_of_parameters_offset() { return byte_offset_of(Method, _size_of_parameters); }
static ByteSize from_compiled_offset() { return byte_offset_of(Method, _from_compiled_entry); }
static ByteSize code_offset() { return byte_offset_of(Method, _code); }
static ByteSize invocation_counter_offset() { return byte_offset_of(Method, _invocation_counter); }
@@ -796,9 +792,6 @@
Array<AnnotationArray*>* methods_default_annotations,
bool idempotent = false);
- // size of parameters
- void set_size_of_parameters(int size) { _size_of_parameters = size; }
-
// Deallocation function for redefine classes or if an error occurs
void deallocate_contents(ClassLoaderData* loader_data);
--- a/hotspot/src/share/vm/opto/addnode.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/addnode.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -189,6 +189,11 @@
set_req(1, addx);
set_req(2, a22);
progress = this;
+ PhaseIterGVN *igvn = phase->is_IterGVN();
+ if (add2->outcnt() == 0 && igvn) {
+ // add disconnected.
+ igvn->_worklist.push(add2);
+ }
}
}
@@ -624,6 +629,11 @@
if( t22->singleton() && (t22 != Type::TOP) ) { // Right input is an add of a constant?
set_req(Address, phase->transform(new (phase->C) AddPNode(in(Base),in(Address),add->in(1))));
set_req(Offset, add->in(2));
+ PhaseIterGVN *igvn = phase->is_IterGVN();
+ if (add->outcnt() == 0 && igvn) {
+ // add disconnected.
+ igvn->_worklist.push((Node*)add);
+ }
return this; // Made progress
}
}
--- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -403,7 +403,7 @@
//------------------------------print_inlining---------------------------------
// Really, the failure_msg can be a success message also.
void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, const char* failure_msg) const {
- CompileTask::print_inlining(callee_method, inline_level(), caller_bci, failure_msg ? failure_msg : "inline");
+ C->print_inlining(callee_method, inline_level(), caller_bci, failure_msg ? failure_msg : "inline");
if (callee_method == NULL) tty->print(" callee not monotonic or profiled");
if (Verbose && callee_method) {
const InlineTree *top = this;
--- a/hotspot/src/share/vm/opto/callGenerator.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/callGenerator.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -274,6 +274,9 @@
virtual void do_late_inline();
virtual JVMState* generate(JVMState* jvms) {
+ Compile *C = Compile::current();
+ C->print_inlining_skip(this);
+
// Record that this call site should be revisited once the main
// parse is finished.
Compile::current()->add_late_inline(this);
@@ -284,7 +287,6 @@
// as is done for allocations and macro expansion.
return DirectCallGenerator::generate(jvms);
}
-
};
@@ -307,7 +309,9 @@
// Make sure the state is a MergeMem for parsing.
if (!map->in(TypeFunc::Memory)->is_MergeMem()) {
- map->set_req(TypeFunc::Memory, MergeMemNode::make(C, map->in(TypeFunc::Memory)));
+ Node* mem = MergeMemNode::make(C, map->in(TypeFunc::Memory));
+ C->initial_gvn()->set_type_bottom(mem);
+ map->set_req(TypeFunc::Memory, mem);
}
// Make enough space for the expression stack and transfer the incoming arguments
@@ -320,6 +324,8 @@
}
}
+ C->print_inlining_insert(this);
+
CompileLog* log = C->log();
if (log != NULL) {
log->head("late_inline method='%d'", log->identify(method()));
@@ -608,7 +614,7 @@
if (cg != NULL && cg->is_inline())
return cg;
} else {
- if (PrintInlining) CompileTask::print_inlining(callee, jvms->depth() - 1, jvms->bci(), "receiver not constant");
+ if (PrintInlining) C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), "receiver not constant");
}
}
break;
--- a/hotspot/src/share/vm/opto/callGenerator.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/callGenerator.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -147,9 +147,9 @@
CallGenerator* cg);
virtual Node* generate_predicate(JVMState* jvms) { return NULL; };
- static void print_inlining(ciMethod* callee, int inline_level, int bci, const char* msg) {
+ static void print_inlining(Compile* C, ciMethod* callee, int inline_level, int bci, const char* msg) {
if (PrintInlining)
- CompileTask::print_inlining(callee, inline_level, bci, msg);
+ C->print_inlining(callee, inline_level, bci, msg);
}
};
--- a/hotspot/src/share/vm/opto/callnode.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/callnode.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -751,7 +751,7 @@
projs->fallthrough_ioproj = pn;
for (DUIterator j = pn->outs(); pn->has_out(j); j++) {
Node* e = pn->out(j);
- if (e->Opcode() == Op_CreateEx && e->in(0)->is_CatchProj()) {
+ if (e->Opcode() == Op_CreateEx && e->in(0)->is_CatchProj() && e->outcnt() > 0) {
assert(projs->exobj == NULL, "only one");
projs->exobj = e;
}
--- a/hotspot/src/share/vm/opto/cfgnode.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/cfgnode.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -1566,6 +1566,10 @@
Node* n = in(j); // Get the input
if (rc == NULL || phase->type(rc) == Type::TOP) {
if (n != top) { // Not already top?
+ PhaseIterGVN *igvn = phase->is_IterGVN();
+ if (can_reshape && igvn != NULL) {
+ igvn->_worklist.push(r);
+ }
set_req(j, top); // Nuke it down
progress = this; // Record progress
}
--- a/hotspot/src/share/vm/opto/compile.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/compile.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -610,7 +610,9 @@
_trace_opto_output(TraceOptoOutput || method()->has_option("TraceOptoOutput")),
_printer(IdealGraphPrinter::printer()),
#endif
- _congraph(NULL) {
+ _congraph(NULL),
+ _print_inlining_list(NULL),
+ _print_inlining(0) {
C = this;
CompileWrapper cw(this);
@@ -666,6 +668,9 @@
PhaseGVN gvn(node_arena(), estimated_size);
set_initial_gvn(&gvn);
+ if (PrintInlining) {
+ _print_inlining_list = new (comp_arena())GrowableArray<PrintInliningBuffer>(comp_arena(), 1, 1, PrintInliningBuffer());
+ }
{ // Scope for timing the parser
TracePhase t3("parse", &_t_parser, true);
@@ -754,6 +759,7 @@
}
}
assert(_late_inlines.length() == 0, "should have been processed");
+ dump_inlining();
print_method("Before RemoveUseless", 3);
@@ -899,7 +905,9 @@
#endif
_dead_node_list(comp_arena()),
_dead_node_count(0),
- _congraph(NULL) {
+ _congraph(NULL),
+ _print_inlining_list(NULL),
+ _print_inlining(0) {
C = this;
#ifndef PRODUCT
@@ -3351,3 +3359,11 @@
cb.consts()->relocate((address) constant_addr, relocInfo::internal_word_type);
}
}
+
+void Compile::dump_inlining() {
+ if (PrintInlining) {
+ for (int i = 0; i < _print_inlining_list->length(); i++) {
+ tty->print(_print_inlining_list->at(i).ss()->as_string());
+ }
+ }
+}
--- a/hotspot/src/share/vm/opto/compile.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/compile.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -30,6 +30,7 @@
#include "code/debugInfoRec.hpp"
#include "code/exceptionHandlerTable.hpp"
#include "compiler/compilerOracle.hpp"
+#include "compiler/compileBroker.hpp"
#include "libadt/dict.hpp"
#include "libadt/port.hpp"
#include "libadt/vectset.hpp"
@@ -369,6 +370,61 @@
GrowableArray<CallGenerator*> _late_inlines; // List of CallGenerators to be revisited after
// main parsing has finished.
+ // Inlining may not happen in parse order which would make
+ // PrintInlining output confusing. Keep track of PrintInlining
+ // pieces in order.
+ class PrintInliningBuffer : public ResourceObj {
+ private:
+ CallGenerator* _cg;
+ stringStream* _ss;
+
+ public:
+ PrintInliningBuffer()
+ : _cg(NULL) { _ss = new stringStream(); }
+
+ stringStream* ss() const { return _ss; }
+ CallGenerator* cg() const { return _cg; }
+ void set_cg(CallGenerator* cg) { _cg = cg; }
+ };
+
+ GrowableArray<PrintInliningBuffer>* _print_inlining_list;
+ int _print_inlining;
+
+ public:
+
+ outputStream* print_inlining_stream() const {
+ return _print_inlining_list->at(_print_inlining).ss();
+ }
+
+ void print_inlining_skip(CallGenerator* cg) {
+ if (PrintInlining) {
+ _print_inlining_list->at(_print_inlining).set_cg(cg);
+ _print_inlining++;
+ _print_inlining_list->insert_before(_print_inlining, PrintInliningBuffer());
+ }
+ }
+
+ void print_inlining_insert(CallGenerator* cg) {
+ if (PrintInlining) {
+ for (int i = 0; i < _print_inlining_list->length(); i++) {
+ if (_print_inlining_list->at(i).cg() == cg) {
+ _print_inlining_list->insert_before(i+1, PrintInliningBuffer());
+ _print_inlining = i+1;
+ _print_inlining_list->at(i).set_cg(NULL);
+ return;
+ }
+ }
+ ShouldNotReachHere();
+ }
+ }
+
+ void print_inlining(ciMethod* method, int inline_level, int bci, const char* msg = NULL) {
+ stringStream ss;
+ CompileTask::print_inlining(&ss, method, inline_level, bci, msg);
+ print_inlining_stream()->print(ss.as_string());
+ }
+
+ private:
// Matching, CFG layout, allocation, code generation
PhaseCFG* _cfg; // Results of CFG finding
bool _select_24_bit_instr; // We selected an instruction with a 24-bit result
@@ -591,7 +647,7 @@
void reset_dead_node_list() { _dead_node_list.Reset();
_dead_node_count = 0;
}
- uint live_nodes() {
+ uint live_nodes() const {
int val = _unique - _dead_node_count;
assert (val >= 0, err_msg_res("number of tracked dead nodes %d more than created nodes %d", _unique, _dead_node_count));
return (uint) val;
@@ -702,7 +758,7 @@
void identify_useful_nodes(Unique_Node_List &useful);
void update_dead_node_list(Unique_Node_List &useful);
- void remove_useless_nodes (Unique_Node_List &useful);
+ void remove_useless_nodes (Unique_Node_List &useful);
WarmCallInfo* warm_calls() const { return _warm_calls; }
void set_warm_calls(WarmCallInfo* l) { _warm_calls = l; }
@@ -711,6 +767,8 @@
// Record this CallGenerator for inlining at the end of parsing.
void add_late_inline(CallGenerator* cg) { _late_inlines.push(cg); }
+ void dump_inlining();
+
// Matching, CFG layout, allocation, code generation
PhaseCFG* cfg() { return _cfg; }
bool select_24_bit_instr() const { return _select_24_bit_instr; }
--- a/hotspot/src/share/vm/opto/doCall.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/doCall.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -40,19 +40,24 @@
#include "prims/nativeLookup.hpp"
#include "runtime/sharedRuntime.hpp"
-void trace_type_profile(ciMethod *method, int depth, int bci, ciMethod *prof_method, ciKlass *prof_klass, int site_count, int receiver_count) {
+void trace_type_profile(Compile* C, ciMethod *method, int depth, int bci, ciMethod *prof_method, ciKlass *prof_klass, int site_count, int receiver_count) {
if (TraceTypeProfile || PrintInlining NOT_PRODUCT(|| PrintOptoInlining)) {
+ outputStream* out = tty;
if (!PrintInlining) {
if (NOT_PRODUCT(!PrintOpto &&) !PrintCompilation) {
method->print_short_name();
tty->cr();
}
CompileTask::print_inlining(prof_method, depth, bci);
+ } else {
+ out = C->print_inlining_stream();
}
- CompileTask::print_inline_indent(depth);
- tty->print(" \\-> TypeProfile (%d/%d counts) = ", receiver_count, site_count);
- prof_klass->name()->print_symbol();
- tty->cr();
+ CompileTask::print_inline_indent(depth, out);
+ out->print(" \\-> TypeProfile (%d/%d counts) = ", receiver_count, site_count);
+ stringStream ss;
+ prof_klass->name()->print_symbol_on(&ss);
+ out->print(ss.as_string());
+ out->cr();
}
}
@@ -233,13 +238,13 @@
}
if (miss_cg != NULL) {
if (next_hit_cg != NULL) {
- trace_type_profile(jvms->method(), jvms->depth() - 1, jvms->bci(), next_receiver_method, profile.receiver(1), site_count, profile.receiver_count(1));
+ trace_type_profile(C, jvms->method(), jvms->depth() - 1, jvms->bci(), next_receiver_method, profile.receiver(1), site_count, profile.receiver_count(1));
// We don't need to record dependency on a receiver here and below.
// Whenever we inline, the dependency is added by Parse::Parse().
miss_cg = CallGenerator::for_predicted_call(profile.receiver(1), miss_cg, next_hit_cg, PROB_MAX);
}
if (miss_cg != NULL) {
- trace_type_profile(jvms->method(), jvms->depth() - 1, jvms->bci(), receiver_method, profile.receiver(0), site_count, receiver_count);
+ trace_type_profile(C, jvms->method(), jvms->depth() - 1, jvms->bci(), receiver_method, profile.receiver(0), site_count, receiver_count);
CallGenerator* cg = CallGenerator::for_predicted_call(profile.receiver(0), miss_cg, hit_cg, profile.receiver_prob(0));
if (cg != NULL) return cg;
}
--- a/hotspot/src/share/vm/opto/graphKit.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/graphKit.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -1771,11 +1771,21 @@
CallProjections callprojs;
call->extract_projections(&callprojs, true);
+ Node* init_mem = call->in(TypeFunc::Memory);
+ Node* final_mem = final_state->in(TypeFunc::Memory);
+ Node* final_ctl = final_state->in(TypeFunc::Control);
+ Node* final_io = final_state->in(TypeFunc::I_O);
+
// Replace all the old call edges with the edges from the inlining result
- C->gvn_replace_by(callprojs.fallthrough_catchproj, final_state->in(TypeFunc::Control));
- C->gvn_replace_by(callprojs.fallthrough_memproj, final_state->in(TypeFunc::Memory));
- C->gvn_replace_by(callprojs.fallthrough_ioproj, final_state->in(TypeFunc::I_O));
- Node* final_mem = final_state->in(TypeFunc::Memory);
+ if (callprojs.fallthrough_catchproj != NULL) {
+ C->gvn_replace_by(callprojs.fallthrough_catchproj, final_ctl);
+ }
+ if (callprojs.fallthrough_memproj != NULL) {
+ C->gvn_replace_by(callprojs.fallthrough_memproj, final_mem);
+ }
+ if (callprojs.fallthrough_ioproj != NULL) {
+ C->gvn_replace_by(callprojs.fallthrough_ioproj, final_io);
+ }
// Replace the result with the new result if it exists and is used
if (callprojs.resproj != NULL && result != NULL) {
@@ -2980,7 +2990,7 @@
set_control( _gvn.transform(new (C) ProjNode(allocx, TypeFunc::Control) ) );
// create memory projection for i_o
set_memory ( _gvn.transform( new (C) ProjNode(allocx, TypeFunc::Memory, true) ), rawidx );
- make_slow_call_ex(allocx, env()->OutOfMemoryError_klass(), true);
+ make_slow_call_ex(allocx, env()->Throwable_klass(), true);
// create a memory projection as for the normal control path
Node* malloc = _gvn.transform(new (C) ProjNode(allocx, TypeFunc::Memory));
--- a/hotspot/src/share/vm/opto/library_call.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/library_call.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -282,6 +282,7 @@
typedef enum { LS_xadd, LS_xchg, LS_cmpxchg } LoadStoreKind;
bool inline_unsafe_load_store(BasicType type, LoadStoreKind kind);
bool inline_unsafe_ordered_store(BasicType type);
+ bool inline_unsafe_fence(vmIntrinsics::ID id);
bool inline_fp_conversions(vmIntrinsics::ID id);
bool inline_number_methods(vmIntrinsics::ID id);
bool inline_reference_get();
@@ -334,6 +335,9 @@
case vmIntrinsics::_getAndSetInt:
case vmIntrinsics::_getAndSetLong:
case vmIntrinsics::_getAndSetObject:
+ case vmIntrinsics::_loadFence:
+ case vmIntrinsics::_storeFence:
+ case vmIntrinsics::_fullFence:
break; // InlineNatives does not control String.compareTo
case vmIntrinsics::_Reference_get:
break; // InlineNatives does not control Reference.get
@@ -412,16 +416,16 @@
break;
case vmIntrinsics::_reverseBytes_c:
- if (!Matcher::match_rule_supported(Op_ReverseBytesUS)) return false;
+ if (!Matcher::match_rule_supported(Op_ReverseBytesUS)) return NULL;
break;
case vmIntrinsics::_reverseBytes_s:
- if (!Matcher::match_rule_supported(Op_ReverseBytesS)) return false;
+ if (!Matcher::match_rule_supported(Op_ReverseBytesS)) return NULL;
break;
case vmIntrinsics::_reverseBytes_i:
- if (!Matcher::match_rule_supported(Op_ReverseBytesI)) return false;
+ if (!Matcher::match_rule_supported(Op_ReverseBytesI)) return NULL;
break;
case vmIntrinsics::_reverseBytes_l:
- if (!Matcher::match_rule_supported(Op_ReverseBytesL)) return false;
+ if (!Matcher::match_rule_supported(Op_ReverseBytesL)) return NULL;
break;
case vmIntrinsics::_Reference_get:
@@ -536,7 +540,7 @@
// Try to inline the intrinsic.
if (kit.try_to_inline()) {
if (PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) {
- CompileTask::print_inlining(callee, jvms->depth() - 1, bci, is_virtual() ? "(intrinsic, virtual)" : "(intrinsic)");
+ C->print_inlining(callee, jvms->depth() - 1, bci, is_virtual() ? "(intrinsic, virtual)" : "(intrinsic)");
}
C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_worked);
if (C->log()) {
@@ -555,7 +559,7 @@
if (jvms->has_method()) {
// Not a root compile.
const char* msg = is_virtual() ? "failed to inline (intrinsic, virtual)" : "failed to inline (intrinsic)";
- CompileTask::print_inlining(callee, jvms->depth() - 1, bci, msg);
+ C->print_inlining(callee, jvms->depth() - 1, bci, msg);
} else {
// Root compile
tty->print("Did not generate intrinsic %s%s at bci:%d in",
@@ -585,7 +589,7 @@
Node* slow_ctl = kit.try_to_predicate();
if (!kit.failing()) {
if (PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) {
- CompileTask::print_inlining(callee, jvms->depth() - 1, bci, is_virtual() ? "(intrinsic, virtual)" : "(intrinsic)");
+ C->print_inlining(callee, jvms->depth() - 1, bci, is_virtual() ? "(intrinsic, virtual)" : "(intrinsic)");
}
C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_worked);
if (C->log()) {
@@ -602,12 +606,12 @@
if (jvms->has_method()) {
// Not a root compile.
const char* msg = "failed to generate predicate for intrinsic";
- CompileTask::print_inlining(kit.callee(), jvms->depth() - 1, bci, msg);
+ C->print_inlining(kit.callee(), jvms->depth() - 1, bci, msg);
} else {
// Root compile
- tty->print("Did not generate predicate for intrinsic %s%s at bci:%d in",
- vmIntrinsics::name_at(intrinsic_id()),
- (is_virtual() ? " (virtual)" : ""), bci);
+ C->print_inlining_stream()->print("Did not generate predicate for intrinsic %s%s at bci:%d in",
+ vmIntrinsics::name_at(intrinsic_id()),
+ (is_virtual() ? " (virtual)" : ""), bci);
}
}
C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_failed);
@@ -732,6 +736,10 @@
case vmIntrinsics::_getAndSetLong: return inline_unsafe_load_store(T_LONG, LS_xchg);
case vmIntrinsics::_getAndSetObject: return inline_unsafe_load_store(T_OBJECT, LS_xchg);
+ case vmIntrinsics::_loadFence:
+ case vmIntrinsics::_storeFence:
+ case vmIntrinsics::_fullFence: return inline_unsafe_fence(intrinsic_id());
+
case vmIntrinsics::_currentThread: return inline_native_currentThread();
case vmIntrinsics::_isInterrupted: return inline_native_isInterrupted();
@@ -2840,6 +2848,26 @@
return true;
}
+bool LibraryCallKit::inline_unsafe_fence(vmIntrinsics::ID id) {
+ // Regardless of form, don't allow previous ld/st to move down,
+ // then issue acquire, release, or volatile mem_bar.
+ insert_mem_bar(Op_MemBarCPUOrder);
+ switch(id) {
+ case vmIntrinsics::_loadFence:
+ insert_mem_bar(Op_MemBarAcquire);
+ return true;
+ case vmIntrinsics::_storeFence:
+ insert_mem_bar(Op_MemBarRelease);
+ return true;
+ case vmIntrinsics::_fullFence:
+ insert_mem_bar(Op_MemBarVolatile);
+ return true;
+ default:
+ fatal_unexpected_iid(id);
+ return false;
+ }
+}
+
//----------------------------inline_unsafe_allocate---------------------------
// public native Object sun.mics.Unsafe.allocateInstance(Class<?> cls);
bool LibraryCallKit::inline_unsafe_allocate() {
@@ -2952,14 +2980,23 @@
// We only go to the fast case code if we pass two guards.
// Paths which do not pass are accumulated in the slow_region.
+
+ enum {
+ no_int_result_path = 1, // t == Thread.current() && !TLS._osthread._interrupted
+ no_clear_result_path = 2, // t == Thread.current() && TLS._osthread._interrupted && !clear_int
+ slow_result_path = 3, // slow path: t.isInterrupted(clear_int)
+ PATH_LIMIT
+ };
+
+ // Ensure that it's not possible to move the load of TLS._osthread._interrupted flag
+ // out of the function.
+ insert_mem_bar(Op_MemBarCPUOrder);
+
+ RegionNode* result_rgn = new (C) RegionNode(PATH_LIMIT);
+ PhiNode* result_val = new (C) PhiNode(result_rgn, TypeInt::BOOL);
+
RegionNode* slow_region = new (C) RegionNode(1);
record_for_igvn(slow_region);
- RegionNode* result_rgn = new (C) RegionNode(1+3); // fast1, fast2, slow
- PhiNode* result_val = new (C) PhiNode(result_rgn, TypeInt::BOOL);
- enum { no_int_result_path = 1,
- no_clear_result_path = 2,
- slow_result_path = 3
- };
// (a) Receiving thread must be the current thread.
Node* rec_thr = argument(0);
@@ -2968,14 +3005,13 @@
Node* cmp_thr = _gvn.transform( new (C) CmpPNode(cur_thr, rec_thr) );
Node* bol_thr = _gvn.transform( new (C) BoolNode(cmp_thr, BoolTest::ne) );
- bool known_current_thread = (_gvn.type(bol_thr) == TypeInt::ZERO);
- if (!known_current_thread)
- generate_slow_guard(bol_thr, slow_region);
+ generate_slow_guard(bol_thr, slow_region);
// (b) Interrupt bit on TLS must be false.
Node* p = basic_plus_adr(top()/*!oop*/, tls_ptr, in_bytes(JavaThread::osthread_offset()));
Node* osthread = make_load(NULL, p, TypeRawPtr::NOTNULL, T_ADDRESS);
p = basic_plus_adr(top()/*!oop*/, osthread, in_bytes(OSThread::interrupted_offset()));
+
// Set the control input on the field _interrupted read to prevent it floating up.
Node* int_bit = make_load(control(), p, TypeInt::BOOL, T_INT);
Node* cmp_bit = _gvn.transform( new (C) CmpINode(int_bit, intcon(0)) );
@@ -3020,22 +3056,20 @@
Node* slow_val = set_results_for_java_call(slow_call);
// this->control() comes from set_results_for_java_call
- // If we know that the result of the slow call will be true, tell the optimizer!
- if (known_current_thread) slow_val = intcon(1);
-
Node* fast_io = slow_call->in(TypeFunc::I_O);
Node* fast_mem = slow_call->in(TypeFunc::Memory);
+
// These two phis are pre-filled with copies of of the fast IO and Memory
- Node* io_phi = PhiNode::make(result_rgn, fast_io, Type::ABIO);
- Node* mem_phi = PhiNode::make(result_rgn, fast_mem, Type::MEMORY, TypePtr::BOTTOM);
+ PhiNode* result_mem = PhiNode::make(result_rgn, fast_mem, Type::MEMORY, TypePtr::BOTTOM);
+ PhiNode* result_io = PhiNode::make(result_rgn, fast_io, Type::ABIO);
result_rgn->init_req(slow_result_path, control());
- io_phi ->init_req(slow_result_path, i_o());
- mem_phi ->init_req(slow_result_path, reset_memory());
+ result_io ->init_req(slow_result_path, i_o());
+ result_mem->init_req(slow_result_path, reset_memory());
result_val->init_req(slow_result_path, slow_val);
- set_all_memory( _gvn.transform(mem_phi) );
- set_i_o( _gvn.transform(io_phi) );
+ set_all_memory(_gvn.transform(result_mem));
+ set_i_o( _gvn.transform(result_io));
}
C->set_has_split_ifs(true); // Has chance for split-if optimization
@@ -3319,7 +3353,7 @@
Node* arg = args[which_arg];
arg = null_check(arg);
if (stopped()) break;
- args[which_arg] = _gvn.transform(arg);
+ args[which_arg] = arg;
Node* p = basic_plus_adr(arg, class_klass_offset);
Node* kls = LoadKlassNode::make(_gvn, immutable_memory(), p, adr_type, kls_type);
--- a/hotspot/src/share/vm/opto/node.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/node.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -1839,15 +1839,16 @@
return idx; // True for other than index 0 (control)
}
+static RegMask _not_used_at_all;
// Register classes are defined for specific machines
const RegMask &Node::out_RegMask() const {
ShouldNotCallThis();
- return *(new RegMask());
+ return _not_used_at_all;
}
const RegMask &Node::in_RegMask(uint) const {
ShouldNotCallThis();
- return *(new RegMask());
+ return _not_used_at_all;
}
//=============================================================================
--- a/hotspot/src/share/vm/opto/parse3.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/parse3.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -509,6 +509,7 @@
makecon(TypeKlassPtr::make(array_klass)),
dims);
}
+ make_slow_call_ex(c, env()->Throwable_klass(), false);
Node* res = _gvn.transform(new (C) ProjNode(c, TypeFunc::Parms));
--- a/hotspot/src/share/vm/opto/runtime.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/runtime.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -989,7 +989,7 @@
// since we're notifying the VM on every catch.
// Force deoptimization and the rest of the lookup
// will be fine.
- deoptimize_caller_frame(thread, true);
+ deoptimize_caller_frame(thread);
}
// Check the stack guard pages. If enabled, look for handler in this frame;
@@ -1143,17 +1143,22 @@
void OptoRuntime::deoptimize_caller_frame(JavaThread *thread, bool doit) {
- // Deoptimize frame
- if (doit) {
- // Called from within the owner thread, so no need for safepoint
- RegisterMap reg_map(thread);
- frame stub_frame = thread->last_frame();
- assert(stub_frame.is_runtime_frame() || exception_blob()->contains(stub_frame.pc()), "sanity check");
- frame caller_frame = stub_frame.sender(®_map);
+ // Deoptimize the caller before continuing, as the compiled
+ // exception handler table may not be valid.
+ if (!StressCompiledExceptionHandlers && doit) {
+ deoptimize_caller_frame(thread);
+ }
+}
- // Deoptimize the caller frame.
- Deoptimization::deoptimize_frame(thread, caller_frame.id());
- }
+void OptoRuntime::deoptimize_caller_frame(JavaThread *thread) {
+ // Called from within the owner thread, so no need for safepoint
+ RegisterMap reg_map(thread);
+ frame stub_frame = thread->last_frame();
+ assert(stub_frame.is_runtime_frame() || exception_blob()->contains(stub_frame.pc()), "sanity check");
+ frame caller_frame = stub_frame.sender(®_map);
+
+ // Deoptimize the caller frame.
+ Deoptimization::deoptimize_frame(thread, caller_frame.id());
}
--- a/hotspot/src/share/vm/opto/runtime.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/runtime.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -174,6 +174,7 @@
static address handle_exception_C (JavaThread* thread);
static address handle_exception_C_helper(JavaThread* thread, nmethod*& nm);
static address rethrow_C (oopDesc* exception, JavaThread *thread, address return_pc );
+ static void deoptimize_caller_frame (JavaThread *thread);
static void deoptimize_caller_frame (JavaThread *thread, bool doit);
static bool is_deoptimized_caller_frame (JavaThread *thread);
--- a/hotspot/src/share/vm/opto/stringopts.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/opto/stringopts.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -744,7 +744,9 @@
ctrl_path.push(cn);
ctrl_path.push(cn->proj_out(0));
ctrl_path.push(cn->proj_out(0)->unique_out());
- ctrl_path.push(cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0));
+ if (cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0) != NULL) {
+ ctrl_path.push(cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0));
+ }
} else {
ShouldNotReachHere();
}
@@ -762,6 +764,12 @@
} else if (ptr->is_IfTrue()) {
IfNode* iff = ptr->in(0)->as_If();
BoolNode* b = iff->in(1)->isa_Bool();
+
+ if (b == NULL) {
+ fail = true;
+ break;
+ }
+
Node* cmp = b->in(1);
Node* v1 = cmp->in(1);
Node* v2 = cmp->in(2);
@@ -1408,71 +1416,76 @@
Deoptimization::Action_make_not_entrant);
}
- // length now contains the number of characters needed for the
- // char[] so create a new AllocateArray for the char[]
- Node* char_array = NULL;
- {
- PreserveReexecuteState preexecs(&kit);
- // The original jvms is for an allocation of either a String or
- // StringBuffer so no stack adjustment is necessary for proper
- // reexecution. If we deoptimize in the slow path the bytecode
- // will be reexecuted and the char[] allocation will be thrown away.
- kit.jvms()->set_should_reexecute(true);
- char_array = kit.new_array(__ makecon(TypeKlassPtr::make(ciTypeArrayKlass::make(T_CHAR))),
- length, 1);
- }
+ Node* result;
+ if (!kit.stopped()) {
+
+ // length now contains the number of characters needed for the
+ // char[] so create a new AllocateArray for the char[]
+ Node* char_array = NULL;
+ {
+ PreserveReexecuteState preexecs(&kit);
+ // The original jvms is for an allocation of either a String or
+ // StringBuffer so no stack adjustment is necessary for proper
+ // reexecution. If we deoptimize in the slow path the bytecode
+ // will be reexecuted and the char[] allocation will be thrown away.
+ kit.jvms()->set_should_reexecute(true);
+ char_array = kit.new_array(__ makecon(TypeKlassPtr::make(ciTypeArrayKlass::make(T_CHAR))),
+ length, 1);
+ }
+
+ // Mark the allocation so that zeroing is skipped since the code
+ // below will overwrite the entire array
+ AllocateArrayNode* char_alloc = AllocateArrayNode::Ideal_array_allocation(char_array, _gvn);
+ char_alloc->maybe_set_complete(_gvn);
- // Mark the allocation so that zeroing is skipped since the code
- // below will overwrite the entire array
- AllocateArrayNode* char_alloc = AllocateArrayNode::Ideal_array_allocation(char_array, _gvn);
- char_alloc->maybe_set_complete(_gvn);
-
- // Now copy the string representations into the final char[]
- Node* start = __ intcon(0);
- for (int argi = 0; argi < sc->num_arguments(); argi++) {
- Node* arg = sc->argument(argi);
- switch (sc->mode(argi)) {
- case StringConcat::IntMode: {
- Node* end = __ AddI(start, string_sizes->in(argi));
- // getChars words backwards so pass the ending point as well as the start
- int_getChars(kit, arg, char_array, start, end);
- start = end;
- break;
+ // Now copy the string representations into the final char[]
+ Node* start = __ intcon(0);
+ for (int argi = 0; argi < sc->num_arguments(); argi++) {
+ Node* arg = sc->argument(argi);
+ switch (sc->mode(argi)) {
+ case StringConcat::IntMode: {
+ Node* end = __ AddI(start, string_sizes->in(argi));
+ // getChars words backwards so pass the ending point as well as the start
+ int_getChars(kit, arg, char_array, start, end);
+ start = end;
+ break;
+ }
+ case StringConcat::StringNullCheckMode:
+ case StringConcat::StringMode: {
+ start = copy_string(kit, arg, char_array, start);
+ break;
+ }
+ case StringConcat::CharMode: {
+ __ store_to_memory(kit.control(), kit.array_element_address(char_array, start, T_CHAR),
+ arg, T_CHAR, char_adr_idx);
+ start = __ AddI(start, __ intcon(1));
+ break;
+ }
+ default:
+ ShouldNotReachHere();
}
- case StringConcat::StringNullCheckMode:
- case StringConcat::StringMode: {
- start = copy_string(kit, arg, char_array, start);
- break;
- }
- case StringConcat::CharMode: {
- __ store_to_memory(kit.control(), kit.array_element_address(char_array, start, T_CHAR),
- arg, T_CHAR, char_adr_idx);
- start = __ AddI(start, __ intcon(1));
- break;
- }
- default:
- ShouldNotReachHere();
}
- }
- // If we're not reusing an existing String allocation then allocate one here.
- Node* result = sc->string_alloc();
- if (result == NULL) {
- PreserveReexecuteState preexecs(&kit);
- // The original jvms is for an allocation of either a String or
- // StringBuffer so no stack adjustment is necessary for proper
- // reexecution.
- kit.jvms()->set_should_reexecute(true);
- result = kit.new_instance(__ makecon(TypeKlassPtr::make(C->env()->String_klass())));
+ // If we're not reusing an existing String allocation then allocate one here.
+ result = sc->string_alloc();
+ if (result == NULL) {
+ PreserveReexecuteState preexecs(&kit);
+ // The original jvms is for an allocation of either a String or
+ // StringBuffer so no stack adjustment is necessary for proper
+ // reexecution.
+ kit.jvms()->set_should_reexecute(true);
+ result = kit.new_instance(__ makecon(TypeKlassPtr::make(C->env()->String_klass())));
+ }
+
+ // Intialize the string
+ if (java_lang_String::has_offset_field()) {
+ kit.store_String_offset(kit.control(), result, __ intcon(0));
+ kit.store_String_length(kit.control(), result, length);
+ }
+ kit.store_String_value(kit.control(), result, char_array);
+ } else {
+ result = C->top();
}
-
- // Intialize the string
- if (java_lang_String::has_offset_field()) {
- kit.store_String_offset(kit.control(), result, __ intcon(0));
- kit.store_String_length(kit.control(), result, length);
- }
- kit.store_String_value(kit.control(), result, char_array);
-
// hook up the outgoing control and result
kit.replace_call(sc->end(), result);
--- a/hotspot/src/share/vm/prims/methodHandles.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -1168,8 +1168,8 @@
// Walk all nmethods depending on this call site.
MutexLocker mu(Compile_lock, thread);
Universe::flush_dependents_on(call_site, target);
+ java_lang_invoke_CallSite::set_target(call_site(), target());
}
- java_lang_invoke_CallSite::set_target(call_site(), target());
}
JVM_END
@@ -1180,8 +1180,8 @@
// Walk all nmethods depending on this call site.
MutexLocker mu(Compile_lock, thread);
Universe::flush_dependents_on(call_site, target);
+ java_lang_invoke_CallSite::set_target_volatile(call_site(), target());
}
- java_lang_invoke_CallSite::set_target_volatile(call_site(), target());
}
JVM_END
--- a/hotspot/src/share/vm/prims/unsafe.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/prims/unsafe.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -468,6 +468,21 @@
#endif
UNSAFE_END
+UNSAFE_ENTRY(void, Unsafe_LoadFence(JNIEnv *env, jobject unsafe))
+ UnsafeWrapper("Unsafe_LoadFence");
+ OrderAccess::acquire();
+UNSAFE_END
+
+UNSAFE_ENTRY(void, Unsafe_StoreFence(JNIEnv *env, jobject unsafe))
+ UnsafeWrapper("Unsafe_StoreFence");
+ OrderAccess::release();
+UNSAFE_END
+
+UNSAFE_ENTRY(void, Unsafe_FullFence(JNIEnv *env, jobject unsafe))
+ UnsafeWrapper("Unsafe_FullFence");
+ OrderAccess::fence();
+UNSAFE_END
+
////// Data in the C heap.
// Note: These do not throw NullPointerException for bad pointers.
@@ -1550,6 +1565,9 @@
{CC"putOrderedObject", CC"("OBJ"J"OBJ")V", FN_PTR(Unsafe_SetOrderedObject)},
{CC"putOrderedInt", CC"("OBJ"JI)V", FN_PTR(Unsafe_SetOrderedInt)},
{CC"putOrderedLong", CC"("OBJ"JJ)V", FN_PTR(Unsafe_SetOrderedLong)},
+ {CC"loadFence", CC"()V", FN_PTR(Unsafe_LoadFence)},
+ {CC"storeFence", CC"()V", FN_PTR(Unsafe_StoreFence)},
+ {CC"fullFence", CC"()V", FN_PTR(Unsafe_FullFence)},
{CC"park", CC"(ZJ)V", FN_PTR(Unsafe_Park)},
{CC"unpark", CC"("OBJ")V", FN_PTR(Unsafe_Unpark)}
--- a/hotspot/src/share/vm/runtime/arguments.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/runtime/arguments.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -1499,13 +1499,12 @@
Abstract_VM_Version::parallel_worker_threads());
}
- if (FLAG_IS_DEFAULT(MarkStackSize)) {
- FLAG_SET_DEFAULT(MarkStackSize, 128 * TASKQUEUE_SIZE);
- }
- if (PrintGCDetails && Verbose) {
- tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
- MarkStackSize / K, MarkStackSizeMax / K);
- tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
+ // MarkStackSize will be set (if it hasn't been set by the user)
+ // when concurrent marking is initialized.
+ // Its value will be based upon the number of parallel marking threads.
+ // But we do set the maximum mark stack size here.
+ if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
+ FLAG_SET_DEFAULT(MarkStackSizeMax, 128 * TASKQUEUE_SIZE);
}
if (FLAG_IS_DEFAULT(GCTimeRatio) || GCTimeRatio == 0) {
@@ -1517,6 +1516,12 @@
// is allocation). We might consider increase it further.
FLAG_SET_DEFAULT(GCTimeRatio, 9);
}
+
+ if (PrintGCDetails && Verbose) {
+ tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
+ MarkStackSize / K, MarkStackSizeMax / K);
+ tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
+ }
}
void Arguments::set_heap_size() {
@@ -1980,6 +1985,9 @@
status = status && verify_min_value(ClassMetaspaceSize, 1*M,
"ClassMetaspaceSize");
+ status = status && verify_interval(MarkStackSizeMax,
+ 1, (max_jint - 1), "MarkStackSizeMax");
+
#ifdef SPARC
if (UseConcMarkSweepGC || UseG1GC) {
// Issue a stern warning if the user has explicitly set
--- a/hotspot/src/share/vm/runtime/globals.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/runtime/globals.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -922,6 +922,9 @@
develop(bool, PrintExceptionHandlers, false, \
"Print exception handler tables for all nmethods when generated") \
\
+ develop(bool, StressCompiledExceptionHandlers, false, \
+ "Exercise compiled exception handlers") \
+ \
develop(bool, InterceptOSException, false, \
"Starts debugger when an implicit OS (e.g., NULL) " \
"exception happens") \
--- a/hotspot/src/share/vm/runtime/os.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/runtime/os.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -255,6 +255,7 @@
static int vm_allocation_granularity();
static char* reserve_memory(size_t bytes, char* addr = 0,
size_t alignment_hint = 0);
+ static char* reserve_memory_aligned(size_t size, size_t alignment);
static char* attempt_reserve_memory_at(size_t bytes, char* addr);
static void split_reserved_memory(char *base, size_t size,
size_t split, bool realloc);
--- a/hotspot/src/share/vm/runtime/os_ext.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/runtime/os_ext.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
--- a/hotspot/src/share/vm/runtime/thread.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/runtime/thread.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -2190,7 +2190,7 @@
// BiasedLocking needs an updated RegisterMap for the revoke monitors pass
RegisterMap reg_map(this, UseBiasedLocking);
frame compiled_frame = f.sender(®_map);
- if (compiled_frame.can_be_deoptimized()) {
+ if (!StressCompiledExceptionHandlers && compiled_frame.can_be_deoptimized()) {
Deoptimization::deoptimize(this, compiled_frame, ®_map);
}
}
@@ -3527,11 +3527,12 @@
java_lang_Thread::set_thread_status(thread_object,
java_lang_Thread::RUNNABLE);
- // The VM preresolve methods to these classes. Make sure that get initialized
+ // The VM creates & returns objects of this class. Make sure it's initialized.
+ initialize_class(vmSymbols::java_lang_Class(), CHECK_0);
+
+ // The VM preresolves methods to these classes. Make sure that they get initialized
initialize_class(vmSymbols::java_lang_reflect_Method(), CHECK_0);
initialize_class(vmSymbols::java_lang_ref_Finalizer(), CHECK_0);
- // The VM creates & returns objects of this class. Make sure it's initialized.
- initialize_class(vmSymbols::java_lang_Class(), CHECK_0);
call_initializeSystemClass(CHECK_0);
// get the Java runtime name after java.lang.System is initialized
--- a/hotspot/src/share/vm/runtime/virtualspace.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/runtime/virtualspace.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -329,20 +329,9 @@
if ((((size_t)base + noaccess_prefix) & (alignment - 1)) != 0) {
// Base not aligned, retry
if (!os::release_memory(base, size)) fatal("os::release_memory failed");
- // Reserve size large enough to do manual alignment and
- // increase size to a multiple of the desired alignment
+ // Make sure that size is aligned
size = align_size_up(size, alignment);
- size_t extra_size = size + alignment;
- do {
- char* extra_base = os::reserve_memory(extra_size, NULL, alignment);
- if (extra_base == NULL) return;
- // Do manual alignement
- base = (char*) align_size_up((uintptr_t) extra_base, alignment);
- assert(base >= extra_base, "just checking");
- // Re-reserve the region at the aligned base address.
- os::release_memory(extra_base, extra_size);
- base = os::reserve_memory(size, base);
- } while (base == NULL);
+ base = os::reserve_memory_aligned(size, alignment);
if (requested_address != 0 &&
failed_to_reserve_as_requested(base, requested_address, size, false)) {
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -355,8 +355,6 @@
nonstatic_field(Method, _access_flags, AccessFlags) \
nonstatic_field(Method, _vtable_index, int) \
nonstatic_field(Method, _method_size, u2) \
- nonstatic_field(Method, _max_locals, u2) \
- nonstatic_field(Method, _size_of_parameters, u2) \
nonstatic_field(Method, _interpreter_throwout_count, u2) \
nonstatic_field(Method, _number_of_breakpoints, u2) \
nonstatic_field(Method, _invocation_counter, InvocationCounter) \
@@ -378,6 +376,8 @@
nonstatic_field(ConstMethod, _signature_index, u2) \
nonstatic_field(ConstMethod, _method_idnum, u2) \
nonstatic_field(ConstMethod, _max_stack, u2) \
+ nonstatic_field(ConstMethod, _max_locals, u2) \
+ nonstatic_field(ConstMethod, _size_of_parameters, u2) \
nonstatic_field(ObjArrayKlass, _element_klass, Klass*) \
nonstatic_field(ObjArrayKlass, _bottom_klass, Klass*) \
volatile_nonstatic_field(Symbol, _refcount, int) \
--- a/hotspot/src/share/vm/services/diagnosticArgument.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/services/diagnosticArgument.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
--- a/hotspot/src/share/vm/services/diagnosticCommand_ext.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/services/diagnosticCommand_ext.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. DO
- * NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * Copyright (c) 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
--- a/hotspot/src/share/vm/services/memBaseline.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/services/memBaseline.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -334,7 +334,7 @@
// create a memory baseline
MemBaseline();
- virtual ~MemBaseline();
+ ~MemBaseline();
inline bool baselined() const {
return _baselined;
--- a/hotspot/src/share/vm/services/memReporter.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/services/memReporter.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/hotspot/src/share/vm/services/memReporter.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/services/memReporter.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/hotspot/src/share/vm/services/nmtDCmd.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/services/nmtDCmd.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -84,28 +84,31 @@
}
int nopt = 0;
- if(_summary.is_set()) { ++nopt; }
- if(_detail.is_set()) { ++nopt; }
- if(_baseline.is_set()) { ++nopt; }
- if(_summary_diff.is_set()) { ++nopt; }
- if(_detail_diff.is_set()) { ++nopt; }
- if(_shutdown.is_set()) { ++nopt; }
+ if(_summary.is_set() && _summary.value()) { ++nopt; }
+ if(_detail.is_set() && _detail.value()) { ++nopt; }
+ if(_baseline.is_set() && _baseline.value()) { ++nopt; }
+ if(_summary_diff.is_set() && _summary_diff.value()) { ++nopt; }
+ if(_detail_diff.is_set() && _detail_diff.value()) { ++nopt; }
+ if(_shutdown.is_set() && _shutdown.value()) { ++nopt; }
#ifndef PRODUCT
- if(_debug.is_set()) { ++nopt; }
+ if(_debug.is_set() && _debug.value()) { ++nopt; }
#endif
if(nopt > 1) {
output()->print_cr("At most one of the following option can be specified: " \
"summary, detail, baseline, summary.diff, detail.diff, shutdown"
#ifndef PRODUCT
- " ,debug"
+ ", debug"
#endif
);
return;
- }
-
- if(nopt == 0) {
+ } else if (nopt == 0) {
+ if (_summary.is_set()) {
+ output()->print_cr("No command to execute");
+ return;
+ } else {
_summary.set_value(true);
+ }
}
#ifndef PRODUCT
--- a/hotspot/src/share/vm/utilities/workgroup.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/utilities/workgroup.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -90,7 +90,7 @@
NOT_PRODUCT(_name = name);
_counter = 0;
}
- virtual ~AbstractGangTask() { }
+ ~AbstractGangTask() { }
public:
};
--- a/hotspot/src/share/vm/utilities/yieldingWorkgroup.hpp Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/src/share/vm/utilities/yieldingWorkgroup.hpp Tue Jan 01 17:49:22 2013 -0800
@@ -106,7 +106,7 @@
_status(INACTIVE),
_gang(NULL) { }
- virtual ~YieldingFlexibleGangTask() { }
+ ~YieldingFlexibleGangTask() { }
friend class YieldingFlexibleWorkGang;
friend class YieldingFlexibleGangWorker;
--- a/hotspot/test/compiler/7184394/TestAESBase.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/test/compiler/7184394/TestAESBase.java Tue Jan 01 17:49:22 2013 -0800
@@ -54,7 +54,6 @@
String paddingStr = "PKCS5Padding";
AlgorithmParameters algParams;
SecretKey key;
- int ivLen;
static int numThreads = 0;
int threadId;
@@ -68,7 +67,7 @@
public void prepare() {
try {
- System.out.println("\nmsgSize=" + msgSize + ", key size=" + keySize + ", reInit=" + !noReinit + ", checkOutput=" + checkOutput);
+ System.out.println("\nalgorithm=" + algorithm + ", mode=" + mode + ", msgSize=" + msgSize + ", keySize=" + keySize + ", noReinit=" + noReinit + ", checkOutput=" + checkOutput);
int keyLenBytes = (keySize == 0 ? 16 : keySize/8);
byte keyBytes[] = new byte[keyLenBytes];
@@ -90,10 +89,14 @@
cipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE");
dCipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE");
- ivLen = (algorithm.equals("AES") ? 16 : algorithm.equals("DES") ? 8 : 0);
- IvParameterSpec initVector = new IvParameterSpec(new byte[ivLen]);
-
- cipher.init(Cipher.ENCRYPT_MODE, key, initVector);
+ if (mode.equals("CBC")) {
+ int ivLen = (algorithm.equals("AES") ? 16 : algorithm.equals("DES") ? 8 : 0);
+ IvParameterSpec initVector = new IvParameterSpec(new byte[ivLen]);
+ cipher.init(Cipher.ENCRYPT_MODE, key, initVector);
+ } else {
+ algParams = cipher.getParameters();
+ cipher.init(Cipher.ENCRYPT_MODE, key, algParams);
+ }
algParams = cipher.getParameters();
dCipher.init(Cipher.DECRYPT_MODE, key, algParams);
if (threadId == 0) {
--- a/hotspot/test/compiler/7184394/TestAESMain.java Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/test/compiler/7184394/TestAESMain.java Tue Jan 01 17:49:22 2013 -0800
@@ -27,7 +27,8 @@
* @bug 7184394
* @summary add intrinsics to use AES instructions
*
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB TestAESMain
*
* @author Tom Deneau
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/8004741/Test8004741.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test Test8004741.java
+ * @bug 8004741
+ * @summary Missing compiled exception handle table entry for multidimensional array allocation
+ * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers Test8004741
+ *
+ */
+
+import java.util.*;
+
+public class Test8004741 extends Thread {
+
+ static int[][] test(int a, int b) throws Exception {
+ int[][] ar = null;
+ try {
+ ar = new int[a][b];
+ } catch (Error e) {
+ System.out.println("test got Error");
+ passed = true;
+ throw(e);
+ } catch (Exception e) {
+ System.out.println("test got Exception");
+ throw(e);
+ }
+ return ar;
+ }
+
+ static boolean passed = false;
+
+ public void run() {
+ System.out.println("test started");
+ try {
+ while(true) {
+ test(2,20000);
+ }
+ } catch (ThreadDeath e) {
+ System.out.println("test got ThreadDeath");
+ passed = true;
+ } catch (Error e) {
+ e.printStackTrace();
+ System.out.println("test got Error");
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.out.println("test got Exception");
+ }
+ }
+
+ public static void main(String[] args) throws Exception {
+ for (int n = 0; n < 11000; n++) {
+ test(2, 20);
+ }
+
+ // First test exception catch
+ Test8004741 t = new Test8004741();
+
+ passed = false;
+ t.start();
+ Thread.sleep(1000);
+ t.stop();
+
+ Thread.sleep(5000);
+ t.join();
+ if (passed) {
+ System.out.println("PASSED");
+ } else {
+ System.out.println("FAILED");
+ System.exit(97);
+ }
+ }
+
+};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/8005033/Test8005033.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2012 SAP AG. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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 8005033
+ * @summary On sparcv9, C2's intrinsic for Integer.bitCount(OV) returns wrong result if OV is the result of an operation with int overflow.
+ * @run main/othervm -Xcomp -XX:CompileOnly=Test8005033::testBitCount Test8005033
+ * @author Richard Reingruber richard DOT reingruber AT sap DOT com
+ */
+
+public class Test8005033 {
+ public static int MINUS_ONE = -1;
+
+ public static void main(String[] args) {
+ System.out.println("EXECUTING test.");
+ Integer.bitCount(1); // load class
+ int expectedBitCount = 0;
+ int calculatedBitCount = testBitCount();
+ if (expectedBitCount != calculatedBitCount) {
+ throw new InternalError("got " + calculatedBitCount + " but expected " + expectedBitCount);
+ }
+ System.out.println("SUCCESSFULLY passed test.");
+ }
+
+ // testBitCount will be compiled using the Integer.bitCount() intrinsic if possible
+ private static int testBitCount() {
+ return Integer.bitCount(MINUS_ONE+1); // -1 + 1 => int overflow
+ }
+}
--- a/hotspot/test/runtime/7158804/Test7158804.sh Sat Dec 29 11:00:15 2012 +0000
+++ b/hotspot/test/runtime/7158804/Test7158804.sh Tue Jan 01 17:49:22 2013 -0800
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/sanity/ExecuteInternalVMTests.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 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.
+ *
+ */
+
+/* @test ExecuteInternalVMTests
+ * @bug 8004691
+ * @summary Add a jtreg test that exercises the ExecuteInternalVMTests flag
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+ExecuteInternalVMTests ExecuteInternalVMTests
+ */
+public class ExecuteInternalVMTests {
+ public static void main(String[] args) throws Exception {
+ // The tests that are run are the HotSpot internal tests which are
+ // executed only when the flag -XX:+ExecuteInternalVMTests is used.
+
+ // The flag -XX:+ExecuteInternalVMTests can only be used for
+ // non-product builds of HotSpot. Therefore, the flag
+ // -XX:+IgnoreUnrecognizedVMOptions is also used, which means that this
+ // test will do nothing on a product build.
+ }
+}
--- a/jaxp/.hgtags Sat Dec 29 11:00:15 2012 +0000
+++ b/jaxp/.hgtags Tue Jan 01 17:49:22 2013 -0800
@@ -189,3 +189,6 @@
5cf3c69a93d6d088a1cdfa28031d4f0f9438c0de jdk8-b65
e6af1ad464e3d9b1154b9f9ed9a5373b97d129fc jdk8-b66
83df3493ca3cf0be077f1d0dd90119456f266f54 jdk8-b67
+b854e70084214e9dcf1b37373f6e4b1a68760e03 jdk8-b68
+789a855de959f7e9600e57759c6c3dbb0b24d78b jdk8-b69
+6ec9edffc286c9c9ac96c9cd2050b01cb5d514a8 jdk8-b70
--- a/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
--- a/jaxp/src/com/sun/org/apache/xalan/internal/utils/FactoryImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/FactoryImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xslt/EnvironmentCheck.java Tue Jan 01 17:49:22 2013 -0800
@@ -1005,7 +1005,7 @@
{
Class clazz = ObjectFactory.findProviderClass(DOM_CLASS, true);
- Method method = clazz.getMethod(DOM_LEVEL3_METHOD, null);
+ Method method = clazz.getMethod(DOM_LEVEL3_METHOD, (Class<?>[])null);
// If we succeeded, we have loaded interfaces from a
// level 3 DOM somewhere
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/Version.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Version.java Tue Jan 01 17:49:22 2013 -0800
@@ -74,7 +74,7 @@
/** Version string.
* @deprecated getVersion() should be used instead. */
- public static String fVersion = "Xerces-J 2.7.1";
+ public static final String fVersion = getVersion();
private static final String fImmutableVersion = "Xerces-J 2.7.1";
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -193,9 +193,12 @@
null,
};
- protected static final char [] cdata = {'[','C','D','A','T','A','['};
- protected static final char [] xmlDecl = {'<','?','x','m','l'};
- protected static final char [] endTag = {'<','/'};
+ private static final char [] cdata = {'[','C','D','A','T','A','['};
+ private static final char [] endTag = {'<','/'};
+
+ //this variable is also used by XMLDocumentScannerImpl in the same package
+ static final char [] xmlDecl = {'<','?','x','m','l'};
+
// debugging
/** Debug scanner state. */
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java Tue Jan 01 17:49:22 2013 -0800
@@ -71,7 +71,7 @@
/** Listeners which should know when load is being called */
private Vector listeners = new Vector();
- public static final boolean [] VALID_NAMES = new boolean[127];
+ private static final boolean [] VALID_NAMES = new boolean[127];
/**
* Debug printing of buffer. This debugging flag works best when you
--- a/jaxp/src/javax/xml/transform/FactoryFinder.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jaxp/src/javax/xml/transform/FactoryFinder.java Tue Jan 01 17:49:22 2013 -0800
@@ -210,7 +210,7 @@
providerClass.getDeclaredMethod(
"newTransformerFactoryNoServiceLoader"
);
- return creationMethod.invoke(null, null);
+ return creationMethod.invoke(null, (Object[])null);
} catch (NoSuchMethodException exc) {
return null;
} catch (Exception exc) {
--- a/jaxp/src/javax/xml/validation/SchemaFactoryFinder.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jaxp/src/javax/xml/validation/SchemaFactoryFinder.java Tue Jan 01 17:49:22 2013 -0800
@@ -357,7 +357,7 @@
providerClass.getDeclaredMethod(
"newXMLSchemaFactoryNoServiceLoader"
);
- return creationMethod.invoke(null, null);
+ return creationMethod.invoke(null, (Object[])null);
} catch (NoSuchMethodException exc) {
return null;
} catch (Exception exc) {
--- a/jaxp/src/javax/xml/xpath/XPathFactoryFinder.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jaxp/src/javax/xml/xpath/XPathFactoryFinder.java Tue Jan 01 17:49:22 2013 -0800
@@ -333,7 +333,7 @@
providerClass.getDeclaredMethod(
"newXPathFactoryNoServiceLoader"
);
- return creationMethod.invoke(null, null);
+ return creationMethod.invoke(null, (Object[])null);
} catch (NoSuchMethodException exc) {
return null;
} catch (Exception exc) {
--- a/jaxws/.hgtags Sat Dec 29 11:00:15 2012 +0000
+++ b/jaxws/.hgtags Tue Jan 01 17:49:22 2013 -0800
@@ -189,3 +189,6 @@
fbe54291c9d337ea4dfef4d846f1d9a22f76249c jdk8-b65
3eb7f11cb4e000555c1b6f0f1a10fe2919633c8e jdk8-b66
eb06aa51dfc225614dba2d89ae7ca6cedddff982 jdk8-b67
+d3fe408f3a9ad250bc9a4e9365bdfc3f28c1d3f4 jdk8-b68
+756323c990115a9c0341d67b10f2d52c6370e35d jdk8-b69
+3b1c2733d47ee9f8c530925df4041c59f9ee5a31 jdk8-b70
--- a/jdk/.hgtags Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/.hgtags Tue Jan 01 17:49:22 2013 -0800
@@ -190,3 +190,5 @@
4d337fae2250135729ee9ed2bf8baf3c60da5d6d jdk8-b66
ce9b02a3a17edd1983201002cfa0f364e4ab7524 jdk8-b67
53fb43e4d614c92310e1fb00ec41d1960fd9facf jdk8-b68
+a8012d8d7e9c5035de0bdd4887dc9f7c54008f21 jdk8-b69
+a996b57e554198f4592a5f3c30f2f9f4075e545d jdk8-b70
--- a/jdk/makefiles/CompileNativeLibraries.gmk Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/makefiles/CompileNativeLibraries.gmk Tue Jan 01 17:49:22 2013 -0800
@@ -90,14 +90,11 @@
ARFLAGS:=$(ARFLAGS),\
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm))
-BUILD_LIBRARIES += $(BUILD_LIBFDLIBM)
-
else
-#
-# On macosx they do partial (incremental) linking of fdlibm
-# code it here...rather than add support to NativeCompilation
-# as this is firt time I see it
-$(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM,\
+
+# On macosx the old build does partial (incremental) linking of fdlibm instead of
+# a plain static library.
+$(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC,\
LIBRARY:=fdlibm,\
OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm,\
SRC:=$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src,\
@@ -107,11 +104,12 @@
LDFLAGS:=-nostdlib -r -arch x86_64,\
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libfdlibm))
-$(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) : $(BUILD_LIBFDLIBM)
+BUILD_LIBFDLIBM := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
+$(BUILD_LIBFDLIBM) : $(BUILD_LIBFDLIBM_MAC)
$(CP) -a $< $@
-BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
endif
+BUILD_LIBRARIES += $(BUILD_LIBFDLIBM)
##########################################################################################
--- a/jdk/makefiles/CreateJars.gmk Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/makefiles/CreateJars.gmk Tue Jan 01 17:49:22 2013 -0800
@@ -812,9 +812,8 @@
$(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(IMAGES_OUTPUTDIR)/lib/rt.jar
$(RM) -r $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
$(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
- $(JAVA) \
- -Xbootclasspath/a:$(JDK_OUTPUTDIR)/classes \
- $(JAVAC_JARS) \
+ $(JAVA) $(JAVAC_JARS) \
+ -bootclasspath $(JDK_OUTPUTDIR)/classes \
-XDprocess.packages -proc:only \
-processor com.sun.tools.javac.sym.CreateSymbols \
-Acom.sun.tools.javac.sym.Jar=$(IMAGES_OUTPUTDIR)/lib/rt.jar \
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java Tue Jan 01 17:49:22 2013 -0800
@@ -119,7 +119,9 @@
public void handleWindowFocusEvent(boolean parentWindowActive) {
this.parentWindowActive = parentWindowActive;
- if (focused) {
+ // ignore focus "lost" native request as it may mistakenly
+ // deactivate active window (see 8001161)
+ if (focused && parentWindowActive) {
responder.handleWindowFocusEvent(parentWindowActive, null);
}
}
--- a/jdk/src/macosx/native/sun/font/CCharToGlyphMapper.m Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/macosx/native/sun/font/CCharToGlyphMapper.m Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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 <JavaNativeFoundation/JavaNativeFoundation.h>
--- a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -58,7 +58,8 @@
*/
public class DefaultPersistenceDelegate extends PersistenceDelegate {
- private String[] constructor;
+ private static final String[] EMPTY = {};
+ private final String[] constructor;
private Boolean definesEquals;
/**
@@ -67,7 +68,7 @@
* @see #DefaultPersistenceDelegate(java.lang.String[])
*/
public DefaultPersistenceDelegate() {
- this(new String[0]);
+ this.constructor = EMPTY;
}
/**
@@ -92,7 +93,7 @@
* @see #instantiate
*/
public DefaultPersistenceDelegate(String[] constructorPropertyNames) {
- this.constructor = constructorPropertyNames;
+ this.constructor = (constructorPropertyNames == null) ? EMPTY : constructorPropertyNames.clone();
}
private static boolean definesEquals(Class<?> type) {
--- a/jdk/src/share/classes/java/beans/EventSetDescriptor.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/beans/EventSetDescriptor.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -277,7 +277,9 @@
Method removeListenerMethod)
throws IntrospectionException {
setName(eventSetName);
- this.listenerMethodDescriptors = listenerMethodDescriptors;
+ this.listenerMethodDescriptors = (listenerMethodDescriptors != null)
+ ? listenerMethodDescriptors.clone()
+ : null;
setAddListenerMethod(addListenerMethod);
setRemoveListenerMethod(removeListenerMethod);
setListenerType(listenerType);
@@ -347,7 +349,9 @@
* events are fired.
*/
public synchronized MethodDescriptor[] getListenerMethodDescriptors() {
- return listenerMethodDescriptors;
+ return (this.listenerMethodDescriptors != null)
+ ? this.listenerMethodDescriptors.clone()
+ : null;
}
/**
--- a/jdk/src/share/classes/java/beans/MethodDescriptor.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/beans/MethodDescriptor.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -70,7 +70,9 @@
ParameterDescriptor parameterDescriptors[]) {
setName(method.getName());
setMethod(method);
- this.parameterDescriptors = parameterDescriptors;
+ this.parameterDescriptors = (parameterDescriptors != null)
+ ? parameterDescriptors.clone()
+ : null;
}
/**
@@ -161,7 +163,9 @@
* a null array if the parameter names aren't known.
*/
public ParameterDescriptor[] getParameterDescriptors() {
- return parameterDescriptors;
+ return (this.parameterDescriptors != null)
+ ? this.parameterDescriptors.clone()
+ : null;
}
/*
--- a/jdk/src/share/classes/java/beans/Statement.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/beans/Statement.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -92,7 +92,7 @@
public Statement(Object target, String methodName, Object[] arguments) {
this.target = target;
this.methodName = methodName;
- this.arguments = (arguments == null) ? emptyArray : arguments;
+ this.arguments = (arguments == null) ? emptyArray : arguments.clone();
}
/**
@@ -128,7 +128,7 @@
* @return the array of arguments
*/
public Object[] getArguments() {
- return arguments;
+ return this.arguments.clone();
}
/**
--- a/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java Tue Jan 01 17:49:22 2013 -0800
@@ -295,9 +295,6 @@
String invokerDesc = invokerType.toMethodDescriptorString();
mv = cw.visitMethod(Opcodes.ACC_STATIC, invokerName, invokerDesc, null, null);
-
- // Force inlining of this invoker method.
- mv.visitAnnotation("Ljava/lang/invoke/ForceInline;", true);
}
/**
@@ -524,6 +521,9 @@
// Mark this method as a compiled LambdaForm
mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Compiled;", true);
+ // Force inlining of this invoker method.
+ mv.visitAnnotation("Ljava/lang/invoke/ForceInline;", true);
+
// iterate over the form's names, generating bytecode instructions for each
// start iterating at the first name following the arguments
for (int i = lambdaForm.arity; i < lambdaForm.names.length; i++) {
@@ -943,6 +943,9 @@
// Suppress this method in backtraces displayed to the user.
mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
+ // Don't inline the interpreter entry.
+ mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true);
+
// create parameter array
emitIconstInsn(invokerType.parameterCount());
mv.visitTypeInsn(Opcodes.ANEWARRAY, "java/lang/Object");
@@ -1005,6 +1008,9 @@
// Suppress this method in backtraces displayed to the user.
mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
+ // Force inlining of this invoker method.
+ mv.visitAnnotation("Ljava/lang/invoke/ForceInline;", true);
+
// Load receiver
emitAloadInsn(0);
--- a/jdk/src/share/classes/java/lang/invoke/LambdaForm.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/lang/invoke/LambdaForm.java Tue Jan 01 17:49:22 2013 -0800
@@ -592,6 +592,7 @@
private int invocationCounter = 0;
@Hidden
+ @DontInline
/** Interpretively invoke this form on the given arguments. */
Object interpretWithArguments(Object... argumentValues) throws Throwable {
if (TRACE_INTERPRETER)
@@ -606,6 +607,7 @@
}
@Hidden
+ @DontInline
/** Evaluate a single Name within this form, applying its function to its arguments. */
Object interpretName(Name name, Object[] values) throws Throwable {
if (TRACE_INTERPRETER)
--- a/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/lang/invoke/MethodHandleImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -310,9 +310,9 @@
}
static class AsVarargsCollector extends MethodHandle {
- MethodHandle target;
- final Class<?> arrayType;
- MethodHandle cache;
+ private final MethodHandle target;
+ private final Class<?> arrayType;
+ private MethodHandle cache;
AsVarargsCollector(MethodHandle target, MethodType type, Class<?> arrayType) {
super(type, reinvokerForm(type));
--- a/jdk/src/share/classes/java/util/CurrencyData.properties Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/util/CurrencyData.properties Tue Jan 01 17:49:22 2013 -0800
@@ -28,7 +28,7 @@
# Version of the currency code information in this class.
# It is a serial number that accompanies with each amendment.
-dataVersion=153
+dataVersion=154
# List of all valid ISO 4217 currency codes.
# To ensure compatibility, do not remove codes.
@@ -52,7 +52,8 @@
TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-\
UYU858-UZS860-VEB862-VEF937-VND704-VUV548-WST882-XAF950-XAG961-XAU959-XBA955-\
XBB956-XBC957-XBD958-XCD951-XDR960-XFO000-XFU000-XOF952-XPD964-XPF953-\
- XPT962-XSU994-XTS963-XUA965-XXX999-YER886-YUM891-ZAR710-ZMK894-ZWD716-ZWL932-ZWN942-ZWR935
+ XPT962-XSU994-XTS963-XUA965-XXX999-YER886-YUM891-ZAR710-ZMK894-ZMW967-ZWD716-ZWL932-\
+ ZWN942-ZWR935
# Mappings from ISO 3166 country codes to ISO 4217 currency codes.
@@ -573,7 +574,7 @@
# YEMEN
YE=YER
# ZAMBIA
-ZM=ZMK
+ZM=ZMW
# ZIMBABWE
ZW=ZWL
--- a/jdk/src/share/classes/java/util/LocaleISOData.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/util/LocaleISOData.java Tue Jan 01 17:49:22 2013 -0800
@@ -473,7 +473,7 @@
+ "YE" + "YEM" // Yemen
+ "YT" + "MYT" // Mayotte
+ "ZA" + "ZAF" // South Africa, Republic of
- + "ZM" + "ZMB" // Zambia, Republic of
+ + "ZM" + "ZMW" // Zambia, Republic of
+ "ZW" + "ZWE" // Zimbabwe
;
--- a/jdk/src/share/classes/java/util/function/BinaryOperator.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/util/function/BinaryOperator.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
--- a/jdk/src/share/classes/java/util/function/Block.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/util/function/Block.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
--- a/jdk/src/share/classes/java/util/function/DoubleBlock.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/util/function/DoubleBlock.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
--- a/jdk/src/share/classes/java/util/function/Function.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/util/function/Function.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
--- a/jdk/src/share/classes/java/util/function/IntBlock.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/util/function/IntBlock.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
--- a/jdk/src/share/classes/java/util/function/LongBlock.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/util/function/LongBlock.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
--- a/jdk/src/share/classes/java/util/function/Predicate.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/java/util/function/Predicate.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
--- a/jdk/src/share/classes/sun/invoke/util/ValueConversions.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/sun/invoke/util/ValueConversions.java Tue Jan 01 17:49:22 2013 -0800
@@ -449,8 +449,16 @@
* @param x an arbitrary reference value
* @return the same value x
*/
+ @SuppressWarnings("unchecked")
static <T,U> T castReference(Class<? extends T> t, U x) {
- return t.cast(x);
+ // inlined Class.cast because we can't ForceInline it
+ if (x != null && !t.isInstance(x))
+ throw newClassCastException(t, x);
+ return (T) x;
+ }
+
+ private static ClassCastException newClassCastException(Class<?> t, Object obj) {
+ return new ClassCastException("Cannot cast " + obj.getClass().getName() + " to " + t.getName());
}
private static final MethodHandle IDENTITY, CAST_REFERENCE, ZERO_OBJECT, IGNORE, EMPTY,
--- a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMS.java Tue Jan 01 17:49:22 2013 -0800
@@ -53,7 +53,9 @@
public static native long getProfileID(ICC_Profile profile);
public static native long createNativeTransform(
- long[] profileIDs, int renderType, int inFormatter, int outFormatter,
+ long[] profileIDs, int renderType,
+ int inFormatter, boolean isInIntPacked,
+ int outFormatter, boolean isOutIntPacked,
Object disposerRef);
/**
--- a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java Tue Jan 01 17:49:22 2013 -0800
@@ -196,7 +196,8 @@
case BufferedImage.TYPE_4BYTE_ABGR:
byteRaster = (ByteComponentRaster)image.getRaster();
nextRowOffset = byteRaster.getScanlineStride();
- offset = byteRaster.getDataOffset(0);
+ int firstBand = image.getSampleModel().getNumBands() - 1;
+ offset = byteRaster.getDataOffset(firstBand);
dataArray = byteRaster.getDataStorage();
dataType = DT_BYTE;
break;
--- a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSTransform.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSTransform.java Tue Jan 01 17:49:22 2013 -0800
@@ -55,8 +55,10 @@
public class LCMSTransform implements ColorTransform {
long ID;
- private int inFormatter;
- private int outFormatter;
+ private int inFormatter = 0;
+ private boolean isInIntPacked = false;
+ private int outFormatter = 0;
+ private boolean isOutIntPacked = false;
ICC_Profile[] profiles;
long [] profileIDs;
@@ -135,18 +137,23 @@
LCMSImageLayout out) {
// update native transfrom if needed
if (ID == 0L ||
- inFormatter != in.pixelType ||
- outFormatter != out.pixelType) {
+ inFormatter != in.pixelType || isInIntPacked != in.isIntPacked ||
+ outFormatter != out.pixelType || isOutIntPacked != out.isIntPacked)
+ {
if (ID != 0L) {
// Disposer will destroy forgotten transform
disposerReferent = new Object();
}
inFormatter = in.pixelType;
+ isInIntPacked = in.isIntPacked;
+
outFormatter = out.pixelType;
+ isOutIntPacked = out.isIntPacked;
ID = LCMS.createNativeTransform(profileIDs, renderType,
- inFormatter, outFormatter,
+ inFormatter, isInIntPacked,
+ outFormatter, isOutIntPacked,
disposerReferent);
}
--- a/jdk/src/share/classes/sun/java2d/pipe/ParallelogramPipe.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/sun/java2d/pipe/ParallelogramPipe.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
--- a/jdk/src/share/classes/sun/misc/Unsafe.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/sun/misc/Unsafe.java Tue Jan 01 17:49:22 2013 -0800
@@ -1008,4 +1008,125 @@
* if the load average is unobtainable.
*/
public native int getLoadAverage(double[] loadavg, int nelems);
+
+ // The following contain CAS-based Java implementations used on
+ // platforms not supporting native instructions
+
+ /**
+ * Atomically adds the given value to the current value of a field
+ * or array element within the given object <code>o</code>
+ * at the given <code>offset</code>.
+ *
+ * @param o object/array to update the field/element in
+ * @param offset field/element offset
+ * @param delta the value to add
+ * @return the previous value
+ * @since 1.8
+ */
+ public final int getAndAddInt(Object o, long offset, int delta) {
+ int v;
+ do {
+ v = getIntVolatile(o, offset);
+ } while (!compareAndSwapInt(o, offset, v, v + delta));
+ return v;
+ }
+
+ /**
+ * Atomically adds the given value to the current value of a field
+ * or array element within the given object <code>o</code>
+ * at the given <code>offset</code>.
+ *
+ * @param o object/array to update the field/element in
+ * @param offset field/element offset
+ * @param delta the value to add
+ * @return the previous value
+ * @since 1.8
+ */
+ public final long getAndAddLong(Object o, long offset, long delta) {
+ long v;
+ do {
+ v = getLongVolatile(o, offset);
+ } while (!compareAndSwapLong(o, offset, v, v + delta));
+ return v;
+ }
+
+ /**
+ * Atomically exchanges the given value with the current value of
+ * a field or array element within the given object <code>o</code>
+ * at the given <code>offset</code>.
+ *
+ * @param o object/array to update the field/element in
+ * @param offset field/element offset
+ * @param newValue new value
+ * @return the previous value
+ * @since 1.8
+ */
+ public final int getAndSetInt(Object o, long offset, int newValue) {
+ int v;
+ do {
+ v = getIntVolatile(o, offset);
+ } while (!compareAndSwapInt(o, offset, v, newValue));
+ return v;
+ }
+
+ /**
+ * Atomically exchanges the given value with the current value of
+ * a field or array element within the given object <code>o</code>
+ * at the given <code>offset</code>.
+ *
+ * @param o object/array to update the field/element in
+ * @param offset field/element offset
+ * @param newValue new value
+ * @return the previous value
+ * @since 1.8
+ */
+ public final long getAndSetLong(Object o, long offset, long newValue) {
+ long v;
+ do {
+ v = getLongVolatile(o, offset);
+ } while (!compareAndSwapLong(o, offset, v, newValue));
+ return v;
+ }
+
+ /**
+ * Atomically exchanges the given reference value with the current
+ * reference value of a field or array element within the given
+ * object <code>o</code> at the given <code>offset</code>.
+ *
+ * @param o object/array to update the field/element in
+ * @param offset field/element offset
+ * @param newValue new value
+ * @return the previous value
+ * @since 1.8
+ */
+ public final Object getAndSetObject(Object o, long offset, Object newValue) {
+ Object v;
+ do {
+ v = getObjectVolatile(o, offset);
+ } while (!compareAndSwapObject(o, offset, v, newValue));
+ return v;
+ }
+
+
+ /**
+ * Ensures lack of reordering of loads before the fence
+ * with loads or stores after the fence.
+ * @since 1.8
+ */
+ public native void loadFence();
+
+ /**
+ * Ensures lack of reordering of stores before the fence
+ * with loads or stores after the fence.
+ * @since 1.8
+ */
+ public native void storeFence();
+
+ /**
+ * Ensures lack of reordering of loads or stores before the fence
+ * with loads or stores after the fence.
+ * @since 1.8
+ */
+ public native void fullFence();
+
}
--- a/jdk/src/share/classes/sun/tools/jcmd/JCmd.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/sun/tools/jcmd/JCmd.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,8 +1,7 @@
/*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *com.sun.tools.attach.AttachNotSupportedException
-
+ *
* 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
--- a/jdk/src/share/classes/sun/util/resources/CurrencyNames.properties Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/classes/sun/util/resources/CurrencyNames.properties Tue Jan 01 17:49:22 2013 -0800
@@ -278,6 +278,7 @@
YUM=YUM
ZAR=ZAR
ZMK=ZMK
+ZMW=ZMW
ZWD=ZWD
ZWL=ZWL
ZWN=ZWN
--- a/jdk/src/share/demo/java2d/J2DBench/build.xml Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/demo/java2d/J2DBench/build.xml Tue Jan 01 17:49:22 2013 -0800
@@ -49,7 +49,7 @@
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
- <javac debug="false" source="1.2" target="1.2" srcdir="${src}" destdir="${build}"/>
+ <javac debug="flase" source="1.5" target="1.5" srcdir="${src}" destdir="${build}"/>
</target>
<target name="run" depends="dist"
--- a/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/J2DBench.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/J2DBench.java Tue Jan 01 17:49:22 2013 -0800
@@ -69,6 +69,7 @@
import j2dbench.tests.RenderTests;
import j2dbench.tests.PixelTests;
import j2dbench.tests.iio.IIOTests;
+import j2dbench.tests.cmm.CMMTests;
import j2dbench.tests.text.TextConstructionTests;
import j2dbench.tests.text.TextMeasureTests;
import j2dbench.tests.text.TextRenderTests;
@@ -199,6 +200,7 @@
TextMeasureTests.init();
TextConstructionTests.init();
IIOTests.init();
+ CMMTests.init();
boolean gui = true;
boolean showresults = true;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/tests/cmm/CMMTests.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of Oracle nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+
+package j2dbench.tests.cmm;
+
+import j2dbench.Group;
+import j2dbench.Option;
+import j2dbench.Result;
+import j2dbench.Test;
+import j2dbench.TestEnvironment;
+import java.awt.color.ColorSpace;
+import java.awt.color.ICC_ColorSpace;
+import java.awt.color.ICC_Profile;
+import java.io.IOException;
+import java.io.InputStream;
+
+public class CMMTests extends Test {
+
+ protected static Group cmmRoot;
+ protected static Group cmmOptRoot;
+ protected static Option csList;
+ protected static Option usePlatfromProfiles;
+
+ public static void init() {
+ cmmRoot = new Group("cmm", "Color Management Benchmarks");
+ cmmRoot.setTabbed();
+
+ cmmOptRoot = new Group(cmmRoot, "opts", "General Options");
+
+ /*
+ usePlatfromProfiles =
+ new Option.Enable(cmmOptRoot, "csPlatfrom",
+ "Use Platfrom Profiles", false);
+ */
+ int[] colorspaces = new int[] {
+ ColorSpace.CS_sRGB,
+ ColorSpace.CS_GRAY,
+ ColorSpace.CS_LINEAR_RGB,
+ ColorSpace.CS_CIEXYZ
+ };
+
+ String[] csNames = new String[]{
+ "CS_sRGB",
+ "CS_GRAY",
+ "CS_LINEAR_RGB",
+ "CS_CIEXYZ"
+ };
+
+ csList = new Option.IntList(cmmOptRoot,
+ "profiles", "Color Profiles",
+ colorspaces, csNames, csNames, 0x8);
+
+ ColorConversionTests.init();
+ ProfileTests.init();
+ }
+
+ protected static ColorSpace getColorSpace(TestEnvironment env) {
+ ColorSpace cs;
+ Boolean usePlatfrom = true; //(Boolean)env.getModifier(usePlatfromProfiles);
+
+ int cs_code = env.getIntValue(csList);
+ if (usePlatfrom) {
+ cs = ColorSpace.getInstance(cs_code);
+ } else {
+ String resource = "profiles/";
+ switch (cs_code) {
+ case ColorSpace.CS_CIEXYZ:
+ resource += "CIEXYZ.pf";
+ break;
+ case ColorSpace.CS_GRAY:
+ resource += "GRAY.pf";
+ break;
+ case ColorSpace.CS_LINEAR_RGB:
+ resource += "LINEAR_RGB.pf";
+ break;
+ case ColorSpace.CS_PYCC:
+ resource += "PYCC.pf";
+ break;
+ case ColorSpace.CS_sRGB:
+ resource += "sRGB.pf";
+ break;
+ default:
+ throw new RuntimeException("Unknown color space: " + cs_code);
+ }
+
+ try {
+ InputStream is = CMMTests.class.getResourceAsStream(resource);
+ ICC_Profile p = ICC_Profile.getInstance(is);
+
+ cs = new ICC_ColorSpace(p);
+ } catch (IOException e) {
+ throw new RuntimeException("Unable load profile from resource " + resource, e);
+ }
+ }
+ return cs;
+ }
+
+ protected CMMTests(Group parent, String nodeName, String description) {
+ super(parent, nodeName, description);
+ addDependencies(cmmOptRoot, true);
+ }
+
+ @Override
+ public Object initTest(TestEnvironment te, Result result) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void runTest(Object o, int i) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void cleanupTest(TestEnvironment te, Object o) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/tests/cmm/ColorConversionTests.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of Oracle nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+
+package j2dbench.tests.cmm;
+
+import j2dbench.Group;
+
+public class ColorConversionTests extends CMMTests {
+
+ protected static Group colorConvRoot;
+
+ public static void init() {
+ colorConvRoot = new Group(cmmRoot, "colorconv", "Color Conversion Benchmarks");
+ colorConvRoot.setTabbed();
+
+ DataConversionTests.init();
+ ColorConvertOpTests.init();
+ }
+
+ protected ColorConversionTests(Group parent, String nodeName, String description) {
+ super(parent, nodeName, description);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/tests/cmm/ColorConvertOpTests.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,383 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of Oracle nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+
+package j2dbench.tests.cmm;
+
+import j2dbench.Group;
+import j2dbench.Option;
+import j2dbench.Result;
+import j2dbench.TestEnvironment;
+import j2dbench.tests.iio.IIOTests;
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.color.ColorSpace;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorConvertOp;
+import java.awt.image.Raster;
+import java.awt.image.WritableRaster;
+import javax.imageio.ImageIO;
+
+public class ColorConvertOpTests extends ColorConversionTests {
+
+ private static enum ImageContent {
+ BLANK("bank", "Blank (opaque black)"),
+ RANDOM("random", "Random"),
+ VECTOR("vector", "Vector Art"),
+ PHOTO("photo", "Photograph");
+
+ public final String name;
+ public final String descr;
+
+ private ImageContent(String name, String descr) {
+ this.name = name;
+ this.descr = descr;
+ }
+ }
+
+ private static enum ImageType {
+ INT_ARGB(BufferedImage.TYPE_INT_ARGB, "INT_ARGB", "TYPE_INT_ARGB"),
+ INT_RGB(BufferedImage.TYPE_INT_RGB, "INT_RGB", "TYPE_INT_RGB"),
+ INT_BGR(BufferedImage.TYPE_INT_BGR, "INT_BGR", "TYPE_INT_BGR"),
+ BYTE_3BYTE_BGR(BufferedImage.TYPE_3BYTE_BGR, "3BYTE_BGR", "TYPE_3BYTE_BGR"),
+ BYTE_4BYTE_ABGR(BufferedImage.TYPE_4BYTE_ABGR, "4BYTE_BGR", "TYPE_4BYTE_BGR"),
+ COMPATIBLE_DST(0, "Compatible", "Compatible destination");
+
+ private ImageType(int type, String abbr, String descr) {
+ this.type = type;
+ this.abbrev = abbr;
+ this.descr = descr;
+ }
+
+ public final int type;
+ public final String abbrev;
+ public final String descr;
+ }
+
+ private static enum ListType {
+ SRC("srcType", "Source Images"),
+ DST("dstType", "Destination Images");
+
+ private ListType(String name, String description) {
+ this.name = name;
+ this.description = description;
+ }
+ public final String name;
+ public final String description;
+ }
+
+ public static Option createImageTypeList(ListType listType) {
+
+ ImageType[] allTypes = ImageType.values();
+
+ int num = allTypes.length;
+ if (listType == ListType.SRC) {
+ num -= 1; // exclude compatible destination
+ }
+
+ ImageType[] t = new ImageType[num];
+ String[] names = new String[num];
+ String[] abbrev = new String[num];
+ String[] descr = new String[num];
+
+ for (int i = 0; i < num; i++) {
+ t[i] = allTypes[i];
+ names[i] = t[i].toString();
+ abbrev[i] = t[i].abbrev;
+ descr[i] = t[i].descr;
+ }
+
+ Option list = new Option.ObjectList(opOptionsRoot,
+ listType.name, listType.description,
+ names, t, abbrev, descr, 1);
+ return list;
+ }
+
+ protected static Group opConvRoot;
+
+ protected static Group opOptionsRoot;
+ protected static Option sizeList;
+ protected static Option contentList;
+
+ protected static Option sourceType;
+
+ protected static Option destinationType;
+
+ public static void init() {
+ opConvRoot = new Group(colorConvRoot, "ccop", "ColorConvertOp Tests");
+
+ opOptionsRoot = new Group(opConvRoot, "ccopOptions", "Options");
+
+ // size list
+ int[] sizes = new int[] {1, 20, 250, 1000, 4000};
+ String[] sizeStrs = new String[] {
+ "1x1", "20x20", "250x250", "1000x1000", "4000x4000"
+ };
+ String[] sizeDescs = new String[] {
+ "Tiny Images (1x1)",
+ "Small Images (20x20)",
+ "Medium Images (250x250)",
+ "Large Images (1000x1000)",
+ "Huge Images (4000x4000)",
+ };
+ sizeList = new Option.IntList(opOptionsRoot,
+ "size", "Image Size",
+ sizes, sizeStrs, sizeDescs, 0x4);
+ ((Option.ObjectList) sizeList).setNumRows(5);
+
+ // image content
+ ImageContent[] c = ImageContent.values();
+
+ String[] contentStrs = new String[c.length];
+ String[] contentDescs = new String[c.length];
+
+ for (int i = 0; i < c.length; i++) {
+ contentStrs[i] = c[i].name;
+ contentDescs[i] = c[i].descr;
+ };
+
+ contentList = new Option.ObjectList(opOptionsRoot,
+ "content", "Image Content",
+ contentStrs, c,
+ contentStrs, contentDescs,
+ 0x8);
+
+ sourceType = createImageTypeList(ListType.SRC);
+
+ destinationType = createImageTypeList(ListType.DST);
+
+ new ConvertImageTest();
+ new ConvertRasterTest();
+ new DrawImageTest();
+ }
+
+ public ColorConvertOpTests(Group parent, String nodeName, String description) {
+ super(parent, nodeName, description);
+ addDependencies(opOptionsRoot, true);
+ }
+
+ public Object initTest(TestEnvironment env, Result res) {
+ return new Context(env, res);
+ }
+
+ public void cleanupTest(TestEnvironment env, Object o) {
+ Context ctx = (Context)o;
+ ctx.cs = null;
+ ctx.op_img = null;
+ ctx.op_rst = null;
+ ctx.dst = null;
+ ctx.src = null;
+ ctx.graphics = null;
+ }
+
+ private static class Context {
+ ColorSpace cs;
+ Graphics2D graphics;
+ ColorConvertOp op_img;
+ ColorConvertOp op_rst;
+
+ BufferedImage src;
+ BufferedImage dst;
+
+ WritableRaster rsrc;
+ WritableRaster rdst;
+
+ public Context(TestEnvironment env, Result res) {
+
+ graphics = (Graphics2D)env.getGraphics();
+ cs = getColorSpace(env);
+
+ // TODO: provide rendering hints
+ op_img = new ColorConvertOp(cs, null);
+ ColorSpace sRGB = ColorSpace.getInstance(ColorSpace.CS_sRGB);
+ op_rst = new ColorConvertOp(sRGB, cs, null);
+
+ int size = env.getIntValue(sizeList);
+
+ ImageContent content = (ImageContent)env.getModifier(contentList);
+ ImageType srcType = (ImageType)env.getModifier(sourceType);
+
+ src = createBufferedImage(size, size, content, srcType.type);
+ rsrc = src.getRaster();
+
+ ImageType dstType = (ImageType)env.getModifier(destinationType);
+ if (dstType == ImageType.COMPATIBLE_DST) {
+ dst = op_img.createCompatibleDestImage(src, null);
+ } else {
+ dst = createBufferedImage(size, size, content, dstType.type);
+ }
+ // raster always has to be comatible
+ rdst = op_rst.createCompatibleDestRaster(rsrc);
+ }
+ }
+
+ private static class ConvertImageTest extends ColorConvertOpTests {
+ public ConvertImageTest() {
+ super(opConvRoot, "op_img", "op.filetr(BufferedImage)");
+ }
+
+ public void runTest(Object octx, int numReps) {
+ final Context ctx = (Context)octx;
+ final ColorConvertOp op = ctx.op_img;
+
+ final BufferedImage src = ctx.src;
+ BufferedImage dst = ctx.dst;
+ do {
+ try {
+ dst = op.filter(src, dst);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } while (--numReps >= 0);
+ }
+ }
+
+ private static class ConvertRasterTest extends ColorConvertOpTests {
+ public ConvertRasterTest() {
+ super(opConvRoot, "op_rst", "op.filetr(Raster)");
+ }
+
+ public void runTest(Object octx, int numReps) {
+ final Context ctx = (Context)octx;
+ final ColorConvertOp op = ctx.op_rst;
+
+ final Raster src = ctx.rsrc;
+ WritableRaster dst = ctx.rdst;
+ do {
+ try {
+ dst = op.filter(src, dst);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } while (--numReps >= 0);
+ }
+ }
+
+ private static class DrawImageTest extends ColorConvertOpTests {
+ public DrawImageTest() {
+ super(opConvRoot, "op_draw", "drawImage(ColorConvertOp)");
+ }
+
+ public void runTest(Object octx, int numReps) {
+ final Context ctx = (Context)octx;
+ final ColorConvertOp op = ctx.op_img;
+
+ final Graphics2D g = ctx.graphics;
+
+ final BufferedImage src = ctx.src;
+
+ do {
+ g.drawImage(src, op, 0, 0);
+ } while (--numReps >= 0);
+ }
+ }
+
+ /**************************************************************************
+ ****** Helper routines
+ *************************************************************************/
+ protected static BufferedImage createBufferedImage(int width,
+ int height,
+ ImageContent contentType,
+ int type)
+ {
+ BufferedImage image;
+ image = new BufferedImage(width, height, type);
+ boolean hasAlpha = image.getColorModel().hasAlpha();
+ switch (contentType) {
+ case RANDOM:
+ for (int y = 0; y < height; y++) {
+ for (int x = 0; x < width; x++) {
+ int rgb = (int)(Math.random() * 0xffffff);
+ if (hasAlpha) {
+ rgb |= 0x7f000000;
+ }
+ image.setRGB(x, y, rgb);
+ }
+ }
+ break;
+ case VECTOR:
+ {
+ Graphics2D g = image.createGraphics();
+ if (hasAlpha) {
+ // fill background with a translucent color
+ g.setComposite(AlphaComposite.getInstance(
+ AlphaComposite.SRC, 0.5f));
+ }
+ g.setColor(Color.blue);
+ g.fillRect(0, 0, width, height);
+ g.setComposite(AlphaComposite.Src);
+ g.setColor(Color.yellow);
+ g.fillOval(2, 2, width-4, height-4);
+ g.setColor(Color.red);
+ g.fillOval(4, 4, width-8, height-8);
+ g.setColor(Color.green);
+ g.fillRect(8, 8, width-16, height-16);
+ g.setColor(Color.white);
+ g.drawLine(0, 0, width, height);
+ g.drawLine(0, height, width, 0);
+ g.dispose();
+ break;
+ }
+ case PHOTO:
+ {
+ Image photo = null;
+ try {
+ photo = ImageIO.read(
+ IIOTests.class.getResourceAsStream("images/photo.jpg"));
+ } catch (Exception e) {
+ System.err.println("error loading photo");
+ e.printStackTrace();
+ }
+ Graphics2D g = image.createGraphics();
+ if (hasAlpha) {
+ g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC,
+ 0.5f));
+ }
+ g.drawImage(photo, 0, 0, width, height, null);
+ g.dispose();
+ break;
+ }
+ default:
+ break;
+ }
+
+ return image;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/tests/cmm/DataConversionTests.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of Oracle nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+
+package j2dbench.tests.cmm;
+
+import j2dbench.Group;
+import j2dbench.Result;
+import j2dbench.TestEnvironment;
+import java.awt.color.ColorSpace;
+
+public class DataConversionTests extends ColorConversionTests {
+
+ protected static Group dataConvRoot;
+
+ public static void init() {
+ dataConvRoot = new Group(colorConvRoot, "data", "Data Conversoion Tests");
+
+ new FromRGBTest();
+ new ToRGBTest();
+ new FromCIEXYZTest();
+ new ToCIEXYZTest();
+ }
+
+ public DataConversionTests(Group parent, String nodeName, String description) {
+ super(parent, nodeName, description);
+ }
+
+ protected static class Context {
+
+ ColorSpace cs;
+ int numComponents;
+ float[] val;
+ float[] rgb;
+ float[] cie;
+ TestEnvironment env;
+ Result res;
+
+ public Context(TestEnvironment env, Result result, ColorSpace cs) {
+ this.cs = cs;
+ this.env = env;
+ this.res = result;
+
+ numComponents = cs.getNumComponents();
+
+ val = new float[numComponents];
+
+ for (int i = 0; i < numComponents; i++) {
+ float min = cs.getMinValue(i);
+ float max = cs.getMaxValue(i);
+
+ val[i] = 0.5f * (max - min);
+ }
+
+ rgb = new float[]{0.5f, 0.5f, 0.5f};
+ cie = new float[]{0.5f, 0.5f, 0.5f};
+ }
+ }
+
+ @Override
+ public Object initTest(TestEnvironment env, Result result) {
+ ColorSpace cs = getColorSpace(env);
+ return new Context(env, result, cs);
+ }
+
+ @Override
+ public void cleanupTest(TestEnvironment te, Object o) {
+ }
+
+ private static class FromRGBTest extends DataConversionTests {
+
+ public FromRGBTest() {
+ super(dataConvRoot,
+ "fromRGB",
+ "ColorSpace.fromRGB()");
+ }
+
+ public void runTest(Object ctx, int numReps) {
+ final Context ictx = (Context) ctx;
+ final ColorSpace cs = ictx.cs;
+
+ final float[] rgb = ictx.rgb;
+ do {
+ try {
+ cs.fromRGB(rgb);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } while (--numReps >= 0);
+ }
+ }
+
+ private static class FromCIEXYZTest extends DataConversionTests {
+
+ public FromCIEXYZTest() {
+ super(dataConvRoot,
+ "fromCIEXYZ",
+ "ColorSpace.fromCIEXYZ()");
+ }
+
+ public void runTest(Object ctx, int numReps) {
+ final Context ictx = (Context) ctx;
+ final ColorSpace cs = ictx.cs;
+
+ final float[] val = ictx.cie;
+ do {
+ try {
+ cs.fromCIEXYZ(val);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } while (--numReps >= 0);
+ }
+ }
+
+ private static class ToCIEXYZTest extends DataConversionTests {
+
+ public ToCIEXYZTest() {
+ super(dataConvRoot,
+ "toCIEXYZ",
+ "ColorSpace.toCIEXYZ()");
+ }
+
+ public void runTest(Object ctx, int numReps) {
+ final Context ictx = (Context) ctx;
+ final ColorSpace cs = ictx.cs;
+
+ final float[] val = ictx.val;
+
+ do {
+ try {
+ cs.toCIEXYZ(val);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } while (--numReps >= 0);
+ }
+ }
+
+ private static class ToRGBTest extends DataConversionTests {
+
+ public ToRGBTest() {
+ super(dataConvRoot,
+ "toRGB",
+ "ColorSpace.toRGB()");
+ }
+
+ public void runTest(Object ctx, int numReps) {
+ final Context ictx = (Context) ctx;
+ final ColorSpace cs = ictx.cs;
+
+ final float[] val = ictx.val;
+
+ do {
+ try {
+ cs.toRGB(val);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } while (--numReps >= 0);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/demo/java2d/J2DBench/src/j2dbench/tests/cmm/ProfileTests.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of Oracle nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This source code is provided to illustrate the usage of a given feature
+ * or technique and has been deliberately simplified. Additional steps
+ * required for a production-quality application, such as security checks,
+ * input validation and proper error handling, might not be present in
+ * this sample code.
+ */
+package j2dbench.tests.cmm;
+
+import j2dbench.Group;
+import j2dbench.Result;
+import j2dbench.TestEnvironment;
+import java.awt.color.ColorSpace;
+import java.awt.color.ICC_ColorSpace;
+import java.awt.color.ICC_Profile;
+
+public class ProfileTests extends CMMTests {
+
+ protected static Group profileRoot;
+
+ public static void init() {
+ profileRoot = new Group(cmmRoot, "profiles", "Profile Handling Benchmarks");
+
+ new ReadHeaderTest();
+ new GetNumComponentsTest();
+ }
+
+ protected ProfileTests(Group parent, String nodeName, String description) {
+ super(parent, nodeName, description);
+ }
+
+ protected static class Context {
+
+ ICC_Profile profile;
+ TestEnvironment env;
+ Result res;
+
+ public Context(ICC_Profile profile, TestEnvironment env, Result res) {
+ this.profile = profile;
+ this.env = env;
+ this.res = res;
+ }
+ }
+
+ @Override
+ public Object initTest(TestEnvironment env, Result res) {
+ ICC_ColorSpace cs = (ICC_ColorSpace) getColorSpace(env);
+ return new Context(cs.getProfile(), env, res);
+ }
+
+ @Override
+ public void cleanupTest(TestEnvironment env, Object o) {
+ }
+
+ private static class ReadHeaderTest extends ProfileTests {
+
+ public ReadHeaderTest() {
+ super(profileRoot,
+ "getHeader",
+ "getData(icSigHead)");
+ }
+
+ @Override
+ public void runTest(Object ctx, int numReps) {
+ final Context ictx = (Context) ctx;
+ final ICC_Profile profile = ictx.profile;
+
+ byte[] data = null;
+ do {
+ try {
+ data = profile.getData(ICC_Profile.icSigHead);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } while (--numReps >= 0);
+ }
+ }
+
+ private static class GetNumComponentsTest extends ProfileTests {
+
+ public GetNumComponentsTest() {
+ super(profileRoot,
+ "getNumComponents",
+ "getNumComponents");
+ }
+
+ @Override
+ public void runTest(Object ctx, int numReps) {
+ final Context ictx = (Context) ctx;
+ final ICC_Profile profile = ictx.profile;
+
+ do {
+ try {
+ int num = profile.getNumComponents();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } while (--numReps >= 0);
+ }
+ }
+}
--- a/jdk/src/share/native/java/util/zip/zlib-1.2.5/gzlib.c Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/native/java/util/zip/zlib-1.2.5/gzlib.c Tue Jan 01 17:49:22 2013 -0800
@@ -1,4 +1,5 @@
-/* NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+/*
+ * 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
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c Tue Jan 01 17:49:22 2013 -0800
@@ -159,7 +159,8 @@
*/
JNIEXPORT jlong JNICALL Java_sun_java2d_cmm_lcms_LCMS_createNativeTransform
(JNIEnv *env, jclass cls, jlongArray profileIDs, jint renderType,
- jint inFormatter, jint outFormatter, jobject disposerRef)
+ jint inFormatter, jboolean isInIntPacked,
+ jint outFormatter, jboolean isOutIntPacked, jobject disposerRef)
{
cmsHPROFILE _iccArray[DF_ICC_BUF_SIZE];
cmsHPROFILE *iccArray = &_iccArray[0];
@@ -170,6 +171,16 @@
size = (*env)->GetArrayLength (env, profileIDs);
ids = (*env)->GetPrimitiveArrayCritical(env, profileIDs, 0);
+#ifdef _LITTLE_ENDIAN
+ /* Reversing data packed into int for LE archs */
+ if (isInIntPacked) {
+ inFormatter ^= DOSWAP_SH(1);
+ }
+ if (isOutIntPacked) {
+ outFormatter ^= DOSWAP_SH(1);
+ }
+#endif
+
if (DF_ICC_BUF_SIZE < size*2) {
iccArray = (cmsHPROFILE*) malloc(
size*2*sizeof(cmsHPROFILE));
@@ -567,7 +578,7 @@
(JNIEnv *env, jclass obj, jobject trans, jobject src, jobject dst)
{
storeID_t sTrans;
- int inFmt, outFmt, srcDType, dstDType;
+ int srcDType, dstDType;
int srcOffset, srcNextRowOffset, dstOffset, dstNextRowOffset;
int width, height, i;
void* inputBuffer;
@@ -576,23 +587,13 @@
char* outputRow;
jobject srcData, dstData;
- inFmt = (*env)->GetIntField (env, src, IL_pixelType_fID);
- outFmt = (*env)->GetIntField (env, dst, IL_pixelType_fID);
srcOffset = (*env)->GetIntField (env, src, IL_offset_fID);
srcNextRowOffset = (*env)->GetIntField (env, src, IL_nextRowOffset_fID);
dstOffset = (*env)->GetIntField (env, dst, IL_offset_fID);
dstNextRowOffset = (*env)->GetIntField (env, dst, IL_nextRowOffset_fID);
width = (*env)->GetIntField (env, src, IL_width_fID);
height = (*env)->GetIntField (env, src, IL_height_fID);
-#ifdef _LITTLE_ENDIAN
- /* Reversing data packed into int for LE archs */
- if ((*env)->GetBooleanField (env, src, IL_isIntPacked_fID) == JNI_TRUE) {
- inFmt ^= DOSWAP_SH(1);
- }
- if ((*env)->GetBooleanField (env, dst, IL_isIntPacked_fID) == JNI_TRUE) {
- outFmt ^= DOSWAP_SH(1);
- }
-#endif
+
sTrans.j = (*env)->GetLongField (env, trans, Trans_ID_fID);
if (sTrans.xf == NULL) {
--- a/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java Tue Jan 01 17:49:22 2013 -0800
@@ -994,10 +994,7 @@
return;
}
int buttonState = 0;
- final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons();
- for (int i = 0; i<buttonsNumber; i++){
- buttonState |= (xbe.get_state() & XConstants.buttonsMask[i]);
- }
+ buttonState = xbe.get_state() & XConstants.ALL_BUTTONS_MASK;
switch (xev.get_type()) {
case XConstants.ButtonPress:
if (buttonState == 0) {
@@ -1034,12 +1031,12 @@
* Checks ButtonRelease released all Mouse buttons
*/
static boolean isFullRelease(int buttonState, int button) {
- final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons();
+ final int buttonsNumber = XToolkit.getNumberOfButtonsForMask();
if (button < 0 || button > buttonsNumber) {
return buttonState == 0;
} else {
- return buttonState == XConstants.buttonsMask[button - 1];
+ return buttonState == XlibUtil.getButtonMask(button);
}
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XConstants.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/solaris/classes/sun/awt/X11/XConstants.java Tue Jan 01 17:49:22 2013 -0800
@@ -130,6 +130,9 @@
public static final long ColormapChangeMask = (1L<<23) ;
public static final long OwnerGrabButtonMask = (1L<<24) ;
+ public static final int MAX_BUTTONS = 5;
+ public static final int ALL_BUTTONS_MASK = (int) (Button1MotionMask | Button2MotionMask | Button3MotionMask | Button4MotionMask | Button5MotionMask);
+
/* Event names. Used in "type" field in XEvent structures. Not to be
confused with event masks above. They start from 2 because 0 and 1
are reserved in the protocol for errors and replies. */
@@ -194,34 +197,6 @@
public static final int Mod4MapIndex = 6 ;
public static final int Mod5MapIndex = 7 ;
-
- /* button masks. Used in same manner as Key masks above. Not to be confused
- with button names below. */
- public static final int [] buttonsMask = new int []{ 1<<8,
- 1<<9,
- 1<<10,
- 1<<11,
- 1<<12,
- 1<<13,
- 1<<14,
- 1<<15,
- 1<<16,
- 1<<17,
- 1<<18,
- 1<<19,
- 1<<20,
- 1<<21,
- 1<<22,
- 1<<23,
- 1<<24,
- 1<<25,
- 1<<26,
- 1<<27,
- 1<<28,
- 1<<29,
- 1<<30,
- 1<<31 };
-
public static final int AnyModifier = (1<<15) ; /* used in GrabButton, GrabKey */
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java Tue Jan 01 17:49:22 2013 -0800
@@ -1543,6 +1543,10 @@
}
}
+ static int getNumberOfButtonsForMask() {
+ return Math.min(XConstants.MAX_BUTTONS, ((SunToolkit) (Toolkit.getDefaultToolkit())).getNumberOfButtons());
+ }
+
private final static String prefix = "DnD.Cursor.";
private final static String postfix = ".32x32";
private static final String dndPrefix = "DnD.";
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java Tue Jan 01 17:49:22 2013 -0800
@@ -596,12 +596,12 @@
/* this is an attempt to refactor button IDs in : MouseEvent, InputEvent, XlibWrapper and XWindow.*/
//reflects a button number similar to MouseEvent.BUTTON1, 2, 3 etc.
- for (int i = 0; i < XConstants.buttonsMask.length; i ++){
+ for (int i = 0; i < XConstants.buttons.length; i ++){
//modifier should be added if :
// 1) current button is now still in PRESSED state (means that user just pressed mouse but not released yet) or
// 2) if Xsystem reports that "state" represents that button was just released. This only happens on RELEASE with 1,2,3 buttons.
// ONLY one of these conditions should be TRUE to add that modifier.
- if (((state & XConstants.buttonsMask[i]) != 0) != (button == XConstants.buttons[i])){
+ if (((state & XlibUtil.getButtonMask(i + 1)) != 0) != (button == XConstants.buttons[i])){
//exclude wheel buttons from adding their numbers as modifiers
if (!wheel_mouse) {
modifiers |= InputEvent.getMaskForButton(i+1);
@@ -689,7 +689,7 @@
if (type == XConstants.ButtonPress) {
//Allow this mouse button to generate CLICK event on next ButtonRelease
- mouseButtonClickAllowed |= XConstants.buttonsMask[lbutton];
+ mouseButtonClickAllowed |= XlibUtil.getButtonMask(lbutton);
XWindow lastWindow = (lastWindowRef != null) ? ((XWindow)lastWindowRef.get()):(null);
/*
multiclick checking
@@ -747,7 +747,7 @@
postEventToEventQueue(me);
if ((type == XConstants.ButtonRelease) &&
- ((mouseButtonClickAllowed & XConstants.buttonsMask[lbutton]) != 0) ) // No up-button in the drag-state
+ ((mouseButtonClickAllowed & XlibUtil.getButtonMask(lbutton)) != 0) ) // No up-button in the drag-state
{
postEventToEventQueue(me = new MouseEvent((Component)getEventSource(),
MouseEvent.MOUSE_CLICKED,
@@ -777,7 +777,7 @@
/* Update the state variable AFTER the CLICKED event post. */
if (type == XConstants.ButtonRelease) {
/* Exclude this mouse button from allowed list.*/
- mouseButtonClickAllowed &= ~XConstants.buttonsMask[lbutton];
+ mouseButtonClickAllowed &= ~ XlibUtil.getButtonMask(lbutton);
}
}
@@ -793,12 +793,12 @@
//this doesn't work for extra buttons because Xsystem is sending state==0 for every extra button event.
// we can't correct it in MouseEvent class as we done it with modifiers, because exact type (DRAG|MOVE)
// should be passed from XWindow.
- final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons();
+ final int buttonsNumber = XToolkit.getNumberOfButtonsForMask();
for (int i = 0; i < buttonsNumber; i++){
// TODO : here is the bug in WM: extra buttons doesn't have state!=0 as they should.
if ((i != 4) && (i != 5)) {
- mouseKeyState = mouseKeyState | (xme.get_state() & XConstants.buttonsMask[i]);
+ mouseKeyState = mouseKeyState | (xme.get_state() & XlibUtil.getButtonMask(i + 1));
}
}
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java Tue Jan 01 17:49:22 2013 -0800
@@ -2070,12 +2070,12 @@
}
if (isGrabbed()) {
boolean dragging = false;
- final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons();
+ final int buttonsNumber = XToolkit.getNumberOfButtonsForMask();
for (int i = 0; i < buttonsNumber; i++){
// here is the bug in WM: extra buttons doesn't have state!=0 as they should.
if ((i != 4) && (i != 5)){
- dragging = dragging || ((xme.get_state() & XConstants.buttonsMask[i]) != 0);
+ dragging = dragging || ((xme.get_state() & XlibUtil.getButtonMask(i + 1)) != 0);
}
}
// When window is grabbed, all events are dispatched to
--- a/jdk/src/solaris/classes/sun/awt/X11/XlibUtil.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/solaris/classes/sun/awt/X11/XlibUtil.java Tue Jan 01 17:49:22 2013 -0800
@@ -396,4 +396,14 @@
return isShapingSupported.booleanValue();
}
+ static int getButtonMask(int button) {
+ // Button indices start with 1. The first bit in the button mask is the 8th.
+ // The state mask does not support button indicies > 5, so we need to
+ // cut there.
+ if (button <= 0 || button > XConstants.MAX_BUTTONS) {
+ return 0;
+ } else {
+ return 1 << (7 + button);
+ }
+ }
}
--- a/jdk/src/solaris/native/common/jdk_util_md.h Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/solaris/native/common/jdk_util_md.h Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
--- a/jdk/src/solaris/native/sun/tools/attach/BsdVirtualMachine.c Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/solaris/native/sun/tools/attach/BsdVirtualMachine.c Tue Jan 01 17:49:22 2013 -0800
@@ -1,12 +1,12 @@
/*
- * Copyright 2005, 2012, Oracle and/or its affiliates. All Rights Reserved.
+ * Copyright (c) 2005, 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. Sun designates this
+ * published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
+ * 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
@@ -18,9 +18,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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 "jni.h"
--- a/jdk/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/windows/classes/java/net/DualStackPlainDatagramSocketImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007,2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, 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
--- a/jdk/src/windows/native/common/jdk_util_md.h Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/windows/native/common/jdk_util_md.h Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
--- a/jdk/src/windows/native/sun/windows/awt_Debug.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/src/windows/native/sun/windows/awt_Debug.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -147,6 +147,24 @@
DTrace_Shutdown();
}
+static jboolean isHeadless() {
+ jmethodID headlessFn;
+ JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
+ jclass graphicsEnvClass = env->FindClass(
+ "java/awt/GraphicsEnvironment");
+
+ if (graphicsEnvClass != NULL) {
+ headlessFn = env->GetStaticMethodID(
+ graphicsEnvClass, "isHeadless", "()Z");
+ if (headlessFn != NULL) {
+ return env->CallStaticBooleanMethod(graphicsEnvClass,
+ headlessFn);
+ }
+ }
+ return true;
+}
+
+
void AwtDebugSupport::AssertCallback(const char * expr, const char * file, int line) {
static const int ASSERT_MSG_SIZE = 1024;
static const char * AssertFmt =
@@ -158,7 +176,8 @@
static char assertMsg[ASSERT_MSG_SIZE+1];
DWORD lastError = GetLastError();
LPSTR msgBuffer = NULL;
- int ret;
+ int ret = IDNO;
+ static jboolean headless = isHeadless();
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
@@ -183,8 +202,11 @@
fprintf(stderr, "*********************\n");
fprintf(stderr, "%s\n", assertMsg);
fprintf(stderr, "*********************\n");
- ret = MessageBoxA(NULL, assertMsg, "AWT Assertion Failure",
- MB_YESNO|MB_ICONSTOP|MB_TASKMODAL);
+
+ if (!headless) {
+ ret = MessageBoxA(NULL, assertMsg, "AWT Assertion Failure",
+ MB_YESNO|MB_ICONSTOP|MB_TASKMODAL);
+ }
// if clicked Yes, break into the debugger
if ( ret == IDYES ) {
--- a/jdk/test/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI/7089914/bug7089914.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI/7089914/bug7089914.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/awt/Focus/6981400/Test1.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/awt/Focus/6981400/Test1.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/awt/Focus/6981400/Test2.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/awt/Focus/6981400/Test2.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/awt/Focus/6981400/Test3.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/awt/Focus/6981400/Test3.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/awt/Frame/ResizeAfterSetFont/ResizeAfterSetFont.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/awt/Frame/ResizeAfterSetFont/ResizeAfterSetFont.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/awt/JAWT/JAWT.sh Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/awt/JAWT/JAWT.sh Tue Jan 01 17:49:22 2013 -0800
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 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
--- a/jdk/test/java/awt/JAWT/Makefile.cygwin Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/awt/JAWT/Makefile.cygwin Tue Jan 01 17:49:22 2013 -0800
@@ -1,4 +1,4 @@
-# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 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
--- a/jdk/test/java/awt/JAWT/Makefile.unix Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/awt/JAWT/Makefile.unix Tue Jan 01 17:49:22 2013 -0800
@@ -1,4 +1,4 @@
-# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 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
--- a/jdk/test/java/awt/JAWT/Makefile.win Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/awt/JAWT/Makefile.win Tue Jan 01 17:49:22 2013 -0800
@@ -1,4 +1,4 @@
-# Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 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
--- a/jdk/test/java/awt/JAWT/MyCanvas.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/awt/JAWT/MyCanvas.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/awt/JAWT/myfile.c Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/awt/JAWT/myfile.c Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/awt/JAWT/myfile.cpp Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/awt/JAWT/myfile.cpp Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/awt/TextArea/DisposeTest/TestDispose.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/awt/TextArea/DisposeTest/TestDispose.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/awt/TextArea/TextAreaCaretVisibilityTest/bug7129742.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/awt/TextArea/TextAreaCaretVisibilityTest/bug7129742.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/awt/TextField/DisposeTest/TestDispose.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/awt/TextField/DisposeTest/TestDispose.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/beans/Introspector/Test8005065.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8005065
+ * @summary Tests that all arrays in JavaBeans are guarded
+ * @author Sergey Malenkov
+ */
+
+import java.beans.DefaultPersistenceDelegate;
+import java.beans.Encoder;
+import java.beans.EventSetDescriptor;
+import java.beans.ExceptionListener;
+import java.beans.Expression;
+import java.beans.Statement;
+import java.beans.MethodDescriptor;
+import java.beans.ParameterDescriptor;
+
+public class Test8005065 {
+
+ public static void main(String[] args) {
+ testDefaultPersistenceDelegate();
+ testEventSetDescriptor();
+ testMethodDescriptor();
+ testStatement();
+ }
+
+ private static void testDefaultPersistenceDelegate() {
+ Encoder encoder = new Encoder();
+ String[] array = { "array" };
+ MyDPD dpd = new MyDPD(array);
+ dpd.instantiate(dpd, encoder);
+ array[0] = null;
+ dpd.instantiate(dpd, encoder);
+ }
+
+ private static void testEventSetDescriptor() {
+ try {
+ MethodDescriptor[] array = { new MethodDescriptor(MyDPD.class.getMethod("getArray")) };
+ EventSetDescriptor descriptor = new EventSetDescriptor(null, null, array, null, null);
+ test(descriptor.getListenerMethodDescriptors());
+ array[0] = null;
+ test(descriptor.getListenerMethodDescriptors());
+ descriptor.getListenerMethodDescriptors()[0] = null;
+ test(descriptor.getListenerMethodDescriptors());
+ }
+ catch (Exception exception) {
+ throw new Error("unexpected error", exception);
+ }
+ }
+
+ private static void testMethodDescriptor() {
+ try {
+ ParameterDescriptor[] array = { new ParameterDescriptor() };
+ MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
+ test(descriptor.getParameterDescriptors());
+ array[0] = null;
+ test(descriptor.getParameterDescriptors());
+ descriptor.getParameterDescriptors()[0] = null;
+ test(descriptor.getParameterDescriptors());
+ }
+ catch (Exception exception) {
+ throw new Error("unexpected error", exception);
+ }
+ }
+
+ private static void testStatement() {
+ Object[] array = { new Object() };
+ Statement statement = new Statement(null, null, array);
+ test(statement.getArguments());
+ array[0] = null;
+ test(statement.getArguments());
+ statement.getArguments()[0] = null;
+ test(statement.getArguments());
+ }
+
+ private static <T> void test(T[] array) {
+ if (array.length != 1) {
+ throw new Error("unexpected array length");
+ }
+ if (array[0] == null) {
+ throw new Error("unexpected array content");
+ }
+ }
+
+ public static class MyDPD
+ extends DefaultPersistenceDelegate
+ implements ExceptionListener {
+
+ private final String[] array;
+
+ public MyDPD(String[] array) {
+ super(array);
+ this.array = array;
+ }
+
+ public Expression instantiate(Object instance, Encoder encoder) {
+ encoder.setExceptionListener(this);
+ return super.instantiate(instance, encoder);
+ }
+
+ public String[] getArray() {
+ return this.array;
+ }
+
+ public void exceptionThrown(Exception exception) {
+ throw new Error("unexpected error", exception);
+ }
+ }
+}
--- a/jdk/test/java/lang/Integer/Unsigned.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/lang/Integer/Unsigned.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*/
/*
--- a/jdk/test/java/lang/Long/Unsigned.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/lang/Long/Unsigned.java Tue Jan 01 17:49:22 2013 -0800
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*/
/*
--- a/jdk/test/java/lang/Math/CubeRootTests.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/lang/Math/CubeRootTests.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
--- a/jdk/test/java/lang/Math/Expm1Tests.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/lang/Math/Expm1Tests.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
--- a/jdk/test/java/lang/Math/HyperbolicTests.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/lang/Math/HyperbolicTests.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
--- a/jdk/test/java/lang/Math/Log10Tests.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/lang/Math/Log10Tests.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
--- a/jdk/test/java/lang/Math/Log1pTests.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/lang/Math/Log1pTests.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
--- a/jdk/test/java/lang/Math/Tests.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/lang/Math/Tests.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
--- a/jdk/test/java/lang/StringBuffer/TestSynchronization.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/lang/StringBuffer/TestSynchronization.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/lang/invoke/remote/RemoteExample.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/lang/invoke/remote/RemoteExample.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,12 +1,12 @@
/*
- * Copyright 2009-2010 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2009, 2010, 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. Sun designates this
+ * published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
+ * 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
@@ -18,9 +18,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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 test.java.lang.invoke.remote;
--- a/jdk/test/java/math/BigDecimal/FloatDoubleValueTests.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/math/BigDecimal/FloatDoubleValueTests.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, 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
--- a/jdk/test/java/math/BigDecimal/StrippingZerosTest.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/math/BigDecimal/StrippingZerosTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, 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
--- a/jdk/test/java/net/Inet4Address/PingThis.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/net/Inet4Address/PingThis.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/net/ProxySelector/MultiThreadedSystemProxies.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/net/ProxySelector/MultiThreadedSystemProxies.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/security/Signature/VerifyRangeCheckOverflow.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/security/Signature/VerifyRangeCheckOverflow.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/util/AbstractCollection/ToArrayTest.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/util/AbstractCollection/ToArrayTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/util/Currency/ValidateISO4217.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/util/Currency/ValidateISO4217.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -22,7 +22,7 @@
*/
/*
* @test
- * @bug 4691089 4819436 4942982 5104960 6544471 6627549 7066203
+ * @bug 4691089 4819436 4942982 5104960 6544471 6627549 7066203 7195759
* @summary Validate ISO 4217 data for Currency class.
*/
@@ -92,7 +92,7 @@
/* Codes that are obsolete, do not have related country */
static final String otherCodes =
- "ADP-AFA-ATS-AYM-AZM-BEF-BGL-BOV-BYB-CLF-CUC-CYP-DEM-EEK-ESP-FIM-FRF-GHC-GRD-GWP-IEP-ITL-LUF-MGF-MTL-MXV-MZM-NLG-PTE-ROL-RUR-SDD-SIT-SKK-SRG-TMM-TPE-TRL-VEF-USN-USS-VEB-XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XSU-XTS-XUA-XXX-YUM-ZWD-ZWN-ZWR";
+ "ADP-AFA-ATS-AYM-AZM-BEF-BGL-BOV-BYB-CLF-CUC-CYP-DEM-EEK-ESP-FIM-FRF-GHC-GRD-GWP-IEP-ITL-LUF-MGF-MTL-MXV-MZM-NLG-PTE-ROL-RUR-SDD-SIT-SKK-SRG-TMM-TPE-TRL-VEF-USN-USS-VEB-XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XSU-XTS-XUA-XXX-YUM-ZMK-ZWD-ZWN-ZWR";
static boolean err = false;
--- a/jdk/test/java/util/Currency/tablea1.txt Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/util/Currency/tablea1.txt Tue Jan 01 17:49:22 2013 -0800
@@ -1,12 +1,12 @@
#
#
-# Amendments up until ISO 4217 AMENDMENT NUMBER 153
-# (As of 12 January 2012)
+# Amendments up until ISO 4217 AMENDMENT NUMBER 154
+# (As of 31 August 2012)
#
# Version
FILEVERSION=1
-DATAVERSION=153
+DATAVERSION=154
# ISO 4217 currency data
AF AFN 971 2
@@ -274,7 +274,7 @@
WF XPF 953 0
EH MAD 504 2
YE YER 886 2
-ZM ZMK 894 2
+ZM ZMW 967 2
ZW ZWL 932 2
#XAU XAU 959
#XBA XBA 955
--- a/jdk/test/java/util/Map/EntryHashCode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/util/Map/EntryHashCode.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/util/concurrent/FutureTask/DoneTimedGetLoops.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/util/concurrent/FutureTask/DoneTimedGetLoops.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/java/util/logging/LoggerResourceBundleRace.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/util/logging/LoggerResourceBundleRace.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
--- a/jdk/test/java/util/logging/LoggingDeadlock2.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/util/logging/LoggingDeadlock2.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
--- a/jdk/test/java/util/logging/LoggingDeadlock3.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/util/logging/LoggingDeadlock3.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
--- a/jdk/test/java/util/logging/SimpleFormatterFormat.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/util/logging/SimpleFormatterFormat.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
--- a/jdk/test/java/util/spi/ResourceBundleControlProvider/providersrc/XmlRB.xml Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/util/spi/ResourceBundleControlProvider/providersrc/XmlRB.xml Tue Jan 01 17:49:22 2013 -0800
@@ -5,13 +5,13 @@
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
+ 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
+ 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).
--- a/jdk/test/java/util/spi/ResourceBundleControlProvider/providersrc/XmlRB_ja.xml Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/java/util/spi/ResourceBundleControlProvider/providersrc/XmlRB_ja.xml Tue Jan 01 17:49:22 2013 -0800
@@ -5,13 +5,13 @@
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
+ 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
+ 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).
--- a/jdk/test/javax/swing/AncestorNotifier/7193219/bug7193219.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/javax/swing/AncestorNotifier/7193219/bug7193219.java Tue Jan 01 17:49:22 2013 -0800
@@ -30,6 +30,7 @@
import java.io.*;
import javax.swing.*;
+import javax.swing.plaf.metal.*;
public class bug7193219 {
private static byte[] serializeGUI() {
@@ -73,6 +74,7 @@
}
public static void main(String[] args) throws Exception {
+ UIManager.setLookAndFeel(new MetalLookAndFeel());
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
--- a/jdk/test/javax/swing/JComponent/7154030/bug7154030.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/javax/swing/JComponent/7154030/bug7154030.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JFrame/4962534/bug4962534.html Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,43 @@
+<html>
+<!--
+ Copyright (c) 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.
+ -->
+
+<!--
+ @test
+ @bug 4962534
+ @summary JFrame dances very badly
+ @author dav@sparc.spb.su area=
+ @run applet bug4962534.html
+ -->
+<head>
+<title> </title>
+</head>
+<body>
+
+<h1>bug4962534<br>Bug ID: 4962534 </h1>
+
+<p> This is an AUTOMATIC test, simply wait for completion </p>
+
+<APPLET CODE="bug4962534.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JFrame/4962534/bug4962534.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,235 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ test
+ @bug 4962534 7104594
+ @summary JFrame dances very badly
+ @author dav@sparc.spb.su area=
+ @run applet bug4962534.html
+ */
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.event.*;
+import java.util.Random;
+import javax.swing.*;
+import sun.awt.SunToolkit;
+
+public class bug4962534 extends Applet {
+
+ Robot robot;
+ volatile Point framePosition;
+ volatile Point newFrameLocation;
+ JFrame frame;
+ Rectangle gcBounds;
+ Component titleComponent;
+ JLayeredPane lPane;
+ volatile boolean titleFound = false;
+ SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+ public static Object LOCK = new Object();
+
+ @Override
+ public void init() {
+ try {
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ createAndShowGUI();
+ }
+ });
+ } catch (Exception ex) {
+ throw new RuntimeException("Init failed. " + ex.getMessage());
+ }
+ }//End init()
+
+ @Override
+ public void start() {
+ validate();
+
+ try {
+ setJLayeredPaneEDT();
+ setTitleComponentEDT();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ throw new RuntimeException("Test failed. " + ex.getMessage());
+ }
+
+ if (!titleFound) {
+ throw new RuntimeException("Test Failed. Unable to determine title's size.");
+ }
+
+ Random r = new Random();
+
+ for (int iteration = 0; iteration < 10; iteration++) {
+ try {
+ setFramePosEDT();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ throw new RuntimeException("Test failed.");
+ }
+ try {
+ robot = new Robot();
+ robot.setAutoDelay(70);
+
+ toolkit.realSync();
+
+ robot.mouseMove(framePosition.x + getJFrameWidthEDT() / 2,
+ framePosition.y + titleComponent.getHeight() / 2);
+ robot.mousePress(InputEvent.BUTTON1_MASK);
+
+ toolkit.realSync();
+
+ gcBounds =
+ GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()[0].getConfigurations()[0].getBounds();
+
+ robot.mouseMove(framePosition.x + getJFrameWidthEDT() / 2,
+ framePosition.y + titleComponent.getHeight() / 2);
+
+ toolkit.realSync();
+
+ int multier = gcBounds.height / 2 - 10; //we will not go out the borders
+ for (int i = 0; i < 10; i++) {
+ robot.mouseMove(gcBounds.width / 2 - (int) (r.nextDouble() * multier), gcBounds.height / 2 - (int) (r.nextDouble() * multier));
+ }
+ robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+ toolkit.realSync();
+
+ } catch (AWTException e) {
+ throw new RuntimeException("Test Failed. AWTException thrown." + e.getMessage());
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RuntimeException("Test Failed.");
+ }
+ System.out.println("Mouse lies in " + MouseInfo.getPointerInfo().getLocation());
+ boolean frameIsOutOfScreen = false;
+ try {
+ setNewFrameLocationEDT();
+ System.out.println("Now Frame lies in " + newFrameLocation);
+ frameIsOutOfScreen = checkFrameIsOutOfScreenEDT();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ throw new RuntimeException("Test Failed.");
+ }
+
+ if (frameIsOutOfScreen) {
+ throw new RuntimeException("Test failed. JFrame is out of screen.");
+ }
+
+ } //for iteration
+ System.out.println("Test passed.");
+ }// start()
+
+ private void createAndShowGUI() {
+ try {
+ UIManager.setLookAndFeel(
+ "javax.swing.plaf.metal.MetalLookAndFeel");
+ } catch (Exception ex) {
+ throw new RuntimeException(ex.getMessage());
+ }
+ JFrame.setDefaultLookAndFeelDecorated(true);
+ frame = new JFrame("JFrame Dance Test");
+ frame.pack();
+ frame.setSize(450, 260);
+ frame.setVisible(true);
+ }
+
+ private void setJLayeredPaneEDT() throws Exception {
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ lPane = frame.getLayeredPane();
+ System.out.println("JFrame's LayeredPane " + lPane);
+ }
+ });
+ }
+
+ private void setTitleComponentEDT() throws Exception {
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ for (int j = 0; j < lPane.getComponentsInLayer(JLayeredPane.FRAME_CONTENT_LAYER.intValue()).length; j++) {
+ titleComponent = lPane.getComponentsInLayer(JLayeredPane.FRAME_CONTENT_LAYER.intValue())[j];
+ if (titleComponent.getClass().getName().equals("javax.swing.plaf.metal.MetalTitlePane")) {
+ titleFound = true;
+ break;
+ }
+ }
+ }
+ });
+ }
+
+ private void setFramePosEDT() throws Exception {
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ framePosition = frame.getLocationOnScreen();
+ }
+ });
+ }
+
+ private boolean checkFrameIsOutOfScreenEDT() throws Exception {
+
+ final boolean[] result = new boolean[1];
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ if (newFrameLocation.x > gcBounds.width || newFrameLocation.x < 0
+ || newFrameLocation.y > gcBounds.height || newFrameLocation.y
+ < 0) {
+ result[0] = true;
+ }
+ }
+ });
+ return result[0];
+ }
+
+ private void setNewFrameLocationEDT() throws Exception {
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ newFrameLocation = new Point(frame.getLocationOnScreen().x
+ + frame.getWidth() / 2, frame.getLocationOnScreen().y + titleComponent.getHeight() / 2);
+ }
+ });
+ }
+
+ private int getJFrameWidthEDT() throws Exception {
+
+ final int[] result = new int[1];
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ result[0] = frame.getWidth();
+ }
+ });
+
+ return result[0];
+ }
+}// class
--- a/jdk/test/javax/swing/JTabbedPane/4310381/bug4310381.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/javax/swing/JTabbedPane/4310381/bug4310381.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/javax/swing/JTable/4235420/bug4235420.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/javax/swing/JTable/4235420/bug4235420.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/javax/swing/JTable/6788484/bug6788484.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/javax/swing/JTable/6788484/bug6788484.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, 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
--- a/jdk/test/javax/swing/JTable/7055065/bug7055065.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/javax/swing/JTable/7055065/bug7055065.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/javax/swing/JTable/7188612/JTableAccessibleGetLocationOnScreen.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/javax/swing/JTable/7188612/JTableAccessibleGetLocationOnScreen.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/javax/swing/JTextArea/7049024/bug7049024.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/javax/swing/JTextArea/7049024/bug7049024.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
--- a/jdk/test/javax/swing/border/Test7022041.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/javax/swing/border/Test7022041.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,11 +1,12 @@
/*
- * Copyright 2012 Red Hat, Inc. All Rights Reserved.
* Copyright (c) 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.
+ * 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
@@ -16,6 +17,10 @@
* 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.awt.Color;
--- a/jdk/test/javax/swing/text/DefaultCaret/6938583/bug6938583.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/javax/swing/text/DefaultCaret/6938583/bug6938583.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/java2d/cmm/ColorConvertOp/GrayTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/**
+ * @test
+ * @bug 7124245
+ * @summary Test verifies that color conversion does not distort
+ * colors in destination image of standard type.
+ *
+ * @run main GrayTest
+ */
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.color.ColorSpace;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorConvertOp;
+
+public class GrayTest {
+ public static void main(String[] args) {
+ GrayTest t = new GrayTest();
+
+ t.doTest(BufferedImage.TYPE_INT_RGB);
+ t.doTest(BufferedImage.TYPE_INT_BGR);
+ t.doTest(BufferedImage.TYPE_INT_ARGB);
+ t.doTest(BufferedImage.TYPE_3BYTE_BGR);
+ t.doTest(BufferedImage.TYPE_4BYTE_ABGR);
+ System.out.println("Test passed.");
+ }
+
+ private static final int w = 3;
+ private static final int h = 3;
+
+ private BufferedImage src;
+ private BufferedImage dst;
+
+ private ColorConvertOp op;
+
+ public GrayTest() {
+ ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY);
+ op = new ColorConvertOp(cs, null);
+ }
+
+ private void render(Graphics2D g) {
+ g.setColor(Color.red);
+ g.fillRect(0, 0, w, h);
+ }
+
+ private BufferedImage initImage(int type) {
+ BufferedImage img = new BufferedImage(w, h, type);
+ Graphics2D g = img.createGraphics();
+
+ render(g);
+
+ g.dispose();
+
+ return img;
+ }
+
+ public void doTest(int type) {
+ System.out.println("Test for type: " + type);
+ src = initImage(type);
+
+ dst = initImage(type);
+
+ dst = op.filter(src, dst);
+
+ int pixel = dst.getRGB(1, 1);
+ int r = 0xff & (pixel >> 16);
+ int g = 0xff & (pixel >> 8);
+ int b = 0xff & (pixel );
+
+ System.out.printf("dst: r:%02x, g: %02x, %02x\n",
+ r, g, b);
+
+ if (r != g || r != b) {
+ String msg = String.format("Invalid pixel: %08x", pixel);
+ throw new RuntimeException(msg);
+ }
+ System.out.println("Done.");
+ }
+}
--- a/jdk/test/sun/management/AgentCMETest.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/sun/management/AgentCMETest.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh Tue Jan 01 17:49:22 2013 -0800
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 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
--- a/jdk/test/sun/nio/ch/SelProvider.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/sun/nio/ch/SelProvider.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
--- a/jdk/test/sun/rmi/rmic/classpath/RMICClassPathTest.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/sun/rmi/rmic/classpath/RMICClassPathTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/sun/security/krb5/auto/ReplayCache.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/sun/security/krb5/auto/ReplayCache.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 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
@@ -16,9 +16,9 @@
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * 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.
*/
/*
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsProxyStackOverflow.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsProxyStackOverflow.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
--- a/jdk/test/sun/text/resources/LocaleData Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/sun/text/resources/LocaleData Tue Jan 01 17:49:22 2013 -0800
@@ -7657,3 +7657,6 @@
FormatData/zh/DayNarrows/4=\u56db
FormatData/zh/DayNarrows/5=\u4e94
FormatData/zh/DayNarrows/6=\u516d
+
+# bug 7195759
+CurrencyNames//ZMW=ZMW
--- a/jdk/test/sun/text/resources/LocaleDataTest.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/sun/text/resources/LocaleDataTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -34,7 +34,7 @@
* 6509039 6609737 6610748 6645271 6507067 6873931 6450945 6645268 6646611
* 6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 6916787
* 6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495
- * 7003124 7085757 7028073 7171028 7189611 8000983
+ * 7003124 7085757 7028073 7171028 7189611 8000983 7195759
* @summary Verify locale data
*
*/
--- a/jdk/test/sun/tools/jps/jps-V_2.sh Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/sun/tools/jps/jps-V_2.sh Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2011,Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, 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
--- a/jdk/test/tools/jar/JarBackSlash.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/tools/jar/JarBackSlash.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/jdk/test/tools/launcher/UnicodeTest.java Sat Dec 29 11:00:15 2012 +0000
+++ b/jdk/test/tools/launcher/UnicodeTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2012, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
--- a/langtools/.hgtags Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/.hgtags Tue Jan 01 17:49:22 2013 -0800
@@ -189,3 +189,6 @@
5f2faba89cac665e365c05074064ffc934a495eb jdk8-b65
20230f8b0eef92a57043735fc2ca00fea7e510a0 jdk8-b66
303b09787a69136cd2019f9edfed3f308572e9fc jdk8-b67
+014a6a11dfe5ddc23ec8c76bb42ac998dbf49acb jdk8-b68
+d7360bf35ee1f40ff78c2e83a22b5446ee464346 jdk8-b69
+47f71d7c124f24c2fe2dfc49865b332345b458ed jdk8-b70
--- a/langtools/make/Makefile-classic Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/make/Makefile-classic Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2007, 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 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
--- a/langtools/make/build.properties Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/make/build.properties Tue Jan 01 17:49:22 2013 -0800
@@ -68,7 +68,7 @@
# set the following to -version to verify the versions of javac being used
javac.version.opt =
# in time, there should be no exceptions to -Xlint:all
-javac.lint.opts = -Xlint:all,-deprecation -Werror
+javac.lint.opts = -Xlint:all -Werror
# options for the <javadoc> task for javac
#javadoc.jls3.url=http://java.sun.com/docs/books/jls/
@@ -117,7 +117,8 @@
javax/lang/model/ \
javax/tools/ \
com/sun/source/ \
- com/sun/tools/javac/
+ com/sun/tools/javac/ \
+ com/sun/tools/doclint/
javac.tests = \
tools/javac
--- a/langtools/src/share/classes/com/sun/javadoc/ClassDoc.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/javadoc/ClassDoc.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -66,6 +66,12 @@
boolean isExternalizable();
/**
+ * Return true if this class can be used as a target type of a lambda expression
+ * or method reference.
+ */
+ boolean isFunctionalInterface();
+
+ /**
* Return the serialization methods for this class or
* interface.
*
--- a/langtools/src/share/classes/com/sun/javadoc/MethodDoc.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/javadoc/MethodDoc.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -39,6 +39,11 @@
boolean isAbstract();
/**
+ * Return true if this method is default
+ */
+ boolean isDefault();
+
+ /**
* Get return type.
*
* @return the return type of this method, null if it
--- a/langtools/src/share/classes/com/sun/source/util/DocTrees.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/source/util/DocTrees.java Tue Jan 01 17:49:22 2013 -0800
@@ -45,9 +45,7 @@
* @throws IllegalArgumentException if the task does not support the Trees API.
*/
public static DocTrees instance(CompilationTask task) {
- if (!task.getClass().getName().equals("com.sun.tools.javac.api.JavacTaskImpl"))
- throw new IllegalArgumentException();
- return (DocTrees) getJavacTrees(CompilationTask.class, task);
+ return (DocTrees) Trees.instance(task);
}
/**
--- a/langtools/src/share/classes/com/sun/source/util/JavacTask.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/source/util/JavacTask.java Tue Jan 01 17:49:22 2013 -0800
@@ -139,6 +139,7 @@
* @see com.sun.source.util.Trees#getTypeMirror
*/
public abstract TypeMirror getTypeMirror(Iterable<? extends Tree> path);
+
/**
* Get a utility object for dealing with program elements.
*/
--- a/langtools/src/share/classes/com/sun/source/util/Plugin.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/source/util/Plugin.java Tue Jan 01 17:49:22 2013 -0800
@@ -56,9 +56,9 @@
String getName();
/**
- * Invoke the plug-in for a given compilation task.
+ * Initialize the plug-in for a given compilation task.
* @param task The compilation task that has just been started
* @param args Arguments, if any, for the plug-in
*/
- void call(JavacTask task, String... args);
+ void init(JavacTask task, String... args);
}
--- a/langtools/src/share/classes/com/sun/source/util/TreePath.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/source/util/TreePath.java Tue Jan 01 17:49:22 2013 -0800
@@ -60,14 +60,20 @@
this.path = path;
}
}
+
class PathFinder extends TreePathScanner<TreePath,Tree> {
public TreePath scan(Tree tree, Tree target) {
- if (tree == target)
+ if (tree == target) {
throw new Result(new TreePath(getCurrentPath(), target));
+ }
return super.scan(tree, target);
}
}
+ if (path.getLeaf() == target) {
+ return path;
+ }
+
try {
new PathFinder().scan(path, target);
} catch (Result result) {
--- a/langtools/src/share/classes/com/sun/tools/classfile/Opcode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Opcode.java Tue Jan 01 17:49:22 2013 -0800
@@ -448,10 +448,10 @@
}
- private static Opcode[] stdOpcodes = new Opcode[256];
- private static Opcode[] wideOpcodes = new Opcode[256];
- private static Opcode[] nonPrivOpcodes = new Opcode[256];
- private static Opcode[] privOpcodes = new Opcode[256];
+ private static final Opcode[] stdOpcodes = new Opcode[256];
+ private static final Opcode[] wideOpcodes = new Opcode[256];
+ private static final Opcode[] nonPrivOpcodes = new Opcode[256];
+ private static final Opcode[] privOpcodes = new Opcode[256];
static {
for (Opcode o: values())
getOpcodeBlock(o.opcode >> 8)[o.opcode & 0xff] = o;
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java Tue Jan 01 17:49:22 2013 -0800
@@ -239,7 +239,14 @@
if ((member.isField() || member.isMethod()) &&
writer instanceof ClassWriterImpl &&
((ClassWriterImpl) writer).getClassDoc().isInterface()) {
- mod = Util.replaceText(mod, "public", "").trim();
+ // This check for isDefault() and the default modifier needs to be
+ // added for it to appear on the method details section. Once the
+ // default modifier is added to the Modifier list on DocEnv and once
+ // it is updated to use the javax.lang.model.element.Modifier, we
+ // will need to remove this.
+ mod = (member.isMethod() && ((MethodDoc)member).isDefault()) ?
+ Util.replaceText(mod, "public", "default").trim() :
+ Util.replaceText(mod, "public", "").trim();
}
if(mod.length() > 0) {
htmltree.addContent(mod);
@@ -313,8 +320,18 @@
code.addContent(configuration.getText("doclet.Package_private"));
code.addContent(" ");
}
- if (member.isMethod() && ((MethodDoc)member).isAbstract()) {
- code.addContent("abstract ");
+ if (member.isMethod()) {
+ if (((MethodDoc)member).isAbstract()) {
+ code.addContent("abstract ");
+ }
+ // This check for isDefault() and the default modifier needs to be
+ // added for it to appear on the "Modifier and Type" column in the
+ // method summary section. Once the default modifier is added
+ // to the Modifier list on DocEnv and once it is updated to use the
+ // javax.lang.model.element.Modifier, we will need to remove this.
+ else if (((MethodDoc)member).isDefault()) {
+ code.addContent("default ");
+ }
}
if (member.isStatic()) {
code.addContent("static ");
@@ -547,6 +564,9 @@
methodType = (classdoc.isInterface() || ((MethodDoc)member).isAbstract()) ?
methodType | MethodTypes.ABSTRACT.value() :
methodType | MethodTypes.CONCRETE.value();
+ if (((MethodDoc)member).isDefault()) {
+ methodType = methodType | MethodTypes.DEFAULT.value();
+ }
if (Util.isDeprecated(member) || Util.isDeprecated(classdoc)) {
methodType = methodType | MethodTypes.DEPRECATED.value();
}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -516,6 +516,20 @@
/**
* {@inheritDoc}
*/
+ public void addFunctionalInterfaceInfo (Content classInfoTree) {
+ if (classDoc.isFunctionalInterface()) {
+ Content dt = HtmlTree.DT(getResource("doclet.Functional_Interface"));
+ Content dl = HtmlTree.DL(dt);
+ Content dd = new HtmlTree(HtmlTag.DD);
+ dd.addContent(getResource("doclet.Functional_Interface_Message"));
+ dl.addContent(dd);
+ classInfoTree.addContent(dl);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public void addClassDeprecationInfo(Content classInfoTree) {
Content hr = new HtmlTree(HtmlTag.HR);
classInfoTree.addContent(hr);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties Tue Jan 01 17:49:22 2013 -0800
@@ -90,6 +90,8 @@
doclet.Subclasses=Direct Known Subclasses:
doclet.Subinterfaces=All Known Subinterfaces:
doclet.Implementing_Classes=All Known Implementing Classes:
+doclet.Functional_Interface=Functional Interface:
+doclet.Functional_Interface_Message=This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
doclet.also=also
doclet.Frames=Frames
doclet.No_Frames=No Frames
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java Tue Jan 01 17:49:22 2013 -0800
@@ -117,6 +117,13 @@
public void addInterfaceUsageInfo(Content classInfoTree);
/**
+ * If this is an functional interface, display appropriate message.
+ *
+ * @param classInfoTree content tree to which the documentation will be added
+ */
+ public void addFunctionalInterfaceInfo(Content classInfoTree);
+
+ /**
* If this is an inner class or interface, add the enclosing class or
* interface.
*
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java Tue Jan 01 17:49:22 2013 -0800
@@ -236,6 +236,16 @@
}
/**
+ * If this is an functional interface, display appropriate message.
+ *
+ * @param node the XML element that specifies which components to document
+ * @param classInfoTree the content tree to which the documentation will be added
+ */
+ public void buildFunctionalInterfaceInfo(XMLNode node, Content classInfoTree) {
+ writer.addFunctionalInterfaceInfo(classInfoTree);
+ }
+
+ /**
* If this class is deprecated, build the appropriate information.
*
* @param node the XML element that specifies which components to document
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml Tue Jan 01 17:49:22 2013 -0800
@@ -85,6 +85,7 @@
<SubInterfacesInfo/>
<InterfaceUsageInfo/>
<NestedClassInfo/>
+ <FunctionalInterfaceInfo/>
<DeprecationInfo/>
<ClassSignature/>
<ClassDescription/>
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFileFactory.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFileFactory.java Tue Jan 01 17:49:22 2013 -0800
@@ -46,7 +46,7 @@
* @since 1.8
*/
abstract class DocFileFactory {
- private static Map<Configuration, DocFileFactory> factories =
+ private static final Map<Configuration, DocFileFactory> factories =
new WeakHashMap<Configuration, DocFileFactory>();
/**
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodTypes.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodTypes.java Tue Jan 01 17:49:22 2013 -0800
@@ -36,7 +36,8 @@
INSTANCE(0x2, "Instance Methods", "t2", false),
ABSTRACT(0x4, "Abstract Methods", "t3", false),
CONCRETE(0x8, "Concrete Methods", "t4", false),
- DEPRECATED(0x10, "Deprecated Methods", "t5", false);
+ DEFAULT(0x10, "Default Methods", "t5", false),
+ DEPRECATED(0x20, "Deprecated Methods", "t6", false);
private final int value;
private final String text;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclint/Checker.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,754 @@
+/*
+ * Copyright (c) 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.tools.doclint;
+
+import java.util.regex.Matcher;
+import com.sun.source.doctree.LinkTree;
+import java.net.URI;
+import java.util.regex.Pattern;
+import java.io.IOException;
+import com.sun.tools.javac.tree.DocPretty;
+import java.io.StringWriter;
+import java.util.Deque;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
+import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.Name;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.TypeKind;
+import javax.lang.model.type.TypeMirror;
+import javax.tools.Diagnostic.Kind;
+
+import com.sun.source.doctree.AttributeTree;
+import com.sun.source.doctree.AuthorTree;
+import com.sun.source.doctree.DocCommentTree;
+import com.sun.source.doctree.DocTree;
+import com.sun.source.doctree.EndElementTree;
+import com.sun.source.doctree.EntityTree;
+import com.sun.source.doctree.ErroneousTree;
+import com.sun.source.doctree.IdentifierTree;
+import com.sun.source.doctree.InheritDocTree;
+import com.sun.source.doctree.ParamTree;
+import com.sun.source.doctree.ReferenceTree;
+import com.sun.source.doctree.ReturnTree;
+import com.sun.source.doctree.SerialDataTree;
+import com.sun.source.doctree.SerialFieldTree;
+import com.sun.source.doctree.SinceTree;
+import com.sun.source.doctree.StartElementTree;
+import com.sun.source.doctree.TextTree;
+import com.sun.source.doctree.ThrowsTree;
+import com.sun.source.doctree.VersionTree;
+import com.sun.source.util.DocTreeScanner;
+import com.sun.source.util.TreePath;
+import com.sun.tools.doclint.HtmlTag.AttrKind;
+import java.net.URISyntaxException;
+import static com.sun.tools.doclint.Messages.Group.*;
+
+
+/**
+ * Validate a doc comment.
+ *
+ * <p><b>This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own
+ * risk. This code and its internal interfaces are subject to change
+ * or deletion without notice.</b></p>
+ */
+public class Checker extends DocTreeScanner<Void, Void> {
+ final Env env;
+
+ Set<Element> foundParams = new HashSet<Element>();
+ Set<TypeMirror> foundThrows = new HashSet<TypeMirror>();
+ Set<String> foundAnchors = new HashSet<String>();
+ boolean foundInheritDoc = false;
+ boolean foundReturn = false;
+
+ enum Flag {
+ TABLE_HAS_CAPTION,
+ HAS_ELEMENT,
+ HAS_TEXT
+ }
+
+ static class TagStackItem {
+ final DocTree tree; // typically, but not always, StartElementTree
+ final HtmlTag tag;
+ final Set<HtmlTag.Attr> attrs;
+ final Set<Flag> flags;
+ TagStackItem(DocTree tree, HtmlTag tag) {
+ this.tree = tree;
+ this.tag = tag;
+ attrs = EnumSet.noneOf(HtmlTag.Attr.class);
+ flags = EnumSet.noneOf(Flag.class);
+ }
+ @Override
+ public String toString() {
+ return String.valueOf(tag);
+ }
+ }
+
+ private Deque<TagStackItem> tagStack; // TODO: maybe want to record starting tree as well
+ private HtmlTag currHeaderTag;
+
+ // <editor-fold defaultstate="collapsed" desc="Top level">
+
+ Checker(Env env) {
+ env.getClass();
+ this.env = env;
+ tagStack = new LinkedList<TagStackItem>();
+ }
+
+ public Void scan(DocCommentTree tree, TreePath p) {
+ env.setCurrent(p, tree);
+
+ boolean isOverridingMethod = !env.currOverriddenMethods.isEmpty();
+
+ if (tree == null) {
+ if (!isSynthetic() && !isOverridingMethod)
+ reportMissing("dc.missing.comment");
+ return null;
+ }
+
+ tagStack.clear();
+ currHeaderTag = null;
+
+ foundParams.clear();
+ foundThrows.clear();
+ foundInheritDoc = false;
+ foundReturn = false;
+
+ scan(tree, (Void) null);
+
+ if (!isOverridingMethod) {
+ switch (env.currElement.getKind()) {
+ case METHOD:
+ case CONSTRUCTOR: {
+ ExecutableElement ee = (ExecutableElement) env.currElement;
+ checkParamsDocumented(ee.getTypeParameters());
+ checkParamsDocumented(ee.getParameters());
+ switch (ee.getReturnType().getKind()) {
+ case VOID:
+ case NONE:
+ break;
+ default:
+ if (!foundReturn
+ && !foundInheritDoc
+ && !env.types.isSameType(ee.getReturnType(), env.java_lang_Void)) {
+ reportMissing("dc.missing.return");
+ }
+ }
+ checkThrowsDocumented(ee.getThrownTypes());
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private void reportMissing(String code, Object... args) {
+ env.messages.report(MISSING, Kind.WARNING, env.currPath.getLeaf(), code, args);
+ }
+
+ @Override
+ public Void visitDocComment(DocCommentTree tree, Void ignore) {
+ super.visitDocComment(tree, ignore);
+ for (TagStackItem tsi: tagStack) {
+ if (tsi.tree.getKind() == DocTree.Kind.START_ELEMENT
+ && tsi.tag.endKind == HtmlTag.EndKind.REQUIRED) {
+ StartElementTree t = (StartElementTree) tsi.tree;
+ env.messages.error(HTML, t, "dc.tag.not.closed", t.getName());
+ }
+ }
+ return null;
+ }
+ // </editor-fold>
+
+ // <editor-fold defaultstate="collapsed" desc="Text and entities.">
+
+ @Override
+ public Void visitText(TextTree tree, Void ignore) {
+ if (!tree.getBody().trim().isEmpty()) {
+ markEnclosingTag(Flag.HAS_TEXT);
+ }
+ return null;
+ }
+
+ @Override
+ public Void visitEntity(EntityTree tree, Void ignore) {
+ markEnclosingTag(Flag.HAS_TEXT);
+ String name = tree.getName().toString();
+ if (name.startsWith("#")) {
+ int v = name.toLowerCase().startsWith("#x")
+ ? Integer.parseInt(name.substring(2), 16)
+ : Integer.parseInt(name.substring(1), 10);
+ if (!Entity.isValid(v)) {
+ env.messages.error(HTML, tree, "dc.entity.invalid", name);
+ }
+ } else if (!Entity.isValid(name)) {
+ env.messages.error(HTML, tree, "dc.entity.invalid", name);
+ }
+ return null;
+ }
+
+ // </editor-fold>
+
+ // <editor-fold defaultstate="collapsed" desc="HTML elements">
+
+ @Override
+ public Void visitStartElement(StartElementTree tree, Void ignore) {
+ markEnclosingTag(Flag.HAS_ELEMENT);
+ final Name treeName = tree.getName();
+ final HtmlTag t = HtmlTag.get(treeName);
+ if (t == null) {
+ env.messages.error(HTML, tree, "dc.tag.unknown", treeName);
+ } else {
+ // tag specific checks
+ switch (t) {
+ // check for out of sequence headers, such as <h1>...</h1> <h3>...</h3>
+ case H1: case H2: case H3: case H4: case H5: case H6:
+ checkHeader(tree, t);
+ break;
+ // <p> inside <pre>
+ case P:
+ TagStackItem top = tagStack.peek();
+ if (top != null && top.tag == HtmlTag.PRE)
+ env.messages.warning(HTML, tree, "dc.tag.p.in.pre");
+ break;
+ }
+
+ // check that only block tags and inline tags are used,
+ // and that blocks tags are not used within inline tags
+ switch (t.blockType) {
+ case INLINE:
+ break;
+ case BLOCK:
+ TagStackItem top = tagStack.peek();
+ if (top != null && top.tag != null && top.tag.blockType == HtmlTag.BlockType.INLINE) {
+ switch (top.tree.getKind()) {
+ case START_ELEMENT: {
+ Name name = ((StartElementTree) top.tree).getName();
+ env.messages.error(HTML, tree, "dc.tag.not.allowed.inline.element",
+ treeName, name);
+ break;
+ }
+ case LINK:
+ case LINK_PLAIN: {
+ String name = top.tree.getKind().tagName;
+ env.messages.error(HTML, tree, "dc.tag.not.allowed.inline.tag",
+ treeName, name);
+ break;
+ }
+ default:
+ env.messages.error(HTML, tree, "dc.tag.not.allowed.inline.other",
+ treeName);
+ }
+ }
+ break;
+ case OTHER:
+ env.messages.error(HTML, tree, "dc.tag.not.allowed", treeName);
+ break;
+ default:
+ throw new AssertionError();
+ }
+
+ if (t.flags.contains(HtmlTag.Flag.NO_NEST)) {
+ for (TagStackItem i: tagStack) {
+ if (t == i.tag) {
+ env.messages.warning(HTML, tree, "dc.tag.nested.not.allowed", treeName);
+ break;
+ }
+ }
+ }
+ }
+
+ // check for self closing tags, such as <a id="name"/>
+ if (tree.isSelfClosing()) {
+ env.messages.error(HTML, tree, "dc.tag.self.closing", treeName);
+ }
+
+ try {
+ TagStackItem parent = tagStack.peek();
+ TagStackItem top = new TagStackItem(tree, t);
+ tagStack.push(top);
+
+ super.visitStartElement(tree, ignore);
+
+ // handle attributes that may or may not have been found in start element
+ if (t != null) {
+ switch (t) {
+ case CAPTION:
+ if (parent != null && parent.tag == HtmlTag.TABLE)
+ parent.flags.add(Flag.TABLE_HAS_CAPTION);
+ break;
+
+ case IMG:
+ if (!top.attrs.contains(HtmlTag.Attr.ALT))
+ env.messages.error(ACCESSIBILITY, tree, "dc.no.alt.attr.for.image");
+ break;
+ }
+ }
+
+ return null;
+ } finally {
+
+ if (t == null || t.endKind == HtmlTag.EndKind.NONE)
+ tagStack.pop();
+ }
+ }
+
+ private void checkHeader(StartElementTree tree, HtmlTag tag) {
+ // verify the new tag
+ if (getHeaderLevel(tag) > getHeaderLevel(currHeaderTag) + 1) {
+ if (currHeaderTag == null) {
+ env.messages.error(ACCESSIBILITY, tree, "dc.tag.header.sequence.1", tag);
+ } else {
+ env.messages.error(ACCESSIBILITY, tree, "dc.tag.header.sequence.2",
+ tag, currHeaderTag);
+ }
+ }
+
+ currHeaderTag = tag;
+ }
+
+ private int getHeaderLevel(HtmlTag tag) {
+ if (tag == null)
+ return 0;
+ switch (tag) {
+ case H1: return 1;
+ case H2: return 2;
+ case H3: return 3;
+ case H4: return 4;
+ case H5: return 5;
+ case H6: return 6;
+ default: throw new IllegalArgumentException();
+ }
+ }
+
+ @Override
+ public Void visitEndElement(EndElementTree tree, Void ignore) {
+ final Name treeName = tree.getName();
+ final HtmlTag t = HtmlTag.get(treeName);
+ if (t == null) {
+ env.messages.error(HTML, tree, "dc.tag.unknown", treeName);
+ } else if (t.endKind == HtmlTag.EndKind.NONE) {
+ env.messages.error(HTML, tree, "dc.tag.end.not.permitted", treeName);
+ } else if (tagStack.isEmpty()) {
+ env.messages.error(HTML, tree, "dc.tag.end.unexpected", treeName);
+ } else {
+ while (!tagStack.isEmpty()) {
+ TagStackItem top = tagStack.peek();
+ if (t == top.tag) {
+ switch (t) {
+ case TABLE:
+ if (!top.attrs.contains(HtmlTag.Attr.SUMMARY)
+ && !top.flags.contains(Flag.TABLE_HAS_CAPTION)) {
+ env.messages.error(ACCESSIBILITY, tree,
+ "dc.no.summary.or.caption.for.table");
+ }
+ }
+ if (t.flags.contains(HtmlTag.Flag.EXPECT_CONTENT)
+ && !top.flags.contains(Flag.HAS_TEXT)
+ && !top.flags.contains(Flag.HAS_ELEMENT)) {
+ env.messages.warning(HTML, tree, "dc.tag.empty", treeName);
+ }
+ if (t.flags.contains(HtmlTag.Flag.NO_TEXT)
+ && top.flags.contains(Flag.HAS_TEXT)) {
+ env.messages.error(HTML, tree, "dc.text.not.allowed", treeName);
+ }
+ tagStack.pop();
+ break;
+ } else if (top.tag == null || top.tag.endKind != HtmlTag.EndKind.REQUIRED) {
+ tagStack.pop();
+ } else {
+ boolean found = false;
+ for (TagStackItem si: tagStack) {
+ if (si.tag == t) {
+ found = true;
+ break;
+ }
+ }
+ if (found && top.tree.getKind() == DocTree.Kind.START_ELEMENT) {
+ env.messages.error(HTML, top.tree, "dc.tag.start.unmatched",
+ ((StartElementTree) top.tree).getName());
+ tagStack.pop();
+ } else {
+ env.messages.error(HTML, tree, "dc.tag.end.unexpected", treeName);
+ break;
+ }
+ }
+ }
+ }
+
+ return super.visitEndElement(tree, ignore);
+ }
+ // </editor-fold>
+
+ // <editor-fold defaultstate="collapsed" desc="HTML attributes">
+
+ @Override @SuppressWarnings("fallthrough")
+ public Void visitAttribute(AttributeTree tree, Void ignore) {
+ HtmlTag currTag = tagStack.peek().tag;
+ if (currTag != null) {
+ Name name = tree.getName();
+ HtmlTag.Attr attr = currTag.getAttr(name);
+ if (attr != null) {
+ boolean first = tagStack.peek().attrs.add(attr);
+ if (!first)
+ env.messages.error(HTML, tree, "dc.attr.repeated", name);
+ }
+ AttrKind k = currTag.getAttrKind(name);
+ switch (k) {
+ case OK:
+ break;
+
+ case INVALID:
+ env.messages.error(HTML, tree, "dc.attr.unknown", name);
+ break;
+
+ case OBSOLETE:
+ env.messages.warning(ACCESSIBILITY, tree, "dc.attr.obsolete", name);
+ break;
+
+ case USE_CSS:
+ env.messages.warning(ACCESSIBILITY, tree, "dc.attr.obsolete.use.css", name);
+ break;
+ }
+
+ if (attr != null) {
+ switch (attr) {
+ case NAME:
+ if (currTag != HtmlTag.A) {
+ break;
+ }
+ // fallthrough
+ case ID:
+ String value = getAttrValue(tree);
+ if (!validName.matcher(value).matches()) {
+ env.messages.error(HTML, tree, "dc.invalid.anchor", value);
+ }
+ if (!foundAnchors.add(value)) {
+ env.messages.error(HTML, tree, "dc.anchor.already.defined", value);
+ }
+ break;
+
+ case HREF:
+ if (currTag == HtmlTag.A) {
+ String v = getAttrValue(tree);
+ if (v == null || v.isEmpty()) {
+ env.messages.error(HTML, tree, "dc.attr.lacks.value");
+ } else {
+ Matcher m = docRoot.matcher(v);
+ if (m.matches()) {
+ String rest = m.group(2);
+ if (!rest.isEmpty())
+ checkURI(tree, rest);
+ } else {
+ checkURI(tree, v);
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ // TODO: basic check on value
+
+ return super.visitAttribute(tree, ignore);
+ }
+
+ // http://www.w3.org/TR/html401/types.html#type-name
+ private static final Pattern validName = Pattern.compile("[A-Za-z][A-Za-z0-9-_:.]*");
+
+ // pattern to remove leading {@docRoot}/?
+ private static final Pattern docRoot = Pattern.compile("(?i)(\\{@docRoot *\\}/?)?(.*)");
+
+ private String getAttrValue(AttributeTree tree) {
+ if (tree.getValue() == null)
+ return null;
+
+ StringWriter sw = new StringWriter();
+ try {
+ new DocPretty(sw).print(tree.getValue());
+ } catch (IOException e) {
+ // cannot happen
+ }
+ // ignore potential use of entities for now
+ return sw.toString();
+ }
+
+ private void checkURI(AttributeTree tree, String uri) {
+ try {
+ URI u = new URI(uri);
+ } catch (URISyntaxException e) {
+ env.messages.error(HTML, tree, "dc.invalid.uri", uri);
+ }
+ }
+ // </editor-fold>
+
+ // <editor-fold defaultstate="collapsed" desc="javadoc tags">
+
+ @Override
+ public Void visitAuthor(AuthorTree tree, Void ignore) {
+ warnIfEmpty(tree, tree.getName());
+ return super.visitAuthor(tree, ignore);
+ }
+
+ @Override
+ public Void visitInheritDoc(InheritDocTree tree, Void ignore) {
+ // TODO: verify on overridden method
+ foundInheritDoc = true;
+ return super.visitInheritDoc(tree, ignore);
+ }
+
+ @Override
+ public Void visitLink(LinkTree tree, Void ignore) {
+ // simulate inline context on tag stack
+ HtmlTag t = (tree.getKind() == DocTree.Kind.LINK)
+ ? HtmlTag.CODE : HtmlTag.SPAN;
+ tagStack.push(new TagStackItem(tree, t));
+ try {
+ return super.visitLink(tree, ignore);
+ } finally {
+ tagStack.pop();
+ }
+ }
+
+ @Override
+ public Void visitParam(ParamTree tree, Void ignore) {
+ boolean typaram = tree.isTypeParameter();
+ IdentifierTree nameTree = tree.getName();
+ Element e = env.currElement;
+ switch (e.getKind()) {
+ case METHOD: case CONSTRUCTOR: {
+ ExecutableElement ee = (ExecutableElement) e;
+ checkParamDeclared(nameTree, typaram ? ee.getTypeParameters() : ee.getParameters());
+ break;
+ }
+
+ case CLASS: case INTERFACE: {
+ TypeElement te = (TypeElement) e;
+ if (typaram) {
+ checkParamDeclared(nameTree, te.getTypeParameters());
+ } else {
+ env.messages.error(REFERENCE, tree, "dc.invalid.param");
+ }
+ break;
+ }
+
+ default:
+ env.messages.error(REFERENCE, tree, "dc.invalid.param");
+ break;
+ }
+ warnIfEmpty(tree, tree.getDescription());
+ return super.visitParam(tree, ignore);
+ }
+ // where
+ private void checkParamDeclared(IdentifierTree nameTree, List<? extends Element> list) {
+ Name name = nameTree.getName();
+ boolean found = false;
+ for (Element e: list) {
+ if (name.equals(e.getSimpleName())) {
+ foundParams.add(e);
+ found = true;
+ }
+ }
+ if (!found)
+ env.messages.error(REFERENCE, nameTree, "dc.param.name.not.found");
+ }
+
+ private void checkParamsDocumented(List<? extends Element> list) {
+ if (foundInheritDoc)
+ return;
+
+ for (Element e: list) {
+ if (!foundParams.contains(e)) {
+ CharSequence paramName = (e.getKind() == ElementKind.TYPE_PARAMETER)
+ ? "<" + e.getSimpleName() + ">"
+ : e.getSimpleName();
+ reportMissing("dc.missing.param", paramName);
+ }
+ }
+ }
+
+ @Override
+ public Void visitReference(ReferenceTree tree, Void ignore) {
+ Element e = env.trees.getElement(env.currPath, tree);
+ if (e == null)
+ env.messages.error(REFERENCE, tree, "dc.ref.not.found");
+ return super.visitReference(tree, ignore);
+ }
+
+ @Override
+ public Void visitReturn(ReturnTree tree, Void ignore) {
+ Element e = env.trees.getElement(env.currPath);
+ if (e.getKind() != ElementKind.METHOD
+ || ((ExecutableElement) e).getReturnType().getKind() == TypeKind.VOID)
+ env.messages.error(REFERENCE, tree, "dc.invalid.return");
+ foundReturn = true;
+ warnIfEmpty(tree, tree.getDescription());
+ return super.visitReturn(tree, ignore);
+ }
+
+ @Override
+ public Void visitSerialData(SerialDataTree tree, Void ignore) {
+ warnIfEmpty(tree, tree.getDescription());
+ return super.visitSerialData(tree, ignore);
+ }
+
+ @Override
+ public Void visitSerialField(SerialFieldTree tree, Void ignore) {
+ warnIfEmpty(tree, tree.getDescription());
+ return super.visitSerialField(tree, ignore);
+ }
+
+ @Override
+ public Void visitSince(SinceTree tree, Void ignore) {
+ warnIfEmpty(tree, tree.getBody());
+ return super.visitSince(tree, ignore);
+ }
+
+ @Override
+ public Void visitThrows(ThrowsTree tree, Void ignore) {
+ ReferenceTree exName = tree.getExceptionName();
+ Element ex = env.trees.getElement(env.currPath, exName);
+ if (ex == null) {
+ env.messages.error(REFERENCE, tree, "dc.ref.not.found");
+ } else if (ex.asType().getKind() == TypeKind.DECLARED
+ && env.types.isAssignable(ex.asType(), env.java_lang_Throwable)) {
+ switch (env.currElement.getKind()) {
+ case CONSTRUCTOR:
+ case METHOD:
+ if (isCheckedException(ex.asType())) {
+ ExecutableElement ee = (ExecutableElement) env.currElement;
+ checkThrowsDeclared(exName, ex.asType(), ee.getThrownTypes());
+ }
+ break;
+ default:
+ env.messages.error(REFERENCE, tree, "dc.invalid.throws");
+ }
+ } else {
+ env.messages.error(REFERENCE, tree, "dc.invalid.throws");
+ }
+ warnIfEmpty(tree, tree.getDescription());
+ return scan(tree.getDescription(), ignore);
+ }
+
+ private void checkThrowsDeclared(ReferenceTree tree, TypeMirror t, List<? extends TypeMirror> list) {
+ boolean found = false;
+ for (TypeMirror tl : list) {
+ if (env.types.isAssignable(t, tl)) {
+ foundThrows.add(tl);
+ found = true;
+ }
+ }
+ if (!found)
+ env.messages.error(REFERENCE, tree, "dc.exception.not.thrown", t);
+ }
+
+ private void checkThrowsDocumented(List<? extends TypeMirror> list) {
+ if (foundInheritDoc)
+ return;
+
+ for (TypeMirror tl: list) {
+ if (isCheckedException(tl) && !foundThrows.contains(tl))
+ reportMissing("dc.missing.throws", tl);
+ }
+ }
+
+ @Override
+ public Void visitVersion(VersionTree tree, Void ignore) {
+ warnIfEmpty(tree, tree.getBody());
+ return super.visitVersion(tree, ignore);
+ }
+
+ @Override
+ public Void visitErroneous(ErroneousTree tree, Void ignore) {
+ env.messages.error(SYNTAX, tree, null, tree.getDiagnostic().getMessage(null));
+ return null;
+ }
+ // </editor-fold>
+
+ // <editor-fold defaultstate="collapsed" desc="Utility methods">
+
+ private boolean isCheckedException(TypeMirror t) {
+ return !(env.types.isAssignable(t, env.java_lang_Error)
+ || env.types.isAssignable(t, env.java_lang_RuntimeException));
+ }
+
+ private boolean isSynthetic() {
+ switch (env.currElement.getKind()) {
+ case CONSTRUCTOR:
+ // A synthetic default constructor has the same pos as the
+ // enclosing class
+ TreePath p = env.currPath;
+ return env.getPos(p) == env.getPos(p.getParentPath());
+ }
+ return false;
+ }
+
+ void markEnclosingTag(Flag flag) {
+ TagStackItem top = tagStack.peek();
+ if (top != null)
+ top.flags.add(flag);
+ }
+
+ String toString(TreePath p) {
+ StringBuilder sb = new StringBuilder("TreePath[");
+ toString(p, sb);
+ sb.append("]");
+ return sb.toString();
+ }
+
+ void toString(TreePath p, StringBuilder sb) {
+ TreePath parent = p.getParentPath();
+ if (parent != null) {
+ toString(parent, sb);
+ sb.append(",");
+ }
+ sb.append(p.getLeaf().getKind()).append(":").append(env.getPos(p)).append(":S").append(env.getStartPos(p));
+ }
+
+ void warnIfEmpty(DocTree tree, List<? extends DocTree> list) {
+ for (DocTree d: list) {
+ switch (d.getKind()) {
+ case TEXT:
+ if (!((TextTree) d).getBody().trim().isEmpty())
+ return;
+ break;
+ default:
+ return;
+ }
+ }
+ env.messages.warning(SYNTAX, tree, "dc.empty", tree.getKind().tagName);
+ }
+ // </editor-fold>
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclint/DocLint.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,376 @@
+/*
+ * Copyright (c) 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.tools.doclint;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.lang.model.element.Name;
+import javax.tools.StandardLocation;
+
+import com.sun.source.doctree.DocCommentTree;
+import com.sun.source.tree.ClassTree;
+import com.sun.source.tree.CompilationUnitTree;
+import com.sun.source.tree.MethodTree;
+import com.sun.source.tree.Tree;
+import com.sun.source.tree.VariableTree;
+import com.sun.source.util.JavacTask;
+import com.sun.source.util.Plugin;
+import com.sun.source.util.TaskEvent;
+import com.sun.source.util.TaskListener;
+import com.sun.source.util.TreePath;
+import com.sun.source.util.TreePathScanner;
+import com.sun.tools.javac.api.JavacTaskImpl;
+import com.sun.tools.javac.api.JavacTool;
+import com.sun.tools.javac.file.JavacFileManager;
+import com.sun.tools.javac.main.JavaCompiler;
+import com.sun.tools.javac.util.Context;
+
+/**
+ * Multi-function entry point for the doc check utility.
+ *
+ * This class can be invoked in the following ways:
+ * <ul>
+ * <li>From the command line
+ * <li>From javac, as a plugin
+ * <li>Directly, via a simple API
+ * </ul>
+ *
+ * <p><b>This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own
+ * risk. This code and its internal interfaces are subject to change
+ * or deletion without notice.</b></p>
+ */
+public class DocLint implements Plugin {
+
+ public static final String XMSGS_OPTION = "-Xmsgs";
+ public static final String XMSGS_CUSTOM_PREFIX = "-Xmsgs:";
+ private static final String STATS = "-stats";
+
+ // <editor-fold defaultstate="collapsed" desc="Command-line entry point">
+ public static void main(String... args) {
+ try {
+ new DocLint().run(args);
+ } catch (BadArgs e) {
+ System.err.println(e.getMessage());
+ System.exit(1);
+ } catch (IOException e) {
+ System.err.println(e);
+ System.exit(2);
+ }
+ }
+
+ // </editor-fold>
+
+ // <editor-fold defaultstate="collapsed" desc="Simple API">
+
+ public static class BadArgs extends Exception {
+ private static final long serialVersionUID = 0;
+ BadArgs(String code, Object... args) {
+ this.code = code;
+ this.args = args;
+ }
+
+ final String code;
+ final Object[] args;
+ }
+
+ /**
+ * Simple API entry point.
+ */
+ public void run(String... args) throws BadArgs, IOException {
+ PrintWriter out = new PrintWriter(System.out);
+ try {
+ run(out, args);
+ } finally {
+ out.flush();
+ }
+ }
+
+ public void run(PrintWriter out, String... args) throws BadArgs, IOException {
+ env = new Env();
+ processArgs(args);
+
+ if (needHelp)
+ showHelp(out);
+
+ if (javacFiles.isEmpty()) {
+ if (!needHelp)
+ System.out.println("no files given");
+ }
+
+ JavacTool tool = JavacTool.create();
+
+ JavacFileManager fm = new JavacFileManager(new Context(), false, null);
+ fm.setSymbolFileEnabled(false);
+ fm.setLocation(StandardLocation.PLATFORM_CLASS_PATH, javacBootClassPath);
+ fm.setLocation(StandardLocation.CLASS_PATH, javacClassPath);
+ fm.setLocation(StandardLocation.SOURCE_PATH, javacSourcePath);
+
+ JavacTask task = tool.getTask(out, fm, null, javacOpts, null,
+ fm.getJavaFileObjectsFromFiles(javacFiles));
+ Iterable<? extends CompilationUnitTree> units = task.parse();
+ ((JavacTaskImpl) task).enter();
+
+ env.init(task);
+ checker = new Checker(env);
+
+ DeclScanner ds = new DeclScanner() {
+ @Override
+ void visitDecl(Tree tree, Name name) {
+ TreePath p = getCurrentPath();
+ DocCommentTree dc = env.trees.getDocCommentTree(p);
+
+ checker.scan(dc, p);
+ }
+ };
+
+ ds.scan(units, null);
+
+ reportStats(out);
+
+ Context ctx = ((JavacTaskImpl) task).getContext();
+ JavaCompiler c = JavaCompiler.instance(ctx);
+ c.printCount("error", c.errorCount());
+ c.printCount("warn", c.warningCount());
+ }
+
+ void processArgs(String... args) throws BadArgs {
+ javacOpts = new ArrayList<String>();
+ javacFiles = new ArrayList<File>();
+
+ if (args.length == 0)
+ needHelp = true;
+
+ for (int i = 0; i < args.length; i++) {
+ String arg = args[i];
+ if (arg.matches("-Xmax(errs|warns)") && i + 1 < args.length) {
+ if (args[++i].matches("[0-9]+")) {
+ javacOpts.add(arg);
+ javacOpts.add(args[i]);
+ } else {
+ throw new BadArgs("dc.bad.value.for.option", arg, args[i]);
+ }
+ } else if (arg.equals(STATS)) {
+ env.messages.setStatsEnabled(true);
+ } else if (arg.matches("-bootclasspath") && i + 1 < args.length) {
+ javacBootClassPath = splitPath(args[++i]);
+ } else if (arg.matches("-classpath") && i + 1 < args.length) {
+ javacClassPath = splitPath(args[++i]);
+ } else if (arg.matches("-sourcepath") && i + 1 < args.length) {
+ javacSourcePath = splitPath(args[++i]);
+ } else if (arg.equals(XMSGS_OPTION)) {
+ env.messages.setOptions(null);
+ } else if (arg.startsWith(XMSGS_CUSTOM_PREFIX)) {
+ env.messages.setOptions(arg.substring(arg.indexOf(":") + 1));
+ } else if (arg.equals("-h") || arg.equals("-help") || arg.equals("--help")
+ || arg.equals("-?") || arg.equals("-usage")) {
+ needHelp = true;
+ } else if (arg.startsWith("-")) {
+ throw new BadArgs("dc.bad.option", arg);
+ } else {
+ while (i < args.length)
+ javacFiles.add(new File(args[i++]));
+ }
+ }
+ }
+
+ void showHelp(PrintWriter out) {
+ out.println("Usage:");
+ out.println(" doclint [options] source-files...");
+ out.println("");
+ out.println("Options:");
+ out.println(" -Xmsgs ");
+ out.println(" Same as -Xmsgs:all");
+ out.println(" -Xmsgs:values");
+ out.println(" Specify categories of issues to be checked, where 'values'");
+ out.println(" is a comma-separated list of any of the following:");
+ out.println(" reference show places where comments contain incorrect");
+ out.println(" references to Java source code elements");
+ out.println(" syntax show basic syntax errors within comments");
+ out.println(" html show issues with HTML tags and attributes");
+ out.println(" accessibility show issues for accessibility");
+ out.println(" missing show issues with missing documentation");
+ out.println(" all all of the above");
+ out.println(" Precede a value with '-' to negate it");
+ out.println(" Categories may be qualified by one of:");
+ out.println(" /public /protected /package /private");
+ out.println(" For positive categories (not beginning with '-')");
+ out.println(" the qualifier applies to that access level and above.");
+ out.println(" For negative categories (beginning with '-')");
+ out.println(" the qualifier applies to that access level and below.");
+ out.println(" If a qualifier is missing, the category applies to");
+ out.println(" all access levels.");
+ out.println(" For example, -Xmsgs:all,-syntax/private");
+ out.println(" This will enable all messages, except syntax errors");
+ out.println(" in the doc comments of private methods.");
+ out.println(" If no -Xmsgs options are provided, the default is");
+ out.println(" equivalent to -Xmsgs:all/protected, meaning that");
+ out.println(" all messages are reported for protected and public");
+ out.println(" declarations only. ");
+ out.println(" -h -help --help -usage -?");
+ out.println(" Show this message.");
+ out.println("");
+ out.println("The following javac options are also supported");
+ out.println(" -bootclasspath, -classpath, -sourcepath, -Xmaxerrs, -Xmaxwarns");
+ out.println("");
+ out.println("To run doclint on part of a project, put the compiled classes for your");
+ out.println("project on the classpath (or bootclasspath), then specify the source files");
+ out.println("to be checked on the command line.");
+ }
+
+ List<File> splitPath(String path) {
+ List<File> files = new ArrayList<File>();
+ for (String f: path.split(File.separator)) {
+ if (f.length() > 0)
+ files.add(new File(f));
+ }
+ return files;
+ }
+
+ List<File> javacBootClassPath;
+ List<File> javacClassPath;
+ List<File> javacSourcePath;
+ List<String> javacOpts;
+ List<File> javacFiles;
+ boolean needHelp = false;
+
+ // </editor-fold>
+
+ // <editor-fold defaultstate="collapsed" desc="javac Plugin">
+
+ @Override
+ public String getName() {
+ return "doclint";
+ }
+
+ @Override
+ public void init(JavacTask task, String... args) {
+ init(task, args, true);
+ }
+
+ // </editor-fold>
+
+ // <editor-fold defaultstate="collapsed" desc="Embedding API">
+
+ public void init(JavacTask task, String[] args, boolean addTaskListener) {
+ env = new Env();
+ for (int i = 0; i < args.length; i++) {
+ String arg = args[i];
+ if (arg.equals(XMSGS_OPTION)) {
+ env.messages.setOptions(null);
+ } else if (arg.startsWith(XMSGS_CUSTOM_PREFIX)) {
+ env.messages.setOptions(arg.substring(arg.indexOf(":") + 1));
+ } else
+ throw new IllegalArgumentException(arg);
+ }
+ env.init(task);
+
+ checker = new Checker(env);
+
+ if (addTaskListener) {
+ final DeclScanner ds = new DeclScanner() {
+ @Override
+ void visitDecl(Tree tree, Name name) {
+ TreePath p = getCurrentPath();
+ DocCommentTree dc = env.trees.getDocCommentTree(p);
+
+ checker.scan(dc, p);
+ }
+ };
+
+ TaskListener tl = new TaskListener() {
+ @Override
+ public void started(TaskEvent e) {
+ return;
+ }
+
+ @Override
+ public void finished(TaskEvent e) {
+ switch (e.getKind()) {
+ case ENTER:
+ ds.scan(e.getCompilationUnit(), null);
+ }
+ }
+ };
+
+ task.addTaskListener(tl);
+ }
+ }
+
+ public void scan(TreePath p) {
+ DocCommentTree dc = env.trees.getDocCommentTree(p);
+ checker.scan(dc, p);
+ }
+
+ public void reportStats(PrintWriter out) {
+ env.messages.reportStats(out);
+ }
+
+ // </editor-fold>
+
+ Env env;
+ Checker checker;
+
+ public static boolean isValidOption(String opt) {
+ if (opt.equals(XMSGS_OPTION))
+ return true;
+ if (opt.startsWith(XMSGS_CUSTOM_PREFIX))
+ return Messages.Options.isValidOptions(opt.substring(XMSGS_CUSTOM_PREFIX.length()));
+ return false;
+ }
+
+ // <editor-fold defaultstate="collapsed" desc="DeclScanner">
+
+ static abstract class DeclScanner extends TreePathScanner<Void, Void> {
+ abstract void visitDecl(Tree tree, Name name);
+
+ @Override
+ public Void visitClass(ClassTree tree, Void ignore) {
+ visitDecl(tree, tree.getSimpleName());
+ return super.visitClass(tree, ignore);
+ }
+
+ @Override
+ public Void visitMethod(MethodTree tree, Void ignore) {
+ visitDecl(tree, tree.getName());
+ //return super.visitMethod(tree, ignore);
+ return null;
+ }
+
+ @Override
+ public Void visitVariable(VariableTree tree, Void ignore) {
+ visitDecl(tree, tree.getName());
+ return super.visitVariable(tree, ignore);
+ }
+ }
+
+ // </editor-fold>
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclint/Entity.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,326 @@
+/*
+ * Copyright (c) 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.tools.doclint;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Table of entities defined in HTML 4.01.
+ *
+ * <p> Derived from
+ * <a href="http://www.w3.org/TR/html4/sgml/entities.html">Character entity references in HTML 4</a>.
+ *
+ * The name of the member follows the name of the entity,
+ * except when it clashes with a keyword, in which case
+ * it is prefixed by '_'.
+ *
+ * <p><b>This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own
+ * risk. This code and its internal interfaces are subject to change
+ * or deletion without notice.</b></p>
+ */
+enum Entity {
+ nbsp(160),
+ iexcl(161),
+ cent(162),
+ pound(163),
+ curren(164),
+ yen(165),
+ brvbar(166),
+ sect(167),
+ uml(168),
+ copy(169),
+ ordf(170),
+ laquo(171),
+ not(172),
+ shy(173),
+ reg(174),
+ macr(175),
+ deg(176),
+ plusmn(177),
+ sup2(178),
+ sup3(179),
+ acute(180),
+ micro(181),
+ para(182),
+ middot(183),
+ cedil(184),
+ sup1(185),
+ ordm(186),
+ raquo(187),
+ frac14(188),
+ frac12(189),
+ frac34(190),
+ iquest(191),
+ Agrave(192),
+ Aacute(193),
+ Acirc(194),
+ Atilde(195),
+ Auml(196),
+ Aring(197),
+ AElig(198),
+ Ccedil(199),
+ Egrave(200),
+ Eacute(201),
+ Ecirc(202),
+ Euml(203),
+ Igrave(204),
+ Iacute(205),
+ Icirc(206),
+ Iuml(207),
+ ETH(208),
+ Ntilde(209),
+ Ograve(210),
+ Oacute(211),
+ Ocirc(212),
+ Otilde(213),
+ Ouml(214),
+ times(215),
+ Oslash(216),
+ Ugrave(217),
+ Uacute(218),
+ Ucirc(219),
+ Uuml(220),
+ Yacute(221),
+ THORN(222),
+ szlig(223),
+ agrave(224),
+ aacute(225),
+ acirc(226),
+ atilde(227),
+ auml(228),
+ aring(229),
+ aelig(230),
+ ccedil(231),
+ egrave(232),
+ eacute(233),
+ ecirc(234),
+ euml(235),
+ igrave(236),
+ iacute(237),
+ icirc(238),
+ iuml(239),
+ eth(240),
+ ntilde(241),
+ ograve(242),
+ oacute(243),
+ ocirc(244),
+ otilde(245),
+ ouml(246),
+ divide(247),
+ oslash(248),
+ ugrave(249),
+ uacute(250),
+ ucirc(251),
+ uuml(252),
+ yacute(253),
+ thorn(254),
+ yuml(255),
+ fnof(402),
+ Alpha(913),
+ Beta(914),
+ Gamma(915),
+ Delta(916),
+ Epsilon(917),
+ Zeta(918),
+ Eta(919),
+ Theta(920),
+ Iota(921),
+ Kappa(922),
+ Lambda(923),
+ Mu(924),
+ Nu(925),
+ Xi(926),
+ Omicron(927),
+ Pi(928),
+ Rho(929),
+ Sigma(931),
+ Tau(932),
+ Upsilon(933),
+ Phi(934),
+ Chi(935),
+ Psi(936),
+ Omega(937),
+ alpha(945),
+ beta(946),
+ gamma(947),
+ delta(948),
+ epsilon(949),
+ zeta(950),
+ eta(951),
+ theta(952),
+ iota(953),
+ kappa(954),
+ lambda(955),
+ mu(956),
+ nu(957),
+ xi(958),
+ omicron(959),
+ pi(960),
+ rho(961),
+ sigmaf(962),
+ sigma(963),
+ tau(964),
+ upsilon(965),
+ phi(966),
+ chi(967),
+ psi(968),
+ omega(969),
+ thetasym(977),
+ upsih(978),
+ piv(982),
+ bull(8226),
+ hellip(8230),
+ prime(8242),
+ Prime(8243),
+ oline(8254),
+ frasl(8260),
+ weierp(8472),
+ image(8465),
+ real(8476),
+ trade(8482),
+ alefsym(8501),
+ larr(8592),
+ uarr(8593),
+ rarr(8594),
+ darr(8595),
+ harr(8596),
+ crarr(8629),
+ lArr(8656),
+ uArr(8657),
+ rArr(8658),
+ dArr(8659),
+ hArr(8660),
+ forall(8704),
+ part(8706),
+ exist(8707),
+ empty(8709),
+ nabla(8711),
+ isin(8712),
+ notin(8713),
+ ni(8715),
+ prod(8719),
+ sum(8721),
+ minus(8722),
+ lowast(8727),
+ radic(8730),
+ prop(8733),
+ infin(8734),
+ ang(8736),
+ and(8743),
+ or(8744),
+ cap(8745),
+ cup(8746),
+ _int(8747),
+ there4(8756),
+ sim(8764),
+ cong(8773),
+ asymp(8776),
+ ne(8800),
+ equiv(8801),
+ le(8804),
+ ge(8805),
+ sub(8834),
+ sup(8835),
+ nsub(8836),
+ sube(8838),
+ supe(8839),
+ oplus(8853),
+ otimes(8855),
+ perp(8869),
+ sdot(8901),
+ lceil(8968),
+ rceil(8969),
+ lfloor(8970),
+ rfloor(8971),
+ lang(9001),
+ rang(9002),
+ loz(9674),
+ spades(9824),
+ clubs(9827),
+ hearts(9829),
+ diams(9830),
+ quot(34),
+ amp(38),
+ lt(60),
+ gt(62),
+ OElig(338),
+ oelig(339),
+ Scaron(352),
+ scaron(353),
+ Yuml(376),
+ circ(710),
+ tilde(732),
+ ensp(8194),
+ emsp(8195),
+ thinsp(8201),
+ zwnj(8204),
+ zwj(8205),
+ lrm(8206),
+ rlm(8207),
+ ndash(8211),
+ mdash(8212),
+ lsquo(8216),
+ rsquo(8217),
+ sbquo(8218),
+ ldquo(8220),
+ rdquo(8221),
+ bdquo(8222),
+ dagger(8224),
+ Dagger(8225),
+ permil(8240),
+ lsaquo(8249),
+ rsaquo(8250),
+ euro(8364);
+
+ int code;
+
+ private Entity(int code) {
+ this.code = code;
+ }
+
+ static boolean isValid(String name) {
+ return names.containsKey(name);
+ }
+
+ static boolean isValid(int code) {
+ // allow numeric codes for standard ANSI characters
+ return codes.containsKey(code) || ( 32 <= code && code < 2127);
+ }
+
+ private static final Map<String,Entity> names = new HashMap<String,Entity>();
+ private static final Map<Integer,Entity> codes = new HashMap<Integer,Entity>();
+ static {
+ for (Entity e: values()) {
+ String name = e.name();
+ int code = e.code;
+ if (name.startsWith("_")) name = name.substring(1);
+ names.put(name, e);
+ codes.put(code, e);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclint/Env.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 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.tools.doclint;
+
+
+import java.util.Set;
+
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.Modifier;
+import javax.lang.model.type.TypeMirror;
+import javax.lang.model.util.Elements;
+import javax.lang.model.util.Types;
+
+import com.sun.source.doctree.DocCommentTree;
+import com.sun.source.util.DocTrees;
+import com.sun.source.util.JavacTask;
+import com.sun.source.util.SourcePositions;
+import com.sun.source.util.TreePath;
+import com.sun.tools.javac.model.JavacTypes;
+import com.sun.tools.javac.tree.JCTree;
+
+/**
+ * Utility container for current execution environment,
+ * providing the current declaration and its doc comment.
+ *
+ * <p><b>This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own
+ * risk. This code and its internal interfaces are subject to change
+ * or deletion without notice.</b></p>
+ */
+public class Env {
+ /**
+ * Access kinds for declarations.
+ */
+ public enum AccessKind {
+ PRIVATE,
+ PACKAGE,
+ PROTECTED,
+ PUBLIC;
+
+ static boolean accepts(String opt) {
+ for (AccessKind g: values())
+ if (opt.equals(g.name().toLowerCase())) return true;
+ return false;
+ }
+
+ static AccessKind of(Set<Modifier> mods) {
+ if (mods.contains(Modifier.PUBLIC))
+ return AccessKind.PUBLIC;
+ else if (mods.contains(Modifier.PROTECTED))
+ return AccessKind.PROTECTED;
+ else if (mods.contains(Modifier.PRIVATE))
+ return AccessKind.PRIVATE;
+ else
+ return AccessKind.PACKAGE;
+ }
+ };
+
+ /** Message handler. */
+ final Messages messages;
+
+ // Utility classes
+ DocTrees trees;
+ Elements elements;
+ Types types;
+
+ // Types used when analysing doc comments.
+ TypeMirror java_lang_Error;
+ TypeMirror java_lang_RuntimeException;
+ TypeMirror java_lang_Throwable;
+ TypeMirror java_lang_Void;
+
+ /** The path for the declaration containing the comment currently being analyzed. */
+ TreePath currPath;
+ /** The element for the declaration containing the comment currently being analyzed. */
+ Element currElement;
+ /** The comment current being analyzed. */
+ DocCommentTree currDocComment;
+ /**
+ * The access kind of the declaration containing the comment currently being analyzed.
+ * This is the minimum (most restrictive) access kind of the declaration iteself
+ * and that of its containers. For example, a public method in a private class is
+ * noted as private.
+ */
+ AccessKind currAccess;
+ /** The set of methods, if any, that the current declaration overrides. */
+ Set<? extends ExecutableElement> currOverriddenMethods;
+
+ Env() {
+ messages = new Messages(this);
+ }
+
+ void init(JavacTask task) {
+ init(DocTrees.instance(task), task.getElements(), task.getTypes());
+ }
+
+ void init(DocTrees trees, Elements elements, Types types) {
+ this.trees = trees;
+ this.elements = elements;
+ this.types = types;
+ java_lang_Error = elements.getTypeElement("java.lang.Error").asType();
+ java_lang_RuntimeException = elements.getTypeElement("java.lang.RuntimeException").asType();
+ java_lang_Throwable = elements.getTypeElement("java.lang.Throwable").asType();
+ java_lang_Void = elements.getTypeElement("java.lang.Void").asType();
+ }
+
+ /** Set the current declaration and its doc comment. */
+ void setCurrent(TreePath path, DocCommentTree comment) {
+ currPath = path;
+ currDocComment = comment;
+ currElement = trees.getElement(currPath);
+ currOverriddenMethods = ((JavacTypes) types).getOverriddenMethods(currElement);
+
+ AccessKind ak = null;
+ for (TreePath p = path; p != null; p = p.getParentPath()) {
+ Element e = trees.getElement(p);
+ if (e != null) {
+ ak = min(ak, AccessKind.of(e.getModifiers()));
+ }
+ }
+ currAccess = ak;
+ }
+
+ AccessKind getAccessKind() {
+ return currAccess;
+ }
+
+ long getPos(TreePath p) {
+ return ((JCTree) p.getLeaf()).pos;
+ }
+
+ long getStartPos(TreePath p) {
+ SourcePositions sp = trees.getSourcePositions();
+ return sp.getStartPosition(p.getCompilationUnit(), p.getLeaf());
+ }
+
+ private <T extends Comparable<T>> T min(T item1, T item2) {
+ return (item1 == null) ? item2
+ : (item2 == null) ? item1
+ : item1.compareTo(item2) <= 0 ? item1 : item2;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclint/HtmlTag.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,356 @@
+/*
+ * Copyright (c) 2010, 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.tools.doclint;
+
+import java.util.Set;
+import java.util.Collections;
+import java.util.EnumMap;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.lang.model.element.Name;
+
+import static com.sun.tools.doclint.HtmlTag.Attr.*;
+
+/**
+ * Enum representing HTML tags.
+ *
+ * The intent of this class is to embody the semantics of W3C HTML 4.01
+ * to the extent supported/used by javadoc.
+ *
+ * This is derivative of com.sun.tools.doclets.formats.html.markup.HtmlTag.
+ * Eventually, these two should be merged back together, and possibly made
+ * public.
+ *
+ * @see <a href="http://www.w3.org/TR/REC-html40/">HTML 4.01 Specification</a>
+ * @author Bhavesh Patel
+ * @author Jonathan Gibbons (revised)
+ */
+public enum HtmlTag {
+ A(BlockType.INLINE, EndKind.REQUIRED,
+ attrs(AttrKind.OK, HREF, TARGET, NAME)),
+
+ B(BlockType.INLINE, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
+
+ BLOCKQUOTE,
+
+ BODY(BlockType.OTHER, EndKind.REQUIRED),
+
+ BR(BlockType.INLINE, EndKind.NONE,
+ attrs(AttrKind.USE_CSS, CLEAR)),
+
+ CAPTION(EnumSet.of(Flag.EXPECT_CONTENT)),
+
+ CENTER,
+
+ CITE(BlockType.INLINE, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
+
+ CODE(BlockType.INLINE, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
+
+ DD(BlockType.BLOCK, EndKind.OPTIONAL,
+ EnumSet.of(Flag.EXPECT_CONTENT)),
+
+ DIV,
+
+ DL(BlockType.BLOCK, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_TEXT),
+ attrs(AttrKind.USE_CSS, COMPACT)),
+
+ DT(BlockType.BLOCK, EndKind.OPTIONAL,
+ EnumSet.of(Flag.EXPECT_CONTENT)),
+
+ EM(BlockType.INLINE, EndKind.REQUIRED,
+ EnumSet.of(Flag.NO_NEST)),
+
+ FONT(BlockType.INLINE, EndKind.REQUIRED, // tag itself is deprecated
+ EnumSet.of(Flag.EXPECT_CONTENT),
+ attrs(AttrKind.USE_CSS, SIZE, COLOR, FACE)),
+
+ FRAME(BlockType.OTHER, EndKind.NONE),
+
+ FRAMESET(BlockType.OTHER, EndKind.REQUIRED),
+
+ H1,
+ H2,
+ H3,
+ H4,
+ H5,
+ H6,
+
+ HEAD(BlockType.OTHER, EndKind.REQUIRED),
+
+ HR(BlockType.BLOCK, EndKind.NONE),
+
+ HTML(BlockType.OTHER, EndKind.REQUIRED),
+
+ I(BlockType.INLINE, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
+
+ IMG(BlockType.INLINE, EndKind.NONE,
+ attrs(AttrKind.OK, SRC, ALT, HEIGHT, WIDTH),
+ attrs(AttrKind.OBSOLETE, NAME),
+ attrs(AttrKind.USE_CSS, ALIGN, HSPACE, VSPACE, BORDER)),
+
+ LI(BlockType.BLOCK, EndKind.OPTIONAL),
+
+ LINK(BlockType.OTHER, EndKind.NONE),
+
+ MENU,
+
+ META(BlockType.OTHER, EndKind.NONE),
+
+ NOFRAMES(BlockType.OTHER, EndKind.REQUIRED),
+
+ NOSCRIPT(BlockType.OTHER, EndKind.REQUIRED),
+
+ OL(BlockType.BLOCK, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_TEXT),
+ attrs(AttrKind.USE_CSS, START, TYPE)),
+
+ P(BlockType.BLOCK, EndKind.OPTIONAL,
+ EnumSet.of(Flag.EXPECT_CONTENT),
+ attrs(AttrKind.USE_CSS, ALIGN)),
+
+ PRE(EnumSet.of(Flag.EXPECT_CONTENT)),
+
+ SCRIPT(BlockType.OTHER, EndKind.REQUIRED),
+
+ SMALL(BlockType.INLINE, EndKind.REQUIRED),
+
+ SPAN(BlockType.INLINE, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT)),
+
+ STRONG(BlockType.INLINE, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT)),
+
+ SUB(BlockType.INLINE, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
+
+ SUP(BlockType.INLINE, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
+
+ TABLE(BlockType.BLOCK, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_TEXT),
+ attrs(AttrKind.OK, SUMMARY, Attr.FRAME, RULES, BORDER,
+ CELLPADDING, CELLSPACING),
+ attrs(AttrKind.USE_CSS, ALIGN, WIDTH, BGCOLOR)),
+
+ TBODY(BlockType.BLOCK, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_TEXT),
+ attrs(AttrKind.OK, ALIGN, CHAR, CHAROFF, VALIGN)),
+
+ TD(BlockType.BLOCK, EndKind.OPTIONAL,
+ attrs(AttrKind.OK, COLSPAN, ROWSPAN, HEADERS, SCOPE, ABBR, AXIS,
+ ALIGN, CHAR, CHAROFF, VALIGN),
+ attrs(AttrKind.USE_CSS, WIDTH, BGCOLOR, HEIGHT, NOWRAP)),
+
+ TFOOT(BlockType.BLOCK, EndKind.REQUIRED,
+ attrs(AttrKind.OK, ALIGN, CHAR, CHAROFF, VALIGN)),
+
+ TH(BlockType.BLOCK, EndKind.OPTIONAL,
+ attrs(AttrKind.OK, COLSPAN, ROWSPAN, HEADERS, SCOPE, ABBR, AXIS,
+ ALIGN, CHAR, CHAROFF, VALIGN),
+ attrs(AttrKind.USE_CSS, WIDTH, BGCOLOR, HEIGHT, NOWRAP)),
+
+ THEAD(BlockType.BLOCK, EndKind.REQUIRED,
+ attrs(AttrKind.OK, ALIGN, CHAR, CHAROFF, VALIGN)),
+
+ TITLE(BlockType.OTHER, EndKind.REQUIRED),
+
+ TR(BlockType.BLOCK, EndKind.OPTIONAL,
+ EnumSet.of(Flag.NO_TEXT),
+ attrs(AttrKind.OK, ALIGN, CHAR, CHAROFF, VALIGN),
+ attrs(AttrKind.USE_CSS, BGCOLOR)),
+
+ TT(BlockType.INLINE, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
+
+ U(BlockType.INLINE, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
+
+ UL(BlockType.BLOCK, EndKind.REQUIRED,
+ EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_TEXT),
+ attrs(AttrKind.USE_CSS, COMPACT, TYPE)),
+
+ VAR(BlockType.INLINE, EndKind.REQUIRED);
+
+ /**
+ * Enum representing the type of HTML element.
+ */
+ public static enum BlockType {
+ BLOCK,
+ INLINE,
+ OTHER;
+ }
+
+ /**
+ * Enum representing HTML end tag requirement.
+ */
+ public static enum EndKind {
+ NONE,
+ OPTIONAL,
+ REQUIRED;
+ }
+
+ public static enum Flag {
+ EXPECT_CONTENT,
+ NO_NEST,
+ NO_TEXT
+ }
+
+ public static enum Attr {
+ ABBR,
+ ALIGN,
+ ALT,
+ AXIS,
+ BGCOLOR,
+ BORDER,
+ CELLSPACING,
+ CELLPADDING,
+ CHAR,
+ CHAROFF,
+ CLEAR,
+ CLASS,
+ COLOR,
+ COLSPAN,
+ COMPACT,
+ FACE,
+ FRAME,
+ HEADERS,
+ HEIGHT,
+ HREF,
+ HSPACE,
+ ID,
+ NAME,
+ NOWRAP,
+ REVERSED,
+ ROWSPAN,
+ RULES,
+ SCOPE,
+ SIZE,
+ SPACE,
+ SRC,
+ START,
+ STYLE,
+ SUMMARY,
+ TARGET,
+ TYPE,
+ VALIGN,
+ VSPACE,
+ WIDTH;
+
+ public String getText() {
+ return name().toLowerCase();
+ }
+
+ static final Map<String,Attr> index = new HashMap<String,Attr>();
+ static {
+ for (Attr t: values()) {
+ index.put(t.name().toLowerCase(), t);
+ }
+ }
+ }
+
+ public static enum AttrKind {
+ INVALID,
+ OBSOLETE,
+ USE_CSS,
+ OK
+ }
+
+ // This class exists to avoid warnings from using parameterized vararg type
+ // Map<Attr,AttrKind> in signature of HtmlTag constructor.
+ private static class AttrMap extends EnumMap<Attr,AttrKind> {
+ private static final long serialVersionUID = 0;
+ AttrMap() {
+ super(Attr.class);
+ }
+ }
+
+
+ public final BlockType blockType;
+ public final EndKind endKind;
+ public final Set<Flag> flags;
+ private final Map<Attr,AttrKind> attrs;
+
+
+ HtmlTag() {
+ this(BlockType.BLOCK, EndKind.REQUIRED);
+ }
+
+ HtmlTag(Set<Flag> flags) {
+ this(BlockType.BLOCK, EndKind.REQUIRED, flags);
+ }
+
+ HtmlTag(BlockType blockType, EndKind endKind, AttrMap... attrMaps) {
+ this(blockType, endKind, Collections.<Flag>emptySet(), attrMaps);
+ }
+
+ HtmlTag(BlockType blockType, EndKind endKind, Set<Flag> flags, AttrMap... attrMaps) {
+ this.blockType = blockType;
+ this.endKind = endKind;this.flags = flags;
+ this.attrs = new EnumMap<Attr,AttrKind>(Attr.class);
+ for (Map<Attr,AttrKind> m: attrMaps)
+ this.attrs.putAll(m);
+ attrs.put(Attr.CLASS, AttrKind.OK);
+ attrs.put(Attr.ID, AttrKind.OK);
+ attrs.put(Attr.STYLE, AttrKind.OK);
+ }
+
+ public String getText() {
+ return name().toLowerCase();
+ }
+
+ public Attr getAttr(Name attrName) {
+ return Attr.index.get(attrName.toString().toLowerCase());
+ }
+
+ public AttrKind getAttrKind(Name attrName) {
+ AttrKind k = attrs.get(getAttr(attrName)); // null-safe
+ return (k == null) ? AttrKind.INVALID : k;
+ }
+
+ private static AttrMap attrs(AttrKind k, Attr... attrs) {
+ AttrMap map = new AttrMap();
+ for (Attr a: attrs) map.put(a, k);
+ return map;
+ }
+
+ private static final Map<String,HtmlTag> index = new HashMap<String,HtmlTag>();
+ static {
+ for (HtmlTag t: values()) {
+ index.put(t.name().toLowerCase(), t);
+ }
+ }
+
+ static HtmlTag get(Name tagName) {
+ return index.get(tagName.toString().toLowerCase());
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclint/Messages.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,348 @@
+/*
+ * Copyright (c) 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.tools.doclint;
+
+import java.io.PrintWriter;
+import java.text.MessageFormat;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+
+import javax.tools.Diagnostic;
+
+import com.sun.source.doctree.DocTree;
+import com.sun.source.tree.Tree;
+import com.sun.tools.doclint.Env.AccessKind;
+
+/**
+ * Message reporting for DocLint.
+ *
+ * Options are used to filter out messages based on group and access level.
+ * Support can be enabled for accumulating statistics of different kinds of
+ * messages.
+ *
+ * <p><b>This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own
+ * risk. This code and its internal interfaces are subject to change
+ * or deletion without notice.</b></p>
+ */
+public class Messages {
+ /**
+ * Groups used to categorize messages, so that messages in each group
+ * can be enabled or disabled via options.
+ */
+ public enum Group {
+ ACCESSIBILITY,
+ HTML,
+ MISSING,
+ SYNTAX,
+ REFERENCE;
+
+ String optName() { return name().toLowerCase(); }
+ String notOptName() { return "-" + optName(); }
+
+ static boolean accepts(String opt) {
+ for (Group g: values())
+ if (opt.equals(g.optName())) return true;
+ return false;
+ }
+ };
+
+ private final Options options;
+ private final Stats stats;
+
+ ResourceBundle bundle;
+ Env env;
+
+ Messages(Env env) {
+ this.env = env;
+ String name = getClass().getPackage().getName() + ".resources.doclint";
+ bundle = ResourceBundle.getBundle(name, Locale.ENGLISH);
+
+ stats = new Stats(bundle);
+ options = new Options(stats);
+ }
+
+ void error(Group group, DocTree tree, String code, Object... args) {
+ report(group, Diagnostic.Kind.ERROR, tree, code, args);
+ }
+
+ void warning(Group group, DocTree tree, String code, Object... args) {
+ report(group, Diagnostic.Kind.WARNING, tree, code, args);
+ }
+
+ void setOptions(String opts) {
+ options.setOptions(opts);
+ }
+
+ void setStatsEnabled(boolean b) {
+ stats.setEnabled(b);
+ }
+
+ void reportStats(PrintWriter out) {
+ stats.report(out);
+ }
+
+ protected void report(Group group, Diagnostic.Kind dkind, DocTree tree, String code, Object... args) {
+ if (options.isEnabled(group, env.currAccess)) {
+ String msg = (code == null) ? (String) args[0] : localize(code, args);
+ env.trees.printMessage(dkind, msg, tree,
+ env.currDocComment, env.currPath.getCompilationUnit());
+
+ stats.record(group, dkind, code);
+ }
+ }
+
+ protected void report(Group group, Diagnostic.Kind dkind, Tree tree, String code, Object... args) {
+ if (options.isEnabled(group, env.currAccess)) {
+ String msg = localize(code, args);
+ env.trees.printMessage(dkind, msg, tree, env.currPath.getCompilationUnit());
+
+ stats.record(group, dkind, code);
+ }
+ }
+
+ String localize(String code, Object... args) {
+ String msg = bundle.getString(code);
+ if (msg == null) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("message file broken: code=").append(code);
+ if (args.length > 0) {
+ sb.append(" arguments={0}");
+ for (int i = 1; i < args.length; i++) {
+ sb.append(", {").append(i).append("}");
+ }
+ }
+ msg = sb.toString();
+ }
+ return MessageFormat.format(msg, args);
+ }
+
+ // <editor-fold defaultstate="collapsed" desc="Options">
+
+ /**
+ * Handler for (sub)options specific to message handling.
+ */
+ static class Options {
+ Map<String, Env.AccessKind> map = new HashMap<String, Env.AccessKind>();
+ private final Stats stats;
+
+ static boolean isValidOptions(String opts) {
+ for (String opt: opts.split(",")) {
+ if (!isValidOption(opt.trim().toLowerCase()))
+ return false;
+ }
+ return true;
+ }
+
+ private static boolean isValidOption(String opt) {
+ if (opt.equals("none") || opt.equals(Stats.OPT))
+ return true;
+
+ int begin = opt.startsWith("-") ? 1 : 0;
+ int sep = opt.indexOf("/");
+ String grp = opt.substring(begin, (sep != -1) ? sep : opt.length());
+ return ((begin == 0 && grp.equals("all")) || Group.accepts(grp))
+ && ((sep == -1) || AccessKind.accepts(opt.substring(sep + 1)));
+ }
+
+ Options(Stats stats) {
+ this.stats = stats;
+ }
+
+ /** Determine if a message group is enabled for a particular access level. */
+ boolean isEnabled(Group g, Env.AccessKind access) {
+ if (map.isEmpty())
+ map.put("all", Env.AccessKind.PROTECTED);
+
+ Env.AccessKind ak = map.get(g.optName());
+ if (ak != null && access.compareTo(ak) >= 0)
+ return true;
+
+ ak = map.get(ALL);
+ if (ak != null && access.compareTo(ak) >= 0) {
+ ak = map.get(g.notOptName());
+ if (ak == null || access.compareTo(ak) > 0) // note >, not >=
+ return true;
+ }
+
+ return false;
+ }
+
+ void setOptions(String opts) {
+ if (opts == null)
+ setOption(ALL, Env.AccessKind.PRIVATE);
+ else {
+ for (String opt: opts.split(","))
+ setOption(opt.trim().toLowerCase());
+ }
+ }
+
+ private void setOption(String arg) throws IllegalArgumentException {
+ if (arg.equals(Stats.OPT)) {
+ stats.setEnabled(true);
+ return;
+ }
+
+ int sep = arg.indexOf("/");
+ if (sep > 0) {
+ Env.AccessKind ak = Env.AccessKind.valueOf(arg.substring(sep + 1).toUpperCase());
+ setOption(arg.substring(0, sep), ak);
+ } else {
+ setOption(arg, null);
+ }
+ }
+
+ private void setOption(String opt, Env.AccessKind ak) {
+ map.put(opt, (ak != null) ? ak
+ : opt.startsWith("-") ? Env.AccessKind.PUBLIC : Env.AccessKind.PRIVATE);
+ }
+
+ private static final String ALL = "all";
+ }
+
+ // </editor-fold>
+
+ // <editor-fold defaultstate="collapsed" desc="Statistics">
+
+ /**
+ * Optionally record statistics of different kinds of message.
+ */
+ static class Stats {
+ public static final String OPT = "stats";
+ public static final String NO_CODE = "";
+ final ResourceBundle bundle;
+
+ // tables only initialized if enabled
+ int[] groupCounts;
+ int[] dkindCounts;
+ Map<String, Integer> codeCounts;
+
+ Stats(ResourceBundle bundle) {
+ this.bundle = bundle;
+ }
+
+ void setEnabled(boolean b) {
+ if (b) {
+ groupCounts = new int[Messages.Group.values().length];
+ dkindCounts = new int[Diagnostic.Kind.values().length];
+ codeCounts = new HashMap<String, Integer>();
+ } else {
+ groupCounts = null;
+ dkindCounts = null;
+ codeCounts = null;
+ }
+ }
+
+ void record(Messages.Group g, Diagnostic.Kind dkind, String code) {
+ if (codeCounts == null) {
+ return;
+ }
+ groupCounts[g.ordinal()]++;
+ dkindCounts[dkind.ordinal()]++;
+ if (code == null) {
+ code = NO_CODE;
+ }
+ Integer i = codeCounts.get(code);
+ codeCounts.put(code, (i == null) ? 1 : i + 1);
+ }
+
+ void report(PrintWriter out) {
+ if (codeCounts == null) {
+ return;
+ }
+ out.println("By group...");
+ Table groupTable = new Table();
+ for (Messages.Group g : Messages.Group.values()) {
+ groupTable.put(g.optName(), groupCounts[g.ordinal()]);
+ }
+ groupTable.print(out);
+ out.println();
+ out.println("By diagnostic kind...");
+ Table dkindTable = new Table();
+ for (Diagnostic.Kind k : Diagnostic.Kind.values()) {
+ dkindTable.put(k.toString().toLowerCase(), dkindCounts[k.ordinal()]);
+ }
+ dkindTable.print(out);
+ out.println();
+ out.println("By message kind...");
+ Table codeTable = new Table();
+ for (Map.Entry<String, Integer> e : codeCounts.entrySet()) {
+ String code = e.getKey();
+ String msg;
+ try {
+ msg = code.equals(NO_CODE) ? "OTHER" : bundle.getString(code);
+ } catch (MissingResourceException ex) {
+ msg = code;
+ }
+ codeTable.put(msg, e.getValue());
+ }
+ codeTable.print(out);
+ }
+
+ /**
+ * A table of (int, String) sorted by decreasing int.
+ */
+ private static class Table {
+
+ private static final Comparator<Integer> DECREASING = new Comparator<Integer>() {
+
+ public int compare(Integer o1, Integer o2) {
+ return o2.compareTo(o1);
+ }
+ };
+ private final TreeMap<Integer, Set<String>> map = new TreeMap<Integer, Set<String>>(DECREASING);
+
+ void put(String label, int n) {
+ if (n == 0) {
+ return;
+ }
+ Set<String> labels = map.get(n);
+ if (labels == null) {
+ map.put(n, labels = new TreeSet<String>());
+ }
+ labels.add(label);
+ }
+
+ void print(PrintWriter out) {
+ for (Map.Entry<Integer, Set<String>> e : map.entrySet()) {
+ int count = e.getKey();
+ Set<String> labels = e.getValue();
+ for (String label : labels) {
+ out.println(String.format("%6d: %s", count, label));
+ }
+ }
+ }
+ }
+ }
+ // </editor-fold>
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclint/resources/doclint.properties Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,65 @@
+#
+# Copyright (c) 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.
+#
+
+dc.anchor.already.defined = anchor already defined: {0}
+dc.attr.lacks.value = attribute lacks value
+dc.attr.obsolete = attribute obsolete: {0}
+dc.attr.obsolete.use.css = attribute obsolete, use CSS instead: {0}
+dc.attr.repeated = repeated attribute: {0}
+dc.attr.unknown = unknown attribute: {0}
+dc.bad.option = bad option: {0}
+dc.bad.value.for.option = bad value for option: {0} {1}
+dc.empty = no description for @{0}
+dc.entity.invalid = invalid entity &{0};
+dc.exception.not.thrown = exception not thrown: {0}
+dc.invalid.anchor = invalid name for anchor: "{0}"
+dc.invalid.param = invalid use of @param
+dc.invalid.return = invalid use of @return
+dc.invalid.throws = invalid use of @throws
+dc.invalid.uri = invalid uri: "{0}"
+dc.missing.comment = no comment
+dc.missing.param = no @param for {0}
+dc.missing.return = no @return
+dc.missing.throws = no @throws for {0}
+dc.no.alt.attr.for.image = no "alt" attribute for image
+dc.no.summary.or.caption.for.table=no summary or caption for table
+dc.param.name.not.found = @param name not found
+dc.ref.not.found = reference not found
+dc.tag.empty = empty <{0}> tag
+dc.tag.end.not.permitted = invalid end tag: </{0}>
+dc.tag.end.unexpected = unexpected end tag: </{0}>
+dc.tag.header.sequence.1 = header used out of sequence: <{0}>
+dc.tag.header.sequence.2 = header used out of sequence: <{0}>
+dc.tag.nested.not.allowed=nested tag not allowed: <{0}>
+dc.tag.not.allowed = element not allowed in documentation comments: <{0}>
+dc.tag.not.allowed.inline.element = block element not allowed within inline element <{1}>: {0}
+dc.tag.not.allowed.inline.tag = block element not allowed within @{1}: {0}
+dc.tag.not.allowed.inline.other = block element not allowed here: {0}
+dc.tag.not.closed= element not closed: {0}
+dc.tag.p.in.pre= unexpected use of <p> inside <pre> element
+dc.tag.self.closing = self-closing element not allowed
+dc.tag.start.unmatched = end tag missing: </{0}>
+dc.tag.unknown = unknown tag: {0}
+dc.text.not.allowed = text not allowed in <{0}> element
--- a/langtools/src/share/classes/com/sun/tools/javac/Server.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/Server.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -49,7 +49,7 @@
private final OutputStream out;
private final boolean isSocket;
private static final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
- private static Logger logger = Logger.getLogger("com.sun.tools.javac");
+ private static final Logger logger = Logger.getLogger("com.sun.tools.javac");
static class CwdFileManager extends ForwardingJavaFileManager<JavaFileManager> {
String cwd;
CwdFileManager(JavaFileManager fileManager) {
@@ -69,7 +69,7 @@
// }
}
// static CwdFileManager fm = new CwdFileManager(tool.getStandardFileManager());
- static StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null);
+ static final StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null);
static {
// Use the same file manager for all compilations. This will
// cache jar files in the standard file manager. Use
--- a/langtools/src/share/classes/com/sun/tools/javac/api/BasicJavacTask.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/BasicJavacTask.java Tue Jan 01 17:49:22 2013 -0800
@@ -57,6 +57,13 @@
protected Context context;
private TaskListener taskListener;
+ public static JavacTask instance(Context context) {
+ JavacTask instance = context.get(JavacTask.class);
+ if (instance == null)
+ instance = new BasicJavacTask(context, true);
+ return instance;
+ }
+
public BasicJavacTask(Context c, boolean register) {
context = c;
if (register)
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -65,7 +65,6 @@
* @author Jonathan Gibbons
*/
public class JavacTaskImpl extends BasicJavacTask {
- private ClientCodeWrapper ccw;
private Main compilerMain;
private JavaCompiler compiler;
private Locale locale;
@@ -85,7 +84,6 @@
Context context,
List<JavaFileObject> fileObjects) {
super(null, false);
- this.ccw = ClientCodeWrapper.instance(context);
this.compilerMain = compilerMain;
this.args = args;
this.classNames = classNames;
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTool.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTool.java Tue Jan 01 17:49:22 2013 -0800
@@ -159,7 +159,7 @@
}
}
- private static void processOptions(Context context,
+ public static void processOptions(Context context,
JavaFileManager fileManager,
Iterable<String> options)
{
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java Tue Jan 01 17:49:22 2013 -0800
@@ -84,6 +84,7 @@
import com.sun.tools.javac.tree.TreeCopier;
import com.sun.tools.javac.tree.TreeInfo;
import com.sun.tools.javac.tree.TreeMaker;
+import com.sun.tools.javac.util.Abort;
import com.sun.tools.javac.util.Assert;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.JCDiagnostic;
@@ -236,19 +237,26 @@
public Element getElement(TreePath path) {
JCTree tree = (JCTree) path.getLeaf();
Symbol sym = TreeInfo.symbolFor(tree);
- if (sym == null && TreeInfo.isDeclaration(tree)) {
- for (TreePath p = path; p != null; p = p.getParentPath()) {
- JCTree t = (JCTree) p.getLeaf();
- if (t.hasTag(JCTree.Tag.CLASSDEF)) {
- JCClassDecl ct = (JCClassDecl) t;
- if (ct.sym != null) {
- if ((ct.sym.flags_field & Flags.UNATTRIBUTED) != 0) {
- attr.attribClass(ct.pos(), ct.sym);
- sym = TreeInfo.symbolFor(tree);
+ if (sym == null) {
+ if (TreeInfo.isDeclaration(tree)) {
+ for (TreePath p = path; p != null; p = p.getParentPath()) {
+ JCTree t = (JCTree) p.getLeaf();
+ if (t.hasTag(JCTree.Tag.CLASSDEF)) {
+ JCClassDecl ct = (JCClassDecl) t;
+ if (ct.sym != null) {
+ if ((ct.sym.flags_field & Flags.UNATTRIBUTED) != 0) {
+ attr.attribClass(ct.pos(), ct.sym);
+ sym = TreeInfo.symbolFor(tree);
+ }
+ break;
}
- break;
}
}
+ } else if (tree.hasTag(Tag.TOPLEVEL)) {
+ JCCompilationUnit cu = (JCCompilationUnit) tree;
+ if (cu.sourcefile.isNameCompatible("package-info", JavaFileObject.Kind.SOURCE)) {
+ sym = cu.packge;
+ }
}
}
return sym;
@@ -332,6 +340,8 @@
} else {
return msym;
}
+ } catch (Abort e) { // may be thrown by Check.completionError in case of bad class file
+ return null;
} finally {
log.popDiagnosticHandler(deferredDiagnosticHandler);
}
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Annotations.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Annotations.java Tue Jan 01 17:49:22 2013 -0800
@@ -74,12 +74,12 @@
*/
private List<Attribute.Compound> attributes = NOT_STARTED;
/*
- * The Symbol this Annotatios belong to
+ * The Symbol this Annotations belong to
*/
- private final Symbol s;
+ private final Symbol sym;
- public Annotations(Symbol s) {
- this.s = s;
+ public Annotations(Symbol sym) {
+ this.sym = sym;
}
public List<Attribute.Compound> getAttributes() {
@@ -102,7 +102,7 @@
}
public void setAttributesWithCompletion(final Annotate.AnnotateRepeatedContext ctx) {
- Assert.check(pendingCompletion() || (!isStarted() && s.kind == PCK));
+ Assert.check(pendingCompletion() || (!isStarted() && sym.kind == PCK));
Map<Symbol.TypeSymbol, ListBuffer<Attribute.Compound>> annotated = ctx.annotated;
boolean atLeastOneRepeated = false;
@@ -111,7 +111,7 @@
if (lb.size() == 1) {
buf = buf.prepend(lb.first());
} else { // repeated
- buf = buf.prepend(new Placeholder(lb.toList(), s));
+ buf = buf.prepend(new Placeholder(lb.toList(), sym));
atLeastOneRepeated = true;
}
}
@@ -141,7 +141,7 @@
@Override
public String toString() {
- return "repeated annotation pass of: " + s + " in: " + s.owner;
+ return "repeated annotation pass of: " + sym + " in: " + sym.owner;
}
@Override
@@ -253,7 +253,7 @@
// Process repeated annotations
Attribute.Compound validRepeated =
- ctx.processRepeatedAnnotations(placeholder.getPlaceholderFor());
+ ctx.processRepeatedAnnotations(placeholder.getPlaceholderFor(), sym);
if (validRepeated != null) {
// Check that the container isn't manually
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java Tue Jan 01 17:49:22 2013 -0800
@@ -60,6 +60,9 @@
throw new UnsupportedOperationException();
}
+ public boolean isSynthesized() {
+ return false;
+ }
/** The value for an annotation element of primitive type or String. */
public static class Constant extends Attribute {
@@ -136,6 +139,18 @@
* access this attribute.
*/
public final List<Pair<MethodSymbol,Attribute>> values;
+
+ private boolean synthesized = false;
+
+ @Override
+ public boolean isSynthesized() {
+ return synthesized;
+ }
+
+ public void setSynthesized(boolean synthesized) {
+ this.synthesized = synthesized;
+ }
+
public Compound(Type type,
List<Pair<MethodSymbol,Attribute>> values) {
super(type);
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java Tue Jan 01 17:49:22 2013 -0800
@@ -307,7 +307,7 @@
}
// Cache of modifier sets.
- private static Map<Long, Set<Modifier>> modifierSets =
+ private static final Map<Long, Set<Modifier>> modifierSets =
new java.util.concurrent.ConcurrentHashMap<Long, Set<Modifier>>(64);
public static boolean isStatic(Symbol symbol) {
@@ -356,7 +356,7 @@
VARARGS("varargs"),
PACKAGE("package");
- String name;
+ private final String name;
Flag(String name) {
this.name = name;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java Tue Jan 01 17:49:22 2013 -0800
@@ -110,7 +110,7 @@
INSTANCE_INIT("kindname.instance.init"),
PACKAGE("kindname.package");
- private String name;
+ private final String name;
KindName(String name) {
this.name = name;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Lint.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Lint.java Tue Jan 01 17:49:22 2013 -0800
@@ -28,11 +28,14 @@
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
+import java.util.Set;
+import javax.lang.model.element.Modifier;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.Options;
import com.sun.tools.javac.util.Pair;
+
import static com.sun.tools.javac.code.Flags.*;
@@ -95,7 +98,8 @@
private final EnumSet<LintCategory> values;
private final EnumSet<LintCategory> suppressedValues;
- private static Map<String, LintCategory> map = new HashMap<String,LintCategory>();
+ private static final Map<String, LintCategory> map =
+ new java.util.concurrent.ConcurrentHashMap<String, LintCategory>(20);
protected Lint(Context context) {
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Source.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Source.java Tue Jan 01 17:49:22 2013 -0800
@@ -87,7 +87,7 @@
public final String name;
- private static Map<String,Source> tab = new HashMap<String,Source>();
+ private static final Map<String,Source> tab = new HashMap<String,Source>();
static {
for (Source s : values()) {
tab.put(s.name, s);
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java Tue Jan 01 17:49:22 2013 -0800
@@ -83,13 +83,13 @@
* Attributes of class symbols should be accessed through the accessor
* method to make sure that the class symbol is loaded.
*/
- public List<Attribute.Compound> getAnnotationMirrors() {
- return Assert.checkNonNull(annotations.getAttributes());
+ public List<Attribute.Compound> getRawAttributes() {
+ return annotations.getAttributes();
}
/** Fetch a particular annotation from a symbol. */
public Attribute.Compound attribute(Symbol anno) {
- for (Attribute.Compound a : getAnnotationMirrors()) {
+ for (Attribute.Compound a : getRawAttributes()) {
if (a.type.tsym == anno) return a;
}
return null;
@@ -447,6 +447,14 @@
}
/**
+ * This is the implementation for {@code
+ * javax.lang.model.element.Element.getAnnotationMirrors()}.
+ */
+ public final List<Attribute.Compound> getAnnotationMirrors() {
+ return getRawAttributes();
+ }
+
+ /**
* @deprecated this method should never be used by javac internally.
*/
@Deprecated
@@ -662,15 +670,21 @@
return flags_field;
}
- public List<Attribute.Compound> getAnnotationMirrors() {
+ @Override
+ public List<Attribute.Compound> getRawAttributes() {
if (completer != null) complete();
if (package_info != null && package_info.completer != null) {
package_info.complete();
- if (annotations.isEmpty()) {
- annotations.setAttributes(package_info.annotations);
+ mergeAttributes();
}
+ return super.getRawAttributes();
+ }
+
+ private void mergeAttributes() {
+ if (annotations.isEmpty() &&
+ !package_info.annotations.isEmpty()) {
+ annotations.setAttributes(package_info.annotations);
}
- return Assert.checkNonNull(annotations.getAttributes());
}
/** A package "exists" if a type or package that exists has
@@ -770,9 +784,10 @@
return members_field;
}
- public List<Attribute.Compound> getAnnotationMirrors() {
+ @Override
+ public List<Attribute.Compound> getRawAttributes() {
if (completer != null) complete();
- return Assert.checkNonNull(annotations.getAttributes());
+ return super.getRawAttributes();
}
public Type erasure(Types types) {
@@ -1353,7 +1368,7 @@
return defaultValue;
}
- public List<VarSymbol> getParameters() {
+ public List<VarSymbol> getParameters() {
return params();
}
@@ -1361,6 +1376,10 @@
return (flags() & VARARGS) != 0;
}
+ public boolean isDefault() {
+ return (flags() & DEFAULT) != 0;
+ }
+
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
return v.visitExecutable(this, p);
}
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TargetType.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TargetType.java Tue Jan 01 17:49:22 2013 -0800
@@ -166,7 +166,7 @@
static final int MAXIMUM_TARGET_TYPE_VALUE = 0x22;
private final int targetTypeValue;
- private Set<TargetAttribute> flags;
+ private final Set<TargetAttribute> flags;
TargetType(int targetTypeValue, TargetAttribute... attributes) {
if (targetTypeValue < Byte.MIN_VALUE
@@ -233,10 +233,10 @@
return this.targetTypeValue;
}
- private static TargetType[] targets = null;
+ private static final TargetType[] targets;
- private static TargetType[] buildTargets() {
- TargetType[] targets = new TargetType[MAXIMUM_TARGET_TYPE_VALUE + 1];
+ static {
+ targets = new TargetType[MAXIMUM_TARGET_TYPE_VALUE + 1];
TargetType[] alltargets = values();
for (TargetType target : alltargets) {
if (target.targetTypeValue >= 0)
@@ -246,13 +246,9 @@
if (targets[i] == null)
targets[i] = UNKNOWN;
}
- return targets;
}
public static boolean isValidTargetTypeValue(int tag) {
- if (targets == null)
- targets = buildTargets();
-
if (((byte)tag) == ((byte)UNKNOWN.targetTypeValue))
return true;
@@ -260,9 +256,6 @@
}
public static TargetType fromTargetTypeValue(int tag) {
- if (targets == null)
- targets = buildTargets();
-
if (((byte)tag) == ((byte)UNKNOWN.targetTypeValue))
return UNKNOWN;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Type.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Type.java Tue Jan 01 17:49:22 2013 -0800
@@ -302,10 +302,12 @@
* never complete classes. Where isSameType would complete a
* class, equals assumes that the two types are different.
*/
+ @Override
public boolean equals(Object t) {
return super.equals(t);
}
+ @Override
public int hashCode() {
return super.hashCode();
}
@@ -996,34 +998,6 @@
return "(" + argtypes + ")" + restype;
}
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof MethodType))
- return false;
- MethodType m = (MethodType)obj;
- List<Type> args1 = argtypes;
- List<Type> args2 = m.argtypes;
- while (!args1.isEmpty() && !args2.isEmpty()) {
- if (!args1.head.equals(args2.head))
- return false;
- args1 = args1.tail;
- args2 = args2.tail;
- }
- if (!args1.isEmpty() || !args2.isEmpty())
- return false;
- return restype.equals(m.restype);
- }
-
- public int hashCode() {
- int h = METHOD.ordinal();
- for (List<Type> thisargs = this.argtypes;
- thisargs.tail != null; /*inlined: thisargs.nonEmpty()*/
- thisargs = thisargs.tail)
- h = (h << 5) + thisargs.head.hashCode();
- return (h << 5) + this.restype.hashCode();
- }
-
public List<Type> getParameterTypes() { return argtypes; }
public Type getReturnType() { return restype; }
public List<Type> getThrownTypes() { return thrown; }
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeTag.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeTag.java Tue Jan 01 17:49:22 2013 -0800
@@ -135,9 +135,11 @@
/** This field will only be used for tags related with numeric types for
* optimization reasons.
*/
- private int order = 0;
+ private final int order;
- private TypeTag() {}
+ private TypeTag() {
+ this(0);
+ }
private TypeTag(int order) {
this.order = order;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java Tue Jan 01 17:49:22 2013 -0800
@@ -1007,11 +1007,11 @@
if (!visit(supertype(t), supertype(s)))
return false;
- HashSet<SingletonType> set = new HashSet<SingletonType>();
+ HashSet<UniqueType> set = new HashSet<UniqueType>();
for (Type x : interfaces(t))
- set.add(new SingletonType(x));
+ set.add(new UniqueType(x, Types.this));
for (Type x : interfaces(s)) {
- if (!set.remove(new SingletonType(x)))
+ if (!set.remove(new UniqueType(x, Types.this)))
return false;
}
return (set.isEmpty());
@@ -2849,7 +2849,7 @@
}
return tvars1;
}
- static private Mapping newInstanceFun = new Mapping("newInstanceFun") {
+ private static final Mapping newInstanceFun = new Mapping("newInstanceFun") {
public Type apply(Type t) { return new TypeVar(t.tsym, t.getUpperBound(), t.getLowerBound()); }
};
// </editor-fold>
@@ -3137,7 +3137,7 @@
}
@Override
public int hashCode() {
- return 127 * Types.hashCode(t1) + Types.hashCode(t2);
+ return 127 * Types.this.hashCode(t1) + Types.this.hashCode(t2);
}
@Override
public boolean equals(Object obj) {
@@ -3400,7 +3400,7 @@
/**
* Compute a hash code on a type.
*/
- public static int hashCode(Type t) {
+ public int hashCode(Type t) {
return hashCode.visit(t);
}
// where
@@ -3423,6 +3423,16 @@
}
@Override
+ public Integer visitMethodType(MethodType t, Void ignored) {
+ int h = METHOD.ordinal();
+ for (List<Type> thisargs = t.argtypes;
+ thisargs.tail != null;
+ thisargs = thisargs.tail)
+ h = (h << 5) + visit(thisargs.head);
+ return (h << 5) + visit(t.restype);
+ }
+
+ @Override
public Integer visitWildcardType(WildcardType t, Void ignored) {
int result = t.kind.hashCode();
if (t.type != null) {
@@ -4082,21 +4092,28 @@
/**
* A wrapper for a type that allows use in sets.
*/
- class SingletonType {
- final Type t;
- SingletonType(Type t) {
- this.t = t;
- }
- public int hashCode() {
- return Types.hashCode(t);
+ public static class UniqueType {
+ public final Type type;
+ final Types types;
+
+ public UniqueType(Type type, Types types) {
+ this.type = type;
+ this.types = types;
}
- public boolean equals(Object obj) {
- return (obj instanceof SingletonType) &&
- isSameType(t, ((SingletonType)obj).t);
+
+ public int hashCode() {
+ return types.hashCode(type);
}
+
+ public boolean equals(Object obj) {
+ return (obj instanceof UniqueType) &&
+ types.isSameType(type, ((UniqueType)obj).type);
+ }
+
public String toString() {
- return t.toString();
+ return type.toString();
}
+
}
// </editor-fold>
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,6 @@
package com.sun.tools.javac.comp;
import java.util.Map;
-
import com.sun.tools.javac.util.*;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
import com.sun.tools.javac.code.*;
@@ -171,8 +170,8 @@
* @param repeatingAnnotations a List of repeating annotations
* @return a new Attribute.Compound that is the container for the repeatingAnnotations
*/
- public Attribute.Compound processRepeatedAnnotations(List<Attribute.Compound> repeatingAnnotations) {
- return Annotate.this.processRepeatedAnnotations(repeatingAnnotations, this);
+ public Attribute.Compound processRepeatedAnnotations(List<Attribute.Compound> repeatingAnnotations, Symbol sym) {
+ return Annotate.this.processRepeatedAnnotations(repeatingAnnotations, this, sym);
}
/**
@@ -339,10 +338,11 @@
* annotation are invalid. This method reports errors/warnings.
*/
private Attribute.Compound processRepeatedAnnotations(List<Attribute.Compound> annotations,
- AnnotateRepeatedContext ctx) {
+ AnnotateRepeatedContext ctx,
+ Symbol on) {
Attribute.Compound firstOccurrence = annotations.head;
List<Attribute> repeated = List.nil();
- Type origAnnoType;
+ Type origAnnoType = null;
Type arrayOfOrigAnnoType = null;
Type targetContainerType = null;
MethodSymbol containerValueSymbol = null;
@@ -390,9 +390,17 @@
new Attribute.Array(arrayOfOrigAnnoType, repeated));
annoTree = m.Annotation(new Attribute.Compound(targetContainerType,
List.of(p)));
+
+ if (!chk.annotationApplicable(annoTree, on))
+ log.error(annoTree.pos(), "invalid.containedby.annotation.incompatible.target", targetContainerType, origAnnoType);
+
+ if (!chk.validateAnnotationDeferErrors(annoTree))
+ log.error(annoTree.pos(), "duplicate.annotation.invalid.repeated", origAnnoType);
+
Attribute.Compound c = enterAnnotation(annoTree,
targetContainerType,
ctx.env);
+ c.setSynthesized(true);
return c;
} else {
return null; // errors should have been reported elsewhere
@@ -410,7 +418,7 @@
// annotation's declaration, or null if it has none
Attribute.Compound ca = origAnnoDecl.attribute(syms.containedByType.tsym);
if (ca == null) { // has no ContainedBy annotation
- log.error(pos, "duplicate.annotation.missing.container", origAnnoType);
+ log.error(pos, "duplicate.annotation.missing.container", origAnnoType, syms.containedByType);
return null;
}
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Tue Jan 01 17:49:22 2013 -0800
@@ -1405,7 +1405,8 @@
Type owntype = standaloneConditional ? condType(tree, truetype, falsetype) : pt();
if (condtype.constValue() != null &&
truetype.constValue() != null &&
- falsetype.constValue() != null) {
+ falsetype.constValue() != null &&
+ !owntype.hasTag(NONE)) {
//constant folding
owntype = cfolder.coerce(condtype.isTrue() ? truetype : falsetype, owntype);
}
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Tue Jan 01 17:49:22 2013 -0800
@@ -1833,13 +1833,15 @@
for (Scope.Entry e1 = t1.tsym.members().elems; e1 != null; e1 = e1.sibling) {
Symbol s1 = e1.sym;
Type st1 = null;
- if (s1.kind != MTH || !s1.isInheritedIn(site.tsym, types)) continue;
+ if (s1.kind != MTH || !s1.isInheritedIn(site.tsym, types) ||
+ (s1.flags() & SYNTHETIC) != 0) continue;
Symbol impl = ((MethodSymbol)s1).implementation(site.tsym, types, false);
if (impl != null && (impl.flags() & ABSTRACT) == 0) continue;
for (Scope.Entry e2 = t2.tsym.members().lookup(s1.name); e2.scope != null; e2 = e2.next()) {
Symbol s2 = e2.sym;
if (s1 == s2) continue;
- if (s2.kind != MTH || !s2.isInheritedIn(site.tsym, types)) continue;
+ if (s2.kind != MTH || !s2.isInheritedIn(site.tsym, types) ||
+ (s2.flags() & SYNTHETIC) != 0) continue;
if (st1 == null) st1 = types.memberType(t1, s1);
Type st2 = types.memberType(t2, s2);
if (types.overrideEquivalent(st1, st2)) {
@@ -2890,39 +2892,54 @@
}
/** Check an annotation value.
+ *
+ * @param a The annotation tree to check
+ * @return true if this annotation tree is valid, otherwise false
*/
- public void validateAnnotation(JCAnnotation a) {
- // collect an inventory of the members (sorted alphabetically)
- Set<MethodSymbol> members = new TreeSet<MethodSymbol>(new Comparator<Symbol>() {
- public int compare(Symbol t, Symbol t1) {
- return t.name.compareTo(t1.name);
- }
- });
+ public boolean validateAnnotationDeferErrors(JCAnnotation a) {
+ boolean res = false;
+ final Log.DiagnosticHandler diagHandler = new Log.DiscardDiagnosticHandler(log);
+ try {
+ res = validateAnnotation(a);
+ } finally {
+ log.popDiagnosticHandler(diagHandler);
+ }
+ return res;
+ }
+
+ private boolean validateAnnotation(JCAnnotation a) {
+ boolean isValid = true;
+ // collect an inventory of the annotation elements
+ Set<MethodSymbol> members = new LinkedHashSet<MethodSymbol>();
for (Scope.Entry e = a.annotationType.type.tsym.members().elems;
e != null;
e = e.sibling)
if (e.sym.kind == MTH)
members.add((MethodSymbol) e.sym);
- // count them off as they're annotated
+ // remove the ones that are assigned values
for (JCTree arg : a.args) {
if (!arg.hasTag(ASSIGN)) continue; // recovery
JCAssign assign = (JCAssign) arg;
Symbol m = TreeInfo.symbol(assign.lhs);
if (m == null || m.type.isErroneous()) continue;
- if (!members.remove(m))
+ if (!members.remove(m)) {
+ isValid = false;
log.error(assign.lhs.pos(), "duplicate.annotation.member.value",
m.name, a.type);
+ }
}
// all the remaining ones better have default values
- ListBuffer<Name> missingDefaults = ListBuffer.lb();
+ List<Name> missingDefaults = List.nil();
for (MethodSymbol m : members) {
if (m.defaultValue == null && !m.type.isErroneous()) {
- missingDefaults.append(m.name);
+ missingDefaults = missingDefaults.append(m.name);
}
}
+ missingDefaults = missingDefaults.reverse();
if (missingDefaults.nonEmpty()) {
+ isValid = false;
String key = (missingDefaults.size() > 1)
? "annotation.missing.default.value.1"
: "annotation.missing.default.value";
@@ -2933,21 +2950,23 @@
// repeated values in its value member
if (a.annotationType.type.tsym != syms.annotationTargetType.tsym ||
a.args.tail == null)
- return;
+ return isValid;
- if (!a.args.head.hasTag(ASSIGN)) return; // error recovery
+ if (!a.args.head.hasTag(ASSIGN)) return false; // error recovery
JCAssign assign = (JCAssign) a.args.head;
Symbol m = TreeInfo.symbol(assign.lhs);
- if (m.name != names.value) return;
+ if (m.name != names.value) return false;
JCTree rhs = assign.rhs;
- if (!rhs.hasTag(NEWARRAY)) return;
+ if (!rhs.hasTag(NEWARRAY)) return false;
JCNewArray na = (JCNewArray) rhs;
Set<Symbol> targets = new HashSet<Symbol>();
for (JCTree elem : na.elems) {
if (!targets.add(TreeInfo.symbol(elem))) {
+ isValid = false;
log.error(elem.pos(), "repeated.annotation.target");
}
}
+ return isValid;
}
void checkDeprecatedAnnotation(DiagnosticPosition pos, Symbol s) {
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/ConstFold.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/ConstFold.java Tue Jan 01 17:49:22 2013 -0800
@@ -62,9 +62,9 @@
syms = Symtab.instance(context);
}
- static Integer minusOne = -1;
- static Integer zero = 0;
- static Integer one = 1;
+ static final Integer minusOne = -1;
+ static final Integer zero = 0;
+ static final Integer one = 1;
/** Convert boolean to integer (true = 1, false = 0).
*/
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java Tue Jan 01 17:49:22 2013 -0800
@@ -246,8 +246,8 @@
*/
SPECULATIVE_LOOP("var.might.be.assigned.in.loop", true);
- String errKey;
- boolean isFinal;
+ final String errKey;
+ final boolean isFinal;
FlowKind(String errKey, boolean isFinal) {
this.errKey = errKey;
@@ -295,7 +295,7 @@
}
};
- JCTree.Tag treeTag;
+ final JCTree.Tag treeTag;
private JumpKind(Tag treeTag) {
this.treeTag = treeTag;
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Tue Jan 01 17:49:22 2013 -0800
@@ -692,8 +692,9 @@
//determine the static bsm args
Type mtype = makeFunctionalDescriptorType(targetType, true);
List<Object> staticArgs = List.<Object>of(
- new Pool.MethodHandle(ClassFile.REF_invokeInterface, types.findDescriptorSymbol(targetType.tsym)),
- new Pool.MethodHandle(refKind, refSym),
+ new Pool.MethodHandle(ClassFile.REF_invokeInterface,
+ types.findDescriptorSymbol(targetType.tsym), types),
+ new Pool.MethodHandle(refKind, refSym, types),
new MethodType(mtype.getParameterTypes(),
mtype.getReturnType(),
mtype.getThrownTypes(),
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java Tue Jan 01 17:49:22 2013 -0800
@@ -156,7 +156,7 @@
OBJECT_INIT("object-init"),
INTERNAL("internal");
- String opt;
+ final String opt;
private VerboseResolutionMode(String opt) {
this.opt = opt;
@@ -1798,6 +1798,9 @@
if ((kind & TYP) != 0) {
sym = findType(env, name);
+ if (sym.kind==TYP) {
+ reportDependence(env.enclClass.sym, sym);
+ }
if (sym.exists()) return sym;
else if (sym.kind < bestSoFar.kind) bestSoFar = sym;
}
@@ -1806,6 +1809,14 @@
else return bestSoFar;
}
+ /** Report dependencies.
+ * @param from The enclosing class sym
+ * @param to The found identifier that the class depends on.
+ */
+ public void reportDependence(Symbol from, Symbol to) {
+ // Override if you want to collect the reported dependencies.
+ }
+
/** Find an identifier in a package which matches a specified kind set.
* @param env The current environment.
* @param name The identifier's name.
@@ -3064,16 +3075,20 @@
if (hasLocation) {
return diags.create(dkind, log.currentSource(), pos,
errKey, kindname, idname, //symbol kindname, name
- typeargtypes, argtypes, //type parameters and arguments (if any)
+ typeargtypes, args(argtypes), //type parameters and arguments (if any)
getLocationDiag(location, site)); //location kindname, type
}
else {
return diags.create(dkind, log.currentSource(), pos,
errKey, kindname, idname, //symbol kindname, name
- typeargtypes, argtypes); //type parameters and arguments (if any)
+ typeargtypes, args(argtypes)); //type parameters and arguments (if any)
}
}
//where
+ private Object args(List<Type> args) {
+ return args.isEmpty() ? args : methodArguments(args);
+ }
+
private String getErrorKey(KindName kindname, boolean hasTypeArgs, boolean hasLocation) {
String key = "cant.resolve";
String suffix = hasLocation ? ".location" : "";
@@ -3381,8 +3396,8 @@
}
};
- boolean isBoxingRequired;
- boolean isVarargsRequired;
+ final boolean isBoxingRequired;
+ final boolean isVarargsRequired;
MethodResolutionPhase(boolean isBoxingRequired, boolean isVarargsRequired) {
this.isBoxingRequired = isBoxingRequired;
--- a/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java Tue Jan 01 17:49:22 2013 -0800
@@ -83,7 +83,7 @@
public final static long NOT_MODIFIED = Long.MIN_VALUE;
- private static boolean NON_BATCH_MODE = System.getProperty("nonBatchMode") != null;// TODO: Use -XD compiler switch for this.
+ private static final boolean NON_BATCH_MODE = System.getProperty("nonBatchMode") != null;// TODO: Use -XD compiler switch for this.
private Map<RelativeDirectory, DirectoryEntry> directories =
Collections.<RelativeDirectory, DirectoryEntry>emptyMap();
@@ -548,17 +548,15 @@
}
if (i >= 0) {
- zipDir = new byte[get4ByteLittleEndian(endbuf, i + 12) + 2];
- zipDir[0] = endbuf[i + 10];
- zipDir[1] = endbuf[i + 11];
+ zipDir = new byte[get4ByteLittleEndian(endbuf, i + 12)];
int sz = get4ByteLittleEndian(endbuf, i + 16);
// a negative offset or the entries field indicates a
// potential zip64 archive
- if (sz < 0 || get2ByteLittleEndian(zipDir, 0) == 0xffff) {
+ if (sz < 0 || get2ByteLittleEndian(endbuf, i + 10) == 0xffff) {
throw new ZipFormatException("detected a zip64 archive");
}
zipRandomFile.seek(start + sz);
- zipRandomFile.readFully(zipDir, 2, zipDir.length - 2);
+ zipRandomFile.readFully(zipDir, 0, zipDir.length);
return;
} else {
endbufend = endbufpos + 21;
@@ -568,14 +566,13 @@
}
private void buildIndex() throws IOException {
- int entryCount = get2ByteLittleEndian(zipDir, 0);
+ int len = zipDir.length;
// Add each of the files
- if (entryCount > 0) {
+ if (len > 0) {
directories = new LinkedHashMap<RelativeDirectory, DirectoryEntry>();
ArrayList<Entry> entryList = new ArrayList<Entry>();
- int pos = 2;
- for (int i = 0; i < entryCount; i++) {
+ for (int pos = 0; pos < len; ) {
pos = readEntry(pos, entryList, directories);
}
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,6 +26,8 @@
package com.sun.tools.javac.jvm;
import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Types;
+import com.sun.tools.javac.code.Types.UniqueType;
import com.sun.tools.javac.util.Name;
@@ -166,22 +168,29 @@
*/
public static class NameAndType {
Name name;
- Type type;
+ UniqueType uniqueType;
+ Types types;
- NameAndType(Name name, Type type) {
+ NameAndType(Name name, Type type, Types types) {
this.name = name;
- this.type = type;
+ this.uniqueType = new UniqueType(type, types);
+ this.types = types;
}
- public boolean equals(Object other) {
- return
- other instanceof NameAndType &&
- name == ((NameAndType) other).name &&
- type.equals(((NameAndType) other).type);
+ void setType(Type type) {
+ this.uniqueType = new UniqueType(type, types);
}
+ @Override
+ public boolean equals(Object other) {
+ return (other instanceof NameAndType &&
+ name == ((NameAndType) other).name &&
+ uniqueType.equals(((NameAndType) other).uniqueType));
+ }
+
+ @Override
public int hashCode() {
- return name.hashCode() * type.hashCode();
+ return name.hashCode() * uniqueType.hashCode();
}
}
}
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Tue Jan 01 17:49:22 2013 -0800
@@ -488,20 +488,20 @@
case CONSTANT_Fieldref: {
ClassSymbol owner = readClassSymbol(getChar(index + 1));
NameAndType nt = (NameAndType)readPool(getChar(index + 3));
- poolObj[i] = new VarSymbol(0, nt.name, nt.type, owner);
+ poolObj[i] = new VarSymbol(0, nt.name, nt.uniqueType.type, owner);
break;
}
case CONSTANT_Methodref:
case CONSTANT_InterfaceMethodref: {
ClassSymbol owner = readClassSymbol(getChar(index + 1));
NameAndType nt = (NameAndType)readPool(getChar(index + 3));
- poolObj[i] = new MethodSymbol(0, nt.name, nt.type, owner);
+ poolObj[i] = new MethodSymbol(0, nt.name, nt.uniqueType.type, owner);
break;
}
case CONSTANT_NameandType:
poolObj[i] = new NameAndType(
readName(getChar(index + 1)),
- readType(getChar(index + 3)));
+ readType(getChar(index + 3)), types);
break;
case CONSTANT_Integer:
poolObj[i] = getInt(index + 1);
@@ -1224,7 +1224,7 @@
if (nt == null)
return null;
- MethodType type = nt.type.asMethodType();
+ MethodType type = nt.uniqueType.type.asMethodType();
for (Scope.Entry e = scope.lookup(nt.name); e.scope != null; e = e.next())
if (e.sym.kind == MTH && isSameBinaryType(e.sym.type.asMethodType(), type))
@@ -1236,16 +1236,16 @@
if ((flags & INTERFACE) != 0)
// no enclosing instance
return null;
- if (nt.type.getParameterTypes().isEmpty())
+ if (nt.uniqueType.type.getParameterTypes().isEmpty())
// no parameters
return null;
// A constructor of an inner class.
// Remove the first argument (the enclosing instance)
- nt.type = new MethodType(nt.type.getParameterTypes().tail,
- nt.type.getReturnType(),
- nt.type.getThrownTypes(),
- syms.methodClass);
+ nt.setType(new MethodType(nt.uniqueType.type.getParameterTypes().tail,
+ nt.uniqueType.type.getReturnType(),
+ nt.uniqueType.type.getThrownTypes(),
+ syms.methodClass));
// Try searching again
return findMethod(nt, scope, flags);
}
@@ -1360,6 +1360,16 @@
void attachAnnotationDefault(final Symbol sym) {
final MethodSymbol meth = (MethodSymbol)sym; // only on methods
final Attribute value = readAttributeValue();
+
+ // The default value is set later during annotation. It might
+ // be the case that the Symbol sym is annotated _after_ the
+ // repeating instances that depend on this default value,
+ // because of this we set an interim value that tells us this
+ // element (most likely) has a default.
+ //
+ // Set interim value for now, reset just before we do this
+ // properly at annotate time.
+ meth.defaultValue = value;
annotate.normal(new AnnotationDefaultCompleter(meth, value));
}
@@ -1680,6 +1690,9 @@
public void enterAnnotation() {
JavaFileObject previousClassFile = currentClassFile;
try {
+ // Reset the interim value set earlier in
+ // attachAnnotationDefault().
+ sym.defaultValue = null;
currentClassFile = classFile;
sym.defaultValue = deproxy(sym.type.getReturnType(), value);
} finally {
@@ -1946,7 +1959,7 @@
if (readAllOfClassFile) {
for (int i = 1; i < poolObj.length; i++) readPool(i);
- c.pool = new Pool(poolObj.length, poolObj);
+ c.pool = new Pool(poolObj.length, poolObj, types);
}
// reset and read rest of classinfo
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java Tue Jan 01 17:49:22 2013 -0800
@@ -39,7 +39,12 @@
import com.sun.tools.javac.code.Attribute.RetentionPolicy;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.code.Type.*;
+import com.sun.tools.javac.code.Types.UniqueType;
import com.sun.tools.javac.file.BaseFileObject;
+import com.sun.tools.javac.jvm.Pool.DynamicMethod;
+import com.sun.tools.javac.jvm.Pool.Method;
+import com.sun.tools.javac.jvm.Pool.MethodHandle;
+import com.sun.tools.javac.jvm.Pool.Variable;
import com.sun.tools.javac.util.*;
import static com.sun.tools.javac.code.BoundKind.*;
@@ -142,7 +147,7 @@
/** The bootstrap methods to be written in the corresponding class attribute
* (one for each invokedynamic)
*/
- Map<MethodSymbol, Pool.MethodHandle> bootstrapMethods;
+ Map<DynamicMethod, MethodHandle> bootstrapMethods;
/** The log to use for verbose output.
*/
@@ -477,10 +482,10 @@
while (i < pool.pp) {
Object value = pool.pool[i];
Assert.checkNonNull(value);
- if (value instanceof Pool.Method)
- value = ((Pool.Method)value).m;
- else if (value instanceof Pool.Variable)
- value = ((Pool.Variable)value).v;
+ if (value instanceof Method)
+ value = ((Method)value).m;
+ else if (value instanceof Variable)
+ value = ((Variable)value).v;
if (value instanceof MethodSymbol) {
MethodSymbol m = (MethodSymbol)value;
@@ -493,8 +498,9 @@
} else {
//invokedynamic
DynamicMethodSymbol dynSym = (DynamicMethodSymbol)m;
- Pool.MethodHandle handle = new Pool.MethodHandle(dynSym.bsmKind, dynSym.bsm);
- bootstrapMethods.put(dynSym, handle);
+ MethodHandle handle = new MethodHandle(dynSym.bsmKind, dynSym.bsm, types);
+ DynamicMethod dynMeth = new DynamicMethod(dynSym, types);
+ bootstrapMethods.put(dynMeth, handle);
//init cp entries
pool.put(names.BootstrapMethods);
pool.put(handle);
@@ -531,7 +537,7 @@
NameAndType nt = (NameAndType)value;
poolbuf.appendByte(CONSTANT_NameandType);
poolbuf.appendChar(pool.put(nt.name));
- poolbuf.appendChar(pool.put(typeSig(nt.type)));
+ poolbuf.appendChar(pool.put(typeSig(nt.uniqueType.type)));
} else if (value instanceof Integer) {
poolbuf.appendByte(CONSTANT_Integer);
poolbuf.appendInt(((Integer)value).intValue());
@@ -549,17 +555,18 @@
} else if (value instanceof String) {
poolbuf.appendByte(CONSTANT_String);
poolbuf.appendChar(pool.put(names.fromString((String)value)));
- } else if (value instanceof MethodType) {
- MethodType mtype = (MethodType)value;
- poolbuf.appendByte(CONSTANT_MethodType);
- poolbuf.appendChar(pool.put(typeSig(mtype)));
- } else if (value instanceof Type) {
- Type type = (Type)value;
- if (type.hasTag(CLASS)) enterInner((ClassSymbol)type.tsym);
- poolbuf.appendByte(CONSTANT_Class);
- poolbuf.appendChar(pool.put(xClassName(type)));
- } else if (value instanceof Pool.MethodHandle) {
- Pool.MethodHandle ref = (Pool.MethodHandle)value;
+ } else if (value instanceof UniqueType) {
+ Type type = ((UniqueType)value).type;
+ if (type instanceof MethodType) {
+ poolbuf.appendByte(CONSTANT_MethodType);
+ poolbuf.appendChar(pool.put(typeSig((MethodType)type)));
+ } else {
+ if (type.hasTag(CLASS)) enterInner((ClassSymbol)type.tsym);
+ poolbuf.appendByte(CONSTANT_Class);
+ poolbuf.appendChar(pool.put(xClassName(type)));
+ }
+ } else if (value instanceof MethodHandle) {
+ MethodHandle ref = (MethodHandle)value;
poolbuf.appendByte(CONSTANT_MethodHandle);
poolbuf.appendByte(ref.refKind);
poolbuf.appendChar(pool.put(ref.refSym));
@@ -589,7 +596,7 @@
return new NameAndType(fieldName(sym),
retrofit
? sym.erasure(types)
- : sym.externalType(types));
+ : sym.externalType(types), types);
// if we retrofit, then the NameAndType has been read in as is
// and no change is necessary. If we compile normally, the
// NameAndType is generated from a symbol reference, and the
@@ -714,7 +721,7 @@
endAttr(alenIdx);
acount++;
}
- acount += writeJavaAnnotations(sym.getAnnotationMirrors());
+ acount += writeJavaAnnotations(sym.getRawAttributes());
return acount;
}
@@ -725,7 +732,7 @@
boolean hasVisible = false;
boolean hasInvisible = false;
if (m.params != null) for (VarSymbol s : m.params) {
- for (Attribute.Compound a : s.getAnnotationMirrors()) {
+ for (Attribute.Compound a : s.getRawAttributes()) {
switch (types.getRetention(a)) {
case SOURCE: break;
case CLASS: hasInvisible = true; break;
@@ -741,7 +748,7 @@
databuf.appendByte(m.params.length());
for (VarSymbol s : m.params) {
ListBuffer<Attribute.Compound> buf = new ListBuffer<Attribute.Compound>();
- for (Attribute.Compound a : s.getAnnotationMirrors())
+ for (Attribute.Compound a : s.getRawAttributes())
if (types.getRetention(a) == RetentionPolicy.RUNTIME)
buf.append(a);
databuf.appendChar(buf.length());
@@ -756,7 +763,7 @@
databuf.appendByte(m.params.length());
for (VarSymbol s : m.params) {
ListBuffer<Attribute.Compound> buf = new ListBuffer<Attribute.Compound>();
- for (Attribute.Compound a : s.getAnnotationMirrors())
+ for (Attribute.Compound a : s.getRawAttributes())
if (types.getRetention(a) == RetentionPolicy.CLASS)
buf.append(a);
databuf.appendChar(buf.length());
@@ -951,14 +958,16 @@
void writeBootstrapMethods() {
int alenIdx = writeAttr(names.BootstrapMethods);
databuf.appendChar(bootstrapMethods.size());
- for (Map.Entry<MethodSymbol, Pool.MethodHandle> entry : bootstrapMethods.entrySet()) {
- DynamicMethodSymbol dsym = (DynamicMethodSymbol)entry.getKey();
+ for (Map.Entry<DynamicMethod, MethodHandle> entry : bootstrapMethods.entrySet()) {
+ DynamicMethod dmeth = entry.getKey();
+ DynamicMethodSymbol dsym = (DynamicMethodSymbol)dmeth.baseSymbol();
//write BSM handle
databuf.appendChar(pool.get(entry.getValue()));
//write static args length
databuf.appendChar(dsym.staticArgs.length);
//write static args array
- for (Object o : dsym.staticArgs) {
+ Object[] uniqueArgs = dmeth.uniqueStaticArgs;
+ for (Object o : uniqueArgs) {
databuf.appendChar(pool.get(o));
}
}
@@ -1534,7 +1543,7 @@
pool = c.pool;
innerClasses = null;
innerClassesQueue = null;
- bootstrapMethods = new LinkedHashMap<MethodSymbol, Pool.MethodHandle>();
+ bootstrapMethods = new LinkedHashMap<DynamicMethod, MethodHandle>();
Type supertype = types.supertype(c.type);
List<Type> interfaces = types.interfaces(c.type);
@@ -1627,7 +1636,7 @@
}
acount += writeFlagAttrs(c.flags());
- acount += writeJavaAnnotations(c.getAnnotationMirrors());
+ acount += writeJavaAnnotations(c.getRawAttributes());
acount += writeEnclosingMethodAttribute(c);
acount += writeExtraClassAttributes(c);
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java Tue Jan 01 17:49:22 2013 -0800
@@ -27,6 +27,7 @@
import com.sun.tools.javac.code.*;
import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.code.Types.UniqueType;
import com.sun.tools.javac.util.*;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
@@ -901,6 +902,7 @@
if (o instanceof ClassSymbol) return syms.classType;
if (o instanceof Type.ArrayType) return syms.classType;
if (o instanceof Type.MethodType) return syms.methodTypeType;
+ if (o instanceof UniqueType) return typeForPool(((UniqueType)o).type);
if (o instanceof Pool.MethodHandle) return syms.methodHandleType;
throw new AssertionError(o);
}
@@ -1030,7 +1032,7 @@
Object o = pool.pool[od];
Type t = (o instanceof Symbol)
? ((Symbol)o).erasure(types)
- : types.erasure(((Type)o));
+ : types.erasure((((UniqueType)o).type));
state.push(t);
break; }
case ldc2w:
@@ -1545,10 +1547,10 @@
public void compressCatchTable() {
ListBuffer<char[]> compressedCatchInfo = ListBuffer.lb();
List<Integer> handlerPcs = List.nil();
- for (char[] catchEntry : catchInfo.elems) {
+ for (char[] catchEntry : catchInfo) {
handlerPcs = handlerPcs.prepend((int)catchEntry[2]);
}
- for (char[] catchEntry : catchInfo.elems) {
+ for (char[] catchEntry : catchInfo) {
int startpc = catchEntry[0];
int endpc = catchEntry[1];
if (startpc == endpc ||
@@ -1825,7 +1827,7 @@
}
}
- static Type jsrReturnValue = new Type(INT, null);
+ static final Type jsrReturnValue = new Type(INT, null);
/* **************************************************************************
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java Tue Jan 01 17:49:22 2013 -0800
@@ -94,6 +94,10 @@
return instance;
}
+ /* Constant pool, reset by genClass.
+ */
+ private Pool pool;
+
protected Gen(Context context) {
context.put(genKey, this);
@@ -126,6 +130,7 @@
genCrt = options.isSet(XJCOV);
debugCode = options.isSet("debugcode");
allowInvokedynamic = target.hasInvokedynamic() || options.isSet("invokedynamic");
+ pool = new Pool(types);
generateIproxies =
target.requiresIproxy() ||
@@ -174,10 +179,6 @@
*/
private boolean useJsrLocally;
- /* Constant pool, reset by genClass.
- */
- private Pool pool = new Pool();
-
/** Code buffer, set by genMethod.
*/
private Code code;
@@ -705,7 +706,7 @@
}
int startpc = code.curPc();
genStat(tree, env);
- if (tree.hasTag(BLOCK)) crtFlags |= CRT_BLOCK;
+ if (tree.hasTag(Tag.BLOCK)) crtFlags |= CRT_BLOCK;
code.crt.put(tree, crtFlags, startpc, code.curPc());
}
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java Tue Jan 01 17:49:22 2013 -0800
@@ -28,6 +28,9 @@
import com.sun.tools.javac.code.Kinds;
import com.sun.tools.javac.code.Symbol;
import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Types;
+import com.sun.tools.javac.code.Types.UniqueType;
import com.sun.tools.javac.util.ArrayUtils;
import com.sun.tools.javac.util.Assert;
@@ -60,11 +63,14 @@
*/
Map<Object,Integer> indices;
+ Types types;
+
/** Construct a pool with given number of elements and element array.
*/
- public Pool(int pp, Object[] pool) {
+ public Pool(int pp, Object[] pool, Types types) {
this.pp = pp;
this.pool = pool;
+ this.types = types;
this.indices = new HashMap<Object,Integer>(pool.length);
for (int i = 1; i < pp; i++) {
if (pool[i] != null) indices.put(pool[i], i);
@@ -73,8 +79,8 @@
/** Construct an empty pool.
*/
- public Pool() {
- this(1, new Object[64]);
+ public Pool(Types types) {
+ this(1, new Object[64], types);
}
/** Return the number of entries in the constant pool.
@@ -114,11 +120,13 @@
Object makePoolValue(Object o) {
if (o instanceof DynamicMethodSymbol) {
- return new DynamicMethod((DynamicMethodSymbol)o);
+ return new DynamicMethod((DynamicMethodSymbol)o, types);
} else if (o instanceof MethodSymbol) {
- return new Method((MethodSymbol)o);
+ return new Method((MethodSymbol)o, types);
} else if (o instanceof VarSymbol) {
- return new Variable((VarSymbol)o);
+ return new Variable((VarSymbol)o, types);
+ } else if (o instanceof Type) {
+ return new UniqueType((Type)o, types);
} else {
return o;
}
@@ -134,9 +142,11 @@
static class Method extends DelegatedSymbol {
MethodSymbol m;
- Method(MethodSymbol m) {
+ UniqueType uniqueType;
+ Method(MethodSymbol m, Types types) {
super(m);
this.m = m;
+ this.uniqueType = new UniqueType(m.type, types);
}
public boolean equals(Object other) {
if (!(other instanceof Method)) return false;
@@ -144,20 +154,22 @@
return
o.name == m.name &&
o.owner == m.owner &&
- o.type.equals(m.type);
+ ((Method)other).uniqueType.equals(uniqueType);
}
public int hashCode() {
return
m.name.hashCode() * 33 +
m.owner.hashCode() * 9 +
- m.type.hashCode();
+ uniqueType.hashCode();
}
}
static class DynamicMethod extends Method {
+ public Object[] uniqueStaticArgs;
- DynamicMethod(DynamicMethodSymbol m) {
- super(m);
+ DynamicMethod(DynamicMethodSymbol m, Types types) {
+ super(m, types);
+ uniqueStaticArgs = getUniqueTypeArray(m.staticArgs, types);
}
@Override
@@ -168,7 +180,8 @@
DynamicMethodSymbol dm2 = (DynamicMethodSymbol)((DynamicMethod)other).m;
return dm1.bsm == dm2.bsm &&
dm1.bsmKind == dm2.bsmKind &&
- Arrays.equals(dm1.staticArgs, dm2.staticArgs);
+ Arrays.equals(uniqueStaticArgs,
+ ((DynamicMethod)other).uniqueStaticArgs);
}
@Override
@@ -178,17 +191,31 @@
hash += dm.bsmKind * 7 +
dm.bsm.hashCode() * 11;
for (int i = 0; i < dm.staticArgs.length; i++) {
- hash += (dm.staticArgs[i].hashCode() * 23);
+ hash += (uniqueStaticArgs[i].hashCode() * 23);
}
return hash;
}
+
+ private Object[] getUniqueTypeArray(Object[] objects, Types types) {
+ Object[] result = new Object[objects.length];
+ for (int i = 0; i < objects.length; i++) {
+ if (objects[i] instanceof Type) {
+ result[i] = new UniqueType((Type)objects[i], types);
+ } else {
+ result[i] = objects[i];
+ }
+ }
+ return result;
+ }
}
static class Variable extends DelegatedSymbol {
VarSymbol v;
- Variable(VarSymbol v) {
+ UniqueType uniqueType;
+ Variable(VarSymbol v, Types types) {
super(v);
this.v = v;
+ this.uniqueType = new UniqueType(v.type, types);
}
public boolean equals(Object other) {
if (!(other instanceof Variable)) return false;
@@ -196,13 +223,13 @@
return
o.name == v.name &&
o.owner == v.owner &&
- o.type.equals(v.type);
+ ((Variable)other).uniqueType.equals(uniqueType);
}
public int hashCode() {
return
v.name.hashCode() * 33 +
v.owner.hashCode() * 9 +
- v.type.hashCode();
+ uniqueType.hashCode();
}
}
@@ -214,9 +241,12 @@
/** Reference symbol */
Symbol refSym;
- public MethodHandle(int refKind, Symbol refSym) {
+ UniqueType uniqueType;
+
+ public MethodHandle(int refKind, Symbol refSym, Types types) {
this.refKind = refKind;
this.refSym = refSym;
+ this.uniqueType = new UniqueType(this.refSym.type, types);
checkConsistent();
}
public boolean equals(Object other) {
@@ -227,14 +257,14 @@
return
o.name == refSym.name &&
o.owner == refSym.owner &&
- o.type.equals(refSym.type);
+ ((MethodHandle)other).uniqueType.equals(uniqueType);
}
public int hashCode() {
return
refKind * 65 +
refSym.name.hashCode() * 33 +
refSym.owner.hashCode() * 9 +
- refSym.type.hashCode();
+ uniqueType.hashCode();
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java Tue Jan 01 17:49:22 2013 -0800
@@ -86,17 +86,15 @@
return instance;
}
- private static Target MIN;
+ private static final Target MIN = values()[0];
public static Target MIN() { return MIN; }
- private static Target MAX;
+ private static final Target MAX = values()[values().length - 1];
public static Target MAX() { return MAX; }
- private static Map<String,Target> tab = new HashMap<String,Target>();
+ private static final Map<String,Target> tab = new HashMap<String,Target>();
static {
for (Target t : values()) {
- if (MIN == null) MIN = t;
- MAX = t;
tab.put(t.name, t);
}
tab.put("5", JDK1_5);
--- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java Tue Jan 01 17:49:22 2013 -0800
@@ -189,7 +189,7 @@
}
}
- private static CompilePolicy DEFAULT_COMPILE_POLICY = CompilePolicy.BY_TODO;
+ private static final CompilePolicy DEFAULT_COMPILE_POLICY = CompilePolicy.BY_TODO;
protected static enum ImplicitSourcePolicy {
/** Don't generate or process implicitly read source files. */
@@ -543,7 +543,7 @@
public static CompileState max(CompileState a, CompileState b) {
return a.value > b.value ? a : b;
}
- private int value;
+ private final int value;
};
/** Partial map to record which compiler phases have been executed
* for each compilation unit. Used for ATTR and FLOW phases.
@@ -928,6 +928,16 @@
}
}
+ /**
+ * Set needRootClasses to true, in JavaCompiler subclass constructor
+ * that want to collect public apis of classes supplied on the command line.
+ */
+ protected boolean needRootClasses = false;
+
+ /**
+ * The list of classes explicitly supplied on the command line for compilation.
+ * Not always populated.
+ */
private List<JCClassDecl> rootClasses;
/**
@@ -984,9 +994,10 @@
}
}
- //If generating source, remember the classes declared in
- //the original compilation units listed on the command line.
- if (sourceOutput || stubOutput) {
+ // If generating source, or if tracking public apis,
+ // then remember the classes declared in
+ // the original compilation units listed on the command line.
+ if (needRootClasses || sourceOutput || stubOutput) {
ListBuffer<JCClassDecl> cdefs = lb();
for (JCCompilationUnit unit : roots) {
for (List<JCTree> defs = unit.defs;
@@ -1247,6 +1258,12 @@
attr.postAttr(env.tree);
}
compileStates.put(env, CompileState.ATTR);
+ if (rootClasses != null && rootClasses.contains(env.enclClass)) {
+ // This was a class that was explicitly supplied for compilation.
+ // If we want to capture the public api of this class,
+ // then now is a good time to do it.
+ reportPublicApi(env.enclClass.sym);
+ }
}
finally {
log.useSource(prev);
@@ -1255,6 +1272,14 @@
return env;
}
+ /** Report the public api of a class that was supplied explicitly for compilation,
+ * for example on the command line to javac.
+ * @param sym The symbol of the class.
+ */
+ public void reportPublicApi(ClassSymbol sym) {
+ // Override to collect the reported public api.
+ }
+
/**
* Perform dataflow checks on attributed parse trees.
* These include checks for definite assignment and unreachable statements.
@@ -1675,7 +1700,7 @@
/** Print numbers of errors and warnings.
*/
- protected void printCount(String kind, int count) {
+ public void printCount(String kind, int count) {
if (count != 0) {
String key;
if (count == 1)
--- a/langtools/src/share/classes/com/sun/tools/javac/main/Main.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/Main.java Tue Jan 01 17:49:22 2013 -0800
@@ -44,6 +44,8 @@
import com.sun.source.util.JavacTask;
import com.sun.source.util.Plugin;
+import com.sun.tools.doclint.DocLint;
+import com.sun.tools.javac.api.BasicJavacTask;
import com.sun.tools.javac.code.Source;
import com.sun.tools.javac.file.CacheFSInfo;
import com.sun.tools.javac.file.JavacFileManager;
@@ -428,6 +430,7 @@
if (batchMode)
CacheFSInfo.preRegister(context);
+ // FIXME: this code will not be invoked if using JavacTask.parse/analyze/generate
// invoke any available plugins
String plugins = options.get(PLUGIN);
if (plugins != null) {
@@ -448,7 +451,7 @@
try {
if (task == null)
task = JavacTask.instance(pEnv);
- plugin.call(task, p.tail.toArray(new String[p.tail.size()]));
+ plugin.init(task, p.tail.toArray(new String[p.tail.size()]));
} catch (Throwable ex) {
if (apiMode)
throw new RuntimeException(ex);
@@ -464,10 +467,31 @@
}
}
- fileManager = context.get(JavaFileManager.class);
+ comp = JavaCompiler.instance(context);
- comp = JavaCompiler.instance(context);
- if (comp == null) return Result.SYSERR;
+ // FIXME: this code will not be invoked if using JavacTask.parse/analyze/generate
+ String xdoclint = options.get(XDOCLINT);
+ String xdoclintCustom = options.get(XDOCLINT_CUSTOM);
+ if (xdoclint != null || xdoclintCustom != null) {
+ Set<String> doclintOpts = new LinkedHashSet<String>();
+ if (xdoclint != null)
+ doclintOpts.add(DocLint.XMSGS_OPTION);
+ if (xdoclintCustom != null) {
+ for (String s: xdoclintCustom.split("\\s+")) {
+ if (s.isEmpty())
+ continue;
+ doclintOpts.add(s.replace(XDOCLINT_CUSTOM.text, DocLint.XMSGS_CUSTOM_PREFIX));
+ }
+ }
+ if (!(doclintOpts.size() == 1
+ && doclintOpts.iterator().next().equals(DocLint.XMSGS_CUSTOM_PREFIX + "none"))) {
+ JavacTask t = BasicJavacTask.instance(context);
+ new DocLint().init(t, doclintOpts.toArray(new String[doclintOpts.size()]));
+ comp.keepComments = true;
+ }
+ }
+
+ fileManager = context.get(JavaFileManager.class);
if (!files.isEmpty()) {
// add filenames to fileObjects
--- a/langtools/src/share/classes/com/sun/tools/javac/main/Option.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/Option.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,28 +25,30 @@
package com.sun.tools.javac.main;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.PrintWriter;
import java.util.Collections;
-import com.sun.tools.javac.util.Log.PrefixKind;
-import com.sun.tools.javac.util.Log.WriterKind;
-import com.sun.tools.javac.util.Log;
+import java.util.EnumSet;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.lang.model.SourceVersion;
+
+import com.sun.tools.doclint.DocLint;
import com.sun.tools.javac.code.Lint;
import com.sun.tools.javac.code.Source;
import com.sun.tools.javac.code.Type;
import com.sun.tools.javac.jvm.Target;
+import com.sun.tools.javac.processing.JavacProcessingEnvironment;
+import com.sun.tools.javac.util.Log;
+import com.sun.tools.javac.util.Log.PrefixKind;
+import com.sun.tools.javac.util.Log.WriterKind;
import com.sun.tools.javac.util.Options;
-import com.sun.tools.javac.processing.JavacProcessingEnvironment;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.util.EnumSet;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-import javax.lang.model.SourceVersion;
-
import static com.sun.tools.javac.main.Option.ChoiceKind.*;
+import static com.sun.tools.javac.main.Option.OptionGroup.*;
import static com.sun.tools.javac.main.Option.OptionKind.*;
-import static com.sun.tools.javac.main.Option.OptionGroup.*;
/**
* Options for javac. The specific Option to handle a command-line option
@@ -79,6 +81,24 @@
XLINT_CUSTOM("-Xlint:", "opt.Xlint.suboptlist",
EXTENDED, BASIC, ANYOF, getXLintChoices()),
+ XDOCLINT("-Xdoclint", "opt.Xdoclint", EXTENDED, BASIC),
+
+ XDOCLINT_CUSTOM("-Xdoclint:", "opt.Xdoclint.subopts", "opt.Xdoclint.custom", EXTENDED, BASIC) {
+ @Override
+ public boolean matches(String option) {
+ return DocLint.isValidOption(
+ option.replace(XDOCLINT_CUSTOM.text, DocLint.XMSGS_CUSTOM_PREFIX));
+ }
+
+ @Override
+ public boolean process(OptionHelper helper, String option) {
+ String prev = helper.get(XDOCLINT_CUSTOM);
+ String next = (prev == null) ? option : (prev + " " + option);
+ helper.put(XDOCLINT_CUSTOM.text, next);
+ return false;
+ }
+ },
+
// -nowarn is retained for command-line backward compatibility
NOWARN("-nowarn", "opt.nowarn", STANDARD, BASIC) {
@Override
@@ -167,7 +187,6 @@
ENCODING("-encoding", "opt.arg.encoding", "opt.encoding", STANDARD, FILEMANAGER) {
@Override
public boolean process(OptionHelper helper, String option, String operand) {
-// System.err.println("process encoding " + operand);
return super.process(helper, option, operand);
}
@@ -246,9 +265,7 @@
}
},
- A("-A", "opt.arg.key.equals.value", "opt.A", STANDARD, BASIC) {
- { hasSuffix = true; }
-
+ A("-A", "opt.arg.key.equals.value", "opt.A", STANDARD, BASIC, true) {
@Override
public boolean matches(String arg) {
return arg.startsWith("-A");
@@ -293,8 +310,6 @@
// This option exists only for the purpose of documenting itself.
// It's actually implemented by the launcher.
J("-J", "opt.arg.flag", "opt.J", STANDARD, INFO) {
- { hasSuffix = true; }
-
@Override
public boolean process(OptionHelper helper, String option) {
throw new AssertionError
@@ -302,10 +317,6 @@
}
},
- // stop after parsing and attributing.
- // new HiddenOption("-attrparseonly"),
-
- // new Option("-moreinfo", "opt.moreinfo") {
MOREINFO("-moreinfo", null, HIDDEN, BASIC) {
@Override
public boolean process(OptionHelper helper, String option) {
@@ -317,23 +328,6 @@
// treat warnings as errors
WERROR("-Werror", "opt.Werror", STANDARD, BASIC),
-// // use complex inference from context in the position of a method call argument
-// COMPLEXINFERENCE("-complexinference", null, HIDDEN, BASIC),
-
- // generare source stubs
- // new HiddenOption("-stubs"),
-
- // relax some constraints to allow compiling from stubs
- // new HiddenOption("-relax"),
-
- // output source after translating away inner classes
- // new Option("-printflat", "opt.printflat"),
- // new HiddenOption("-printflat"),
-
- // display scope search details
- // new Option("-printsearch", "opt.printsearch"),
- // new HiddenOption("-printsearch"),
-
// prompt after each error
// new Option("-prompt", "opt.prompt"),
PROMPT("-prompt", null, HIDDEN, BASIC),
@@ -342,13 +336,8 @@
DOE("-doe", null, HIDDEN, BASIC),
// output source after type erasure
- // new Option("-s", "opt.s"),
PRINTSOURCE("-printsource", null, HIDDEN, BASIC),
- // output shrouded class files
- // new Option("-scramble", "opt.scramble"),
- // new Option("-scrambleall", "opt.scrambleall"),
-
// display warnings for generic unchecked operations
WARNUNCHECKED("-warnunchecked", null, HIDDEN, BASIC) {
@Override
@@ -408,18 +397,16 @@
* -XDx sets the option x to the value x.
*/
XD("-XD", null, HIDDEN, BASIC) {
- String s;
@Override
public boolean matches(String s) {
- this.s = s;
return s.startsWith(text);
}
@Override
public boolean process(OptionHelper helper, String option) {
- s = s.substring(text.length());
- int eq = s.indexOf('=');
- String key = (eq < 0) ? s : s.substring(0, eq);
- String value = (eq < 0) ? s : s.substring(eq+1);
+ option = option.substring(text.length());
+ int eq = option.indexOf('=');
+ String key = (eq < 0) ? option : option.substring(0, eq);
+ String value = (eq < 0) ? option : option.substring(eq+1);
helper.put(key, value);
return false;
}
@@ -428,8 +415,6 @@
// This option exists only for the purpose of documenting itself.
// It's actually implemented by the CommandLine class.
AT("@", "opt.arg.file", "opt.AT", STANDARD, INFO) {
- { hasSuffix = true; }
-
@Override
public boolean process(OptionHelper helper, String option) {
throw new AssertionError("the @ flag should be caught by CommandLine.");
@@ -445,17 +430,15 @@
* name to a separate list.
*/
SOURCEFILE("sourcefile", null, HIDDEN, INFO) {
- String s;
@Override
public boolean matches(String s) {
- this.s = s;
return s.endsWith(".java") // Java source file
|| SourceVersion.isName(s); // Legal type name
}
@Override
public boolean process(OptionHelper helper, String option) {
- if (s.endsWith(".java") ) {
- File f = new File(s);
+ if (option.endsWith(".java") ) {
+ File f = new File(option);
if (!f.exists()) {
helper.error("err.file.not.found", f);
return true;
@@ -465,9 +448,9 @@
return true;
}
helper.addFile(f);
+ } else {
+ helper.addClassName(option);
}
- else
- helper.addClassName(s);
return false;
}
};
@@ -521,7 +504,7 @@
/** Suffix option (-foo=bar or -foo:bar)
*/
- boolean hasSuffix;
+ final boolean hasSuffix;
/** The kind of choices for this option, if any.
*/
@@ -535,24 +518,30 @@
Option(String text, String descrKey,
OptionKind kind, OptionGroup group) {
- this(text, null, descrKey, kind, group, null, null);
+ this(text, null, descrKey, kind, group, null, null, false);
}
Option(String text, String argsNameKey, String descrKey,
OptionKind kind, OptionGroup group) {
- this(text, argsNameKey, descrKey, kind, group, null, null);
+ this(text, argsNameKey, descrKey, kind, group, null, null, false);
+ }
+
+ Option(String text, String argsNameKey, String descrKey,
+ OptionKind kind, OptionGroup group, boolean doHasSuffix) {
+ this(text, argsNameKey, descrKey, kind, group, null, null, doHasSuffix);
}
Option(String text, String descrKey,
OptionKind kind, OptionGroup group,
ChoiceKind choiceKind, Map<String,Boolean> choices) {
- this(text, null, descrKey, kind, group, choiceKind, choices);
+ this(text, null, descrKey, kind, group, choiceKind, choices, false);
}
Option(String text, String descrKey,
OptionKind kind, OptionGroup group,
ChoiceKind choiceKind, String... choices) {
- this(text, null, descrKey, kind, group, choiceKind, createChoices(choices));
+ this(text, null, descrKey, kind, group, choiceKind,
+ createChoices(choices), false);
}
// where
private static Map<String,Boolean> createChoices(String... choices) {
@@ -564,7 +553,8 @@
private Option(String text, String argsNameKey, String descrKey,
OptionKind kind, OptionGroup group,
- ChoiceKind choiceKind, Map<String,Boolean> choices) {
+ ChoiceKind choiceKind, Map<String,Boolean> choices,
+ boolean doHasSuffix) {
this.text = text;
this.argsNameKey = argsNameKey;
this.descrKey = descrKey;
@@ -573,7 +563,7 @@
this.choiceKind = choiceKind;
this.choices = choices;
char lastChar = text.charAt(text.length()-1);
- hasSuffix = lastChar == ':' || lastChar == '=';
+ this.hasSuffix = doHasSuffix || lastChar == ':' || lastChar == '=';
}
public String getText() {
--- a/langtools/src/share/classes/com/sun/tools/javac/model/JavacTypes.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/JavacTypes.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -25,11 +25,16 @@
package com.sun.tools.javac.model;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
-import java.util.EnumSet;
+
import javax.lang.model.element.*;
import javax.lang.model.type.*;
+
import com.sun.tools.javac.code.*;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.util.*;
@@ -301,4 +306,31 @@
throw new IllegalArgumentException(o.toString());
return clazz.cast(o);
}
+
+ public Set<MethodSymbol> getOverriddenMethods(Element elem) {
+ if (elem.getKind() != ElementKind.METHOD
+ || elem.getModifiers().contains(Modifier.STATIC)
+ || elem.getModifiers().contains(Modifier.PRIVATE))
+ return Collections.emptySet();
+
+ if (!(elem instanceof MethodSymbol))
+ throw new IllegalArgumentException();
+
+ MethodSymbol m = (MethodSymbol) elem;
+ ClassSymbol origin = (ClassSymbol) m.owner;
+
+ Set<MethodSymbol> results = new LinkedHashSet<MethodSymbol>();
+ for (Type t : types.closure(origin.type)) {
+ if (t != origin.type) {
+ ClassSymbol c = (ClassSymbol) t.tsym;
+ for (Scope.Entry e = c.members().lookup(m.name); e.scope != null; e = e.next()) {
+ if (e.sym.kind == Kinds.MTH && m.overrides(e.sym, origin, types, true)) {
+ results.add((MethodSymbol) e.sym);
+ }
+ }
+ }
+ }
+
+ return results;
+ }
}
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentParser.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,15 +25,12 @@
package com.sun.tools.javac.parser;
-import com.sun.tools.javac.util.Filter;
import java.text.BreakIterator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.LinkedList;
import java.util.Locale;
import java.util.Map;
-import java.util.Queue;
import java.util.Set;
import com.sun.source.doctree.AttributeTree.ValueKind;
@@ -52,7 +49,6 @@
import com.sun.tools.javac.tree.DocTreeMaker;
import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.util.DiagnosticSource;
-import com.sun.tools.javac.util.JCDiagnostic;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.ListBuffer;
import com.sun.tools.javac.util.Log;
@@ -736,7 +732,9 @@
nextChar();
return m.at(p).Entity(names.fromChars(buf, namep, bp - namep - 1));
} else {
- String code = checkSemi ? "dc.missing.semicolon" : "dc.bad.entity";
+ String code = checkSemi
+ ? "dc.missing.semicolon"
+ : "dc.bad.entity";
return erroneous(code, p);
}
}
@@ -888,8 +886,10 @@
}
protected void addPendingText(ListBuffer<DCTree> list, int textEnd) {
- if (textStart != -1 && textStart <= textEnd) {
- list.add(m.at(textStart).Text(newString(textStart, textEnd + 1)));
+ if (textStart != -1) {
+ if (textStart <= textEnd) {
+ list.add(m.at(textStart).Text(newString(textStart, textEnd + 1)));
+ }
textStart = -1;
}
}
@@ -1196,6 +1196,16 @@
return m.at(pos).See(html);
break;
+ case '@':
+ if (newline)
+ throw new ParseException("dc.no.content");
+ break;
+
+ case EOI:
+ if (bp == buf.length - 1)
+ throw new ParseException("dc.no.content");
+ break;
+
default:
if (isJavaIdentifierStart(ch) || ch == '#') {
DCReference ref = reference(true);
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java Tue Jan 01 17:49:22 2013 -0800
@@ -44,7 +44,7 @@
*/
public class JavaTokenizer {
- private static boolean scannerDebug = false;
+ private static final boolean scannerDebug = false;
/** Allow hex floating-point literals.
*/
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Tue Jan 01 17:49:22 2013 -0800
@@ -818,9 +818,7 @@
* | "*" | "/" | "%"
*/
JCExpression term2Rest(JCExpression t, int minprec) {
- List<JCExpression[]> savedOd = odStackSupply.elems;
JCExpression[] odStack = newOdStack();
- List<Token[]> savedOp = opStackSupply.elems;
Token[] opStack = newOpStack();
// optimization, was odStack = new Tree[...]; opStack = new Tree[...];
@@ -851,8 +849,8 @@
}
}
- odStackSupply.elems = savedOd; // optimization
- opStackSupply.elems = savedOp; // optimization
+ odStackSupply.add(odStack);
+ opStackSupply.add(opStack);
return t;
}
//where
@@ -906,23 +904,19 @@
/** optimization: To save allocating a new operand/operator stack
* for every binary operation, we use supplys.
*/
- ListBuffer<JCExpression[]> odStackSupply = new ListBuffer<JCExpression[]>();
- ListBuffer<Token[]> opStackSupply = new ListBuffer<Token[]>();
+ ArrayList<JCExpression[]> odStackSupply = new ArrayList<JCExpression[]>();
+ ArrayList<Token[]> opStackSupply = new ArrayList<Token[]>();
private JCExpression[] newOdStack() {
- if (odStackSupply.elems == odStackSupply.last)
- odStackSupply.append(new JCExpression[infixPrecedenceLevels + 1]);
- JCExpression[] odStack = odStackSupply.elems.head;
- odStackSupply.elems = odStackSupply.elems.tail;
- return odStack;
+ if (odStackSupply.isEmpty())
+ return new JCExpression[infixPrecedenceLevels + 1];
+ return odStackSupply.remove(odStackSupply.size() - 1);
}
private Token[] newOpStack() {
- if (opStackSupply.elems == opStackSupply.last)
- opStackSupply.append(new Token[infixPrecedenceLevels + 1]);
- Token[] opStack = opStackSupply.elems.head;
- opStackSupply.elems = opStackSupply.elems.tail;
- return opStack;
+ if (opStackSupply.isEmpty())
+ return new Token[infixPrecedenceLevels + 1];
+ return opStackSupply.remove(opStackSupply.size() - 1);
}
/**
@@ -2001,7 +1995,7 @@
ListBuffer<JCStatement> stats =
variableDeclarators(mods, t, new ListBuffer<JCStatement>());
// A "LocalVariableDeclarationStatement" subsumes the terminating semicolon
- storeEnd(stats.elems.last(), token.endPos);
+ storeEnd(stats.last(), token.endPos);
accept(SEMI);
return stats.toList();
}
@@ -2042,7 +2036,7 @@
ListBuffer<JCStatement> stats =
variableDeclarators(mods, t, new ListBuffer<JCStatement>());
// A "LocalVariableDeclarationStatement" subsumes the terminating semicolon
- storeEnd(stats.elems.last(), token.endPos);
+ storeEnd(stats.last(), token.endPos);
accept(SEMI);
return stats.toList();
} else {
@@ -2577,7 +2571,7 @@
vdefs.append(variableDeclaratorRest(pos, mods, type, name, reqInit, dc));
while (token.kind == COMMA) {
// All but last of multiple declarators subsume a comma
- storeEnd((JCTree)vdefs.elems.last(), token.endPos);
+ storeEnd((JCTree)vdefs.last(), token.endPos);
nextToken();
vdefs.append(variableDeclarator(mods, type, reqInit, dc));
}
@@ -2632,7 +2626,7 @@
defs.append(resource());
while (token.kind == SEMI) {
// All but last of multiple declarators must subsume a semicolon
- storeEnd(defs.elems.last(), token.endPos);
+ storeEnd(defs.last(), token.endPos);
int semiColonPos = token.pos;
nextToken();
if (token.kind == RPAREN) { // Optional trailing semicolon
@@ -2710,7 +2704,7 @@
JCTree.JCCompilationUnit toplevel = F.at(firstToken.pos).TopLevel(packageAnnotations, pid, defs.toList());
if (!consumedToplevelDoc)
attach(toplevel, firstToken.comment(CommentStyle.JAVADOC));
- if (defs.elems.isEmpty())
+ if (defs.isEmpty())
storeEnd(toplevel, S.prevToken().endPos);
if (keepDocComments)
toplevel.docComments = docComments;
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Tue Jan 01 17:49:22 2013 -0800
@@ -1336,7 +1336,7 @@
return nodes;
}
- private static TreeScanner treeCleaner = new TreeScanner() {
+ private static final TreeScanner treeCleaner = new TreeScanner() {
public void scan(JCTree node) {
super.scan(node);
if (node != null)
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties Tue Jan 01 17:49:22 2013 -0800
@@ -307,13 +307,17 @@
compiler.err.duplicate.annotation=\
duplicate annotation
+# 0: type
+compiler.err.duplicate.annotation.invalid.repeated=\
+ annotation {0} cannot be repeated\nIt does not define a valid containing annotation.
+
# 0: name, 1: type
compiler.err.duplicate.annotation.member.value=\
duplicate annotation member value {0} in {1}
-# 0: type
+# 0: type, 1: type
compiler.err.duplicate.annotation.missing.container=\
- duplicate annotation, the declaration of {0} does not have a ContainedBy annotation
+ duplicate annotation, the declaration of {0} does not have a valid {1} annotation
# 0: type, 1: type
compiler.err.invalid.container.no.containedby=\
@@ -2360,6 +2364,9 @@
compiler.err.dc.missing.semicolon=\
semicolon missing
+compiler.err.dc.no.content=\
+ no content
+
compiler.err.dc.no.tag.name=\
no tag name after '@'
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/javac.properties Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/javac.properties Tue Jan 01 17:49:22 2013 -0800
@@ -138,6 +138,14 @@
Enable recommended warnings
javac.opt.Xlint.suboptlist=\
Enable or disable specific warnings
+javac.opt.Xdoclint=\
+ Enable recommended checks for problems in javadoc comments
+javac.opt.Xdoclint.subopts = \
+ (all|[-]<group>)[/<access>]
+javac.opt.Xdoclint.custom=\n\
+\ Enable or disable specific checks for problems in javadoc comments,\n\
+\ where <group> is one of accessibility, html, reference, or syntax,\n\
+\ and <access> is one of public, protected, package, or private.
javac.opt.Xstdout=\
Redirect standard output
javac.opt.X=\
--- a/langtools/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java Tue Jan 01 17:49:22 2013 -0800
@@ -33,6 +33,7 @@
import com.sun.tools.javac.code.Attribute;
import com.sun.tools.javac.code.Symtab;
import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Types;
import com.sun.tools.javac.jvm.ClassReader;
import com.sun.tools.javac.jvm.ClassWriter;
import com.sun.tools.javac.jvm.Pool;
@@ -173,7 +174,8 @@
List.<Pair<Symbol.MethodSymbol,Attribute>>nil());
Type.moreInfo = true;
- Pool pool = new Pool();
+ Types types = Types.instance(task.getContext());
+ Pool pool = new Pool(types);
for (JavaFileObject file : fm.list(jarLocation, "", EnumSet.of(CLASS), true)) {
String className = fm.inferBinaryName(jarLocation, file);
int index = className.lastIndexOf('.');
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/DCTree.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/DCTree.java Tue Jan 01 17:49:22 2013 -0800
@@ -36,6 +36,8 @@
import com.sun.tools.javac.util.JCDiagnostic.SimpleDiagnosticPosition;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.Name;
+import java.io.IOException;
+import java.io.StringWriter;
import javax.tools.JavaFileObject;
/**
@@ -65,6 +67,21 @@
return new SimpleDiagnosticPosition(dc.comment.getSourcePos(pos));
}
+ /** Convert a tree to a pretty-printed string. */
+ @Override
+ public String toString() {
+ StringWriter s = new StringWriter();
+ try {
+ new DocPretty(s).print(this);
+ }
+ catch (IOException e) {
+ // should never happen, because StringWriter is defined
+ // never to throw any IOExceptions
+ throw new AssertionError(e);
+ }
+ return s.toString();
+ }
+
public static class DCDocComment extends DCTree implements DocCommentTree {
final Comment comment; // required for the implicit source pos table
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/DocPretty.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/DocPretty.java Tue Jan 01 17:49:22 2013 -0800
@@ -81,7 +81,7 @@
/**
* Print list.
*/
- protected void print(List<? extends DocTree> list) throws IOException {
+ public void print(List<? extends DocTree> list) throws IOException {
for (DocTree t: list) {
print(t);
}
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java Tue Jan 01 17:49:22 2013 -0800
@@ -340,15 +340,17 @@
*/
LETEXPR; // ala scheme
- private Tag noAssignTag;
+ private final Tag noAssignTag;
- private static int numberOfOperators = MOD.ordinal() - POS.ordinal() + 1;
+ private static final int numberOfOperators = MOD.ordinal() - POS.ordinal() + 1;
private Tag(Tag noAssignTag) {
this.noAssignTag = noAssignTag;
}
- private Tag() { }
+ private Tag() {
+ this(null);
+ }
public static int getNumberOfOperators() {
return numberOfOperators;
@@ -1838,8 +1840,8 @@
/** Toplevel # new */
TOPLEVEL(ReferenceMode.NEW, false);
- ReferenceMode mode;
- boolean unbound;
+ final ReferenceMode mode;
+ final boolean unbound;
private ReferenceKind(ReferenceMode mode, boolean unbound) {
this.mode = mode;
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,6 +26,7 @@
package com.sun.tools.javac.tree;
+
import com.sun.source.tree.Tree;
import com.sun.tools.javac.code.*;
import com.sun.tools.javac.comp.AttrContext;
@@ -330,6 +331,13 @@
return (docComments == null) ? null : docComments.getCommentText(tree);
}
+ public static DCTree.DCDocComment getCommentTree(Env<?> env, JCTree tree) {
+ DocCommentTable docComments = (tree.hasTag(JCTree.Tag.TOPLEVEL))
+ ? ((JCCompilationUnit) tree).docComments
+ : env.toplevel.docComments;
+ return (docComments == null) ? null : docComments.getCommentTree(tree);
+ }
+
/** The position of the first statement in a block, or the position of
* the block itself if it is empty.
*/
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java Tue Jan 01 17:49:22 2013 -0800
@@ -684,7 +684,7 @@
public JCVariableDecl VarDef(VarSymbol v, JCExpression init) {
return (JCVariableDecl)
new JCVariableDecl(
- Modifiers(v.flags(), Annotations(v.getAnnotationMirrors())),
+ Modifiers(v.flags(), Annotations(v.getRawAttributes())),
v.name,
Type(v.type),
init,
@@ -800,7 +800,7 @@
public JCMethodDecl MethodDef(MethodSymbol m, Type mtype, JCBlock body) {
return (JCMethodDecl)
new JCMethodDecl(
- Modifiers(m.flags(), Annotations(m.getAnnotationMirrors())),
+ Modifiers(m.flags(), Annotations(m.getRawAttributes())),
m.name,
Type(mtype.getReturnType()),
TypeParams(mtype.getTypeArguments()),
--- a/langtools/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -181,7 +181,7 @@
return false;
}
// where
- private static Set<Option> javacFileManagerOptions =
+ private static final Set<Option> javacFileManagerOptions =
Option.getJavacFileManagerOptions();
public int isSupportedOption(String option) {
--- a/langtools/src/share/classes/com/sun/tools/javac/util/List.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/List.java Tue Jan 01 17:49:22 2013 -0800
@@ -74,7 +74,7 @@
return (List<A>)EMPTY_LIST;
}
- private static List<?> EMPTY_LIST = new List<Object>(null,null) {
+ private static final List<?> EMPTY_LIST = new List<Object>(null,null) {
public List<Object> setTail(List<Object> tail) {
throw new UnsupportedOperationException();
}
@@ -391,7 +391,7 @@
return (List<T>)list;
}
- private static Iterator<?> EMPTYITERATOR = new Iterator<Object>() {
+ private static final Iterator<?> EMPTYITERATOR = new Iterator<Object>() {
public boolean hasNext() {
return false;
}
--- a/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -52,19 +52,20 @@
/** The list of elements of this buffer.
*/
- public List<A> elems;
+ private List<A> elems;
- /** A pointer pointing to the last, sentinel element of `elems'.
+ /** A pointer pointing to the last element of 'elems' containing data,
+ * or null if the list is empty.
*/
- public List<A> last;
+ private List<A> last;
/** The number of element in this buffer.
*/
- public int count;
+ private int count;
/** Has a list been created from this buffer yet?
*/
- public boolean shared;
+ private boolean shared;
/** Create a new initially empty list buffer.
*/
@@ -73,8 +74,8 @@
}
public final void clear() {
- this.elems = new List<A>(null,null);
- this.last = this.elems;
+ this.elems = List.nil();
+ this.last = null;
count = 0;
shared = false;
}
@@ -103,22 +104,23 @@
/** Copy list and sets last.
*/
private void copy() {
- List<A> p = elems = new List<A>(elems.head, elems.tail);
- while (true) {
- List<A> tail = p.tail;
- if (tail == null) break;
- tail = new List<A>(tail.head, tail.tail);
- p.setTail(tail);
- p = tail;
+ if (elems.nonEmpty()) {
+ List<A> orig = elems;
+
+ elems = last = List.<A>of(orig.head);
+
+ while ((orig = orig.tail).nonEmpty()) {
+ last.tail = List.<A>of(orig.head);
+ last = last.tail;
+ }
}
- last = p;
- shared = false;
}
/** Prepend an element to buffer.
*/
public ListBuffer<A> prepend(A x) {
elems = elems.prepend(x);
+ if (last == null) last = elems;
count++;
return this;
}
@@ -128,9 +130,13 @@
public ListBuffer<A> append(A x) {
x.getClass(); // null check
if (shared) copy();
- last.head = x;
- last.setTail(new List<A>(null,null));
- last = last.tail;
+ List<A> newLast = List.<A>of(x);
+ if (last != null) {
+ last.tail = newLast;
+ last = newLast;
+ } else {
+ elems = last = newLast;
+ }
count++;
return this;
}
@@ -192,8 +198,9 @@
*/
public A next() {
A x = elems.head;
- if (elems != last) {
+ if (!elems.isEmpty()) {
elems = elems.tail;
+ if (elems.isEmpty()) last = null;
count--;
}
return x;
@@ -205,10 +212,10 @@
return new Iterator<A>() {
List<A> elems = ListBuffer.this.elems;
public boolean hasNext() {
- return elems != last;
+ return !elems.isEmpty();
}
public A next() {
- if (elems == last)
+ if (elems.isEmpty())
throw new NoSuchElementException();
A elem = elems.head;
elems = elems.tail;
@@ -263,4 +270,8 @@
public A peek() {
return first();
}
+
+ public A last() {
+ return last != null ? last.head : null;
+ }
}
--- a/langtools/src/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -91,7 +91,7 @@
DeferredDiagnosticKind(String v) { value = v; }
String getKey(String prefix) { return prefix + value; }
- private String value;
+ private final String value;
}
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java Tue Jan 01 17:49:22 2013 -0800
@@ -249,7 +249,7 @@
INTERSECTION("where.description.intersection");
/** resource key for this where clause kind */
- private String key;
+ private final String key;
WhereClauseKind(String key) {
this.key = key;
--- a/langtools/src/share/classes/com/sun/tools/javadoc/AnnotationTypeDocImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/AnnotationTypeDocImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -27,13 +27,13 @@
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Kinds;
import com.sun.tools.javac.code.Scope;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.tree.JCTree.*;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.Names;
-import com.sun.tools.javac.util.Position;
/**
* Represents an annotation type.
@@ -51,12 +51,11 @@
extends ClassDocImpl implements AnnotationTypeDoc {
public AnnotationTypeDocImpl(DocEnv env, ClassSymbol sym) {
- this(env, sym, null, null, null);
+ this(env, sym, null);
}
- public AnnotationTypeDocImpl(DocEnv env, ClassSymbol sym,
- String doc, JCClassDecl tree, Position.LineMap lineMap) {
- super(env, sym, doc, tree, lineMap);
+ public AnnotationTypeDocImpl(DocEnv env, ClassSymbol sym, TreePath treePath) {
+ super(env, sym, treePath);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/AnnotationTypeElementDocImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/AnnotationTypeElementDocImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -27,9 +27,9 @@
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.tree.JCTree.*;
-import com.sun.tools.javac.util.Position;
/**
* Represents an element of an annotation type.
@@ -50,9 +50,8 @@
super(env, sym);
}
- public AnnotationTypeElementDocImpl(DocEnv env, MethodSymbol sym,
- String doc, JCMethodDecl tree, Position.LineMap lineMap) {
- super(env, sym, doc, tree, lineMap);
+ public AnnotationTypeElementDocImpl(DocEnv env, MethodSymbol sym, TreePath treePath) {
+ super(env, sym, treePath);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -31,13 +31,14 @@
import java.net.URI;
import java.util.HashSet;
import java.util.Set;
+
import javax.tools.FileObject;
import javax.tools.JavaFileManager.Location;
import javax.tools.StandardJavaFileManager;
import javax.tools.StandardLocation;
import com.sun.javadoc.*;
-
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Flags;
import com.sun.tools.javac.code.Kinds;
import com.sun.tools.javac.code.Scope;
@@ -45,22 +46,17 @@
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.code.Type;
import com.sun.tools.javac.code.Type.ClassType;
-
import com.sun.tools.javac.comp.AttrContext;
import com.sun.tools.javac.comp.Env;
-
import com.sun.tools.javac.tree.JCTree;
-import com.sun.tools.javac.tree.JCTree.JCClassDecl;
import com.sun.tools.javac.tree.JCTree.JCFieldAccess;
import com.sun.tools.javac.tree.JCTree.JCImport;
import com.sun.tools.javac.tree.TreeInfo;
-
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.ListBuffer;
import com.sun.tools.javac.util.Name;
import com.sun.tools.javac.util.Names;
import com.sun.tools.javac.util.Position;
-
import static com.sun.tools.javac.code.Kinds.*;
import static com.sun.tools.javac.code.TypeTag.CLASS;
import static com.sun.tools.javac.tree.JCTree.Tag.*;
@@ -100,15 +96,14 @@
* Constructor
*/
public ClassDocImpl(DocEnv env, ClassSymbol sym) {
- this(env, sym, null, null, null);
+ this(env, sym, null);
}
/**
* Constructor
*/
- public ClassDocImpl(DocEnv env, ClassSymbol sym, String documentation,
- JCClassDecl tree, Position.LineMap lineMap) {
- super(env, sym, documentation, tree, lineMap);
+ public ClassDocImpl(DocEnv env, ClassSymbol sym, TreePath treePath) {
+ super(env, sym, treePath);
this.type = (ClassType)sym.type;
this.tsym = sym;
}
@@ -281,6 +276,10 @@
return false;
}
+ public boolean isFunctionalInterface() {
+ return env.types.isFunctionalInterface(tsym);
+ }
+
/**
* Return the package that this class is contained in.
*/
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ConstructorDocImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ConstructorDocImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -27,10 +27,9 @@
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Symbol.ClassSymbol;
import com.sun.tools.javac.code.Symbol.MethodSymbol;
-import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
-import com.sun.tools.javac.util.Position;
/**
* Represents a constructor of a java class.
@@ -58,9 +57,8 @@
/**
* constructor.
*/
- public ConstructorDocImpl(DocEnv env, MethodSymbol sym,
- String docComment, JCMethodDecl tree, Position.LineMap lineMap) {
- super(env, sym, docComment, tree, lineMap);
+ public ConstructorDocImpl(DocEnv env, MethodSymbol sym, TreePath treePath) {
+ super(env, sym, treePath);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java Tue Jan 01 17:49:22 2013 -0800
@@ -27,18 +27,20 @@
import java.lang.reflect.Modifier;
import java.util.*;
+
import javax.tools.JavaFileManager;
import com.sun.javadoc.*;
-
+import com.sun.source.util.TreePath;
+import com.sun.tools.javac.api.JavacTrees;
import com.sun.tools.javac.code.*;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.code.Type.ClassType;
import com.sun.tools.javac.comp.Check;
+import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.tree.JCTree.*;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.Names;
-import com.sun.tools.javac.util.Position;
/**
* Holds the environment for a run of javadoc.
@@ -104,6 +106,8 @@
JavaFileManager fileManager;
Context context;
+ WeakHashMap<JCTree, TreePath> treePaths = new WeakHashMap<JCTree, TreePath>();
+
/** Allow documenting from class files? */
boolean docClasses = false;
@@ -540,13 +544,12 @@
/**
* Create the PackageDoc (or a subtype) for a package symbol.
*/
- void makePackageDoc(PackageSymbol pack, String docComment, JCCompilationUnit tree) {
+ void makePackageDoc(PackageSymbol pack, TreePath treePath) {
PackageDocImpl result = packageMap.get(pack);
if (result != null) {
- if (docComment != null) result.setRawCommentText(docComment);
- if (tree != null) result.setTree(tree);
+ if (treePath != null) result.setTreePath(treePath);
} else {
- result = new PackageDocImpl(this, pack, docComment, tree);
+ result = new PackageDocImpl(this, pack, treePath);
packageMap.put(pack, result);
}
}
@@ -572,17 +575,16 @@
/**
* Create the ClassDoc (or a subtype) for a class symbol.
*/
- protected void makeClassDoc(ClassSymbol clazz, String docComment, JCClassDecl tree, Position.LineMap lineMap) {
+ protected void makeClassDoc(ClassSymbol clazz, TreePath treePath) {
ClassDocImpl result = classMap.get(clazz);
if (result != null) {
- if (docComment != null) result.setRawCommentText(docComment);
- if (tree != null) result.setTree(tree);
+ if (treePath != null) result.setTreePath(treePath);
return;
}
- if (isAnnotationType(tree)) { // flags of clazz may not yet be set
- result = new AnnotationTypeDocImpl(this, clazz, docComment, tree, lineMap);
+ if (isAnnotationType((JCClassDecl) treePath.getLeaf())) { // flags of clazz may not yet be set
+ result = new AnnotationTypeDocImpl(this, clazz, treePath);
} else {
- result = new ClassDocImpl(this, clazz, docComment, tree, lineMap);
+ result = new ClassDocImpl(this, clazz, treePath);
}
classMap.put(clazz, result);
}
@@ -610,13 +612,12 @@
/**
* Create a FieldDoc for a var symbol.
*/
- protected void makeFieldDoc(VarSymbol var, String docComment, JCVariableDecl tree, Position.LineMap lineMap) {
+ protected void makeFieldDoc(VarSymbol var, TreePath treePath) {
FieldDocImpl result = fieldMap.get(var);
if (result != null) {
- if (docComment != null) result.setRawCommentText(docComment);
- if (tree != null) result.setTree(tree);
+ if (treePath != null) result.setTreePath(treePath);
} else {
- result = new FieldDocImpl(this, var, docComment, tree, lineMap);
+ result = new FieldDocImpl(this, var, treePath);
fieldMap.put(var, result);
}
}
@@ -627,14 +628,12 @@
* Create a MethodDoc for this MethodSymbol.
* Should be called only on symbols representing methods.
*/
- protected void makeMethodDoc(MethodSymbol meth, String docComment,
- JCMethodDecl tree, Position.LineMap lineMap) {
+ protected void makeMethodDoc(MethodSymbol meth, TreePath treePath) {
MethodDocImpl result = (MethodDocImpl)methodMap.get(meth);
if (result != null) {
- if (docComment != null) result.setRawCommentText(docComment);
- if (tree != null) result.setTree(tree);
+ if (treePath != null) result.setTreePath(treePath);
} else {
- result = new MethodDocImpl(this, meth, docComment, tree, lineMap);
+ result = new MethodDocImpl(this, meth, treePath);
methodMap.put(meth, result);
}
}
@@ -656,14 +655,12 @@
* Create the ConstructorDoc for a MethodSymbol.
* Should be called only on symbols representing constructors.
*/
- protected void makeConstructorDoc(MethodSymbol meth, String docComment,
- JCMethodDecl tree, Position.LineMap lineMap) {
+ protected void makeConstructorDoc(MethodSymbol meth, TreePath treePath) {
ConstructorDocImpl result = (ConstructorDocImpl)methodMap.get(meth);
if (result != null) {
- if (docComment != null) result.setRawCommentText(docComment);
- if (tree != null) result.setTree(tree);
+ if (treePath != null) result.setTreePath(treePath);
} else {
- result = new ConstructorDocImpl(this, meth, docComment, tree, lineMap);
+ result = new ConstructorDocImpl(this, meth, treePath);
methodMap.put(meth, result);
}
}
@@ -685,16 +682,14 @@
* Create the AnnotationTypeElementDoc for a MethodSymbol.
* Should be called only on symbols representing annotation type elements.
*/
- protected void makeAnnotationTypeElementDoc(MethodSymbol meth,
- String docComment, JCMethodDecl tree, Position.LineMap lineMap) {
+ protected void makeAnnotationTypeElementDoc(MethodSymbol meth, TreePath treePath) {
AnnotationTypeElementDocImpl result =
(AnnotationTypeElementDocImpl)methodMap.get(meth);
if (result != null) {
- if (docComment != null) result.setRawCommentText(docComment);
- if (tree != null) result.setTree(tree);
+ if (treePath != null) result.setTreePath(treePath);
} else {
result =
- new AnnotationTypeElementDocImpl(this, meth, docComment, tree, lineMap);
+ new AnnotationTypeElementDocImpl(this, meth, treePath);
methodMap.put(meth, result);
}
}
@@ -730,6 +725,18 @@
// return result;
}
+ TreePath getTreePath(JCCompilationUnit tree) {
+ TreePath p = treePaths.get(tree);
+ if (p == null)
+ treePaths.put(tree, p = new TreePath(tree));
+ return p;
+ }
+
+ TreePath getTreePath(JCCompilationUnit toplevel, JCTree tree) {
+ // don't bother to cache paths for classes and members
+ return new TreePath(getTreePath(toplevel), tree);
+ }
+
/**
* Set the encoding.
*/
--- a/langtools/src/share/classes/com/sun/tools/javadoc/DocImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -35,6 +35,9 @@
import javax.tools.FileObject;
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
+import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
import com.sun.tools.javac.util.Position;
/**
@@ -61,6 +64,12 @@
protected final DocEnv env; //### Rename this everywhere to 'docenv' ?
/**
+ * Back pointer to the tree node for this doc item.
+ * May be null if there is no associated tree.
+ */
+ protected TreePath treePath;
+
+ /**
* The complex comment object, lazily initialized.
*/
private Comment comment;
@@ -88,11 +97,21 @@
/**
* Constructor.
*/
- DocImpl(DocEnv env, String documentation) {
- this.documentation = documentation;
+ DocImpl(DocEnv env, TreePath treePath) {
+ this.treePath = treePath;
+ this.documentation = getCommentText(treePath);
this.env = env;
}
+ private static String getCommentText(TreePath p) {
+ if (p == null)
+ return null;
+
+ JCCompilationUnit topLevel = (JCCompilationUnit) p.getCompilationUnit();
+ JCTree tree = (JCTree) p.getLeaf();
+ return topLevel.docComments.getCommentText(tree);
+ }
+
/**
* So subclasses have the option to do lazy initialization of
* "documentation" string.
@@ -213,11 +232,21 @@
* operations like internalization.
*/
public void setRawCommentText(String rawDocumentation) {
+ treePath = null;
documentation = rawDocumentation;
comment = null;
}
/**
+ * Set the full unprocessed text of the comment and tree path.
+ */
+ void setTreePath(TreePath treePath) {
+ this.treePath = treePath;
+ documentation = getCommentText(treePath);
+ comment = null;
+ }
+
+ /**
* return a key for sorting.
*/
CollationKey key() {
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -30,13 +30,12 @@
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Flags;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.code.Type;
-import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.ListBuffer;
-import com.sun.tools.javac.util.Position;
/**
* Represents a method or constructor of a java class.
@@ -60,9 +59,8 @@
/**
* Constructor.
*/
- public ExecutableMemberDocImpl(DocEnv env, MethodSymbol sym,
- String rawDocs, JCMethodDecl tree, Position.LineMap lineMap) {
- super(env, sym, rawDocs, tree, lineMap);
+ public ExecutableMemberDocImpl(DocEnv env, MethodSymbol sym, TreePath treePath) {
+ super(env, sym, treePath);
this.sym = sym;
}
@@ -70,7 +68,7 @@
* Constructor.
*/
public ExecutableMemberDocImpl(DocEnv env, MethodSymbol sym) {
- this(env, sym, null, null, null);
+ this(env, sym, null);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/FieldDocImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/FieldDocImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,6 +25,7 @@
package com.sun.tools.javadoc;
+import com.sun.source.util.TreePath;
import java.lang.reflect.Modifier;
import com.sun.javadoc.*;
@@ -61,9 +62,8 @@
/**
* Constructor.
*/
- public FieldDocImpl(DocEnv env, VarSymbol sym,
- String rawDocs, JCVariableDecl tree, Position.LineMap lineMap) {
- super(env, sym, rawDocs, tree, lineMap);
+ public FieldDocImpl(DocEnv env, VarSymbol sym, TreePath treePath) {
+ super(env, sym, treePath);
this.sym = sym;
}
@@ -71,7 +71,7 @@
* Constructor.
*/
public FieldDocImpl(DocEnv env, VarSymbol sym) {
- this(env, sym, null, null, null);
+ this(env, sym, null);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/JavadocEnter.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/JavadocEnter.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,13 +25,14 @@
package com.sun.tools.javadoc;
+
import javax.tools.JavaFileObject;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Kinds;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.comp.Enter;
import com.sun.tools.javac.tree.JCTree.*;
-import com.sun.tools.javac.tree.TreeInfo;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
import com.sun.tools.javac.util.List;
@@ -85,8 +86,7 @@
public void visitTopLevel(JCCompilationUnit tree) {
super.visitTopLevel(tree);
if (tree.sourcefile.isNameCompatible("package-info", JavaFileObject.Kind.SOURCE)) {
- String comment = TreeInfo.getCommentText(env, tree);
- docenv.makePackageDoc(tree.packge, comment, tree);
+ docenv.makePackageDoc(tree.packge, docenv.getTreePath(tree));
}
}
@@ -95,9 +95,8 @@
super.visitClassDef(tree);
if (tree.sym == null) return;
if (tree.sym.kind == Kinds.TYP || tree.sym.kind == Kinds.ERR) {
- String comment = TreeInfo.getCommentText(env, tree);
ClassSymbol c = tree.sym;
- docenv.makeClassDoc(c, comment, tree, env.toplevel.lineMap);
+ docenv.makeClassDoc(c, docenv.getTreePath(env.toplevel, tree));
}
}
--- a/langtools/src/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,14 +25,13 @@
package com.sun.tools.javadoc;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Flags;
import com.sun.tools.javac.code.Kinds;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.comp.MemberEnter;
import com.sun.tools.javac.tree.JCTree.*;
-import com.sun.tools.javac.tree.TreeInfo;
import com.sun.tools.javac.util.Context;
-import com.sun.tools.javac.util.Position;
/**
* Javadoc's own memberEnter phase does a few things above and beyond that
@@ -73,14 +72,13 @@
super.visitMethodDef(tree);
MethodSymbol meth = tree.sym;
if (meth == null || meth.kind != Kinds.MTH) return;
- String docComment = TreeInfo.getCommentText(env, tree);
- Position.LineMap lineMap = env.toplevel.lineMap;
+ TreePath treePath = docenv.getTreePath(env.toplevel, tree);
if (meth.isConstructor())
- docenv.makeConstructorDoc(meth, docComment, tree, lineMap);
+ docenv.makeConstructorDoc(meth, treePath);
else if (isAnnotationTypeElement(meth))
- docenv.makeAnnotationTypeElementDoc(meth, docComment, tree, lineMap);
+ docenv.makeAnnotationTypeElementDoc(meth, treePath);
else
- docenv.makeMethodDoc(meth, docComment, tree, lineMap);
+ docenv.makeMethodDoc(meth, treePath);
// release resources
tree.body = null;
@@ -92,9 +90,7 @@
if (tree.sym != null &&
tree.sym.kind == Kinds.VAR &&
!isParameter(tree.sym)) {
- String docComment = TreeInfo.getCommentText(env, tree);
- Position.LineMap lineMap = env.toplevel.lineMap;
- docenv.makeFieldDoc(tree.sym, docComment, tree, lineMap);
+ docenv.makeFieldDoc(tree.sym, docenv.getTreePath(env.toplevel, tree));
}
}
--- a/langtools/src/share/classes/com/sun/tools/javadoc/MemberDocImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/MemberDocImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -27,9 +27,8 @@
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Symbol;
-import com.sun.tools.javac.tree.JCTree;
-import com.sun.tools.javac.util.Position;
/**
* Represents a member of a java class: field, constructor, or method.
@@ -57,8 +56,8 @@
/**
* constructor.
*/
- public MemberDocImpl(DocEnv env, Symbol sym, String doc, JCTree tree, Position.LineMap lineMap) {
- super(env, sym, doc, tree, lineMap);
+ public MemberDocImpl(DocEnv env, Symbol sym, TreePath treePath) {
+ super(env, sym, treePath);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/MethodDocImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/MethodDocImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -28,12 +28,10 @@
import java.lang.reflect.Modifier;
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.*;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.code.Type;
-import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
-import com.sun.tools.javac.util.Position;
-
import static com.sun.tools.javac.code.TypeTag.CLASS;
/**
@@ -62,9 +60,8 @@
/**
* constructor.
*/
- public MethodDocImpl(DocEnv env, MethodSymbol sym,
- String docComment, JCMethodDecl tree, Position.LineMap lineMap) {
- super(env, sym, docComment, tree, lineMap);
+ public MethodDocImpl(DocEnv env, MethodSymbol sym, TreePath treePath) {
+ super(env, sym, treePath);
}
/**
@@ -79,6 +76,13 @@
}
/**
+ * Return true if this method is default
+ */
+ public boolean isDefault() {
+ return (sym.flags() & Flags.DEFAULT) != 0;
+ }
+
+ /**
* Return true if this method is abstract
*/
public boolean isAbstract() {
--- a/langtools/src/share/classes/com/sun/tools/javadoc/PackageDocImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/PackageDocImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -31,6 +31,7 @@
import javax.tools.FileObject;
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Attribute;
import com.sun.tools.javac.code.Scope;
import com.sun.tools.javac.code.Symbol.ClassSymbol;
@@ -75,17 +76,16 @@
* Constructor
*/
public PackageDocImpl(DocEnv env, PackageSymbol sym) {
- this(env, sym, null, null);
+ this(env, sym, null);
}
/**
* Constructor
*/
- public PackageDocImpl(DocEnv env, PackageSymbol sym,
- String documentation, JCTree tree) {
- super(env, documentation);
+ public PackageDocImpl(DocEnv env, PackageSymbol sym, TreePath treePath) {
+ super(env, treePath);
this.sym = sym;
- this.tree = (JCCompilationUnit) tree;
+ this.tree = (treePath == null) ? null : (JCCompilationUnit) treePath.getCompilationUnit();
foundDoc = (documentation != null);
}
@@ -93,8 +93,8 @@
this.tree = (JCCompilationUnit) tree;
}
- public void setRawCommentText(String rawDocumentation) {
- super.setRawCommentText(rawDocumentation);
+ public void setTreePath(TreePath treePath) {
+ super.setTreePath(treePath);
checkDoc();
}
@@ -288,9 +288,9 @@
* Return an empty array if there are none.
*/
public AnnotationDesc[] annotations() {
- AnnotationDesc res[] = new AnnotationDesc[sym.getAnnotationMirrors().length()];
+ AnnotationDesc res[] = new AnnotationDesc[sym.getRawAttributes().length()];
int i = 0;
- for (Attribute.Compound a : sym.getAnnotationMirrors()) {
+ for (Attribute.Compound a : sym.getRawAttributes()) {
res[i++] = new AnnotationDescImpl(env, a);
}
return res;
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ParameterImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ParameterImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -99,9 +99,9 @@
* Return an empty array if there are none.
*/
public AnnotationDesc[] annotations() {
- AnnotationDesc res[] = new AnnotationDesc[sym.getAnnotationMirrors().length()];
+ AnnotationDesc res[] = new AnnotationDesc[sym.getRawAttributes().length()];
int i = 0;
- for (Attribute.Compound a : sym.getAnnotationMirrors()) {
+ for (Attribute.Compound a : sym.getRawAttributes()) {
res[i++] = new AnnotationDescImpl(env, a);
}
return res;
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ProgramElementDocImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ProgramElementDocImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -29,10 +29,12 @@
import java.text.CollationKey;
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Attribute;
import com.sun.tools.javac.code.Symbol;
import com.sun.tools.javac.code.Symbol.ClassSymbol;
import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
import com.sun.tools.javac.util.Position;
/**
@@ -66,16 +68,20 @@
// Cache for getModifiers().
private int modifiers = -1;
- protected ProgramElementDocImpl(DocEnv env, Symbol sym,
- String doc, JCTree tree, Position.LineMap lineMap) {
- super(env, doc);
+ protected ProgramElementDocImpl(DocEnv env, Symbol sym, TreePath treePath) {
+ super(env, treePath);
this.sym = sym;
- this.tree = tree;
- this.lineMap = lineMap;
+ if (treePath != null) {
+ tree = (JCTree) treePath.getLeaf();
+ lineMap = ((JCCompilationUnit) treePath.getCompilationUnit()).lineMap;
+ }
}
- void setTree(JCTree tree) {
- this.tree = tree;
+ @Override
+ void setTreePath(TreePath treePath) {
+ super.setTreePath(treePath);
+ this.tree = (JCTree) treePath.getLeaf();
+ this.lineMap = ((JCCompilationUnit) treePath.getCompilationUnit()).lineMap;
}
/**
@@ -158,9 +164,9 @@
* Return an empty array if there are none.
*/
public AnnotationDesc[] annotations() {
- AnnotationDesc res[] = new AnnotationDesc[sym.getAnnotationMirrors().length()];
+ AnnotationDesc res[] = new AnnotationDesc[sym.getRawAttributes().length()];
int i = 0;
- for (Attribute.Compound a : sym.getAnnotationMirrors()) {
+ for (Attribute.Compound a : sym.getRawAttributes()) {
res[i++] = new AnnotationDescImpl(env, a);
}
return res;
--- a/langtools/src/share/classes/com/sun/tools/javadoc/RootDocImpl.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/RootDocImpl.java Tue Jan 01 17:49:22 2013 -0800
@@ -331,7 +331,6 @@
@Override
protected String documentation() {
if (documentation == null) {
- int cnt = options.length();
JavaFileObject overviewPath = getOverviewPath();
if (overviewPath == null) {
// no doc file to be had
--- a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java Tue Jan 01 17:49:22 2013 -0800
@@ -147,7 +147,7 @@
}
}
- static Option[] recognizedOptions = {
+ static final Option[] recognizedOptions = {
new Option(true, "-o") {
void process(JavahTask task, String opt, String arg) {
task.ofile = new File(arg);
--- a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java Tue Jan 01 17:49:22 2013 -0800
@@ -117,7 +117,7 @@
final String[] aliases;
}
- static Option[] recognizedOptions = {
+ static final Option[] recognizedOptions = {
new Option(false, "-help", "--help", "-?") {
void process(JavapTask task, String opt, String arg) {
--- a/langtools/src/share/classes/javax/lang/model/element/ExecutableElement.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/javax/lang/model/element/ExecutableElement.java Tue Jan 01 17:49:22 2013 -0800
@@ -78,6 +78,16 @@
boolean isVarArgs();
/**
+ * Returns {@code true} if this method is a default method and
+ * returns {@code false} otherwise.
+ *
+ * @return {@code true} if this method is a default method and
+ * {@code false} otherwise
+ * @since 1.8
+ */
+ boolean isDefault();
+
+ /**
* Returns the exceptions and other throwables listed in this
* method or constructor's {@code throws} clause in declaration
* order.
--- a/langtools/src/share/classes/javax/lang/model/element/Modifier.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/javax/lang/model/element/Modifier.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -61,16 +61,10 @@
/** The modifier {@code native} */ NATIVE,
/** The modifier {@code strictfp} */ STRICTFP;
-
- private String lowercase = null; // modifier name in lowercase
-
/**
* Returns this modifier's name in lowercase.
*/
public String toString() {
- if (lowercase == null) {
- lowercase = name().toLowerCase(java.util.Locale.US);
- }
- return lowercase;
+ return name().toLowerCase(java.util.Locale.US);
}
}
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2011, 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
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor8.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor8.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
--- a/langtools/src/share/classes/javax/lang/model/util/ElementFilter.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementFilter.java Tue Jan 01 17:49:22 2013 -0800
@@ -66,19 +66,19 @@
public class ElementFilter {
private ElementFilter() {} // Do not instantiate.
- private static Set<ElementKind> CONSTRUCTOR_KIND =
+ private static final Set<ElementKind> CONSTRUCTOR_KIND =
Collections.unmodifiableSet(EnumSet.of(ElementKind.CONSTRUCTOR));
- private static Set<ElementKind> FIELD_KINDS =
+ private static final Set<ElementKind> FIELD_KINDS =
Collections.unmodifiableSet(EnumSet.of(ElementKind.FIELD,
ElementKind.ENUM_CONSTANT));
- private static Set<ElementKind> METHOD_KIND =
+ private static final Set<ElementKind> METHOD_KIND =
Collections.unmodifiableSet(EnumSet.of(ElementKind.METHOD));
- private static Set<ElementKind> PACKAGE_KIND =
+ private static final Set<ElementKind> PACKAGE_KIND =
Collections.unmodifiableSet(EnumSet.of(ElementKind.PACKAGE));
- private static Set<ElementKind> TYPE_KINDS =
+ private static final Set<ElementKind> TYPE_KINDS =
Collections.unmodifiableSet(EnumSet.of(ElementKind.CLASS,
ElementKind.ENUM,
ElementKind.INTERFACE,
--- a/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor8.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor8.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
--- a/langtools/src/share/classes/javax/tools/StandardLocation.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/src/share/classes/javax/tools/StandardLocation.java Tue Jan 01 17:49:22 2013 -0800
@@ -97,7 +97,7 @@
return locations.get(name);
}
//where
- private static ConcurrentMap<String,Location> locations
+ private static final ConcurrentMap<String,Location> locations
= new ConcurrentHashMap<String,Location>();
public String getName() { return name(); }
--- a/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -207,7 +207,7 @@
"Instance Methods</a></span><span class=\"tabEnd\"> </span></span>" +
"<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">" +
"Concrete Methods</a></span><span class=\"tabEnd\"> </span></span>" +
- "<span id=\"t5\" class=\"tableTab\"><span><a href=\"javascript:show(16);\">" +
+ "<span id=\"t6\" class=\"tableTab\"><span><a href=\"javascript:show(32);\">" +
"Deprecated Methods</a></span><span class=\"tabEnd\"> </span></span>" +
"</caption>"
},
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8004893
+ * @summary Make sure that the lambda feature changes work fine in
+ * javadoc.
+ * @author bpatel
+ * @library ../lib/
+ * @build JavadocTester TestLambdaFeature
+ * @run main TestLambdaFeature
+ */
+
+public class TestLambdaFeature extends JavadocTester {
+
+ //Test information.
+ private static final String BUG_ID = "8004893";
+
+ //Javadoc arguments.
+ private static final String[] ARGS = new String[] {
+ "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
+ };
+
+ //Input for string search tests.
+ private static final String[][] TEST = {
+ {BUG_ID + FS + "pkg" + FS + "A.html",
+ "<td class=\"colFirst\"><code>default void</code></td>"},
+ {BUG_ID + FS + "pkg" + FS + "A.html",
+ "<pre>default void defaultMethod()</pre>"},
+ {BUG_ID + FS + "pkg" + FS + "A.html",
+ "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
+ "All Methods</span><span class=\"tabEnd\"> </span></span>" +
+ "<span id=\"t2\" class=\"tableTab\"><span>" +
+ "<a href=\"javascript:show(2);\">Instance Methods</a></span>" +
+ "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " +
+ "class=\"tableTab\"><span><a href=\"javascript:show(4);\">" +
+ "Abstract Methods</a></span><span class=\"tabEnd\"> </span>" +
+ "</span><span id=\"t5\" class=\"tableTab\"><span>" +
+ "<a href=\"javascript:show(16);\">Default Methods</a></span>" +
+ "<span class=\"tabEnd\"> </span></span></caption>"},
+ {BUG_ID + FS + "pkg" + FS + "A.html",
+ "<dl>" + NL + "<dt>Functional Interface:</dt>" + NL +
+ "<dd>This is a functional interface and can therefore be used as " +
+ "the assignment target for a lambda expression or method " +
+ "reference. </dd>" + NL + "</dl>"}
+ };
+ private static final String[][] NEGATED_TEST = {
+ {BUG_ID + FS + "pkg" + FS + "A.html",
+ "<td class=\"colFirst\"><code>default default void</code></td>"},
+ {BUG_ID + FS + "pkg" + FS + "A.html",
+ "<pre>default default void defaultMethod()</pre>"},
+ {BUG_ID + FS + "pkg" + FS + "B.html",
+ "<td class=\"colFirst\"><code>default void</code></td>"},
+ {BUG_ID + FS + "pkg" + FS + "B.html",
+ "<dl>" + NL + "<dt>Functional Interface:</dt>"}
+ };
+
+ /**
+ * The entry point of the test.
+ * @param args the array of command line arguments.
+ */
+ public static void main(String[] args) {
+ TestLambdaFeature tester = new TestLambdaFeature();
+ run(tester, ARGS, TEST, NEGATED_TEST);
+ tester.printSummary();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getBugId() {
+ return BUG_ID;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getBugName() {
+ return getClass().getName();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testLambdaFeature/pkg/A.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 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.
+ */
+
+package pkg;
+
+public interface A {
+
+ public void method1();
+
+ public default void defaultMethod() { }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testLambdaFeature/pkg/B.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 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.
+ */
+
+package pkg;
+
+public abstract class B {
+
+ public abstract void method1();
+
+ public void method2() { }
+}
--- a/langtools/test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java Tue Jan 01 17:49:22 2013 -0800
@@ -55,7 +55,7 @@
"Instance Methods</a></span><span class=\"tabEnd\"> </span></span>" +
"<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">" +
"Concrete Methods</a></span><span class=\"tabEnd\"> </span></span>" +
- "<span id=\"t5\" class=\"tableTab\"><span><a href=\"javascript:show(16);\">" +
+ "<span id=\"t6\" class=\"tableTab\"><span><a href=\"javascript:show(32);\">" +
"Deprecated Methods</a></span><span class=\"tabEnd\"> </span></span>" +
"</caption>"
},
@@ -87,7 +87,7 @@
"Abstract Methods</a></span><span class=\"tabEnd\"> </span></span>" +
"<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">" +
"Concrete Methods</a></span><span class=\"tabEnd\"> </span></span>" +
- "<span id=\"t5\" class=\"tableTab\"><span><a href=\"javascript:show(16);\">" +
+ "<span id=\"t6\" class=\"tableTab\"><span><a href=\"javascript:show(32);\">" +
"Deprecated Methods</a></span><span class=\"tabEnd\"> </span></span>" +
"</caption>"
},
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/AccessTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,65 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -ref AccessTest.protected.out AccessTest.java
+ * @run main DocLintTester -Xmsgs -ref AccessTest.private.out AccessTest.java
+ * @run main DocLintTester -Xmsgs:syntax -ref AccessTest.private.out AccessTest.java
+ * @run main DocLintTester -Xmsgs:syntax/public -ref AccessTest.public.out AccessTest.java
+ * @run main DocLintTester -Xmsgs:syntax/protected -ref AccessTest.protected.out AccessTest.java
+ * @run main DocLintTester -Xmsgs:syntax/package -ref AccessTest.package.out AccessTest.java
+ * @run main DocLintTester -Xmsgs:syntax/private -ref AccessTest.private.out AccessTest.java
+ * @run main DocLintTester -Xmsgs:all,-syntax AccessTest.java
+ * @run main DocLintTester -Xmsgs:all,-syntax/public AccessTest.java
+ * @run main DocLintTester -Xmsgs:all,-syntax/protected -ref AccessTest.public.out AccessTest.java
+ * @run main DocLintTester -Xmsgs:all,-syntax/package -ref AccessTest.protected.out AccessTest.java
+ * @run main DocLintTester -Xmsgs:all,-syntax/private -ref AccessTest.package.out AccessTest.java
+ */
+
+/** */
+public class AccessTest {
+ /**
+ * public a < b
+ */
+ public void public_syntax_error() { }
+
+ /**
+ * protected a < b
+ */
+ protected void protected_syntax_error() { }
+
+ /**
+ * package-private a < b
+ */
+ void syntax_error() { }
+
+ /**
+ * private a < b
+ */
+ private void private_syntax_error() { }
+}
+
+/** */
+class AccessTest2 {
+ /**
+ * public a < b
+ */
+ public void public_syntax_error() { }
+
+ /**
+ * protected a < b
+ */
+ protected void protected_syntax_error() { }
+
+ /**
+ * package-private a < b
+ */
+ void syntax_error() { }
+
+ /**
+ * private a < b
+ */
+ private void private_syntax_error() { }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/AccessTest.package.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,20 @@
+AccessTest.java:23: error: malformed HTML
+ * public a < b
+ ^
+AccessTest.java:28: error: malformed HTML
+ * protected a < b
+ ^
+AccessTest.java:33: error: malformed HTML
+ * package-private a < b
+ ^
+AccessTest.java:46: error: malformed HTML
+ * public a < b
+ ^
+AccessTest.java:51: error: malformed HTML
+ * protected a < b
+ ^
+AccessTest.java:56: error: malformed HTML
+ * package-private a < b
+ ^
+6 errors
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/AccessTest.private.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,27 @@
+AccessTest.java:23: error: malformed HTML
+ * public a < b
+ ^
+AccessTest.java:28: error: malformed HTML
+ * protected a < b
+ ^
+AccessTest.java:33: error: malformed HTML
+ * package-private a < b
+ ^
+AccessTest.java:38: error: malformed HTML
+ * private a < b
+ ^
+AccessTest.java:46: error: malformed HTML
+ * public a < b
+ ^
+AccessTest.java:51: error: malformed HTML
+ * protected a < b
+ ^
+AccessTest.java:56: error: malformed HTML
+ * package-private a < b
+ ^
+AccessTest.java:61: error: malformed HTML
+ * private a < b
+ ^
+8 errors
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/AccessTest.protected.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,8 @@
+AccessTest.java:23: error: malformed HTML
+ * public a < b
+ ^
+AccessTest.java:28: error: malformed HTML
+ * protected a < b
+ ^
+2 errors
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/AccessTest.public.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,5 @@
+AccessTest.java:23: error: malformed HTML
+ * public a < b
+ ^
+1 error
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/AccessibilityTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,44 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-accessibility AccessibilityTest.java
+ * @run main DocLintTester -ref AccessibilityTest.out AccessibilityTest.java
+ */
+
+/** */
+public class AccessibilityTest {
+
+ /**
+ * <h2> ... </h2>
+ */
+ public void missing_h1() { }
+
+ /**
+ * <h1> ... </h1>
+ * <h3> ... </h3>
+ */
+ public void missing_h2() { }
+
+ /**
+ * <img src="x.jpg">
+ */
+ public void missing_alt() { }
+
+ /**
+ * <table summary="ok"><tr><th>head<tr><td>data</table>
+ */
+ public void table_with_summary() { }
+
+ /**
+ * <table><caption>ok</caption><tr><th>head<tr><td>data</table>
+ */
+ public void table_with_caption() { }
+
+ /**
+ * <table><tr><th>head<tr><td>data</table>
+ */
+ public void table_without_summary_and_caption() { }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/AccessibilityTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,13 @@
+AccessibilityTest.java:14: error: header used out of sequence: <H2>
+ * <h2> ... </h2>
+ ^
+AccessibilityTest.java:20: error: header used out of sequence: <H3>
+ * <h3> ... </h3>
+ ^
+AccessibilityTest.java:25: error: no "alt" attribute for image
+ * <img src="x.jpg">
+ ^
+AccessibilityTest.java:40: error: no summary or caption for table
+ * <table><tr><th>head<tr><td>data</table>
+ ^
+4 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/DocLintTester.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 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.
+ */
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.sun.tools.doclint.DocLint;
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+
+public class DocLintTester {
+
+ public static void main(String... args) throws Exception {
+ new DocLintTester().run(args);
+ }
+
+ public void run(String... args) throws Exception {
+ String testSrc = System.getProperty("test.src");
+
+ File refFile = null;
+ List<String> opts = new ArrayList<String>();
+ List<File> files = new ArrayList<File>();
+ for (int i = 0; i < args.length; i++) {
+ String arg = args[i];
+ if (arg.equals("-ref")) {
+ refFile = new File(testSrc, args[++i]);
+ } else if (arg.startsWith("-Xmsgs")) {
+ opts.add(arg);
+ } else
+ files.add(new File(testSrc, arg));
+ }
+
+ check(opts, files, refFile);
+
+ if (errors > 0)
+ throw new Exception(errors + " errors occurred");
+ }
+
+ void check(List<String> opts, List<File> files, File refFile) throws Exception {
+ List<String> args = new ArrayList<String>();
+ args.addAll(opts);
+ for (File file: files)
+ args.add(file.getPath());
+
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ new DocLint().run(pw, args.toArray(new String[args.size()]));
+ pw.flush();
+ String out = normalizeNewlines(removeFileNames(sw.toString())).trim();
+ if (out != null)
+ System.err.println("Output:\n" + out);
+
+ if (refFile == null) {
+ if (!out.isEmpty())
+ error("unexpected output");
+ } else {
+ String expect = readFile(refFile);
+ if (!expect.equals(out)) {
+ error("expected output not found");
+ System.err.println("EXPECT>>" + expect + "<<");
+ System.err.println(" FOUND>>" + out + "<<");
+ }
+ }
+ }
+
+ String readFile(File file) throws IOException {
+ StringBuilder sb = new StringBuilder();
+ Reader in = new BufferedReader(new FileReader(file));
+ try {
+ char[] buf = new char[1024];
+ int n;
+ while ((n = in.read(buf)) != -1)
+ sb.append(buf, 0, n);
+ } finally {
+ in.close();
+ }
+ return sb.toString().trim();
+ }
+
+ private static final Pattern dirFileLine = Pattern.compile(
+ "(?m)" // multi-line mode
+ + "^([^: ]+?)" // directory part of file name
+ + "([A-Za-z0-9.]+:[0-9]+:)"); // file name and line number
+
+ String removeFileNames(String s) {
+ Matcher m = dirFileLine.matcher(s);
+ StringBuffer sb = new StringBuffer();
+ while (m.find()) {
+ m.appendReplacement(sb, "$2");
+ }
+ m.appendTail(sb);
+ return sb.toString();
+ }
+
+ private static final String nl = System.getProperty("line.separator");
+ String normalizeNewlines(String s) {
+ return (nl.equals("\n") ? s : s.replace(nl, "\n"));
+ }
+
+
+ void error(String msg) {
+ System.err.println("Error: " + msg);
+ errors++;
+ }
+
+ int errors;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptyAuthorTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,12 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-syntax EmptyAuthorTest.java
+ * @run main DocLintTester -Xmsgs:syntax -ref EmptyAuthorTest.out EmptyAuthorTest.java
+ */
+
+/** @author */
+public class EmptyAuthorTest {
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptyAuthorTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,5 @@
+EmptyAuthorTest.java:10: warning: no description for @author
+/** @author */
+ ^
+1 warning
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptyExceptionTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-syntax EmptyExceptionTest.java
+ * @run main DocLintTester -Xmsgs:syntax -ref EmptyExceptionTest.out EmptyExceptionTest.java
+ */
+
+/** . */
+public class EmptyExceptionTest {
+ /** @exception NullPointerException */
+ int emptyException() throws NullPointerException { }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptyExceptionTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,4 @@
+EmptyExceptionTest.java:12: warning: no description for @exception
+ /** @exception NullPointerException */
+ ^
+1 warning
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptyParamTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-syntax EmptyParamTest.java
+ * @run main DocLintTester -Xmsgs:syntax -ref EmptyParamTest.out EmptyParamTest.java
+ */
+
+/** . */
+public class EmptyParamTest {
+ /** @param i */
+ int emptyParam(int i) { }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptyParamTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,5 @@
+EmptyParamTest.java:12: warning: no description for @param
+ /** @param i */
+ ^
+1 warning
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptyReturnTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-syntax EmptyReturnTest.java
+ * @run main DocLintTester -Xmsgs:syntax -ref EmptyReturnTest.out EmptyReturnTest.java
+ */
+
+/** . */
+public class EmptyReturnTest {
+ /** @return */
+ int emptyReturn() { }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptyReturnTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,5 @@
+EmptyReturnTest.java:12: warning: no description for @return
+ /** @return */
+ ^
+1 warning
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptySerialDataTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,17 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-syntax EmptySerialDataTest.java
+ * @run main DocLintTester -Xmsgs:syntax -ref EmptySerialDataTest.out EmptySerialDataTest.java
+ */
+
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+
+/** . */
+public class EmptySerialDataTest implements Serializable {
+ /** @serialData */
+ private void writeObject(ObjectOutputStream s) { }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptySerialDataTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,5 @@
+EmptySerialDataTest.java:15: warning: no description for @serialData
+ /** @serialData */
+ ^
+1 warning
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptySerialFieldTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,22 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-syntax EmptySerialFieldTest.java
+ * @run main DocLintTester -Xmsgs:syntax -ref EmptySerialFieldTest.out EmptySerialFieldTest.java
+ */
+
+import java.io.ObjectStreamField;
+import java.io.Serializable;
+
+/** . */
+public class EmptySerialFieldTest implements Serializable {
+
+ /**
+ * @serialField empty String
+ */
+ private static final ObjectStreamField[] serialPersistentFields = {
+ new ObjectStreamField("empty", String.class),
+ };
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptySerialFieldTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,5 @@
+EmptySerialFieldTest.java:17: warning: no description for @serialField
+ * @serialField empty String
+ ^
+1 warning
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptySinceTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-syntax EmptySinceTest.java
+ * @run main DocLintTester -Xmsgs:syntax -ref EmptySinceTest.out EmptySinceTest.java
+ */
+
+/** . */
+public class EmptySinceTest {
+ /** @since */
+ int emptySince() { }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptySinceTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,5 @@
+EmptySinceTest.java:12: warning: no description for @since
+ /** @since */
+ ^
+1 warning
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptyVersionTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-syntax EmptyVersionTest.java
+ * @run main DocLintTester -Xmsgs:syntax -ref EmptyVersionTest.out EmptyVersionTest.java
+ */
+
+/** . */
+public class EmptyVersionTest {
+ /** @version */
+ int missingVersion() { }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/EmptyVersionTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,4 @@
+EmptyVersionTest.java:12: warning: no description for @version
+ /** @version */
+ ^
+1 warning
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/HtmlAttrsTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,27 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-html HtmlAttrsTest.java
+ * @run main DocLintTester -ref HtmlAttrsTest.out HtmlAttrsTest.java
+ */
+
+/** */
+public class HtmlAttrsTest {
+ /**
+ * <p xyz>
+ */
+ public void unknown() { }
+
+ /**
+ * <img name="x" alt="alt">
+ */
+ public void obsolete() { }
+
+ /**
+ * <font size="3"> text </font>
+ */
+ public void obsolete_use_css() { }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/HtmlAttrsTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,12 @@
+HtmlAttrsTest.java:13: error: unknown attribute: xyz
+ * <p xyz>
+ ^
+HtmlAttrsTest.java:18: warning: attribute obsolete: name
+ * <img name="x" alt="alt">
+ ^
+HtmlAttrsTest.java:23: warning: attribute obsolete, use CSS instead: size
+ * <font size="3"> text </font>
+ ^
+1 error
+2 warnings
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/HtmlTagsTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,58 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-html HtmlTagsTest.java
+ * @run main DocLintTester -ref HtmlTagsTest.out HtmlTagsTest.java
+ */
+
+/** */
+public class HtmlTagsTest {
+ /**
+ * <xyz> ... </xyz>
+ */
+ public void unknownTag1() { }
+
+ /**
+ * <div> <xyz> </div>
+ */
+ public void unknownTag2() { }
+
+ /**
+ * <br/>
+ */
+ public void selfClosingTag() { }
+
+ /**
+ * <html>
+ */
+ public void not_allowed() { }
+
+ /**
+ * <span> <p> </span>
+ */
+ public void not_allowed_inline() { }
+
+ /**
+ * {@link java.lang.String <p> }
+ * {@link java.lang.String <p> }
+ */
+ public void not_allowed_inline_2() { }
+
+ /**
+ * <img src="any.jpg" alt="alt"> </img>
+ */
+ public void end_not_allowed() { }
+
+ /**
+ * <i> <b> </i>
+ */
+ public void start_not_matched() { }
+
+ /**
+ * <i> </b> </i>
+ */
+ public void end_unexpected() { }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/HtmlTagsTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,38 @@
+HtmlTagsTest.java:13: error: unknown tag: xyz
+ * <xyz> ... </xyz>
+ ^
+HtmlTagsTest.java:13: error: unknown tag: xyz
+ * <xyz> ... </xyz>
+ ^
+HtmlTagsTest.java:18: error: unknown tag: xyz
+ * <div> <xyz> </div>
+ ^
+HtmlTagsTest.java:23: error: self-closing element not allowed
+ * <br/>
+ ^
+HtmlTagsTest.java:28: error: element not allowed in documentation comments: <html>
+ * <html>
+ ^
+HtmlTagsTest.java:33: error: block element not allowed within inline element <span>: p
+ * <span> <p> </span>
+ ^
+HtmlTagsTest.java:38: error: block element not allowed within @link: p
+ * {@link java.lang.String <p> }
+ ^
+HtmlTagsTest.java:39: error: block element not allowed within @link: p
+ * {@link java.lang.String <p> }
+ ^
+HtmlTagsTest.java:44: error: invalid end tag: </img>
+ * <img src="any.jpg" alt="alt"> </img>
+ ^
+HtmlTagsTest.java:49: error: end tag missing: </b>
+ * <i> <b> </i>
+ ^
+HtmlTagsTest.java:54: error: unexpected end tag: </b>
+ * <i> </b> </i>
+ ^
+HtmlTagsTest.java:54: warning: empty <i> tag
+ * <i> </b> </i>
+ ^
+11 errors
+1 warning
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/MissingCommentTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-missing MissingCommentTest.java
+ * @run main DocLintTester -Xmsgs:missing -ref MissingCommentTest.out MissingCommentTest.java
+ */
+
+public class MissingCommentTest {
+ MissingCommentTest() { }
+
+ int missingComment;
+
+ void missingComment() { }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/MissingCommentTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,14 @@
+MissingCommentTest.java:8: warning: no comment
+public class MissingCommentTest {
+ ^
+MissingCommentTest.java:9: warning: no comment
+ MissingCommentTest() { }
+ ^
+MissingCommentTest.java:11: warning: no comment
+ int missingComment;
+ ^
+MissingCommentTest.java:13: warning: no comment
+ void missingComment() { }
+ ^
+4 warnings
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/MissingParamsTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,23 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-missing MissingParamsTest.java
+ * @run main DocLintTester -Xmsgs:missing -ref MissingParamsTest.out MissingParamsTest.java
+ */
+
+/** . */
+public class MissingParamsTest {
+ /** */
+ MissingParamsTest(int param) { }
+
+ /** */
+ <T> MissingParamsTest() { }
+
+ /** */
+ void missingParam(int param) { }
+
+ /** */
+ <T> void missingTyparam() { }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/MissingParamsTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,14 @@
+MissingParamsTest.java:13: warning: no @param for param
+ MissingParamsTest(int param) { }
+ ^
+MissingParamsTest.java:16: warning: no @param for <T>
+ <T> MissingParamsTest() { }
+ ^
+MissingParamsTest.java:19: warning: no @param for param
+ void missingParam(int param) { }
+ ^
+MissingParamsTest.java:22: warning: no @param for <T>
+ <T> void missingTyparam() { }
+ ^
+4 warnings
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/MissingReturnTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,23 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-missing MissingReturnTest.java
+ * @run main DocLintTester -Xmsgs:missing -ref MissingReturnTest.out MissingReturnTest.java
+ */
+
+/** . */
+public class MissingReturnTest {
+ /** no return allowed */
+ MissingReturnTest() { }
+
+ /** no return allowed */
+ void return_void() { }
+
+ /** no return required */
+ Void return_Void() { }
+
+ /** */
+ int missingReturn() { }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/MissingReturnTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,5 @@
+MissingReturnTest.java:22: warning: no @return
+ int missingReturn() { }
+ ^
+1 warning
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/MissingThrowsTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-missing MissingThrowsTest.java
+ * @run main DocLintTester -Xmsgs:missing -ref MissingThrowsTest.out MissingThrowsTest.java
+ */
+
+/** */
+public class MissingThrowsTest {
+ /** */
+ void missingThrows() throws Exception { }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/MissingThrowsTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,4 @@
+MissingThrowsTest.java:13: warning: no @throws for java.lang.Exception
+ void missingThrows() throws Exception { }
+ ^
+1 warning
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/OptionTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8004832
+ * @summary Add new doclint package
+ */
+
+import com.sun.tools.doclint.DocLint;
+
+public class OptionTest {
+ public static void main(String... args) throws Exception {
+ new OptionTest().run();
+ }
+
+ String[] positiveTests = {
+ "-Xmsgs",
+ "-Xmsgs:all",
+ "-Xmsgs:none",
+ "-Xmsgs:accessibility",
+ "-Xmsgs:html",
+ "-Xmsgs:missing",
+ "-Xmsgs:reference",
+ "-Xmsgs:syntax",
+ "-Xmsgs:html/public",
+ "-Xmsgs:html/protected",
+ "-Xmsgs:html/package",
+ "-Xmsgs:html/private",
+ "-Xmsgs:-html/public",
+ "-Xmsgs:-html/protected",
+ "-Xmsgs:-html/package",
+ "-Xmsgs:-html/private",
+ "-Xmsgs:html,syntax",
+ "-Xmsgs:html,-syntax",
+ "-Xmsgs:-html,syntax",
+ "-Xmsgs:-html,-syntax",
+ "-Xmsgs:html/public,syntax",
+ "-Xmsgs:html,syntax/public",
+ "-Xmsgs:-html/public,syntax/public"
+ };
+
+ String[] negativeTests = {
+ "-typo",
+ "-Xmsgs:-all",
+ "-Xmsgs:-none",
+ "-Xmsgs:typo",
+ "-Xmsgs:html/typo",
+ "-Xmsgs:html/public,typo",
+ "-Xmsgs:html/public,syntax/typo",
+ };
+
+ void run() throws Exception {
+ test(positiveTests, true);
+ test(negativeTests, false);
+
+ if (errors > 0)
+ throw new Exception(errors + " errors occurred");
+ }
+
+ void test(String[] tests, boolean expect) {
+ for (String test: tests) {
+ System.err.println("test: " + test);
+ boolean found = DocLint.isValidOption(test);
+ if (found != expect)
+ error("Unexpected result: " + found + ",expected: " + expect);
+ }
+ }
+
+ void error(String msg) {
+ System.err.println("Error: " + msg);
+ errors++;
+ }
+
+ int errors;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/OverridesTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:all OverridesTest.java
+ */
+
+/*
+ * This is a test that missing comments on methods may be inherited
+ * from overridden methods. As such, there should be no errors due
+ * to missing comments (or any other types of error) in this test.
+ */
+
+/** An interface. */
+interface I1 {
+ /**
+ * A method
+ * @param p a param
+ * @throws Exception an exception
+ * @return an int
+ */
+ int m(int p) throws Exception;
+}
+
+/** An extending interface. */
+interface I2 extends I1 { }
+
+/** An abstract class. */
+abstract class C1 {
+ /**
+ * A method
+ * @param p a param
+ * @throws Exception an exception
+ * @return an int
+ */
+ int m(int p) throws Exception;
+}
+
+/** An implementing class. */
+class C2 implements I1 {
+ int m(int p) throws Exception { return p; }
+}
+
+/** An extending class. */
+class C3 extends C1 {
+ int m(int p) throws Exception { return p; }
+}
+
+/** An extending and implementing class. */
+class C4 extends C1 implements I1 {
+ int m(int p) throws Exception { return p; }
+}
+
+/** An implementing class using inheritdoc. */
+class C5 implements I1 {
+ /** {@inheritDoc} */
+ int m(int p) throws Exception { return p; }
+}
+
+/** An implementing class with incomplete documentation. */
+class C6 implements I1 {
+ /** Overriding method */
+ int m(int p) throws Exception { return p; }
+}
+
+/** A class implementing an inherited interface. */
+class C7 implements I2 {
+ int m(int p) throws Exception { return p; }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/ReferenceTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,52 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-reference ReferenceTest.java
+ * @run main DocLintTester -ref ReferenceTest.out ReferenceTest.java
+ */
+
+/** */
+public class ReferenceTest {
+ /**
+ * @param x description
+ */
+ public int invalid_param;
+
+ /**
+ * @param x description
+ */
+ public class InvalidParam { }
+
+ /**
+ * @param x description
+ */
+ public void param_name_not_found(int a) { }
+
+ /**
+ * @param <X> description
+ */
+ public class typaram_name_not_found { }
+
+ /**
+ * @see Object#tooStrong()
+ */
+ public void ref_not_found() { }
+
+ /**
+ * @return x description
+ */
+ public int invalid_return;
+
+ /**
+ * @return x description
+ */
+ public void invalid_return();
+
+ /**
+ * @throws Exception description
+ */
+ public void exception_not_thrown() { }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/ReferenceTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,30 @@
+ReferenceTest.java:13: error: invalid use of @param
+ * @param x description
+ ^
+ReferenceTest.java:18: error: invalid use of @param
+ * @param x description
+ ^
+ReferenceTest.java:23: error: @param name not found
+ * @param x description
+ ^
+ReferenceTest.java:25: warning: no @param for a
+ public void param_name_not_found(int a) { }
+ ^
+ReferenceTest.java:28: error: @param name not found
+ * @param <X> description
+ ^
+ReferenceTest.java:33: error: reference not found
+ * @see Object#tooStrong()
+ ^
+ReferenceTest.java:38: error: invalid use of @return
+ * @return x description
+ ^
+ReferenceTest.java:43: error: invalid use of @return
+ * @return x description
+ ^
+ReferenceTest.java:48: error: exception not thrown: java.lang.Exception
+ * @throws Exception description
+ ^
+8 errors
+1 warning
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/RunTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/* @test
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @bug 8000103
+ * @summary Create doclint utility
+ */
+
+import com.sun.tools.doclint.DocLint;
+import com.sun.tools.doclint.DocLint.BadArgs;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FilterOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/** javadoc error on toplevel: a & b. */
+public class RunTest {
+ /** javadoc error on member: a < b */
+ public static void main(String... args) throws Exception {
+ new RunTest().run();
+ }
+
+
+ File testSrc = new File(System.getProperty("test.src"));
+ File thisFile = new File(testSrc, RunTest.class.getSimpleName() + ".java");
+
+ void run() throws Exception {
+ for (Method m: getClass().getDeclaredMethods()) {
+ Annotation a = m.getAnnotation(Test.class);
+ if (a != null) {
+ System.err.println("test: " + m.getName());
+ try {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);;
+ m.invoke(this, new Object[] { pw });
+ String out = sw.toString();
+ System.err.println(">>> " + out.replace("\n", "\n>>> "));
+ if (!out.contains("a < b"))
+ error("\"a < b\" not found");
+ if (!out.contains("a & b"))
+ error("\"a & b\" not found");
+ } catch (InvocationTargetException e) {
+ Throwable cause = e.getCause();
+ throw (cause instanceof Exception) ? ((Exception) cause) : e;
+ }
+ System.err.println();
+ }
+ }
+
+ if (errors > 0)
+ throw new Exception(errors + " errors occurred");
+ }
+
+
+ void error(String msg) {
+ System.err.println("Error: " + msg);
+ errors++;
+ }
+
+ int errors;
+
+ /** Marker annotation for test cases. */
+ @Retention(RetentionPolicy.RUNTIME)
+ @interface Test { }
+
+ @Test
+ void testMain(PrintWriter pw) throws BadArgs, IOException {
+ String[] args = { "-Xmsgs", thisFile.getPath() };
+ DocLint d = new DocLint();
+ d.run(pw, args);
+ }
+}
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/SyntaxTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,17 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:-syntax SyntaxTest.java
+ * @run main DocLintTester -ref SyntaxTest.out SyntaxTest.java
+ */
+
+/** */
+public class SyntaxTest {
+ /**
+ * a < b
+ */
+ public void syntax_error() { }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/SyntaxTest.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,5 @@
+SyntaxTest.java:13: error: malformed HTML
+ * a < b
+ ^
+1 error
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/SyntheticTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:all SyntheticTest.java
+ */
+
+/**
+ * This is a test that messages are not generated for synthesized elements
+ * such as default constructors and enum methods.
+ */
+public class SyntheticTest {
+ // No explicit constructor implies a default constructor
+
+ /** enum E */
+ enum E {
+ /** enum member E1 */
+ E1,
+ /** enum member E2 */
+ E2,
+ /** enum member E3 */
+ E3
+ }
+}
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/ValidTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @build DocLintTester
+ * @run main DocLintTester ValidTest.java
+ */
+
+class ValidTest {
+ /**
+ * < > & (
+ */
+ void entities() { }
+
+ /**
+ * <h1> ... </h1>
+ * <h2> ... </h2>
+ * <h3> ... </h3>
+ * <h4> ... </h4>
+ * <h5> ... </h5>
+ * <h6> ... </h6>
+ */
+ void all_headers() { }
+
+ /**
+ * <h1> ... </h1>
+ * <h2> ... </h2>
+ * <h3> ... </h3>
+ * <h1> ... </h1>
+ * <h2> ... </h2>
+ * <h3> ... </h3>
+ * <h2> ... </h2>
+ */
+ void header_series() { }
+
+ /**
+ * <div> <p> </div>
+ */
+ void autoclose_tags() { }
+
+ /**
+ * @param x
+ */
+ void method_param(int x) { }
+
+ /**
+ * @param <T>
+ */
+ <T> T method_typaram(T t) { return t; }
+
+ /**
+ * @param <T>
+ */
+ class ClassTyparam<T> { }
+
+ /**
+ * @param <T>
+ */
+ interface InterfaceTyparam<T> { }
+
+ /**
+ * @return x
+ */
+ int return_int() { return 0; }
+
+ /**
+ * @exception Exception
+ */
+ void throws_Exception1() throws Exception { }
+
+ /**
+ * @throws Exception
+ */
+ void throws_Exception2() throws Exception { }
+
+ class X {
+ /**
+ * @param x
+ */
+ X(int x) { } // constructor parameter
+
+ /**
+ * @param <T>
+ */
+ <T> X(T t) { } // constructor type parameter
+ }
+
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/AnchorAlreadyDefined.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,17 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref AnchorAlreadyDefined.out AnchorAlreadyDefined.java
+ */
+
+// tidy: Warning: <.*> anchor ".*" already defined
+
+/**
+ * <a name="here">valid</a>
+ * <a name="here">duplicate</a>
+ * <h1 id="here">duplicate</h1>
+ */
+public class AnchorAlreadyDefined { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/AnchorAlreadyDefined.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,7 @@
+AnchorAlreadyDefined.java:14: error: anchor already defined: here
+ * <a name="here">duplicate</a>
+ ^
+AnchorAlreadyDefined.java:15: error: anchor already defined: here
+ * <h1 id="here">duplicate</h1>
+ ^
+2 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/BadEnd.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,16 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref BadEnd.out BadEnd.java
+ */
+
+// tidy: Warning: <.*> is probably intended as </.*>
+
+/**
+ * <a name="here"> text <a>
+ * <code> text <code>
+ */
+public class BadEnd { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/BadEnd.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,17 @@
+BadEnd.java:14: warning: nested tag not allowed: <code>
+ * <code> text <code>
+ ^
+BadEnd.java:14: error: element not closed: code
+ * <code> text <code>
+ ^
+BadEnd.java:14: error: element not closed: code
+ * <code> text <code>
+ ^
+BadEnd.java:13: error: element not closed: a
+ * <a name="here"> text <a>
+ ^
+BadEnd.java:13: error: element not closed: a
+ * <a name="here"> text <a>
+ ^
+4 errors
+1 warning
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/InsertImplicit.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,16 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref InsertImplicit.out InsertImplicit.java
+ */
+
+// tidy: Warning: inserting implicit <.*>
+
+/**
+ * </p>
+ * <i> <blockquote> abc </blockquote> </i>
+ */
+public class InsertImplicit { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/InsertImplicit.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,7 @@
+InsertImplicit.java:13: error: unexpected end tag: </p>
+ * </p>
+ ^
+InsertImplicit.java:14: error: block element not allowed within inline element <i>: blockquote
+ * <i> <blockquote> abc </blockquote> </i>
+ ^
+2 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/InvalidEntity.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,22 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref InvalidEntity.out InvalidEntity.java
+ */
+
+// tidy: Warning: replacing invalid numeric character reference .*
+
+// See
+// http://www.w3.org/TR/html4/sgml/entities.html
+// http://stackoverflow.com/questions/631406/what-is-the-difference-between-em-dash-151-and-8212
+
+/**
+ * 
+ * 
+ * &splodge;
+ *
+ */
+public class InvalidEntity { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/InvalidEntity.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,10 @@
+InvalidEntity.java:17: error: invalid entity 
+ * 
+ ^
+InvalidEntity.java:18: error: invalid entity 
+ * 
+ ^
+InvalidEntity.java:19: error: invalid entity &splodge;
+ * &splodge;
+ ^
+3 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/InvalidName.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,18 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref InvalidName.out InvalidName.java
+ */
+
+// tidy: Warning: <a> cannot copy name attribute to id
+
+/**
+ * <a name="abc">valid</a>
+ * <a name="abc123">valid</a>
+ * <a name="a.1:2-3_4">valid</a>
+ * <a name="foo()">invalid</a>
+ */
+public class InvalidName { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/InvalidName.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,4 @@
+InvalidName.java:16: error: invalid name for anchor: "foo()"
+ * <a name="foo()">invalid</a>
+ ^
+1 error
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/InvalidTag.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,15 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref InvalidTag.out InvalidTag.java
+ */
+
+// tidy: Error: <.*> is not recognized!
+
+/**
+ * List<String> list = new ArrayList<>();
+ */
+public class InvalidTag { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/InvalidTag.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,10 @@
+InvalidTag.java:13: error: unknown tag: String
+ * List<String> list = new ArrayList<>();
+ ^
+InvalidTag.java:13: error: malformed HTML
+ * List<String> list = new ArrayList<>();
+ ^
+InvalidTag.java:13: error: bad use of '>'
+ * List<String> list = new ArrayList<>();
+ ^
+3 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/InvalidURI.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,21 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref InvalidURI.out InvalidURI.java
+ */
+
+// tidy: Warning: <a> escaping malformed URI reference
+// tidy: Warning: <.*> attribute ".*" lacks value
+
+/**
+ * <a href="abc">valid</a>
+ * <a href="abc%20def">valid</a>
+ * <a href="abc def">invalid</a>
+ * <a href>no value</a>
+ * <a href= >no value</a>
+ * <a href="" >no value</a>
+ */
+public class InvalidURI { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/InvalidURI.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,13 @@
+InvalidURI.java:16: error: invalid uri: "abc def"
+ * <a href="abc def">invalid</a>
+ ^
+InvalidURI.java:17: error: attribute lacks value
+ * <a href>no value</a>
+ ^
+InvalidURI.java:18: error: attribute lacks value
+ * <a href= >no value</a>
+ ^
+InvalidURI.java:19: error: attribute lacks value
+ * <a href="" >no value</a>
+ ^
+4 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/MissingGT.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,16 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref MissingGT.out MissingGT.java
+ */
+
+// tidy: Warning: <.*> missing '>' for end of tag
+
+/**
+ * <img src="image.gif"
+ * <i> text </i>
+ */
+public class MissingGT { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/MissingGT.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,4 @@
+MissingGT.java:13: error: malformed HTML
+ * <img src="image.gif"
+ ^
+1 error
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/MissingTag.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,17 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref MissingTag.out MissingTag.java
+ */
+
+// tidy: Warning: missing <.*>
+// tidy: Warning: missing </.*> before </.*>
+
+/**
+ * </p>
+ * <h1> <b> text </h1>
+ */
+public class MissingTag { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/MissingTag.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,7 @@
+MissingTag.java:14: error: unexpected end tag: </p>
+ * </p>
+ ^
+MissingTag.java:15: error: end tag missing: </b>
+ * <h1> <b> text </h1>
+ ^
+2 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/NestedTag.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,16 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref NestedTag.out NestedTag.java
+ */
+
+// tidy: Warning: nested emphasis <.*>
+
+/**
+ * <b><b> text </b></b>
+ * {@link java.lang.String <code>String</code>}
+ */
+public class NestedTag { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/NestedTag.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,7 @@
+NestedTag.java:13: warning: nested tag not allowed: <b>
+ * <b><b> text </b></b>
+ ^
+NestedTag.java:14: warning: nested tag not allowed: <code>
+ * {@link java.lang.String <code>String</code>}
+ ^
+2 warnings
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/ParaInPre.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,20 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref ParaInPre.out ParaInPre.java
+ */
+
+// tidy: Warning: replacing <p> by <br>
+// tidy: Warning: using <br> in place of <p>
+
+/**
+ * <pre>
+ * text
+ * <p>
+ * more text
+ * </pre>
+ */
+public class ParaInPre { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/ParaInPre.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,4 @@
+ParaInPre.java:16: warning: unexpected use of <p> inside <pre> element
+ * <p>
+ ^
+1 warning
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/README.txt Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,21 @@
+The utilities in this directory can be used to determine
+common issues in javadoc comments by running the standard
+"tidy" program on the output of javadoc, and analysing
+the messages that are reported.
+
+tidy.sh is a script that will run the "tidy" program on
+the files in a directory, writing the results to a new
+directroy.
+
+tidystats.Main is a Java program that can analyze the
+files produced by the tidy.sh script to generate a
+summary report about the warnings that were found.
+
+
+The tests is this directory are focussed on verifying
+that doclint detects issues in javadoc comments that will
+give rise to issues detected by "tidy" in the output
+generated by javadoc.
+
+For more information on the "tidy" program, see the HTML Tidy
+Library Project page at http://tidy.sourceforge.net/.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/RepeatedAttr.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,15 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref RepeatedAttr.out RepeatedAttr.java
+ */
+
+// tidy: Warning: <.*> dropping value ".*" for repeated attribute ".*"
+
+/**
+ * <img src="image.gif" alt alt="summary">
+ */
+public class RepeatedAttr { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/RepeatedAttr.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,4 @@
+RepeatedAttr.java:13: error: repeated attribute: alt
+ * <img src="image.gif" alt alt="summary">
+ ^
+1 error
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/TextNotAllowed.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,26 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref TextNotAllowed.out TextNotAllowed.java
+ */
+
+// tidy: Warning: plain text isn't allowed in <.*> elements
+
+/**
+ * <table summary=description> abc </table>
+ * <table summary=description> <tbody> abc </tbody> </table>
+ * <table summary=description> <tr> abc </tr> </table>
+ *
+ * <dl> abc </dl>
+ * <ol> abc </ol>
+ * <ul> abc </ul>
+ *
+ * <ul>
+ * <li> item
+ * <li> item
+ * </ul>
+ */
+public class TextNotAllowed { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/TextNotAllowed.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,19 @@
+TextNotAllowed.java:13: error: text not allowed in <table> element
+ * <table summary=description> abc </table>
+ ^
+TextNotAllowed.java:14: error: text not allowed in <tbody> element
+ * <table summary=description> <tbody> abc </tbody> </table>
+ ^
+TextNotAllowed.java:15: error: text not allowed in <tr> element
+ * <table summary=description> <tr> abc </tr> </table>
+ ^
+TextNotAllowed.java:17: error: text not allowed in <dl> element
+ * <dl> abc </dl>
+ ^
+TextNotAllowed.java:18: error: text not allowed in <ol> element
+ * <ol> abc </ol>
+ ^
+TextNotAllowed.java:19: error: text not allowed in <ul> element
+ * <ul> abc </ul>
+ ^
+6 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/TrimmingEmptyTag.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,29 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref TrimmingEmptyTag.out TrimmingEmptyTag.java
+ */
+
+// tidy: Warning: trimming empty <.*>
+
+/**
+ * <b></b>
+ * <table summary=description></table>
+ * <table><caption></caption></table>
+ * <code></code>
+ * <dl></dl>
+ * <dl><dt></dt><dd></dd></dl>
+ * <font></font>
+ * <i></i>
+ * <ol></ol>
+ * <p></p>
+ * <pre></pre>
+ * <span></span>
+ * <tt></tt>
+ * <ul></ul>
+ * <ul><li></li></ul>
+ */
+public class TrimmingEmptyTag { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/TrimmingEmptyTag.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,46 @@
+TrimmingEmptyTag.java:13: warning: empty <b> tag
+ * <b></b>
+ ^
+TrimmingEmptyTag.java:14: warning: empty <table> tag
+ * <table summary=description></table>
+ ^
+TrimmingEmptyTag.java:15: warning: empty <caption> tag
+ * <table><caption></caption></table>
+ ^
+TrimmingEmptyTag.java:16: warning: empty <code> tag
+ * <code></code>
+ ^
+TrimmingEmptyTag.java:17: warning: empty <dl> tag
+ * <dl></dl>
+ ^
+TrimmingEmptyTag.java:18: warning: empty <dt> tag
+ * <dl><dt></dt><dd></dd></dl>
+ ^
+TrimmingEmptyTag.java:18: warning: empty <dd> tag
+ * <dl><dt></dt><dd></dd></dl>
+ ^
+TrimmingEmptyTag.java:19: warning: empty <font> tag
+ * <font></font>
+ ^
+TrimmingEmptyTag.java:20: warning: empty <i> tag
+ * <i></i>
+ ^
+TrimmingEmptyTag.java:21: warning: empty <ol> tag
+ * <ol></ol>
+ ^
+TrimmingEmptyTag.java:22: warning: empty <p> tag
+ * <p></p>
+ ^
+TrimmingEmptyTag.java:23: warning: empty <pre> tag
+ * <pre></pre>
+ ^
+TrimmingEmptyTag.java:24: warning: empty <span> tag
+ * <span></span>
+ ^
+TrimmingEmptyTag.java:25: warning: empty <tt> tag
+ * <tt></tt>
+ ^
+TrimmingEmptyTag.java:26: warning: empty <ul> tag
+ * <ul></ul>
+ ^
+15 warnings
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/UnescapedOrUnknownEntity.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,19 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8004832
+ * @summary Add new doclint package
+ * @library ..
+ * @build DocLintTester
+ * @run main DocLintTester -ref UnescapedOrUnknownEntity.out UnescapedOrUnknownEntity.java
+ */
+
+// tidy: Warning: unescaped & or unknown entity ".*"
+// tidy: Warning: unescaped & which should be written as &
+// tidy: Warning: entity ".*" doesn't end in ';'
+
+/**
+ * L&F
+ * Drag&Drop
+ * if (a & b);
+ */
+public class UnescapedOrUnknownEntity { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/UnescapedOrUnknownEntity.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,11 @@
+UnescapedOrUnknownEntity.java:15: error: semicolon missing
+ * L&F
+ ^
+UnescapedOrUnknownEntity.java:16: error: semicolon missing
+ * Drag&Drop
+ ^
+UnescapedOrUnknownEntity.java:17: error: bad HTML entity
+ * if (a & b);
+ ^
+3 errors
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/util/Main.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,182 @@
+package tidystats;
+
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class Main {
+ public static void main(String... args) throws IOException {
+ new Main().run(args);
+ }
+
+ void run(String... args) throws IOException {
+ FileSystem fs = FileSystems.getDefault();
+ List<Path> paths = new ArrayList<>();
+
+ int i;
+ for (i = 0; i < args.length; i++) {
+ String arg = args[i];
+ if (arg.startsWith("-"))
+ throw new IllegalArgumentException(arg);
+ else
+ break;
+ }
+
+ for ( ; i < args.length; i++) {
+ Path p = fs.getPath(args[i]);
+ paths.add(p);
+ }
+
+ for (Path p: paths) {
+ scan(p);
+ }
+
+ print("%6d files read", files);
+ print("%6d files had no errors or warnings", ok);
+ print("%6d files reported \"Not all warnings/errors were shown.\"", overflow);
+ print("%6d errors found", errs);
+ print("%6d warnings found", warns);
+ print("%6d recommendations to use CSS", css);
+ print("");
+
+ Map<Integer, Set<String>> sortedCounts = new TreeMap<>(
+ new Comparator<Integer>() {
+ @Override
+ public int compare(Integer o1, Integer o2) {
+ return o2.compareTo(o1);
+ }
+ });
+
+ for (Map.Entry<Pattern, Integer> e: counts.entrySet()) {
+ Pattern p = e.getKey();
+ Integer n = e.getValue();
+ Set<String> set = sortedCounts.get(n);
+ if (set == null)
+ sortedCounts.put(n, (set = new TreeSet<>()));
+ set.add(p.toString());
+ }
+
+ for (Map.Entry<Integer, Set<String>> e: sortedCounts.entrySet()) {
+ for (String p: e.getValue()) {
+ if (p.startsWith(".*")) p = p.substring(2);
+ print("%6d: %s", e.getKey(), p);
+ }
+ }
+ }
+
+ void scan(Path p) throws IOException {
+ if (Files.isDirectory(p)) {
+ for (Path c: Files.newDirectoryStream(p)) {
+ scan(c);
+ }
+ } else if (isTidyFile(p)) {
+ scan(Files.readAllLines(p, Charset.defaultCharset()));
+ }
+ }
+
+ boolean isTidyFile(Path p) {
+ return Files.isRegularFile(p) && p.getFileName().toString().endsWith(".tidy");
+ }
+
+ void scan(List<String> lines) {
+ Matcher m;
+ files++;
+ for (String line: lines) {
+ if (okPattern.matcher(line).matches()) {
+ ok++;
+ } else if ((m = countPattern.matcher(line)).matches()) {
+ warns += Integer.valueOf(m.group(1));
+ errs += Integer.valueOf(m.group(2));
+ if (m.group(3) != null)
+ overflow++;
+ } else if ((m = guardPattern.matcher(line)).matches()) {
+ boolean found = false;
+ for (Pattern p: patterns) {
+ if ((m = p.matcher(line)).matches()) {
+ found = true;
+ count(p);
+ break;
+ }
+ }
+ if (!found)
+ System.err.println("Unrecognized line: " + line);
+ } else if (cssPattern.matcher(line).matches()) {
+ css++;
+ }
+ }
+ }
+
+ Map<Pattern, Integer> counts = new HashMap<>();
+ void count(Pattern p) {
+ Integer i = counts.get(p);
+ counts.put(p, (i == null) ? 1 : i + 1);
+ }
+
+ void print(String format, Object... args) {
+ System.out.println(String.format(format, args));
+ }
+
+ Pattern okPattern = Pattern.compile("No warnings or errors were found.");
+ Pattern countPattern = Pattern.compile("([0-9]+) warnings, ([0-9]+) errors were found!.*?(Not all warnings/errors were shown.)?");
+ Pattern cssPattern = Pattern.compile("You are recommended to use CSS.*");
+ Pattern guardPattern = Pattern.compile("line [0-9]+ column [0-9]+ - (Error|Warning):.*");
+
+ Pattern[] patterns = {
+ Pattern.compile(".*Error: <.*> is not recognized!"),
+ Pattern.compile(".*Error: missing quote mark for attribute value"),
+ Pattern.compile(".*Warning: <.*> anchor \".*\" already defined"),
+ Pattern.compile(".*Warning: <.*> attribute \".*\" has invalid value \".*\""),
+ Pattern.compile(".*Warning: <.*> attribute \".*\" lacks value"),
+ Pattern.compile(".*Warning: <.*> attribute \".*\" lacks value"),
+ Pattern.compile(".*Warning: <.*> attribute with missing trailing quote mark"),
+ Pattern.compile(".*Warning: <.*> dropping value \".*\" for repeated attribute \".*\""),
+ Pattern.compile(".*Warning: <.*> inserting \".*\" attribute"),
+ Pattern.compile(".*Warning: <.*> is probably intended as </.*>"),
+ Pattern.compile(".*Warning: <.*> isn't allowed in <.*> elements"),
+ Pattern.compile(".*Warning: <.*> lacks \".*\" attribute"),
+ Pattern.compile(".*Warning: <.*> missing '>' for end of tag"),
+ Pattern.compile(".*Warning: <.*> proprietary attribute \".*\""),
+ Pattern.compile(".*Warning: <.*> unexpected or duplicate quote mark"),
+ Pattern.compile(".*Warning: <a> cannot copy name attribute to id"),
+ Pattern.compile(".*Warning: <a> escaping malformed URI reference"),
+ Pattern.compile(".*Warning: <blockquote> proprietary attribute \"pre\""),
+ Pattern.compile(".*Warning: discarding unexpected <.*>"),
+ Pattern.compile(".*Warning: discarding unexpected </.*>"),
+ Pattern.compile(".*Warning: entity \".*\" doesn't end in ';'"),
+ Pattern.compile(".*Warning: inserting implicit <.*>"),
+ Pattern.compile(".*Warning: inserting missing 'title' element"),
+ Pattern.compile(".*Warning: missing <!DOCTYPE> declaration"),
+ Pattern.compile(".*Warning: missing <.*>"),
+ Pattern.compile(".*Warning: missing </.*> before <.*>"),
+ Pattern.compile(".*Warning: nested emphasis <.*>"),
+ Pattern.compile(".*Warning: plain text isn't allowed in <.*> elements"),
+ Pattern.compile(".*Warning: replacing <p> by <br>"),
+ Pattern.compile(".*Warning: replacing invalid numeric character reference .*"),
+ Pattern.compile(".*Warning: replacing unexpected .* by </.*>"),
+ Pattern.compile(".*Warning: trimming empty <.*>"),
+ Pattern.compile(".*Warning: unescaped & or unknown entity \".*\""),
+ Pattern.compile(".*Warning: unescaped & which should be written as &"),
+ Pattern.compile(".*Warning: using <br> in place of <p>")
+ };
+
+ int files;
+ int ok;
+ int warns;
+ int errs;
+ int css;
+ int overflow;
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/doclint/tidy/util/tidy.sh Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# Copyright (c) 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.
+#
+
+# Run the "tidy" program over the files in a directory.
+#
+# Usage:
+# sh tidy.sh <dir>
+#
+# The "tidy" program will be run on each HTML file in <dir>,
+# and the output placed in the corresponding location in a new
+# directory <dir>.tidy. The console output from running "tidy" will
+# be saved in a corresponding file with an additional .tidy extension.
+#
+# Non-HTML files will be copied without modification from <dir> to
+# <dir>.tidy, so that relative links within the directory tree are
+# unaffected.
+
+dir=$1
+odir=$dir.tidy
+
+( cd $dir ; find . -type f ) | \
+ while read file ; do
+ mkdir -p $odir/$(dirname $file)
+ case $file in
+ *.html )
+ cat $dir/$file | tidy 1>$odir/$file 2>$odir/$file.tidy
+ ;;
+ * ) cp $dir/$file $odir/$file
+ ;;
+ esac
+ done
--- a/langtools/test/tools/javac/7129225/TestImportStar.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/7129225/TestImportStar.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
/* @test
* @bug 7129225
* @summary import xxx.* isn't handled correctly by annotation processing
- * @library ../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile/fail/ref=NegTest.ref -XDrawDiagnostics TestImportStar.java
* @compile Anno.java AnnoProcessor.java
--- a/langtools/test/tools/javac/7153958/CPoolRefClassContainingInlinedCts.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/7153958/CPoolRefClassContainingInlinedCts.java Tue Jan 01 17:49:22 2013 -0800
@@ -27,7 +27,7 @@
* @test
* @bug 7153958
* @summary add constant pool reference to class containing inlined constants
- * @compile pkg/ClassToBeStaticallyImported.java
+ * @compile pkg/ClassToBeStaticallyImported.java CPoolRefClassContainingInlinedCts.java
* @run main CPoolRefClassContainingInlinedCts
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/8000518/DuplicateConstantPoolEntry.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2002, 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.
+ */
+
+/*
+ * @test
+ * @bug 8000518
+ * @summary Javac generates duplicate name_and_type constant pool entry for
+ * class BinaryOpValueExp.java
+ * @run main DuplicateConstantPoolEntry
+ */
+
+import com.sun.source.util.JavacTask;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.ConstantPoolException;
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+/*
+ * This bug was reproduced having two classes B and C referenced from a class A
+ * class C should be compiled and generated in advance. Later class A and B should
+ * be compiled like this: javac A.java B.java
+ */
+
+public class DuplicateConstantPoolEntry {
+
+ public static void main(String args[]) throws Exception {
+ new DuplicateConstantPoolEntry().run();
+ }
+
+ void run() throws Exception {
+ generateFilesNeeded();
+ checkReference();
+ }
+
+ void generateFilesNeeded() throws Exception {
+
+ StringJavaFileObject[] CSource = new StringJavaFileObject[] {
+ new StringJavaFileObject("C.java",
+ "class C {C(String s) {}}"),
+ };
+
+ List<StringJavaFileObject> AandBSource = Arrays.asList(
+ new StringJavaFileObject("A.java",
+ "class A {void test() {new B(null);new C(null);}}"),
+ new StringJavaFileObject("B.java",
+ "class B {B(String s) {}}")
+ );
+
+ final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+ JavacTask compileC = (JavacTask)tool.getTask(null, null, null, null, null,
+ Arrays.asList(CSource));
+ if (!compileC.call()) {
+ throw new AssertionError("Compilation error while compiling C.java sources");
+ }
+ JavacTask compileAB = (JavacTask)tool.getTask(null, null, null,
+ Arrays.asList("-cp", "."), null, AandBSource);
+ if (!compileAB.call()) {
+ throw new AssertionError("Compilation error while compiling A and B sources");
+ }
+ }
+
+ void checkReference() throws IOException, ConstantPoolException {
+ File file = new File("A.class");
+ ClassFile classFile = ClassFile.read(file);
+ for (int i = 1;
+ i < classFile.constant_pool.size() - 1;
+ i += classFile.constant_pool.get(i).size()) {
+ for (int j = i + classFile.constant_pool.get(i).size();
+ j < classFile.constant_pool.size();
+ j += classFile.constant_pool.get(j).size()) {
+ if (classFile.constant_pool.get(i).toString().
+ equals(classFile.constant_pool.get(j).toString())) {
+ throw new AssertionError(
+ "Duplicate entries in the constant pool at positions " +
+ i + " and " + j);
+ }
+ }
+ }
+ }
+
+ private static class StringJavaFileObject extends SimpleJavaFileObject {
+ StringJavaFileObject(String name, String text) {
+ super(URI.create(name), JavaFileObject.Kind.SOURCE);
+ this.text = text;
+ }
+ @Override
+ public CharSequence getCharContent(boolean b) {
+ return text;
+ }
+ private String text;
+ }
+}
--- a/langtools/test/tools/javac/StringsInSwitch/StringSwitches.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/StringsInSwitch/StringSwitches.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T8003967/DetectMutableStaticFields.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,242 @@
+/*
+ * Copyright (c) 2006, 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.
+ */
+
+/*
+ * @test
+ * @bug 8003967
+ * @summary detect and remove all mutable implicit static enum fields in langtools
+ * @run main DetectMutableStaticFields
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.ConstantPoolException;
+import com.sun.tools.classfile.Descriptor;
+import com.sun.tools.classfile.Descriptor.InvalidDescriptor;
+import com.sun.tools.classfile.Field;
+
+import static javax.tools.JavaFileObject.Kind.CLASS;
+import static com.sun.tools.classfile.AccessFlags.ACC_ENUM;
+import static com.sun.tools.classfile.AccessFlags.ACC_FINAL;
+import static com.sun.tools.classfile.AccessFlags.ACC_STATIC;
+
+public class DetectMutableStaticFields {
+
+ private static final String keyResource =
+ "com/sun/tools/javac/tree/JCTree.class";
+
+ private String[] packagesToSeekFor = new String[] {
+ "javax.tools",
+ "javax.lang.model",
+ "com.sun.javadoc",
+ "com.sun.source",
+ "com.sun.tools.classfile",
+ "com.sun.tools.doclets",
+ "com.sun.tools.javac",
+ "com.sun.tools.javadoc",
+ "com.sun.tools.javah",
+ "com.sun.tools.javap",
+ };
+
+ private static final Map<String, List<String>> classFieldsToIgnoreMap = new HashMap<>();
+
+ static {
+ classFieldsToIgnoreMap.
+ put("javax/tools/ToolProvider",
+ Arrays.asList("instance"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javah/JavahTask",
+ Arrays.asList("versionRB"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/classfile/Dependencies$DefaultFilter",
+ Arrays.asList("instance"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javap/JavapTask",
+ Arrays.asList("versionRB"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/doclets/formats/html/HtmlDoclet",
+ Arrays.asList("docletToStart"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javac/util/JCDiagnostic",
+ Arrays.asList("fragmentFormatter"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javac/util/JavacMessages",
+ Arrays.asList("defaultBundle", "defaultMessages"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javac/file/ZipFileIndexCache",
+ Arrays.asList("sharedInstance"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javac/main/JavaCompiler",
+ Arrays.asList("versionRB"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javac/code/Type",
+ Arrays.asList("moreInfo"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javac/util/SharedNameTable",
+ Arrays.asList("freelist"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javac/util/Log",
+ Arrays.asList("useRawMessages"));
+ }
+
+ private List<String> errors = new ArrayList<>();
+
+ public static void main(String[] args) {
+ try {
+ new DetectMutableStaticFields().run();
+ } catch (Exception ex) {
+ throw new AssertionError(
+ "Exception during test execution with cause ",
+ ex.getCause());
+ }
+ }
+
+ private void run()
+ throws
+ IOException,
+ ConstantPoolException,
+ InvalidDescriptor,
+ URISyntaxException {
+
+ URI resource = findResource(keyResource);
+ if (resource == null) {
+ throw new AssertionError("Resource " + keyResource +
+ "not found in the class path");
+ }
+ analyzeResource(resource);
+
+ if (errors.size() > 0) {
+ for (String error: errors) {
+ System.err.println(error);
+ }
+ throw new AssertionError("There are mutable fields, "
+ + "please check output");
+ }
+ }
+
+ URI findResource(String className) throws URISyntaxException {
+ URI uri = getClass().getClassLoader().getResource(className).toURI();
+ if (uri.getScheme().equals("jar")) {
+ String ssp = uri.getRawSchemeSpecificPart();
+ int sep = ssp.lastIndexOf("!");
+ uri = new URI(ssp.substring(0, sep));
+ } else if (uri.getScheme().equals("file")) {
+ uri = new URI(uri.getPath().substring(0,
+ uri.getPath().length() - keyResource.length()));
+ }
+ return uri;
+ }
+
+ boolean shouldAnalyzePackage(String packageName) {
+ for (String aPackage: packagesToSeekFor) {
+ if (packageName.contains(aPackage)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ void analyzeResource(URI resource)
+ throws
+ IOException,
+ ConstantPoolException,
+ InvalidDescriptor {
+ JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+ StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null);
+ JavaFileManager.Location location =
+ StandardLocation.locationFor(resource.getPath());
+ fm.setLocation(location, com.sun.tools.javac.util.List.of(
+ new File(resource.getPath())));
+
+ for (JavaFileObject file : fm.list(location, "", EnumSet.of(CLASS), true)) {
+ String className = fm.inferBinaryName(location, file);
+ int index = className.lastIndexOf('.');
+ String pckName = index == -1 ? "" : className.substring(0, index);
+ if (shouldAnalyzePackage(pckName)) {
+ analyzeClassFile(ClassFile.read(file.openInputStream()));
+ }
+ }
+ }
+
+ List<String> currentFieldsToIgnore;
+
+ boolean ignoreField(String field) {
+ if (currentFieldsToIgnore != null) {
+ for (String fieldToIgnore : currentFieldsToIgnore) {
+ if (field.equals(fieldToIgnore)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ void analyzeClassFile(ClassFile classFileToCheck)
+ throws
+ IOException,
+ ConstantPoolException,
+ Descriptor.InvalidDescriptor {
+ boolean enumClass =
+ (classFileToCheck.access_flags.flags & ACC_ENUM) != 0;
+ boolean nonFinalStaticEnumField;
+ boolean nonFinalStaticField;
+
+ currentFieldsToIgnore =
+ classFieldsToIgnoreMap.get(classFileToCheck.getName());
+
+ for (Field field : classFileToCheck.fields) {
+ if (ignoreField(field.getName(classFileToCheck.constant_pool))) {
+ continue;
+ }
+ nonFinalStaticEnumField =
+ (field.access_flags.flags & (ACC_ENUM | ACC_FINAL)) == 0;
+ nonFinalStaticField =
+ (field.access_flags.flags & ACC_STATIC) != 0 &&
+ (field.access_flags.flags & ACC_FINAL) == 0;
+ if (enumClass ? nonFinalStaticEnumField : nonFinalStaticField) {
+ errors.add("There is a mutable field named " +
+ field.getName(classFileToCheck.constant_pool) +
+ ", at class " +
+ classFileToCheck.getName());
+ }
+ }
+ }
+
+}
--- a/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.java Tue Jan 01 17:49:22 2013 -0800
@@ -20,4 +20,3 @@
@Foo @Foo
public class MissingDefaultCase1 {}
-
--- a/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.out Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.out Tue Jan 01 17:49:22 2013 -0800
@@ -1,2 +1,3 @@
+MissingDefaultCase1.java:21:1: compiler.err.duplicate.annotation.invalid.repeated: Foo
MissingDefaultCase1.java:12:1: compiler.err.invalid.containedby.annotation.elem.nondefault: FooContainer, other()
-1 error
+2 errors
--- a/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.java Tue Jan 01 17:49:22 2013 -0800
@@ -20,4 +20,3 @@
@Foo @Foo
public class MissingDefaultCase2 {}
-
--- a/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.out Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.out Tue Jan 01 17:49:22 2013 -0800
@@ -1,2 +1,3 @@
+MissingDefaultCase2.java:21:1: compiler.err.duplicate.annotation.invalid.repeated: Foo
MissingDefaultCase2.java:12:1: compiler.err.invalid.containedby.annotation.elem.nondefault: FooContainer, other()
-1 error
+2 errors
--- a/langtools/test/tools/javac/annotations/repeatingAnnotations/NoRepeatableAnno.out Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/NoRepeatableAnno.out Tue Jan 01 17:49:22 2013 -0800
@@ -1,3 +1,3 @@
-NoRepeatableAnno.java:11:1: compiler.err.duplicate.annotation.missing.container: Foo
-NoRepeatableAnno.java:11:6: compiler.err.duplicate.annotation.missing.container: Foo
+NoRepeatableAnno.java:11:1: compiler.err.duplicate.annotation.missing.container: Foo, java.lang.annotation.ContainedBy
+NoRepeatableAnno.java:11:6: compiler.err.duplicate.annotation.missing.container: Foo, java.lang.annotation.ContainedBy
2 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/RepeatingTargetNotAllowed.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/**
+ * @test
+ * @summary Container annotation is not checked for semantic correctness
+ * @bug 8001114
+ *
+ * @compile/fail/ref=RepeatingTargetNotAllowed.out -XDrawDiagnostics RepeatingTargetNotAllowed.java
+ */
+
+import java.lang.annotation.*;
+
+@ContainedBy(Foos.class)
+@interface Foo {}
+
+@ContainerFor(Foo.class)
+@Target(ElementType.ANNOTATION_TYPE)
+@interface Foos {
+ Foo[] value();
+}
+
+public class RepeatingTargetNotAllowed {
+ @Foo @Foo int f = 0;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/RepeatingTargetNotAllowed.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,2 @@
+RepeatingTargetNotAllowed.java:44:5: compiler.err.invalid.containedby.annotation.incompatible.target: Foos, Foo
+1 error
--- a/langtools/test/tools/javac/api/T6395981.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/api/T6395981.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2011, 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
--- a/langtools/test/tools/javac/cast/intersection/model/Model01.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/cast/intersection/model/Model01.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 8002099
* @summary Add support for intersection types in cast expression
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor ModelChecker
* @compile -XDallowIntersectionTypes -processor ModelChecker Model01.java
*/
--- a/langtools/test/tools/javac/classreader/T7031108.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/classreader/T7031108.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 7031108
* @summary NPE in javac.jvm.ClassReader.findMethod in PackageElement.enclosedElements from AP in incr build
- * @library ../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor T7031108
* @run main T7031108
*/
--- a/langtools/test/tools/javac/defaultMethods/defaultMethodExecution/DefaultMethodRegressionTests.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/defaultMethods/defaultMethodExecution/DefaultMethodRegressionTests.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/diags/examples/ContainedByNonDefault.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/diags/examples/ContainedByNonDefault.java Tue Jan 01 17:49:22 2013 -0800
@@ -31,6 +31,4 @@
@ContainerFor(Anno.class)
@interface Annos { Anno[] value(); String foo(); }
-@Anno
-@Anno
class ContainedByNonDefault { }
--- a/langtools/test/tools/javac/diags/examples/DuplicateAnnotation.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/diags/examples/DuplicateAnnotation.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/InvalidDuplicateAnnotation.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 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.
+ */
+
+// key: compiler.err.duplicate.annotation.invalid.repeated
+// key: compiler.err.invalid.containedby.annotation.elem.nondefault
+//
+// We need an almost valid containing annotation. The easiest way to get
+// one close enough to valid is by forgetting a default.
+
+import java.lang.annotation.*;
+
+@ContainedBy(Annos.class)
+@interface Anno { }
+
+@ContainerFor(Anno.class)
+@interface Annos { Anno[] value(); String foo(); }
+
+@Anno
+@Anno
+class InvalidDuplicateAnnotation { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/NoContent.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 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.
+ */
+
+// key: compiler.err.dc.no.content
+// key: compiler.note.note
+// key: compiler.note.proc.messager
+// run: backdoor
+// options: -processor DocCommentProcessor -proc:only
+
+/** @see */
+class NoContent {
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/doclint/DocLintTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,225 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8004833
+ * @summary Integrate doclint support into javac
+ */
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import javax.tools.Diagnostic;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+import static javax.tools.Diagnostic.Kind.*;
+
+import com.sun.source.util.JavacTask;
+import com.sun.tools.javac.main.Main;
+import java.util.EnumSet;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class DocLintTest {
+ public static void main(String... args) throws Exception {
+ new DocLintTest().run();
+ }
+
+ JavaCompiler javac;
+ StandardJavaFileManager fm;
+ JavaFileObject file;
+
+ final String code =
+ /* 01 */ "/** Class comment. */\n" +
+ /* 02 */ "public class Test {\n" +
+ /* 03 */ " /** Method comment. */\n" +
+ /* 04 */ " public void method() { }\n" +
+ /* 05 */ "\n" +
+ /* 06 */ " /** Syntax < error. */\n" +
+ /* 07 */ " private void syntaxError() { }\n" +
+ /* 08 */ "\n" +
+ /* 09 */ " /** @see DoesNotExist */\n" +
+ /* 10 */ " protected void referenceError() { }\n" +
+ /* 08 */ "\n" +
+ /* 09 */ " /** @return */\n" +
+ /* 10 */ " public int emptyReturn() { return 0; }\n" +
+ /* 11 */ "}\n";
+
+ final String rawDiags = "-XDrawDiagnostics";
+ private enum Message {
+ // doclint messages
+ DL_ERR6(ERROR, "Test.java:6:16: compiler.err.proc.messager: malformed HTML"),
+ DL_ERR9(ERROR, "Test.java:9:14: compiler.err.proc.messager: reference not found"),
+ DL_WRN12(WARNING, "Test.java:12:9: compiler.warn.proc.messager: no description for @return"),
+
+ OPT_BADARG(ERROR, "invalid flag: -Xdoclint:badarg");
+
+ final Diagnostic.Kind kind;
+ final String text;
+
+ static Message get(String text) {
+ for (Message m: values()) {
+ if (m.text.equals(text))
+ return m;
+ }
+ return null;
+ }
+
+ Message(Diagnostic.Kind kind, String text) {
+ this.kind = kind;
+ this.text = text;
+ }
+
+ @Override
+ public String toString() {
+ return "[" + kind + ",\"" + text + "\"]";
+ }
+ }
+ void run() throws Exception {
+ javac = ToolProvider.getSystemJavaCompiler();
+ fm = javac.getStandardFileManager(null, null, null);
+ fm.setLocation(StandardLocation.CLASS_OUTPUT, Arrays.asList(new File(".")));
+ file = new SimpleJavaFileObject(URI.create("Test.java"), JavaFileObject.Kind.SOURCE) {
+ @Override
+ public CharSequence getCharContent(boolean ignoreEncoding) {
+ return code;
+ }
+ };
+
+ test(Collections.<String>emptyList(),
+ Main.Result.OK,
+ EnumSet.noneOf(Message.class));
+
+ test(Arrays.asList("-Xdoclint:none"),
+ Main.Result.OK,
+ EnumSet.noneOf(Message.class));
+
+ test(Arrays.asList(rawDiags, "-Xdoclint"),
+ Main.Result.ERROR,
+ EnumSet.of(Message.DL_ERR6, Message.DL_ERR9, Message.DL_WRN12));
+
+ test(Arrays.asList(rawDiags, "-Xdoclint:all/public"),
+ Main.Result.OK,
+ EnumSet.of(Message.DL_WRN12));
+
+ test(Arrays.asList(rawDiags, "-Xdoclint:syntax"),
+ Main.Result.ERROR,
+ EnumSet.of(Message.DL_ERR6, Message.DL_WRN12));
+
+ test(Arrays.asList(rawDiags, "-Xdoclint:reference"),
+ Main.Result.ERROR,
+ EnumSet.of(Message.DL_ERR9));
+
+ test(Arrays.asList(rawDiags, "-Xdoclint:badarg"),
+ Main.Result.CMDERR,
+ EnumSet.of(Message.OPT_BADARG));
+
+ if (errors > 0)
+ throw new Exception(errors + " errors occurred");
+ }
+
+ void test(List<String> opts, Main.Result expectResult, Set<Message> expectMessages) {
+ System.err.println("test: " + opts);
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ List<JavaFileObject> files = Arrays.asList(file);
+ try {
+ JavacTask t = (JavacTask) javac.getTask(pw, fm, null, opts, null, files);
+ boolean ok = t.call();
+ pw.close();
+ String out = sw.toString().replaceAll("[\r\n]+", "\n");
+ if (!out.isEmpty())
+ System.err.println(out);
+ if (ok && expectResult != Main.Result.OK) {
+ error("Compilation succeeded unexpectedly");
+ } else if (!ok && expectResult != Main.Result.ERROR) {
+ error("Compilation failed unexpectedly");
+ } else
+ check(out, expectMessages);
+ } catch (IllegalArgumentException e) {
+ System.err.println(e);
+ String expectOut = expectMessages.iterator().next().text;
+ if (expectResult != Main.Result.CMDERR)
+ error("unexpected exception caught");
+ else if (!e.getMessage().equals(expectOut)) {
+ error("unexpected exception message: "
+ + e.getMessage()
+ + " expected: " + expectOut);
+ }
+ }
+
+// if (errors > 0)
+// throw new Error("stop");
+ }
+
+ private void check(String out, Set<Message> expect) {
+ Pattern stats = Pattern.compile("^([1-9]+) (error|warning)(s?)");
+ Set<Message> found = EnumSet.noneOf(Message.class);
+ int e = 0, w = 0;
+ if (!out.isEmpty()) {
+ for (String line: out.split("[\r\n]+")) {
+ Matcher s = stats.matcher(line);
+ if (s.matches()) {
+ int i = Integer.valueOf(s.group(1));
+ if (s.group(2).equals("error"))
+ e++;
+ else
+ w++;
+ continue;
+ }
+
+ Message m = Message.get(line);
+ if (m == null)
+ error("Unexpected line: " + line);
+ else
+ found.add(m);
+ }
+ }
+ for (Message m: expect) {
+ if (!found.contains(m))
+ error("expected message not found: " + m.text);
+ }
+ for (Message m: found) {
+ if (!expect.contains(m))
+ error("unexpected message found: " + m.text);
+ }
+ }
+
+ void error(String msg) {
+ System.err.println("Error: " + msg);
+ errors++;
+ }
+
+ int errors;
+}
--- a/langtools/test/tools/javac/enum/6350057/T6350057.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/enum/6350057/T6350057.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6350057 7025809
* @summary Test that parameters on implicit enum methods have the right kind
* @author Joseph D. Darcy
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor T6350057
* @compile -processor T6350057 -proc:only TestEnum.java
*/
--- a/langtools/test/tools/javac/enum/6424358/T6424358.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/enum/6424358/T6424358.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6424358 7025809
* @summary Synthesized static enum method values() is final
* @author Peter von der Ah\u00e9
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor T6424358
* @compile -processor T6424358 -proc:only T6424358.java
*/
--- a/langtools/test/tools/javac/file/T7018098.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/file/T7018098.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 7018098
* @summary CacheFSInfo persists too long
- * @library ../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor T7018098
* @run main T7018098
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/file/zip/8003512/LoadClassFromJava6CreatedJarTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,183 @@
+
+/*
+ * Copyright (c) 2002, 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.
+ */
+
+/*
+ * @test
+ * @bug 8003512
+ * @summary javac doesn't work with jar files with >64k entries
+ * @compile -target 6 -source 6 -XDignore.symbol.file LoadClassFromJava6CreatedJarTest.java ../Utils.java
+ * @run main/timeout=360 LoadClassFromJava6CreatedJarTest
+ */
+
+/*
+ * The test creates a jar file with more than 64K entries. The jar file is
+ * created executing the LoadClassFromJava6CreatedJarTest$MakeJar
+ * class with a JVM version 6. The test must include Java 6 features only.
+ *
+ * The aim is to verify classes included in jar files with more than 64K entries
+ * created with Java 6 can be loaded by more recent versions of Java.
+ *
+ * A path to JDK or JRE version 6 is needed. This can be provided
+ * by passing this option to jtreg:
+ * -javaoption:-Djava6.home="/path/to/jdk_or_jre6"
+ */
+
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.Arrays;
+import java.util.List;
+import java.util.zip.CRC32;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+public class LoadClassFromJava6CreatedJarTest {
+
+ static final String javaHome6 = System.getProperty("java6.home");
+ static final String testClasses = System.getProperty("test.classes");
+
+ public static void main(String... args)
+ throws IOException, InterruptedException {
+ if (javaHome6 != null) {
+ new LoadClassFromJava6CreatedJarTest().run();
+ } else {
+ System.out.println(
+ "The test LoadClassFromJava6CreatedJarTest cannot be executed. " +
+ "In order to run it you should pass an option with " +
+ "this form -javaoption:-Djava6.home=\"/path/to/jdk_or_jre6\" " +
+ "to jtreg.");
+ }
+ }
+
+ void run() throws IOException, InterruptedException {
+ File classA = new File("A.java");
+ Utils.createJavaFile(classA, null);
+ if (!Utils.compile("-target", "6", "-source", "6",
+ classA.getAbsolutePath())) {
+ throw new AssertionError("Test failed while compiling class A");
+ }
+
+ executeCommand(Arrays.asList(javaHome6 + "/bin/java", "-classpath",
+ testClasses, "LoadClassFromJava6CreatedJarTest$MakeJar"));
+
+ File classB = new File("B.java");
+ Utils.createJavaFile(classB, classA);
+ if (!Utils.compile("-cp", "a.jar", classB.getAbsolutePath())) {
+ throw new AssertionError("Test failed while compiling class Main");
+ }
+ }
+
+ void executeCommand(List<String> command)
+ throws IOException, InterruptedException {
+ ProcessBuilder pb = new ProcessBuilder(command).
+ redirectErrorStream(true);
+ Process p = pb.start();
+ BufferedReader r =
+ new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String line;
+ while ((line = r.readLine()) != null) {
+ System.err.println(line);
+ }
+ int rc = p.waitFor();
+ if (rc != 0) {
+ throw new AssertionError("Unexpected exit code: " + rc);
+ }
+ }
+
+ static class MakeJar {
+ public static void main(String[] args) throws Throwable {
+ File classFile = new File("A.class");
+ ZipOutputStream zos = null;
+ FileInputStream fis = null;
+ final int MAX = Short.MAX_VALUE * 2 + 10;
+ ZipEntry ze = null;
+ try {
+ zos = new ZipOutputStream(new FileOutputStream("a.jar"));
+ zos.setLevel(ZipOutputStream.STORED);
+ zos.setMethod(ZipOutputStream.STORED);
+ for (int i = 0; i < MAX ; i++) {
+ ze = new ZipEntry("X" + i + ".txt");
+ ze.setSize(0);
+ ze.setCompressedSize(0);
+ ze.setCrc(0);
+ zos.putNextEntry(ze);
+ }
+
+ // add a class file
+ ze = new ZipEntry("A.class");
+ ze.setCompressedSize(classFile.length());
+ ze.setSize(classFile.length());
+ ze.setCrc(computeCRC(classFile));
+ zos.putNextEntry(ze);
+ fis = new FileInputStream(classFile);
+ for (int c; (c = fis.read()) >= 0;) {
+ zos.write(c);
+ }
+ } finally {
+ zos.close();
+ fis.close();
+ }
+ }
+
+ private static final int BUFFER_LEN = Short.MAX_VALUE * 2;
+
+ static long getCount(long minlength) {
+ return (minlength / BUFFER_LEN) + 1;
+ }
+
+ static long computeCRC(long minlength) {
+ CRC32 crc = new CRC32();
+ byte[] buffer = new byte[BUFFER_LEN];
+ long count = getCount(minlength);
+ for (long i = 0; i < count; i++) {
+ crc.update(buffer);
+ }
+ return crc.getValue();
+ }
+
+ static long computeCRC(File inFile) throws IOException {
+ byte[] buffer = new byte[8192];
+ CRC32 crc = new CRC32();
+ FileInputStream fis = null;
+ BufferedInputStream bis = null;
+ try {
+ fis = new FileInputStream(inFile);
+ bis = new BufferedInputStream(fis);
+ int n = bis.read(buffer);
+ while (n > 0) {
+ crc.update(buffer, 0, n);
+ n = bis.read(buffer);
+ }
+ } finally {
+ bis.close();
+ fis.close();
+ }
+ return crc.getValue();
+ }
+ }
+}
--- a/langtools/test/tools/javac/file/zip/Utils.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/file/zip/Utils.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
@@ -21,6 +21,12 @@
* questions.
*/
+/*
+ * This utils class is been used by test T8003512 which is compiled with Java 6
+ * only features. So if this class is modified, it should be so using Java 6
+ * features only.
+ */
+
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.Closeable;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/8004094/B.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 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.
+ */
+abstract class A {
+
+ private static String s = null;
+
+ static void test() {
+ new Object() {
+ void m() {
+ Object o = s;
+ }
+ };
+ }
+}
+
+public abstract class B<T> extends A {
+
+ private static Integer i = null;
+
+ static void test() {
+ new Object() {
+ void m() {
+ Object o = i;
+ }
+ };
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/8004094/T8004094.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8004094
+ * @summary Javac compiler error - synthetic method accessor generated with duplicate name
+ *
+ * @compile B.java T8004094.java
+ */
+
+public class T8004094 extends B<Object> { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/BadMethodCall2.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,13 @@
+/**
+ * @test /nodynamiccopyright/
+ * @bug 8004099
+ * @summary Bad compiler diagnostic generated when poly expression is passed to non-existent method
+ * @compile/fail/ref=BadMethodCall2.out -XDrawDiagnostics BadMethodCall2.java
+ */
+class BadMethodCall2 {
+ void test(Object rec) {
+ rec.nonExistent(System.out::println);
+ rec.nonExistent(()->{});
+ rec.nonExistent(true ? "1" : "2");
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/lambda/BadMethodCall2.out Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,4 @@
+BadMethodCall2.java:9:13: compiler.err.cant.resolve.location.args: kindname.method, nonExistent, , @309, (compiler.misc.location.1: kindname.variable, rec, java.lang.Object)
+BadMethodCall2.java:10:13: compiler.err.cant.resolve.location.args: kindname.method, nonExistent, , @356, (compiler.misc.location.1: kindname.variable, rec, java.lang.Object)
+BadMethodCall2.java:11:13: compiler.err.cant.resolve.location.args: kindname.method, nonExistent, , @390, (compiler.misc.location.1: kindname.variable, rec, java.lang.Object)
+3 errors
--- a/langtools/test/tools/javac/lambda/TestInvokeDynamic.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambda/TestInvokeDynamic.java Tue Jan 01 17:49:22 2013 -0800
@@ -50,6 +50,7 @@
import com.sun.tools.javac.code.Symbol;
import com.sun.tools.javac.code.Symbol.MethodSymbol;
import com.sun.tools.javac.code.Symtab;
+import com.sun.tools.javac.code.Types;
import com.sun.tools.javac.jvm.Pool;
import com.sun.tools.javac.tree.JCTree.JCMethodInvocation;
import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
@@ -151,7 +152,7 @@
abstract boolean check(CPInfo cpInfo) throws Exception;
- Object getValue(Symtab syms, Names names) {
+ Object getValue(Symtab syms, Names names, Types types) {
switch (this) {
case STRING:
case INTEGER:
@@ -162,7 +163,7 @@
case CLASS:
return syms.stringType.tsym;
case METHOD_HANDLE:
- return new Pool.MethodHandle(REF_invokeVirtual, syms.arrayCloneMethod);
+ return new Pool.MethodHandle(REF_invokeVirtual, syms.arrayCloneMethod, types);
case METHOD_TYPE:
return syms.arrayCloneMethod.type;
default:
@@ -231,7 +232,8 @@
Context context = ct.getContext();
Symtab syms = Symtab.instance(context);
Names names = Names.instance(context);
- ct.addTaskListener(new Indifier(syms, names));
+ Types types = Types.instance(context);
+ ct.addTaskListener(new Indifier(syms, names, types));
try {
ct.generate();
} catch (Throwable t) {
@@ -378,10 +380,12 @@
MethodSymbol bsm;
Symtab syms;
Names names;
+ Types types;
- Indifier(Symtab syms, Names names) {
+ Indifier(Symtab syms, Names names, Types types) {
this.syms = syms;
this.names = names;
+ this.types = types;
}
@Override
@@ -405,7 +409,7 @@
if (!oldSym.isConstructor()) {
Object[] staticArgs = new Object[arity.arity];
for (int i = 0; i < arity.arity ; i++) {
- staticArgs[i] = saks[i].getValue(syms, names);
+ staticArgs[i] = saks[i].getValue(syms, names, types);
}
ident.sym = new Symbol.DynamicMethodSymbol(oldSym.name, oldSym.owner, REF_invokeStatic, bsm, oldSym.type, staticArgs);
}
--- a/langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestKinds.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestKinds.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestSueCase1.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestSueCase1.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestSueCase2.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestSueCase2.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestSueCase4.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambda/methodReferenceExecution/MethodReferenceTestSueCase4.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/AttributeInjector.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/AttributeInjector.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/ClassFile.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/ClassFile.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/ClassFilePreprocessor.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/ClassFilePreprocessor.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/ClassToInterfaceConverter.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/ClassToInterfaceConverter.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/Compiler.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/Compiler.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/DirectedClassLoader.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/DirectedClassLoader.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/SourceModel.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/SourceModel.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/TestHarness.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/TestHarness.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/vm/DefaultMethodsTest.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/vm/DefaultMethodsTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/vm/FDSeparateCompilationTest.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/lambdaShapes/org/openjdk/tests/vm/FDSeparateCompilationTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
--- a/langtools/test/tools/javac/multicatch/model/ModelChecker.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/multicatch/model/ModelChecker.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6993963 7025809
* @summary Project Coin: Use precise exception analysis for effectively final catch parameters
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor ModelChecker
* @compile -processor ModelChecker Model01.java
*/
--- a/langtools/test/tools/javac/nativeHeaders/javahComparison/CompareTest.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/nativeHeaders/javahComparison/CompareTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007,2012 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
--- a/langtools/test/tools/javac/options/T7022337.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/options/T7022337.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @test
* @bug 7022337
* @summary repeated warnings about bootclasspath not set
- * @library ../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor T7022337
* @run main T7022337
*/
--- a/langtools/test/tools/javac/plugin/showtype/ShowTypePlugin.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/plugin/showtype/ShowTypePlugin.java Tue Jan 01 17:49:22 2013 -0800
@@ -41,7 +41,7 @@
return "showtype";
}
- public void call(JavacTask task, String... args) {
+ public void init(JavacTask task, String... args) {
Pattern pattern = null;
if (args.length == 1)
pattern = Pattern.compile(args[0]);
--- a/langtools/test/tools/javac/plugin/showtype/Test.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/plugin/showtype/Test.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,22 +1,3 @@
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.nio.charset.Charset;
-import java.nio.file.Files;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Locale;
-import java.util.Objects;
-import javax.tools.JavaCompiler;
-import javax.tools.JavaFileManager;
-import javax.tools.JavaFileObject;
-import javax.tools.StandardJavaFileManager;
-import javax.tools.StandardLocation;
-import javax.tools.ToolProvider;
-
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,10 +23,28 @@
/**
* @test
- * @bug 8001098
+ * @bug 8001098 8004961
* @summary Provide a simple light-weight "plug-in" mechanism for javac
*/
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+import java.util.Objects;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+
public class Test {
public static void main(String... args) throws Exception {
new Test().run();
--- a/langtools/test/tools/javac/processing/6348499/T6348499.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/6348499/T6348499.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6441871
* @summary javac crashes at com.sun.tools.javac.jvm.ClassReader$BadClassFile
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor A
* @run main T6348499
*/
--- a/langtools/test/tools/javac/processing/6359313/T6359313.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/6359313/T6359313.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6359313
* @summary error compiling annotated package
* @author Peter von der Ah\u00e9
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile T6359313.java
* @compile -processor T6359313 package-info.java Foo.java
--- a/langtools/test/tools/javac/processing/6365040/T6365040.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/6365040/T6365040.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6365040 6358129
* @summary Test -processor foo,bar,baz
* @author Joseph D. Darcy
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile ProcFoo.java
* @compile ProcBar.java
--- a/langtools/test/tools/javac/processing/6413690/T6413690.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/6413690/T6413690.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6413690 6380018
* @summary JavacProcessingEnvironment does not enter trees from preceding rounds
* @author Peter von der Ah\u00e9
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile T6413690.java
* @compile -XDfatalEnterError -verbose -processor T6413690 src/Super.java TestMe.java
--- a/langtools/test/tools/javac/processing/6414633/T6414633.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/6414633/T6414633.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6414633 6440109
* @summary Only the first processor message at a source location is reported
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor A T6414633
* @run main T6414633
*/
--- a/langtools/test/tools/javac/processing/6430209/T6430209.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/6430209/T6430209.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6441871
* @summary spurious compiler error elicited by packageElement.getEnclosedElements()
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor b6341534
* @run main T6430209
*/
--- a/langtools/test/tools/javac/processing/6499119/ClassProcessor.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/6499119/ClassProcessor.java Tue Jan 01 17:49:22 2013 -0800
@@ -32,7 +32,7 @@
* @test
* @bug 6499119
* @summary Created package-info class file modeled improperly
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile ClassProcessor.java package-info.java
* @compile/process -cp . -processor ClassProcessor -Akind=java java.lang.Object
--- a/langtools/test/tools/javac/processing/6511613/clss41701.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/6511613/clss41701.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6511613
* @summary javac unexpectedly doesn't fail in some cases if an annotation processor specified
*
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor DummyProcessor
* @compile/fail clss41701.java
* @compile/fail -processor DummyProcessor clss41701.java
--- a/langtools/test/tools/javac/processing/6512707/T6512707.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/6512707/T6512707.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6512707
* @summary "incompatible types" after (unrelated) annotation processing
* @author Peter Runge
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile T6512707.java
* @compile -processor T6512707 TestAnnotation.java
--- a/langtools/test/tools/javac/processing/6634138/T6634138.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/6634138/T6634138.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6634138
* @author Joseph D. Darcy
* @summary Verify source files output after processing is over are compiled
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile T6634138.java
* @compile -processor T6634138 Dummy.java
--- a/langtools/test/tools/javac/processing/6994946/SemanticErrorTest.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/6994946/SemanticErrorTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 6994946
* @summary option to specify only syntax errors as unrecoverable
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestProcessor
* @compile/fail/ref=SemanticErrorTest.1.out -XDrawDiagnostics -processor TestProcessor SemanticErrorTest.java
* @compile/fail/ref=SemanticErrorTest.2.out -XDrawDiagnostics -XDonlySyntaxErrorsUnrecoverable -processor TestProcessor SemanticErrorTest.java
--- a/langtools/test/tools/javac/processing/6994946/SyntaxErrorTest.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/6994946/SyntaxErrorTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 6994946
* @summary option to specify only syntax errors as unrecoverable
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestProcessor
* @compile/fail/ref=SyntaxErrorTest.out -XDrawDiagnostics -processor TestProcessor SyntaxErrorTest.java
* @compile/fail/ref=SyntaxErrorTest.out -XDrawDiagnostics -XDonlySyntaxErrorsUnrecoverable -processor TestProcessor SyntaxErrorTest.java
--- a/langtools/test/tools/javac/processing/T6920317.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/T6920317.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6920317
* @summary package-info.java file has to be specified on the javac cmdline, else it will not be avail
- * @library ../lib
+ * @library /tools/javac/lib
*/
import java.io.*;
--- a/langtools/test/tools/javac/processing/T7196462.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/T7196462.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 7196462
* @summary JavacProcessingEnvironment should tolerate BasicJavacTask
- * @library ../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor T7196462
* @compile/process -processor T7196462 T7196462.java
*/
--- a/langtools/test/tools/javac/processing/TestWarnErrorCount.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/TestWarnErrorCount.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @test
* @bug 7022337
* @summary repeated warnings about bootclasspath not set
- * @library ../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestWarnErrorCount
* @run main TestWarnErrorCount
*/
--- a/langtools/test/tools/javac/processing/environment/TestSourceVersion.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/environment/TestSourceVersion.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6402506
* @summary Test that getSourceVersion works properly
* @author Joseph D. Darcy
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile TestSourceVersion.java
* @compile -processor TestSourceVersion -proc:only -source 1.2 -AExpectedVersion=RELEASE_2 HelloWorld.java
--- a/langtools/test/tools/javac/processing/environment/round/TestContext.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/environment/round/TestContext.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6988836
* @summary A new JavacElements is created for each round of annotation processing
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestContext
* @compile/process -processor TestContext -XprintRounds TestContext
*/
--- a/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6397298 6400986 6425592 6449798 6453386 6508401 6498938 6911854
* @summary Tests that getElementsAnnotatedWith works properly.
* @author Joseph D. Darcy
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile TestElementsAnnotatedWith.java
* @compile InheritedAnnotation.java
--- a/langtools/test/tools/javac/processing/errors/TestErrorCount.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/errors/TestErrorCount.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6988079
* @summary Errors reported via Messager.printMessage(ERROR,"error message") are not tallied correctly
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestErrorCount
* @compile/fail/ref=TestErrorCount.out -XDrawDiagnostics -processor TestErrorCount TestErrorCount.java
*/
--- a/langtools/test/tools/javac/processing/errors/TestFatalityOfParseErrors.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/errors/TestFatalityOfParseErrors.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6403459
* @summary Test that generating programs with syntax errors is a fatal condition
* @author Joseph D. Darcy
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile TestReturnCode.java
* @compile TestFatalityOfParseErrors.java
--- a/langtools/test/tools/javac/processing/errors/TestOptionSyntaxErrors.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/errors/TestOptionSyntaxErrors.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6406212
* @summary Test that annotation processor options with illegal syntax are rejected
* @author Joseph D. Darcy
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor CompileFail
* @compile TestOptionSyntaxErrors.java
* @run main CompileFail CMDERR -A TestOptionSyntaxErrors.java
--- a/langtools/test/tools/javac/processing/errors/TestParseErrors/TestParseErrors.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/errors/TestParseErrors/TestParseErrors.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6988407
* @summary javac crashes running processor on errant code; it used to print error message
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestParseErrors
* @compile/fail/ref=TestParseErrors.out -XDrawDiagnostics -proc:only -processor TestParseErrors ParseErrors.java
*/
--- a/langtools/test/tools/javac/processing/errors/TestReturnCode.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/errors/TestReturnCode.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6403468
* @summary Test that an erroneous return code results from raising an error.
* @author Joseph D. Darcy
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor CompileFail
* @compile TestReturnCode.java
*
--- a/langtools/test/tools/javac/processing/filer/TestFilerConstraints.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/filer/TestFilerConstraints.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6380018 6453386 6457283
* @summary Test that the constraints guaranteed by the Filer and maintained
* @author Joseph D. Darcy
- * @library ../../lib
+ * @library /tools/javac/lib
* @build TestFilerConstraints
* @compile -encoding iso-8859-1 -processor TestFilerConstraints -proc:only TestFilerConstraints.java
*/
--- a/langtools/test/tools/javac/processing/filer/TestGetResource.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/filer/TestGetResource.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6380018 6449798
* @summary Test Filer.getResource
* @author Joseph D. Darcy
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestGetResource
* @compile -processor TestGetResource -proc:only -Aphase=write TestGetResource.java
* @compile -processor TestGetResource -proc:only -Aphase=read TestGetResource.java
--- a/langtools/test/tools/javac/processing/filer/TestGetResource2.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/filer/TestGetResource2.java Tue Jan 01 17:49:22 2013 -0800
@@ -24,7 +24,7 @@
/* @test
* @bug 6929404
* @summary Filer.getResource(SOURCE_PATH, ...) does not work when -sourcepath contains >1 entry
- * @library ../../lib
+ * @library /tools/javac/lib
*/
import java.io.*;
--- a/langtools/test/tools/javac/processing/filer/TestInvalidRelativeNames.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/filer/TestInvalidRelativeNames.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6502392
* @summary Invalid relative names for Filer.createResource and Filer.getResource
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile TestInvalidRelativeNames.java
* @compile/process -processor TestInvalidRelativeNames java.lang.Object
--- a/langtools/test/tools/javac/processing/filer/TestLastRound.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/filer/TestLastRound.java Tue Jan 01 17:49:22 2013 -0800
@@ -24,7 +24,7 @@
/*
* @test 6966604
* @summary JavacFiler not correctly notified of lastRound
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile TestLastRound.java
* @compile/fail/ref=TestLastRound.out -XDrawDiagnostics -Werror -proc:only -processor TestLastRound TestLastRound.java
--- a/langtools/test/tools/javac/processing/filer/TestPackageInfo.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/filer/TestPackageInfo.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6380018 6392177 6993311
* @summary Test the ability to create and process package-info.java files
* @author Joseph D. Darcy
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile TestPackageInfo.java
* @compile -processor TestPackageInfo -proc:only foo/bar/package-info.java TestPackageInfo.java
--- a/langtools/test/tools/javac/processing/filer/TestValidRelativeNames.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/filer/TestValidRelativeNames.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6999891
* @summary Test valid relative names for Filer.createResource and Filer.getResource
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile TestValidRelativeNames.java
* @compile/process -processor TestValidRelativeNames -Amode=create java.lang.Object
--- a/langtools/test/tools/javac/processing/messager/6362067/T6362067.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/messager/6362067/T6362067.java Tue Jan 01 17:49:22 2013 -0800
@@ -2,7 +2,7 @@
* @test /nodynamiccopyright/
* @bug 6362067
* @summary Messager methods do not print out source position information
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor T6362067
* @compile -processor T6362067 -proc:only T6362067.java
* @compile/ref=T6362067.out -XDrawDiagnostics -processor T6362067 -proc:only T6362067.java
--- a/langtools/test/tools/javac/processing/messager/MessagerBasics.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/messager/MessagerBasics.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6341173 6341072
* @summary Test presence of Messager methods
* @author Joseph D. Darcy
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile MessagerBasics.java
* @compile -processor MessagerBasics -proc:only MessagerBasics.java
--- a/langtools/test/tools/javac/processing/model/6194785/T6194785.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/6194785/T6194785.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6194785
* @summary ParameterDeclaration.getSimpleName does not return actual name from class files
* @author Peter von der Ah\u00e9
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile -g T6194785.java T6194785a.java
* @compile -processor T6194785 foo.T6194785a T6194785.java
--- a/langtools/test/tools/javac/processing/model/6341534/T6341534.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/6341534/T6341534.java Tue Jan 01 17:49:22 2013 -0800
@@ -27,7 +27,7 @@
* @summary PackageElement.getEnclosedElements results in NullPointerException from parse(JavaCompiler.java:429)
* @author Steve Sides
* @author Peter von der Ahe
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile T6341534.java
* @compile -proc:only -processor T6341534 dir/package-info.java
--- a/langtools/test/tools/javac/processing/model/element/TestAnonClassNames.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestAnonClassNames.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6449781 6930508
* @summary Test that reported names of anonymous classes are non-null.
* @author Joseph D. Darcy
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestAnonSourceNames
* @compile -processor TestAnonSourceNames TestAnonClassNames.java
* @run main TestAnonClassNames
--- a/langtools/test/tools/javac/processing/model/element/TestElement.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestElement.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6453386
* @summary Test basic properties of javax.lang.element.Element
* @author Joseph D. Darcy
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestElement
* @compile -processor TestElement -proc:only TestElement.java
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestExecutableElement.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8005046
+ * @summary Test basic properties of javax.lang.element.Element
+ * @author Joseph D. Darcy
+ * @library /tools/javac/lib
+ * @build JavacTestingAbstractProcessor TestExecutableElement
+ * @compile -processor TestExecutableElement -proc:only TestExecutableElement.java
+ */
+
+import java.lang.annotation.*;
+import java.util.Formatter;
+import java.util.Set;
+import java.util.Objects;
+import javax.annotation.processing.*;
+import javax.lang.model.SourceVersion;
+import static javax.lang.model.SourceVersion.*;
+import javax.lang.model.element.*;
+import javax.lang.model.util.*;
+import static javax.lang.model.util.ElementFilter.*;
+import static javax.tools.Diagnostic.Kind.*;
+import static javax.tools.StandardLocation.*;
+
+/**
+ * Test some basic workings of javax.lang.element.ExecutableElement
+ */
+public class TestExecutableElement extends JavacTestingAbstractProcessor implements ProviderOfDefault {
+ @IsDefault(false)
+ public boolean process(Set<? extends TypeElement> annotations,
+ RoundEnvironment roundEnv) {
+ int errors = 0;
+ if (!roundEnv.processingOver()) {
+ boolean hasRun = false;
+ for (Element element : roundEnv.getRootElements()) {
+ for (ExecutableElement method : methodsIn(element.getEnclosedElements())) {
+ hasRun = true;
+ errors += checkIsDefault(method);
+ }
+ }
+
+ if (!hasRun) {
+ messager.printMessage(ERROR, "No test cases run; test fails.");
+ }
+ }
+ return true;
+ }
+
+ @IsDefault(false)
+ int checkIsDefault(ExecutableElement method) {
+ System.out.println("Testing " + method);
+ IsDefault expectedIsDefault = method.getAnnotation(IsDefault.class);
+
+ boolean expectedDefault = (expectedIsDefault != null) ?
+ expectedIsDefault.value() :
+ false;
+
+ boolean methodIsDefault = method.isDefault();
+
+ if (methodIsDefault != expectedDefault) {
+ messager.printMessage(ERROR,
+ new Formatter().format("Unexpected Executable.isDefault result: got %s, expected %s",
+ expectedDefault,
+ methodIsDefault).toString(),
+ method);
+ return 1;
+ }
+ return 0;
+ }
+}
+
+/**
+ * Expected value of the ExecutableElement.isDefault method.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+@interface IsDefault {
+ boolean value();
+}
+
+/**
+ * Test interface to provide a default method.
+ */
+interface ProviderOfDefault {
+ @IsDefault(false)
+ boolean process(Set<? extends TypeElement> annotations,
+ RoundEnvironment roundEnv);
+
+ @IsDefault(true)
+ default void quux() {};
+}
--- a/langtools/test/tools/javac/processing/model/element/TestMissingElement/TestMissingElement.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestMissingElement/TestMissingElement.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @test
* @bug 6639645 7026414 7025809
* @summary Modeling type implementing missing interfaces
- * @library ../../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestMissingElement
* @compile -proc:only -XprintRounds -processor TestMissingElement InvalidSource.java
*/
--- a/langtools/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingClass.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingClass.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6639645
* @summary Modeling type implementing missing interfaces
- * @library ../../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor Generator
* @compile -XprintRounds -processor Generator TestMissingClass.java
* @run main TestMissingClass
--- a/langtools/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericClass1.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericClass1.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6639645
* @summary Modeling type implementing missing interfaces
- * @library ../../../../lib
+ * @library /tools/javac/lib
* @clean MissingGenericClass1
* @build JavacTestingAbstractProcessor Generator
* @compile -XprintRounds -processor Generator TestMissingGenericClass1.java
--- a/langtools/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericClass2.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericClass2.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6639645
* @summary Modeling type implementing missing interfaces
- * @library ../../../../lib
+ * @library /tools/javac/lib
* @clean MissingGenericClass2
* @build JavacTestingAbstractProcessor Generator
* @compile -XprintRounds -processor Generator TestMissingGenericClass2.java
--- a/langtools/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericInterface1.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericInterface1.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6639645
* @summary Modeling type implementing missing interfaces
- * @library ../../../../lib
+ * @library /tools/javac/lib
* @clean MissingGenericInterface1
* @build JavacTestingAbstractProcessor Generator
* @compile -XprintRounds -processor Generator TestMissingGenericInterface1.java
--- a/langtools/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericInterface2.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingGenericInterface2.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6639645
* @summary Modeling type implementing missing interfaces
- * @library ../../../../lib
+ * @library /tools/javac/lib
* @clean MissingGenericInterface2
* @build JavacTestingAbstractProcessor Generator
* @compile -XprintRounds -processor Generator TestMissingGenericInterface2.java
--- a/langtools/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingInterface.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestMissingElement2/TestMissingInterface.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6639645
* @summary Modeling type implementing missing interfaces
- * @library ../../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor Generator
* @compile -XprintRounds -processor Generator TestMissingInterface.java
* @run main TestMissingInterface
--- a/langtools/test/tools/javac/processing/model/element/TestNames.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestNames.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6380016
* @summary Test that the constraints guaranteed by the Filer and maintained
* @author Joseph D. Darcy
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestNames
* @compile -processor TestNames -proc:only TestNames.java
*/
--- a/langtools/test/tools/javac/processing/model/element/TestPackageElement.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestPackageElement.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6449798 6399404
* @summary Test basic workings of PackageElement
* @author Joseph D. Darcy
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestPackageElement
* @compile -processor TestPackageElement -proc:only TestPackageElement.java
*/
--- a/langtools/test/tools/javac/processing/model/element/TestResourceElement.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestResourceElement.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6967842
* @summary Element not returned from tree API for ARM resource variables.
* @author A. Sundararajan
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestResourceElement
* @compile -processor TestResourceElement -proc:only TestResourceElement.java
*/
--- a/langtools/test/tools/javac/processing/model/element/TestResourceVariable.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestResourceVariable.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6911256 6964740 6967842 6961571 7025809
* @summary Test that the resource variable kind is appropriately set
* @author Joseph D. Darcy
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestResourceVariable
* @compile -processor TestResourceVariable -proc:only TestResourceVariable.java
*/
--- a/langtools/test/tools/javac/processing/model/element/TestTypeParameter.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TestTypeParameter.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6505047
* @summary javax.lang.model.element.Element.getEnclosingElement() doesn't return null for type parameter
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestTypeParameter
* @compile -processor TestTypeParameter -proc:only TestTypeParameter.java
*/
--- a/langtools/test/tools/javac/processing/model/element/TypeParamBounds.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/element/TypeParamBounds.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6423972
* @summary Tests TypeParameter.getBounds.
* @author Scott Seligman
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TypeParamBounds
* @compile -processor TypeParamBounds -proc:only TypeParamBounds.java
*/
--- a/langtools/test/tools/javac/processing/model/type/MirroredTypeEx/OverEager.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/type/MirroredTypeEx/OverEager.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6362178
* @summary MirroredType[s]Exception shouldn't be created too eagerly
* @author Scott Seligman
- * @library ../../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile -g OverEager.java
* @compile -processor OverEager -proc:only OverEager.java
--- a/langtools/test/tools/javac/processing/model/type/MirroredTypeEx/Plurality.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/type/MirroredTypeEx/Plurality.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6519115
* @summary Verify MirroredTypeException vs MirroredTypesException is thrown
- * @library ../../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile Plurality.java
* @compile -processor Plurality -proc:only Plurality.java
--- a/langtools/test/tools/javac/processing/model/type/NoTypes.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/type/NoTypes.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6418666 6423973 6453386 7025809
* @summary Test the NoTypes: VOID, PACKAGE, NONE
* @author Scott Seligman
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile -g NoTypes.java
* @compile -processor NoTypes -proc:only NoTypes.java
--- a/langtools/test/tools/javac/processing/model/type/TestUnionType.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/type/TestUnionType.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 7029150 7025809
* @summary Test support for union types
- * @library ../../../lib
+ * @library /tools/javac/lib
*/
import java.net.URI;
--- a/langtools/test/tools/javac/processing/model/util/BinaryName.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/util/BinaryName.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6346251
* @summary Test Elements.getBinaryName
* @author Scott Seligman
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor BinaryName
* @compile -processor BinaryName -proc:only BinaryName.java
*/
--- a/langtools/test/tools/javac/processing/model/util/GetTypeElemBadArg.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/util/GetTypeElemBadArg.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6346506 6408241
* @summary getTypeElement should tolerate a type that can't be found
* @author Scott Seligman
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor GetTypeElemBadArg
* @compile -processor GetTypeElemBadArg -proc:only GetTypeElemBadArg.java
*/
--- a/langtools/test/tools/javac/processing/model/util/NoSupers.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/util/NoSupers.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6346453
* @summary directSupertypes should return empty list if arg has no supertypes
* @author Scott Seligman
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor NoSupers
* @compile -processor NoSupers -proc:only NoSupers.java
*/
--- a/langtools/test/tools/javac/processing/model/util/OverridesSpecEx.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/util/OverridesSpecEx.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6453386
* @summary Verify that example code in Elements.overrides works as spec'ed.
* @author Scott Seligman
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile -g OverridesSpecEx.java
* @compile -processor OverridesSpecEx -proc:only OverridesSpecEx.java
--- a/langtools/test/tools/javac/processing/model/util/TypesBadArg.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/util/TypesBadArg.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6345812
* @summary Validate argument kinds in Types utilities
* @author Scott Seligman
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TypesBadArg
* @compile -processor TypesBadArg -proc:only TypesBadArg.java
*/
--- a/langtools/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java Tue Jan 01 17:49:22 2013 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
* @bug 6392818
* @summary Tests Elements.isDeprecated(Element)
* @author Joseph D. Darcy
- * @library ../../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile TestDeprecation.java
* @compile -processor TestDeprecation -proc:only Dep1.java
--- a/langtools/test/tools/javac/processing/model/util/directSupersOfErr/DirectSupersOfErr.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/util/directSupersOfErr/DirectSupersOfErr.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6346973
* @summary directSupertypes(t) should not return t
* @author Scott Seligman
- * @library ../../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor DirectSupersOfErr
* @compile -processor DirectSupersOfErr -proc:only C1.java
*/
--- a/langtools/test/tools/javac/processing/model/util/elements/TestGetConstantExpression.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/util/elements/TestGetConstantExpression.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6471577 6517779
* @summary Test Elements.getConstantExpression
* @author Joseph D. Darcy
- * @library ../../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestGetConstantExpression
* @compile -processor TestGetConstantExpression Foo.java
*/
--- a/langtools/test/tools/javac/processing/model/util/elements/TestGetPackageOf.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/util/elements/TestGetPackageOf.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6453386
* @summary Test Elements.getPackageOf
* @author Joseph D. Darcy
- * @library ../../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestGetPackageOf
* @compile -processor TestGetPackageOf -proc:only TestGetPackageOf.java
*/
--- a/langtools/test/tools/javac/processing/model/util/filter/TestIterables.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/model/util/filter/TestIterables.java Tue Jan 01 17:49:22 2013 -0800
@@ -26,7 +26,7 @@
* @bug 6406164
* @summary Test that ElementFilter iterable methods behave properly.
* @author Joseph D. Darcy
- * @library ../../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile TestIterables.java
* @compile -processor TestIterables -proc:only Foo1.java
--- a/langtools/test/tools/javac/processing/options/testCommandLineClasses/Test.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/options/testCommandLineClasses/Test.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6930508
* @summary Passing nested class names on javac command line interfere with subsequent name -> class lookup
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor p.NestedExamples Test
* @run main Test
*/
--- a/langtools/test/tools/javac/processing/options/testPrintProcessorInfo/Test.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/options/testPrintProcessorInfo/Test.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6987384
* @summary -XprintProcessorRoundsInfo message printed with different timing than previous
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor Test
* @compile/fail/ref=Test.out -XDrawDiagnostics -XprintProcessorInfo -Werror -proc:only -processor Test Test.java
*/
--- a/langtools/test/tools/javac/processing/options/testPrintProcessorInfo/TestWithXstdout.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/options/testPrintProcessorInfo/TestWithXstdout.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6987384
* @summary -XprintProcessorRoundsInfo message printed with different timing than previous
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor Test TestWithXstdout
* @run main TestWithXstdout
*/
--- a/langtools/test/tools/javac/processing/warnings/UseImplicit/TestProcUseImplicitWarning.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/warnings/UseImplicit/TestProcUseImplicitWarning.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6986892
* @summary confusing warning given after errors in annotation processing
- * @library ../../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor TestProcUseImplicitWarning
* @clean C1 p.C2
* @compile/fail/ref=err.out -XDrawDiagnostics -processor TestProcUseImplicitWarning -Aerror C1.java
--- a/langtools/test/tools/javac/processing/werror/WError1.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/werror/WError1.java Tue Jan 01 17:49:22 2013 -0800
@@ -24,7 +24,7 @@
/*
* @test 6403456
* @summary -Werror should work with annotation processing
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile WError1.java
* @compile -proc:only -processor WError1 WError1.java
--- a/langtools/test/tools/javac/processing/werror/WErrorGen.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/werror/WErrorGen.java Tue Jan 01 17:49:22 2013 -0800
@@ -24,7 +24,7 @@
/*
* @test 6403456
* @summary -Werror should work with annotation processing
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile WErrorGen.java
* @compile -proc:only -processor WErrorGen WErrorGen.java
--- a/langtools/test/tools/javac/processing/werror/WErrorLast.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/processing/werror/WErrorLast.java Tue Jan 01 17:49:22 2013 -0800
@@ -24,7 +24,7 @@
/*
* @test 6403456
* @summary -Werror should work with annotation processing
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor
* @compile WErrorLast.java
* @compile -proc:only -processor WErrorLast WErrorLast.java
--- a/langtools/test/tools/javac/resolve/ResolveHarness.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/resolve/ResolveHarness.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 7098660
* @summary Write better overload resolution/inference tests
- * @library ../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor ResolveHarness
* @run main ResolveHarness
*/
--- a/langtools/test/tools/javac/util/T6597678.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/util/T6597678.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 6597678 6449184
* @summary Ensure Messages propogated between rounds
- * @library ../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor T6597678
* @run main T6597678
*/
--- a/langtools/test/tools/javac/util/context/T7021650.java Sat Dec 29 11:00:15 2012 +0000
+++ b/langtools/test/tools/javac/util/context/T7021650.java Tue Jan 01 17:49:22 2013 -0800
@@ -25,7 +25,7 @@
* @test
* @bug 7021650
* @summary Fix Context issues
- * @library ../../lib
+ * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor T7021650
* @run main T7021650
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/util/list/ListBufferTest.java Tue Jan 01 17:49:22 2013 -0800
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 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.
+ */
+
+/*
+ * @test
+ * @bug 8004504
+ * @summary Ensure that ListBuffer is working properly
+ */
+
+import com.sun.tools.javac.util.List;
+import com.sun.tools.javac.util.ListBuffer;
+import java.util.Iterator;
+import java.util.Objects;
+
+public class ListBufferTest {
+ public static void main(String... args) {
+ testRemove();
+ testCopiedEndsWithList_nil();
+ }
+
+ private static void testCopiedEndsWithList_nil() {
+ ListBuffer<String> lb = new ListBuffer<>();
+
+ lb.add("a");
+ lb.add("b");
+ lb.add("c");
+
+ List<String> l1 = lb.toList();
+
+ assertListEquals(l1, "a", "b", "c");
+ assertEndsWithNil(l1);
+
+ lb.add("d");
+
+ List<String> l2 = lb.toList();
+ assertListEquals(l2, "a", "b", "c", "d");
+ assertEndsWithNil(l2);
+ assertListEquals(l1, "a", "b", "c");
+ }
+
+ private static void testRemove() {
+ ListBuffer<String> lb1 = new ListBuffer<>();
+
+ lb1.add("a");
+ lb1.add("b");
+ lb1.add("c");
+
+ assertListEquals(lb1.toList(), "a", "b", "c");
+ assertEquals(lb1.next(), "a");
+ assertListEquals(lb1.toList(), "b", "c");
+ assertEquals(lb1.next(), "b");
+ assertListEquals(lb1.toList(), "c");
+ assertEquals(lb1.next(), "c");
+ assertListEquals(lb1.toList());
+ assertEquals(lb1.next(), null);
+
+ lb1.add("d");
+
+ assertEquals(lb1.next(), "d");
+ }
+
+ private static void assertEndsWithNil(List<?> list) {
+ while (!list.isEmpty()) {
+ list = list.tail;
+ }
+
+ if (list != List.nil()) throw new IllegalStateException("Not ending with List.nil()");
+ }
+
+ private static <T> void assertListEquals(Iterable<T> list, T... data) {
+ int i = 0;
+ Iterator<T> it = list.iterator();
+
+ while (it.hasNext() && i < data.length) {
+ assertEquals(it.next(), data[i++]);
+ }
+
+ if (it.hasNext()) {
+ throw new IllegalStateException("Too many elements in the list");
+ }
+
+ if (i < data.length) {
+ throw new IllegalStateException("Too few elements in the list");
+ }
+ }
+
+ private static void assertEquals(Object expected, Object actual) {
+ if (!Objects.equals(expected, actual)) {
+ throw new IllegalStateException("Incorrect content. Expected: " + expected + ", actual: " + actual);
+ }
+ }
+}